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 ¶
func Login ¶ added in v0.2.0
func Login(ctx context.Context, withAuth credential.Name, opts ResolveSessionOptions) (Session, StoreFunc, error)
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
}
type Session ¶
type Session struct {
CurrentProfile *profile.Profile
Credential profile.CachedCredential
Client func() (client.Client, error)
MeshInfo func() (client.MeshInfo, 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.