Documentation
¶
Index ¶
Constants ¶
View Source
const ( AccessAll = "All" AccessOwner = "Owner" AccessOwnerOrAdmin = "OwnerOrAdmin" )
Variables ¶
This section is empty.
Functions ¶
func GetUsername ¶
GetUsername returns the attached user name, or SYSTEM for internal requests.
Types ¶
type AccessMode ¶
type AccessMode string
Access modes describe which task owners an authenticated user may access.
type UserInfo ¶
type UserInfo struct {
// Public users are unauthenticated callers, including callers of public endpoints.
IsPublic bool
// Administrators are defined by the configuration file:
// Basic-auth users with Admin set, or usernames listed under OIDC Admins.
IsAdmin bool
// Username of an authenticated user (the subject field from a JWT for OIDC).
Username string
// OIDC bearer token, used when requesting task input data.
Token string
// AccessMode is assigned by server authentication after validating config.
AccessMode AccessMode
}
UserInfo describes the authenticated caller and the task access policy selected by server configuration.
func GetUser ¶
GetUser returns the user attached to ctx, or the internal SYSTEM identity when no user is attached.
func (*UserInfo) CanSeeAllTasks ¶
CanSeeAllTasks reports whether the user can list all tasks without checking each task's owner.
func (*UserInfo) IsAccessible ¶
IsAccessible reports whether the user can access data owned by dataOwner.
Click to show internal directories.
Click to hide internal directories.