Skip to content

Commit 7fc7f0f

Browse files
ci-stytchStytch Codegen Bot
andauthored
Release user device history (#283)
Co-authored-by: Stytch Codegen Bot <[email protected]>
1 parent 015a0f3 commit 7fc7f0f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+420
-9
lines changed

stytch/b2b/api/discovery_intermediate_sessions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def exchange(
3131
session_duration_minutes: Optional[int] = None,
3232
session_custom_claims: Optional[Dict[str, Any]] = None,
3333
locale: Optional[Union[ExchangeRequestLocale, str]] = None,
34+
telemetry_id: Optional[str] = None,
3435
) -> ExchangeResponse:
3536
"""Exchange an Intermediate Session for a fully realized [Member Session](https://stytch.com/docs/b2b/api/session-object) for the [Organization](https://stytch.com/docs/b2b/api/organization-object) that the user wishes to log into.
3637
@@ -73,6 +74,7 @@ def exchange(
7374
7475
Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
7576
77+
- telemetry_id: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
7678
""" # noqa
7779
headers: Dict[str, str] = {}
7880
data: Dict[str, Any] = {
@@ -85,6 +87,8 @@ def exchange(
8587
data["session_custom_claims"] = session_custom_claims
8688
if locale is not None:
8789
data["locale"] = locale
90+
if telemetry_id is not None:
91+
data["telemetry_id"] = telemetry_id
8892

8993
url = self.api_base.url_for(
9094
"/v1/b2b/discovery/intermediate_sessions/exchange", data
@@ -99,6 +103,7 @@ async def exchange_async(
99103
session_duration_minutes: Optional[int] = None,
100104
session_custom_claims: Optional[Dict[str, Any]] = None,
101105
locale: Optional[ExchangeRequestLocale] = None,
106+
telemetry_id: Optional[str] = None,
102107
) -> ExchangeResponse:
103108
"""Exchange an Intermediate Session for a fully realized [Member Session](https://stytch.com/docs/b2b/api/session-object) for the [Organization](https://stytch.com/docs/b2b/api/organization-object) that the user wishes to log into.
104109
@@ -141,6 +146,7 @@ async def exchange_async(
141146
142147
Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
143148
149+
- telemetry_id: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
144150
""" # noqa
145151
headers: Dict[str, str] = {}
146152
data: Dict[str, Any] = {
@@ -153,6 +159,8 @@ async def exchange_async(
153159
data["session_custom_claims"] = session_custom_claims
154160
if locale is not None:
155161
data["locale"] = locale
162+
if telemetry_id is not None:
163+
data["telemetry_id"] = telemetry_id
156164

157165
url = self.api_base.url_for(
158166
"/v1/b2b/discovery/intermediate_sessions/exchange", data

stytch/b2b/api/discovery_organizations.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def create(
5858
Union[CreateRequestThirdPartyConnectedAppsAllowedType, str]
5959
] = None,
6060
allowed_third_party_connected_apps: Optional[List[str]] = None,
61+
telemetry_id: Optional[str] = None,
6162
) -> CreateResponse:
6263
"""This endpoint allows you to exchange the `intermediate_session_token` returned when the user successfully completes a Discovery authentication flow to create a new
6364
[Organization](https://stytch.com/docs/b2b/api/organization-object) and [Member](https://stytch.com/docs/b2b/api/member-object) and log the user in. If the user wants to log into an existing Organization, use the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) instead.
@@ -174,6 +175,7 @@ def create(
174175
`NOT_ALLOWED` – no third party Connected Apps are permitted.
175176
176177
- allowed_third_party_connected_apps: An array of third party Connected App IDs that are allowed for the Organization. Only used when the Organization's `third_party_connected_apps_allowed_type` is `RESTRICTED`.
178+
- telemetry_id: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
177179
""" # noqa
178180
headers: Dict[str, str] = {}
179181
data: Dict[str, Any] = {
@@ -234,6 +236,8 @@ def create(
234236
data["allowed_third_party_connected_apps"] = (
235237
allowed_third_party_connected_apps
236238
)
239+
if telemetry_id is not None:
240+
data["telemetry_id"] = telemetry_id
237241

238242
url = self.api_base.url_for("/v1/b2b/discovery/organizations/create", data)
239243
res = self.sync_client.post(url, data, headers)
@@ -270,6 +274,7 @@ async def create_async(
270274
CreateRequestThirdPartyConnectedAppsAllowedType
271275
] = None,
272276
allowed_third_party_connected_apps: Optional[List[str]] = None,
277+
telemetry_id: Optional[str] = None,
273278
) -> CreateResponse:
274279
"""This endpoint allows you to exchange the `intermediate_session_token` returned when the user successfully completes a Discovery authentication flow to create a new
275280
[Organization](https://stytch.com/docs/b2b/api/organization-object) and [Member](https://stytch.com/docs/b2b/api/member-object) and log the user in. If the user wants to log into an existing Organization, use the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) instead.
@@ -386,6 +391,7 @@ async def create_async(
386391
`NOT_ALLOWED` – no third party Connected Apps are permitted.
387392
388393
- allowed_third_party_connected_apps: An array of third party Connected App IDs that are allowed for the Organization. Only used when the Organization's `third_party_connected_apps_allowed_type` is `RESTRICTED`.
394+
- telemetry_id: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
389395
""" # noqa
390396
headers: Dict[str, str] = {}
391397
data: Dict[str, Any] = {
@@ -446,6 +452,8 @@ async def create_async(
446452
data["allowed_third_party_connected_apps"] = (
447453
allowed_third_party_connected_apps
448454
)
455+
if telemetry_id is not None:
456+
data["telemetry_id"] = telemetry_id
449457

450458
url = self.api_base.url_for("/v1/b2b/discovery/organizations/create", data)
451459
res = await self.async_client.post(url, data, headers)

stytch/b2b/api/magic_links.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def authenticate(
4646
session_custom_claims: Optional[Dict[str, Any]] = None,
4747
locale: Optional[Union[AuthenticateRequestLocale, str]] = None,
4848
intermediate_session_token: Optional[str] = None,
49+
telemetry_id: Optional[str] = None,
4950
) -> AuthenticateResponse:
5051
"""Authenticate a Member with a Magic Link. This endpoint requires a Magic Link token that is not expired or previously used. If the Member's status is `pending` or `invited`, they will be updated to `active`.
5152
Provide the `session_duration_minutes` 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.
@@ -90,6 +91,7 @@ def authenticate(
9091
Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
9192
9293
- intermediate_session_token: Adds this primary authentication factor to the intermediate session token. If the resulting set of factors satisfies the organization's primary authentication requirements and MFA requirements, the intermediate session token will be consumed and converted to a member session. If not, the same intermediate session token will be returned.
94+
- telemetry_id: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
9395
""" # noqa
9496
headers: Dict[str, str] = {}
9597
data: Dict[str, Any] = {
@@ -109,6 +111,8 @@ def authenticate(
109111
data["locale"] = locale
110112
if intermediate_session_token is not None:
111113
data["intermediate_session_token"] = intermediate_session_token
114+
if telemetry_id is not None:
115+
data["telemetry_id"] = telemetry_id
112116

113117
url = self.api_base.url_for("/v1/b2b/magic_links/authenticate", data)
114118
res = self.sync_client.post(url, data, headers)
@@ -124,6 +128,7 @@ async def authenticate_async(
124128
session_custom_claims: Optional[Dict[str, Any]] = None,
125129
locale: Optional[AuthenticateRequestLocale] = None,
126130
intermediate_session_token: Optional[str] = None,
131+
telemetry_id: Optional[str] = None,
127132
) -> AuthenticateResponse:
128133
"""Authenticate a Member with a Magic Link. This endpoint requires a Magic Link token that is not expired or previously used. If the Member's status is `pending` or `invited`, they will be updated to `active`.
129134
Provide the `session_duration_minutes` 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.
@@ -168,6 +173,7 @@ async def authenticate_async(
168173
Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
169174
170175
- intermediate_session_token: Adds this primary authentication factor to the intermediate session token. If the resulting set of factors satisfies the organization's primary authentication requirements and MFA requirements, the intermediate session token will be consumed and converted to a member session. If not, the same intermediate session token will be returned.
176+
- telemetry_id: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
171177
""" # noqa
172178
headers: Dict[str, str] = {}
173179
data: Dict[str, Any] = {
@@ -187,6 +193,8 @@ async def authenticate_async(
187193
data["locale"] = locale
188194
if intermediate_session_token is not None:
189195
data["intermediate_session_token"] = intermediate_session_token
196+
if telemetry_id is not None:
197+
data["telemetry_id"] = telemetry_id
190198

191199
url = self.api_base.url_for("/v1/b2b/magic_links/authenticate", data)
192200
res = await self.async_client.post(url, data, headers)

stytch/b2b/api/oauth.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def authenticate(
3737
pkce_code_verifier: Optional[str] = None,
3838
locale: Optional[Union[AuthenticateRequestLocale, str]] = None,
3939
intermediate_session_token: Optional[str] = None,
40+
telemetry_id: Optional[str] = None,
4041
) -> AuthenticateResponse:
4142
"""Authenticate a Member given a `token`. This endpoint verifies that the member completed the OAuth flow by verifying that the token is valid and hasn't expired. Provide the `session_duration_minutes` 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.
4243
@@ -80,6 +81,7 @@ def authenticate(
8081
Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
8182
8283
- intermediate_session_token: Adds this primary authentication factor to the intermediate session token. If the resulting set of factors satisfies the organization's primary authentication requirements and MFA requirements, the intermediate session token will be consumed and converted to a member session. If not, the same intermediate session token will be returned.
84+
- telemetry_id: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
8385
""" # noqa
8486
headers: Dict[str, str] = {}
8587
data: Dict[str, Any] = {
@@ -99,6 +101,8 @@ def authenticate(
99101
data["locale"] = locale
100102
if intermediate_session_token is not None:
101103
data["intermediate_session_token"] = intermediate_session_token
104+
if telemetry_id is not None:
105+
data["telemetry_id"] = telemetry_id
102106

103107
url = self.api_base.url_for("/v1/b2b/oauth/authenticate", data)
104108
res = self.sync_client.post(url, data, headers)
@@ -114,6 +118,7 @@ async def authenticate_async(
114118
pkce_code_verifier: Optional[str] = None,
115119
locale: Optional[AuthenticateRequestLocale] = None,
116120
intermediate_session_token: Optional[str] = None,
121+
telemetry_id: Optional[str] = None,
117122
) -> AuthenticateResponse:
118123
"""Authenticate a Member given a `token`. This endpoint verifies that the member completed the OAuth flow by verifying that the token is valid and hasn't expired. Provide the `session_duration_minutes` 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.
119124
@@ -157,6 +162,7 @@ async def authenticate_async(
157162
Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
158163
159164
- intermediate_session_token: Adds this primary authentication factor to the intermediate session token. If the resulting set of factors satisfies the organization's primary authentication requirements and MFA requirements, the intermediate session token will be consumed and converted to a member session. If not, the same intermediate session token will be returned.
165+
- telemetry_id: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
160166
""" # noqa
161167
headers: Dict[str, str] = {}
162168
data: Dict[str, Any] = {
@@ -176,6 +182,8 @@ async def authenticate_async(
176182
data["locale"] = locale
177183
if intermediate_session_token is not None:
178184
data["intermediate_session_token"] = intermediate_session_token
185+
if telemetry_id is not None:
186+
data["telemetry_id"] = telemetry_id
179187

180188
url = self.api_base.url_for("/v1/b2b/oauth/authenticate", data)
181189
res = await self.async_client.post(url, data, headers)

stytch/b2b/api/organizations.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,10 @@ def search(
978978
limit: Optional[int] = None,
979979
query: Optional[Union[SearchQuery, Dict[str, Any]]] = None,
980980
) -> SearchResponse:
981-
"""Search for Organizations. If you send a request with no body params, no filtering will be applied and the endpoint will return all Organizations. All fuzzy search filters require a minimum of three characters.
981+
"""
982+
**Warning**: This endpoint is not recommended for use in login flows. Scaling issues may occur, as search performance may vary from ~150 milliseconds to 9 seconds depending on query complexity and rate limits are set to 100 requests/second.
983+
984+
Search across your Organizations. Returns an array of Organization objects.
982985
983986
Fields:
984987
- cursor: The `cursor` field allows you to paginate through your results. Each result array is limited to 1000 results. If your query returns more than 1000 results, you will need to paginate the responses using the `cursor`. If you receive a response that includes a non-null `next_cursor` in the `results_metadata` object, repeat the search call with the `next_cursor` value set to the `cursor` field to retrieve the next page of results. Continue to make search calls until the `next_cursor` in the response is null.
@@ -1004,7 +1007,10 @@ async def search_async(
10041007
limit: Optional[int] = None,
10051008
query: Optional[SearchQuery] = None,
10061009
) -> SearchResponse:
1007-
"""Search for Organizations. If you send a request with no body params, no filtering will be applied and the endpoint will return all Organizations. All fuzzy search filters require a minimum of three characters.
1010+
"""
1011+
**Warning**: This endpoint is not recommended for use in login flows. Scaling issues may occur, as search performance may vary from ~150 milliseconds to 9 seconds depending on query complexity and rate limits are set to 100 requests/second.
1012+
1013+
Search across your Organizations. Returns an array of Organization objects.
10081014
10091015
Fields:
10101016
- cursor: The `cursor` field allows you to paginate through your results. Each result array is limited to 1000 results. If your query returns more than 1000 results, you will need to paginate the responses using the `cursor`. If you receive a response that includes a non-null `next_cursor` in the `results_metadata` object, repeat the search call with the `next_cursor` value set to the `cursor` field to retrieve the next page of results. Continue to make search calls until the `next_cursor` in the response is null.

0 commit comments

Comments
 (0)