Verify Options

This commit is contained in:
Ben Toogood
2020-05-20 16:49:52 +01:00
parent 5d14970a55
commit 344ce061ce
6 changed files with 35 additions and 15 deletions

View File

@@ -123,7 +123,7 @@ type GenerateOptions struct {
Metadata map[string]string
// Roles/scopes associated with the account
Roles []string
// Scopes the account hasaccess too
// Scopes the account has access too
Scopes []string
// Provider of the account, e.g. oauth
Provider string
@@ -233,3 +233,16 @@ func NewTokenOptions(opts ...TokenOption) TokenOptions {
return options
}
type VerifyOptions struct {
Scope string
}
type VerifyOption func(o *VerifyOptions)
// WithScope to require when verifying
func WithScope(s string) VerifyOption {
return func(o *VerifyOptions) {
o.Scope = s
}
}