mirror of
https://github.com/idanoo/autobrr
synced 2025-07-22 16:29:12 +00:00
feat(api): add apikey support (#408)
* feat(api): add apikey support * feat(web): api settings crud
This commit is contained in:
parent
9c036033e9
commit
fa20978d58
31 changed files with 834 additions and 70 deletions
19
internal/domain/api.go
Normal file
19
internal/domain/api.go
Normal 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"`
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue