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

Pass client identity config with every API request #593

Merged
merged 4 commits into from
Dec 20, 2023

Conversation

f1ames
Copy link
Contributor

@f1ames f1ames commented Dec 18, 2023

This PR allows to pass config identifying tool/integration using library. The config is then send as User-Agent header with every API request. Needed for https://github.com/kubeshop/monokle-saas/issues/1904.

This follows standard format for User-Agent headers, for reference see:

In short:

<product>/<product_version> <comment>

which in our case could be (the simplest version):

Monokle CLI/0.8.0

Then comment is additional data in (). Browsers put there OS info or similar usually, so we will have it there too:

Monokle CLI/0.8.0 (OS info)

This is also important since ua-parser-js library is used on the BE which can parse such OS info properly and will send it as separate payload parameter (see here).

The comment part can also contain other arbitrary data, common format is key=value; key=value; ... and this allows us to send any additional data we need, e.g.:

Monokle CLI/0.8.0 (OS info; machineId=123; foo=bar)

Changes

  • As above.

Fixes

  • None.

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test

Copy link

changeset-bot bot commented Dec 18, 2023

🦋 Changeset detected

Latest commit: 7126eb4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@monokle/synchronizer Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@f1ames f1ames changed the title F1ames/feat/synchronizer client Allow to pass client config to be send with every API request Dec 18, 2023
@f1ames f1ames changed the title Allow to pass client config to be send with every API request Pass client identity config with every API request Dec 19, 2023
@f1ames f1ames merged commit 978aa7a into main Dec 20, 2023
2 checks passed
@f1ames f1ames deleted the f1ames/feat/synchronizer-client-id branch December 20, 2023 09:13
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.

2 participants