iam

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 14 Imported by: 6

Documentation

Overview

Package iam ...

Package iam ...

Package iam ...

Index

Constants

View Source
const (
	// VPC - if VPC option is provided as providerType, key will read from VPC section.
	VPC = secret_provider.VPC
	// Bluemix - if Bluemix option is provided as providerType, key will read from Bluemix section.
	Bluemix = secret_provider.Bluemix
	// Softlayer - if Softlayer option is provided as providerType, key will read from Softlayer section.
	Softlayer = secret_provider.Softlayer
)

Variables

This section is empty.

Functions

func IsConnectionError

func IsConnectionError(err error) bool

IsConnectionError ...

func String

func String(v string) *string

String returns a pointer to the string value provided

Types

type AccessToken

type AccessToken struct {
	Token string `json:"-"` // Do not trace
}

AccessToken ...

type AuthConfiguration

type AuthConfiguration struct {
	IamURL          string
	IamClientID     string
	IamClientSecret string
}

AuthConfiguration ...

type IMSToken

type IMSToken struct {
	UserID int    // Numerical ID is safe to trace
	Token  string `json:"-"` // Do not trace
}

IMSToken ...

type TokenExchangeService

type TokenExchangeService interface {

	// ExchangeRefreshTokenForAccessToken ...
	// TODO Deprecate when no longer reliant on refresh token authentication
	ExchangeRefreshTokenForAccessToken(refreshToken string, logger *zap.Logger) (*AccessToken, error)

	// ExchangeAccessTokenForIMSToken ...
	ExchangeAccessTokenForIMSToken(accessToken AccessToken, logger *zap.Logger) (*IMSToken, error)

	// ExchangeIAMAPIKeyForIMSToken ...
	ExchangeIAMAPIKeyForIMSToken(iamAPIKey string, logger *zap.Logger) (*IMSToken, error)

	// ExchangeIAMAPIKeyForAccessToken ...
	ExchangeIAMAPIKeyForAccessToken(iamAPIKey string, logger *zap.Logger) (*AccessToken, error)

	// GetIAMAccountIDFromAccessToken ...
	GetIAMAccountIDFromAccessToken(accessToken AccessToken, logger *zap.Logger) (string, error)
}

TokenExchangeService ...

func NewTokenExchangeService

func NewTokenExchangeService(authConfig *AuthConfiguration, k8sClient *k8s_utils.KubernetesClient, providerType ...string) (TokenExchangeService, error)

NewTokenExchangeService ...

func NewTokenExchangeServiceWithClient

func NewTokenExchangeServiceWithClient(authConfig *AuthConfiguration, httpClient *http.Client) (TokenExchangeService, error)

NewTokenExchangeServiceWithClient ...

Jump to

Keyboard shortcuts

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