Skip to content

Conversation

@zvigrinberg
Copy link
Contributor

@zvigrinberg zvigrinberg commented Dec 27, 2023

  1. Generate ex-request-id , a sha256 digest of the timestamp + rhda_token if exists ( otherwise random real number in the range of [0,1] ).

  2. add this generated value as an exchange property ( Camel exchange property) called exRequestId.

  3. propagate it to all original request message paths , all error messages and on all error paths as a metadata field with the name of the property.

  4. add to the response of all paths and cases( 200, 422 , 5xx , etc.) the value of generted ex-request-id as a response header.

Handle: https://issues.redhat.com/browse/APPENG-2183.

Why not using UUID generator and that's it?
Because RHDA Token is already one of the metadata fields in logs messages sent to sentry, and usually clients send RHDA Token as Pseudo random generated uuid, and we want a different pattern of randomly generated unique string not to be confused with RHDA Token:

  1. The size is much bigger - 64 characters, hence it can be instantly looked up in the logs and found, without any fear for collision ( chances for collisions are very near to zero, much more close to zero than just standard UUID because of the string size).
  2. It can't be confused with RHDA-TOKEN' UUID value as uuid' length is much shorter and also with hyphens, and sha256 string digest is a string of 64 charcters long of hexadecimal characters.

@zvigrinberg zvigrinberg requested a review from ruromero January 1, 2024 15:54
Copy link
Collaborator

@ruromero ruromero left a comment

Choose a reason for hiding this comment

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

@zvigrinberg the solution looks consistent. I have just added some small remarks and comments

fix: couple of more adjustments

Signed-off-by: Zvi Grinberg <[email protected]>
@zvigrinberg zvigrinberg requested a review from ruromero January 9, 2024 10:01
@zvigrinberg zvigrinberg force-pushed the feature/add-exhort-request-id branch from 993c210 to 1492b1e Compare January 9, 2024 10:27
test: use concurrent hashset for mass concurrency test

Signed-off-by: Zvi Grinberg <[email protected]>
@zvigrinberg zvigrinberg requested a review from ruromero January 9, 2024 11:24
Copy link
Collaborator

@ruromero ruromero left a comment

Choose a reason for hiding this comment

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

LGTM thanks for the changes

@zvigrinberg zvigrinberg merged commit 6a3aed1 into guacsec:main Jan 9, 2024
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