Skip to content
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

[DXEX-455] Allow custom headers to be set in Management/Auth Clients. #460

Merged
merged 1 commit into from
Feb 21, 2020

Conversation

seejee
Copy link
Contributor

@seejee seejee commented Feb 18, 2020

Changes

In order to better determine what version of the Deploy CLI tool is being used
by our customers, we would like to include the Deploy CLI's version in the
User-agent header as opposed to the current behavior (the version of node under
which the CLI is running).

The Deploy CLI uses ManagementClient to do its work, but the User-agent header
was not configurable before this change. This commit provides a new option
called userAgent that will override the User-agent header if it is provided.
If it is not provided, the original User-agent will be used (e.g. node.js/13.1.2).

References

Testing

Unit tests were added for the new behavior as well as ones to ensure the original behavior works when userAgent is not provided.

  • This change adds unit test coverage
  • This change adds integration test coverage

Checklist

@seejee seejee requested a review from a team February 18, 2020 15:06
@seejee
Copy link
Contributor Author

seejee commented Feb 18, 2020

One note/question about this PR: we only need the user agent header to be exposed, but should we just expose the entire headers object instead so that the consumer can add whatever additional headers they like?

@seejee seejee closed this Feb 19, 2020
@seejee
Copy link
Contributor Author

seejee commented Feb 19, 2020

Closed this PR by mistake! :derp:

@seejee seejee reopened this Feb 19, 2020
@seejee
Copy link
Contributor Author

seejee commented Feb 20, 2020

Thanks for updating this branch @damieng! I just realized that my original commit is not properly signed. Let me know if you want me to amend it and force push a new commit that is signed (and has my auth0 email instead of my personal one).

In order to better determine what version of the Deploy CLI tool is being used
by our customers, we would like to include the Deploy CLI's version in the
User-agent header as opposed to the current behavior (the version of node under
which the CLI is running).

The Deploy CLI uses ManagementClient to do its work, but the User-agent header
was not configurable before this change. This commit provides a new option
called `headers` that will allow the caller to provide an optional set of
additional headers to outgoing requests.

In the case of the `User-agent` header, if it is not provided by the caller,
the original User-agent string will be used (e.g. `node.js/13.1.2`).
@seejee seejee changed the title [DXEX-455] Allow User Agent to be set in Management/Auth Clients. [DXEX-455] Allow custom headers to be set in Management/Auth Clients. Feb 21, 2020
@lbalmaceda lbalmaceda merged commit 2075875 into auth0:master Feb 21, 2020
@lbalmaceda
Copy link
Contributor

Tests passed but status check got stuck.

@davidpatrick davidpatrick added this to the v2.23.0 milestone Feb 21, 2020
@davidpatrick davidpatrick mentioned this pull request Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants