access

package
v0.42.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package access contains commands related to API access for the client.

Index

Constants

View Source
const (

	// ServiceAccountNameSuffix is appended to the name of all service accounts.
	ServiceAccountNameSuffix = "@" + serviceAccountDomain

	// InfraProviderServiceAccountPrefix is the prefix required for infra provider service accounts.
	InfraProviderServiceAccountPrefix = "infra-provider:"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceAccount added in v0.40.0

type ServiceAccount struct {
	// BaseName is the base name of the service account.
	//
	// Example: "aws-1"
	BaseName string

	// Suffix is the suffix of the service account.
	//
	// Example: "@infra-provider.serviceaccount.omni.sidero.dev"
	Suffix string

	// IsInfraProvider indicates whether the service account is a infra provider service account.
	IsInfraProvider bool
}

ServiceAccount represents a service account.

func ParseServiceAccountFromFullID added in v0.40.0

func ParseServiceAccountFromFullID(fullID string) (sa ServiceAccount, isSa bool)

ParseServiceAccountFromFullID parses a service account from a full ID (Identity resource ID / e-mail).

Example: fullID: aws-1@infra-provider.serviceaccount.omni.sidero.dev

Result: ServiceAccount{BaseName: "aws-1", Suffix: "@infra-provider.serviceaccount.omni.sidero.dev", IsInfraProvider: true}.

func ParseServiceAccountFromName added in v0.40.0

func ParseServiceAccountFromName(name string) ServiceAccount

ParseServiceAccountFromName parses a service account from a name with a potential prefix.

Example: name: "infra-provider:aws-1"

Result: ServiceAccount{BaseName: "aws-1", Suffix: "@infra-provider.serviceaccount.omni.sidero.dev", IsInfraProvider: true}.

func (ServiceAccount) FullID added in v0.40.0

func (sa ServiceAccount) FullID() string

FullID returns the full ID (Identity resource ID / e-mail) of the service account.

Example: aws-1@infra-provider.serviceaccount.omni.sidero.dev.

func (ServiceAccount) NameWithPrefix added in v0.40.0

func (sa ServiceAccount) NameWithPrefix() string

NameWithPrefix returns the name of the service account with the appropriate prefix.

Example: infra-provider:aws-1.

Jump to

Keyboard shortcuts

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