mirror of
https://github.com/go-micro/go-micro.git
synced 2025-12-05 21:56:14 +02:00
Implement new interface
This commit is contained in:
@@ -34,17 +34,22 @@ func (n *noop) Options() Options {
|
||||
}
|
||||
|
||||
// Generate a new account
|
||||
func (n *noop) Generate(id string, opts ...GenerateOption) (*Account, error) {
|
||||
func (n *noop) Generate(id, secret string, opts ...GenerateOption) (*Account, error) {
|
||||
options := NewGenerateOptions(opts...)
|
||||
|
||||
return &Account{
|
||||
ID: id,
|
||||
Roles: options.Roles,
|
||||
Metadata: options.Metadata,
|
||||
Secret: uuid.New().String(),
|
||||
ID: id,
|
||||
Roles: options.Roles,
|
||||
Metadata: options.Metadata,
|
||||
RefreshToken: uuid.New().String(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Login to an existing account
|
||||
func (n *noop) Login(id, secret string) (*Account, error) {
|
||||
return &Account{ID: id}, nil
|
||||
}
|
||||
|
||||
// Grant access to a resource
|
||||
func (n *noop) Grant(role string, res *Resource) error {
|
||||
return nil
|
||||
@@ -68,6 +73,6 @@ func (n *noop) Inspect(token string) (*Account, error) {
|
||||
}
|
||||
|
||||
// Token generation using an account id and secret
|
||||
func (n *noop) Token(id, secret string, opts ...TokenOption) (*Token, error) {
|
||||
func (n *noop) Token(id, tok string, opts ...TokenOption) (*Token, error) {
|
||||
return &Token{}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user