identity

package
v1.4.16 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package identity implements types and utility routines related to the identity of a workload, as used within FSM.

Index

Constants

View Source
const WildcardPrincipal = "*"

WildcardPrincipal is a wildcard to match all principals. A principal is a service identity with a trust domain.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sServiceAccount

type K8sServiceAccount struct {
	Namespace string
	Name      string
}

K8sServiceAccount is a type for a namespaced service account

func (K8sServiceAccount) AsPrincipal

func (sa K8sServiceAccount) AsPrincipal(trustDomain string) string

AsPrincipal converts the K8sServiceAccount to a Principal with the given trust domain.

func (K8sServiceAccount) String

func (sa K8sServiceAccount) String() string

String returns the string representation of the service account object

func (K8sServiceAccount) ToServiceIdentity

func (sa K8sServiceAccount) ToServiceIdentity() ServiceIdentity

ToServiceIdentity converts K8sServiceAccount to the newer ServiceIdentity

type ServiceIdentity

type ServiceIdentity string

ServiceIdentity is the type used to represent the identity for a service For Kubernetes services this string will be in the format: <ServiceAccount>.<Namespace>

const WildcardServiceIdentity ServiceIdentity = "*"

WildcardServiceIdentity is a wildcard to match all service identities

func FromPrincipal

func FromPrincipal(servicePrincipal, trustDomain string) ServiceIdentity

FromPrincipal returns a new ServiceIdentity for the given servicePrincipal.

func New

func New(name, namespace string) ServiceIdentity

New returns a new ServiceIdentity for the given name and namespace.

func (ServiceIdentity) AsPrincipal

func (si ServiceIdentity) AsPrincipal(trustDomain string) string

AsPrincipal converts the ServiceIdentity to a Principal with the given trust domain.

func (ServiceIdentity) IsWildcard

func (si ServiceIdentity) IsWildcard() bool

IsWildcard determines if the ServiceIdentity is a wildcard

func (ServiceIdentity) String

func (si ServiceIdentity) String() string

String returns the ServiceIdentity as a string

func (ServiceIdentity) ToK8sServiceAccount

func (si ServiceIdentity) ToK8sServiceAccount() K8sServiceAccount

ToK8sServiceAccount converts a ServiceIdentity to a K8sServiceAccount to help with transition from K8sServiceAccount to ServiceIdentity

Jump to

Keyboard shortcuts

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