Skip to content

Commit

Permalink
Update docs (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-stytch authored Nov 13, 2024
1 parent 07c5578 commit dce0cfd
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 31 deletions.
26 changes: 13 additions & 13 deletions stytch/b2b/discovery/organizations/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@ type CreateParams struct {
// or the
// [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member.
IntermediateSessionToken string `json:"intermediate_session_token,omitempty"`
// OrganizationName: The name of the Organization. If the name is not specified, a default name will be
// created based on the email used to initiate the discovery flow. If the email domain is a common email
// provider such as gmail.com, or if the email is a .edu email, the organization name will be generated
// based on the name portion of the email. Otherwise, the organization name will be generated based on the
// email domain.
OrganizationName string `json:"organization_name,omitempty"`
// OrganizationSlug: The unique URL slug of the Organization. A minimum of two characters is required. The
// slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`. If the
// slug is not specified, a default slug will be created based on the email used to initiate the discovery
// flow. If the email domain is a common email provider such as gmail.com, or if the email is a .edu email,
// the organization slug will be generated based on the name portion of the email. Otherwise, the
// organization slug will be generated based on the email domain.
OrganizationSlug string `json:"organization_slug,omitempty"`
// SessionDurationMinutes: Set the session lifetime to be this many minutes from now. This will start a new
// session if one doesn't already exist,
// returning both an opaque `session_token` and `session_jwt` for this session. Remember that the
Expand All @@ -63,6 +50,19 @@ type CreateParams struct {
// `exp`, `nbf`, `iat`, `jti`) will be ignored.
// Total custom claims size cannot exceed four kilobytes.
SessionCustomClaims map[string]any `json:"session_custom_claims,omitempty"`
// OrganizationName: The name of the Organization. If the name is not specified, a default name will be
// created based on the email used to initiate the discovery flow. If the email domain is a common email
// provider such as gmail.com, or if the email is a .edu email, the organization name will be generated
// based on the name portion of the email. Otherwise, the organization name will be generated based on the
// email domain.
OrganizationName string `json:"organization_name,omitempty"`
// OrganizationSlug: The unique URL slug of the Organization. A minimum of two characters is required. The
// slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`. If the
// slug is not specified, a default slug will be created based on the email used to initiate the discovery
// flow. If the email domain is a common email provider such as gmail.com, or if the email is a .edu email,
// the organization slug will be generated based on the name portion of the email. Otherwise, the
// organization slug will be generated based on the email domain.
OrganizationSlug string `json:"organization_slug,omitempty"`
// OrganizationLogoURL: The image URL of the Organization logo.
OrganizationLogoURL string `json:"organization_logo_url,omitempty"`
// TrustedMetadata: An arbitrary JSON object for storing application-specific data or
Expand Down
16 changes: 10 additions & 6 deletions stytch/b2b/sso/oidc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ type CreateConnectionParams struct {
OrganizationID string `json:"organization_id,omitempty"`
// DisplayName: A human-readable display name for the connection.
DisplayName string `json:"display_name,omitempty"`
// IdentityProvider: The identity provider of this connection. For OIDC, the accepted values are `generic`,
// `okta`, and `microsoft-entra`. For SAML, the accepted values are `generic`, `okta`, `microsoft-entra`,
// and `google-workspace`.
// IdentityProvider: Name of the IdP. Enum with possible values: `classlink`, `cyberark`, `duo`,
// `google-workspace`, `jumpcloud`, `keycloak`, `miniorange`, `microsoft-entra`, `okta`, `onelogin`,
// `pingfederate`, `rippling`, `salesforce`, `shibboleth`, or `generic`.
//
// Specifying a known provider allows Stytch to handle any provider-specific logic.
IdentityProvider CreateConnectionRequestIdentityProvider `json:"identity_provider,omitempty"`
}

Expand Down Expand Up @@ -54,9 +56,11 @@ type UpdateConnectionParams struct {
// JWKSURL: The location of the IdP's JSON Web Key Set, used to verify credentials issued by the IdP. This
// will be provided by the IdP.
JWKSURL string `json:"jwks_url,omitempty"`
// IdentityProvider: The identity provider of this connection. For OIDC, the accepted values are `generic`,
// `okta`, and `microsoft-entra`. For SAML, the accepted values are `generic`, `okta`, `microsoft-entra`,
// and `google-workspace`.
// IdentityProvider: Name of the IdP. Enum with possible values: `classlink`, `cyberark`, `duo`,
// `google-workspace`, `jumpcloud`, `keycloak`, `miniorange`, `microsoft-entra`, `okta`, `onelogin`,
// `pingfederate`, `rippling`, `salesforce`, `shibboleth`, or `generic`.
//
// Specifying a known provider allows Stytch to handle any provider-specific logic.
IdentityProvider UpdateConnectionRequestIdentityProvider `json:"identity_provider,omitempty"`
// CustomScopes: Include a space-separated list of custom scopes that you'd like to include. Note that this
// list must be URL encoded, e.g. the spaces must be expressed as %20.
Expand Down
16 changes: 10 additions & 6 deletions stytch/b2b/sso/saml/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ type CreateConnectionParams struct {
OrganizationID string `json:"organization_id,omitempty"`
// DisplayName: A human-readable display name for the connection.
DisplayName string `json:"display_name,omitempty"`
// IdentityProvider: The identity provider of this connection. For OIDC, the accepted values are `generic`,
// `okta`, and `microsoft-entra`. For SAML, the accepted values are `generic`, `okta`, `microsoft-entra`,
// and `google-workspace`.
// IdentityProvider: Name of the IdP. Enum with possible values: `classlink`, `cyberark`, `duo`,
// `google-workspace`, `jumpcloud`, `keycloak`, `miniorange`, `microsoft-entra`, `okta`, `onelogin`,
// `pingfederate`, `rippling`, `salesforce`, `shibboleth`, or `generic`.
//
// Specifying a known provider allows Stytch to handle any provider-specific logic.
IdentityProvider CreateConnectionRequestIdentityProvider `json:"identity_provider,omitempty"`
}

Expand Down Expand Up @@ -87,9 +89,11 @@ type UpdateConnectionParams struct {
// [SSO migration guide](https://stytch.com/docs/b2b/guides/migrations/additional-migration-considerations)
// for more info.
AlternativeAudienceURI string `json:"alternative_audience_uri,omitempty"`
// IdentityProvider: The identity provider of this connection. For OIDC, the accepted values are `generic`,
// `okta`, and `microsoft-entra`. For SAML, the accepted values are `generic`, `okta`, `microsoft-entra`,
// and `google-workspace`.
// IdentityProvider: Name of the IdP. Enum with possible values: `classlink`, `cyberark`, `duo`,
// `google-workspace`, `jumpcloud`, `keycloak`, `miniorange`, `microsoft-entra`, `okta`, `onelogin`,
// `pingfederate`, `rippling`, `salesforce`, `shibboleth`, or `generic`.
//
// Specifying a known provider allows Stytch to handle any provider-specific logic.
IdentityProvider UpdateConnectionRequestIdentityProvider `json:"identity_provider,omitempty"`
}

Expand Down
2 changes: 1 addition & 1 deletion stytch/config/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package config

const APIVersion = "15.9.0"
const APIVersion = "15.9.1"
4 changes: 2 additions & 2 deletions stytch/consumer/otp/email/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ type SendParams struct {
SessionJWT string `json:"session_jwt,omitempty"`
// LoginTemplateID: Use a custom template for login emails. By default, it will use your default email
// template. The template must be a template using our built-in customizations or a custom HTML email for
// Magic links - Login.
// OTP - Login.
LoginTemplateID string `json:"login_template_id,omitempty"`
// SignupTemplateID: Use a custom template for sign-up emails. By default, it will use your default email
// template. The template must be a template using our built-in customizations or a custom HTML email for
// Magic links - Sign-up.
// OTP - Sign-up.
SignupTemplateID string `json:"signup_template_id,omitempty"`
}

Expand Down
5 changes: 3 additions & 2 deletions stytch/consumer/sessions/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ type AuthenticateParams struct {
// AuthenticationFactor:
type AuthenticationFactor struct {
// Type: The type of authentication factor. The possible values are: `magic_link`, `otp`,
// `oauth`, `password`, or `sso`.
// `oauth`, `password`, `email_otp`, or `sso` .
Type AuthenticationFactorType `json:"type,omitempty"`
// DeliveryMethod: The method that was used to deliver the authentication factor. The possible values
// depend on the `type`:
//
// `magic_link` – Only `email`.
//
// `otp` – Only `sms`.
// `otp` – Either `sms` or `email` .
//
// `oauth` – Either `oauth_google` or `oauth_microsoft`.
//
Expand Down Expand Up @@ -573,6 +573,7 @@ const (
AuthenticationFactorTypeSSO AuthenticationFactorType = "sso"
AuthenticationFactorTypeImported AuthenticationFactorType = "imported"
AuthenticationFactorTypeRecoveryCodes AuthenticationFactorType = "recovery_codes"
AuthenticationFactorTypeEmailOTP AuthenticationFactorType = "email_otp"
)

// MANUAL(Types)(TYPES)
Expand Down
12 changes: 11 additions & 1 deletion stytch/consumer/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,17 @@ func (c *UsersClient) Get(
return &retVal, err
}

// Search for Users within your Stytch Project. Submit an empty `query` in the request to return all Users.
// Search for Users within your Stytch Project.
//
// Use the `query` object to filter by different fields. See the `query.operands.filter_value`
// documentation below for a list of available filters.
//
// ### Export all User data
//
// Submit an empty `query` in your Search Users request to return all of your Stytch Project's Users.
//
// [This Github repository](https://github.com/stytchauth/stytch-node-export-users) contains a utility that
// leverages the Search Users endpoint to export all of your User data to a CSV or JSON file.
func (c *UsersClient) Search(
ctx context.Context,
body *users.SearchParams,
Expand Down

0 comments on commit dce0cfd

Please sign in to comment.