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

User Management support #212

Merged
merged 3 commits into from
Apr 25, 2024
Merged

User Management support #212

merged 3 commits into from
Apr 25, 2024

Conversation

amadeo-workos
Copy link
Contributor

Description

Support for all User Management APIs.

/**
* Builder for options when creating a user.
*
* @param email The email address of the user.
Copy link
Contributor

Choose a reason for hiding this comment

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

email is only a possible option when creating a user. Should we have separate objects for create and update to make sure people don't attempt to pass email when updating a user?

Copy link
Contributor

Choose a reason for hiding this comment

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

Might make sense to have some kind of BaseCreateOrUPdateUserOptions class that both can inherit from with only the common options, but I'll defer to you as the more experienced Kotlin developer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OMG good call... for some reason I read from the docs that both create and update were operating off of the email. I just made the change, and also pushed an AbstractUserOptionsBuilder<OptionsObject> to simplify the code of both create/update builders.

@JsonProperty("refresh_token")
val refreshToken: String? = null,

@JsonProperty("created_at")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@JsonProperty("created_at")
@JsonProperty("impersonator")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great catch!! 🔥

import com.workos.common.models.ListMetadata

/**
* A list of [AuthenticationFactor]s
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* A list of [AuthenticationFactor]s
* A list of authentication Factors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, wait. Do these brackets actually mean something as far as these doc comments go? As in, would they link to the type-definitions of the relevantly named object if say a doc generator to HTML was run?

I had assumed these were copy-paste mistakes, but now realizing that may have been wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. They also provide the full documentation of the type when hovering over in IntelliJ, which can be useful in those cases were the structure of the class is not trivial:

image

While it is not a big deal at the moment, as we don't rely on any autogened documentation for the SDKs yet, I went ahead and edited the documentation of the non-literal types found in the model classes.

@amadeo-workos amadeo-workos requested a review from mthadley April 18, 2024 22:42
@amadeo-workos amadeo-workos changed the base branch from main to beta April 23, 2024 14:48
* Add Beta SDKs section in README.md

* Nit/typo
mthadley
mthadley previously approved these changes Apr 23, 2024
@amadeo-workos
Copy link
Contributor Author

@mthadley Can I have another :stamp:? I pushed an extra commit to just rename the name of the folder/package? Thanks!

@amadeo-workos amadeo-workos requested a review from mthadley April 24, 2024 17:02
mthadley
mthadley previously approved these changes Apr 24, 2024
* Nit in section about Beta releases in the README.md

* Improvement to README.md

* Update README.md
@amadeo-workos amadeo-workos enabled auto-merge (squash) April 25, 2024 12:20
@amadeo-workos amadeo-workos force-pushed the user-management-support branch 2 times, most recently from 5af0fbe to fe79094 Compare April 25, 2024 12:26
@amadeo-workos amadeo-workos force-pushed the user-management-support branch 3 times, most recently from af57a84 to 9f2e340 Compare April 25, 2024 12:27
@amadeo-workos
Copy link
Contributor Author

@PaulAsjes are you around to approve this? It was originally approved by @mthadley but I had to rebase my branch and dismissed their approval. Thanks!

@amadeo-workos amadeo-workos requested a review from PaulAsjes April 25, 2024 12:30
@amadeo-workos
Copy link
Contributor Author

Sigh... no idea why it is not letting me merge... why 2 commits are verified but 1 is not 👎

@amadeo-workos amadeo-workos force-pushed the user-management-support branch from 9f2e340 to 437fbd4 Compare April 25, 2024 12:57
@amadeo-workos amadeo-workos disabled auto-merge April 25, 2024 13:01
@amadeo-workos amadeo-workos merged commit 1bf461f into beta Apr 25, 2024
2 checks passed
@amadeo-workos amadeo-workos deleted the user-management-support branch April 25, 2024 13:03
@amadeo-workos
Copy link
Contributor Author

@ibrahimbutt

The UM support in the Java SDK has shipped! ⛵ it is under the 3.1.0-beta.user-management1 version. Please check it out and let us know how it goes!

Thanks!

PaulAsjes added a commit that referenced this pull request Jul 19, 2024
* User Management support (#212)

* Add Beta SDKs section in README.md (#213)

* Add Beta SDKs section in README.md

* Nit/typo

* Nit in section about Beta releases in the README.md (#214)

* Nit in section about Beta releases in the README.md

* Improvement to README.md

* Update README.md

* User Management support

* Update version (#215)

* Add Beta SDKs section in README.md (#213)

* Add Beta SDKs section in README.md

* Nit/typo

* Nit in section about Beta releases in the README.md (#214)

* Nit in section about Beta releases in the README.md

* Improvement to README.md

* Update README.md

* Update version

* Fix release script (Beta branch) (#217)

* Add Beta SDKs section in README.md (#213)

* Add Beta SDKs section in README.md

* Nit/typo

* Nit in section about Beta releases in the README.md (#214)

* Nit in section about Beta releases in the README.md

* Improvement to README.md

* Update README.md

* Fix typo in release script

* Add organization membership events (#218)

Add organization membership events.

* Update beta version (#219)

* Add events and API changes for invitations and Magic Auth (#221)

* Add events and API changes for invitations and Magic Auth

* Fix failing test

* Rename event data

* v3.1.0-beta.user-management3 (#222)

* Add organization membership deactivate and reactivate API methods. (#226)

* Bump to version 3.1.0-beta.user-management4. (#227)

* Add methods and events for email verification and password reset (#228)

* v3.1.0-beta.user-management5 (#229)

* Add find invitation by token method (#230)

* Fix list endpoints (#236)

* Now correctly parsing data as params for GET requests

* Value has to be a string

* lol linting

* 3.1.0-beta.user-management6 (#233)

* `invitationCode` should be `invitationToken` (#237)

---------

Co-authored-by: amadeo <[email protected]>
Co-authored-by: Matt Dzwonczyk <[email protected]>
Co-authored-by: Blair Lunceford <[email protected]>
Co-authored-by: Michael Hadley <[email protected]>
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