@azure/attestation 1.0.1-alpha.20250620.1 → 1.0.1-alpha.20250730.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/attestationAdministrationClient.js +24 -22
- package/dist/browser/attestationAdministrationClient.js.map +1 -1
- package/dist/browser/attestationClient.js +23 -21
- package/dist/browser/attestationClient.js.map +1 -1
- package/dist/browser/generated/generatedClient.js +14 -3
- package/dist/browser/generated/generatedClient.js.map +1 -1
- package/dist/browser/generated/operations/attestation.js +4 -3
- package/dist/browser/generated/operations/attestation.js.map +1 -1
- package/dist/browser/generated/operations/metadataConfiguration.js +2 -1
- package/dist/browser/generated/operations/metadataConfiguration.js.map +1 -1
- package/dist/browser/generated/operations/policy.js +4 -3
- package/dist/browser/generated/operations/policy.js.map +1 -1
- package/dist/browser/generated/operations/policyCertificates.js +4 -3
- package/dist/browser/generated/operations/policyCertificates.js.map +1 -1
- package/dist/browser/generated/operations/signingCertificates.js +2 -1
- package/dist/browser/generated/operations/signingCertificates.js.map +1 -1
- package/dist/browser/models/attestationResult.js +17 -0
- package/dist/browser/models/attestationResult.js.map +1 -1
- package/dist/browser/models/attestationSigner.js +2 -3
- package/dist/browser/models/attestationSigner.js.map +1 -1
- package/dist/browser/models/attestationToken.js +12 -8
- package/dist/browser/models/attestationToken.js.map +1 -1
- package/dist/browser/models/storedAttestationPolicy.js +4 -0
- package/dist/browser/models/storedAttestationPolicy.js.map +1 -1
- package/dist/commonjs/attestationAdministrationClient.js +24 -22
- package/dist/commonjs/attestationAdministrationClient.js.map +1 -1
- package/dist/commonjs/attestationClient.js +23 -21
- package/dist/commonjs/attestationClient.js.map +1 -1
- package/dist/commonjs/generated/generatedClient.js +14 -3
- package/dist/commonjs/generated/generatedClient.js.map +1 -1
- package/dist/commonjs/generated/operations/attestation.js +4 -3
- package/dist/commonjs/generated/operations/attestation.js.map +1 -1
- package/dist/commonjs/generated/operations/metadataConfiguration.js +2 -1
- package/dist/commonjs/generated/operations/metadataConfiguration.js.map +1 -1
- package/dist/commonjs/generated/operations/policy.js +4 -3
- package/dist/commonjs/generated/operations/policy.js.map +1 -1
- package/dist/commonjs/generated/operations/policyCertificates.js +4 -3
- package/dist/commonjs/generated/operations/policyCertificates.js.map +1 -1
- package/dist/commonjs/generated/operations/signingCertificates.js +2 -1
- package/dist/commonjs/generated/operations/signingCertificates.js.map +1 -1
- package/dist/commonjs/models/attestationResult.js +17 -0
- package/dist/commonjs/models/attestationResult.js.map +1 -1
- package/dist/commonjs/models/attestationSigner.js +2 -3
- package/dist/commonjs/models/attestationSigner.js.map +1 -1
- package/dist/commonjs/models/attestationToken.js +12 -8
- package/dist/commonjs/models/attestationToken.js.map +1 -1
- package/dist/commonjs/models/storedAttestationPolicy.js +4 -0
- package/dist/commonjs/models/storedAttestationPolicy.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/esm/attestationAdministrationClient.js +24 -22
- package/dist/esm/attestationAdministrationClient.js.map +1 -1
- package/dist/esm/attestationClient.js +23 -21
- package/dist/esm/attestationClient.js.map +1 -1
- package/dist/esm/generated/generatedClient.js +14 -3
- package/dist/esm/generated/generatedClient.js.map +1 -1
- package/dist/esm/generated/operations/attestation.js +4 -3
- package/dist/esm/generated/operations/attestation.js.map +1 -1
- package/dist/esm/generated/operations/metadataConfiguration.js +2 -1
- package/dist/esm/generated/operations/metadataConfiguration.js.map +1 -1
- package/dist/esm/generated/operations/policy.js +4 -3
- package/dist/esm/generated/operations/policy.js.map +1 -1
- package/dist/esm/generated/operations/policyCertificates.js +4 -3
- package/dist/esm/generated/operations/policyCertificates.js.map +1 -1
- package/dist/esm/generated/operations/signingCertificates.js +2 -1
- package/dist/esm/generated/operations/signingCertificates.js.map +1 -1
- package/dist/esm/models/attestationResult.js +17 -0
- package/dist/esm/models/attestationResult.js.map +1 -1
- package/dist/esm/models/attestationSigner.js +2 -3
- package/dist/esm/models/attestationSigner.js.map +1 -1
- package/dist/esm/models/attestationToken.js +12 -8
- package/dist/esm/models/attestationToken.js.map +1 -1
- package/dist/esm/models/storedAttestationPolicy.js +4 -0
- package/dist/esm/models/storedAttestationPolicy.js.map +1 -1
- package/dist/esm/utils/textEncoding-browser.d.mts +8 -2
- package/dist/esm/utils/textEncoding-browser.d.mts.map +1 -1
- package/dist/react-native/attestationAdministrationClient.js +24 -22
- package/dist/react-native/attestationAdministrationClient.js.map +1 -1
- package/dist/react-native/attestationClient.js +23 -21
- package/dist/react-native/attestationClient.js.map +1 -1
- package/dist/react-native/generated/generatedClient.js +14 -3
- package/dist/react-native/generated/generatedClient.js.map +1 -1
- package/dist/react-native/generated/operations/attestation.js +4 -3
- package/dist/react-native/generated/operations/attestation.js.map +1 -1
- package/dist/react-native/generated/operations/metadataConfiguration.js +2 -1
- package/dist/react-native/generated/operations/metadataConfiguration.js.map +1 -1
- package/dist/react-native/generated/operations/policy.js +4 -3
- package/dist/react-native/generated/operations/policy.js.map +1 -1
- package/dist/react-native/generated/operations/policyCertificates.js +4 -3
- package/dist/react-native/generated/operations/policyCertificates.js.map +1 -1
- package/dist/react-native/generated/operations/signingCertificates.js +2 -1
- package/dist/react-native/generated/operations/signingCertificates.js.map +1 -1
- package/dist/react-native/models/attestationResult.js +17 -0
- package/dist/react-native/models/attestationResult.js.map +1 -1
- package/dist/react-native/models/attestationSigner.js +2 -3
- package/dist/react-native/models/attestationSigner.js.map +1 -1
- package/dist/react-native/models/attestationToken.js +12 -8
- package/dist/react-native/models/attestationToken.js.map +1 -1
- package/dist/react-native/models/storedAttestationPolicy.js +4 -0
- package/dist/react-native/models/storedAttestationPolicy.js.map +1 -1
- package/dist/react-native/utils/textEncoding-browser.d.mts +8 -2
- package/dist/react-native/utils/textEncoding-browser.d.mts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatedClient.js","sourceRoot":"","sources":["../../../src/generated/generatedClient.ts"],"names":[],"mappings":"AAAA;;;;;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;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAS;IACf,kBAAkB,CAAqB;IACvC,WAAW,CAAc;IACzB,mBAAmB,CAAsB;IACzC,qBAAqB,CAAwB;CAC9C","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport {\n PolicyImpl,\n PolicyCertificatesImpl,\n AttestationImpl,\n SigningCertificatesImpl,\n MetadataConfigurationImpl\n} from \"./operations/index.js\";\nimport {\n Policy,\n PolicyCertificates,\n Attestation,\n SigningCertificates,\n MetadataConfiguration\n} from \"./operationsInterfaces/index.js\";\nimport { GeneratedClientOptionalParams } from \"./models/index.js\";\n\nexport class GeneratedClient extends coreClient.ServiceClient {\n instanceUrl: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the GeneratedClient class.\n * @param instanceUrl The attestation instance base URI, for example https://mytenant.attest.azure.net.\n * @param options The parameter options\n */\n constructor(instanceUrl: string, options?: GeneratedClientOptionalParams) {\n if (instanceUrl === undefined) {\n throw new Error(\"'instanceUrl' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: GeneratedClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-attestation/1.0.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{instanceUrl}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.instanceUrl = instanceUrl;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2020-10-01\";\n this.policy = new PolicyImpl(this);\n this.policyCertificates = new PolicyCertificatesImpl(this);\n this.attestation = new AttestationImpl(this);\n this.signingCertificates = new SigningCertificatesImpl(this);\n this.metadataConfiguration = new MetadataConfigurationImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n policy: Policy;\n policyCertificates: PolicyCertificates;\n attestation: Attestation;\n signingCertificates: SigningCertificates;\n metadataConfiguration: MetadataConfiguration;\n}\n"]}
|
|
@@ -11,6 +11,7 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing Attestation operations. */
|
|
13
13
|
export class AttestationImpl {
|
|
14
|
+
client;
|
|
14
15
|
/**
|
|
15
16
|
* Initialize a new instance of the class Attestation class.
|
|
16
17
|
* @param client Reference to the service client
|
|
@@ -25,7 +26,7 @@ export class AttestationImpl {
|
|
|
25
26
|
* @param options The options parameters.
|
|
26
27
|
*/
|
|
27
28
|
async attestOpenEnclave(request, options) {
|
|
28
|
-
return tracingClient.withSpan("GeneratedClient.attestOpenEnclave", options
|
|
29
|
+
return tracingClient.withSpan("GeneratedClient.attestOpenEnclave", options ?? {}, async (options) => {
|
|
29
30
|
return this.client.sendOperationRequest({ request, options }, attestOpenEnclaveOperationSpec);
|
|
30
31
|
});
|
|
31
32
|
}
|
|
@@ -36,7 +37,7 @@ export class AttestationImpl {
|
|
|
36
37
|
* @param options The options parameters.
|
|
37
38
|
*/
|
|
38
39
|
async attestSgxEnclave(request, options) {
|
|
39
|
-
return tracingClient.withSpan("GeneratedClient.attestSgxEnclave", options
|
|
40
|
+
return tracingClient.withSpan("GeneratedClient.attestSgxEnclave", options ?? {}, async (options) => {
|
|
40
41
|
return this.client.sendOperationRequest({ request, options }, attestSgxEnclaveOperationSpec);
|
|
41
42
|
});
|
|
42
43
|
}
|
|
@@ -47,7 +48,7 @@ export class AttestationImpl {
|
|
|
47
48
|
* @param options The options parameters.
|
|
48
49
|
*/
|
|
49
50
|
async attestTpm(request, options) {
|
|
50
|
-
return tracingClient.withSpan("GeneratedClient.attestTpm", options
|
|
51
|
+
return tracingClient.withSpan("GeneratedClient.attestTpm", options ?? {}, async (options) => {
|
|
51
52
|
return this.client.sendOperationRequest({ request, options }, attestTpmOperationSpec);
|
|
52
53
|
});
|
|
53
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attestation.js","sourceRoot":"","sources":["../../../../src/generated/operations/attestation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AActD,+CAA+C;AAC/C,MAAM,OAAO,eAAe;
|
|
1
|
+
{"version":3,"file":"attestation.js","sourceRoot":"","sources":["../../../../src/generated/operations/attestation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AActD,+CAA+C;AAC/C,MAAM,OAAO,eAAe;IACT,MAAM,CAAkB;IAEzC;;;OAGG;IACH,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,iBAAiB,CACrB,OAAiC,EACjC,OAAoD;QAEpD,OAAO,aAAa,CAAC,QAAQ,CAC3B,mCAAmC,EACnC,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,OAAO,EAAE,OAAO,EAAE,EACpB,8BAA8B,CACkB,CAAC;QACrD,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,gBAAgB,CACpB,OAAgC,EAChC,OAAmD;QAEnD,OAAO,aAAa,CAAC,QAAQ,CAC3B,kCAAkC,EAClC,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,OAAO,EAAE,OAAO,EAAE,EACpB,6BAA6B,CACkB,CAAC;QACpD,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CACb,OAA8B,EAC9B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AAU,CAAC,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC;IAC9D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC;AACF,MAAM,sBAAsB,GAA6B;IACvD,IAAI,EAAE,aAAa;IACnB,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,sBAAsB;SAC3C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,WAAW,EAAE,UAAU,CAAC,QAAQ;IAChC,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;IACvC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC;IAC9D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport { Attestation } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { GeneratedClient } from \"../generatedClient.js\";\nimport {\n AttestOpenEnclaveRequest,\n AttestationAttestOpenEnclaveOptionalParams,\n AttestationAttestOpenEnclaveResponse,\n AttestSgxEnclaveRequest,\n AttestationAttestSgxEnclaveOptionalParams,\n AttestationAttestSgxEnclaveResponse,\n TpmAttestationRequest,\n AttestationAttestTpmOptionalParams,\n AttestationAttestTpmResponse\n} from \"../models/index.js\";\n\n/** Class containing Attestation operations. */\nexport class AttestationImpl implements Attestation {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class Attestation class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * Processes an OpenEnclave report , producing an artifact. The type of artifact produced is dependent\n * upon attestation policy.\n * @param request Request object containing the quote\n * @param options The options parameters.\n */\n async attestOpenEnclave(\n request: AttestOpenEnclaveRequest,\n options?: AttestationAttestOpenEnclaveOptionalParams\n ): Promise<AttestationAttestOpenEnclaveResponse> {\n return tracingClient.withSpan(\n \"GeneratedClient.attestOpenEnclave\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { request, options },\n attestOpenEnclaveOperationSpec\n ) as Promise<AttestationAttestOpenEnclaveResponse>;\n }\n );\n }\n\n /**\n * Processes an SGX enclave quote, producing an artifact. The type of artifact produced is dependent\n * upon attestation policy.\n * @param request Request object containing the quote\n * @param options The options parameters.\n */\n async attestSgxEnclave(\n request: AttestSgxEnclaveRequest,\n options?: AttestationAttestSgxEnclaveOptionalParams\n ): Promise<AttestationAttestSgxEnclaveResponse> {\n return tracingClient.withSpan(\n \"GeneratedClient.attestSgxEnclave\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { request, options },\n attestSgxEnclaveOperationSpec\n ) as Promise<AttestationAttestSgxEnclaveResponse>;\n }\n );\n }\n\n /**\n * Processes attestation evidence from a VBS enclave, producing an attestation result. The attestation\n * result produced is dependent upon the attestation policy.\n * @param request Request object\n * @param options The options parameters.\n */\n async attestTpm(\n request: TpmAttestationRequest,\n options?: AttestationAttestTpmOptionalParams\n ): Promise<AttestationAttestTpmResponse> {\n return tracingClient.withSpan(\n \"GeneratedClient.attestTpm\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { request, options },\n attestTpmOperationSpec\n ) as Promise<AttestationAttestTpmResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst attestOpenEnclaveOperationSpec: coreClient.OperationSpec = {\n path: \"/attest/OpenEnclave\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.AttestationResponse\n },\n default: {\n bodyMapper: Mappers.CloudError\n }\n },\n requestBody: Parameters.request,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.instanceUrl],\n headerParameters: [Parameters.accept, Parameters.contentType1],\n mediaType: \"json\",\n serializer\n};\nconst attestSgxEnclaveOperationSpec: coreClient.OperationSpec = {\n path: \"/attest/SgxEnclave\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.AttestationResponse\n },\n default: {\n bodyMapper: Mappers.CloudError\n }\n },\n requestBody: Parameters.request1,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.instanceUrl],\n headerParameters: [Parameters.accept, Parameters.contentType1],\n mediaType: \"json\",\n serializer\n};\nconst attestTpmOperationSpec: coreClient.OperationSpec = {\n path: \"/attest/Tpm\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.TpmAttestationResponse\n },\n default: {\n bodyMapper: Mappers.CloudError\n }\n },\n requestBody: Parameters.request2,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.instanceUrl],\n headerParameters: [Parameters.accept, Parameters.contentType1],\n mediaType: \"json\",\n serializer\n};\n"]}
|
|
@@ -11,6 +11,7 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing MetadataConfiguration operations. */
|
|
13
13
|
export class MetadataConfigurationImpl {
|
|
14
|
+
client;
|
|
14
15
|
/**
|
|
15
16
|
* Initialize a new instance of the class MetadataConfiguration class.
|
|
16
17
|
* @param client Reference to the service client
|
|
@@ -23,7 +24,7 @@ export class MetadataConfigurationImpl {
|
|
|
23
24
|
* @param options The options parameters.
|
|
24
25
|
*/
|
|
25
26
|
async get(options) {
|
|
26
|
-
return tracingClient.withSpan("GeneratedClient.get", options
|
|
27
|
+
return tracingClient.withSpan("GeneratedClient.get", options ?? {}, async (options) => {
|
|
27
28
|
return this.client.sendOperationRequest({ options }, getOperationSpec);
|
|
28
29
|
});
|
|
29
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadataConfiguration.js","sourceRoot":"","sources":["../../../../src/generated/operations/metadataConfiguration.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,yDAAyD;AACzD,MAAM,OAAO,yBAAyB;
|
|
1
|
+
{"version":3,"file":"metadataConfiguration.js","sourceRoot":"","sources":["../../../../src/generated/operations/metadataConfiguration.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,yDAAyD;AACzD,MAAM,OAAO,yBAAyB;IACnB,MAAM,CAAkB;IAEzC;;;OAGG;IACH,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,GAAG,CACP,OAAgD;QAEhD,OAAO,aAAa,CAAC,QAAQ,CAC3B,qBAAqB,EACrB,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,OAAO,EAAE,EACX,gBAAgB,CAC4B,CAAC;QACjD,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,gBAAgB,GAA6B;IACjD,IAAI,EAAE,mCAAmC;IACzC,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;aAC/D;SACF;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;IACvC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport { MetadataConfiguration } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { GeneratedClient } from \"../generatedClient.js\";\nimport {\n MetadataConfigurationGetOptionalParams,\n MetadataConfigurationGetResponse\n} from \"../models/index.js\";\n\n/** Class containing MetadataConfiguration operations. */\nexport class MetadataConfigurationImpl implements MetadataConfiguration {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class MetadataConfiguration class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * Retrieves metadata about the attestation signing keys in use by the attestation service\n * @param options The options parameters.\n */\n async get(\n options?: MetadataConfigurationGetOptionalParams\n ): Promise<MetadataConfigurationGetResponse> {\n return tracingClient.withSpan(\n \"GeneratedClient.get\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getOperationSpec\n ) as Promise<MetadataConfigurationGetResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/.well-known/openid-configuration\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Dictionary\", value: { type: { name: \"any\" } } }\n }\n },\n default: {\n bodyMapper: Mappers.CloudError\n }\n },\n urlParameters: [Parameters.instanceUrl],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
@@ -11,6 +11,7 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing Policy operations. */
|
|
13
13
|
export class PolicyImpl {
|
|
14
|
+
client;
|
|
14
15
|
/**
|
|
15
16
|
* Initialize a new instance of the class Policy class.
|
|
16
17
|
* @param client Reference to the service client
|
|
@@ -25,7 +26,7 @@ export class PolicyImpl {
|
|
|
25
26
|
* @param options The options parameters.
|
|
26
27
|
*/
|
|
27
28
|
async get(attestationType, options) {
|
|
28
|
-
return tracingClient.withSpan("GeneratedClient.get", options
|
|
29
|
+
return tracingClient.withSpan("GeneratedClient.get", options ?? {}, async (options) => {
|
|
29
30
|
return this.client.sendOperationRequest({ attestationType, options }, getOperationSpec);
|
|
30
31
|
});
|
|
31
32
|
}
|
|
@@ -38,7 +39,7 @@ export class PolicyImpl {
|
|
|
38
39
|
* @param options The options parameters.
|
|
39
40
|
*/
|
|
40
41
|
async set(attestationType, newAttestationPolicy, options) {
|
|
41
|
-
return tracingClient.withSpan("GeneratedClient.set", options
|
|
42
|
+
return tracingClient.withSpan("GeneratedClient.set", options ?? {}, async (options) => {
|
|
42
43
|
return this.client.sendOperationRequest({ attestationType, newAttestationPolicy, options }, setOperationSpec);
|
|
43
44
|
});
|
|
44
45
|
}
|
|
@@ -50,7 +51,7 @@ export class PolicyImpl {
|
|
|
50
51
|
* @param options The options parameters.
|
|
51
52
|
*/
|
|
52
53
|
async reset(attestationType, policyJws, options) {
|
|
53
|
-
return tracingClient.withSpan("GeneratedClient.reset", options
|
|
54
|
+
return tracingClient.withSpan("GeneratedClient.reset", options ?? {}, async (options) => {
|
|
54
55
|
return this.client.sendOperationRequest({ attestationType, policyJws, options }, resetOperationSpec);
|
|
55
56
|
});
|
|
56
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../../../src/generated/operations/policy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAYtD,0CAA0C;AAC1C,MAAM,OAAO,UAAU;
|
|
1
|
+
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../../../src/generated/operations/policy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAYtD,0CAA0C;AAC1C,MAAM,OAAO,UAAU;IACJ,MAAM,CAAkB;IAEzC;;;OAGG;IACH,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,GAAG,CACP,eAAgC,EAChC,OAAiC;QAEjC,OAAO,aAAa,CAAC,QAAQ,CAC3B,qBAAqB,EACrB,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,eAAe,EAAE,OAAO,EAAE,E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MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,gBAAgB,GAA6B;IACjD,IAAI,EAAE,6BAA6B;IACnC,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,cAAc;SACnC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,WAAW,EAAE,UAAU,CAAC,oBAAoB;IAC5C,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,eAAe,CAAC;IACnE,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,OAAO,CAAC;IAC9D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC;AACF,MAAM,kBAAkB,GAA6B;IACnD,IAAI,EAAE,mCAAmC;IACzC,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,cAAc;SACnC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,WAAW,EAAE,UAAU,CAAC,SAAS;IACjC,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,eAAe,CAAC;IACnE,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,OAAO,CAAC;IAC9D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport { Policy } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { GeneratedClient } from \"../generatedClient.js\";\nimport {\n AttestationType,\n PolicyGetOptionalParams,\n PolicyGetResponse,\n PolicySetModelOptionalParams,\n PolicySetModelResponse,\n PolicyResetOptionalParams,\n PolicyResetResponse\n} from \"../models/index.js\";\n\n/** Class containing Policy operations. */\nexport class PolicyImpl implements Policy {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class Policy class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * Retrieves the current policy for an attestation type.\n * @param attestationType Specifies the trusted execution environment to be used to validate the\n * evidence\n * @param options The options parameters.\n */\n async get(\n attestationType: AttestationType,\n options?: PolicyGetOptionalParams\n ): Promise<PolicyGetResponse> {\n return tracingClient.withSpan(\n \"GeneratedClient.get\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { attestationType, options },\n getOperationSpec\n ) as Promise<PolicyGetResponse>;\n }\n );\n }\n\n /**\n * Sets the policy for a given attestation type.\n * @param attestationType Specifies the trusted execution environment to be used to validate the\n * evidence\n * @param newAttestationPolicy JWT Expressing the new policy whose body is a StoredAttestationPolicy\n * object.\n * @param options The options parameters.\n */\n async set(\n attestationType: AttestationType,\n newAttestationPolicy: string,\n options?: PolicySetModelOptionalParams\n ): Promise<PolicySetModelResponse> {\n return tracingClient.withSpan(\n \"GeneratedClient.set\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { attestationType, newAttestationPolicy, options },\n setOperationSpec\n ) as Promise<PolicySetModelResponse>;\n }\n );\n }\n\n /**\n * Resets the attestation policy for the specified tenant and reverts to the default policy.\n * @param attestationType Specifies the trusted execution environment to be used to validate the\n * evidence\n * @param policyJws JSON Web Signature with an empty policy document\n * @param options The options parameters.\n */\n async reset(\n attestationType: AttestationType,\n policyJws: string,\n options?: PolicyResetOptionalParams\n ): Promise<PolicyResetResponse> {\n return tracingClient.withSpan(\n \"GeneratedClient.reset\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { attestationType, policyJws, options },\n resetOperationSpec\n ) as Promise<PolicyResetResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/policies/{attestationType}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PolicyResponse\n },\n default: {\n bodyMapper: Mappers.CloudError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.instanceUrl, Parameters.attestationType],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst setOperationSpec: coreClient.OperationSpec = {\n path: \"/policies/{attestationType}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n bodyMapper: Mappers.PolicyResponse\n },\n default: {\n bodyMapper: Mappers.CloudError\n }\n },\n requestBody: Parameters.newAttestationPolicy,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.instanceUrl, Parameters.attestationType],\n headerParameters: [Parameters.contentType, Parameters.accept1],\n mediaType: \"text\",\n serializer\n};\nconst resetOperationSpec: coreClient.OperationSpec = {\n path: \"/policies/{attestationType}:reset\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.PolicyResponse\n },\n default: {\n bodyMapper: Mappers.CloudError\n }\n },\n requestBody: Parameters.policyJws,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.instanceUrl, Parameters.attestationType],\n headerParameters: [Parameters.contentType, Parameters.accept1],\n mediaType: \"text\",\n serializer\n};\n"]}
|
|
@@ -11,6 +11,7 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing PolicyCertificates operations. */
|
|
13
13
|
export class PolicyCertificatesImpl {
|
|
14
|
+
client;
|
|
14
15
|
/**
|
|
15
16
|
* Initialize a new instance of the class PolicyCertificates class.
|
|
16
17
|
* @param client Reference to the service client
|
|
@@ -23,7 +24,7 @@ export class PolicyCertificatesImpl {
|
|
|
23
24
|
* @param options The options parameters.
|
|
24
25
|
*/
|
|
25
26
|
async get(options) {
|
|
26
|
-
return tracingClient.withSpan("GeneratedClient.get", options
|
|
27
|
+
return tracingClient.withSpan("GeneratedClient.get", options ?? {}, async (options) => {
|
|
27
28
|
return this.client.sendOperationRequest({ options }, getOperationSpec);
|
|
28
29
|
});
|
|
29
30
|
}
|
|
@@ -34,7 +35,7 @@ export class PolicyCertificatesImpl {
|
|
|
34
35
|
* @param options The options parameters.
|
|
35
36
|
*/
|
|
36
37
|
async add(policyCertificateToAdd, options) {
|
|
37
|
-
return tracingClient.withSpan("GeneratedClient.add", options
|
|
38
|
+
return tracingClient.withSpan("GeneratedClient.add", options ?? {}, async (options) => {
|
|
38
39
|
return this.client.sendOperationRequest({ policyCertificateToAdd, options }, addOperationSpec);
|
|
39
40
|
});
|
|
40
41
|
}
|
|
@@ -47,7 +48,7 @@ export class PolicyCertificatesImpl {
|
|
|
47
48
|
* @param options The options parameters.
|
|
48
49
|
*/
|
|
49
50
|
async remove(policyCertificateToRemove, options) {
|
|
50
|
-
return tracingClient.withSpan("GeneratedClient.remove", options
|
|
51
|
+
return tracingClient.withSpan("GeneratedClient.remove", options ?? {}, async (options) => {
|
|
51
52
|
return this.client.sendOperationRequest({ policyCertificateToRemove, options }, removeOperationSpec);
|
|
52
53
|
});
|
|
53
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policyCertificates.js","sourceRoot":"","sources":["../../../../src/generated/operations/policyCertificates.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAWtD,sDAAsD;AACtD,MAAM,OAAO,sBAAsB;
|
|
1
|
+
{"version":3,"file":"policyCertificates.js","sourceRoot":"","sources":["../../../../src/generated/operations/policyCertificates.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAWtD,sDAAsD;AACtD,MAAM,OAAO,sBAAsB;IAChB,MAAM,CAAkB;IAEzC;;;OAGG;IACH,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,GAAG,CACP,OAA6C;QAE7C,OAAO,aAAa,CAAC,QAAQ,CAC3B,qBAAqB,EACrB,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,OAAO,EAAE,EACX,gBAAgB,CACyB,CAAC;QAC9C,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,GAAG,CACP,sBAA8B,EAC9B,OAA6C;QAE7C,OAAO,aAAa,CAAC,QAAQ,CAC3B,qBAAqB,EACrB,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,sBAAsB,EAAE,OAAO,EAAE,EACnC,gBAAgB,CACyB,CAAC;QAC9C,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,MAAM,CACV,yBAAiC,EACjC,OAAgD;QAEhD,OAAO,aAAa,CAAC,QAAQ,CAC3B,wBAAwB,EACxB,OAAO,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U,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,gCAAgC;SACrD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,WAAW,EAAE,UAAU,CAAC,yBAAyB;IACjD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;IACvC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC;IAC9D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport { PolicyCertificates } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { GeneratedClient } from \"../generatedClient.js\";\nimport {\n PolicyCertificatesGetOptionalParams,\n PolicyCertificatesGetResponse,\n PolicyCertificatesAddOptionalParams,\n PolicyCertificatesAddResponse,\n PolicyCertificatesRemoveOptionalParams,\n PolicyCertificatesRemoveResponse\n} from \"../models/index.js\";\n\n/** Class containing PolicyCertificates operations. */\nexport class PolicyCertificatesImpl implements PolicyCertificates {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class PolicyCertificates class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * Retrieves the set of certificates used to express policy for the current tenant.\n * @param options The options parameters.\n */\n async get(\n options?: PolicyCertificatesGetOptionalParams\n ): Promise<PolicyCertificatesGetResponse> {\n return tracingClient.withSpan(\n \"GeneratedClient.get\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getOperationSpec\n ) as Promise<PolicyCertificatesGetResponse>;\n }\n );\n }\n\n /**\n * Adds a new attestation policy certificate to the set of policy management certificates.\n * @param policyCertificateToAdd An RFC7519 JSON Web Token whose body is an RFC7517 JSON Web Key\n * object. The RFC7519 JWT must be signed with one of the existing signing certificates\n * @param options The options parameters.\n */\n async add(\n policyCertificateToAdd: string,\n options?: PolicyCertificatesAddOptionalParams\n ): Promise<PolicyCertificatesAddResponse> {\n return tracingClient.withSpan(\n \"GeneratedClient.add\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { policyCertificateToAdd, options },\n addOperationSpec\n ) as Promise<PolicyCertificatesAddResponse>;\n }\n );\n }\n\n /**\n * Removes the specified policy management certificate. Note that the final policy management\n * certificate cannot be removed.\n * @param policyCertificateToRemove An RFC7519 JSON Web Token whose body is an\n * AttestationCertificateManagementBody object. The RFC7519 JWT must be signed with one of the existing\n * signing certificates\n * @param options The options parameters.\n */\n async remove(\n policyCertificateToRemove: string,\n options?: PolicyCertificatesRemoveOptionalParams\n ): Promise<PolicyCertificatesRemoveResponse> {\n return tracingClient.withSpan(\n \"GeneratedClient.remove\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { policyCertificateToRemove, options },\n removeOperationSpec\n ) as Promise<PolicyCertificatesRemoveResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/certificates\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PolicyCertificatesResponse\n },\n default: {\n bodyMapper: Mappers.CloudError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.instanceUrl],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst addOperationSpec: coreClient.OperationSpec = {\n path: \"/certificates:add\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.PolicyCertificatesModifyResponse\n },\n default: {\n bodyMapper: Mappers.CloudError\n }\n },\n requestBody: Parameters.policyCertificateToAdd,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.instanceUrl],\n headerParameters: [Parameters.accept, Parameters.contentType1],\n mediaType: \"json\",\n serializer\n};\nconst removeOperationSpec: coreClient.OperationSpec = {\n path: \"/certificates:remove\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.PolicyCertificatesModifyResponse\n },\n default: {\n bodyMapper: Mappers.CloudError\n }\n },\n requestBody: Parameters.policyCertificateToRemove,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.instanceUrl],\n headerParameters: [Parameters.accept, Parameters.contentType1],\n mediaType: \"json\",\n serializer\n};\n"]}
|
|
@@ -11,6 +11,7 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing SigningCertificates operations. */
|
|
13
13
|
export class SigningCertificatesImpl {
|
|
14
|
+
client;
|
|
14
15
|
/**
|
|
15
16
|
* Initialize a new instance of the class SigningCertificates class.
|
|
16
17
|
* @param client Reference to the service client
|
|
@@ -23,7 +24,7 @@ export class SigningCertificatesImpl {
|
|
|
23
24
|
* @param options The options parameters.
|
|
24
25
|
*/
|
|
25
26
|
async get(options) {
|
|
26
|
-
return tracingClient.withSpan("GeneratedClient.get", options
|
|
27
|
+
return tracingClient.withSpan("GeneratedClient.get", options ?? {}, async (options) => {
|
|
27
28
|
return this.client.sendOperationRequest({ options }, getOperationSpec);
|
|
28
29
|
});
|
|
29
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signingCertificates.js","sourceRoot":"","sources":["../../../../src/generated/operations/signingCertificates.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,uDAAuD;AACvD,MAAM,OAAO,uBAAuB;
|
|
1
|
+
{"version":3,"file":"signingCertificates.js","sourceRoot":"","sources":["../../../../src/generated/operations/signingCertificates.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,uDAAuD;AACvD,MAAM,OAAO,uBAAuB;IACjB,MAAM,CAAkB;IAEzC;;;OAGG;IACH,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,GAAG,CACP,OAA8C;QAE9C,OAAO,aAAa,CAAC,QAAQ,CAC3B,qBAAqB,EACrB,OAAO,IAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,OAAO,EAAE,EACX,gBAAgB,CAC0B,CAAC;QAC/C,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,gBAAgB,GAA6B;IACjD,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;IACvC,gBAAgB,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;IACtC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport { SigningCertificates } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { GeneratedClient } from \"../generatedClient.js\";\nimport {\n SigningCertificatesGetOptionalParams,\n SigningCertificatesGetResponse\n} from \"../models/index.js\";\n\n/** Class containing SigningCertificates operations. */\nexport class SigningCertificatesImpl implements SigningCertificates {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class SigningCertificates class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * Retrieves metadata signing certificates in use by the attestation service\n * @param options The options parameters.\n */\n async get(\n options?: SigningCertificatesGetOptionalParams\n ): Promise<SigningCertificatesGetResponse> {\n return tracingClient.withSpan(\n \"GeneratedClient.get\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getOperationSpec\n ) as Promise<SigningCertificatesGetResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/certs\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.JsonWebKeySet\n },\n default: {\n bodyMapper: Mappers.CloudError\n }\n },\n urlParameters: [Parameters.instanceUrl],\n headerParameters: [Parameters.accept2],\n serializer\n};\n"]}
|
|
@@ -30,6 +30,23 @@ export class AttestationResultImpl {
|
|
|
30
30
|
this._enclaveHeldData = params.enclaveHeldData;
|
|
31
31
|
this._sgxCollateral = params.sgxCollateral;
|
|
32
32
|
}
|
|
33
|
+
_issuer;
|
|
34
|
+
_version;
|
|
35
|
+
_nonce;
|
|
36
|
+
_uniqueId;
|
|
37
|
+
_runTimeClaims;
|
|
38
|
+
_initTimeClaims;
|
|
39
|
+
_policyClaims;
|
|
40
|
+
_verifierType;
|
|
41
|
+
_policySigner;
|
|
42
|
+
_policyHash;
|
|
43
|
+
_isDebuggable;
|
|
44
|
+
_productId;
|
|
45
|
+
_mrEnclave;
|
|
46
|
+
_mrSigner;
|
|
47
|
+
_svn;
|
|
48
|
+
_enclaveHeldData;
|
|
49
|
+
_sgxCollateral;
|
|
33
50
|
/**
|
|
34
51
|
* Unique Identifier for the token
|
|
35
52
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attestationResult.js","sourceRoot":"","sources":["../../../src/models/attestationResult.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAqLzE;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAChC;;;;;OAKG;IACH,YAAY,MAkBX;QACC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAA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AC,eAAe;QAC1C,aAAa,EAAE,SAAS,CAAC,aAAa;KACvC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AttestationSigner } from \"./index.js\";\nimport type { GeneratedAttestationResult } from \"../generated/index.js\";\nimport { _attestationSignerFromGenerated } from \"./attestationSigner.js\";\n\n/**\n * Defines the contents of the {@link AttestationResult.sgxCollateral} claim in\n * an {@link AttestationResult}.\n */\nexport interface AttestationSgxCollateralInfo {\n /**\n * Hex encoded Sha256 hash of the Quoting Enclave Certificates.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n qeidcertshash?: string;\n /**\n * Hex encoded Sha256 hash of the Quoting Enclave Certificate CRL.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n qeidcrlhash?: string;\n /**\n * Hex encoded Sha256 hash of the Quoting Enclave Identity.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n qeidhash?: string;\n /**\n * Hex encoded Sha256 hash of the SGX Quote or OpenEnclave Report validated\n * by this token.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n quotehash?: string;\n /**\n * Hex encoded Sha256 hash of the TCB Info Certificates.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n tcbinfocertshash?: string;\n /**\n * Hex encoded Sha256 hash of the TCB Info Certificate CRL.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n tcbinfocrlhash?: string;\n /**\n * Hex encoded Sha256 hash of the TCB Info for the device being attested.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n tcbinfohash?: string;\n}\n\n/**\n * A Microsoft Azure Attestation response token body - the body of a response token issued by MAA\n */\nexport interface AttestationResult {\n /**\n * Unique Identifier for the token.\n *\n * Corresponds to the 'jti' claim defined in\n * {@link https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.7 | RFC 7519 section 4.1.7}\n */\n uniqueId: string;\n\n /**\n * Returns the issuer of the attestation token. MUST be the same as the\n * endpoint used when constructing the attestation client instance.\n */\n issuer: string;\n\n /**\n * Returns the \"nonce\" value if one was specified in the Attest request.\n */\n nonce?: string;\n\n /**\n * The Schema version of this structure. Current Value: 1.0\n */\n version: string;\n\n /**\n * Returns the runtime claims in the token.\n *\n * This value will match the input `runTimeJson` property to the\n * {@link AttestationClient.attestSgxEnclave} or\n * {@link AttestationClient.attestOpenEnclave} API.\n *\n * @remarks\n *\n * The `runtimeClaims` property will only be populated if the\n * `runtimeJson` parameter to the `Attest` API is specified. It will\n * not be populated if the `runtimeData` parameter is specified.\n */\n runTimeClaims: unknown;\n /**\n * Returns the initialization time claims in the token.\n * This value will match the input `initTimeJson` property to the\n * {@link AttestationClient.attestSgxEnclave} or\n * {@link AttestationClient.attestOpenEnclave} API.\n *\n * @remarks\n *\n * The `initTimeClaims` property will only be populated if the `initTimeJson`\n * parameter to the `Attest` API is specified. It will not be populated if\n * the `initTimeData` parameter is specified.\n */\n initTimeClaims: unknown;\n\n /**\n * Returns the set of claims generated by the attestation policy on the instance.\n */\n policyClaims: unknown;\n\n /**\n * Returns the verifier which generated this attestation token. Normally one of:\n * \"SGX\" or \"TPM\", but others can be specified.\n */\n verifierType: string;\n /**\n * The certificate used to sign the policy object, if specified.\n */\n policySigner?: AttestationSigner;\n /**\n * The base64url encoded SHA256 hash of the BASE64URL encoded policy text\n * used for attestation.\n */\n policyHash: Uint8Array;\n /**\n * True if the enclave is debuggable, false otherwise. Only valid if `verifierType` is SGX.\n */\n isDebuggable?: boolean;\n\n /**\n * The SGX Product ID for the enclave. Only valid if the `verifierType` field is \"SGX\"\n */\n productId?: number;\n /**\n * The HEX encoded SGX MRENCLAVE value for the enclave. Only valid if the\n * `verifierType` field is \"SGX\"\n */\n mrEnclave?: string;\n\n /**\n * The HEX encoded SGX MRSIGNER value for the enclave. Only valid if the\n * `verifierType` field is \"SGX\"\n */\n mrSigner?: string;\n\n /**\n * The SGX SVN value for the enclave. Only valid if the `verifierType` field is \"SGX\"\n */\n svn?: number;\n\n /**\n * Returns the value of the runtime_data field specified as an input to the\n * {@link AttestationClient.attestSgxEnclave} or {@link AttestationClient.attestOpenEnclave} API.\n *\n * @remarks\n *\n * The `enclaveHeldData` property will only be populated if the\n * `runtimeData` parameter to the `Attest` API is specified.\n */\n enclaveHeldData?: Uint8Array;\n\n /**\n * Returns a set of information describing the complete set of inputs to the\n * Attestation validation logic.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n sgxCollateral?: AttestationSgxCollateralInfo;\n}\n\n/**\n * A Microsoft Azure Attestation response token body - the body of a response token issued by MAA\n */\nexport class AttestationResultImpl implements AttestationResult {\n /**\n *\n * @param params - The parameters for the constructor.\n *\n * @hidden\n */\n constructor(params: {\n issuer: string;\n version: string;\n nonce?: string;\n uniqueId: string;\n runTimeClaims?: unknown;\n initTimeClaims?: unknown;\n policyClaims?: unknown;\n verifierType: string;\n policySigner?: AttestationSigner;\n policyHash: Uint8Array;\n isDebuggable?: boolean;\n productId?: number;\n mrEnclave?: string;\n mrSigner?: string;\n svn?: number;\n enclaveHeldData?: Uint8Array;\n sgxCollateral?: AttestationSgxCollateralInfo;\n }) {\n this._issuer = params.issuer;\n this._nonce = params.nonce;\n this._version = params.version;\n this._uniqueId = params.uniqueId;\n this._runTimeClaims = params.runTimeClaims;\n this._initTimeClaims = params.initTimeClaims;\n this._policyClaims = params.policyClaims;\n this._verifierType = params.verifierType;\n this._policySigner = params.policySigner;\n this._policyHash = params.policyHash;\n this._isDebuggable = params.isDebuggable;\n this._productId = params.productId;\n this._mrEnclave = params.mrEnclave;\n this._mrSigner = params.mrSigner;\n this._svn = params.svn;\n this._enclaveHeldData = params.enclaveHeldData;\n this._sgxCollateral = params.sgxCollateral;\n }\n\n private _issuer: string;\n private _version: string;\n private _nonce?: string;\n private _uniqueId: string;\n private _runTimeClaims?: unknown;\n private _initTimeClaims?: unknown;\n private _policyClaims?: unknown;\n private _verifierType: string;\n private _policySigner?: AttestationSigner;\n private _policyHash: Uint8Array;\n private _isDebuggable?: boolean;\n private _productId?: number;\n private _mrEnclave?: string;\n private _mrSigner?: string;\n private _svn?: number;\n private _enclaveHeldData?: Uint8Array;\n private _sgxCollateral?: AttestationSgxCollateralInfo;\n\n /**\n * Unique Identifier for the token\n *\n */\n get uniqueId(): string {\n return this._uniqueId;\n }\n\n /**\n * Returns the issuer of the attestation token. MUST be the same as the\n * endpoint used when constructing the attestation client instance.\n */\n get issuer(): string {\n return this._issuer;\n }\n\n /**\n * Returns the \"nonce\" value specified in the Attest request.\n */\n get nonce(): string | undefined {\n return this._nonce;\n }\n\n /**\n * The Schema version of this structure. Current Value: 1.0\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * Runtime Claims\n */\n get runTimeClaims(): unknown {\n return this._runTimeClaims;\n }\n /**\n * Inittime Claims\n */\n get initTimeClaims(): unknown {\n return this._initTimeClaims;\n }\n\n /**\n * Policy Generated Claims\n */\n get policyClaims(): unknown {\n return this._policyClaims;\n }\n /**\n * The Attestation type being attested.\n */\n get verifierType(): string {\n return this._verifierType;\n }\n /**\n * The certificate used to sign the policy object, if specified.\n */\n get policySigner(): AttestationSigner | undefined {\n return this._policySigner;\n }\n /**\n * The SHA256 hash of the BASE64URL encoded policy text used for attestation\n */\n get policyHash(): Uint8Array {\n return this._policyHash;\n }\n /**\n * True if the enclave is debuggable, false otherwise\n */\n get isDebuggable(): boolean | undefined {\n return this._isDebuggable;\n }\n /**\n * The SGX Product ID for the enclave.\n */\n get productId(): number | undefined {\n return this._productId;\n }\n /**\n * The HEX encoded SGX MRENCLAVE value for the enclave.\n */\n get mrEnclave(): string | undefined {\n return this._mrEnclave;\n }\n /**\n * The HEX encoded SGX MRSIGNER value for the enclave.\n */\n get mrSigner(): string | undefined {\n return this._mrSigner;\n }\n /**\n * The SGX SVN value for the enclave.\n */\n get svn(): number | undefined {\n return this._svn;\n }\n /**\n * A copy of the RuntimeData specified as an input to the attest call.\n */\n get enclaveHeldData(): Uint8Array | undefined {\n return this._enclaveHeldData;\n }\n /**\n * The SGX SVN value for the enclave.\n */\n get sgxCollateral(): AttestationSgxCollateralInfo | undefined {\n return this._sgxCollateral;\n }\n}\n\n/**\n *\n * @param generated - Generated attestation result object.\n * @returns newly created AttestationResult from the generated result.\n *\n * @internal\n */\nexport function _attestationResultFromGenerated(\n generated: GeneratedAttestationResult,\n): AttestationResultImpl {\n return new AttestationResultImpl({\n issuer: generated.iss,\n version: generated.version,\n nonce: generated.nonce,\n uniqueId: generated.jti,\n policySigner: generated.policySigner\n ? _attestationSignerFromGenerated(generated.policySigner)\n : undefined,\n runTimeClaims: generated.runtimeClaims,\n initTimeClaims: generated.inittimeClaims,\n policyClaims: generated.policyClaims,\n verifierType: generated.verifierType,\n policyHash: generated.policyHash,\n isDebuggable: generated.isDebuggable,\n productId: generated.productId,\n mrEnclave: generated.mrEnclave,\n mrSigner: generated.mrSigner,\n svn: generated.svn,\n enclaveHeldData: generated.enclaveHeldData,\n sgxCollateral: generated.sgxCollateral,\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"attestationResult.js","sourceRoot":"","sources":["../../../src/models/attestationResult.ts"],"names":[],"mappings":"AAAA,uCAAuC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AS,CAAC;IACxB,CAAC;IACD;;OAEG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IACD;;OAEG;IACH,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IACD;;OAEG;IACH,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,UAAU,+BAA+B,CAC7C,SAAqC;IAErC,OAAO,IAAI,qBAAqB,CAAC;QAC/B,MAAM,EAAE,SAAS,CAAC,GAAG;QACrB,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,QAAQ,EAAE,SAAS,CAAC,GAAG;QACvB,YAAY,EAAE,SAAS,CAAC,YAAY;YAClC,CAAC,CAAC,+BAA+B,CAAC,SAAS,CAAC,YAAY,CAAC;YACzD,CAAC,CAAC,SAAS;QACb,aAAa,EAAE,SAAS,CAAC,aAAa;QACtC,cAAc,EAAE,SAAS,CAAC,cAAc;QACxC,YAAY,EAAE,SAAS,CAAC,YAAY;QACpC,YAAY,EAAE,SAAS,CAAC,YAAY;QACpC,UAAU,EAAE,SAAS,CAAC,UAAU;QAChC,YAAY,EAAE,SAAS,CAAC,YAAY;QACpC,SAAS,EAAE,SAAS,CAAC,SAAS;QAC9B,SAAS,EAAE,SAAS,CAAC,SAAS;QAC9B,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,GAAG,EAAE,SAAS,CAAC,GAAG;QAClB,eAAe,EAAE,SAAS,CAAC,eAAe;QAC1C,aAAa,EAAE,SAAS,CAAC,aAAa;KACvC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AttestationSigner } from \"./index.js\";\nimport type { GeneratedAttestationResult } from \"../generated/index.js\";\nimport { _attestationSignerFromGenerated } from \"./attestationSigner.js\";\n\n/**\n * Defines the contents of the {@link AttestationResult.sgxCollateral} claim in\n * an {@link AttestationResult}.\n */\nexport interface AttestationSgxCollateralInfo {\n /**\n * Hex encoded Sha256 hash of the Quoting Enclave Certificates.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n qeidcertshash?: string;\n /**\n * Hex encoded Sha256 hash of the Quoting Enclave Certificate CRL.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n qeidcrlhash?: string;\n /**\n * Hex encoded Sha256 hash of the Quoting Enclave Identity.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n qeidhash?: string;\n /**\n * Hex encoded Sha256 hash of the SGX Quote or OpenEnclave Report validated\n * by this token.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n quotehash?: string;\n /**\n * Hex encoded Sha256 hash of the TCB Info Certificates.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n tcbinfocertshash?: string;\n /**\n * Hex encoded Sha256 hash of the TCB Info Certificate CRL.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n tcbinfocrlhash?: string;\n /**\n * Hex encoded Sha256 hash of the TCB Info for the device being attested.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n tcbinfohash?: string;\n}\n\n/**\n * A Microsoft Azure Attestation response token body - the body of a response token issued by MAA\n */\nexport interface AttestationResult {\n /**\n * Unique Identifier for the token.\n *\n * Corresponds to the 'jti' claim defined in\n * {@link https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.7 | RFC 7519 section 4.1.7}\n */\n uniqueId: string;\n\n /**\n * Returns the issuer of the attestation token. MUST be the same as the\n * endpoint used when constructing the attestation client instance.\n */\n issuer: string;\n\n /**\n * Returns the \"nonce\" value if one was specified in the Attest request.\n */\n nonce?: string;\n\n /**\n * The Schema version of this structure. Current Value: 1.0\n */\n version: string;\n\n /**\n * Returns the runtime claims in the token.\n *\n * This value will match the input `runTimeJson` property to the\n * {@link AttestationClient.attestSgxEnclave} or\n * {@link AttestationClient.attestOpenEnclave} API.\n *\n * @remarks\n *\n * The `runtimeClaims` property will only be populated if the\n * `runtimeJson` parameter to the `Attest` API is specified. It will\n * not be populated if the `runtimeData` parameter is specified.\n */\n runTimeClaims: unknown;\n /**\n * Returns the initialization time claims in the token.\n * This value will match the input `initTimeJson` property to the\n * {@link AttestationClient.attestSgxEnclave} or\n * {@link AttestationClient.attestOpenEnclave} API.\n *\n * @remarks\n *\n * The `initTimeClaims` property will only be populated if the `initTimeJson`\n * parameter to the `Attest` API is specified. It will not be populated if\n * the `initTimeData` parameter is specified.\n */\n initTimeClaims: unknown;\n\n /**\n * Returns the set of claims generated by the attestation policy on the instance.\n */\n policyClaims: unknown;\n\n /**\n * Returns the verifier which generated this attestation token. Normally one of:\n * \"SGX\" or \"TPM\", but others can be specified.\n */\n verifierType: string;\n /**\n * The certificate used to sign the policy object, if specified.\n */\n policySigner?: AttestationSigner;\n /**\n * The base64url encoded SHA256 hash of the BASE64URL encoded policy text\n * used for attestation.\n */\n policyHash: Uint8Array;\n /**\n * True if the enclave is debuggable, false otherwise. Only valid if `verifierType` is SGX.\n */\n isDebuggable?: boolean;\n\n /**\n * The SGX Product ID for the enclave. Only valid if the `verifierType` field is \"SGX\"\n */\n productId?: number;\n /**\n * The HEX encoded SGX MRENCLAVE value for the enclave. Only valid if the\n * `verifierType` field is \"SGX\"\n */\n mrEnclave?: string;\n\n /**\n * The HEX encoded SGX MRSIGNER value for the enclave. Only valid if the\n * `verifierType` field is \"SGX\"\n */\n mrSigner?: string;\n\n /**\n * The SGX SVN value for the enclave. Only valid if the `verifierType` field is \"SGX\"\n */\n svn?: number;\n\n /**\n * Returns the value of the runtime_data field specified as an input to the\n * {@link AttestationClient.attestSgxEnclave} or {@link AttestationClient.attestOpenEnclave} API.\n *\n * @remarks\n *\n * The `enclaveHeldData` property will only be populated if the\n * `runtimeData` parameter to the `Attest` API is specified.\n */\n enclaveHeldData?: Uint8Array;\n\n /**\n * Returns a set of information describing the complete set of inputs to the\n * Attestation validation logic.\n *\n * See the {@link https://software.intel.com/content/www/us/en/develop/articles/quote-verification-attestation-with-intel-sgx-dcap.html | Intel SGX documentation }\n * for more information on quote validation.\n */\n sgxCollateral?: AttestationSgxCollateralInfo;\n}\n\n/**\n * A Microsoft Azure Attestation response token body - the body of a response token issued by MAA\n */\nexport class AttestationResultImpl implements AttestationResult {\n /**\n *\n * @param params - The parameters for the constructor.\n *\n * @hidden\n */\n constructor(params: {\n issuer: string;\n version: string;\n nonce?: string;\n uniqueId: string;\n runTimeClaims?: unknown;\n initTimeClaims?: unknown;\n policyClaims?: unknown;\n verifierType: string;\n policySigner?: AttestationSigner;\n policyHash: Uint8Array;\n isDebuggable?: boolean;\n productId?: number;\n mrEnclave?: string;\n mrSigner?: string;\n svn?: number;\n enclaveHeldData?: Uint8Array;\n sgxCollateral?: AttestationSgxCollateralInfo;\n }) {\n this._issuer = params.issuer;\n this._nonce = params.nonce;\n this._version = params.version;\n this._uniqueId = params.uniqueId;\n this._runTimeClaims = params.runTimeClaims;\n this._initTimeClaims = params.initTimeClaims;\n this._policyClaims = params.policyClaims;\n this._verifierType = params.verifierType;\n this._policySigner = params.policySigner;\n this._policyHash = params.policyHash;\n this._isDebuggable = params.isDebuggable;\n this._productId = params.productId;\n this._mrEnclave = params.mrEnclave;\n this._mrSigner = params.mrSigner;\n this._svn = params.svn;\n this._enclaveHeldData = params.enclaveHeldData;\n this._sgxCollateral = params.sgxCollateral;\n }\n\n private _issuer: string;\n private _version: string;\n private _nonce?: string;\n private _uniqueId: string;\n private _runTimeClaims?: unknown;\n private _initTimeClaims?: unknown;\n private _policyClaims?: unknown;\n private _verifierType: string;\n private _policySigner?: AttestationSigner;\n private _policyHash: Uint8Array;\n private _isDebuggable?: boolean;\n private _productId?: number;\n private _mrEnclave?: string;\n private _mrSigner?: string;\n private _svn?: number;\n private _enclaveHeldData?: Uint8Array;\n private _sgxCollateral?: AttestationSgxCollateralInfo;\n\n /**\n * Unique Identifier for the token\n *\n */\n get uniqueId(): string {\n return this._uniqueId;\n }\n\n /**\n * Returns the issuer of the attestation token. MUST be the same as the\n * endpoint used when constructing the attestation client instance.\n */\n get issuer(): string {\n return this._issuer;\n }\n\n /**\n * Returns the \"nonce\" value specified in the Attest request.\n */\n get nonce(): string | undefined {\n return this._nonce;\n }\n\n /**\n * The Schema version of this structure. Current Value: 1.0\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * Runtime Claims\n */\n get runTimeClaims(): unknown {\n return this._runTimeClaims;\n }\n /**\n * Inittime Claims\n */\n get initTimeClaims(): unknown {\n return this._initTimeClaims;\n }\n\n /**\n * Policy Generated Claims\n */\n get policyClaims(): unknown {\n return this._policyClaims;\n }\n /**\n * The Attestation type being attested.\n */\n get verifierType(): string {\n return this._verifierType;\n }\n /**\n * The certificate used to sign the policy object, if specified.\n */\n get policySigner(): AttestationSigner | undefined {\n return this._policySigner;\n }\n /**\n * The SHA256 hash of the BASE64URL encoded policy text used for attestation\n */\n get policyHash(): Uint8Array {\n return this._policyHash;\n }\n /**\n * True if the enclave is debuggable, false otherwise\n */\n get isDebuggable(): boolean | undefined {\n return this._isDebuggable;\n }\n /**\n * The SGX Product ID for the enclave.\n */\n get productId(): number | undefined {\n return this._productId;\n }\n /**\n * The HEX encoded SGX MRENCLAVE value for the enclave.\n */\n get mrEnclave(): string | undefined {\n return this._mrEnclave;\n }\n /**\n * The HEX encoded SGX MRSIGNER value for the enclave.\n */\n get mrSigner(): string | undefined {\n return this._mrSigner;\n }\n /**\n * The SGX SVN value for the enclave.\n */\n get svn(): number | undefined {\n return this._svn;\n }\n /**\n * A copy of the RuntimeData specified as an input to the attest call.\n */\n get enclaveHeldData(): Uint8Array | undefined {\n return this._enclaveHeldData;\n }\n /**\n * The SGX SVN value for the enclave.\n */\n get sgxCollateral(): AttestationSgxCollateralInfo | undefined {\n return this._sgxCollateral;\n }\n}\n\n/**\n *\n * @param generated - Generated attestation result object.\n * @returns newly created AttestationResult from the generated result.\n *\n * @internal\n */\nexport function _attestationResultFromGenerated(\n generated: GeneratedAttestationResult,\n): AttestationResultImpl {\n return new AttestationResultImpl({\n issuer: generated.iss,\n version: generated.version,\n nonce: generated.nonce,\n uniqueId: generated.jti,\n policySigner: generated.policySigner\n ? _attestationSignerFromGenerated(generated.policySigner)\n : undefined,\n runTimeClaims: generated.runtimeClaims,\n initTimeClaims: generated.inittimeClaims,\n policyClaims: generated.policyClaims,\n verifierType: generated.verifierType,\n policyHash: generated.policyHash,\n isDebuggable: generated.isDebuggable,\n productId: generated.productId,\n mrEnclave: generated.mrEnclave,\n mrSigner: generated.mrSigner,\n svn: generated.svn,\n enclaveHeldData: generated.enclaveHeldData,\n sgxCollateral: generated.sgxCollateral,\n });\n}\n"]}
|
|
@@ -9,10 +9,9 @@ import { pemFromBase64 } from "../utils/helpers.js";
|
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
11
11
|
export function _attestationSignerFromGenerated(key) {
|
|
12
|
-
var _a, _b;
|
|
13
12
|
return {
|
|
14
|
-
keyId: key
|
|
15
|
-
certificates:
|
|
13
|
+
keyId: key?.kid,
|
|
14
|
+
certificates: key?.x5C?.map((cert) => pemFromBase64(cert, "CERTIFICATE")) ?? [],
|
|
16
15
|
};
|
|
17
16
|
}
|
|
18
17
|
//# sourceMappingURL=attestationSigner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attestationSigner.js","sourceRoot":"","sources":["../../../src/models/attestationSigner.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAqBpD;;;;;;GAMG;AACH,MAAM,UAAU,+BAA+B,CAAC,GAAgB
|
|
1
|
+
{"version":3,"file":"attestationSigner.js","sourceRoot":"","sources":["../../../src/models/attestationSigner.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAqBpD;;;;;;GAMG;AACH,MAAM,UAAU,+BAA+B,CAAC,GAAgB;IAC9D,OAAO;QACL,KAAK,EAAE,GAAG,EAAE,GAAG;QACf,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,IAAI,EAAE;KAChF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { JsonWebKey } from \"../generated/models/index.js\";\nimport { pemFromBase64 } from \"../utils/helpers.js\";\n\n/**\n * An AttestationSigner represents a signing certificate chain/Key ID combination\n * returned by the attestation service.\n */\nexport interface AttestationSigner {\n /**\n * The Key ID for the signer, as defined by the \"kid\" parameter in\n * {@link https://datatracker.ietf.org/doc/html/rfc7517#section-4.5 | RFC 7517 section 4.5}\n */\n keyId?: string;\n\n /**\n * An array of X.509 certificates DER encoded and PEM encoded one of which\n * will be used to sign an attestation token. Also the \"x5c\" parameter in\n * {@link https://datatracker.ietf.org/doc/html/rfc7517#section-4.7 | RFC 7517 section 4.7}\n */\n certificates: string[];\n}\n\n/**\n *\n * @param key - JsonWebKey for signing key.\n * @returns AttestationSigner created from the JsonWebKey.\n *\n * @internal\n */\nexport function _attestationSignerFromGenerated(key?: JsonWebKey): AttestationSigner {\n return {\n keyId: key?.kid,\n certificates: key?.x5C?.map((cert) => pemFromBase64(cert, \"CERTIFICATE\")) ?? [],\n };\n}\n"]}
|
|
@@ -36,6 +36,13 @@ export class AttestationTokenImpl {
|
|
|
36
36
|
// this._signature = base64UrlDecodeString(pieces[2]);
|
|
37
37
|
this._jwsVerifier = jsrsasign.KJUR.jws.JWS.parse(token);
|
|
38
38
|
}
|
|
39
|
+
_token;
|
|
40
|
+
_headerBytes;
|
|
41
|
+
_header;
|
|
42
|
+
_bodyBytes;
|
|
43
|
+
_body;
|
|
44
|
+
// private _signature: Uint8Array;
|
|
45
|
+
_jwsVerifier; // jsrsasign.KJUR.jws.JWS.JWSResult;
|
|
39
46
|
/**
|
|
40
47
|
* Returns the deserialized body of the AttestationToken object.
|
|
41
48
|
*
|
|
@@ -116,7 +123,6 @@ export class AttestationTokenImpl {
|
|
|
116
123
|
* @param options - Options to be used validating the time properties.
|
|
117
124
|
*/
|
|
118
125
|
validateTimeProperties(options) {
|
|
119
|
-
var _a, _b;
|
|
120
126
|
// Calculate the current time as a number of seconds since the start of the
|
|
121
127
|
// Unix epoch.
|
|
122
128
|
const problems = new Array();
|
|
@@ -126,7 +132,7 @@ export class AttestationTokenImpl {
|
|
|
126
132
|
const expTime = this.expiresOn.getTime() / 1000;
|
|
127
133
|
if (timeNow > expTime) {
|
|
128
134
|
const delta = timeNow - expTime;
|
|
129
|
-
if (delta > (
|
|
135
|
+
if (delta > (options.timeValidationSlack ?? 0)) {
|
|
130
136
|
problems.push("AttestationToken has expired.");
|
|
131
137
|
}
|
|
132
138
|
}
|
|
@@ -136,7 +142,7 @@ export class AttestationTokenImpl {
|
|
|
136
142
|
const nbfTime = this.notBefore.getTime() / 1000;
|
|
137
143
|
if (nbfTime > timeNow) {
|
|
138
144
|
const delta = nbfTime - timeNow;
|
|
139
|
-
if (delta > (
|
|
145
|
+
if (delta > (options.timeValidationSlack ?? 0)) {
|
|
140
146
|
problems.push("AttestationToken is not yet valid.");
|
|
141
147
|
}
|
|
142
148
|
}
|
|
@@ -166,7 +172,7 @@ export class AttestationTokenImpl {
|
|
|
166
172
|
}
|
|
167
173
|
}
|
|
168
174
|
else {
|
|
169
|
-
possibleSigningCertificates
|
|
175
|
+
possibleSigningCertificates?.map((value) => candidateSigners.push(value));
|
|
170
176
|
if (this.certificateChain !== undefined) {
|
|
171
177
|
candidateSigners.push(this.certificateChain);
|
|
172
178
|
}
|
|
@@ -183,8 +189,7 @@ export class AttestationTokenImpl {
|
|
|
183
189
|
* If the value of algorithm is "none" it indicates that the token is unsecured.
|
|
184
190
|
*/
|
|
185
191
|
get algorithm() {
|
|
186
|
-
|
|
187
|
-
return (_a = this._header) === null || _a === void 0 ? void 0 : _a.alg;
|
|
192
|
+
return this._header?.alg;
|
|
188
193
|
}
|
|
189
194
|
/**
|
|
190
195
|
* Json Web Signature Header "kid".
|
|
@@ -307,7 +312,6 @@ export class AttestationTokenImpl {
|
|
|
307
312
|
* @returns an {@link AttestationToken | attestation token}
|
|
308
313
|
*/
|
|
309
314
|
static create(params) {
|
|
310
|
-
var _a;
|
|
311
315
|
const header = { alg: "none" };
|
|
312
316
|
if ((!params.privateKey && params.certificate) || (params.privateKey && !params.certificate)) {
|
|
313
317
|
throw new Error("If privateKey is specified, certificate must also be provided. If certificate is provided, privateKey must also be provided.");
|
|
@@ -333,7 +337,7 @@ export class AttestationTokenImpl {
|
|
|
333
337
|
else {
|
|
334
338
|
header.alg = "none";
|
|
335
339
|
}
|
|
336
|
-
const encodedToken = jsrsasign.KJUR.jws.JWS.sign(header.alg, header,
|
|
340
|
+
const encodedToken = jsrsasign.KJUR.jws.JWS.sign(header.alg, header, params.body ?? "", params.privateKey);
|
|
337
341
|
return new AttestationTokenImpl(encodedToken);
|
|
338
342
|
}
|
|
339
343
|
}
|