Skip to content

feat: add --extra-header flag for custom gRPC headers#588

Open
sputnikraket wants to merge 1 commit intoauthzed:mainfrom
sputnikraket:add-custom-headers
Open

feat: add --extra-header flag for custom gRPC headers#588
sputnikraket wants to merge 1 commit intoauthzed:mainfrom
sputnikraket:add-custom-headers

Conversation

@sputnikraket
Copy link

Signed-off-by: Erik Hennings erik.hennings@freda.com

Description

This PR adds support for passing custom headers to gRPC requests via a new --extra-header flag.

Testing

Manual testing

References

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@sputnikraket
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

authzedbot added a commit to authzed/cla that referenced this pull request Dec 1, 2025
@sputnikraket sputnikraket marked this pull request as ready for review December 1, 2025 19:02
@tstirrat15
Copy link
Contributor

I think this is fine, but what's the use case? I'm wondering if it's something that zed already supports.

@radhus
Copy link

radhus commented Feb 16, 2026

I think this is fine, but what's the use case? I'm wondering if it's something that zed already supports.

We're running SpiceDB behind a proxy that requires authentication (GCP Cloud Run), that can be specified either through the Authorization header or another header. So we kind-of need to pass double authentication tokens 😅

This setup is perhaps not ideal, but it works.

Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

See question; otherwise LGTM

Comment on lines +231 to +232
md := metadata.New(headers)
ctx = metadata.NewOutgoingContext(ctx, md)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this logic functionally merge the headers, or would this overwrite headers if some other component added new headers?

Signed-off-by: Erik Hennings <erik.hennings@freda.com>
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 7.31707% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.49%. Comparing base (56e9ecd) to head (67dafa8).

Files with missing lines Patch % Lines
internal/client/client.go 5.40% 34 Missing and 1 partial ⚠️
internal/testing/test_helpers.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #588      +/-   ##
==========================================
- Coverage   41.72%   41.49%   -0.23%     
==========================================
  Files          38       38              
  Lines        6131     6172      +41     
==========================================
+ Hits         2558     2561       +3     
- Misses       3317     3354      +37     
- Partials      256      257       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

4 participants