Auth - Swap Refresh to Token and change secrets to be strings, not tokens (#1444)

* Refresh => Token

* Secret is no longer a token

Co-authored-by: Ben Toogood <ben@micro.mu>
This commit is contained in:
ben-toogood
2020-03-31 10:06:13 +01:00
committed by GitHub
parent c706ebe3fb
commit 76ade7efd9
7 changed files with 144 additions and 166 deletions

View File

@@ -41,7 +41,7 @@ func (n *noop) Generate(id string, opts ...GenerateOption) (*Account, error) {
ID: id,
Roles: options.Roles,
Metadata: options.Metadata,
Secret: &Token{},
Secret: uuid.New().String(),
}, nil
}
@@ -67,7 +67,7 @@ func (n *noop) Inspect(token string) (*Account, error) {
}, nil
}
// Refresh an account using a secret
func (n *noop) Refresh(secret string, opts ...RefreshOption) (*Token, error) {
// Token generation using an account id and secret
func (n *noop) Token(id, secret string, opts ...TokenOption) (*Token, error) {
return &Token{}, nil
}