auth

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the Apache 2.0 license.

Copyright (c) Microsoft Corporation. Licensed under the Apache 2.0 license.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authentication

type Authentication struct {
	ClientID             string `json:"clientId,omitempty"`
	ClientSecret         string `json:"clientSecret,omitempty"`
	SubscriptionID       string `json:"subscriptionId,omitempty"`
	TenantID             string `json:"tenantId,omitempty"`
	UserIdentityClientId string `json:"userIdentityClientId,omitempty"`
}

Authentication represents the Authentication file for Azure.

func NewAuthentication

func NewAuthentication(clientID, clientSecret, subscriptionID, tenantID, userAssignedIdentityID string) *Authentication

NewAuthentication returns an Authentication struct from user provided credentials.

type CloudEnvironmentName

type CloudEnvironmentName string
const (
	AzurePublicCloud       CloudEnvironmentName = "AzurePublicCloud"
	AzureUSGovernmentCloud CloudEnvironmentName = "AzureUSGovernmentCloud"
	AzureChinaCloud        CloudEnvironmentName = "AzureChinaCloud"
)

type Config

type Config struct {
	AKSCredential *aksCredential
	AuthConfig    *Authentication
	Cloud         cloud.Configuration
	Authorizer    autorest.Authorizer
}

func (*Config) GetAuthorizer added in v1.6.0

func (c *Config) GetAuthorizer(ctx context.Context, resource string) (autorest.Authorizer, error)

GetAuthorizer return autorest authorizer.

func (*Config) GetMSICredential added in v1.4.10

func (c *Config) GetMSICredential(ctx context.Context) (*azidentity.ManagedIdentityCredential, error)

GetMSICredential retrieve MSI credential

func (*Config) GetSPCredential added in v1.4.10

func (c *Config) GetSPCredential(ctx context.Context) (*azidentity.ClientSecretCredential, error)

GetSPCredential retrieve SP credential

func (*Config) SetAuthConfig

func (c *Config) SetAuthConfig(ctx context.Context) error

SetAuthConfig sets the configuration needed for Authentication.

type ConfigInterface added in v1.6.0

type ConfigInterface interface {
	GetMSICredential(ctx context.Context) (*azidentity.ManagedIdentityCredential, error)
	GetSPCredential(ctx context.Context) (*azidentity.ClientSecretCredential, error)
	GetAuthorizer(ctx context.Context, resource string) (autorest.Authorizer, error)
}

Jump to

Keyboard shortcuts

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