credential

package
v0.0.0-...-f94be1b Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, c Credential) context.Context

NewContext returns a new context carrying credential 'c'.

Types

type AuthCredential

type AuthCredential interface {
	Id() string
}

Auth credential is an interface to be implemented by credentials, i.e. user & permission

type Credential

type Credential int

Credential is a value stored in the context that identifies whether the request uses a user credential or permission credential.

const (
	User Credential = iota
	Permission
)

Credentials

func FromContext

func FromContext(ctx context.Context) (Credential, error)

FromContext retrieves credential type stored in the context against credential.CtxKey.

Jump to

Keyboard shortcuts

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