Skip to content

Commit

Permalink
Bump SDK from codegen workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Stytch Codegen Bot committed Jan 16, 2025
1 parent 38baf27 commit 8b2a5a5
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
20 changes: 16 additions & 4 deletions stytch/b2b/api/impersonation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ def __init__(

def authenticate(
self,
token: str,
impersonation_token: str,
) -> AuthenticateResponse:
"""Authenticate an impersonation token to impersonate a. This endpoint requires an impersonation token that is not expired or previously used.
A Stytch session will be created for the impersonated member with a 60 minute duration. Impersonated sessions cannot be extended.
Fields:
- impersonation_token: The User Impersonation token to authenticate.
""" # noqa
headers: Dict[str, str] = {}
data: Dict[str, Any] = {
"token": token,
"impersonation_token": impersonation_token,
}

url = self.api_base.url_for("/v1/b2b/impersonation/authenticate", data)
Expand All @@ -36,11 +42,17 @@ def authenticate(

async def authenticate_async(
self,
token: str,
impersonation_token: str,
) -> AuthenticateResponse:
"""Authenticate an impersonation token to impersonate a. This endpoint requires an impersonation token that is not expired or previously used.
A Stytch session will be created for the impersonated member with a 60 minute duration. Impersonated sessions cannot be extended.
Fields:
- impersonation_token: The User Impersonation token to authenticate.
""" # noqa
headers: Dict[str, str] = {}
data: Dict[str, Any] = {
"token": token,
"impersonation_token": impersonation_token,
}

url = self.api_base.url_for("/v1/b2b/impersonation/authenticate", data)
Expand Down
14 changes: 14 additions & 0 deletions stytch/b2b/models/impersonation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@


class AuthenticateResponse(ResponseBase):
"""Response type for `Impersonation.authenticate`.
Fields:
- member_id: Globally unique UUID that identifies a specific Member.
- organization_id: 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.
- member: The [Member object](https://stytch.com/docs/b2b/api/member-object)
- session_token: A secret token for a given Stytch Session.
- session_jwt: The JSON Web Token (JWT) for a given Stytch Session.
- organization: The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
- intermediate_session_token: Successfully authenticating an impersonation token will never result in an intermediate session. If the token is valid, a full session will be created.
- member_authenticated: The member will always be fully authenticated if an impersonation token is successfully authenticated.
- member_session: The [Session object](https://stytch.com/docs/b2b/api/session-object) for the impersonated Member.
- mfa_required: MFA will not be required when authenticating impersonation tokens.
""" # noqa

member_id: str
organization_id: str
member: Member
Expand Down
8 changes: 7 additions & 1 deletion stytch/consumer/models/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ class HubspotOAuthFactor(pydantic.BaseModel):


class ImpersonatedFactor(pydantic.BaseModel):
"""
Fields:
- impersonator_id: The unique UUID of the impersonator. For impersonation sessions initiated via the Stytch dashboard, the `impersonator_id` will be the impersonator's Stytch workspace id.
- impersonator_email_address: The email address of the impersonator.
""" # noqa

impersonator_id: str
impersonator_email_address: str

Expand Down Expand Up @@ -408,7 +414,7 @@ class AuthenticationFactor(pydantic.BaseModel):
- hubspot_oauth_exchange_factor: (no documentation yet)
- github_oauth_exchange_factor: (no documentation yet)
- google_oauth_exchange_factor: (no documentation yet)
- impersonated_factor: (no documentation yet)
- impersonated_factor: Information about the impersonated factor, if one is present.
""" # noqa

type: AuthenticationFactorType
Expand Down
2 changes: 1 addition & 1 deletion stytch/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "12.2.0"
__version__ = "12.3.0"

0 comments on commit 8b2a5a5

Please sign in to comment.