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:

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.

SEE ALSO

Azure::SDK::Core::Policy::Credential