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

26471 added App-Name to request headers #734

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

severinbeauvais
Copy link
Collaborator

Issue #: bcgov/entity#26471

Description of changes:

  • app version = 7.4.27
  • updated app name
  • added app name to Vite config
  • simplified Vite config
  • added App Name to Axios requests

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the business-filings-ui license (Apache 2.0).

- updated app name
- added app name to Vite config
- simplified Vite config
- added App Name to Axios requests
@severinbeauvais severinbeauvais self-assigned this Mar 17, 2025
@severinbeauvais severinbeauvais changed the title 26471 added App Name to request headers 26471 added App-Name to request headers Mar 17, 2025
@@ -11,15 +11,14 @@ const appName = JSON.parse(packageJson).appName
const appVersion = JSON.parse(packageJson).version
const sbcName = JSON.parse(packageJson).sbcName
const sbcVersion = JSON.parse(packageJson).dependencies['sbc-common-components']
const aboutApp = (appName && appVersion) ? `${appName} v${appVersion}` : 'Unknown APP'
const aboutSbc = (sbcName && sbcVersion) ? `${sbcName} v${sbcVersion}` : 'Unknown SBC'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If we can't parse the properties from the package.json file then we have bigger problems, so I simplified this.

@@ -11,6 +11,7 @@ instance.interceptors.request.use(

const kcToken = sessionStorage.getItem(SessionStorageKeys.KeyCloakToken)
request.headers.common['Authorization'] = `Bearer ${kcToken}`
request.headers.common['App-Name'] = import.meta.env.APP_NAME
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sample call to Auth API:
image

Sample call to Legal API:
image

@severinbeauvais
Copy link
Collaborator Author

/gcbrun

@bcregistry-sre
Copy link
Collaborator

bcregistry-sre commented Mar 17, 2025

Copy link
Collaborator

@TVWerdal TVWerdal 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 to me

Copy link
Collaborator

@ArwenQin ArwenQin left a comment

Choose a reason for hiding this comment

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

LGTM

@severinbeauvais severinbeauvais merged commit 0d1e11c into bcgov:main Mar 18, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants