authorizer

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateACRDockerCfg

func CreateACRDockerCfg(acrFQDN string, accessToken types.AccessToken) string

CreateACRDockerCfg creates an ACR docker config using given access token.

Types

type ACRTokenExchanger

type ACRTokenExchanger interface {
	ExchangeACRAccessToken(ctx context.Context, log logr.Logger, armToken types.AccessToken, acrFQDN string) (types.AccessToken, error)
}

ACRTokenExchanger is the interface to exchange an ACR access token.

type Authorizer

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

Authorizer is an instance of authorizer

func NewAuthorizer

func NewAuthorizer() *Authorizer

NewAuthorizer returns an authorizer

func (*Authorizer) AcquireACRAccessTokenWithClientID

func (az *Authorizer) AcquireACRAccessTokenWithClientID(ctx context.Context, log logr.Logger, clientID string, acrFQDN string) (types.AccessToken, error)

AcquireACRAccessTokenWithClientID acquires ACR access token using managed identity client ID.

func (*Authorizer) AcquireACRAccessTokenWithResourceID

func (az *Authorizer) AcquireACRAccessTokenWithResourceID(ctx context.Context, log logr.Logger, identityResourceID string, acrFQDN string) (types.AccessToken, error)

AcquireACRAccessTokenWithResourceID acquires ACR access token using managed identity resource ID (/subscriptions/{id}/resourceGroups/{group}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{name}).

type Interface

type Interface interface {
	AcquireACRAccessTokenWithResourceID(ctx context.Context, log logr.Logger, identityResourceID string, acrFQDN string) (types.AccessToken, error)
	AcquireACRAccessTokenWithClientID(ctx context.Context, log logr.Logger, clientID string, acrFQDN string) (types.AccessToken, error)
}

Interface is the authorizer interface to acquire ACR access tokens.

type ManagedIdentityTokenRetriever

type ManagedIdentityTokenRetriever interface {
	AcquireARMToken(ctx context.Context, log logr.Logger, clientID string, resourceID string) (types.AccessToken, error)
}

ManagedIdentityTokenRetriever is the interface to acquire an ARM access token.

type TokenExchanger

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

TokenExchanger is an instance of ACRTokenExchanger

func NewTokenExchanger

func NewTokenExchanger() *TokenExchanger

NewTokenExchanger returns a new token exchanger

func (*TokenExchanger) ExchangeACRAccessToken

func (te *TokenExchanger) ExchangeACRAccessToken(ctx context.Context, log logr.Logger, armToken types.AccessToken, acrFQDN string) (types.AccessToken, error)

ExchangeACRAccessToken exchanges an ARM access token to an ACR access token

type TokenRetriever

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

TokenRetriever is an instance of ManagedIdentityTokenRetriever

func NewTokenRetriever

func NewTokenRetriever() *TokenRetriever

NewTokenRetriever returns a new token retriever

func (*TokenRetriever) AcquireARMToken

func (tr *TokenRetriever) AcquireARMToken(ctx context.Context, log logr.Logger, clientID string, resourceID string) (types.AccessToken, error)

AcquireARMToken acquires the managed identity ARM access token

Directories

Path Synopsis
Package mock_authorizer is a generated GoMock package.
Package mock_authorizer is a generated GoMock package.

Jump to

Keyboard shortcuts

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