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

Add in additional SCIM Attributes to get parity to spec #335

Merged
merged 6 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
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.

4 changes: 4 additions & 0 deletions lib/b2b/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,21 @@ export type {
Address,
B2BSCIMEmail,
EnterpriseExtension,
Entitlement,
Group,
IMs,
Manager,
B2BSCIMName,
B2BSCIMPhoneNumber,
Photo,
Role,
SCIMAttributes,
SCIMConnection,
SCIMConnectionWithNextToken,
SCIMConnectionWithToken,
SCIMGroup,
SCIMGroupImplicitRoleAssignments,
B2BSCIMX509Certificate,
} from "./scim";

export type {
Expand Down
29 changes: 29 additions & 0 deletions lib/b2b/scim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ export interface B2BSCIMPhoneNumber {
primary: boolean;
}

export interface B2BSCIMX509Certificate {
value: string;
type: string;
primary: boolean;
}

export interface EnterpriseExtension {
employee_number: string;
cost_center: string;
Expand All @@ -49,6 +55,12 @@ export interface EnterpriseExtension {
manager?: Manager;
}

export interface Entitlement {
value: string;
type: string;
primary: boolean;
}

export interface Group {
value: string;
display: string;
Expand All @@ -57,6 +69,7 @@ export interface Group {
export interface IMs {
value: string;
type: string;
primary: boolean;
}

export interface Manager {
Expand All @@ -65,6 +78,18 @@ export interface Manager {
display_name: string;
}

export interface Photo {
value: string;
type: string;
primary: boolean;
}

export interface Role {
value: string;
type: string;
primary: boolean;
}

export interface SCIMAttributes {
user_name: string;
id: string;
Expand All @@ -83,6 +108,10 @@ export interface SCIMAttributes {
phone_numbers: B2BSCIMPhoneNumber[];
addresses: Address[];
ims: IMs[];
photos: Photo[];
entitlements: Entitlement[];
roles: Role[];
x509certificates: B2BSCIMX509Certificate[];
name?: B2BSCIMName;
enterprise_extension?: EnterpriseExtension;
}
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.3.0",
"version": "11.3.1",
"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.

25 changes: 25 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.

26 changes: 13 additions & 13 deletions types/lib/b2c/m2m.d.ts

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

Loading