authctx

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerEndpointEnvVar = "TMC_ENDPOINT"

	// TMC SaaS env variables.
	VMWCloudEndpointEnvVar = "VMW_CLOUD_ENDPOINT"
	VMWCloudAPITokenEnvVar = "VMW_CLOUD_API_TOKEN"

	// TMC self managed env variables.
	OIDCIssuerEndpointEnvVar = "OIDC_ISSUER"
	TmcSMUsernameEnvVar      = "TMC_SM_USERNAME"
	TmcSMPasswordEnvVar      = "TMC_SM_PASSWORD"

	// Proxy config values.
	InsecureAllowUnverifiedSSLEnvVar = "INSECURE_ALLOW_UNVERIFIED_SSL"
	ClientAuthCertFileEnvVar         = "CLIENT_AUTH_CERT_FILE"
	ClientAuthKeyFileEnvVar          = "CLIENT_AUTH_KEY_FILE"
	CAFileEnvVar                     = "CA_FILE"
	ClientAuthCertEnvVar             = "CLIENT_AUTH_CERT"
	ClientAuthKeyEnvVar              = "CLIENT_AUTH_KEY"
	CACertEnvVar                     = "CA_CERT"
)

Variables

View Source
var RefreshUserAuthContext = func(config *TanzuContext, refreshCondition func(error) bool, err error) {
	if refreshCondition(err) {
		if config.IsSelfManaged() {
			refreshSMUserAuthCtx(config)
			return
		}
		refreshSaaSUserAuthCtx(config)
	}
}

Functions

func ProviderAuthSchema

func ProviderAuthSchema() map[string]*schema.Schema

func ProviderConfigureContext

func ProviderConfigureContext(_ context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics)

func ProviderConfigureContextWithDefaultTransportForTesting added in v1.1.4

func ProviderConfigureContextWithDefaultTransportForTesting(_ context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics)

The default transport is needed for mocking. The http mocking library used in testing can only intercept calls if they're made with the default transport.

Types

type AgentTokenInfo

type AgentTokenInfo struct {
	AccessToken string `json:"access_token"`
}

type TanzuContext

type TanzuContext struct {
	SelfManaged      bool
	ServerEndpoint   string
	SMUsername       string
	Token            string // selfmanaged password is stored here
	VMWCloudEndPoint string // selfmanaged odic issuer is stored here
	TMCConnection    *client.TanzuMissionControl
	TLSConfig        *proxy.TLSConfig
}

func (*TanzuContext) IsSelfManaged added in v1.2.0

func (cfg *TanzuContext) IsSelfManaged() bool

func (*TanzuContext) Setup

func (cfg *TanzuContext) Setup() (err error)

func (*TanzuContext) SetupWithDefaultTransportForTesting added in v1.1.4

func (cfg *TanzuContext) SetupWithDefaultTransportForTesting() (err error)

The default transport is needed for mocking. The http mocking library used in testing can only intercept calls if they're made with the default transport.

Jump to

Keyboard shortcuts

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