Skip to content

Commit

Permalink
Merge branch 'appPortalSdks' of github.com:descope/descope-js into ap…
Browse files Browse the repository at this point in the history
…pPortalSdks
  • Loading branch information
nirgur committed Sep 29, 2024
2 parents 2846114 + 5411b5d commit 648f928
Show file tree
Hide file tree
Showing 34 changed files with 198 additions and 25 deletions.
12 changes: 12 additions & 0 deletions packages/sdks/angular-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [0.5.24](https://github.com/descope/descope-js/compare/angular-sdk-0.5.23...angular-sdk-0.5.24) (2024-09-29)

### Dependency Updates

* `access-key-management-widget` updated to version `0.1.124`
* `audit-management-widget` updated to version `0.1.88`
* `role-management-widget` updated to version `0.1.122`
* `user-management-widget` updated to version `0.4.125`
* `user-profile-widget` updated to version `0.0.106`
* `web-component` updated to version `3.25.2`
* `web-js-sdk` updated to version `1.17.0`
* `core-js-sdk` updated to version `2.26.0`
## [0.5.23](https://github.com/descope/descope-js/compare/angular-sdk-0.5.22...angular-sdk-0.5.23) (2024-09-19)

### Dependency Updates
Expand Down
2 changes: 1 addition & 1 deletion packages/sdks/angular-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@descope/angular-sdk",
"version": "0.5.23",
"version": "0.5.24",
"peerDependencies": {
"@angular/common": ">=16.0.0",
"@angular/core": ">=16.0.0"
Expand Down
7 changes: 7 additions & 0 deletions packages/sdks/core-js-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [2.26.0](https://github.com/descope/descope-js/compare/core-js-sdk-2.25.1...core-js-sdk-2.26.0) (2024-09-29)


### Features

* Add passkeyOptions to all webauthn start calls ([#807](https://github.com/descope/descope-js/issues/807)) RELEASE ([a8e0909](https://github.com/descope/descope-js/commit/a8e09094f8afdb016f437a3bc3bb6c6586330840))

## [2.25.1](https://github.com/descope/descope-js/compare/core-js-sdk-2.25.0...core-js-sdk-2.25.1) (2024-09-17)


Expand Down
2 changes: 1 addition & 1 deletion packages/sdks/core-js-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@descope/core-js-sdk",
"version": "2.25.1",
"version": "2.26.0",
"author": "Descope Team <info@descope.com>",
"homepage": "https://github.com/descope/descope-js",
"bugs": {
Expand Down
1 change: 1 addition & 0 deletions packages/sdks/core-js-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export type {
UserHistoryResponse,
LoginOptions,
AccessKeyLoginOptions,
PasskeyOptions,
} from './sdk/types';
export * from './utils';
export { default as HttpStatusCodes } from './constants/httpStatusCodes';
Expand Down
18 changes: 18 additions & 0 deletions packages/sdks/core-js-sdk/src/sdk/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,24 @@ export type ExchangeAccessKeyResponse = {
expiration: number;
};

/** Options for fine-grained passkey (WebAuthn) control */
export type PasskeyOptions = {
// attestation only (sign up)
authenticatorSelection?: WebauthnAuthenticatorSelectionCriteria;
attestation?: 'none' | 'indirect' | 'direct';
// assertion only (sign in)
userVerification?: 'preferred' | 'required' | 'discouraged';
// shared
extensionsJSON?: string;
};

/** Part of the passkey options that apply when performing attestation (sign up) */
export type WebauthnAuthenticatorSelectionCriteria = {
authenticatorAttachment?: 'any' | 'platform' | 'crossplatform';
residentKey?: 'discouraged' | 'preferred' | 'required';
userVerification?: 'preferred' | 'required' | 'discouraged';
};

/** The response returned from the various start webauthn functions */
export type WebAuthnStartResponse = {
transactionId: string;
Expand Down
11 changes: 9 additions & 2 deletions packages/sdks/core-js-sdk/src/sdk/webauthn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ResponseData,
LoginOptions,
JWTResponse,
PasskeyOptions,
WebAuthnStartResponse,
} from './types';
import { string, stringNonEmpty, withValidations } from './validations';
Expand Down Expand Up @@ -44,6 +45,7 @@ const withWebauthn = (httpClient: HttpClient) => ({
loginId: string,
origin: string,
name: string,
passkeyOptions?: PasskeyOptions,
): Promise<SdkResponse<WebAuthnStartResponse>> =>
transformResponse(
httpClient.post(apiPaths.webauthn.signUp.start, {
Expand All @@ -52,6 +54,7 @@ const withWebauthn = (httpClient: HttpClient) => ({
name,
},
origin,
passkeyOptions,
}),
),
),
Expand All @@ -77,11 +80,12 @@ const withWebauthn = (httpClient: HttpClient) => ({
origin: string,
loginOptions?: LoginOptions,
token?: string,
passkeyOptions?: PasskeyOptions,
): Promise<SdkResponse<WebAuthnStartResponse>> =>
transformResponse(
httpClient.post(
apiPaths.webauthn.signIn.start,
{ loginId, origin, loginOptions },
{ loginId, origin, loginOptions, passkeyOptions },
{ token },
),
),
Expand All @@ -106,11 +110,13 @@ const withWebauthn = (httpClient: HttpClient) => ({
(
loginId: string,
origin: string,
passkeyOptions?: PasskeyOptions,
): Promise<SdkResponse<WebAuthnStartResponse>> =>
transformResponse(
httpClient.post(apiPaths.webauthn.signUpOrIn.start, {
loginId,
origin,
passkeyOptions,
}),
),
),
Expand All @@ -122,11 +128,12 @@ const withWebauthn = (httpClient: HttpClient) => ({
loginId: string,
origin: string,
token: string,
passkeyOptions?: PasskeyOptions,
): Promise<SdkResponse<WebAuthnStartResponse>> =>
transformResponse(
httpClient.post(
apiPaths.webauthn.update.start,
{ loginId, origin },
{ loginId, origin, passkeyOptions },
{ token },
),
),
Expand Down
39 changes: 37 additions & 2 deletions packages/sdks/core-js-sdk/test/sdk/webauthn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,32 @@ describe('webauthn', () => {
};
mockHttpClient.post.mockResolvedValue(httpResponse);

sdk.webauthn.signUp.start('loginId', 'origin', 'John Doe');
const passkeyOptions = {
authenticatorSelection: {
authenticatorAttachment: 'platform',
residentKey: 'required',
userVerification: 'required',
},
};
sdk.webauthn.signUp.start(
'loginId',
'origin',
'John Doe',
passkeyOptions,
);

expect(mockHttpClient.post).toHaveBeenCalledWith(
apiPaths.webauthn.signUp.start,
{
user: { loginId: 'loginId', name: 'John Doe' },
origin: 'origin',
passkeyOptions: {
authenticatorSelection: {
authenticatorAttachment: 'platform',
residentKey: 'required',
userVerification: 'required',
},
},
},
);
});
Expand Down Expand Up @@ -201,14 +220,29 @@ describe('webauthn', () => {
};
mockHttpClient.post.mockResolvedValue(httpResponse);

sdk.webauthn.signIn.start('loginId', 'origin');
const passkeyOptions = {
userVerification: 'required',
extensionsJSON: '{}',
};
sdk.webauthn.signIn.start(
'loginId',
'origin',
undefined,
undefined,
passkeyOptions,
);

expect(mockHttpClient.post).toHaveBeenCalledWith(
apiPaths.webauthn.signIn.start,
{
loginId: 'loginId',
origin: 'origin',
loginOptions: undefined,
token: undefined,
passkeyOptions: {
userVerification: 'required',
extensionsJSON: '{}',
},
},
{ token: undefined },
);
Expand Down Expand Up @@ -387,6 +421,7 @@ describe('webauthn', () => {
{
loginId: 'loginId',
origin: 'origin',
passkeyOptions: undefined,
},
);
});
Expand Down
8 changes: 8 additions & 0 deletions packages/sdks/nextjs-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [0.2.11](https://github.com/descope/descope-js/compare/nextjs-sdk-0.2.10...nextjs-sdk-0.2.11) (2024-09-29)

### Dependency Updates

* `web-js-sdk` updated to version `1.17.0`
* `react-sdk` updated to version `2.0.77`
* `core-js-sdk` updated to version `2.26.0`
* `web-component` updated to version `3.25.2`
## [0.2.10](https://github.com/descope/descope-js/compare/nextjs-sdk-0.2.9...nextjs-sdk-0.2.10) (2024-09-19)

### Dependency Updates
Expand Down
2 changes: 1 addition & 1 deletion packages/sdks/nextjs-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@descope/nextjs-sdk",
"version": "0.2.10",
"version": "0.2.11",
"description": "Descope NextJS SDK",
"author": "Descope Team <info@descope.com>",
"homepage": "https://github.com/descope/descope-js",
Expand Down
12 changes: 12 additions & 0 deletions packages/sdks/react-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [2.0.77](https://github.com/descope/descope-js/compare/react-sdk-2.0.76...react-sdk-2.0.77) (2024-09-29)

### Dependency Updates

* `access-key-management-widget` updated to version `0.1.124`
* `audit-management-widget` updated to version `0.1.88`
* `role-management-widget` updated to version `0.1.122`
* `user-management-widget` updated to version `0.4.125`
* `user-profile-widget` updated to version `0.0.106`
* `web-component` updated to version `3.25.2`
* `web-js-sdk` updated to version `1.17.0`
* `core-js-sdk` updated to version `2.26.0`
## [2.0.76](https://github.com/descope/descope-js/compare/react-sdk-2.0.75...react-sdk-2.0.76) (2024-09-19)

### Dependency Updates
Expand Down
2 changes: 1 addition & 1 deletion packages/sdks/react-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ import { ApplicationsPortal } from '@descope/react-sdk';
```

Example:
[User Profile](./examples/app/MyApplicationsPortal.tsx)
[Applications Portal](./examples/app/MyApplicationsPortal.tsx)

## Code Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const MyApplicationsPortal = () => {
</p>
</div>
</header>
<h2>My Profile</h2>
<h2>Applications Portal</h2>
<ApplicationsPortal widgetId="applications-portal-widget" />
</>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/sdks/react-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@descope/react-sdk",
"version": "2.0.76",
"version": "2.0.77",
"description": "Descope React SDK",
"author": "Descope Team <info@descope.com>",
"homepage": "https://github.com/descope/descope-js",
Expand Down
12 changes: 12 additions & 0 deletions packages/sdks/vue-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [2.0.36](https://github.com/descope/descope-js/compare/vue-sdk-2.0.35...vue-sdk-2.0.36) (2024-09-29)

### Dependency Updates

* `access-key-management-widget` updated to version `0.1.124`
* `audit-management-widget` updated to version `0.1.88`
* `role-management-widget` updated to version `0.1.122`
* `user-management-widget` updated to version `0.4.125`
* `user-profile-widget` updated to version `0.0.106`
* `web-component` updated to version `3.25.2`
* `web-js-sdk` updated to version `1.17.0`
* `core-js-sdk` updated to version `2.26.0`
## [2.0.35](https://github.com/descope/descope-js/compare/vue-sdk-2.0.34...vue-sdk-2.0.35) (2024-09-19)

### Dependency Updates
Expand Down
2 changes: 1 addition & 1 deletion packages/sdks/vue-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@descope/vue-sdk",
"version": "2.0.35",
"version": "2.0.36",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"type": "module",
Expand Down
5 changes: 5 additions & 0 deletions packages/sdks/web-component/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [3.25.2](https://github.com/descope/descope-js/compare/web-component-3.25.1...web-component-3.25.2) (2024-09-29)

### Dependency Updates

* `web-js-sdk` updated to version `1.17.0`
## [3.25.1](https://github.com/descope/descope-js/compare/web-component-3.25.0...web-component-3.25.1) (2024-09-19)

### Dependency Updates
Expand Down
2 changes: 1 addition & 1 deletion packages/sdks/web-component/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@descope/web-component",
"version": "3.25.1",
"version": "3.25.2",
"author": "Descope Team <info@descope.com>",
"homepage": "https://github.com/descope/descope-js",
"bugs": {
Expand Down
10 changes: 10 additions & 0 deletions packages/sdks/web-js-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [1.17.0](https://github.com/descope/descope-js/compare/web-js-sdk-1.16.6...web-js-sdk-1.17.0) (2024-09-29)

### Dependency Updates

* `core-js-sdk` updated to version `2.26.0`

### Features

* Add passkeyOptions to all webauthn start calls ([#807](https://github.com/descope/descope-js/issues/807)) RELEASE ([a8e0909](https://github.com/descope/descope-js/commit/a8e09094f8afdb016f437a3bc3bb6c6586330840))

## [1.16.6](https://github.com/descope/descope-js/compare/web-js-sdk-1.16.5...web-js-sdk-1.16.6) (2024-09-17)

### Dependency Updates
Expand Down
2 changes: 1 addition & 1 deletion packages/sdks/web-js-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@descope/web-js-sdk",
"version": "1.16.6",
"version": "1.17.0",
"author": "Descope Team <info@descope.com>",
"homepage": "https://github.com/descope/descope-js",
"bugs": {
Expand Down
Loading

0 comments on commit 648f928

Please sign in to comment.