Skip to content

Conversation

@willmanduffy
Copy link
Contributor

  • Adds an SDK method to generate an Admin Portal link.

@codecov
Copy link

codecov bot commented Sep 14, 2020

Codecov Report

Merging #39 into master will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #39      +/-   ##
==========================================
+ Coverage   94.07%   94.16%   +0.09%     
==========================================
  Files          13       13              
  Lines         253      257       +4     
==========================================
+ Hits          238      242       +4     
  Misses         15       15              
Impacted Files Coverage Δ
workos/portal.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af49b54...8d52d0d. Read the comment docs.

@willmanduffy willmanduffy force-pushed the feature/ch3035/add-create-organization-method-to-python branch from b16ddef to 0f006b4 Compare September 14, 2020 18:38
Args:
intent (str): The access scope for the generated Admin Portal link. Valid values are: ["sso"]
organization (string): The ID of the organization the Admin Portal link will be generated for
return_url (str): The URL that the end user will be redirected to upon exiting the generated Admin Portal. If none is provided, the default redirect link set in your WorkOS Dashboard will be used. (Optional)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you move return_url into a Kwargs section?

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably a discussion for some other time but... it's called return_url but we're using the default reDirect_uri if one is not supplied?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had the same question as I was writing this. @maxchehab?

Copy link
Contributor

Choose a reason for hiding this comment

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

We are deciding to keep this as is. See slack convo.

workos/portal.py Outdated
"return_url": return_url,
}
return self.request_helper.request(
"portal/generate_link",
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you create a constant for this for consistency?

self._request_helper = RequestHelper()
return self._request_helper

def create_organization(self, organization):
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious if Organizations are going to be used for anything else in the future. If so, would it make sense to put it into a Portal module or should it go somewhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We had this discussion as we kicked things off and it was decided that while it's not the best future home it is the one most consistent with the approach we've taken so far. In the future we might re-organize things to a more resource based approach, but that would have enough breaking changes we'd want it to be a major version.

@willmanduffy willmanduffy force-pushed the feature/ch3035/add-create-organization-method-to-python branch from 0f006b4 to d033e28 Compare September 14, 2020 19:56
Base automatically changed from feature/ch3035/add-create-organization-method-to-python to master September 14, 2020 19:57
* Adds an SDK method to generate an Admin Portal link.
@willmanduffy willmanduffy force-pushed the feature/ch3039/add-generate-portal-link-method-to-python branch from a046a92 to 8d52d0d Compare September 14, 2020 19:59
@willmanduffy
Copy link
Contributor Author

@henrylamchan I've updated with all the outstanding changes. Ready for a another review!

@willmanduffy willmanduffy merged commit 1eac351 into master Sep 14, 2020
@willmanduffy willmanduffy deleted the feature/ch3039/add-generate-portal-link-method-to-python branch September 14, 2020 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants