SUSE / telemetry-server

Proof of Concept Telemetry Server scaffolding
Apache License 2.0
2 stars 1 forks source link

Add support of /authenticate request #39

Closed rtamalin closed 3 months ago

rtamalin commented 3 months ago

Note that this change depends upon corresponding changes being landed in the github.com/SUSE/telemetry repo.

Added a new InstIdExists() helper method to the ClientsRow structure which is equivalent to the old Exists() helper. Updated the Exists() helper to now search for clients table entries with a matching Id value.

Add support for handling /authenticate requests allowing clients to obtain an updated authToken.

The /report handling now also requires that clients provide a new X-Telemetry-Client-Id header specifying their client id, and uses this to retrieve the saved authToken value for that client to check that the client id and token values provided match what is stored in the Operational DB's client table.

The /register handling has been tweaked slightly to align with new shared data types and also to use a different client instance id existence check mechanism.

Added new tests to test the /authenticate request and updated the test suite setup to create a test client entry in the operational DB's clients table as well as updating the relevant tests to pass the appropriate header values.

rtamalin commented 3 months ago

This code depends upon github.com/SUSE/telemetry/pull/38 so that will need to be merged first.

rtamalin commented 3 months ago

Yeah there is a lot of work needed on the testing front ;-)