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

Add support of /authenticate request #39

Merged
merged 1 commit into from
Jul 24, 2024
Merged

Conversation

rtamalin
Copy link
Collaborator

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.

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 rtamalin requested review from mbelur and gbuenodevsuse July 23, 2024 23:27
@rtamalin
Copy link
Collaborator Author

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

Copy link
Collaborator

@gbuenodevsuse gbuenodevsuse left a comment

Choose a reason for hiding this comment

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

LGTM. Minor suggestion would be to use table tests to make our test suite easier to maintain.

@rtamalin
Copy link
Collaborator Author

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

@rtamalin rtamalin merged commit b497c06 into main Jul 24, 2024
1 check passed
@rtamalin rtamalin deleted the authenticate_handler branch July 24, 2024 14:32
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