Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var KindToLegacy = map[Scope]Scope{
"KubernetesCluster": "cluster",
"Project": "project",
"Workspace": "workspace",
"VirtualMachine": "virtualmachine",
"BackupJob": "backup",
"Datacenter": "datacenter",
"Machine": "machine",
}
KindToLegacy maps resource Kind names back to legacy V2 scope names. Used when returning data to V2 API consumers that expect the old naming.
var KindToLegacySubject = map[Subject]Subject{
"KubernetesCluster": "cluster",
"Project": "project",
"Workspace": "workspace",
"VirtualMachine": "virtualmachine",
"BackupJob": "backup",
"Datacenter": "datacenter",
"Machine": "machine",
}
KindToLegacySubject maps resource Kind subject names back to legacy V2 subject names.
var LegacySubjectToKind = map[Subject]Subject{
"cluster": "KubernetesCluster",
"project": "Project",
"workspace": "Workspace",
"virtualmachine": "VirtualMachine",
"backup": "BackupJob",
"datacenter": "Datacenter",
"machine": "Machine",
}
LegacySubjectToKind maps legacy V2 subject names (used with scope "ror") to resource Kind names. These represent type-level grants (e.g. "can manage all clusters").
var LegacyToKind = map[Scope]Scope{
"cluster": "KubernetesCluster",
"project": "Project",
"workspace": "Workspace",
"virtualmachine": "VirtualMachine",
"backup": "BackupJob",
"datacenter": "Datacenter",
"machine": "Machine",
}
LegacyToKind maps legacy V2 scope names to resource Kind names. Used to translate V2 API calls to the Kind-based scope values stored in the database after the scope migration.
Functions ¶
This section is empty.
Types ¶
type Scope ¶
type Scope string
Scope represents the scope of an ACL entry. Valid values are known resource kinds (e.g. "cluster", "project") or system identifiers (e.g. "ror", "all").
const ( ScopeUnknown Scope = "UNKNOWN" ScopeRor Scope = "ror" ScopeCluster Scope = "KubernetesCluster" ScopeProject Scope = "Project" ScopeDatacenter Scope = "Datacenter" ScopeVirtualMachine Scope = "VirtualMachine" ScopeMachine Scope = "Machine" ScopeBackup Scope = "BackupJob" ScopeAll Scope = "all" ScopeSpam Scope = "spam" )
func (Scope) GetSubjects ¶
GetSubjects returns valid subjects for a given scope.
type Subject ¶
type Subject string
Subject represents the subject of an ACL entry. This is the identifier of the specific object, e.g. a cluster ID, project ID, or "All".
const ( SubjectUnknown Subject = "UNKNOWN" SubjectCluster Subject = "cluster" SubjectProject Subject = "project" SubjectGlobal Subject = "globalscope" SubjectAcl Subject = "acl" SubjectApiKey Subject = "apikey" SubjectDatacenter Subject = "datacenter" SubjectWorkspace Subject = "workspace" SubjectPrice Subject = "price" SubjectVirtualMachine Subject = "virtualmachine" SubjectBackup Subject = "backup" SubjectAll Subject = "all" SubjectSpamGit Subject = "spamgit" )
func GetValidSubjects ¶
func GetValidSubjects() []Subject
GetValidSubjects returns all valid subjects for the "ror" scope.
func (Subject) HasValidScope ¶
HasValidScope checks if the subject is valid for the given scope.