Documentation
¶
Overview ¶
Package access is the manifest of what Dormeto needs in Google Cloud: the APIs, the custom roles, the predefined roles' permissions, the router's grants, the manager's connection (its section manager) and, per `dormeto gcp` command, the permissions the operator needs by step. access.json is a byte for byte copy of router/gcp/access.json (a test compares them).
Index ¶
- func CheckFeatures(names []string) error
- func Commands() []string
- func FeatureNames() []string
- func Needs(command string) []string
- func NeedsWith(command string, features []string) []string
- func NeedsWithout(command string, features []string, skip ...string) []string
- func StepNeeds(command string, steps ...string) []string
- func Steps(command string) []string
- type Attribute
- type Condition
- type Feature
- type Federation
- type Grant
- type Impersonation
- type Manager
- type ManagerGrant
- type ManagerRole
- type Manifest
- type Role
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckFeatures ¶
CheckFeatures is nil when every name is a feature, else an error naming the first that is not and the features there are.
func Commands ¶
func Commands() []string
Commands are the operator's commands in the manifest's order.
func Needs ¶
Needs are the permissions of all of a command's steps, sorted, without duplicates (nil for an unknown command).
func NeedsWith ¶
NeedsWith are Needs(command) and, for each named feature, the permissions its operator steps need for the command (a name that is not a feature adds nothing).
func NeedsWithout ¶ added in v0.14.0
NeedsWithout are NeedsWith(command, features) without the permissions of the command's steps named in skip: a permission another step needs too stays.
Types ¶
type Attribute ¶ added in v0.14.0
type Attribute struct {
Name, Expression string
}
Attribute is one entry of the provider's attribute mapping: Google's attribute and the expression that sets it.
type Condition ¶
Condition is an IAM condition, its placeholders ({project}, {projectNumber}, {region}, {database}) not yet filled.
type Feature ¶
type Feature struct {
APIs []string `json:"apis"`
Roles map[string]Role `json:"roles"`
Router []Grant `json:"router"`
Operator map[string]map[string][]string `json:"operator"`
}
Feature is an optional access (`--with`): its APIs, custom roles, the router's grants and, per `dormeto gcp` command, the permissions the operator needs for it.
type Federation ¶ added in v0.14.0
type Federation struct {
Pool string `json:"pool"`
Provider string `json:"provider"`
Condition string `json:"condition"`
Mapping []Attribute `json:"-"`
}
Federation is the workload identity pool and its AWS provider, placeholders ({env}, {account}) not yet filled; Mapping in the manifest's order.
type Grant ¶
type Grant struct {
Role string `json:"role"`
On string `json:"on"`
Condition *Condition `json:"condition,omitempty"`
}
Grant is one of the router's grants: a role on a resource kind.
type Impersonation ¶ added in v0.14.0
type Impersonation struct {
Role string `json:"role"`
PrincipalSet string `json:"principalSet"`
Roles map[string][]string `json:"-"`
}
Impersonation is the grant on each service account to the principal set of each of the manager's roles that act as it: Roles by account (discovery, command).
type Manager ¶ added in v0.14.0
type Manager struct {
APIs []string `json:"apis"`
Federation Federation `json:"federation"`
ServiceAccounts map[string]string `json:"serviceAccounts"`
Roles map[string]ManagerRole `json:"roles"`
Grants struct {
Scopes []ManagerGrant `json:"scopes"`
RouterProjects []ManagerGrant `json:"routerProjects"`
} `json:"grants"`
Impersonation Impersonation `json:"impersonation"`
}
Manager is the manifest's manager section: what `dormeto gcp connect` sets up for the manager.
type ManagerGrant ¶ added in v0.14.0
type ManagerGrant struct {
Account string `json:"account"`
Role string `json:"role"`
On string `json:"on"`
}
ManagerGrant is one of the manager accounts' grants: a role (a custom role's ID, or a predefined role) to an account (discovery or command) on a resource (scope, controller, tagValue or project).
type ManagerRole ¶ added in v0.14.0
type ManagerRole struct {
Title string `json:"title"`
Description string `json:"description"`
Permissions []string `json:"permissions"`
OrganizationPermissions []string `json:"organizationPermissions"`
}
ManagerRole is a custom role of the manager's accounts: Permissions wherever it is defined, OrganizationPermissions added only when it is defined in an organization (Google refuses them in a project's role).
type Manifest ¶
type Manifest struct {
Version int `json:"version"`
APIs []string `json:"apis"`
Roles map[string]Role `json:"roles"`
Predefined map[string][]string `json:"predefined"`
Router []Grant `json:"router"`
Features map[string]Feature `json:"features"`
Manager Manager `json:"manager"`
// contains filtered or unexported fields
}
Manifest is access.json.