Help us shape the future of Go! Take the 2026 Go Developer Survey

auth

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

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

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 (s Session) GetBearerToken(ctx context.Context) (out http.BearerToken, err error)

func (Session) RefreshBearerToken

func (s Session) RefreshBearerToken(ctx context.Context, rejected http.BearerToken) (out http.BearerToken, err error)

type SettingSources

type SettingSources = setting.Sources

type StoreFunc added in v0.2.0

type StoreFunc func(context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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