Skip to content

Commit c560144

Browse files
authored
[TSP] Updates to Attestation TSP (Azure#38148)
* fix client name and point the right name * base64 url handling
1 parent 60dab19 commit c560144

File tree

3 files changed

+29
-16
lines changed

3 files changed

+29
-16
lines changed

specification/attestation/data-plane/Attestation/client.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "@azure-tools/typespec-client-generator-core";
44
using Azure.ClientGenerator.Core;
55
using AttestationService;
66

7-
@@clientName(AttestationService, "Attestation");
7+
@@clientName(AttestationService, "AttestationClient");
88

99
@@clientName(AttestationResult.`x-ms-sgx-svn`, "svn");
1010
@@clientName(AttestationResult.svn, "deprecatedSvn");

specification/attestation/data-plane/Attestation/models.tsp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ model AttestOpenEnclaveRequest {
197197
/**
198198
* OpenEnclave report from the enclave to be attested
199199
*/
200+
@encode(BytesKnownEncoding.base64url)
200201
report?: bytes;
201202

202203
/**
@@ -237,6 +238,7 @@ model RuntimeData {
237238
* quote, the SHA256 hash of the RuntimeData must match the quote's "report data"
238239
* attribute.
239240
*/
241+
@encode(BytesKnownEncoding.base64url)
240242
data?: bytes;
241243

242244
/**
@@ -260,6 +262,7 @@ model InitTimeData {
260262
* attribute. For a SEV-SNP quote, the SHA256 hash of the InitTimeData must match
261263
* the quote's "host data" attribute.
262264
*/
265+
@encode(BytesKnownEncoding.base64url)
263266
data?: bytes;
264267

265268
/**
@@ -286,6 +289,7 @@ model AttestSgxEnclaveRequest {
286289
/**
287290
* Quote of the enclave to be attested
288291
*/
292+
@encode(BytesKnownEncoding.base64url)
289293
quote?: bytes;
290294

291295
/**
@@ -343,6 +347,7 @@ model TpmAttestationRequest {
343347
/**
344348
* Protocol data containing artifacts for attestation.
345349
*/
350+
@encode(BytesKnownEncoding.base64url)
346351
data?: bytes;
347352
}
348353

@@ -353,6 +358,7 @@ model TpmAttestationResponse {
353358
/**
354359
* Protocol data containing attestation service response.
355360
*/
361+
@encode(BytesKnownEncoding.base64url)
356362
data?: bytes;
357363
}
358364

@@ -397,6 +403,7 @@ model AttestTdxVmRequest {
397403
/**
398404
* Quote of the TDX virtual machine to be attested
399405
*/
406+
@encode(BytesKnownEncoding.base64url)
400407
quote?: bytes;
401408

402409
/**
@@ -677,7 +684,7 @@ model PolicyCertificatesModificationResult {
677684
/**
678685
* The result of the operation
679686
*/
680-
@encodedName("application/json", "x-ms-certificate-result")
687+
@encodedName("application/json", "x-ms-policycertificates-result")
681688
certificateResolution?: CertificateModification;
682689
}
683690

@@ -689,6 +696,7 @@ model StoredAttestationPolicy {
689696
* Policy text to set as a sequence of UTF-8 encoded octets.
690697
*/
691698
@encodedName("application/json", "AttestationPolicy")
699+
@encode(BytesKnownEncoding.base64url)
692700
attestationPolicy?: bytes;
693701
}
694702

@@ -706,6 +714,7 @@ model PolicyResult {
706714
* The SHA256 hash of the policy object modified
707715
*/
708716
@encodedName("application/json", "x-ms-policy-token-hash")
717+
@encode(BytesKnownEncoding.base64url)
709718
policyTokenHash?: bytes;
710719

711720
/**
@@ -806,6 +815,7 @@ model AttestationResult {
806815
* The SHA256 hash of the BASE64URL encoded policy text used for attestation
807816
*/
808817
@encodedName("application/json", "x-ms-policy-hash")
818+
@encode(BytesKnownEncoding.base64url)
809819
policyHash?: bytes;
810820

811821
/**
@@ -842,6 +852,7 @@ model AttestationResult {
842852
* A copy of the RuntimeData specified as an input to the attest call.
843853
*/
844854
@encodedName("application/json", "x-ms-sgx-ehd")
855+
@encode(BytesKnownEncoding.base64url)
845856
enclaveHeldData?: bytes;
846857

847858
/**
@@ -872,12 +883,14 @@ model AttestationResult {
872883
* DEPRECATED: Private Preview version of x-ms-sgx-ehd claim.
873884
*/
874885
@encodedName("application/json", "aas-ehd")
886+
@encode(BytesKnownEncoding.base64url)
875887
deprecatedEnclaveHeldData?: bytes;
876888

877889
/**
878890
* DEPRECATED: Private Preview version of x-ms-sgx-ehd claim.
879891
*/
880892
@encodedName("application/json", "maa-ehd")
893+
@encode(BytesKnownEncoding.base64url)
881894
deprecatedEnclaveHeldData2?: bytes;
882895

883896
/**

specification/attestation/data-plane/Attestation/stable/2025-06-01/attestation.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@
932932
"properties": {
933933
"report": {
934934
"type": "string",
935-
"format": "byte",
935+
"format": "base64url",
936936
"description": "OpenEnclave report from the enclave to be attested"
937937
},
938938
"runtimeData": {
@@ -985,7 +985,7 @@
985985
"properties": {
986986
"quote": {
987987
"type": "string",
988-
"format": "byte",
988+
"format": "base64url",
989989
"description": "Quote of the enclave to be attested"
990990
},
991991
"runtimeData": {
@@ -1012,7 +1012,7 @@
10121012
"properties": {
10131013
"quote": {
10141014
"type": "string",
1015-
"format": "byte",
1015+
"format": "base64url",
10161016
"description": "Quote of the TDX virtual machine to be attested"
10171017
},
10181018
"runtimeData": {
@@ -1129,7 +1129,7 @@
11291129
},
11301130
"x-ms-policy-hash": {
11311131
"type": "string",
1132-
"format": "byte",
1132+
"format": "base64url",
11331133
"description": "The SHA256 hash of the BASE64URL encoded policy text used for attestation",
11341134
"x-ms-client-name": "policyHash"
11351135
},
@@ -1161,7 +1161,7 @@
11611161
},
11621162
"x-ms-sgx-ehd": {
11631163
"type": "string",
1164-
"format": "byte",
1164+
"format": "base64url",
11651165
"description": "A copy of the RuntimeData specified as an input to the attest call.",
11661166
"x-ms-client-name": "enclaveHeldData"
11671167
},
@@ -1193,13 +1193,13 @@
11931193
},
11941194
"aas-ehd": {
11951195
"type": "string",
1196-
"format": "byte",
1196+
"format": "base64url",
11971197
"description": "DEPRECATED: Private Preview version of x-ms-sgx-ehd claim.",
11981198
"x-ms-client-name": "deprecatedEnclaveHeldData"
11991199
},
12001200
"maa-ehd": {
12011201
"type": "string",
1202-
"format": "byte",
1202+
"format": "base64url",
12031203
"description": "DEPRECATED: Private Preview version of x-ms-sgx-ehd claim.",
12041204
"x-ms-client-name": "deprecatedEnclaveHeldData2"
12051205
},
@@ -1433,7 +1433,7 @@
14331433
"properties": {
14341434
"data": {
14351435
"type": "string",
1436-
"format": "byte",
1436+
"format": "base64url",
14371437
"description": "Initialization time data are passed into the Trusted Execution Environment\n(TEE) when it is created. For an Icelake SGX quote, the SHA256 hash of the\nInitTimeData must match the lower 32 bytes of the quote's \"config id\"\nattribute. For a SEV-SNP quote, the SHA256 hash of the InitTimeData must match\nthe quote's \"host data\" attribute."
14381438
},
14391439
"dataType": {
@@ -1589,7 +1589,7 @@
15891589
"description": "Hex encoded SHA1 Hash of the binary representation certificate which was added\nor removed",
15901590
"x-ms-client-name": "certificateThumbprint"
15911591
},
1592-
"x-ms-certificate-result": {
1592+
"x-ms-policycertificates-result": {
15931593
"$ref": "#/definitions/CertificateModification",
15941594
"description": "The result of the operation",
15951595
"x-ms-client-name": "certificateResolution"
@@ -1675,7 +1675,7 @@
16751675
},
16761676
"x-ms-policy-token-hash": {
16771677
"type": "string",
1678-
"format": "byte",
1678+
"format": "base64url",
16791679
"description": "The SHA256 hash of the policy object modified",
16801680
"x-ms-client-name": "policyTokenHash"
16811681
},
@@ -1711,7 +1711,7 @@
17111711
"properties": {
17121712
"data": {
17131713
"type": "string",
1714-
"format": "byte",
1714+
"format": "base64url",
17151715
"description": "Runtime data are generated by the Trusted Execution Environment (TEE). For an\nSGX quote (Coffeelake or Icelake), the SHA256 hash of the RuntimeData must\nmatch the lower 32 bytes of the quote's \"report data\" attribute. For a SEV-SNP\nquote, the SHA256 hash of the RuntimeData must match the quote's \"report data\"\nattribute."
17161716
},
17171717
"dataType": {
@@ -1760,7 +1760,7 @@
17601760
"properties": {
17611761
"AttestationPolicy": {
17621762
"type": "string",
1763-
"format": "byte",
1763+
"format": "base64url",
17641764
"description": "Policy text to set as a sequence of UTF-8 encoded octets.",
17651765
"x-ms-client-name": "attestationPolicy"
17661766
}
@@ -1817,7 +1817,7 @@
18171817
"properties": {
18181818
"data": {
18191819
"type": "string",
1820-
"format": "byte",
1820+
"format": "base64url",
18211821
"description": "Protocol data containing artifacts for attestation."
18221822
}
18231823
}
@@ -1828,7 +1828,7 @@
18281828
"properties": {
18291829
"data": {
18301830
"type": "string",
1831-
"format": "byte",
1831+
"format": "base64url",
18321832
"description": "Protocol data containing attestation service response."
18331833
}
18341834
}

0 commit comments

Comments
 (0)