Skip to content

Commit

Permalink
Add verified fields to Members and refresh docs (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-stytch authored Aug 10, 2023
1 parent 5b969d6 commit 9e3800c
Show file tree
Hide file tree
Showing 28 changed files with 199 additions and 118 deletions.
13 changes: 7 additions & 6 deletions stytch/b2b/discovery/intermediatesessions/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ type ExchangeParams 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"`
// Locale: (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number,
// this endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale
// argument will be used to determine which language to use when sending the passcode.
// Locale: If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint
// will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will
// be used to determine which language to use when sending the passcode.
//
// Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/),
// e.g. `"en"`.
Expand All @@ -79,7 +79,8 @@ type ExchangeResponse struct {
SessionToken string `json:"session_token,omitempty"`
// SessionJWT: The JSON Web Token (JWT) for a given Stytch Session.
SessionJWT string `json:"session_jwt,omitempty"`
// Member: The [Member object](https://stytch.com/docs/b2b/api/member-object).
// Member: The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or
// null if one does not.
Member organizations.Member `json:"member,omitempty"`
// Organization: The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
Organization organizations.Organization `json:"organization,omitempty"`
Expand All @@ -103,8 +104,8 @@ type ExchangeResponse struct {
StatusCode int32 `json:"status_code,omitempty"`
// MemberSession: The [Session object](https://stytch.com/docs/b2b/api/session-object).
MemberSession sessions.MemberSession `json:"member_session,omitempty"`
// MFARequired: (Coming Soon) Information about the MFA requirements of the Organization and the Member's
// options for fulfilling MFA.
// MFARequired: Information about the MFA requirements of the Organization and the Member's options for
// fulfilling MFA.
MFARequired mfa.MfaRequired `json:"mfa_required,omitempty"`
}

Expand Down
11 changes: 6 additions & 5 deletions stytch/b2b/discovery/organizations/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ type CreateParams struct {
// The list's accepted values are: `sso`, `magic_link`, `password`, `google_oauth`, and `microsoft_oauth`.
//
AllowedAuthMethods []string `json:"allowed_auth_methods,omitempty"`
// MFAPolicy: (Coming Soon) The setting that controls the MFA policy for all Members in the Organization.
// The accepted values are:
// MFAPolicy: The setting that controls the MFA policy for all Members in the Organization. The accepted
// values are:
//
// `REQUIRED_FOR_ALL` – All Members within the Organization will be required to complete MFA every time
// they wish to log in.
Expand Down Expand Up @@ -164,7 +164,8 @@ type CreateResponse struct {
SessionToken string `json:"session_token,omitempty"`
// SessionJWT: The JSON Web Token (JWT) for a given Stytch Session.
SessionJWT string `json:"session_jwt,omitempty"`
// Member: The [Member object](https://stytch.com/docs/b2b/api/member-object).
// Member: The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or
// null if one does not.
Member organizations.Member `json:"member,omitempty"`
// MemberAuthenticated: Indicates whether the Member is fully authenticated. If false, the Member needs to
// complete an MFA step to log in to the Organization.
Expand All @@ -188,8 +189,8 @@ type CreateResponse struct {
MemberSession sessions.MemberSession `json:"member_session,omitempty"`
// Organization: The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
Organization organizations.Organization `json:"organization,omitempty"`
// MFARequired: (Coming Soon) Information about the MFA requirements of the Organization and the Member's
// options for fulfilling MFA.
// MFARequired: Information about the MFA requirements of the Organization and the Member's options for
// fulfilling MFA.
MFARequired mfa.MfaRequired `json:"mfa_required,omitempty"`
}

Expand Down
7 changes: 3 additions & 4 deletions stytch/b2b/discovery/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ type DiscoveredOrganization struct {
Organization organizations.Organization `json:"organization,omitempty"`
// Membership: Information about the membership.
Membership Membership `json:"membership,omitempty"`
// PrimaryRequired: (Coming Soon) Information about the primary authentication requirements of the
// Organization.
// PrimaryRequired: Information about the primary authentication requirements of the Organization.
PrimaryRequired PrimaryRequired `json:"primary_required,omitempty"`
// MFARequired: (Coming Soon) Information about the MFA requirements of the Organization and the Member's
// options for fulfilling MFA.
// MFARequired: Information about the MFA requirements of the Organization and the Member's options for
// fulfilling MFA.
MFARequired mfa.MfaRequired `json:"mfa_required,omitempty"`
}

Expand Down
4 changes: 2 additions & 2 deletions stytch/b2b/discovery_intermediatesessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ func NewDiscoveryIntermediateSessionsClient(c stytch.Client) *DiscoveryIntermedi
//
// This endpoint can be used to accept invites and create new members via domain matching.
//
// (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned
// value of `member_authenticated` will be `false`.
// If the Member is required to complete MFA to log in to the Organization, the returned value of
// `member_authenticated` will be `false`.
// The `intermediate_session_token` will not be consumed and instead will be returned in the response.
// The `intermediate_session_token` can be passed into the
// [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the
Expand Down
4 changes: 2 additions & 2 deletions stytch/b2b/discovery_organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ func NewDiscoveryOrganizationsClient(c stytch.Client) *DiscoveryOrganizationsCli
//
// This endpoint can also be used to start an initial session for the newly created member and organization.
//
// (Coming Soon) If the new Organization is created with a `mfa_policy` of `REQUIRED_FOR_ALL`, the newly
// created Member will need to complete an MFA step to log in to the Organization.
// If the new Organization is created with a `mfa_policy` of `REQUIRED_FOR_ALL`, the newly created Member
// will need to complete an MFA step to log in to the Organization.
// The `intermediate_session_token` will not be consumed and instead will be returned in the response.
// The `intermediate_session_token` can be passed into the
// [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the
Expand Down
4 changes: 2 additions & 2 deletions stytch/b2b/magiclinks.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ func NewMagicLinksClient(c stytch.Client) *MagicLinksClient {
// `session_duration_minutes` parameter is not specified, a Stytch session will be created with a 60 minute
// duration.
//
// (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned
// value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned.
// If the Member is required to complete MFA to log in to the Organization, the returned value of
// `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned.
// The `intermediate_session_token` can be passed into the
// [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the
// MFA step and acquire a full member session.
Expand Down
6 changes: 4 additions & 2 deletions stytch/b2b/magiclinks/email/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ type InviteResponse struct {
RequestID string `json:"request_id,omitempty"`
// MemberID: Globally unique UUID that identifies a specific Member.
MemberID string `json:"member_id,omitempty"`
// Member: The [Member object](https://stytch.com/docs/b2b/api/member-object).
// Member: The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or
// null if one does not.
Member organizations.Member `json:"member,omitempty"`
// Organization: The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
Organization organizations.Organization `json:"organization,omitempty"`
Expand All @@ -126,7 +127,8 @@ type LoginOrSignupResponse struct {
// MemberCreated: A flag indicating `true` if a new Member object was created and `false` if the Member
// object already existed.
MemberCreated bool `json:"member_created,omitempty"`
// Member: The [Member object](https://stytch.com/docs/b2b/api/member-object).
// Member: The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or
// null if one does not.
Member organizations.Member `json:"member,omitempty"`
// Organization: The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
Organization organizations.Organization `json:"organization,omitempty"`
Expand Down
13 changes: 7 additions & 6 deletions stytch/b2b/magiclinks/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ type AuthenticateParams 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"`
// Locale: (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number,
// this endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale
// argument will be used to determine which language to use when sending the passcode.
// Locale: If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint
// will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will
// be used to determine which language to use when sending the passcode.
//
// Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/),
// e.g. `"en"`.
Expand Down Expand Up @@ -88,7 +88,8 @@ type AuthenticateResponse struct {
// OrganizationID: Globally unique UUID that identifies a specific Organization. The `organization_id` is
// critical to perform operations on an Organization, so be sure to preserve this value.
OrganizationID string `json:"organization_id,omitempty"`
// Member: The [Member object](https://stytch.com/docs/b2b/api/member-object).
// Member: The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or
// null if one does not.
Member organizations.Member `json:"member,omitempty"`
// SessionToken: A secret token for a given Stytch Session.
SessionToken string `json:"session_token,omitempty"`
Expand Down Expand Up @@ -116,8 +117,8 @@ type AuthenticateResponse struct {
// patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX
// are server errors.
StatusCode int32 `json:"status_code,omitempty"`
// MFARequired: (Coming Soon) Information about the MFA requirements of the Organization and the Member's
// options for fulfilling MFA.
// MFARequired: Information about the MFA requirements of the Organization and the Member's options for
// fulfilling MFA.
MFARequired mfa.MfaRequired `json:"mfa_required,omitempty"`
}

Expand Down
2 changes: 2 additions & 0 deletions stytch/b2b/mfa/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ package mfa
// or your changes may be overwritten later!
// !!!

// MemberOptions:
type MemberOptions struct {
// MFAPhoneNumber: The Member's MFA phone number.
MFAPhoneNumber string `json:"mfa_phone_number,omitempty"`
}

Expand Down
4 changes: 2 additions & 2 deletions stytch/b2b/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ func NewOAuthClient(c stytch.Client) *OAuthClient {
// parameter to set the lifetime of the session. If the `session_duration_minutes` parameter is not
// specified, a Stytch session will be created with a 60 minute duration.
//
// (Coming Soon) If the Member is required to complete MFA to log in to the Organization, the returned
// value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned.
// If the Member is required to complete MFA to log in to the Organization, the returned value of
// `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned.
// The `intermediate_session_token` can be passed into the
// [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the
// MFA step and acquire a full member session.
Expand Down
13 changes: 7 additions & 6 deletions stytch/b2b/oauth/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ type AuthenticateParams struct {
// PkceCodeVerifier: A base64url encoded one time secret used to validate that the request starts and ends
// on the same device.
PkceCodeVerifier string `json:"pkce_code_verifier,omitempty"`
// Locale: (Coming Soon) If the Member needs to complete an MFA step, and the Member has a phone number,
// this endpoint will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale
// argument will be used to determine which language to use when sending the passcode.
// Locale: If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint
// will pre-emptively send a one-time passcode (OTP) to the Member's phone number. The locale argument will
// be used to determine which language to use when sending the passcode.
//
// Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/),
// e.g. `"en"`.
Expand Down Expand Up @@ -99,7 +99,8 @@ type AuthenticateResponse struct {
SessionToken string `json:"session_token,omitempty"`
// SessionJWT: The JSON Web Token (JWT) for a given Stytch Session.
SessionJWT string `json:"session_jwt,omitempty"`
// Member: The [Member object](https://stytch.com/docs/b2b/api/member-object).
// Member: The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or
// null if one does not.
Member organizations.Member `json:"member,omitempty"`
// OrganizationID: Globally unique UUID that identifies a specific Organization. The `organization_id` is
// critical to perform operations on an Organization, so be sure to preserve this value.
Expand Down Expand Up @@ -134,8 +135,8 @@ type AuthenticateResponse struct {
// Note that these values will vary based on the OAuth provider in question, e.g. `id_token` is only
// returned by Microsoft.
ProviderValues ProviderValues `json:"provider_values,omitempty"`
// MFARequired: (Coming Soon) Information about the MFA requirements of the Organization and the Member's
// options for fulfilling MFA.
// MFARequired: Information about the MFA requirements of the Organization and the Member's options for
// fulfilling MFA.
MFARequired mfa.MfaRequired `json:"mfa_required,omitempty"`
}

Expand Down
Loading

0 comments on commit 9e3800c

Please sign in to comment.