auth

package
v0.0.0-...-778c101 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: AGPL-3.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

Registry is the default authenticator/authorizer factory registry.

Functions

func DeleteCredentials

func DeleteCredentials(path string) (err error)

DeleteCredentials deletes credentials to a file or the system keyring. The path can be a file path, a "file:/path" URI or a "keyring:service/user" URI.

func WriteCredentials

func WriteCredentials(path string, cmap CredentialMap) (err error)

WriteCredentials writes credentials to a file or the system keyring. The path can be a file path, a "file:/path" URI or a "keyring:service/user" URI.

Types

type Auth

type Auth interface {
	Session(credentials CredentialMap) (Session, error)
}

Auth is the primary interface implemented by an authenticator/authorizer.

type CredentialMap

type CredentialMap map[string]interface{}

CredentialMap maps names to credentials.

func ReadCredentials

func ReadCredentials(path string) (cmap CredentialMap, err error)

ReadCredentials reads credentials from a file or the system keyring. The path can be a file path, a "file:/path" URI or a "keyring:service/user" URI.

func (CredentialMap) Get

func (self CredentialMap) Get(name string) string

Get gets a credential by name. It will convert the credential to a string using fmt.Sprint if required.

func (*CredentialMap) Set

func (self *CredentialMap) Set(s string) (err error)

Set implements flag.Value.Set.

func (*CredentialMap) String

func (self *CredentialMap) String() string

String implements flag.Value.String.

type Session

type Session interface {
	Credentials() CredentialMap
}

Session represents an authentication/authorization session.

type SessionDestroyer

type SessionDestroyer interface {
	Destroy()
}

SessionDestroyer destroys a session.

type SessionRefresher

type SessionRefresher interface {
	Refresh(force bool) error
}

SessionRefresher refreshes a session.

Jump to

Keyboard shortcuts

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