NAME
Azure::SDK::Core::Credential - credential contract for the Perl Azure SDK core
DESCRIPTION
Azure::SDK::Core::Credential is the base class that defines how a credential authenticates a request. Concrete credentials subclass it and implement apply, mutating the request to add the appropriate authentication: a bearer token header, a SAS query string, or a service-specific shared-key signature.
The shared core provides three credential types:
Azure::SDK::Core::Credential::StaticToken for bearer tokens.
Azure::SDK::Core::Credential::Sas for shared access signatures.
Azure::SDK::Core::Credential::SharedKey for account shared keys.
METHODS
applies_to_request
if ($credential->applies_to_request) { ... }
Returns true when the credential authenticates a request on its own by mutating it through apply, so the default pipeline can attach it automatically. The base class returns false; request-applying credentials (Azure::SDK::Core::Credential::StaticToken, Azure::SDK::Core::Credential::Sas) override it to return true. Signing credentials such as Azure::SDK::Core::Credential::SharedKey leave it false because they need service-specific canonicalization.
apply
$credential->apply($request);
Mutates the request to add authentication. The base implementation throws; subclasses must override it.