access

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 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 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 Steps

func Steps(command string) []string

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

Types

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 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 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"`
	// 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