Documentation
¶
Index ¶
Constants ¶
const ( // ApiKeyMethod mints a token from an API key id and secret. ApiKeyMethod = credential.ApiKeyName // ManualMethod sends an access token as it is. ManualMethod = credential.ManualName // OidcLoginMethod logs a person in through a browser, so it resolves only when asked for by name. OidcLoginMethod = credential.OidcLoginName )
Variables ¶
This section is empty.
Functions ¶
func ResolveClient ¶
ResolveClient resolves a session and builds its client in one call.
Types ¶
type Method ¶
type Method = credential.Name
Method names one way of authenticating, as [ResolveSessionOptions.ForceAuthWith] takes it.
type ResolveSessionOptions ¶
type ResolveSessionOptions = auth.ResolveSessionOptions
ResolveSessionOptions carries the setting sources, the calling front end and the credential to insist on.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is one resolved profile and credential, and builds an authorized client from them.
func ResolveSession ¶
func ResolveSession(ctx context.Context, opts ResolveSessionOptions) (result Session, err error)
ResolveSession resolves the profile, creating a default one when none exists. It checks no backend version, so prefer ResolveClient where the Session itself is not needed.
func (Session) Client ¶
Client builds the authorized client and checks the backend version, unless MESHSTACK_SKIP_VERSION_CHECK asks it not to. It is built once, from the context ResolveSession was given, so it takes none of its own.
func (Session) Status ¶
Status reads the backend's info and mints a bearer token, so that an unusable credential fails here. A Session.Store afterwards persists that token.