Tidying up auth (#1410)

* Don't clear auth rules if request fails

* Add jitter to auth service loading rules

* Remove unused error from ContextWithToken result

Co-authored-by: Ben Toogood <ben@micro.mu>
This commit is contained in:
ben-toogood
2020-03-25 18:34:13 +00:00
committed by GitHub
parent 56af826230
commit 378d03eb66
2 changed files with 12 additions and 4 deletions

View File

@@ -130,6 +130,6 @@ func ContextWithAccount(ctx context.Context, account *Account) (context.Context,
}
// ContextWithToken sets the auth token in the context
func ContextWithToken(ctx context.Context, token string) (context.Context, error) {
return metadata.Set(ctx, "Authorization", fmt.Sprintf("%v%v", BearerScheme, token)), nil
func ContextWithToken(ctx context.Context, token string) context.Context {
return metadata.Set(ctx, "Authorization", fmt.Sprintf("%v%v", BearerScheme, token))
}