Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AccessLevels = []AccessLevel{AccessFull, AccessWrite, AccessRead}
AccessLevels is the order the login page offers them in.
var EndpointSetting = setting.Setting[xurl.URL]{ Env: "MESHSTACK_ENDPOINT", Short: func(envKey string) string { return fmt.Sprintf("The meshStack API to act against, such as https://api.example.meshcloud.io. Also read from %s.", envKey) }, Long: func(envKey string) string { return fmt.Sprintf("The meshStack API to act against, such as `https://api.example.meshcloud.io`, "+ "also read from `%s` and inferred from current profile if possible.", envKey) }, Parse: setting.ParseTextUnmarshaler[xurl.URL], }
var SkipVersionCheckSetting = setting.Setting[bool]{ Env: "MESHSTACK_SKIP_VERSION_CHECK", Short: func(envKey string) string { return fmt.Sprintf("Skip version check against meshStack backend. Also read from %s.", envKey) }, Parse: setting.ParseBool, Default: setting.StaticDefault("0"), }
SkipVersionCheckSetting skips both the minimum backend version check and the check for a newer release of the front end itself.
Functions ¶
func SetWorkspacesInContext ¶
func SetWorkspacesInContext(ctx context.Context, workspacesFunc WorkspacesFunc) context.Context
Types ¶
type AccessLevel ¶ added in v0.3.0
type AccessLevel string
AccessLevel limits a browser login to a subset of the user's rights.
const ( AccessFull AccessLevel = "full" AccessWrite AccessLevel = "write" AccessRead AccessLevel = "read" )
func AccessLevelOf ¶ added in v0.3.0
func AccessLevelOf(scopes scope.Scopes) (AccessLevel, bool)
func ParseAccessLevel ¶ added in v0.3.0
func ParseAccessLevel(value string) (AccessLevel, bool)
func (AccessLevel) Detail ¶ added in v0.3.0
func (l AccessLevel) Detail() string
func (AccessLevel) Label ¶ added in v0.3.0
func (l AccessLevel) Label() string
func (AccessLevel) Scope ¶ added in v0.3.0
func (l AccessLevel) Scope() scope.Scope
Scope must match the client scopes that CliClientBootstrapService in ../meshfed-release creates.
type MeshWorkspace ¶
type MeshWorkspace struct {
client.MeshWorkspace
IsAdmin bool
}
MeshWorkspace is a workspace to select from, where a Workspace only names one.
func (MeshWorkspace) Label ¶ added in v0.3.0
func (w MeshWorkspace) Label() string
func (MeshWorkspace) Matches ¶
func (w MeshWorkspace) Matches(other MeshWorkspace) bool
func (MeshWorkspace) Name ¶
func (w MeshWorkspace) Name() Workspace
func (MeshWorkspace) String ¶
func (w MeshWorkspace) String() string
type NoRoleInWorkspaceError ¶ added in v0.3.0
NoRoleInWorkspaceError is what a login gets that asks for a token for a workspace in which it has no role. The issuer then mints a token for no workspace.
func (NoRoleInWorkspaceError) Error ¶ added in v0.3.0
func (e NoRoleInWorkspaceError) Error() string
type NoWorkspaceToWorkInError ¶ added in v0.3.0
type NoWorkspaceToWorkInError struct {
// MayNotList is set where meshStack refused the list, rather than answering an empty one.
MayNotList bool
}
NoWorkspaceToWorkInError is what a login gets whose workspace list holds nothing to choose from.
func (NoWorkspaceToWorkInError) Error ¶ added in v0.3.0
func (e NoWorkspaceToWorkInError) Error() string
type Workspace ¶
type Workspace string
Workspace identifies a workspace as meshPanel shows it.
const NoWorkspace Workspace = ""
NoWorkspace means that no workspace is known, or that the authentication is unscoped. It is the zero value, so `omitzero` leaves it out of a stored profile.
type WorkspaceNotNamedError ¶ added in v0.6.0
type WorkspaceNotNamedError struct {
Resolution error
}
func (WorkspaceNotNamedError) Error ¶ added in v0.6.0
func (e WorkspaceNotNamedError) Error() string
func (WorkspaceNotNamedError) Unwrap ¶ added in v0.6.0
func (e WorkspaceNotNamedError) Unwrap() error
type Workspaces ¶
type Workspaces struct {
Items []client.MeshWorkspace
// AdminWorkspace is the workspace of meshPanel's admin area. The listed workspaces do not
// mark it, so it comes from client.MeshInfo.AdminWorkspaceIdentifier.
AdminWorkspace Workspace
ProfileDefaultWorkspace Workspace
}
func WorkspacesFromContext ¶
func WorkspacesFromContext(ctx context.Context) (Workspaces, error)
func (Workspaces) All ¶
func (ws Workspaces) All() iter.Seq2[int, MeshWorkspace]
func (Workspaces) ProfileDefault ¶
func (ws Workspaces) ProfileDefault(ctx context.Context) (r *MeshWorkspace)
type WorkspacesFunc ¶
type WorkspacesFunc func() (Workspaces, error)