access

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 7 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 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

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFeatures

func CheckFeatures(names []string) error

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 FeatureNames

func FeatureNames() []string

FeatureNames are the optional features, sorted.

func Needs

func Needs(command string) []string

Needs are the permissions of all of a command's steps, sorted, without duplicates (nil for an unknown command).

func NeedsWith

func NeedsWith(command string, features []string) []string

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

func NeedsWithout(command string, features []string, skip ...string) []string

NeedsWithout are NeedsWith(command, features) without the permissions of the command's steps named in skip: a permission another step needs too stays.

func StepNeeds added in v0.14.0

func StepNeeds(command string, steps ...string) []string

StepNeeds are the permissions of the named steps of a command, sorted, without duplicates (nil for an unknown command): connect and disconnect test each resource for the steps that act on it only.

func Steps

func Steps(command string) []string

Steps are a command's steps in the manifest's order (nil for an unknown command).

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

type Condition struct {
	Title      string `json:"title"`
	Expression string `json:"expression"`
}

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.

func Load

func Load() Manifest

Load is the embedded manifest. It panics on an invalid embedded file, which a test proves never happens.

type Role

type Role struct {
	Title       string   `json:"title"`
	Description string   `json:"description"`
	Permissions []string `json:"permissions"`
}

Role is a custom role.

Jump to

Keyboard shortcuts

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