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

enhancement: Ability to set request ID #63

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

charithe
Copy link
Contributor

@charithe charithe commented Jun 20, 2024

Adds RequestIDGenerator option that allows the user to configure a
function to be called for each request to generate the request ID.

client = client.With(cerbos.RequestIDGenerator(func(_ context.Context) string {
    // Extract the ID from the context or compute it some other way
    return  id
})

Fixes #62

Signed-off-by: Charith Ellawala charith@cerbos.dev

Adds `RequestIDGenerator` option that allows the user to configure a
function to be called for each request to generate the request ID.

Signed-off-by: Charith Ellawala <charith@cerbos.dev>
Signed-off-by: Charith Ellawala <charith@cerbos.dev>
@charithe charithe merged commit 309fc80 into cerbos:main Jun 21, 2024
7 checks passed
@charithe charithe deleted the add-request-id branch June 21, 2024 07:02
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.

Changing RequestId is not possible
2 participants