Skip to content

fix: remove unnecessary null check for oauth cred exchange #407

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

Merged

Conversation

mconflitti-pbc
Copy link
Contributor

Intent

Support ticket was raised: https://rstudioide.zendesk.com/agent/tickets/115510

There was an extra null check added in the sdk that is unnecessary since the connect endpoint handles this check in the latest version. By adding a default value here, version 0.7.0 breaks when trying to do a credential exchange with an older version of connect < 2025.03.0.

This check is not done in posit-sdk-py so this brings them into parity.

Approach

Removes the null check and default for the requested_token_type. So if the value is not set, a null value is passed through the api which will then determine which the proper default is in both older and newer versions of connect.

Checklist

  • Does this change update NEWS.md (referencing the connected issue if necessary)?
  • Does this change need documentation? Have you run devtools::document()?

@mconflitti-pbc mconflitti-pbc self-assigned this May 5, 2025
@mconflitti-pbc
Copy link
Contributor Author

@toph-allen Updated the tests like we did last time since the hashes changed for those two functions. Is this adequate? I am not familiar enough with how to build this and use it locally to verify e2e.

Copy link
Contributor

@jonkeane jonkeane left a comment

Choose a reason for hiding this comment

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

Thanks for this!

@mconflitti-pbc
Copy link
Contributor Author

Verified this fixes the cred exchange call on older version of the connect API.

@mconflitti-pbc mconflitti-pbc merged commit bc697d1 into main May 6, 2025
19 checks passed
@mconflitti-pbc mconflitti-pbc deleted the fix-remove-unnecessary-null-check-cred-exchange branch May 6, 2025 20:54
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.

3 participants