Skip to content

[v13] Supporting changes for Cloud email invites (#32439)#34181

Merged
timothyb89 merged 2 commits intobranch/v13from
timothyb89/v13/teleport-invites
Nov 13, 2023
Merged

[v13] Supporting changes for Cloud email invites (#32439)#34181
timothyb89 merged 2 commits intobranch/v13from
timothyb89/v13/teleport-invites

Conversation

@timothyb89
Copy link
Copy Markdown
Contributor

Backport of #32439 for branch/v13


This adds a number of changes to support email user invites for Cloud.

image

  • Adds a new public /preset-roles endpoint that just returns the preset roles for the current version of Teleport. It's unauthenticated and intended for use in the new onboarding invitation UI. I don't think this has security implications beyond what we already return in the ping replies, since those include the Teleport version.
  • Includes role descriptions in the JSON responses sent to the UI
  • Makes various tweaks to our react-select wrapper, and adds a Creatable variant for email entry.
  • Adds a new requiresEmailLike validation rule, and adds more typing to the rules
  • Adds support for providing an invite collaborators element to replace the usual "Create User" UI from teleport.e
  • Adds support for showing the invite collaborators element during onboard, if a flag is set as a query parameter in the invite URL.

Note that gravitational/teleport.e#2286 is needed to test the changes. This PR must be merged before the teleport.e PR, then another PR here should bump the .e ref.

See also:

Backport of #32439 for branch/v13

---

* Add WIP implementation of Teleport email invites

This adds a WIP impl of Teleport email invites. Requires a compatible
Enterprise build and Cloud API.

* Bump e ref and add new validation rule

* Various improvements to enable Cloud email invites

* Add description to UI role resources
* Expose various new react-select options
* Add new FieldSelectCreatable
* Add some typing for validation rules
* Tweak invite button for Cloud to use email UI instead of showing
  both buttons
* Partial implementation for onboarding invites

* Add support for Cloud collaborator invites during onboarding

This adds various changes to enable showing the invite collaborators
form during initial user onboarding.

 * Adds a `?initial` URL query parameter for the UI to signify the
   first user; Cloud will append this to invite appropriate invite
   links.
 * Added a new ratelimited public endpoint to return a list of preset
   roles. This just exposes static data available otherwise available
   in Git and that could be obtained from the public Teleport version
   shown in ping responses already.

* Update e ref for the invite-collaborators branch

* Honor the `inputId` parameter if set

* bump e ref

* Improve typing for `requiredEmailLike` to add a error category

The `kind` field can allow the UI to group errors together if several
invalid emails are entered.

* bump e ref

* Destructure the InviteCollaborators component sanely

* Set `setDisplayInviteCollaborators` to `null` instead of `false`

* Split `FieldSelectCreatable` into its own file

* Fix lint

* add story for SelectCreatable

* Add tests for `requiredEmailLike`

* Rename `initial` flag to `invite`

Renaming the flag will hopefully clarify the intent.

* Add tests for invite collaborators feedback and users rendering

* Add rendering test for the invite collaborators card

* Clean up lints

* Rename types.tsx -> shared.tsx

* Relocate invite constant to `Welcome/const.ts`

* Split `SelectCreatable` into its own story

* Clarify SelectCreatable story

* Simplify story; fix lint

* Fix type checker failure

* Rename `preset-roles` endpoint to `presetroles` to follow API conventions
@timothyb89 timothyb89 changed the title [13] Supporting changes for Cloud email invites (#32439) [v13] Supporting changes for Cloud email invites (#32439) Nov 2, 2023
@timothyb89 timothyb89 enabled auto-merge November 13, 2023 02:49
@timothyb89 timothyb89 added this pull request to the merge queue Nov 13, 2023
Merged via the queue into branch/v13 with commit 42b0623 Nov 13, 2023
@timothyb89 timothyb89 deleted the timothyb89/v13/teleport-invites branch November 13, 2023 03:08
This was referenced Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants