-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Recorder] configureClientOptions
method on the recorder
#20175
Changes from all commits
88fe779
00eb82e
8048e9e
e1626ca
a6d1b95
6c29355
5885760
e44fe9c
c64883f
bf8bd52
2eaf778
fe5fb23
8822738
4f84663
0ce0ed3
5fc3208
4340a71
b5fa677
f65c68a
9a9e0aa
bab5665
2b36e82
74684dd
c79a6bb
23dcf48
18a4fab
3b2f286
8e564c1
0215d5d
dc1a346
1601db6
a4fe196
d0cbb6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,18 +187,14 @@ export class AttestationClient { | |
) { | ||
let credentialScopes: string[] | undefined = undefined; | ||
let credential: TokenCredential | undefined = undefined; | ||
let options: AttestationClientOptions = {}; | ||
let options: AttestationClientOptions; | ||
|
||
// If arg2 is defined, it's either a tokenCredential or it's a client options. | ||
if (credentialsOrOptions !== undefined) { | ||
if (isTokenCredential(credentialsOrOptions)) { | ||
credential = credentialsOrOptions; | ||
credentialScopes = ["https://attest.azure.net/.default"]; | ||
} else { | ||
options = credentialsOrOptions; | ||
} | ||
} else if (clientOptions !== undefined) { | ||
if (credentialsOrOptions && isTokenCredential(credentialsOrOptions)) { | ||
credential = credentialsOrOptions; | ||
credentialScopes = ["https://attest.azure.net/.default"]; | ||
options = clientOptions; | ||
} else { | ||
options = credentialsOrOptions || {}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: You can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't want to kick off another 100 builds again. 🥲 I'll consider the change if I am making any other significant commit 🙂 |
||
} | ||
|
||
const internalPipelineOptions: GeneratedClientOptionalParams = { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,15 +197,15 @@ describe("[AAD] Attestation Client", function () { | |
const binaryRuntimeData = base64url.decodeString(_runtimeData); | ||
const client = createRecordedClient(recorder, endpointType); | ||
|
||
{ | ||
// You can't specify both runtimeData and runtimeJson. | ||
await expect( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. expect wasn't capturing somehow. |
||
client.attestOpenEnclave(base64url.decodeString(_openEnclaveReport).subarray(0x10), { | ||
runTimeData: binaryRuntimeData, | ||
runTimeJson: binaryRuntimeData, | ||
}) | ||
).to.eventually.be.rejectedWith("Cannot provide both runTimeData and runTimeJson"); | ||
} | ||
// You can't specify both runtimeData and runtimeJson. | ||
await assert.isRejected( | ||
client.attestOpenEnclave(base64url.decodeString(_openEnclaveReport).subarray(0x10), { | ||
runTimeData: binaryRuntimeData, | ||
runTimeJson: binaryRuntimeData, | ||
}), | ||
"Cannot provide both runTimeData and runTimeJson.", | ||
"Expected to throw since you can't specify both runtimeData and runtimeJson" | ||
); | ||
|
||
{ | ||
const attestationResult = await client.attestOpenEnclave( | ||
|
@@ -251,15 +251,14 @@ describe("[AAD] Attestation Client", function () { | |
|
||
const binaryRuntimeData = base64url.decodeString(_runtimeData); | ||
|
||
{ | ||
// You can't specify both runtimeData and runtimeJson. | ||
await expect( | ||
client.attestSgxEnclave(base64url.decodeString(_openEnclaveReport).subarray(0x10), { | ||
runTimeData: binaryRuntimeData, | ||
runTimeJson: binaryRuntimeData, | ||
}) | ||
).to.eventually.be.rejectedWith("Cannot provide both runTimeData and runTimeJson"); | ||
} | ||
await assert.isRejected( | ||
client.attestSgxEnclave(base64url.decodeString(_openEnclaveReport).subarray(0x10), { | ||
runTimeData: binaryRuntimeData, | ||
runTimeJson: binaryRuntimeData, | ||
}), | ||
"Cannot provide both runTimeData and runTimeJson.", | ||
"Expected to throw since you can't specify both runtimeData and runtimeJson" | ||
); | ||
|
||
{ | ||
// An OpenEnclave report has a 16 byte header prepended to an SGX quote. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, are these changes necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier did this.