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

chore: [AUTH-2594] Publish Member OAuth methods #297

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dist/b2b/magic_links.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/b2b/organizations_members.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions dist/b2b/organizations_members_oauth_providers.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/b2b/rbac.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions dist/b2b/sso.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/b2c/otps_email.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions lib/b2b/discovery_intermediate_sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ export interface B2BDiscoveryIntermediateSessionsExchangeRequest {
* The Intermediate Session Token. This token does not necessarily belong to a specific instance of a
* Member, but represents a bag of factors that may be converted to a member session.
* The token can be used with the
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA
* flow;
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms),
* [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
* or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to
* complete an MFA flow;
* the
* [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session)
* to join a specific Organization that allows the factors represented by the intermediate session token;
Expand Down Expand Up @@ -102,8 +104,10 @@ export interface B2BDiscoveryIntermediateSessionsExchangeResponse {
* The returned Intermediate Session Token is identical to the one that was originally passed in to the
* request.
* The token can be used with the
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the
* MFA flow and log in to the Organization.
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms),
* [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
* or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to
* complete the MFA flow and log in to the Organization.
* It can also be used with the
* [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session)
* to join a different existing Organization,
Expand Down
24 changes: 15 additions & 9 deletions lib/b2b/discovery_organizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export interface B2BDiscoveryOrganizationsCreateRequest {
* The Intermediate Session Token. This token does not necessarily belong to a specific instance of a
* Member, but represents a bag of factors that may be converted to a member session.
* The token can be used with the
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA
* flow;
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms),
* [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
* or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to
* complete an MFA flow;
* the
* [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session)
* to join a specific Organization that allows the factors represented by the intermediate session token;
Expand Down Expand Up @@ -165,18 +167,18 @@ export interface B2BDiscoveryOrganizationsCreateRequest {
*/
rbac_email_implicit_role_assignments?: EmailImplicitRoleAssignment[];
/**
* The setting that controls which mfa methods can be used by Members of an Organization. The accepted
* The setting that controls which MFA methods can be used by Members of an Organization. The accepted
* values are:
*
* `ALL_ALLOWED` – the default setting which allows all authentication methods to be used.
*
* `RESTRICTED` – only methods that comply with `allowed_auth_methods` can be used for authentication.
* `RESTRICTED` – only methods that comply with `allowed_mfa_methods` can be used for authentication.
* This setting does not apply to Members with `is_breakglass` set to `true`.
*
*/
mfa_methods?: string;
/**
* An array of allowed mfa authentication methods. This list is enforced when `mfa_methods` is set to
* An array of allowed MFA authentication methods. This list is enforced when `mfa_methods` is set to
* `RESTRICTED`.
* The list's accepted values are: `sms_otp` and `totp`.
*
Expand Down Expand Up @@ -208,8 +210,10 @@ export interface B2BDiscoveryOrganizationsCreateResponse {
* The returned Intermediate Session Token is identical to the one that was originally passed in to the
* request.
* The token can be used with the
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the
* MFA flow and log in to the Organization.
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms),
* [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
* or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to
* complete the MFA flow and log in to the Organization.
* It can also be used with the
* [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session)
* to join a different existing Organization,
Expand All @@ -236,8 +240,10 @@ export interface B2BDiscoveryOrganizationsListRequest {
* The Intermediate Session Token. This token does not necessarily belong to a specific instance of a
* Member, but represents a bag of factors that may be converted to a member session.
* The token can be used with the
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA
* flow;
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms),
* [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
* or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to
* complete an MFA flow;
* the
* [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session)
* to join a specific Organization that allows the factors represented by the intermediate session token;
Expand Down
6 changes: 6 additions & 0 deletions lib/b2b/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ export type {
B2BOrganizationsMembersCreateRequestOptions,
} from "./organizations_members";

export type {
B2BOrganizationsMembersOAuthProvidersGoogleResponse,
B2BOrganizationsMembersOAuthProvidersMicrosoftRequest,
B2BOrganizationsMembersOAuthProvidersMicrosoftResponse,
Copy link
Contributor

Choose a reason for hiding this comment

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

The identiifer-vomit from how these get built is amazing

} from "./organizations_members_oauth_providers";

export type {
AuthorizationCheck,
AuthorizationVerdict,
Expand Down
12 changes: 8 additions & 4 deletions lib/b2b/magic_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ export interface B2BMagicLinksAuthenticateResponse {
* The returned Intermediate Session Token contains an Email Magic Link factor associated with the Member's
* email address.
* The token can be used with the
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the
* MFA flow and log in to the Organization.
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms),
* [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
* or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to
* complete the MFA flow and log in to the Organization.
* It can also be used with the
* [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session)
* to join a different existing Organization that allows login with Email Magic Links,
Expand Down Expand Up @@ -161,8 +163,10 @@ export class MagicLinks {
* 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.
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms),
* [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
* or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete
* the MFA step and acquire a full member session.
* The `intermediate_session_token` can also be used with the
* [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session)
* or the
Expand Down
6 changes: 4 additions & 2 deletions lib/b2b/magic_links_discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ export interface B2BMagicLinksDiscoveryAuthenticateResponse {
* The Intermediate Session Token. This token does not necessarily belong to a specific instance of a
* Member, but represents a bag of factors that may be converted to a member session.
* The token can be used with the
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA
* flow;
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms),
* [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
* or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to
* complete an MFA flow;
* the
* [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session)
* to join a specific Organization that allows the factors represented by the intermediate session token;
Expand Down
2 changes: 1 addition & 1 deletion lib/b2b/magic_links_email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// !!!

import {
Authorization,
addAuthorizationHeaders,
Authorization,
} from "../shared/method_options";
import { Discovery } from "./magic_links_email_discovery";
import { fetchConfig } from "../shared";
Expand Down
2 changes: 2 additions & 0 deletions lib/b2b/mfa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {} from "../shared/method_options";
export interface MemberOptions {
// The Member's MFA phone number.
mfa_phone_number: string;
// The Member's MFA TOTP registration ID.
totp_registration_id: string;
}

export interface MfaRequired {
Expand Down
6 changes: 4 additions & 2 deletions lib/b2b/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ export interface B2BOAuthAuthenticateResponse {
* The returned Intermediate Session Token contains an OAuth factor associated with the Member's email
* address.
* The token can be used with the
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the
* MFA flow and log in to the Organization.
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms),
* [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
* or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to
* complete the MFA flow and log in to the Organization.
* It can also be used with the
* [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session)
* to join a different existing Organization that allows login with OAuth,
Expand Down
6 changes: 4 additions & 2 deletions lib/b2b/oauth_discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ export interface B2BOAuthDiscoveryAuthenticateResponse {
* The Intermediate Session Token. This token does not necessarily belong to a specific instance of a
* Member, but represents a bag of factors that may be converted to a member session.
* The token can be used with the
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete an MFA
* flow;
* [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms),
* [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),
* or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to
* complete an MFA flow;
* the
* [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session)
* to join a specific Organization that allows the factors represented by the intermediate session token;
Expand Down
Loading
Loading