-
Notifications
You must be signed in to change notification settings - Fork 137
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
[SDK-4142] Add support for /oauth/par #470
Conversation
@@ -16,7 +16,7 @@ module HTTPProxy | |||
BASE_DELAY = 100 | |||
|
|||
# proxying requests from instance methods to HTTP class methods | |||
%i(get post post_file put patch delete delete_with_body).each do |method| | |||
%i(get post post_file post_form put patch delete delete_with_body).each do |method| |
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.
Until now the SDK didn't have a way to send a POST request with application/x-www-form-urlencoded
, it always assumed JSON. To support this, I added a new method type here (which ultimately ends up as a POST, similar to how :post_file
is used).
The alternative was to add an option to the method that signals the developer wants to use form data, but there was no way to do this without introducing a potential breaking change.
Changes
This PR implements two new auth API methods:
pushed_authorization_request
: calls the/oauth/par
endpoint with all the parameters that would normally be sent to/authorize
, and returns the payload includingrequest_uri
par_authorization_url
: acceptsrequest_uri
and builds a URL that includes it along withclient_id
Note
Something I would like some feedback on: the SDK already exposes
authorization_url
(source) that builds a URL for/authorize
with all the params. However, I decided not to support PAR here for two reasons:redirect_url
that is not required for the PAR requestrequest_uri
It made sense to build a new method. However, also looking for feedback on the name
par_authorization_url
.Testing
Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.
Checklist