-
Notifications
You must be signed in to change notification settings - Fork 0
Apply rate limiting to ConnectRPC path, deduplicate auth helpers #113
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -347,14 +347,12 @@ func ClientTransport(controlPlaneURL string) (string, *http.Client, error) { | |
| } | ||
| } | ||
|
|
||
| // OutgoingHeaders returns HTTP headers with auth and org ID for direct use. | ||
| func OutgoingHeaders(apiKey, orgID string) http.Header { | ||
| h := http.Header{} | ||
| // ApplyAuth sets authentication headers on a ConnectRPC request. | ||
| func ApplyAuth(req interface{ Header() http.Header }, apiKey, orgID string) { | ||
| if apiKey != "" { | ||
| h.Set("Authorization", "Bearer "+apiKey) | ||
| req.Header().Set("Authorization", "Bearer "+apiKey) | ||
| } | ||
| if orgID != "" { | ||
| h.Set("X-Org-Id", orgID) | ||
| req.Header().Set("X-Org-Id", orgID) | ||
| } | ||
| return h | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New
|
||


Uh oh!
There was an error while loading. Please reload this page.