feat(api): add apikey support (#408)

* feat(api): add apikey support

* feat(web): api settings crud
This commit is contained in:
ze0s 2022-08-15 11:58:13 +02:00 committed by GitHub
parent 9c036033e9
commit fa20978d58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 834 additions and 70 deletions

19
internal/domain/api.go Normal file
View file

@ -0,0 +1,19 @@
package domain
import (
"context"
"time"
)
type APIRepo interface {
Store(ctx context.Context, key *APIKey) error
Delete(ctx context.Context, key string) error
GetKeys(ctx context.Context) ([]APIKey, error)
}
type APIKey struct {
Name string `json:"name"`
Key string `json:"key"`
Scopes []string `json:"scopes"`
CreatedAt time.Time `json:"created_at"`
}