auth

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizationMiddleware

func AuthorizationMiddleware(opts *options.Options, inner vk.HandlerFunc) vk.HandlerFunc

func ExtractAccessToken

func ExtractAccessToken(header http.Header) system.Credential

func NewAccessToken

func NewAccessToken(token string) system.Credential

Types

type AccessToken

type AccessToken struct {
	// contains filtered or unexported fields
}

func (AccessToken) Scheme

func (a AccessToken) Scheme() string

func (AccessToken) String

func (a AccessToken) String() string

func (AccessToken) Value

func (a AccessToken) Value() string

type AuthorizationCache

type AuthorizationCache struct {
	// contains filtered or unexported fields
}

AuthorizationCache caches authorization successful policy decisions for up to 10 minutes.

func NewAuthorizationCache

func NewAuthorizationCache(ttl time.Duration) *AuthorizationCache

NewAuthorizationCache creates a new AuthorizationCache

func (AuthorizationCache) Get

func (cache AuthorizationCache) Get(key string, newFunc func() (*TenantInfo, error)) (*TenantInfo, error)

Get fetches a cached result if present; otherwise it executes newFunc to obtain the result.

type AuthzClient

type AuthzClient struct {
	// contains filtered or unexported fields
}

func NewApiAuthClient

func NewApiAuthClient(opts *options.Options) *AuthzClient

func (*AuthzClient) Authorize

func (client *AuthzClient) Authorize(token system.Credential, identifier, namespace, name string) (*TenantInfo, error)

type TenantInfo

type TenantInfo struct {
	AuthorizedParty string `json:"authorized_party"`
	Organization    string `json:"organization"`
	Environment     string `json:"environment"`
	Tenant          string `json:"tenant"`
}

Jump to

Keyboard shortcuts

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