orgconfig

package
v1.89.0 Latest Latest
Warning

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

Go to latest
Published: Dec 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 orgconfig is what an installation decides for one GitHub organisation's settings (ADR 0080): the mode, where the organisation's document is read from, how far the document may reach, and the variables whose value the installation sets.

It is the policy document's `controllers.github.orgSettings`, a light package so that the documents' loaders and validators need none of the controller's dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Mode is `report` or `enforce`. Unset is `report`.
	Mode Mode `yaml:"mode,omitempty" json:"mode,omitempty"`
	// Read says where the organisation's document is and as whom it is read.
	Read Read `yaml:"read" json:"read"`
	// PlatformVariables are path.Match patterns of the variable names the
	// platform owns: `CI_RUNNER_LABEL_*`. The document may not declare one.
	PlatformVariables []string `yaml:"platformVariables,omitempty" json:"platformVariables,omitempty"`
	// PlatformValued are variable names whose value the platform sets and
	// whose visibility and repositories the organisation chooses.
	PlatformValued []string `yaml:"platformValued,omitempty" json:"platformValued,omitempty"`
	// SecretPrefix is the prefix every secret's parameter must have in the
	// organisation's own parameter store, ending in a slash. Unset puts
	// secrets out of scope.
	SecretPrefix string `yaml:"secretPrefix,omitempty" json:"secretPrefix,omitempty"`
	// Variables are the variables the installation sets, by name: each name
	// must be one the platform owns, by pattern or by value.
	Variables map[string]Variable `yaml:"variables,omitempty" json:"variables,omitempty"`
}

Config is what the installation decides for one organisation. The mode is here and not in the organisation's document, so the platform can force `report` whatever the document says: the document has no key for it.

func (Config) Ceiling

func (c Config) Ceiling() tenant.OrgCeiling

Ceiling is how far the organisation's document may reach.

func (Config) EffectiveMode

func (c Config) EffectiveMode() Mode

EffectiveMode is the mode the pass runs in: report unless the installation says enforce.

func (Config) SessionPolicy

func (c Config) SessionPolicy() (string, error)

SessionPolicy is the inline session policy the controller assumes the read role with: ssm:GetParameter on the document parameter and on the secrets' prefix, and kms:Decrypt for the SecureString parameters, whatever else the role would allow. A session policy only narrows the role. The account and partition are the role's own.

func (Config) Validate

func (c Config) Validate() error

Validate refuses a configuration the controller could not act on.

type Mode

type Mode string

Mode is what the controller does with a difference.

const (
	ModeReport  Mode = "report"
	ModeEnforce Mode = "enforce"
)

The modes. Report is the default: an organisation changes nothing until the installation says enforce.

func (Mode) Valid

func (m Mode) Valid() bool

Valid reports whether the mode is one of the two.

type Read

type Read struct {
	// RoleARN is the role the controller assumes in the organisation's own
	// account. It can read the document and the secrets' parameters and
	// nothing else, and it trusts only the controller's role.
	RoleARN string `yaml:"roleArn" json:"roleArn"`
	// Region is where the account's parameter store is read.
	Region string `yaml:"region" json:"region"`
	// Parameter is the name of the parameter that holds the document.
	Parameter string `yaml:"parameter" json:"parameter"`
	// ExternalID is passed to STS as the ExternalId of the assumption. The
	// organisation's trust policy may require it (`sts:ExternalId`), which
	// keeps the role from being assumed by anyone who learns its ARN. Optional.
	ExternalID string `yaml:"externalId,omitempty" json:"externalId,omitempty"`
}

Read is where an organisation's document is.

type Variable

type Variable struct {
	// Value is the value.
	Value string `yaml:"value" json:"value"`
	// Visibility is `all`, `private` or `selected`. Unset is `all`. For a
	// platform-valued name the organisation's document may choose its own.
	Visibility string `yaml:"visibility,omitempty" json:"visibility,omitempty"`
	// Repositories are the repositories that see it, when selected.
	Repositories []string `yaml:"repositories,omitempty" json:"repositories,omitempty"`
}

Variable is a variable the installation sets.

Jump to

Keyboard shortcuts

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