policies

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const GCPRoleIDPrefix = "roles/"

Variables

This section is empty.

Functions

func DownloadCredentialRequests

func DownloadCredentialRequests(version string, cloud CloudSpec) (string, error)

DownloadCredentialRequests creates a temp directory and extracts credential request manifests from a given release payload

func GetAWSProviderSpec

func GetAWSProviderSpec(credReq *cco.CredentialsRequest) (*cco.AWSProviderSpec, error)

func GetGcpProviderSpec

func GetGcpProviderSpec(credReq *cco.CredentialsRequest) (*cco.GCPProviderSpec, error)

func ParseCredentialsRequestsInDir

func ParseCredentialsRequestsInDir(dir string) ([]*cco.CredentialsRequest, error)

Types

type CloudSpec

type CloudSpec int
const (
	AWS CloudSpec = iota
	GCP CloudSpec = iota
)

func (*CloudSpec) Set

func (e *CloudSpec) Set(v string) error

Set must have pointer receiver so it doesn't change the value of a copy

func (*CloudSpec) String

func (e *CloudSpec) String() string

String is used both by fmt.Print and by Cobra in help text

func (*CloudSpec) Type

func (*CloudSpec) Type() string

Type is only used in help text

type CredentialRequest

type CredentialRequest struct {
	SecretRef           SecretRef `json:"secret_ref,omitempty"`
	ServiceAccountNames []string  `json:"service_account_names,omitempty"`
}

type PolicyDocument

type PolicyDocument struct {
	Version   string
	Statement []cco.StatementEntry
}

func AWSCredentialsRequestToPolicyDocument

func AWSCredentialsRequestToPolicyDocument(credReq *cco.CredentialsRequest) (*PolicyDocument, error)

type Role

type Role struct {
	Id          string   `json:"id,omitempty"`
	Kind        string   `json:"kind,omitempty"`
	Permissions []string `json:"permissions,omitempty"`
	Predefined  bool     `json:"predefined,omitempty"`
}

type SecretRef

type SecretRef struct {
	Name      string `json:"name,omitempty"`
	Namespace string `json:"namespace,omitempty"`
}

type ServiceAccount

type ServiceAccount struct {
	AccessMethod      string            `json:"access_method,omitempty"`
	CredentialRequest CredentialRequest `json:"credential_request,omitempty"`
	Id                string            `json:"id,omitempty"`
	Kind              string            `json:"kind,omitempty"`
	OsdRole           string            `json:"osd_role,omitempty"`
	Roles             []Role            `json:"roles,omitempty"`
}

func CredentialsRequestToWifServiceAccount

func CredentialsRequestToWifServiceAccount(credReq *cco.CredentialsRequest) (*ServiceAccount, error)

func (ServiceAccount) GetId

func (s ServiceAccount) GetId() string

func (ServiceAccount) GetSecretName

func (s ServiceAccount) GetSecretName() string

func (ServiceAccount) GetSecretNamespace

func (s ServiceAccount) GetSecretNamespace() string

func (ServiceAccount) GetServiceAccountNames

func (s ServiceAccount) GetServiceAccountNames() []string

type WifTemplate

type WifTemplate struct {
	Id              string           `json:"id,omitempty"`
	Kind            string           `json:"kind,omitempty"`
	ServiceAccounts []ServiceAccount `json:"service_accounts,omitempty"`
}

Jump to

Keyboard shortcuts

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