This commit is contained in:
2026-07-25 14:51:48 -05:00
parent 1ea21c065e
commit 69cc236635
18 changed files with 770 additions and 106 deletions
+9
View File
@@ -48,6 +48,12 @@ type packageRecord struct {
Enabled bool
}
type actionRecord struct {
Slug string
DisplayName string
Enabled bool
}
type authorizationRecord struct {
ID uint64
CodeHint string
@@ -59,6 +65,7 @@ type authorizationRecord struct {
ExpiresAt time.Time
RevokedAt sql.NullTime
Packages string
Actions string
}
type auditRecord struct {
@@ -78,6 +85,7 @@ type pageData struct {
Authorizations []authorizationRecord
AuditEvents []auditRecord
Packages []packageRecord
Actions []actionRecord
NewCode string
DefaultHostLimit int
DefaultDuration string
@@ -161,6 +169,7 @@ func (s *Server) Routes() http.Handler {
mux.HandleFunc("POST /portal/authorizations", s.requireTechnician(s.handleCreateAuthorization))
mux.HandleFunc("POST /portal/authorizations/{id}/revoke", s.requireTechnician(s.handleRevokeAuthorization))
mux.HandleFunc("POST /portal/packages", s.requireTechnician(s.handleUpsertPackage))
mux.HandleFunc("POST /portal/packages/upload", s.requireTechnician(s.handleUploadPackage))
mux.HandleFunc("POST /api/v1/exchange", s.handleExchange)
mux.HandleFunc("GET /api/v1/packages/{slug}", s.handlePackageDownload)
mux.HandleFunc("GET /", s.handleHome)