consoleauth

package
v1.76.10 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package consoleauth is how a controller proves itself to the console.

In a cluster it is the pod's projected ServiceAccount token, read afresh on every call. On Lambda there is none, and the proof is the function role's outbound web identity token (`sts:GetWebIdentityToken`), scoped to the console's own audience (distinct from the token exchange's), and reused for under four minutes (the issuer refuses a token older than its maxAge) so a pass that calls the console many times asks STS once.

The issuer verifies the token against the account's published key set, with the same verifier token exchange uses, and the policy's `aws` matchers decide what the role may do (docs/reference/sluis/lambda.md).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Interceptor

func Interceptor(src Source) connect.Option

Interceptor presents the source's token as the bearer of every call.

func Unary

Unary is Interceptor as the interceptor itself.

Types

type AWS

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

AWS is the function role's web identity token, for one audience.

func NewAWS

func NewAWS(ctx context.Context, audience string) (*AWS, error)

NewAWS connects with the function's role. The audience must equal the issuer's `console.awsAudience`, not the AWS federation file's.

The source is shared by audience for the life of the process: a function assembles its controller per invocation, and a warm execution environment should reuse the token, not ask STS again.

func NewAWSWith

func NewAWSWith(api STS, audience string, now func() time.Time) (*AWS, error)

NewAWSWith is NewAWS over a client and a clock the caller made.

func (*AWS) Token

func (a *AWS) Token(ctx context.Context) (string, error)

Token implements Source. A token is reused while it is under four minutes old, and a new one is minted after that.

type File

type File string

File reads a projected token afresh each time: the kubelet rotates it under the pod.

func (File) Token

func (f File) Token(context.Context) (string, error)

Token implements Source.

type STS

type STS interface {
	GetWebIdentityToken(ctx context.Context, in *sts.GetWebIdentityTokenInput, opts ...func(*sts.Options)) (*sts.GetWebIdentityTokenOutput, error)
}

STS is the part of the STS client the AWS source uses.

type Source

type Source interface {
	Token(ctx context.Context) (string, error)
}

Source yields the bearer a call to the console carries.

Jump to

Keyboard shortcuts

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