-
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
[KeyVault Keys] Fixed the rollup warnings #11549
Conversation
sdk/keyvault/keyvault-keys/src/localCryptography/algorithms.browser.ts
Outdated
Show resolved
Hide resolved
sdk/keyvault/keyvault-keys/src/localCryptography/algorithms.browser.ts
Outdated
Show resolved
Hide resolved
@ramya-rao-a After having the time to read this again, I realized I did a very poor job of moving the algorithms.ts file! These new changes I'm working on will make a lot more sense! Thank you for your patience. |
/** | ||
* A plain object containing all of the locally supported algorithms. | ||
*/ | ||
export const localSupportedAlgorithms: LocalSupportedAlgorithmsRecord = { |
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.
If we keep the current types as is, this contraption is necessary. As soon as we get into browser support, this will expand and be coherent.
@@ -80,77 +74,6 @@ const pipeAssertions = (...assertions: LocalAssertion[]): LocalAssertion => (... | |||
} | |||
}; | |||
|
|||
/** |
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.
These types were moved to localCryptography/models.ts
.
@@ -1,4 +1,98 @@ | |||
// Copyright (c) Microsoft Corporation. | |||
// Licensed under the MIT license. | |||
|
|||
import { JsonWebKey } from "../keysModels"; |
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.
These types were just moved out of the algorithms.ts
file.
…eded on algorithms.browser.ts
* The list of known assertions so far. | ||
* Assertions verify that the requirements to execute a local cryptography operation are met. | ||
*/ | ||
export const assertions: Record<string, LocalAssertion> = {}; |
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.
Please note, the below feedback is not a blocker for this PR, but we should look into this nevertheless and do any follow ups in a separate PR.
I was trying to figure out whey we need to export these assertions
. We use these assertions
only in the validate
method in each algorithm. Since we dont have any algorithm in browser, this got me thinking as to why we even need it which then lead me to the tests in the file localCryptography.spect.ts
file. So, a few questions:
- When we run the tests in the file
localCryptography.spect.ts
in CI in the browser, what isassertions
pointing to? If it is the assertions in the algorithms.ts file, then we are essentially not getting the coverage for "browser code". If it is the assertions in the algorithms.browser.ts file, then tests would fail because assertions is an empty object as seen above. This delves into a generic question around how do we expect our tests to work when the code is split between node and browser like how are are doing in this PR and how we have done in many other places - Looking at the tests themselves, it felt a little odd to me that we were testing assertions. Shouldnt we be testing that the right assertions are added to the alogrithms i.e. Wouldnt we get a more appropriate coverage by calling
validate()
on the different algorithms and checking if the expected error was thrown?
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.
I like those ideas! After this release, I'll go back to this PR and make issues based on your feedback. Thank you 🌞
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.
We don't currently run cryptography tests on the browser. I can take your validate feedback and work with it on a separate issue! Here's the issue: #11779
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.
Looks good. Please look at #11549 (comment)
/azp run js - keyvault-keys - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Merged since it was approved, we just released and to avoid this PR from getting stale. |
Api Management - make /tenant endpoints ARM compliant in 2020-06-01-preview version (Azure#11549) * Adds base for updating Microsoft.ApiManagement from version stable/2019-12-01 to version 2020-06-01-preview * Updates readme * Updates API version in new specs and examples * Add support in API Management for Availability Zones (Azure#10284) * apim in azs * fix prettier check * PATCH should return 200 OK (Azure#10328) * add support for PATCH returning 200 OK * CI fixes prettier fix CI fixes part 2 * Password no longer a mandatory property when uploading Certificates * add missing x-ms-odata extension for filter support * +gatewayhostnameconfiguration protocol changes (Azure#10292) * [2020-06-01-preview] Update Oauth Server secrets Contract (Azure#10602) * Oauth server secrets contract * fix azureMonitor enum * API Management Service Deleted Services Resource (Azure#10607) * API Management Service Deleted Services Resource * Path fix * Lint + custom-words fixes * Location URI parameter for deletedservices Resource * GET for deletedservices by service name * Remove resourceGroupName from resource path * fixes * schema for purge operation * perttier applied * 204 response code added Co-authored-by: REDMOND\glfeokti <glfeokti@microsoft.com> * OperationNameFormat property added to Diagnostic contract (Azure#10641) * OperationNameFormat property added to Diagnostic contract * add azuremonitor to update contract Co-authored-by: REDMOND\glfeokti <glfeokti@microsoft.com> * [Microsoft.ApiManagement][2020-06-01-preview] Change Network Status response contract (Azure#10331) * Change Network Status response contract * Update examples for network status contract * ApiManagement - tenant/settings endpoints * ApiManagement - tenant/settings endpoints fix * ApiManagement - tenant/settings endpoints fix prettier * ApiManagement - tenant/settings endpoints fix 3 * ApiManagement - tenant/settings endpoints fix 4 * ApiManagement - tenant/settings endpoints fix 5 Co-authored-by: Samir Solanki <samirsolanki@outlook.com> Co-authored-by: maksimkim <maksim.kim@gmail.com> Co-authored-by: promoisha <feoktistovgg@gmail.com> Co-authored-by: REDMOND\glfeokti <glfeokti@microsoft.com> Co-authored-by: RupengLiu <rliu1211@terpmail.umd.edu> Co-authored-by: vfedonkin <vifedo@microsoft.com>
Context: I did most of this while writing instructions for others. It made sense to me to make the pull request instead of putting more effort in the instructions.
Fixes #9867
This PR:
.browser
..browser
files.It's my first time doing the
.browser
stuff, soFeedback appreciated ✨