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
[test-credential] DAC update #29577
Merged
HarshaNalluru
merged 14 commits into
Azure:main
from
HarshaNalluru:harshan/test-credential
May 6, 2024
Merged
[test-credential] DAC update #29577
HarshaNalluru
merged 14 commits into
Azure:main
from
HarshaNalluru:harshan/test-credential
May 6, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
test-utils
Label for the issues related to the @azure/test-utils package
label
May 3, 2024
jeremymeng
pushed a commit
that referenced
this pull request
May 6, 2024
### Packages impacted by this PR `@Azure/service-bus` ### Issues associated with this PR https://dev.azure.com/azure-sdk/public/_build/results?buildId=3759006&view=logs&j=3dc8fd7e-4368-5a92-293e-d53cefc8c4b3&t=acc99708-be46-50ff-f197-4ecb2c3cab18&l=733 ### Describe the problem that is addressed by this PR Strange build failure seen in https://dev.azure.com/azure-sdk/public/_build/results?buildId=3759006&view=logs&j=3dc8fd7e-4368-5a92-293e-d53cefc8c4b3&t=acc99708-be46-50ff-f197-4ecb2c3cab18&l=733 ![image](https://github.com/Azure/azure-sdk-for-js/assets/10452642/3db414ff-02ed-4b7e-b132-b48499e858c9) Unblocks #29577
… harshan/test-credential
HarshaNalluru
requested review from
ckairen,
deyaaeldeen,
jeremymeng,
bterlson,
xirzec,
mpodwysocki and
timovv
as code owners
May 6, 2024 19:53
minhanh-phan
reviewed
May 6, 2024
timovv
reviewed
May 6, 2024
timovv
reviewed
May 6, 2024
Co-authored-by: Timo van Veenendaal <me@timo.nz>
…lluru/azure-sdk-for-js into harshan/test-credential
timovv
approved these changes
May 6, 2024
HarshaNalluru
changed the title
[test-credential] DAZ update
[test-credential] DAC update
May 6, 2024
timovv
added a commit
that referenced
this pull request
May 9, 2024
### Packages impacted by this PR - `@azure-tools/dev-tool` - `@azure-tools/test-credential` ### Describe the problem that is addressed by this PR We want to move to user auth and `DefaultAzureCredential` to authenticate our tests, but `DefaultAzureCredential` does not work in the browser, blocking this transition. This PR proposes a solution -- create a short-lived, local-only, server which can create tokens in Node using DefaultAzureCredential. In the browser, createTestCredential provides a credential implementation which calls this server whenever it needs a token, and the server relays the request to DefaultAzureCredential. Here's what's changed: - `test-credential` now returns a credential which requests tokens from a local web endpoint when running browser tests against a live service. - `dev-tool` contains an implementation of this web endpoint. The dev-tool scripts used to run browser tests now start this server automatically when running browser tests. A separate command to start the server is also provided for pipelines. - Update live test pipelines to start the server when running browser tests. ### Provide a list of related PRs _(if any)_ - Draft version with loads of commits and `/azp run` spam: #29581 - Harsha's earlier PR to enable DefaultAzureCredential: #29577
HarshaNalluru
added a commit
to HarshaNalluru/azure-sdk-for-js
that referenced
this pull request
May 9, 2024
`@azure-tools/test-credential` Need to move away from client secrets in the dev workflow. Updates the `createTestCredential` method to consume `DefaultAzureCredential` instead of `ClientSecretCredential` in order to offer autonomy to the devs and to move away from clietn secrets in environment varaibles. - `NoOpCredential` is offered for playback and `DefaultAzureCredential` in record/live modes. - [`User Auth` and `Auth via development tools`](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#authenticate-users) are preferred in record mode to record the tests. Hotfix 1.x release with the same change. --------- Co-authored-by: Timo van Veenendaal <me@timo.nz>
HarshaNalluru
pushed a commit
to HarshaNalluru/azure-sdk-for-js
that referenced
this pull request
May 9, 2024
- `@azure-tools/dev-tool` - `@azure-tools/test-credential` We want to move to user auth and `DefaultAzureCredential` to authenticate our tests, but `DefaultAzureCredential` does not work in the browser, blocking this transition. This PR proposes a solution -- create a short-lived, local-only, server which can create tokens in Node using DefaultAzureCredential. In the browser, createTestCredential provides a credential implementation which calls this server whenever it needs a token, and the server relays the request to DefaultAzureCredential. Here's what's changed: - `test-credential` now returns a credential which requests tokens from a local web endpoint when running browser tests against a live service. - `dev-tool` contains an implementation of this web endpoint. The dev-tool scripts used to run browser tests now start this server automatically when running browser tests. A separate command to start the server is also provided for pipelines. - Update live test pipelines to start the server when running browser tests. - Draft version with loads of commits and `/azp run` spam: Azure#29581 - Harsha's earlier PR to enable DefaultAzureCredential: Azure#29577
HarshaNalluru
added a commit
that referenced
this pull request
May 9, 2024
…t-credential (#29641) ### Packages impacted by this PR `@azure-tools/test-credential@1.1.0` ### What's happening? `test-credential 2.x` is for `test-recorder 4.x` `test-credential 1.x` is for `test-recorder 3.x` The only difference between test-credential 2.x and test-credential 1.x is that it consumes the new env support with vitest [azure-sdk-for-js/sdk/test-utils/test-credential/CHANGELOG.md at main · Azure/azure-sdk-for-js (github.com)](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/test-credential/CHANGELOG.md#200-2024-04-09) New changes went in `test-credential v2` as part of the spring grove effort as part of #29577 and #29616. Cherrypicking those changes into `test-credential v1` is necessary to address the spring grove efforts. This PR aims to accomplish that for 1.1.0 version of `@azure-tools/test-credential`. Next step is to publish `@azure-tools/test-credential@1.1.0` package so that sdks relying on recorder v3 can leverage the package. --------- Co-authored-by: Timo van Veenendaal <me@timo.nz> Co-authored-by: Timo van Veenendaal <timov@microsoft.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Packages impacted by this PR
@azure-tools/test-credential
Describe the problem that is addressed by this PR
Need to move away from client secrets in the dev workflow.
Breaking Changes
Updates the
createTestCredential
method to consumeDefaultAzureCredential
instead ofClientSecretCredential
in order to offer autonomy to the devs and to move away from clietn secrets in environment varaibles.NoOpCredential
is offered for playback andDefaultAzureCredential
in record/live modes.User Auth
andAuth via development tools
are preferred in record mode to record the tests.TO DO
Hotfix 1.x release with the same change.