aws

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FingerprintSHA1 added in v1.0.1

func FingerprintSHA1(addr string, tlsSkipVerify bool) (string, error)

FingerprintSHA1 returns certificate sha1 fingerprint e.g. oidc.eks.eu-west-2.amazonaws.com

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(logger *slog.Logger, region, clusterName string) (Client, error)

func (Client) DescribeCluster added in v1.0.1

func (c Client) DescribeCluster() (Cluster, error)

func (Client) GetClusterOidcProvider added in v1.0.1

func (c Client) GetClusterOidcProvider(clusterOidcIssuerId string) (OidcProvider, error)

func (Client) GetIAMRole

func (c Client) GetIAMRole(roleName string) (Role, error)

func (Client) LookupEvents

func (c Client) LookupEvents(namespace, serviceAccount string) (Events, error)

type Cluster added in v1.0.1

type Cluster struct {
	Arn         string
	Name        string
	Certificate string
	CreatedAt   time.Time
	Endpoint    string
	OidcIssuer  string
	RoleArn     string
	Status      string
}

func (Cluster) OidcIssuerFingerprint added in v1.0.1

func (c Cluster) OidcIssuerFingerprint() (string, error)

func (Cluster) OidcIssuerId added in v1.0.1

func (c Cluster) OidcIssuerId() string

type Event

type Event struct {
	EventTime         time.Time         `json:"-"`
	EventId           string            `json:"-"`
	EventSource       string            `json:"-"`
	EventName         string            `json:"-"`
	UserName          string            `json:"-"`
	ErrorCode         string            `json:"errorCode"`    // set when there's error
	ErrorMessage      string            `json:"errorMessage"` // set when there's error
	UserIdentity      UserIdentity      `json:"userIdentity"`
	Region            string            `json:"awsRegion"`
	SourceIP          string            `json:"sourceIPAddress"`
	UserAgent         string            `json:"userAgent"`
	RequestParameters RequestParameters `json:"requestParameters"`
	RequestId         string            `json:"requestId"`
	EventType         string            `json:"eventType"`
}

type Events

type Events []Event

func (Events) FailedEvents

func (e Events) FailedEvents() Events

type OidcProvider added in v1.0.1

type OidcProvider struct {
	Arn         string
	ClientIDs   []string
	CreateDate  time.Time
	Thumbprints []string
	Url         string
}

type RequestParameters

type RequestParameters struct {
	RoleArn         string `json:"roleArn"`
	RoleSessionName string `json:"roleSessionName"`
}

type Role

type Role struct {
	ARN                      string
	Name                     string
	Description              string
	AssumeRolePolicyDocument string
	CreateDate               time.Time
	RoleLastUsed             time.Time
}

type UserIdentity

type UserIdentity struct {
	Type             string `json:"type"`
	PrincipalId      string `json:"principalId"`
	UserName         string `json:"userName"`
	IdentityProvider string `json:"identityProvider"`
}

Jump to

Keyboard shortcuts

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