Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ApiKeyClientIdSetting = setting.Setting[uuid.UUID]{ Env: "MESHSTACK_API_KEY", Short: func(envKey string) string { return fmt.Sprintf("The client id of a meshStack API key, which mints tokens together with its secret. Also read from %s.", envKey) }, Long: func(envKey string) string { return fmt.Sprintf("The client id of a meshStack API key, which mints tokens together with its secret, also read from `%s`.", envKey) }, Parse: setting.ParseTextUnmarshaler[uuid.UUID], }
View Source
var ApiKeyClientSecretSetting = setting.Setting[string]{ Env: "MESHSTACK_API_SECRET", Short: func(envKey string) string { return fmt.Sprintf("The client secret belonging to the API key. Also read from %s.", envKey) }, Long: func(envKey string) string { return fmt.Sprintf("The client secret belonging to the API key, also read from `%s`.", envKey) }, Parse: setting.ParseText[string], }
View Source
var ApiTokenSetting = setting.Setting[jwt.JWT]{ Env: "MESHSTACK_API_TOKEN", Short: func(envKey string) string { return fmt.Sprintf("A meshStack access token to send as it is. Also read from %s.", envKey) }, Long: func(envKey string) string { return fmt.Sprintf("A meshStack access token to send as it is, also read from `%s`.\n\n"+ "The token is minted elsewhere, so nothing renews it and nothing asks for a workspace: it "+ "already carries the one it was minted for. A building block runner's token is the usual "+ "one to bring here, to see what a run sees, and such a token may not be allowed to list "+ "workspaces at all.", envKey) }, Parse: setting.ParseTextUnmarshaler[jwt.JWT], }
Functions ¶
This section is empty.
Types ¶
type ResolveSessionOptions ¶
type ResolveSessionOptions struct {
SettingSources
// Version of the calling front end and GitHubRepo, as "<org>/<repo>", where its releases live.
// Both are required: together they are the User-Agent, and they name the release to check against.
Version string
GitHubRepo string
ForceAuthWith credential.Name
// CreateProfileIfMissing writes the profile this run names as a new one instead of failing
// on it. A login sets it, and no other command does: an unknown name is a typo there.
CreateProfileIfMissing bool
}
type Session ¶
type Session struct {
ConfigDir config.Directory
Credentials profile.Credentials
Credential credential.Credential
Endpoint xurl.URL
Client func() (client.Client, error)
Store func(ctx context.Context) error
// contains filtered or unexported fields
}
func ResolveSession ¶
func ResolveSession(ctx context.Context, opts ResolveSessionOptions) (Session, error)
func (Session) GetBearerToken ¶
func (Session) RefreshBearerToken ¶
func (s Session) RefreshBearerToken(ctx context.Context, rejected http.BearerToken) (out http.BearerToken, err error)
type SettingSources ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.