Documentation ¶
Index ¶
- Constants
- func Contains(ctx context.Context, scope string) (bool, error)
- func LoadFromContext(ctx context.Context) ([]string, error)
- func NewDirective(getter ScopesGetter, errorProvider ScopesMismatchErrorProvider) *directive
- func SaveToContext(ctx context.Context, scopes []string) context.Context
- type HasScopesErrorProvider
- type SanitizeErrorProvider
- type ScopesGetter
- type ScopesMismatchErrorProvider
Constants ¶
View Source
const ScopesContextKey key = iota
ScopesContextKey is the key under which the scopes are saved in a given context.Context.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
Contains returns whether an input scope is present in the provided scopes in the context. It returns error if scopes cannot be found
func LoadFromContext ¶
LoadFromContext retrieves the scopes from the provided context. It returns error if they cannot be found
func NewDirective ¶
func NewDirective(getter ScopesGetter, errorProvider ScopesMismatchErrorProvider) *directive
NewDirective missing godoc
Types ¶
type HasScopesErrorProvider ¶
type HasScopesErrorProvider struct{}
HasScopesErrorProvider missing godoc
func (*HasScopesErrorProvider) Error ¶
func (s *HasScopesErrorProvider) Error(requiredScopes, actualScopes []string) error
Error missing godoc
type SanitizeErrorProvider ¶
type SanitizeErrorProvider struct{}
SanitizeErrorProvider missing godoc
func (*SanitizeErrorProvider) Error ¶
func (s *SanitizeErrorProvider) Error(_, _ []string) error
Error missing godoc
type ScopesGetter ¶
ScopesGetter missing godoc
type ScopesMismatchErrorProvider ¶
ScopesMismatchErrorProvider missing godoc
Click to show internal directories.
Click to hide internal directories.