authn

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Unauthenticated         = status.Error(codes.Code(base.ErrorCode_ERROR_CODE_UNAUTHENTICATED), "unauthenticated")
	MissingBearerTokenError = status.Error(codes.Code(base.ErrorCode_ERROR_CODE_MISSING_BEARER_TOKEN), "missing bearer token")
)

Functions

This section is empty.

Types

type KeyAuthenticator

type KeyAuthenticator interface {
	Authenticate(ctx context.Context) error
}

KeyAuthenticator - Interface for key authenticator

type KeyAuthn

type KeyAuthn struct {
	Keys map[string]struct{}
}

KeyAuthn - Authentication Keys Structure

func NewKeyAuthn

func NewKeyAuthn(keys ...string) (*KeyAuthn, error)

NewKeyAuthn - Create New Authenticated Keys

func (*KeyAuthn) Authenticate

func (a *KeyAuthn) Authenticate(ctx context.Context) error

Authenticate - Checking whether any API request contain keys

Jump to

Keyboard shortcuts

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