Documentation ¶
Index ¶
- Constants
- Variables
- func ExtractGraphODataErrorCode(err error) (errorCode *string, odErr *odataerrors.ODataError, ok bool)
- func GetCanonicalCertificateTemplateID(namespaceID uuid.UUID, templateName WellKnownCertTemplateName) uuid.UUID
- func GetCanonicalNamespaceRelationID(namespaceID uuid.UUID, relationName string) uuid.UUID
- func IsAzCosmosNotFound(err error) (error, bool)
- func IsAzNotFound(err error) booldeprecated
- func IsEnvValueTrue(envValue string) bool
- func IsGraphODataErrorNotFound(err error) booldeprecated
- func LookupEnvWithDefault(envKey string, defaultValue string) string
- func NewCommonConfig(envSvc EnvService, buildID string) (c commonConfig, err error)
- func ToAzTokenCredentialRequestEditorFn(cred azcore.TokenCredential, tokenOptions policy.TokenRequestOptions) func(ctx context.Context, req *http.Request) error
- func ToSilenTokenRequestEditorFn(pubClient *public.Client, tokenScope string, account public.Account) func(ctx context.Context, req *http.Request) error
- func WrapAzRsNotFoundErr(err error, resourceDescriptor string) error
- func WrapMsGraphNotFoundErr(err error, resourceDescriptor string) error
- type AzureAppConfidentialIdentity
- type AzureCredentialServiceIdentity
- type AzureIdentity
- type CommonServer
- type ConfidentialAppIdentityProvider
- type EnvService
- type ServerContext
- type ServiceIdentityProvider
- type WellKnownCertTemplateName
- type WellKnownID
- type WellKnownIdentifier
Constants ¶
View Source
const ( EnvKeyAzClientID = "AZURE_CLIENT_ID" EnvKeyAzTenantID = "AZURE_TENANT_ID" EnvKeyAzClientSecret = "AZURE_CLIENT_SECRET" EnvKeyAzClientCertPath = "AZURE_CLIENT_CERTIFICATE_PATH" EnvKeyUseManagedIdentity = "USE_MANAGED_IDENTITY" EnvKeyAzKeyvaultResourceEndpoint = "AZURE_KEYVAULT_RESOURCEENDPOINT" EnvKeyAzSubscriptionID = "AZURE_SUBSCRIPTION_ID" EnvKeyAzResourceGroupName = "AZURE_RESOURCE_GROUP_NAME" )
View Source
const ( IdentityEnvVarPrefixService = "SERVICE_" IdentityEnvVarPrefixApp = "APP_" IdentityEnvVarPrefixAgent = "AGENT_" )
View Source
const (
NSRelNameDASPLink = "device-application-service-principal-link"
)
Variables ¶
View Source
var ( // root CA --1 ~ --f WellKnownID_RootCA = uuid.MustParse("00000000-0000-0000-0000-000000000001") WellKnownID_TestRootCA = uuid.MustParse("00000000-0000-0000-0000-00000000000f") // intermediate CAs --10 ~ --ff WellKnownID_IntCAService = uuid.MustParse("00000000-0000-0000-0000-000000000011") WellKnownID_IntCAIntranet = uuid.MustParse("00000000-0000-0000-0000-000000000012") WellKnownID_IntCAAadSp = uuid.MustParse("00000000-0000-0000-0000-000000000013") WellKnownID_TestIntCA = uuid.MustParse("00000000-0000-0000-0000-0000000000ff") )
View Source
var ( ErrStatus2xxCreated = errors.New("created") // 201 ErrStatusBadRequest = errors.New("invalid input") // 400 ErrStatusForbidden = errors.New("forbidden") // 403 ErrStatusNotFound = errors.New("resource not found") // 404 ErrStatusConflict = errors.New("resource conflict") // 409 )
View Source
var ( ErrMissingEnvVar = errors.New("missing env var") ErrInvalidEnvVar = errors.New("invalid env var") )
Functions ¶
func ExtractGraphODataErrorCode ¶
func ExtractGraphODataErrorCode(err error) (errorCode *string, odErr *odataerrors.ODataError, ok bool)
func GetCanonicalCertificateTemplateID ¶
func GetCanonicalCertificateTemplateID(namespaceID uuid.UUID, templateName WellKnownCertTemplateName) uuid.UUID
func IsAzCosmosNotFound ¶
func IsAzNotFound
deprecated
func IsEnvValueTrue ¶
func IsGraphODataErrorNotFound
deprecated
func LookupEnvWithDefault ¶
func NewCommonConfig ¶
func NewCommonConfig(envSvc EnvService, buildID string) (c commonConfig, err error)
func ToAzTokenCredentialRequestEditorFn ¶
func ToAzTokenCredentialRequestEditorFn(cred azcore.TokenCredential, tokenOptions policy.TokenRequestOptions) func(ctx context.Context, req *http.Request) error
func WrapAzRsNotFoundErr ¶
func WrapMsGraphNotFoundErr ¶
Types ¶
type AzureAppConfidentialIdentity ¶
type AzureAppConfidentialIdentity = auth.AzureAppConfidentialIdentity
type AzureCredentialServiceIdentity ¶
type AzureCredentialServiceIdentity struct {
// contains filtered or unexported fields
}
func (AzureCredentialServiceIdentity) ClientID ¶
func (identity AzureCredentialServiceIdentity) ClientID() string
func (AzureCredentialServiceIdentity) TenantID ¶
func (identity AzureCredentialServiceIdentity) TenantID() string
func (AzureCredentialServiceIdentity) TokenCredential ¶
func (identity AzureCredentialServiceIdentity) TokenCredential() azcore.TokenCredential
TokenCredential implements AzureIdentity.
type AzureIdentity ¶
type AzureIdentity = auth.AzureIdentity
func NewAzureIdentityFromEnv ¶
func NewAzureIdentityFromEnv(envService EnvService, envVarPrefix string) (AzureIdentity, error)
type CommonServer ¶
type CommonServer interface { ServiceIdentityProvider EnvService() EnvService BuildID() string }
type ConfidentialAppIdentityProvider ¶
type ConfidentialAppIdentityProvider interface {
ConfidentialAppIdentity() AzureAppConfidentialIdentity
}
type EnvService ¶
type EnvService interface { Export() []string Require(key string, prefixes ...string) (string, bool) RequireNonWhitespace(key string, prefixes ...string) (string, bool) RequireAbsPath(key string, prefixes ...string) (string, bool) Default(key string, value string, prefixes ...string) string Clone() EnvService SetValue(key string, value string) // convience method to create a error with key missing ErrMissing(key string) error }
func NewEnvService ¶
func NewEnvService() EnvService
type ServerContext ¶
type ServerContext interface { ctx.Context ServiceIdentity() AzureIdentity }
type ServiceIdentityProvider ¶
type ServiceIdentityProvider interface {
ServiceIdentity() AzureIdentity
}
type WellKnownCertTemplateName ¶
type WellKnownCertTemplateName string
const ( DefaultCertTemplateName_GlobalDefault WellKnownCertTemplateName = "default" DefaultCertTemplateName_ServicePrincipalClientCredential WellKnownCertTemplateName = "default-service-principal-client-credential" )
type WellKnownID ¶
type WellKnownIdentifier ¶
type WellKnownIdentifier int
Click to show internal directories.
Click to hide internal directories.