Documentation
¶
Index ¶
Constants ¶
const ( // 499b84ac-1321-427f-aa17-267ca6975798 is the UUID of Azure Devops // resource. The scope defined below provides access to Azure DevOps // Services REST API. The Microsoft Entra ID access token with this scope // can be used to call Azure DevOps API by passing it in the headers as a // Bearer Token : https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/service-principal-managed-identity?view=azure-devops#q-can-i-use-a-service-principal-or-managed-identity-with-azure-cli AzureDevOpsRestApiScope = "499b84ac-1321-427f-aa17-267ca6975798/.default" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an authentication provider for Azure.
func New ¶
New returns a new authentication provider for Azure. It configures credentials using a default credential chain with options. https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#NewDefaultAzureCredential The default scope is to ARM endpoint in Azure Cloud. The scope is overridden using OptFunc.
type FakeTokenCredential ¶
FakeTokenCredential is a fake Azure credential provider.
func (*FakeTokenCredential) GetToken ¶
func (tc *FakeTokenCredential) GetToken(ctx context.Context, options policy.TokenRequestOptions) (azcore.AccessToken, error)
type OptFunc ¶
type OptFunc func(*Client)
OptFunc enables specifying options for the provider.
func WithAzureDevOpsScope ¶
func WithAzureDevOpsScope() OptFunc
WithAzureDevOpsScope() configures the scope to access Azure DevOps Rest API needed to access Azure DevOps Repositories
func WithCredential ¶
func WithCredential(cred azcore.TokenCredential) OptFunc
WithCredential configures the credential to use to fetch the resource manager token.
func WithProxyURL ¶
WithProxyURL sets the proxy URL to use with NewDefaultAzureCredential.