Codeunit 9063 Stor. Serv. Auth. Impl. in 27

App
System Application
Namespace
System.Azure.Storage

Procedures, 5

Versions171819202122232425262728latest

Source242526272829

Source in 27

src/System Application/App/Azure Storage Services Authorization/src/StorServAuthImpl.Codeunit.al69 lines, Copyright (c) Microsoft Corporation. MIT

// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.Azure.Storage;

codeunit 9063 "Stor. Serv. Auth. Impl."
{
    Access = Internal;
    InherentEntitlements = X;
    InherentPermissions = X;

    procedure CreateSAS(SigningKey: SecretText; SignedVersion: Enum "Storage Service API Version"; SignedServices: List of [Enum "SAS Service Type"]; SignedResources: List of [Enum "SAS Resource Type"]; SignedPermissions: List of [Enum "SAS Permission"]; SignedExpiry: DateTime): Interface "Storage Service Authorization"
    var
        OptionalParams: Record "SAS Parameters";
    begin
        OptionalParams.Init();
        exit(CreateSAS(SigningKey, SignedVersion, SignedServices, SignedResources, SignedPermissions, SignedExpiry, OptionalParams));
    end;

    procedure CreateSAS(SigningKey: SecretText; SignedVersion: Enum "Storage Service API Version"; SignedServices: List of [Enum "SAS Service Type"]; SignedResources: List of [Enum "SAS Resource Type"]; SignedPermissions: List of [Enum "SAS Permission"]; SignedExpiry: DateTime; OptionalParams: Record "SAS Parameters"): Interface "Storage Service Authorization"
    var
        StorServAuthSAS: Codeunit "Stor. Serv. Auth. SAS";
    begin
        StorServAuthSAS.SetSigningKey(SigningKey);
        StorServAuthSAS.SetVersion(SignedVersion);
        StorServAuthSAS.SetSignedServices(SignedServices);
        StorServAuthSAS.SetResources(SignedResources);
        StorServAuthSAS.SetSignedPermissions(SignedPermissions);
        StorServAuthSAS.SetSignedExpiry(SignedExpiry);

        // Set optional parameters
        if OptionalParams.SignedStart <> 0DT then
          StorServAuthSAS.SetSignedStart(OptionalParams.SignedStart)
        else
          StorServAuthSAS.SetSignedStart(CurrentDateTime());
        StorServAuthSAS.SetIPrange(OptionalParams.SignedIp);
        StorServAuthSAS.SetProtocol(OptionalParams.SignedProtocol);
        StorServAuthSAS.SetSignedEncryptionScope(OptionalParams.SignedEncryptionScope);

        exit(StorServAuthSAS);
    end;

    procedure SharedKey(SharedKeyToUse: SecretText; ApiVersion: Enum "Storage Service API Version"): Interface "Storage Service Authorization"
    var
        StorServAuthSharedKey: Codeunit "Stor. Serv. Auth. Shared Key";
    begin
        StorServAuthSharedKey.SetSharedKey(SharedKeyToUse);
        StorServAuthSharedKey.SetApiVersion(ApiVersion);

        exit(StorServAuthSharedKey);
    end;

    procedure ReadySAS(SASToken: SecretText): Interface "Storage Service Authorization"
    var
        StorServAuthReadySAS: Codeunit "Stor. Serv. Auth. Ready SAS";
    begin
        StorServAuthReadySAS.SetSharedAccessSignature(SASToken);

        exit(StorServAuthReadySAS);
    end;

    procedure GetDefaultAPIVersion(): Enum "Storage Service API Version"
    begin
        exit(Enum::"Storage Service API Version"::"2020-10-02");
    end;
}

Procedures, 5

NameParametersReturnsAccessObsolete
GetDefaultAPIVersion()Enum Storage Service API Versionpublic-
CreateSAS(SecretText, Enum Storage Service API Version, List, List, List, DateTime)Interface Storage Service Authorizationpublic-
CreateSAS(SecretText, Enum Storage Service API Version, List, List, List, DateTime, Record SAS Parameters)Interface Storage Service Authorizationpublic-
SharedKey(SecretText, Enum Storage Service API Version)Interface Storage Service Authorizationpublic-
ReadySAS(SecretText)Interface Storage Service Authorizationpublic-