scope

package
v0.0.0-...-a423d60 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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

func Contains(ctx context.Context, scope string) (bool, error)

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

func LoadFromContext(ctx context.Context) ([]string, error)

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

func SaveToContext

func SaveToContext(ctx context.Context, scopes []string) context.Context

SaveToContext returns a child context of the provided context, including the provided scopes information

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

type ScopesGetter interface {
	GetRequiredScopes(scopesDefinition string) ([]string, error)
}

ScopesGetter missing godoc

type ScopesMismatchErrorProvider

type ScopesMismatchErrorProvider interface {
	Error([]string, []string) error
}

ScopesMismatchErrorProvider missing godoc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL