ScuttleBot

style: gofmt api key files

lmata 2026-04-05 14:19 trunk
Commit e6074da5483c324751b7e9808ba34e4ff3f3b8f217573ef63ac2ae9d07952933
--- internal/api/apikeys.go
+++ internal/api/apikeys.go
@@ -13,26 +13,26 @@
1313
Scopes []string `json:"scopes"`
1414
ExpiresIn string `json:"expires_in,omitempty"` // e.g. "720h" for 30 days, empty = never
1515
}
1616
1717
type createAPIKeyResponse struct {
18
- ID string `json:"id"`
19
- Name string `json:"name"`
20
- Token string `json:"token"` // plaintext, shown only once
18
+ ID string `json:"id"`
19
+ Name string `json:"name"`
20
+ Token string `json:"token"` // plaintext, shown only once
2121
Scopes []auth.Scope `json:"scopes"`
22
- CreatedAt time.Time `json:"created_at"`
23
- ExpiresAt *time.Time `json:"expires_at,omitempty"`
22
+ CreatedAt time.Time `json:"created_at"`
23
+ ExpiresAt *time.Time `json:"expires_at,omitempty"`
2424
}
2525
2626
type apiKeyListEntry struct {
27
- ID string `json:"id"`
28
- Name string `json:"name"`
27
+ ID string `json:"id"`
28
+ Name string `json:"name"`
2929
Scopes []auth.Scope `json:"scopes"`
30
- CreatedAt time.Time `json:"created_at"`
31
- LastUsed *time.Time `json:"last_used,omitempty"`
32
- ExpiresAt *time.Time `json:"expires_at,omitempty"`
33
- Active bool `json:"active"`
30
+ CreatedAt time.Time `json:"created_at"`
31
+ LastUsed *time.Time `json:"last_used,omitempty"`
32
+ ExpiresAt *time.Time `json:"expires_at,omitempty"`
33
+ Active bool `json:"active"`
3434
}
3535
3636
// handleListAPIKeys handles GET /v1/api-keys.
3737
func (s *Server) handleListAPIKeys(w http.ResponseWriter, r *http.Request) {
3838
keys := s.apiKeys.List()
3939
--- internal/api/apikeys.go
+++ internal/api/apikeys.go
@@ -13,26 +13,26 @@
13 Scopes []string `json:"scopes"`
14 ExpiresIn string `json:"expires_in,omitempty"` // e.g. "720h" for 30 days, empty = never
15 }
16
17 type createAPIKeyResponse struct {
18 ID string `json:"id"`
19 Name string `json:"name"`
20 Token string `json:"token"` // plaintext, shown only once
21 Scopes []auth.Scope `json:"scopes"`
22 CreatedAt time.Time `json:"created_at"`
23 ExpiresAt *time.Time `json:"expires_at,omitempty"`
24 }
25
26 type apiKeyListEntry struct {
27 ID string `json:"id"`
28 Name string `json:"name"`
29 Scopes []auth.Scope `json:"scopes"`
30 CreatedAt time.Time `json:"created_at"`
31 LastUsed *time.Time `json:"last_used,omitempty"`
32 ExpiresAt *time.Time `json:"expires_at,omitempty"`
33 Active bool `json:"active"`
34 }
35
36 // handleListAPIKeys handles GET /v1/api-keys.
37 func (s *Server) handleListAPIKeys(w http.ResponseWriter, r *http.Request) {
38 keys := s.apiKeys.List()
39
--- internal/api/apikeys.go
+++ internal/api/apikeys.go
@@ -13,26 +13,26 @@
13 Scopes []string `json:"scopes"`
14 ExpiresIn string `json:"expires_in,omitempty"` // e.g. "720h" for 30 days, empty = never
15 }
16
17 type createAPIKeyResponse struct {
18 ID string `json:"id"`
19 Name string `json:"name"`
20 Token string `json:"token"` // plaintext, shown only once
21 Scopes []auth.Scope `json:"scopes"`
22 CreatedAt time.Time `json:"created_at"`
23 ExpiresAt *time.Time `json:"expires_at,omitempty"`
24 }
25
26 type apiKeyListEntry struct {
27 ID string `json:"id"`
28 Name string `json:"name"`
29 Scopes []auth.Scope `json:"scopes"`
30 CreatedAt time.Time `json:"created_at"`
31 LastUsed *time.Time `json:"last_used,omitempty"`
32 ExpiresAt *time.Time `json:"expires_at,omitempty"`
33 Active bool `json:"active"`
34 }
35
36 // handleListAPIKeys handles GET /v1/api-keys.
37 func (s *Server) handleListAPIKeys(w http.ResponseWriter, r *http.Request) {
38 keys := s.apiKeys.List()
39
--- internal/auth/apikeys.go
+++ internal/auth/apikeys.go
@@ -37,11 +37,11 @@
3737
3838
// APIKey is a single API key record.
3939
type APIKey struct {
4040
ID string `json:"id"`
4141
Name string `json:"name"`
42
- Hash string `json:"hash"` // SHA-256 of the plaintext token
42
+ Hash string `json:"hash"` // SHA-256 of the plaintext token
4343
Scopes []Scope `json:"scopes"`
4444
CreatedAt time.Time `json:"created_at"`
4545
LastUsed time.Time `json:"last_used,omitempty"`
4646
ExpiresAt time.Time `json:"expires_at,omitempty"` // zero = never
4747
Active bool `json:"active"`
4848
--- internal/auth/apikeys.go
+++ internal/auth/apikeys.go
@@ -37,11 +37,11 @@
37
38 // APIKey is a single API key record.
39 type APIKey struct {
40 ID string `json:"id"`
41 Name string `json:"name"`
42 Hash string `json:"hash"` // SHA-256 of the plaintext token
43 Scopes []Scope `json:"scopes"`
44 CreatedAt time.Time `json:"created_at"`
45 LastUsed time.Time `json:"last_used,omitempty"`
46 ExpiresAt time.Time `json:"expires_at,omitempty"` // zero = never
47 Active bool `json:"active"`
48
--- internal/auth/apikeys.go
+++ internal/auth/apikeys.go
@@ -37,11 +37,11 @@
37
38 // APIKey is a single API key record.
39 type APIKey struct {
40 ID string `json:"id"`
41 Name string `json:"name"`
42 Hash string `json:"hash"` // SHA-256 of the plaintext token
43 Scopes []Scope `json:"scopes"`
44 CreatedAt time.Time `json:"created_at"`
45 LastUsed time.Time `json:"last_used,omitempty"`
46 ExpiresAt time.Time `json:"expires_at,omitempty"` // zero = never
47 Active bool `json:"active"`
48

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button