controlpanel

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 48 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package controlpanel owns administrator credentials and project access policy. It never observes or starts local harness processes.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSetupCode     = errors.New("invalid setup code")
	ErrAlreadySetup  = errors.New("administrator is already configured")
	ErrForbidden     = errors.New("permission denied")
	ErrInvalid       = errors.New("invalid configuration")
	ErrStorage       = errors.New("control panel storage unavailable")
	ErrDataDirLocked = errors.Join(ErrStorage, errors.New("data directory locked"))
)
View Source
var ErrNicknameReservedBound = fmt.Errorf("previously connected credential: %w", ErrNicknameTaken)
View Source
var ErrNicknameReservedUnbound = fmt.Errorf("unused credential: %w", ErrNicknameTaken)
View Source
var ErrNicknameTaken = errors.New("nickname already reserved")
View Source
var ErrTokenCap = errors.New("project active token limit reached (256); revoke unused tokens or detach old sessions before issuing or approving another token")

Functions

func AccessMetadata added in v1.2.0

func AccessMetadata(r *http.Request, scheme, address []netip.Prefix, forwarded bool) accesslog.Metadata

AccessMetadata reuses the scheme decision without expanding authentication trust.

func AccessRoute added in v1.1.1

func AccessRoute(r *http.Request) string

AccessRoute returns only registered templates, never the original variable path.

func New

func New(store *Store, backend Backend, next http.Handler, version ...string) http.Handler

func NewWithTrustedProxies

func NewWithTrustedProxies(store *Store, backend Backend, next http.Handler, proxies []netip.Prefix, version ...string) http.Handler

Types

type AnnouncementResult

type AnnouncementResult struct {
	Project, SessionID, Name, Error string
	Accepted                        bool
}

AnnouncementResult reports queue acceptance, never model receipt. Error is a machine code; the panel translates it.

func (AnnouncementResult) ErrorMessage added in v1.1.0

func (r AnnouncementResult) ErrorMessage() i18n.Message

ErrorMessage is the failure in the page's language; an unknown code reads as not accepted.

type AuditEvent

type AuditEvent struct {
	TokenScopes         *TokenScopeAudit          `json:"tokenScopes,omitempty"`
	ProjectGenerationID string                    `json:"projectGenerationId,omitempty"`
	Handover            *protocol.HandoverAudit   `json:"handover,omitempty"`
	Management          *protocol.ManagementEvent `json:"management,omitempty"`
	Version             int                       `json:"version"`
	Project             string                    `json:"project"`
	ParentID            string                    `json:"parentID"`
	GrantID             string                    `json:"grantID,omitempty"`
	Binding             string                    `json:"binding"` // one-way internal reference, never the raw identity
	OwnerID             string                    `json:"ownerID"`
	Kind                string                    `json:"kind"`
	Reason              string                    `json:"reason"`
	At                  time.Time                 `json:"at"`
}

type AuditFilter

type AuditFilter struct{ Bucket string }

type AutoBinding

type AutoBinding struct {
	HandoverSource  string    `json:"handoverSource,omitempty"`
	DetachPending   bool      `json:"detachPending,omitempty"`
	OwnerID         string    `json:"ownerID"`
	PendingRevision uint64    `json:"pendingRevision,omitempty"`
	ParentID        string    `json:"parentID"`
	Identity        string    `json:"identity"`
	GrantID         string    `json:"grantID"`
	RegistrationID  string    `json:"registrationID,omitempty"`
	State           string    `json:"state"`
	ExpiresAt       time.Time `json:"expiresAt"`
	// Proof is server-verified, not a client assertion. No secret is stored.
	ExpectedID       string `json:"expectedID,omitempty"`
	ExpectedOwner    string `json:"expectedOwner,omitempty"`
	ExpectedRevision uint64 `json:"expectedRevision,omitempty"`
}

type AutoExchange

type AutoExchange struct {
	ParentID      string    `json:"parentID"`
	RequestID     string    `json:"requestID"`
	Identity      string    `json:"identity"`
	RequestedName string    `json:"requestedName,omitempty"`
	GrantID       string    `json:"grantID"`
	ExpiresAt     time.Time `json:"expiresAt"`
}

type Backend

type Backend interface {
	Sessions(context.Context, string) ([]Session, error)
	Detach(context.Context, string, string) error
}

type DeviceAuthorization

type DeviceAuthorization struct {
	ScopeVersion int           `json:"scopeVersion,omitempty"`
	Scopes       []string      `json:"scopes,omitempty"`
	Request      DeviceRequest `json:"request"`
	TokenID      string        `json:"tokenID"`
	CodeHash     string        `json:"codeHash"`
	UserHash     string        `json:"userHash"`
	ExpiresAt    time.Time     `json:"expiresAt"`
	CreatedAt    time.Time     `json:"createdAt"`
	Status       string        `json:"status"`
	GrantID      string        `json:"grantID,omitempty"`
	ApprovedBy   string        `json:"approvedBy,omitempty"`
}

type DeviceRequest

type DeviceRequest struct {
	CWDBasename string `json:"-"`
	ClientID    string `json:"clientID"`
	Harness     string `json:"harness"`
	SessionID   string `json:"sessionID"`
	InstanceID  string `json:"instanceID"`
	RequestID   string `json:"requestID"`
}

type DeviceResponse

type DeviceResponse struct {
	VerificationURIComplete string `json:"verification_uri_complete"`
	DeviceCode              string `json:"device_code"`
	UserCode                string `json:"user_code"`
	VerificationURI         string `json:"verification_uri"`
	ExpiresIn               int    `json:"expires_in"`
	Interval                int    `json:"interval"`
}

type DeviceTokenResponse

type DeviceTokenResponse struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	ExpiresIn   int    `json:"expires_in"`
	GrantID     string `json:"session_grant_id"`
	Nickname    string `json:"nickname"`
}

type DeviceView

type DeviceView struct {
	Project, OwnerID, Harness, InstanceID, SessionID, Status, Nickname string
	ClientID, CWDBasename                                              string
	CreatedAt, ExpiresAt                                               time.Time
}

func (DeviceView) ShortSessionID

func (v DeviceView) ShortSessionID() string

ShortSessionID keeps the review readable; the full value remains in title.

type DirectProof

type DirectProof struct {
	HandoverFrom                                    *protocol.HandoverFrom
	PreviousIdentity                                string
	Absent                                          bool
	RegistrationID, OwnerID, Name, AdmissionGrantID string
	Revision                                        uint64
	Names                                           []string
}

type DirectRequest

type DirectRequest struct {
	Holder          *protocol.ReceiverHolder
	HolderProof     *protocol.HolderProof
	Handover        bool
	PID             int
	CWD, ProcessKey string
	DeviceRequest
	RequestedNickname string
	RegistrationID    string
	ResumeSecret      string // transient proof only; never persisted or logged
}

type DirectResponse

type DirectResponse struct {
	HandoverFrom *protocol.HandoverFrom `json:"handover_from,omitempty"`
	DeviceTokenResponse
	Scopes         []string `json:"scopes"`
	AdmissionMode  string   `json:"admission_mode"`
	RegistrationID string   `json:"registration_id,omitempty"`
	Revision       uint64   `json:"revision,omitempty"`
}

type PendingRebind

type PendingRebind struct {
	Project string
	Journal protocol.RebindJournal
}

type Project

type Project struct {
	ProjectGenerationID string                   `json:"projectGenerationId,omitempty"`
	Rebinds             []protocol.RebindJournal `json:"rebinds,omitempty"`

	AutoBindings  []AutoBinding  `json:"autoBindings,omitempty"`
	AutoExchanges []AutoExchange `json:"autoExchanges,omitempty"`
	// AllowHTTP is the 0.7.0 per-project opt-in, kept only so older state
	// decodes; the live policy is state.AllowHTTP.
	AllowHTTP bool                  `json:"allowHTTP,omitempty"`
	Devices   []DeviceAuthorization `json:"devices,omitempty"`
	Deleting  bool                  `json:"deleting,omitempty"`
	Members   map[string]string     `json:"members"`
	Name      string                `json:"name"`
	Mode      string                `json:"mode"`
	Enabled   bool                  `json:"enabled"`
	Tokens    []SessionToken        `json:"tokens,omitempty"`
	UpdatedAt time.Time             `json:"updatedAt"`
}

type ProjectTokenOptions

type ProjectTokenOptions struct {
	Scopes                []string
	MaxAutoBindings       int
	AutoLifetimeDays      int
	UnlimitedAutoBindings bool
	UnlimitedAutoLifetime bool
}

ProjectTokenOptions is copied and validated before an immutable issuance snapshot is committed. Nil Scopes preserves the historical LEGACY_V1 default; an explicit empty set is invalid. Limits apply only to auto admission.

type ScopeIssuanceChange

type ScopeIssuanceChange struct {
	Actor string     `json:"actor"`
	At    time.Time  `json:"at"`
	Old   policyBool `json:"old"`
	New   policyBool `json:"new"`
}

func (*ScopeIssuanceChange) UnmarshalJSON

func (e *ScopeIssuanceChange) UnmarshalJSON(raw []byte) error

type Session

type Session struct {
	OwnerID         string // Server-recorded registration owner; never supplied by a panel request.
	RuntimeInfo     *protocol.RuntimeInfoSnapshot
	Activity        *protocol.ActivitySnapshot
	RegistrationID  string
	GrantID         string
	GrantOwner      string
	PendingNickname string
	ID              string
	SessionID       string
	Name            string
	Status          string
	Harness         string
	PID             int
	Ready           bool
	ClientID        string
	LastSeen        string
	ProbePending    bool
	Suspended       bool
	ErrorCode       string
}

Session is a presentation DTO; the panel has no harness/runtime dependency.

func (Session) ActivityTooltip

func (s Session) ActivityTooltip(language string) []string

func (Session) ActivityTooltipTimes

func (s Session) ActivityTooltipTimes(language string) []activityTooltipTime

func (Session) ActivityView

func (s Session) ActivityView(language string) activityView

ActivityView is the activity in the page's language; the API passes English.

func (Session) ConnectionLabel

func (s Session) ConnectionLabel() i18n.Message

func (Session) DisplayState

func (s Session) DisplayState() string

DisplayState is the one rule the session badge and the summary share (PM decision): a detached registration is history, an administrator's suspension comes next, a ready session can receive even if it reports an error code, an error code without readiness cannot be confirmed, and the rest is still waiting. ProbePending only adds a note; the protocol Status and StateReason stay visible beside the badge.

func (Session) RowKey

func (s Session) RowKey() string

func (Session) RowShape

func (s Session) RowShape(canManage bool, owner string) string

A shape change needs a full reload: it must never silently replace identity, ownership or management controls under an open confirmation dialog.

func (Session) RuntimeInfoView

func (s Session) RuntimeInfoView(language string) runtimeInfoView

func (Session) StateReason

func (s Session) StateReason() i18n.Message

StateReason explains the runtime observation without changing its protocol status.

type SessionToken

type SessionToken struct {
	AdmissionMode   string   `json:"admissionMode,omitempty"`
	IssuedBy        string   `json:"issuedBy,omitempty"`
	MaxAutoBindings int      `json:"maxAutoBindings,omitempty"`
	ScopeVersion    int      `json:"scopeVersion,omitempty"`
	Scopes          []string `json:"scopes,omitempty"`
	Kind            string   `json:"kind,omitempty"`
	Label           string   `json:"label,omitempty"`
	// Approvals and LastRegisteredAt keep a project token's history even after
	// its session grants are revoked or expire and are swept away.
	Approvals        int       `json:"approvals,omitempty"`
	LastRegisteredAt time.Time `json:"lastRegisteredAt,omitempty"`
	ParentID         string    `json:"parentID,omitempty"`
	ExpiresAt        time.Time `json:"expiresAt,omitempty"`
	FirstUsedAt      time.Time `json:"firstUsedAt,omitempty"`
	LastUsedAt       time.Time `json:"lastUsedAt,omitempty"`
	OwnerID          string    `json:"ownerID"`
	IssuedAt         time.Time `json:"issuedAt"`
	FirstConnectedAt time.Time `json:"firstConnectedAt,omitempty"`
	ID               string    `json:"id"`
	Nickname         string    `json:"nickname"`
	PendingNickname  string    `json:"pendingNickname,omitempty"`
	TokenHash        string    `json:"tokenHash,omitempty"`
	BoundIdentity    string    `json:"boundIdentity,omitempty"`
	Revoked          bool      `json:"revoked"`
	RevokedAt        time.Time `json:"revokedAt,omitempty"`
	ExpiredAt        time.Time `json:"expiredAt,omitempty"`
}

SessionToken reserves a nickname until revoked or its unused lifetime ends.

type Store

type Store struct {
	// contains filtered or unexported fields
}

func OpenSQLite

func OpenSQLite(directory string) (*Store, error)

OpenSQLite is the production control store. Legacy JSON is imported once without rewriting it; all subsequent mutations are SQLite transactions.

func (*Store) AdminAPIEnabled

func (s *Store) AdminAPIEnabled() bool

func (*Store) AllowHTTP

func (s *Store) AllowHTTP(project string) bool

AllowHTTP reports whether a currently usable project has opted clients into sending credentials over HTTP. It deliberately fails closed.

func (*Store) AllowsUnauthenticated

func (s *Store) AllowsUnauthenticated() bool

AllowsUnauthenticated remains for callers compiled against the old store API. Project access always requires a session token.

func (*Store) ApproveDeviceAuthorization

func (s *Store) ApproveDeviceAuthorization(actor, code, nickname string, deny bool) (DeviceView, error)

func (*Store) AttachmentsEnabled

func (s *Store) AttachmentsEnabled() bool

func (*Store) Authenticate

func (s *Store) Authenticate(password string) bool

func (*Store) AuthenticateUser

func (s *Store) AuthenticateUser(username, password string) (User, bool)

func (*Store) Authorize

func (s *Store) Authorize(project, token string) bool

func (*Store) BeginDeviceAuthorization

func (s *Store) BeginDeviceAuthorization(project, raw string, r DeviceRequest) (DeviceResponse, error)

func (*Store) BugReportPolicy

func (s *Store) BugReportPolicy(actor string) (map[string]string, func(), error)

BugReportPolicy acquires control before report locks. The caller MUST hold release through the complete report operation, including its SQLite commit. Empty actor is reserved for server-owned current-only operations; historical readers must supply an active instance administrator.

func (*Store) CanManageSession

func (s *Store) CanManageSession(actor, project, identity string, recordedOwner ...string) bool

func (*Store) CanReleaseReservedGrant

func (s *Store) CanReleaseReservedGrant(actor, project, id string) bool

CanReleaseReservedGrant uses the same owner/role rule as the locked POST path.

func (*Store) ChangeOwnPassword

func (s *Store) ChangeOwnPassword(actor, currentPassword, newPassword, confirmation string) error

ChangeOwnPassword verifies the current credential and publishes the new hash and login revision under one lock, including the fixed admin's legacy hash.

func (*Store) CleanupDetachedAutoBatch

func (s *Store) CleanupDetachedAutoBatch(project, generation string, proofs []access.DetachedRemovalProof) error

Later proofs observe earlier mutations; policy and audit are committed together.

func (*Store) Close

func (s *Store) Close() error

func (*Store) CreateProject

func (s *Store) CreateProject(name string) error

func (*Store) CreateProjectFor

func (s *Store) CreateProjectFor(actor, name string) error

func (*Store) CreateUser

func (s *Store) CreateUser(actor, username, password, role string) error

func (*Store) DeviceAuthorizationFor

func (s *Store) DeviceAuthorizationFor(actor, code string) (DeviceView, error)

func (*Store) DirectAuditFor

func (s *Store) DirectAuditFor(actor, project string) ([]AuditEvent, error)

Audit is not bearer-readable and preserves the existing panel role boundary.

func (*Store) DirectAuditRecordsFor

func (s *Store) DirectAuditRecordsFor(actor, project string, filter AuditFilter) ([]AuditEvent, error)

DirectAuditRecordsFor exposes history only to instance administrators. project="" selects all projects for an administrator; ordinary readers must identify a current project and retain the Owner/Developer restrictions.

func (*Store) EditTokenScopesFor

func (s *Store) EditTokenScopesFor(actor, project, id string, scopes, version []string) (TokenScopeEdit, error)

func (*Store) ExchangeDeviceToken

func (s *Store) ExchangeDeviceToken(project, raw, code, clientID string, plaintext bool) (DeviceTokenResponse, error)

func (*Store) ExchangeDirect

func (s *Store) ExchangeDirect(project, raw string, r DirectRequest, proof DirectProof, source string, plaintext bool) (DirectResponse, error)

func (*Store) ImportProjects

func (s *Store) ImportProjects(names []string) error

ImportProjects adds legacy project directories without changing existing policy. Validation and persistence are atomic; an error never publishes a partial set.

func (*Store) InstanceHTTPPolicy

func (s *Store) InstanceHTTPPolicy() bool

InstanceHTTPPolicy reports the instance-wide HTTP opt-in for the admin UI.

func (*Store) IssueOwnUserToken

func (s *Store) IssueOwnUserToken(actor string, revision uint64, label string, seconds int64, scopes []string, principalKey string, plaintext bool, admit ...func() bool) (string, UserTokenView, error)

IssueOwnUserToken binds panel issuance to the authenticated session revision.

func (*Store) IssueProjectTokenFor

func (s *Store) IssueProjectTokenFor(actor, project, label string) (string, error)

func (*Store) IssueProjectTokenWithOptionsFor

func (s *Store) IssueProjectTokenWithOptionsFor(actor, project, label string, options ProjectTokenOptions) (string, error)

func (*Store) IssueToken

func (s *Store) IssueToken(project, nickname string) (string, error)

func (*Store) IssueTokenFor

func (s *Store) IssueTokenFor(actor, project, nickname, ownerID string) (string, error)

func (*Store) ListOwnUserTokens

func (s *Store) ListOwnUserTokens(actor string) ([]UserTokenView, error)

func (*Store) PendingRebinds

func (s *Store) PendingRebinds() []PendingRebind

func (*Store) PreviewTokenScopesFor

func (s *Store) PreviewTokenScopesFor(actor, project, id string, scopes, version []string) (TokenScopeEdit, error)

func (*Store) ProjectGeneration

func (s *Store) ProjectGeneration(project string) string

ProjectGeneration returns server-owned identity, including during deletion.

func (*Store) ProjectRole

func (s *Store) ProjectRole(actor, project string) string

func (*Store) Projects

func (s *Store) Projects() []Project

func (*Store) ProjectsFor

func (s *Store) ProjectsFor(actor string) []Project

func (*Store) Ready

func (s *Store) Ready() bool

func (*Store) RecordSessionManagement

func (s *Store) RecordSessionManagement(project, actor string, event protocol.ManagementEvent, expectedGeneration ...string) error

func (*Store) RecoverRebind

func (s *Store) RecoverRebind(project string, j protocol.RebindJournal, result protocol.RebindResult, applied bool) error

RecoverRebind is used before serving requests. No raw credential is needed; the runtime supplies proof read from the registration named by the journal.

func (*Store) RegistrationOwnerBindings

func (s *Store) RegistrationOwnerBindings() map[string]map[string]string

RegistrationOwnerBindings takes a read-only snapshot before retention cleanup for startup migration. Values are server grant owner IDs, including revoked grants.

func (*Store) ReleaseDirectRegistration

func (s *Store) ReleaseDirectRegistration(project, identity string) error

func (*Store) RevokeOwnUserToken

func (s *Store) RevokeOwnUserToken(actor, id string) error

func (*Store) RevokeOwnUserTokens

func (s *Store) RevokeOwnUserTokens(actor string) error

func (*Store) RevokeSessionTokens

func (s *Store) RevokeSessionTokens(project, nickname, identity string) error

RevokeSessionTokens releases reservations belonging to this exact detached session. The trusted runtime calls this after authorizing the UI operation, or when cleaning up an already detached registration. Matching the binding as well as the name protects a newly issued, unbound replacement token.

func (*Store) RevokeToken

func (s *Store) RevokeToken(project, id string) error

func (*Store) RevokeTokenFor

func (s *Store) RevokeTokenFor(actor, project, id string) error

func (*Store) RevokeUserTokensFor

func (s *Store) RevokeUserTokensFor(actor, user, id string, all bool) error

func (*Store) SaveProject

func (s *Store) SaveProject(name, mode string, enabled bool, token string) error

SaveProject changes access policy. The legacy token argument must be empty; session credentials are generated by IssueToken, never supplied by a form.

func (*Store) SaveProjectFor

func (s *Store) SaveProjectFor(actor, name, mode string, enabled bool, version ...string) error

func (*Store) SessionOwners

func (s *Store) SessionOwners(project string, sessions ...Session) map[string]string

SessionOwners names the account behind each bound session identity, using retained ownership bindings even after revocation. Displayed ownership does not grant management rights; those require current membership and role.

func (*Store) SetAdminAPI

func (s *Store) SetAdminAPI(actor string, enabled bool, version ...string) error

func (*Store) SetAllowsUnauthenticated

func (s *Store) SetAllowsUnauthenticated(actor string, allowed bool) error

SetAllowsUnauthenticated cannot re-enable the removed authentication mode.

func (*Store) SetAttachmentPolicy

func (s *Store) SetAttachmentPolicy(actor string, enabled bool, version ...string) error

func (*Store) SetAttachmentStore

func (s *Store) SetAttachmentStore(store *attachments.Store)

func (*Store) SetInstanceHTTPPolicy

func (s *Store) SetInstanceHTTPPolicy(actor string, allow bool, version ...string) error

SetInstanceHTTPPolicy changes the credential-transport opt-in for every project. Only a system administrator may make this security decision, and live streams are interrupted only after the new policy is durable.

func (*Store) SetProjectMember

func (s *Store) SetProjectMember(actor, project, user, role string) error

func (*Store) SetScopeIssuanceReady

func (s *Store) SetScopeIssuanceReady(actor string, enabled bool, version ...string) error

func (*Store) Setup

func (s *Store) Setup(password string) error

Setup is for in-process initialization; HTTP must use SetupWithCode.

func (*Store) SetupWithCode

func (s *Store) SetupWithCode(code, password string) error

func (*Store) SweepExpired

func (s *Store) SweepExpired() error

func (*Store) TokenScopeEditFor

func (s *Store) TokenScopeEditFor(actor, project, id string) (TokenScopeEdit, error)

func (*Store) TransportPolicy

func (s *Store) TransportPolicy(project string) (bool, bool)

TransportPolicy returns the instance HTTP opt-in for an enabled, non-deleting project. The second result intentionally combines missing and unavailable projects so the public endpoint reveals nothing about them.

func (*Store) UpdateLanguage added in v1.1.0

func (s *Store) UpdateLanguage(actor, language string) error

func (*Store) UpdateProfile

func (s *Store) UpdateProfile(actor, displayName, email string, version ...string) error

UpdateProfile never accepts a target account or authorization fields. The caller supplies its authenticated actor; ordinary metadata keeps logins valid.

func (*Store) UpdateUser

func (s *Store) UpdateUser(actor, id, role string, enabled bool, password string, version ...string) error

func (*Store) User

func (s *Store) User(id string) (User, bool)

func (*Store) UserLanguage added in v1.1.0

func (s *Store) UserLanguage(id string) string

UserLanguage returns an account preference without adding it to the persisted User.

func (*Store) UserTokensFor

func (s *Store) UserTokensFor(actor, user string) ([]UserTokenView, error)

func (*Store) Users

func (s *Store) Users(actor string) ([]User, error)

type TokenScopeAudit

type TokenScopeAudit struct {
	ActorID         string   `json:"actorId"`
	Label           string   `json:"label"`
	Before          []string `json:"before"`
	After           []string `json:"after"`
	ChangedChildren int      `json:"changedChildren"`
}

type TokenScopeEdit

type TokenScopeEdit struct {
	Project         string   `json:"project"`
	ParentID        string   `json:"id"`
	Label           string   `json:"label"`
	OwnerID         string   `json:"ownerId"`
	Scopes          []string `json:"scopes"`
	Version         string   `json:"settings_version"`
	ChangedChildren int      `json:"changedChildren"`
	UsableChildren  int      `json:"usableChildren"`
	Auto            bool     `json:"auto"`
	MaxAutoBindings int      `json:"maxAutoBindings"`
	LifetimeDays    int      `json:"lifetimeDays"`
	CanWiden        bool     `json:"canWiden"`
}

TokenScopeEdit contains only non-secret editor data; the version is not authorization.

type User

type User struct {
	DisplayName string `json:"displayName,omitempty"`
	Email       string `json:"email,omitempty"`
	ID          string `json:"id"`
	Username    string `json:"username"`
	Role        string `json:"role"`
	Enabled     bool   `json:"enabled"`
	Revision    uint64 `json:"revision"`
}

User is a public account view. Verifiers are deliberately kept in a separate persistence record and can never be returned by listing or authentication.

type UserTokenView

type UserTokenView struct {
	ID         string    `json:"id"`
	Label      string    `json:"label"`
	Scopes     []string  `json:"scopes"`
	Source     string    `json:"source"`
	CreatedAt  time.Time `json:"created_at"`
	ExpiresAt  time.Time `json:"expires_at"`
	LastUsedAt time.Time `json:"last_used_at"`
}

UserTokenView never contains a digest or password verifier.

Jump to

Keyboard shortcuts

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