Skip to content
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-2391] Organizations support #1159

Merged
merged 18 commits into from
Mar 19, 2021
Merged

[SDK-2391] Organizations support #1159

merged 18 commits into from
Mar 19, 2021

Conversation

stevehobbsdev
Copy link
Contributor

@stevehobbsdev stevehobbsdev commented Mar 18, 2021

Changes

This PR adds support for Organizations, currently in closed beta.

  • Adds the ability to pass organization and invitation parameters (for user invitations)
  • Adds ID token validation for the org_id claim
  • Adds usage info into the readme
  • Adds support for testing into the built-in playground

Testing

  • This change adds unit test coverage
  • This change adds integration test coverage

Checklist

@stevehobbsdev stevehobbsdev added this to the vNext milestone Mar 18, 2021
@stevehobbsdev stevehobbsdev added CH: Added enhancement An enhancement or improvement to the SDK that could not be otherwise categorized as a new feature review:medium Medium review labels Mar 18, 2021
Comment on lines 345 to 365
if (transactionOrganization) {
if (!payload.org_id) {
return callback(
error.invalidToken(
'Organization Id (org_id) claim must be a string present in the ID token'
)
);
}

if (payload.org_id !== transactionOrganization) {
return callback(
error.invalidToken(
'Organization Id (org_id) claim value mismatch in the ID token; expected "' +
transactionOrganization +
'", found "' +
payload.org_id +
'"'
)
);
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could have gone into validateToken, but putting it here has the advantage that we don't then need to make a breaking change to that method interface, which might be being used by a consumer of the SDK.

Happy of course to discuss alternatives.

@stevehobbsdev stevehobbsdev marked this pull request as ready for review March 18, 2021 22:16
@stevehobbsdev stevehobbsdev requested a review from a team as a code owner March 18, 2021 22:16
@stevehobbsdev stevehobbsdev merged commit e93f5d0 into master Mar 19, 2021
@stevehobbsdev stevehobbsdev deleted the sdk-2391/organizations branch March 19, 2021 11:14
@stevehobbsdev stevehobbsdev mentioned this pull request Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Added enhancement An enhancement or improvement to the SDK that could not be otherwise categorized as a new feature review:medium Medium review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants