1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-24 22:26:54 +02:00

Add Namespace to Auth (#1438)

Co-authored-by: Ben Toogood <ben@micro.mu>
This commit is contained in:
ben-toogood
2020-03-30 09:51:37 +01:00
committed by GitHub
parent 3d7d5ce6b4
commit 4db2f5e79d
8 changed files with 120 additions and 64 deletions

View File

@ -40,13 +40,14 @@ func (b *Basic) Generate(subject string, opts ...token.GenerateOption) (*auth.To
// construct the token
token := auth.Token{
Subject: subject,
Type: b.String(),
Token: uuid.New().String(),
Created: time.Now(),
Expiry: time.Now().Add(options.Expiry),
Metadata: options.Metadata,
Roles: options.Roles,
Subject: subject,
Type: b.String(),
Token: uuid.New().String(),
Created: time.Now(),
Expiry: time.Now().Add(options.Expiry),
Metadata: options.Metadata,
Roles: options.Roles,
Namespace: options.Namespace,
}
// marshal the account to bytes