Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertBase64ToCert ¶
func ConvertBase64ToCert(b64, password string) ([]*x509.Certificate, crypto.PrivateKey, error)
func ConvertFileToBase64 ¶
Types ¶
type AuthenticationMethod ¶
type AuthenticationMethod string
const ( ServicePrincipalSecretAuth AuthenticationMethod = "ServicePrincipalSecret" ServicePrincipalCertificateAuth AuthenticationMethod = "ServicePrincipalCertificate" ServicePrincipalOIDCAuth AuthenticationMethod = "ServicePrincipalOIDC" AzureDevOpsWorkloadIdentityFederationAuth AuthenticationMethod = "AzureDevOpsWorkloadIdentityFederation" ManagedServiceIdentityUserAuth AuthenticationMethod = "ManagedServiceIdentityUser" ManagedServiceIdentitySystemAuth AuthenticationMethod = "ManagedServiceIdentitySystem" AzureCLIAuth AuthenticationMethod = "AzureCLI" AzureDevCLIAuth AuthenticationMethod = "AzureDeveloperCLI" TokenAuth AuthenticationMethod = "Token" )
Supported authentication methods.
type Config ¶
type Config struct { UseCLI bool UseDevCLI bool UseOIDC bool UseMSI bool Token string Environment cloud.Configuration AuxiliaryTenantIDs []string TenantID string ClientID string ClientSecret string ClientCertificate []*x509.Certificate ClientCertificateKey crypto.PrivateKey OIDC OIDCConfig }
Config represents the authentication configuration.
type CredentialResponse ¶
type CredentialResponse struct { Cred azcore.TokenCredential AuthMethod AuthenticationMethod Info string }
func NewCredential ¶
func NewCredential(cfg Config) (CredentialResponse, error)
NewCredential evaluates the authentication method and returns the appropriate credential.
type OIDCConfig ¶
type OIDCConfig struct { RequestURL string RequestToken string Token string AzureDevOpsServiceConnectionID string }
OIDCConfig represents the OpenID Connect configuration.
type TokenCredential ¶
type TokenCredential struct {
// contains filtered or unexported fields
}
TokenCredential is a TokenCredential that returns a static bearer token.
func NewTokenCredential ¶
func NewTokenCredential(token string) (*TokenCredential, error)
NewTokenCredential creates a new instance of TokenCredential.
func (*TokenCredential) GetToken ¶
func (c *TokenCredential) GetToken(_ context.Context, _ policy.TokenRequestOptions) (azcore.AccessToken, error)
GetToken returns the bearer token.
Click to show internal directories.
Click to hide internal directories.