@kya-os/consent 0.1.3 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +2 -2
- package/dist/bundle/inline.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +30 -0
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +52 -2
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/consent.js +53 -9
- package/dist/consent.min.js +20 -20
- package/dist/schemas/api.schemas.d.ts +94 -94
- package/dist/schemas/config.schemas.d.ts +104 -104
- package/dist/types/modes.types.d.ts +45 -8
- package/dist/types/modes.types.d.ts.map +1 -1
- package/dist/types/modes.types.js +45 -8
- package/dist/types/modes.types.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,39 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Canonical type definitions for authentication modes and their configurations.
|
|
5
5
|
*
|
|
6
|
+
* ## Consent Flow Architecture
|
|
7
|
+
*
|
|
8
|
+
* The consent flow has two patterns based on the auth mode:
|
|
9
|
+
*
|
|
10
|
+
* ### Flow 1: Consent Only (CONSENT_ONLY mode) - 2 Screens
|
|
11
|
+
* ```
|
|
12
|
+
* [Consent Screen] → [Success Screen]
|
|
13
|
+
* ↓
|
|
14
|
+
* User confirms → DelegationCredential (VC) created
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* ### Flow 2: Auth First (CREDENTIALS, OAUTH, etc.) - 3 Screens
|
|
18
|
+
* ```
|
|
19
|
+
* [Auth Screen] → [Consent Screen] → [Success Screen]
|
|
20
|
+
* ↓ ↓
|
|
21
|
+
* Verify identity User confirms → DelegationCredential (VC) created
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ## Relationship to AuthorizationRequirement
|
|
25
|
+
*
|
|
26
|
+
* - `AUTH_MODES` here define what UI to render for authentication
|
|
27
|
+
* - `AuthorizationRequirement` in @kya-os/contracts defines what a TOOL requires
|
|
28
|
+
*
|
|
29
|
+
* Mapping:
|
|
30
|
+
* | AUTH_MODE | AuthorizationRequirement.type |
|
|
31
|
+
* |-----------|-------------------------------|
|
|
32
|
+
* | CONSENT_ONLY | 'none' |
|
|
33
|
+
* | CREDENTIALS | 'password' |
|
|
34
|
+
* | OAUTH | 'oauth' |
|
|
35
|
+
* | IDV | 'idv' |
|
|
36
|
+
* | MAGIC_LINK | (future) |
|
|
37
|
+
* | OTP | (future) |
|
|
38
|
+
*
|
|
6
39
|
* @module @kya-os/consent/types/modes
|
|
7
40
|
*/
|
|
8
41
|
/**
|
|
@@ -10,23 +43,27 @@
|
|
|
10
43
|
*
|
|
11
44
|
* Constants for all supported auth modes in consent pages.
|
|
12
45
|
* Matches AgentShield's AUTH_MODES constant.
|
|
46
|
+
*
|
|
47
|
+
* The mode determines the screen flow:
|
|
48
|
+
* - CONSENT_ONLY: Consent → Success (2 screens) - Direct to consent, no auth
|
|
49
|
+
* - All others: Auth → Consent → Success (3 screens) - Auth first, then consent
|
|
13
50
|
*/
|
|
14
51
|
export declare const AUTH_MODES: {
|
|
15
|
-
/** Simple consent with no authentication */
|
|
52
|
+
/** Simple consent with no authentication - Consent → Success (2 screens) */
|
|
16
53
|
readonly CONSENT_ONLY: "consent-only";
|
|
17
|
-
/** Username/password authentication */
|
|
54
|
+
/** Username/password authentication - Auth → Consent → Success (3 screens) */
|
|
18
55
|
readonly CREDENTIALS: "credentials";
|
|
19
|
-
/** OAuth provider authentication */
|
|
56
|
+
/** OAuth provider authentication - Auth → Consent → Success (3 screens) */
|
|
20
57
|
readonly OAUTH: "oauth";
|
|
21
|
-
/** Email magic link authentication */
|
|
58
|
+
/** Email magic link authentication - Auth → Consent → Success (3 screens) */
|
|
22
59
|
readonly MAGIC_LINK: "magic-link";
|
|
23
|
-
/** One-time password (SMS/TOTP) authentication */
|
|
60
|
+
/** One-time password (SMS/TOTP) authentication - Auth → Consent → Success (3 screens) */
|
|
24
61
|
readonly OTP: "otp";
|
|
25
|
-
/** QR code scanning authentication (future) */
|
|
62
|
+
/** QR code scanning authentication (future) - Auth → Consent → Success (3 screens) */
|
|
26
63
|
readonly QR_CODE: "qr-code";
|
|
27
|
-
/** Passkey/WebAuthn authentication (future) */
|
|
64
|
+
/** Passkey/WebAuthn authentication (future) - Auth → Consent → Success (3 screens) */
|
|
28
65
|
readonly PASSKEY: "passkey";
|
|
29
|
-
/** Identity verification (future) */
|
|
66
|
+
/** Identity verification (future) - Auth → Consent → Success (3 screens) */
|
|
30
67
|
readonly IDV: "idv";
|
|
31
68
|
};
|
|
32
69
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modes.types.d.ts","sourceRoot":"","sources":["../../src/types/modes.types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"modes.types.d.ts","sourceRoot":"","sources":["../../src/types/modes.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU;IACrB,4EAA4E;;IAG5E,8EAA8E;;IAG9E,2EAA2E;;IAG3E,6EAA6E;;IAG7E,yFAAyF;;IAGzF,sFAAsF;;IAGtF,sFAAsF;;IAGtF,4EAA4E;;CAEpE,CAAC;AAEX;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEpE;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,iCAAiC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,2BAA2B;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,iCAAiC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,6CAA6C;IAC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AAM,CAAC;IAEjB,2CAA2C;IAC3C,cAAc,EAAE,OAAO,CAAC;IAExB,uCAAuC;IACvC,WAAW,EAAE,OAAO,CAAC;IAErB,wCAAwC;IACxC,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB"}
|
|
@@ -3,6 +3,39 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Canonical type definitions for authentication modes and their configurations.
|
|
5
5
|
*
|
|
6
|
+
* ## Consent Flow Architecture
|
|
7
|
+
*
|
|
8
|
+
* The consent flow has two patterns based on the auth mode:
|
|
9
|
+
*
|
|
10
|
+
* ### Flow 1: Consent Only (CONSENT_ONLY mode) - 2 Screens
|
|
11
|
+
* ```
|
|
12
|
+
* [Consent Screen] → [Success Screen]
|
|
13
|
+
* ↓
|
|
14
|
+
* User confirms → DelegationCredential (VC) created
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* ### Flow 2: Auth First (CREDENTIALS, OAUTH, etc.) - 3 Screens
|
|
18
|
+
* ```
|
|
19
|
+
* [Auth Screen] → [Consent Screen] → [Success Screen]
|
|
20
|
+
* ↓ ↓
|
|
21
|
+
* Verify identity User confirms → DelegationCredential (VC) created
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ## Relationship to AuthorizationRequirement
|
|
25
|
+
*
|
|
26
|
+
* - `AUTH_MODES` here define what UI to render for authentication
|
|
27
|
+
* - `AuthorizationRequirement` in @kya-os/contracts defines what a TOOL requires
|
|
28
|
+
*
|
|
29
|
+
* Mapping:
|
|
30
|
+
* | AUTH_MODE | AuthorizationRequirement.type |
|
|
31
|
+
* |-----------|-------------------------------|
|
|
32
|
+
* | CONSENT_ONLY | 'none' |
|
|
33
|
+
* | CREDENTIALS | 'password' |
|
|
34
|
+
* | OAUTH | 'oauth' |
|
|
35
|
+
* | IDV | 'idv' |
|
|
36
|
+
* | MAGIC_LINK | (future) |
|
|
37
|
+
* | OTP | (future) |
|
|
38
|
+
*
|
|
6
39
|
* @module @kya-os/consent/types/modes
|
|
7
40
|
*/
|
|
8
41
|
/**
|
|
@@ -10,23 +43,27 @@
|
|
|
10
43
|
*
|
|
11
44
|
* Constants for all supported auth modes in consent pages.
|
|
12
45
|
* Matches AgentShield's AUTH_MODES constant.
|
|
46
|
+
*
|
|
47
|
+
* The mode determines the screen flow:
|
|
48
|
+
* - CONSENT_ONLY: Consent → Success (2 screens) - Direct to consent, no auth
|
|
49
|
+
* - All others: Auth → Consent → Success (3 screens) - Auth first, then consent
|
|
13
50
|
*/
|
|
14
51
|
export const AUTH_MODES = {
|
|
15
|
-
/** Simple consent with no authentication */
|
|
52
|
+
/** Simple consent with no authentication - Consent → Success (2 screens) */
|
|
16
53
|
CONSENT_ONLY: "consent-only",
|
|
17
|
-
/** Username/password authentication */
|
|
54
|
+
/** Username/password authentication - Auth → Consent → Success (3 screens) */
|
|
18
55
|
CREDENTIALS: "credentials",
|
|
19
|
-
/** OAuth provider authentication */
|
|
56
|
+
/** OAuth provider authentication - Auth → Consent → Success (3 screens) */
|
|
20
57
|
OAUTH: "oauth",
|
|
21
|
-
/** Email magic link authentication */
|
|
58
|
+
/** Email magic link authentication - Auth → Consent → Success (3 screens) */
|
|
22
59
|
MAGIC_LINK: "magic-link",
|
|
23
|
-
/** One-time password (SMS/TOTP) authentication */
|
|
60
|
+
/** One-time password (SMS/TOTP) authentication - Auth → Consent → Success (3 screens) */
|
|
24
61
|
OTP: "otp",
|
|
25
|
-
/** QR code scanning authentication (future) */
|
|
62
|
+
/** QR code scanning authentication (future) - Auth → Consent → Success (3 screens) */
|
|
26
63
|
QR_CODE: "qr-code",
|
|
27
|
-
/** Passkey/WebAuthn authentication (future) */
|
|
64
|
+
/** Passkey/WebAuthn authentication (future) - Auth → Consent → Success (3 screens) */
|
|
28
65
|
PASSKEY: "passkey",
|
|
29
|
-
/** Identity verification (future) */
|
|
66
|
+
/** Identity verification (future) - Auth → Consent → Success (3 screens) */
|
|
30
67
|
IDV: "idv",
|
|
31
68
|
};
|
|
32
69
|
//# sourceMappingURL=modes.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modes.types.js","sourceRoot":"","sources":["../../src/types/modes.types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"modes.types.js","sourceRoot":"","sources":["../../src/types/modes.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,4EAA4E;IAC5E,YAAY,EAAE,cAAc;IAE5B,8EAA8E;IAC9E,WAAW,EAAE,aAAa;IAE1B,2EAA2E;IAC3E,KAAK,EAAE,OAAO;IAEd,6EAA6E;IAC7E,UAAU,EAAE,YAAY;IAExB,yFAAyF;IACzF,GAAG,EAAE,KAAK;IAEV,sFAAsF;IACtF,OAAO,EAAE,SAAS;IAElB,sFAAsF;IACtF,OAAO,EAAE,SAAS;IAElB,4EAA4E;IAC5E,GAAG,EAAE,KAAK;CACF,CAAC"}
|