bertyauth

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0, MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthSessionCodeChallenge

func AuthSessionCodeChallenge(codeVerifier string) string

func AuthSessionCodeVerifierAndChallenge

func AuthSessionCodeVerifierAndChallenge() (string, string, error)

func HelperGenerateTokenIssuerSecrets

func HelperGenerateTokenIssuerSecrets(t *testing.T) ([]byte, ed25519.PublicKey, ed25519.PrivateKey)

func IssueRandomToken

func IssueRandomToken(issuer *AuthTokenIssuer, services map[string]string) (string, error)

Types

type AuthSession

type AuthSession struct {
	State        string
	CodeVerifier string // CodeVerifier base64 encoded random value
	BaseURL      string
}

func NewAuthSession

func NewAuthSession(baseURL string) (*AuthSession, string, error)

type AuthTokenIssuer

type AuthTokenIssuer struct {
	*AuthTokenVerifier
	// contains filtered or unexported fields
}

func NewAuthTokenIssuer

func NewAuthTokenIssuer(secret []byte, sk ed25519.PrivateKey) (*AuthTokenIssuer, error)

func (*AuthTokenIssuer) IssueCode

func (r *AuthTokenIssuer) IssueCode(codeChallenge string, services []string) (string, error)

func (*AuthTokenIssuer) IssueToken

func (r *AuthTokenIssuer) IssueToken(services []string) (string, error)

type AuthTokenOptions

type AuthTokenOptions struct {
	NoClick          bool
	Logger           *zap.Logger
	PrivacyPolicyURL string
}

type AuthTokenServer

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

func NewAuthTokenServer

func NewAuthTokenServer(secret []byte, sk ed25519.PrivateKey, services map[string]string, opts *AuthTokenOptions) (*AuthTokenServer, error)

func (*AuthTokenServer) IssueRandomTokenForServices

func (a *AuthTokenServer) IssueRandomTokenForServices() (string, error)

func (*AuthTokenServer) ServeHTTP

func (a *AuthTokenServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

type AuthTokenVerifier

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

func GetAuthTokenVerifier

func GetAuthTokenVerifier(secret, pk string) (*AuthTokenVerifier, error)

func NewAuthTokenVerifier

func NewAuthTokenVerifier(secret []byte, pk ed25519.PublicKey) (*AuthTokenVerifier, error)

func (*AuthTokenVerifier) GRPCAuthInterceptor

func (r *AuthTokenVerifier) GRPCAuthInterceptor(serviceID string) func(ctx context.Context) (context.Context, error)

func (*AuthTokenVerifier) VerifyCode

func (r *AuthTokenVerifier) VerifyCode(code, codeVerifier string) (*protocoltypes.ServicesTokenCode, error)

func (*AuthTokenVerifier) VerifyToken

func (r *AuthTokenVerifier) VerifyToken(token, serviceID string) (*protocoltypes.ServicesTokenCode, error)

Jump to

Keyboard shortcuts

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