auth

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

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

An Authenticator is used to authenticate the rpc requests.

func NewAuthenticator

func NewAuthenticator(store *redis.Redis, key string, strict bool) (*Authenticator, error)

NewAuthenticator returns an Authenticator.

func (*Authenticator) Authenticate

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

Authenticate authenticates the given ctx.

type Credential

type Credential struct {
	App   string
	Token string
}

A Credential is used to authenticate.

func ParseCredential

func ParseCredential(ctx context.Context) Credential

ParseCredential parses credential from given ctx.

func (*Credential) GetRequestMetadata

func (c *Credential) GetRequestMetadata(context.Context, ...string) (map[string]string, error)

GetRequestMetadata gets the request metadata.

func (*Credential) RequireTransportSecurity

func (c *Credential) RequireTransportSecurity() bool

RequireTransportSecurity always returns false.

Jump to

Keyboard shortcuts

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