nylas / nylas-ruby

Ruby bindings for the Nylas Platform APIs
https://nylas.com/docs
MIT License
101 stars 130 forks source link

Issue-394: Add disable_provider_selection kwarg to Api.authentication_url #395

Closed PickertJoe closed 1 year ago

PickertJoe commented 1 year ago

Closes #394

Description

We need the option to disable the "Select different provider" button in Nylas' hosted auth when we are trying to authenticate against a specific provider. This is necessary to prevent our users from escaping the intended auth flow and selecting a provider that we do not support.

This commit addresses this need by adding an optional keyword argument to the Api.authentication_url method and, if it is provided, including it in the params payload appended on the call to the /oauth/authorize endpoint. Tests have been added to account for this change and I tested it locally to confirm that the "Select different provider" button was no longer visible when I included disable_provider_selection: true in my call to the authentication_url method.

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

PickertJoe commented 1 year ago

Hey @mrashed-dev @andreccosta! I'm not able to tag reviewers for this PR, but I saw you'd contributed recently and was curious if you'd mind taking a look at this for me. I'd be happy to share more about these changes and our need for them if needed. Thanks so much!

codecov[bot] commented 1 year ago

Codecov Report

Merging #395 (3226339) into main (b22c7d1) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #395   +/-   ##
=======================================
  Coverage   97.73%   97.73%           
=======================================
  Files         126      126           
  Lines        4555     4555           
=======================================
  Hits         4452     4452           
  Misses        103      103           
Impacted Files Coverage Δ
spec/nylas/api_spec.rb 100.00% <ø> (ø)
lib/nylas/api.rb 72.22% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.