-
Notifications
You must be signed in to change notification settings - Fork 20
feat: Generate and add ex-request-id response header #252
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
Merged
zvigrinberg
merged 9 commits into
guacsec:main
from
zvigrinberg:feature/add-exhort-request-id
Jan 9, 2024
Merged
feat: Generate and add ex-request-id response header #252
zvigrinberg
merged 9 commits into
guacsec:main
from
zvigrinberg:feature/add-exhort-request-id
Jan 9, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Zvi Grinberg <[email protected]>
Signed-off-by: Zvi Grinberg <[email protected]>
Signed-off-by: Zvi Grinberg <[email protected]>
Signed-off-by: Zvi Grinberg <[email protected]>
ruromero
requested changes
Jan 8, 2024
There was a problem hiding this 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
src/main/java/com/redhat/exhort/integration/backend/BackendUtils.java
Outdated
Show resolved
Hide resolved
src/test/java/com/redhat/exhort/integration/backend/BackendUtilsTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/redhat/exhort/integration/backend/BackendUtilsTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/redhat/exhort/integration/backend/BackendUtilsTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/redhat/exhort/integration/backend/BackendUtilsTest.java
Outdated
Show resolved
Hide resolved
ruromero
reviewed
Jan 8, 2024
src/test/java/com/redhat/exhort/integration/backend/BackendUtilsTest.java
Outdated
Show resolved
Hide resolved
fix: couple of more adjustments Signed-off-by: Zvi Grinberg <[email protected]>
Signed-off-by: Zvi Grinberg <[email protected]>
ruromero
requested changes
Jan 9, 2024
src/test/java/com/redhat/exhort/integration/backend/BackendUtilsTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/redhat/exhort/integration/backend/BackendUtilsTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/redhat/exhort/integration/backend/BackendUtilsTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/redhat/exhort/integration/backend/BackendUtilsTest.java
Show resolved
Hide resolved
Signed-off-by: Zvi Grinberg <[email protected]>
993c210 to
1492b1e
Compare
Signed-off-by: Zvi Grinberg <[email protected]>
zvigrinberg
commented
Jan 9, 2024
src/test/java/com/redhat/exhort/integration/backend/BackendUtilsTest.java
Outdated
Show resolved
Hide resolved
ruromero
reviewed
Jan 9, 2024
src/test/java/com/redhat/exhort/integration/AbstractAnalysisTest.java
Outdated
Show resolved
Hide resolved
test: use concurrent hashset for mass concurrency test Signed-off-by: Zvi Grinberg <[email protected]>
ruromero
approved these changes
Jan 9, 2024
There was a problem hiding this 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Generate ex-request-id , a sha256 digest of the timestamp + rhda_token if exists ( otherwise random real number in the range of [0,1] ).
add this generated value as an exchange property ( Camel exchange property) called exRequestId.
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.
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: