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

feat: send user-agent header with auth token requests #272

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

padamstx
Copy link
Member

@padamstx padamstx commented Apr 16, 2024

This commit updates our various request-based authenticators so that the User-Agent header is included with each outbound token request. The value of the User-Agent header will be of the form ibm-node-sdk-core/<authenticator-type>-<core-version> <os-info>.

Edit: I also updated BaseService.createRequest() so that it will add a default User-Agent header to the outbound request if one was not passed in with the request options.

Checklist
  • npm test passes (tip: npm run lint-fix can correct most style issues)
  • tests are included
  • documentation is changed or added

@padamstx padamstx self-assigned this Apr 16, 2024
@padamstx padamstx force-pushed the auth-user-agent branch 2 times, most recently from 2997880 to 92babfb Compare April 16, 2024 16:50
@padamstx padamstx requested review from dpopp07 and pyrooka April 16, 2024 16:53
Copy link
Member

@dpopp07 dpopp07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, aside from one request to change a file name, but I'll approve to avoid re-review

auth/token-managers/cp4d-token-manager.ts Outdated Show resolved Hide resolved
lib/privateHelper.ts Outdated Show resolved Hide resolved
test/unit/token-manager-helper.js Outdated Show resolved Hide resolved
Copy link
Member

@pyrooka pyrooka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, as far as I can tell. :)

This commit updates our various request-based authenticators
so that the User-Agent header is included with each outbound
token request. The value of the User-Agent header will be
of the form "ibm-node-sdk-core/<authenticator-type>-<core-version> <os-info>".

Signed-off-by: Phil Adams <phil_adams@us.ibm.com>
@padamstx padamstx merged commit a558274 into main Apr 17, 2024
4 checks passed
@padamstx padamstx deleted the auth-user-agent branch April 17, 2024 19:40
ibm-devx-sdk pushed a commit that referenced this pull request Apr 17, 2024
# [4.3.0](v4.2.5...v4.3.0) (2024-04-17)

### Features

* send user-agent header with auth token requests ([#272](#272)) ([a558274](a558274))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 4.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants