Skip to content

Commit

Permalink
Change chain_id to string (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-stytch authored Aug 13, 2024
1 parent 4bfcc1d commit 0e6bd13
Show file tree
Hide file tree
Showing 16 changed files with 119 additions and 57 deletions.
2 changes: 1 addition & 1 deletion dist/b2b/scim_connection.js

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

26 changes: 13 additions & 13 deletions dist/b2c/m2m.js

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

1 change: 1 addition & 0 deletions lib/b2b/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type {
B2BSCIMEmail,
EnterpriseExtension,
Group,
IMs,
Manager,
B2BSCIMName,
B2BSCIMPhoneNumber,
Expand Down
13 changes: 13 additions & 0 deletions lib/b2b/organizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,16 @@ export interface MemberRoleSource {
* argument to the [Update SAML connection](https://stytch.com/docs/b2b/api/update-saml-connection)
* endpoint.
*
* `scim_connection_group` – an implicit Role granted by the Member's SCIM connection and group. If the
* Member has
* a SCIM Member registration with the given connection, and belongs to a specific group within the IdP,
* this role assignment will appear in the list.
*
* SCIM group implicit role assignments can be updated by passing in the
* `scim_group_implicit_role_assignments`
* argument to the [Update SCIM connection](https://stytch.com/docs/b2b/api/update-scim-connection)
* endpoint.
*
*/
type: string;
/**
Expand All @@ -267,6 +277,9 @@ export interface MemberRoleSource {
* `group`
* that granted the assignment.
*
* `scim_connection_group` – will contain the `connection_id` of the SAML connection and the `group_id`
* that granted the assignment.
*
*/
details?: Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any
}
Expand Down
7 changes: 7 additions & 0 deletions lib/b2b/scim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ export interface Group {
display: string;
}

export interface IMs {
value: string;
type: string;
}

export interface Manager {
value: string;
ref: string;
Expand All @@ -77,6 +82,7 @@ export interface SCIMAttributes {
emails: B2BSCIMEmail[];
phone_numbers: B2BSCIMPhoneNumber[];
addresses: Address[];
ims: IMs[];
name?: B2BSCIMName;
enterprise_extension?: EnterpriseExtension;
}
Expand Down Expand Up @@ -138,6 +144,7 @@ export interface SCIMGroup {
export interface SCIMGroupImplicitRoleAssignments {
// The ID of the role.
role_id: string;
// The ID of the group.
group_id: string;
group_name: string;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/b2b/scim_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ export interface B2BSCIMConnectionUpdateRequest {
| "rippling"
| string;
/**
* An array of SCIM group implicit role assignments. Each object in the array must contain a `group` and a
* `role_id`.
* An array of SCIM group implicit role assignments. Each object in the array must contain a `group_id` and
* a `role_id`.
*/
scim_group_implicit_role_assignments?: SCIMGroupImplicitRoleAssignments[];
}
Expand Down Expand Up @@ -557,7 +557,7 @@ export class Connection {
}

/**
* Get SCIM Connections.
* Get SCIM Connection.
* @param params {@link B2BSCIMConnectionGetRequest}
* @param options {@link B2BSCIMConnectionGetRequestOptions}
* @returns {@link B2BSCIMConnectionGetResponse}
Expand Down
20 changes: 15 additions & 5 deletions lib/b2c/crypto_wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,16 @@ export interface SIWEParams {
* authentication. Every resource must be an RFC 3986 URI.
*/
resources: string[];
// The EIP-155 Chain ID to which the session is bound. Defaults to 1.
chain_id?: number;
// A human-readable ASCII assertion that the user will sign.
/**
* The EIP-155 Chain ID to which the session is bound. Defaults to 1. Must be the string representation of
* an integer between 1 and 9,223,372,036,854,775,771, inclusive.
*/
chain_id?: string;
/**
* A human-readable ASCII assertion that the user will sign. The statement may only include reserved,
* unreserved, or space characters according to RFC 3986 definitions, and must not contain other forms of
* whitespace such as newlines, tabs, and carriage returns.
*/
statement?: string;
/**
* The time when the message was generated. Defaults to the current time. All timestamps in our API conform
Expand All @@ -41,7 +48,10 @@ export interface SIWEParams {
* `2021-12-29T12:33:09Z`.
*/
not_before?: string;
// A system-specific identifier that may be used to uniquely refer to the sign-in request.
/**
* A system-specific identifier that may be used to uniquely refer to the sign-in request. The
* `message_request_id` must be a valid pchar according to RFC 3986 definitions.
*/
message_request_id?: string;
}

Expand Down Expand Up @@ -172,7 +182,7 @@ export interface CryptoWalletsSIWEParamsResponse {
// An RFC 3986 URI referring to the resource that is the subject of the signing.
uri: string;
// The EIP-155 Chain ID to which the session is bound.
chain_id: number;
chain_id: string;
/**
* A list of information or references to information the user wishes to have resolved as part of
* authentication. Every resource must be an RFC 3986 URI.
Expand Down
26 changes: 13 additions & 13 deletions lib/b2c/m2m.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,19 +241,19 @@ export class M2M {
// ADDIMPORT: import { performAuthorizationCheck, ScopeAuthorizationFunc } from "./m2m_local";
// ADDIMPORT: import { ClientError } from "../shared/errors";
/**
* Authenticate an access token issued by Stytch from the Token endpoint.
* M2M access tokens are JWTs signed with the project's JWKs, and can be validated locally using any Stytch client library.
* You may pass in an optional set of scopes that the JWT must contain in order to enforce permissions.
* You may also override the default scope authorization function to implement custom authorization logic.
*
* @param data {@link AuthenticateTokenRequest}
* @param scopeAuthorizationFunc {@link ScopeAuthorizationFunc} - A function that checks if the token has the required scopes.
The default function assumes scopes are either direct string matches or written in the form "action:resource". See the
documentation for {@link performAuthorizationCheck} for more information.
* @async
* @returns {@link AuthenticateTokenResponse}
* @throws {ClientError} when token can not be authenticated
*/
* Authenticate an access token issued by Stytch from the Token endpoint.
* M2M access tokens are JWTs signed with the project's JWKs, and can be validated locally using any Stytch client library.
* You may pass in an optional set of scopes that the JWT must contain in order to enforce permissions.
* You may also override the default scope authorization function to implement custom authorization logic.
*
* @param data {@link AuthenticateTokenRequest}
* @param scopeAuthorizationFunc {@link ScopeAuthorizationFunc} - A function that checks if the token has the required scopes.
The default function assumes scopes are either direct string matches or written in the form "action:resource". See the
documentation for {@link performAuthorizationCheck} for more information.
* @async
* @returns {@link AuthenticateTokenResponse}
* @throws {ClientError} when token can not be authenticated
*/
async authenticateToken(
data: AuthenticateTokenRequest,
scopeAuthorizationFunc: ScopeAuthorizationFunc = performAuthorizationCheck
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stytch",
"version": "11.2.0",
"version": "11.3.0",
"description": "A wrapper for the Stytch API",
"types": "./types/lib/index.d.ts",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion types/lib/b2b/index.d.ts

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

13 changes: 13 additions & 0 deletions types/lib/b2b/organizations.d.ts

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

5 changes: 5 additions & 0 deletions types/lib/b2b/scim.d.ts

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

6 changes: 3 additions & 3 deletions types/lib/b2b/scim_connection.d.ts

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

17 changes: 15 additions & 2 deletions types/lib/b2c/crypto_wallets.d.ts

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

Loading

0 comments on commit 0e6bd13

Please sign in to comment.