authn

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 16

Documentation

Index

Constants

View Source
const (
	TimeFormatToken4 = "2006-01-02 15:04:05 MST"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeyAuthenticator

type APIKeyAuthenticator struct {
	Authenticate func(loginPair LoginPair) ([]byte, error)
	LoginPair
}

func (*APIKeyAuthenticator) NeedsTokenRefresh

func (a *APIKeyAuthenticator) NeedsTokenRefresh() bool

func (*APIKeyAuthenticator) RefreshToken

func (a *APIKeyAuthenticator) RefreshToken() ([]byte, error)

type AuthnToken

type AuthnToken struct {
	Protected string `json:"protected"`
	Payload   string `json:"payload"`
	Signature string `json:"signature"`
	// contains filtered or unexported fields
}

Sample token {"protected":"eyJhbGciOiJjb25qdXIub3JnL3Nsb3NpbG8vdjIiLCJraWQiOiI5M2VjNTEwODRmZTM3Zjc3M2I1ODhlNTYyYWVjZGMxMSJ9","payload":"eyJzdWIiOiJhZG1pbiIsImlhdCI6MTUxMDc1MzI1OX0=","signature":"raCufKOf7sKzciZInQTphu1mBbLhAdIJM72ChLB4m5wKWxFnNz_7LawQ9iYEI_we1-tdZtTXoopn_T1qoTplR9_Bo3KkpI5Hj3DB7SmBpR3CSRTnnEwkJ0_aJ8bql5Cbst4i4rSftyEmUqX-FDOqJdAztdi9BUJyLfbeKTW9OGg-QJQzPX1ucB7IpvTFCEjMoO8KUxZpbHj-KpwqAMZRooG4ULBkxp5nSfs-LN27JupU58oRgIfaWASaDmA98O2x6o88MFpxK_M0FeFGuDKewNGrRc8lCOtTQ9cULA080M5CSnruCqu1Qd52r72KIOAfyzNIiBCLTkblz2fZyEkdSKQmZ8J3AakxQE2jyHmMT-eXjfsEIzEt-IRPJIirI3Qm"} https://www.conjur.org/reference/cryptography.html

func NewToken

func NewToken(data []byte) (token *AuthnToken, err error)

func (*AuthnToken) FromJSON

func (t *AuthnToken) FromJSON(data []byte) (err error)

func (*AuthnToken) Raw

func (t *AuthnToken) Raw() []byte

func (*AuthnToken) ShouldRefresh

func (t *AuthnToken) ShouldRefresh() bool

type LoginPair

type LoginPair struct {
	Login  string
	APIKey string
}

type OidcAuthenticator added in v0.11.0

type OidcAuthenticator struct {
	Code         string
	Nonce        string
	CodeVerifier string
	Authenticate func(code, noce, code_verifier string) ([]byte, error)
}

func (*OidcAuthenticator) NeedsTokenRefresh added in v0.11.0

func (a *OidcAuthenticator) NeedsTokenRefresh() bool

func (*OidcAuthenticator) RefreshToken added in v0.11.0

func (a *OidcAuthenticator) RefreshToken() ([]byte, error)

type TokenAuthenticator

type TokenAuthenticator struct {
	Token string `env:"CONJUR_AUTHN_TOKEN"`
}

func (*TokenAuthenticator) NeedsTokenRefresh

func (a *TokenAuthenticator) NeedsTokenRefresh() bool

func (*TokenAuthenticator) RefreshToken

func (a *TokenAuthenticator) RefreshToken() ([]byte, error)

type TokenFileAuthenticator

type TokenFileAuthenticator struct {
	TokenFile string `env:"CONJUR_AUTHN_TOKEN_FILE"`

	MaxWaitTime time.Duration
	// contains filtered or unexported fields
}

func (*TokenFileAuthenticator) NeedsTokenRefresh

func (a *TokenFileAuthenticator) NeedsTokenRefresh() bool

func (*TokenFileAuthenticator) RefreshToken

func (a *TokenFileAuthenticator) RefreshToken() ([]byte, error)

TODO: is this implementation concurrent ?

Jump to

Keyboard shortcuts

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