kubeshop / monokle-core

Monokle validation engine, CLI and shared UI components
MIT License
18 stars 3 forks source link

Pass client identity config with every API request #593

Closed f1ames closed 10 months ago

f1ames commented 10 months ago

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

Fixes

Checklist

changeset-bot[bot] commented 10 months ago

🦋 Changeset detected

Latest commit: 7126eb44e021c68290d8f9366704177db842a958

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