-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(decision): add support to register api keys to proxy #5168
base: main
Are you sure you want to change the base?
Conversation
} | ||
} | ||
|
||
pub async fn add_publishable_key( |
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.
should we combine with add_api_key and pass variant to a common function ?
@@ -281,6 +281,25 @@ pub async fn create_merchant_account( | |||
.await | |||
.to_duplicate_response(errors::ApiErrorResponse::DuplicateMerchantAccount)?; | |||
|
|||
if let Some(api_key) = merchant_account.publishable_key.as_ref() { | |||
let state = state.clone(); |
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.
should we clone only necessary data here?
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.
|
||
let response = state | ||
.api_client | ||
.send_request(state, request, None, false) |
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.
@akshay-97 , we cannot pass standalone ApiClient
as the send_request
function takes SessionState
as an input argument
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.
ah okay, sure
Type of Change
Description
This PR adds support for exporting hashed api keys to the incoming proxy allowing for authentication outside the application facilitating detached authentication and ratelimiting
Additional Changes
Motivation and Context
How did you test it?
Checklist
cargo +nightly fmt --all
cargo clippy