@kya-os/consent 0.1.49 → 0.2.0
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/README.md +75 -9
- package/dist/bundle/browser.d.ts +18 -0
- package/dist/bundle/browser.d.ts.map +1 -0
- package/dist/bundle/browser.js +18 -0
- package/dist/bundle/browser.js.map +1 -0
- package/dist/bundle/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +4 -4
- package/dist/bundle/inline.js.map +1 -1
- package/dist/bundle/shell.d.ts +4 -2
- package/dist/bundle/shell.d.ts.map +1 -1
- package/dist/bundle/shell.js +16 -43
- package/dist/bundle/shell.js.map +1 -1
- package/dist/cjs/bundle/inline.js +4 -4
- package/dist/cjs/bundle/inline.js.map +1 -1
- package/dist/cjs/bundle/shell.js +16 -43
- package/dist/cjs/bundle/shell.js.map +1 -1
- package/dist/cjs/components/consent-agent-header.js +81 -21
- package/dist/cjs/components/consent-agent-header.js.map +1 -1
- package/dist/cjs/components/consent-button.js +16 -13
- package/dist/cjs/components/consent-button.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +15 -5
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-checkbox.js +21 -17
- package/dist/cjs/components/consent-checkbox.js.map +1 -1
- package/dist/cjs/components/consent-connector-header.js +14 -3
- package/dist/cjs/components/consent-connector-header.js.map +1 -1
- package/dist/cjs/components/consent-permissions.js +16 -15
- package/dist/cjs/components/consent-permissions.js.map +1 -1
- package/dist/cjs/components/consent-revocation-notice.js +23 -5
- package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
- package/dist/cjs/components/consent-shell.js +35 -17
- package/dist/cjs/components/consent-shell.js.map +1 -1
- package/dist/cjs/components/consent-terms.js +27 -23
- package/dist/cjs/components/consent-terms.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +222 -45
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/constants/auth-modes.js +1 -1
- package/dist/cjs/constants/auth-modes.js.map +1 -1
- package/dist/cjs/constants/colors.js +7 -2
- package/dist/cjs/constants/colors.js.map +1 -1
- package/dist/cjs/constants/defaults.js +1 -1
- package/dist/cjs/copy/tokens.js +45 -1
- package/dist/cjs/copy/tokens.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/mcp-app/inline.js +2 -2
- package/dist/cjs/mcp-app/inline.js.map +1 -1
- package/dist/cjs/react/index.js +1 -1
- package/dist/cjs/resolution/resolve-branding.js +3 -1
- package/dist/cjs/resolution/resolve-branding.js.map +1 -1
- package/dist/cjs/resolution/resolve-config.js +3 -0
- package/dist/cjs/resolution/resolve-config.js.map +1 -1
- package/dist/cjs/schemas/api.schemas.js +1 -1
- package/dist/cjs/schemas/branding.schemas.js +3 -0
- package/dist/cjs/schemas/branding.schemas.js.map +1 -1
- package/dist/cjs/schemas/capabilities.schemas.js +48 -3
- package/dist/cjs/schemas/capabilities.schemas.js.map +1 -1
- package/dist/cjs/schemas/config.schemas.js +1 -0
- package/dist/cjs/schemas/config.schemas.js.map +1 -1
- package/dist/cjs/schemas/modes.schemas.js +1 -0
- package/dist/cjs/schemas/modes.schemas.js.map +1 -1
- package/dist/cjs/styles/contrast.js +100 -0
- package/dist/cjs/styles/contrast.js.map +1 -0
- package/dist/cjs/styles/css-variables.js +36 -1
- package/dist/cjs/styles/css-variables.js.map +1 -1
- package/dist/cjs/styles/index.js +2 -1
- package/dist/cjs/styles/index.js.map +1 -1
- package/dist/cjs/styles/stylesheet.js +10 -5
- package/dist/cjs/styles/stylesheet.js.map +1 -1
- package/dist/cjs/styles/theme.js +29 -1
- package/dist/cjs/styles/theme.js.map +1 -1
- package/dist/cjs/styles/tokens.js +8 -8
- package/dist/cjs/styles/tokens.js.map +1 -1
- package/dist/cjs/templates/base/components.js +1 -1
- package/dist/cjs/templates/index.js +1 -0
- package/dist/cjs/templates/index.js.map +1 -1
- package/dist/cjs/templates/modes/credentials.template.js +15 -13
- package/dist/cjs/templates/modes/credentials.template.js.map +1 -1
- package/dist/cjs/templates/modes/index.js +3 -1
- package/dist/cjs/templates/modes/index.js.map +1 -1
- package/dist/cjs/templates/modes/passkey.template.js +178 -0
- package/dist/cjs/templates/modes/passkey.template.js.map +1 -0
- package/dist/cjs/templates/modes/success.template.js +2 -7
- package/dist/cjs/templates/modes/success.template.js.map +1 -1
- package/dist/cjs/templates/registry.js +4 -3
- package/dist/cjs/templates/registry.js.map +1 -1
- package/dist/cjs/types/capabilities.types.js +27 -2
- package/dist/cjs/types/capabilities.types.js.map +1 -1
- package/dist/cjs/types/index.js +1 -1
- package/dist/cjs/types/modes.types.js +11 -4
- package/dist/cjs/types/modes.types.js.map +1 -1
- package/dist/components/consent-agent-header.d.ts +16 -3
- package/dist/components/consent-agent-header.d.ts.map +1 -1
- package/dist/components/consent-agent-header.js +81 -21
- package/dist/components/consent-agent-header.js.map +1 -1
- package/dist/components/consent-button.d.ts +6 -5
- package/dist/components/consent-button.d.ts.map +1 -1
- package/dist/components/consent-button.js +18 -15
- package/dist/components/consent-button.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts +3 -1
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +15 -5
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-checkbox.d.ts +4 -2
- package/dist/components/consent-checkbox.d.ts.map +1 -1
- package/dist/components/consent-checkbox.js +23 -19
- package/dist/components/consent-checkbox.js.map +1 -1
- package/dist/components/consent-connector-header.d.ts.map +1 -1
- package/dist/components/consent-connector-header.js +14 -3
- package/dist/components/consent-connector-header.js.map +1 -1
- package/dist/components/consent-passkey.d.ts +128 -0
- package/dist/components/consent-passkey.d.ts.map +1 -0
- package/dist/components/consent-passkey.js +408 -0
- package/dist/components/consent-passkey.js.map +1 -0
- package/dist/components/consent-permissions.d.ts +4 -3
- package/dist/components/consent-permissions.d.ts.map +1 -1
- package/dist/components/consent-permissions.js +18 -17
- package/dist/components/consent-permissions.js.map +1 -1
- package/dist/components/consent-revocation-notice.d.ts +8 -0
- package/dist/components/consent-revocation-notice.d.ts.map +1 -1
- package/dist/components/consent-revocation-notice.js +23 -5
- package/dist/components/consent-revocation-notice.js.map +1 -1
- package/dist/components/consent-shell.d.ts +2 -2
- package/dist/components/consent-shell.d.ts.map +1 -1
- package/dist/components/consent-shell.js +37 -19
- package/dist/components/consent-shell.js.map +1 -1
- package/dist/components/consent-terms.d.ts +4 -2
- package/dist/components/consent-terms.d.ts.map +1 -1
- package/dist/components/consent-terms.js +29 -25
- package/dist/components/consent-terms.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +11 -3
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +222 -45
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/consent.js +1102 -140
- package/dist/consent.min.js +481 -228
- package/dist/constants/auth-modes.js +1 -1
- package/dist/constants/auth-modes.js.map +1 -1
- package/dist/constants/colors.d.ts +7 -2
- package/dist/constants/colors.d.ts.map +1 -1
- package/dist/constants/colors.js +7 -2
- package/dist/constants/colors.js.map +1 -1
- package/dist/constants/defaults.d.ts +1 -1
- package/dist/constants/defaults.js +1 -1
- package/dist/copy/tokens.d.ts +45 -1
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +45 -1
- package/dist/copy/tokens.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp-app/inline.d.ts.map +1 -1
- package/dist/mcp-app/inline.js +2 -2
- package/dist/mcp-app/inline.js.map +1 -1
- package/dist/passkey/index.d.ts +19 -0
- package/dist/passkey/index.d.ts.map +1 -0
- package/dist/passkey/index.js +18 -0
- package/dist/passkey/index.js.map +1 -0
- package/dist/passkey/react.d.ts +34 -0
- package/dist/passkey/react.d.ts.map +1 -0
- package/dist/passkey/react.js +39 -0
- package/dist/passkey/react.js.map +1 -0
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/dist/resolution/resolve-branding.d.ts.map +1 -1
- package/dist/resolution/resolve-branding.js +3 -1
- package/dist/resolution/resolve-branding.js.map +1 -1
- package/dist/resolution/resolve-config.d.ts.map +1 -1
- package/dist/resolution/resolve-config.js +3 -0
- package/dist/resolution/resolve-config.js.map +1 -1
- package/dist/schemas/api.schemas.d.ts +55 -9
- package/dist/schemas/api.schemas.d.ts.map +1 -1
- package/dist/schemas/api.schemas.js +1 -1
- package/dist/schemas/branding.schemas.d.ts +24 -0
- package/dist/schemas/branding.schemas.d.ts.map +1 -1
- package/dist/schemas/branding.schemas.js +3 -0
- package/dist/schemas/branding.schemas.js.map +1 -1
- package/dist/schemas/capabilities.schemas.d.ts +38 -4
- package/dist/schemas/capabilities.schemas.d.ts.map +1 -1
- package/dist/schemas/capabilities.schemas.js +47 -2
- package/dist/schemas/capabilities.schemas.js.map +1 -1
- package/dist/schemas/config.schemas.d.ts +88 -12
- package/dist/schemas/config.schemas.d.ts.map +1 -1
- package/dist/schemas/config.schemas.js +1 -0
- package/dist/schemas/config.schemas.js.map +1 -1
- package/dist/schemas/modes.schemas.d.ts +8 -0
- package/dist/schemas/modes.schemas.d.ts.map +1 -1
- package/dist/schemas/modes.schemas.js +1 -0
- package/dist/schemas/modes.schemas.js.map +1 -1
- package/dist/styles/contrast.d.ts +33 -0
- package/dist/styles/contrast.d.ts.map +1 -0
- package/dist/styles/contrast.js +92 -0
- package/dist/styles/contrast.js.map +1 -0
- package/dist/styles/css-variables.d.ts +20 -0
- package/dist/styles/css-variables.d.ts.map +1 -1
- package/dist/styles/css-variables.js +35 -1
- package/dist/styles/css-variables.js.map +1 -1
- package/dist/styles/index.d.ts +2 -1
- package/dist/styles/index.d.ts.map +1 -1
- package/dist/styles/index.js +2 -1
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/stylesheet.d.ts +1 -1
- package/dist/styles/stylesheet.d.ts.map +1 -1
- package/dist/styles/stylesheet.js +10 -5
- package/dist/styles/stylesheet.js.map +1 -1
- package/dist/styles/theme.d.ts +32 -1
- package/dist/styles/theme.d.ts.map +1 -1
- package/dist/styles/theme.js +29 -1
- package/dist/styles/theme.js.map +1 -1
- package/dist/styles/tokens.d.ts +5 -5
- package/dist/styles/tokens.js +8 -8
- package/dist/styles/tokens.js.map +1 -1
- package/dist/templates/base/components.d.ts +1 -1
- package/dist/templates/base/components.js +1 -1
- package/dist/templates/index.d.ts +1 -0
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +1 -0
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/modes/credentials.template.d.ts +5 -5
- package/dist/templates/modes/credentials.template.d.ts.map +1 -1
- package/dist/templates/modes/credentials.template.js +15 -13
- package/dist/templates/modes/credentials.template.js.map +1 -1
- package/dist/templates/modes/index.d.ts +1 -0
- package/dist/templates/modes/index.d.ts.map +1 -1
- package/dist/templates/modes/index.js +1 -0
- package/dist/templates/modes/index.js.map +1 -1
- package/dist/templates/modes/passkey.template.d.ts +62 -0
- package/dist/templates/modes/passkey.template.d.ts.map +1 -0
- package/dist/templates/modes/passkey.template.js +174 -0
- package/dist/templates/modes/passkey.template.js.map +1 -0
- package/dist/templates/modes/success.template.d.ts.map +1 -1
- package/dist/templates/modes/success.template.js +2 -7
- package/dist/templates/modes/success.template.js.map +1 -1
- package/dist/templates/registry.d.ts +3 -3
- package/dist/templates/registry.d.ts.map +1 -1
- package/dist/templates/registry.js +6 -5
- package/dist/templates/registry.js.map +1 -1
- package/dist/types/api.types.d.ts +1 -1
- package/dist/types/branding.types.d.ts +6 -0
- package/dist/types/branding.types.d.ts.map +1 -1
- package/dist/types/capabilities.types.d.ts +44 -7
- package/dist/types/capabilities.types.d.ts.map +1 -1
- package/dist/types/capabilities.types.js +26 -2
- package/dist/types/capabilities.types.js.map +1 -1
- package/dist/types/config.types.d.ts +11 -2
- package/dist/types/config.types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/modes.types.d.ts +31 -4
- package/dist/types/modes.types.d.ts.map +1 -1
- package/dist/types/modes.types.js +10 -3
- package/dist/types/modes.types.js.map +1 -1
- package/dist/types/page.types.d.ts +8 -2
- package/dist/types/page.types.d.ts.map +1 -1
- package/package.json +29 -5
|
@@ -35,6 +35,8 @@ const decorators_js_1 = require("lit/decorators.js");
|
|
|
35
35
|
* @csspart label - The label wrapper
|
|
36
36
|
* @csspart link - The terms link
|
|
37
37
|
* @cssprop --consent-primary - Primary brand color for checked state
|
|
38
|
+
* @cssprop --consent-on-primary - Text and checkmarks on the primary fill (default: white)
|
|
39
|
+
* @cssprop --consent-link - Link text on the white card (default: the primary)
|
|
38
40
|
*/
|
|
39
41
|
let ConsentTerms = class ConsentTerms extends lit_1.LitElement {
|
|
40
42
|
constructor() {
|
|
@@ -42,19 +44,19 @@ let ConsentTerms = class ConsentTerms extends lit_1.LitElement {
|
|
|
42
44
|
/**
|
|
43
45
|
* Form field name
|
|
44
46
|
*/
|
|
45
|
-
this.name =
|
|
47
|
+
this.name = "termsAccepted";
|
|
46
48
|
/**
|
|
47
49
|
* Terms text to display
|
|
48
50
|
*/
|
|
49
|
-
this.text =
|
|
51
|
+
this.text = "Terms and Conditions";
|
|
50
52
|
/**
|
|
51
53
|
* Prefix text before the links
|
|
52
54
|
*/
|
|
53
|
-
this.labelPrefix =
|
|
55
|
+
this.labelPrefix = "I agree to the";
|
|
54
56
|
/**
|
|
55
57
|
* Conjunction between terms and privacy links
|
|
56
58
|
*/
|
|
57
|
-
this.conjunction =
|
|
59
|
+
this.conjunction = "and";
|
|
58
60
|
/**
|
|
59
61
|
* Checked state
|
|
60
62
|
*/
|
|
@@ -70,11 +72,11 @@ let ConsentTerms = class ConsentTerms extends lit_1.LitElement {
|
|
|
70
72
|
/**
|
|
71
73
|
* Value when checked
|
|
72
74
|
*/
|
|
73
|
-
this.value =
|
|
75
|
+
this.value = "accepted";
|
|
74
76
|
this.internals = this.attachInternals();
|
|
75
77
|
}
|
|
76
78
|
updated(changedProperties) {
|
|
77
|
-
if (changedProperties.has(
|
|
79
|
+
if (changedProperties.has("checked") || changedProperties.has("value")) {
|
|
78
80
|
this.updateFormValue();
|
|
79
81
|
}
|
|
80
82
|
}
|
|
@@ -90,7 +92,7 @@ let ConsentTerms = class ConsentTerms extends lit_1.LitElement {
|
|
|
90
92
|
const input = e.target;
|
|
91
93
|
this.checked = input.checked;
|
|
92
94
|
this.updateFormValue();
|
|
93
|
-
this.dispatchEvent(new CustomEvent(
|
|
95
|
+
this.dispatchEvent(new CustomEvent("change", {
|
|
94
96
|
detail: { checked: this.checked, value: this.value },
|
|
95
97
|
bubbles: true,
|
|
96
98
|
composed: true,
|
|
@@ -161,13 +163,13 @@ ConsentTerms.styles = (0, lit_1.css) `
|
|
|
161
163
|
opacity: 0.6;
|
|
162
164
|
}
|
|
163
165
|
|
|
164
|
-
/* Custom checkbox styling - matches
|
|
165
|
-
input[type=
|
|
166
|
+
/* Custom checkbox styling - matches Checkpoint exactly */
|
|
167
|
+
input[type="checkbox"] {
|
|
166
168
|
appearance: none;
|
|
167
169
|
-webkit-appearance: none;
|
|
168
170
|
margin: 0;
|
|
169
171
|
|
|
170
|
-
/* Size - matches
|
|
172
|
+
/* Size - matches Checkpoint w-4 h-4 */
|
|
171
173
|
width: 1rem;
|
|
172
174
|
height: 1rem;
|
|
173
175
|
min-width: 1rem;
|
|
@@ -183,39 +185,41 @@ ConsentTerms.styles = (0, lit_1.css) `
|
|
|
183
185
|
/* Interaction */
|
|
184
186
|
cursor: pointer;
|
|
185
187
|
position: relative;
|
|
186
|
-
transition:
|
|
188
|
+
transition:
|
|
189
|
+
background-color 0.15s ease,
|
|
190
|
+
border-color 0.15s ease;
|
|
187
191
|
}
|
|
188
192
|
|
|
189
|
-
input[type=
|
|
193
|
+
input[type="checkbox"]:hover:not(:disabled) {
|
|
190
194
|
border-color: var(--_primary);
|
|
191
195
|
}
|
|
192
196
|
|
|
193
|
-
input[type=
|
|
197
|
+
input[type="checkbox"]:focus-visible {
|
|
194
198
|
outline: 2px solid var(--_primary);
|
|
195
199
|
outline-offset: 2px;
|
|
196
200
|
}
|
|
197
201
|
|
|
198
202
|
/* Checked state */
|
|
199
|
-
input[type=
|
|
203
|
+
input[type="checkbox"]:checked {
|
|
200
204
|
background-color: var(--_primary);
|
|
201
205
|
border-color: var(--_primary);
|
|
202
206
|
}
|
|
203
207
|
|
|
204
208
|
/* Checkmark */
|
|
205
|
-
input[type=
|
|
206
|
-
content:
|
|
209
|
+
input[type="checkbox"]:checked::after {
|
|
210
|
+
content: "";
|
|
207
211
|
position: absolute;
|
|
208
212
|
left: 4px;
|
|
209
213
|
top: 1px;
|
|
210
214
|
width: 5px;
|
|
211
215
|
height: 9px;
|
|
212
|
-
border: solid white;
|
|
216
|
+
border: solid var(--consent-on-primary, white);
|
|
213
217
|
border-width: 0 2px 2px 0;
|
|
214
218
|
transform: rotate(45deg);
|
|
215
219
|
}
|
|
216
220
|
|
|
217
221
|
/* Disabled */
|
|
218
|
-
input[type=
|
|
222
|
+
input[type="checkbox"]:disabled {
|
|
219
223
|
cursor: not-allowed;
|
|
220
224
|
opacity: 0.5;
|
|
221
225
|
}
|
|
@@ -227,7 +231,7 @@ ConsentTerms.styles = (0, lit_1.css) `
|
|
|
227
231
|
|
|
228
232
|
/* Links */
|
|
229
233
|
a {
|
|
230
|
-
color: var(--_primary);
|
|
234
|
+
color: var(--consent-link, var(--_primary));
|
|
231
235
|
text-decoration: underline;
|
|
232
236
|
text-underline-offset: 2px;
|
|
233
237
|
}
|
|
@@ -258,13 +262,13 @@ __decorate([
|
|
|
258
262
|
(0, decorators_js_1.property)({ type: String })
|
|
259
263
|
], ConsentTerms.prototype, "url", void 0);
|
|
260
264
|
__decorate([
|
|
261
|
-
(0, decorators_js_1.property)({ type: String, attribute:
|
|
265
|
+
(0, decorators_js_1.property)({ type: String, attribute: "privacy-text" })
|
|
262
266
|
], ConsentTerms.prototype, "privacyText", void 0);
|
|
263
267
|
__decorate([
|
|
264
|
-
(0, decorators_js_1.property)({ type: String, attribute:
|
|
268
|
+
(0, decorators_js_1.property)({ type: String, attribute: "privacy-url" })
|
|
265
269
|
], ConsentTerms.prototype, "privacyUrl", void 0);
|
|
266
270
|
__decorate([
|
|
267
|
-
(0, decorators_js_1.property)({ type: String, attribute:
|
|
271
|
+
(0, decorators_js_1.property)({ type: String, attribute: "label-prefix" })
|
|
268
272
|
], ConsentTerms.prototype, "labelPrefix", void 0);
|
|
269
273
|
__decorate([
|
|
270
274
|
(0, decorators_js_1.property)({ type: String })
|
|
@@ -282,6 +286,6 @@ __decorate([
|
|
|
282
286
|
(0, decorators_js_1.property)({ type: String })
|
|
283
287
|
], ConsentTerms.prototype, "value", void 0);
|
|
284
288
|
exports.ConsentTerms = ConsentTerms = __decorate([
|
|
285
|
-
(0, decorators_js_1.customElement)(
|
|
289
|
+
(0, decorators_js_1.customElement)("consent-terms")
|
|
286
290
|
], ConsentTerms);
|
|
287
291
|
//# sourceMappingURL=consent-terms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-terms.js","sourceRoot":"","sources":["../../../src/components/consent-terms.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;AAEH,6BAAqD;AACrD,qDAA4D;AAE5D
|
|
1
|
+
{"version":3,"file":"consent-terms.js","sourceRoot":"","sources":["../../../src/components/consent-terms.ts"],"names":[],"mappings":"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"}
|
|
@@ -131,7 +131,7 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
131
131
|
/**
|
|
132
132
|
* User email from credential provider response
|
|
133
133
|
* Set when redirecting from credential auth → clickwrap page
|
|
134
|
-
* Used for human-readable display in
|
|
134
|
+
* Used for human-readable display in Checkpoint dashboard (user_identifier)
|
|
135
135
|
*/
|
|
136
136
|
this.credentialUserEmail = "";
|
|
137
137
|
/**
|
|
@@ -150,6 +150,8 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
150
150
|
/** Native HTTP resolves assertion scopes from its immutable anchor, so the
|
|
151
151
|
* submitted grant may safely narrow to the human's selected permissions. */
|
|
152
152
|
this.nativeScopeSelection = false;
|
|
153
|
+
/** Native request deadline from the host; never an authorization decision. */
|
|
154
|
+
this.requestExpiresAt = 0;
|
|
153
155
|
// === HUMANIZED CONSENT (capability-based) ===
|
|
154
156
|
/**
|
|
155
157
|
* Operator-authored capability groups. When present and non-empty, the new
|
|
@@ -159,8 +161,8 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
159
161
|
this.capabilities = [];
|
|
160
162
|
/** Org name shown in headline + revocation footer (e.g. "Hardware World"). */
|
|
161
163
|
this.orgName = "";
|
|
162
|
-
/** Operator-set
|
|
163
|
-
this.headlineVerb = "
|
|
164
|
+
/** Operator-set action phrase. Empty uses a complete generic heading. */
|
|
165
|
+
this.headlineVerb = "";
|
|
164
166
|
/** Path the user can visit to revoke (footer notice). */
|
|
165
167
|
this.revocationPath = "Account → Connected Agents";
|
|
166
168
|
/** Days of inactivity before auto-revocation (footer notice). Defaults to 90. */
|
|
@@ -175,7 +177,7 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
175
177
|
* Values: 'password', 'oauth2', 'none', etc.
|
|
176
178
|
* Default: 'password' for credential flows
|
|
177
179
|
*
|
|
178
|
-
* This is dynamically set based on the tool's authorization.type in
|
|
180
|
+
* This is dynamically set based on the tool's authorization.type in Checkpoint
|
|
179
181
|
* to ensure the delegation's authorization type matches the tool's expectations.
|
|
180
182
|
*/
|
|
181
183
|
this.authorizationType = "password";
|
|
@@ -193,6 +195,17 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
193
195
|
this.resendCooldown = 0;
|
|
194
196
|
this.selectedScopes = [];
|
|
195
197
|
this.closeFailed = false;
|
|
198
|
+
this.restartApprovalPage = () => {
|
|
199
|
+
if (!this.approvalRecovery?.reload ||
|
|
200
|
+
!this.anchorSid ||
|
|
201
|
+
typeof window === "undefined")
|
|
202
|
+
return;
|
|
203
|
+
// Re-authenticate the same anchor. The fragment assertion was consumed, so
|
|
204
|
+
// reloading mode=consent-only would leave the form unable to prove sign-in.
|
|
205
|
+
const target = new URL("/consent", window.location.origin);
|
|
206
|
+
target.searchParams.set("sid", this.anchorSid);
|
|
207
|
+
window.location.assign(target.toString());
|
|
208
|
+
};
|
|
196
209
|
this.onCapabilitiesAllow = (event) => {
|
|
197
210
|
if (this.loading)
|
|
198
211
|
return;
|
|
@@ -245,6 +258,7 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
245
258
|
// Initialize selected scopes with all requested scopes
|
|
246
259
|
this.selectedScopes = [...this.scopes];
|
|
247
260
|
this.readIdentityAssertionFromLocation();
|
|
261
|
+
this.scheduleRequestExpiry();
|
|
248
262
|
}
|
|
249
263
|
/**
|
|
250
264
|
* Read the grant-bound signed identity assertion the worker delivers via
|
|
@@ -276,6 +290,7 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
276
290
|
}
|
|
277
291
|
disconnectedCallback() {
|
|
278
292
|
super.disconnectedCallback();
|
|
293
|
+
clearTimeout(this.requestExpiryTimer);
|
|
279
294
|
// Clean up interval timer to prevent memory leaks
|
|
280
295
|
if (this.resendCooldownInterval !== undefined) {
|
|
281
296
|
clearInterval(this.resendCooldownInterval);
|
|
@@ -283,6 +298,9 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
283
298
|
}
|
|
284
299
|
}
|
|
285
300
|
updated(changedProperties) {
|
|
301
|
+
if (changedProperties.has("requestExpiresAt") ||
|
|
302
|
+
changedProperties.has("nativeScopeSelection"))
|
|
303
|
+
this.scheduleRequestExpiry();
|
|
286
304
|
if (changedProperties.has("config") || changedProperties.has("agentName")) {
|
|
287
305
|
this.resolved = (0, resolve_config_js_1.resolveConsentConfig)(this.config, this.agentName);
|
|
288
306
|
}
|
|
@@ -293,10 +311,14 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
293
311
|
if (changedProperties.has("scopes")) {
|
|
294
312
|
this.selectedScopes = [...this.scopes];
|
|
295
313
|
}
|
|
296
|
-
//
|
|
314
|
+
// The brand colors, and the text colors that read on them, from the
|
|
315
|
+
// resolved config. They are set together: text colors inherited from a
|
|
316
|
+
// host page were picked for the host's primary, not for this one.
|
|
297
317
|
if (this.resolved) {
|
|
298
|
-
|
|
299
|
-
|
|
318
|
+
for (const [name, value] of Object.entries(this.resolved.branding.cssVars)) {
|
|
319
|
+
if (value)
|
|
320
|
+
this.style.setProperty(name, value);
|
|
321
|
+
}
|
|
300
322
|
}
|
|
301
323
|
}
|
|
302
324
|
// === FORM SUBMISSION ===
|
|
@@ -359,6 +381,13 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
359
381
|
*/
|
|
360
382
|
async handleApprove(e) {
|
|
361
383
|
e?.preventDefault();
|
|
384
|
+
// A rejected native form cannot be re-submitted until a safe GET refresh.
|
|
385
|
+
if (this.nativeScopeSelection &&
|
|
386
|
+
this.requestExpiresAt > 0 &&
|
|
387
|
+
Date.now() >= this.requestExpiresAt)
|
|
388
|
+
this.setApprovalRecovery("kyaos/pickup-expired");
|
|
389
|
+
if (this.approvalRecovery)
|
|
390
|
+
return;
|
|
362
391
|
// Guard against duplicate submissions
|
|
363
392
|
if (this.loading) {
|
|
364
393
|
return;
|
|
@@ -388,6 +417,7 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
388
417
|
}
|
|
389
418
|
this.loading = true;
|
|
390
419
|
this.error = undefined;
|
|
420
|
+
let credentialsRejected = false;
|
|
391
421
|
try {
|
|
392
422
|
// Build consent approval request
|
|
393
423
|
// The server creates the DelegationCredential (VC) when this request succeeds
|
|
@@ -454,7 +484,7 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
454
484
|
formData.append("user_did", this.userDid);
|
|
455
485
|
}
|
|
456
486
|
// Pass user info from credential provider for delegation metadata
|
|
457
|
-
// These are used for human-readable display in
|
|
487
|
+
// These are used for human-readable display in Checkpoint dashboard
|
|
458
488
|
if (this.credentialUserEmail) {
|
|
459
489
|
formData.append("credential_user_email", this.credentialUserEmail);
|
|
460
490
|
}
|
|
@@ -466,15 +496,52 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
466
496
|
formData.append(key, value);
|
|
467
497
|
});
|
|
468
498
|
// Submit consent - server creates DelegationCredential on success
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
499
|
+
let response;
|
|
500
|
+
try {
|
|
501
|
+
response = await fetch(`${this.serverUrl}/consent/approve`, {
|
|
502
|
+
method: "POST",
|
|
503
|
+
body: formData,
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
catch (error) {
|
|
507
|
+
if (this.nativeScopeSelection)
|
|
508
|
+
this.setApprovalRecovery("kyaos/consent-network-interrupted");
|
|
509
|
+
throw error;
|
|
510
|
+
}
|
|
473
511
|
if (!response.ok) {
|
|
474
|
-
const errorData = await response.json().catch(() =>
|
|
475
|
-
|
|
512
|
+
const errorData = await response.json().catch(() => null);
|
|
513
|
+
const data = errorData && typeof errorData === "object"
|
|
514
|
+
? errorData
|
|
515
|
+
: {};
|
|
516
|
+
if (this.nativeScopeSelection) {
|
|
517
|
+
const code = typeof data.error_code === "string" ? data.error_code : undefined;
|
|
518
|
+
// Only an explicit pre-mint credential rejection permits another
|
|
519
|
+
// POST. Other 401s can be terminal identity/anchor failures.
|
|
520
|
+
credentialsRejected =
|
|
521
|
+
this.currentMode === modes_types_js_1.AUTH_MODES.CREDENTIALS &&
|
|
522
|
+
response.status === 401 &&
|
|
523
|
+
code === "kyaos/credentials-not-accepted";
|
|
524
|
+
if (!credentialsRejected)
|
|
525
|
+
this.setApprovalRecovery(code ??
|
|
526
|
+
(response.status === 410
|
|
527
|
+
? "kyaos/pickup-expired"
|
|
528
|
+
: "kyaos/consent-request-unavailable"));
|
|
529
|
+
}
|
|
530
|
+
throw new Error(credentialsRejected
|
|
531
|
+
? "Those credentials were not accepted. Please check them and try again."
|
|
532
|
+
: typeof data.error === "string"
|
|
533
|
+
? data.error
|
|
534
|
+
: typeof data.message === "string"
|
|
535
|
+
? data.message
|
|
536
|
+
: "Approval failed");
|
|
476
537
|
}
|
|
477
538
|
const result = await response.json();
|
|
539
|
+
if (this.nativeScopeSelection &&
|
|
540
|
+
(!result ||
|
|
541
|
+
result.success !== true ||
|
|
542
|
+
typeof result.delegation_id !== "string" ||
|
|
543
|
+
!result.delegation_id))
|
|
544
|
+
throw new Error("Invalid approval response");
|
|
478
545
|
// Check if server wants us to redirect (e.g., credential auth → clickwrap page)
|
|
479
546
|
// This implements the 3-screen flow: Auth → Clickwrap → Success
|
|
480
547
|
if (result.redirectUrl) {
|
|
@@ -507,9 +574,15 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
507
574
|
}));
|
|
508
575
|
}
|
|
509
576
|
catch (e) {
|
|
510
|
-
this.
|
|
577
|
+
if (this.nativeScopeSelection &&
|
|
578
|
+
!credentialsRejected &&
|
|
579
|
+
!this.approvalRecovery)
|
|
580
|
+
this.setApprovalRecovery("kyaos/consent-request-unavailable");
|
|
581
|
+
const message = this.approvalRecoveryMessage() ??
|
|
582
|
+
(e instanceof Error ? e.message : "Unknown error");
|
|
583
|
+
this.error = message;
|
|
511
584
|
this.dispatchEvent(new CustomEvent("mcp-consent:error", {
|
|
512
|
-
detail: { error:
|
|
585
|
+
detail: { error: message },
|
|
513
586
|
bubbles: true,
|
|
514
587
|
composed: true,
|
|
515
588
|
}));
|
|
@@ -575,6 +648,7 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
575
648
|
<section class="agent-key" aria-label="Agent key">
|
|
576
649
|
<p><strong>Agent key</strong></p>
|
|
577
650
|
<p>This permission is bound to this key.</p>
|
|
651
|
+
<p>The agent provider has not been verified.</p>
|
|
578
652
|
<code>${this.agentDid}</code>
|
|
579
653
|
</section>
|
|
580
654
|
`;
|
|
@@ -667,10 +741,81 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
667
741
|
</div>
|
|
668
742
|
`;
|
|
669
743
|
}
|
|
744
|
+
approvalRecoveryMessage() {
|
|
745
|
+
return this.approvalRecovery?.message;
|
|
746
|
+
}
|
|
747
|
+
setApprovalRecovery(code) {
|
|
748
|
+
const expired = code === "kyaos/pickup-expired";
|
|
749
|
+
const invalidForm = code === "kyaos/consent-form-invalid";
|
|
750
|
+
const mismatch = code === "kyaos/session-mismatch";
|
|
751
|
+
const missing = code === "kyaos/consent-request-not-found";
|
|
752
|
+
const network = code === "kyaos/consent-network-interrupted";
|
|
753
|
+
this.approvalRecovery = {
|
|
754
|
+
code: expired || invalidForm || mismatch || missing || network
|
|
755
|
+
? code
|
|
756
|
+
: "kyaos/consent-request-unavailable",
|
|
757
|
+
title: expired
|
|
758
|
+
? "This approval request has expired"
|
|
759
|
+
: invalidForm
|
|
760
|
+
? "We couldn't verify this approval page"
|
|
761
|
+
: mismatch
|
|
762
|
+
? "This sign-in could not be verified"
|
|
763
|
+
: missing
|
|
764
|
+
? "This approval request is no longer available"
|
|
765
|
+
: network
|
|
766
|
+
? "The connection was interrupted"
|
|
767
|
+
: "We couldn't check this approval request",
|
|
768
|
+
message: expired || missing || mismatch
|
|
769
|
+
? "Return to your assistant for a new approval link, then review the permissions again."
|
|
770
|
+
: invalidForm
|
|
771
|
+
? "Reload and sign in again, then review the permissions. This submission did not approve access."
|
|
772
|
+
: network
|
|
773
|
+
? "We couldn't confirm whether approval completed. Return to your assistant to check the request before trying again."
|
|
774
|
+
: "Return to your assistant to check this request before trying again.",
|
|
775
|
+
// Only a server-confirmed valid pinned anchor permits a GET restart.
|
|
776
|
+
reload: invalidForm,
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
scheduleRequestExpiry() {
|
|
780
|
+
clearTimeout(this.requestExpiryTimer);
|
|
781
|
+
if (!this.nativeScopeSelection ||
|
|
782
|
+
!Number.isSafeInteger(this.requestExpiresAt) ||
|
|
783
|
+
this.requestExpiresAt <= 0)
|
|
784
|
+
return;
|
|
785
|
+
const remaining = this.requestExpiresAt - Date.now();
|
|
786
|
+
if (remaining <= 0) {
|
|
787
|
+
if (this.step !== "success")
|
|
788
|
+
this.setApprovalRecovery("kyaos/pickup-expired");
|
|
789
|
+
}
|
|
790
|
+
else {
|
|
791
|
+
this.requestExpiryTimer = setTimeout(() => {
|
|
792
|
+
if (this.step !== "success")
|
|
793
|
+
this.setApprovalRecovery("kyaos/pickup-expired");
|
|
794
|
+
}, Math.min(remaining, 2147483647));
|
|
795
|
+
}
|
|
796
|
+
}
|
|
670
797
|
renderError() {
|
|
798
|
+
if (this.approvalRecovery)
|
|
799
|
+
return (0, lit_1.html) ` <section
|
|
800
|
+
class="error-message"
|
|
801
|
+
role="alert"
|
|
802
|
+
aria-live="assertive"
|
|
803
|
+
aria-atomic="true"
|
|
804
|
+
>
|
|
805
|
+
<h2>${this.approvalRecovery.title}</h2>
|
|
806
|
+
<p>${this.approvalRecovery.message}</p>
|
|
807
|
+
${this.approvalRecovery.reload
|
|
808
|
+
? (0, lit_1.html) `<consent-button
|
|
809
|
+
variant="secondary"
|
|
810
|
+
@click=${this.restartApprovalPage}
|
|
811
|
+
>Reload and sign in again</consent-button
|
|
812
|
+
>`
|
|
813
|
+
: lit_1.nothing}
|
|
814
|
+
<p><small>Reference: ${this.approvalRecovery.code}</small></p>
|
|
815
|
+
</section>`;
|
|
671
816
|
if (!this.error)
|
|
672
817
|
return lit_1.nothing;
|
|
673
|
-
return (0, lit_1.html) `<div class="error-message">${this.error}</div>`;
|
|
818
|
+
return (0, lit_1.html) `<div class="error-message" role="alert">${this.error}</div>`;
|
|
674
819
|
}
|
|
675
820
|
/**
|
|
676
821
|
* Whether the user's identity has already been established, either via a
|
|
@@ -698,9 +843,10 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
698
843
|
<consent-button
|
|
699
844
|
variant="primary"
|
|
700
845
|
?loading=${this.loading}
|
|
701
|
-
?disabled=${this.
|
|
702
|
-
this.
|
|
703
|
-
|
|
846
|
+
?disabled=${!!this.approvalRecovery ||
|
|
847
|
+
(this.currentMode === modes_types_js_1.AUTH_MODES.CONSENT_ONLY &&
|
|
848
|
+
this.resolved?.terms.required &&
|
|
849
|
+
!this.termsAccepted)}
|
|
704
850
|
@click=${this.handleApprove}
|
|
705
851
|
>
|
|
706
852
|
${submitText ??
|
|
@@ -782,7 +928,7 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
782
928
|
<p style="text-align: right; margin-bottom: 1rem;">
|
|
783
929
|
<a
|
|
784
930
|
href=${creds.forgotPasswordUrl}
|
|
785
|
-
style="font-size: 0.75rem; color: var(--_primary);"
|
|
931
|
+
style="font-size: 0.75rem; color: var(--consent-link, var(--_primary));"
|
|
786
932
|
>
|
|
787
933
|
Forgot password?
|
|
788
934
|
</a>
|
|
@@ -829,14 +975,16 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
829
975
|
>
|
|
830
976
|
<div slot="content">
|
|
831
977
|
${this.renderError()} ${this.renderAgentInfo()}
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
978
|
+
${this.approvalRecovery
|
|
979
|
+
? lit_1.nothing
|
|
980
|
+
: (0, lit_1.html) `<consent-oauth-button
|
|
981
|
+
provider=${provider}
|
|
982
|
+
provider-name=${providerName}
|
|
983
|
+
url=${oauthButtonUrl}
|
|
984
|
+
button-text=${oauth?.buttonText ??
|
|
985
|
+
`Continue with ${providerName}`}
|
|
986
|
+
full-width
|
|
987
|
+
></consent-oauth-button>`}
|
|
840
988
|
</div>
|
|
841
989
|
${this.renderFooter({ allowSubmit: this.hasEstablishedIdentity })}
|
|
842
990
|
</consent-shell>
|
|
@@ -1132,19 +1280,6 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
1132
1280
|
// site" with placeholder logos — a visible branding regression versus
|
|
1133
1281
|
// the sign-in screen it replaces.
|
|
1134
1282
|
return (0, lit_1.html) `
|
|
1135
|
-
${error
|
|
1136
|
-
? (0, lit_1.html) `<div
|
|
1137
|
-
role="alert"
|
|
1138
|
-
style="
|
|
1139
|
-
color: var(--cs-text-danger, #b91c1c);
|
|
1140
|
-
margin: 0 auto 12px;
|
|
1141
|
-
max-width: 560px;
|
|
1142
|
-
font-size: 13px;
|
|
1143
|
-
"
|
|
1144
|
-
>
|
|
1145
|
-
${error}
|
|
1146
|
-
</div>`
|
|
1147
|
-
: lit_1.nothing}
|
|
1148
1283
|
<consent-capabilities-screen
|
|
1149
1284
|
.capabilities=${flatCapabilities}
|
|
1150
1285
|
.agentMetadata=${this.agentMetadata}
|
|
@@ -1155,16 +1290,39 @@ let McpConsent = class McpConsent extends lit_1.LitElement {
|
|
|
1155
1290
|
revocationPath="${this.revocationPath}"
|
|
1156
1291
|
inactivityDays=${this.inactivityDays}
|
|
1157
1292
|
?fixed-expiry=${this.nativeScopeSelection}
|
|
1293
|
+
fixed-expiry-days=${this.resolved?.fixedExpiryDays ?? lit_1.nothing}
|
|
1158
1294
|
theme="${this.consentTheme}"
|
|
1159
1295
|
how-it-works-url="${this.howItWorksUrl}"
|
|
1160
1296
|
?loading=${this.loading}
|
|
1161
1297
|
?all-selected=${allSelected}
|
|
1298
|
+
?disabled=${!!this.approvalRecovery}
|
|
1162
1299
|
?require-all=${allSelected}
|
|
1163
|
-
?allow-disabled=${
|
|
1300
|
+
?allow-disabled=${!!this.approvalRecovery ||
|
|
1301
|
+
!projection.ok ||
|
|
1164
1302
|
(credentials && !(0, credential_capabilities_js_1.areCredentialsComplete)(this.formData))}
|
|
1165
1303
|
@capabilities-allow=${this.onCapabilitiesAllow}
|
|
1166
1304
|
@capabilities-deny=${this.handleDeny}
|
|
1167
1305
|
>
|
|
1306
|
+
${error || this.approvalRecovery
|
|
1307
|
+
? (0, lit_1.html) `<div slot="recovery">
|
|
1308
|
+
${this.renderError()}${!this.error &&
|
|
1309
|
+
!this.approvalRecovery &&
|
|
1310
|
+
error
|
|
1311
|
+
? (0, lit_1.html) `<div class="error-message" role="alert">${error}</div>`
|
|
1312
|
+
: lit_1.nothing}
|
|
1313
|
+
</div>`
|
|
1314
|
+
: lit_1.nothing}
|
|
1315
|
+
${this.nativeScopeSelection &&
|
|
1316
|
+
(!this.approvalRecovery || this.approvalRecovery.reload) &&
|
|
1317
|
+
Number.isSafeInteger(this.requestExpiresAt) &&
|
|
1318
|
+
this.requestExpiresAt > 0
|
|
1319
|
+
? (0, lit_1.html) `<p slot="details">
|
|
1320
|
+
Approval request expires at
|
|
1321
|
+
<time datetime=${new Date(this.requestExpiresAt).toISOString()}
|
|
1322
|
+
>${new Date(this.requestExpiresAt).toLocaleString()}</time
|
|
1323
|
+
>.
|
|
1324
|
+
</p>`
|
|
1325
|
+
: lit_1.nothing}
|
|
1168
1326
|
${this.nativeScopeSelection && this.agentDid
|
|
1169
1327
|
? (0, lit_1.html) `<div slot="agent-key">${this.renderNativeAgentKey()}</div>`
|
|
1170
1328
|
: lit_1.nothing}
|
|
@@ -1311,6 +1469,19 @@ McpConsent.styles = (0, lit_1.css) `
|
|
|
1311
1469
|
font-size: 0.875rem;
|
|
1312
1470
|
}
|
|
1313
1471
|
|
|
1472
|
+
.error-message h2 {
|
|
1473
|
+
font: inherit;
|
|
1474
|
+
font-weight: 650;
|
|
1475
|
+
margin: 0 0 0.5rem;
|
|
1476
|
+
}
|
|
1477
|
+
.error-message p {
|
|
1478
|
+
margin: 0.5rem 0;
|
|
1479
|
+
line-height: 1.5;
|
|
1480
|
+
}
|
|
1481
|
+
.error-message small {
|
|
1482
|
+
overflow-wrap: anywhere;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1314
1485
|
/* Form fields */
|
|
1315
1486
|
.form-fields {
|
|
1316
1487
|
display: flex;
|
|
@@ -1483,7 +1654,7 @@ McpConsent.styles = (0, lit_1.css) `
|
|
|
1483
1654
|
|
|
1484
1655
|
.permission-badge {
|
|
1485
1656
|
background: var(--_secondary);
|
|
1486
|
-
color: #0e2249;
|
|
1657
|
+
color: var(--consent-on-secondary, #0e2249);
|
|
1487
1658
|
font-family:
|
|
1488
1659
|
"Geist",
|
|
1489
1660
|
-apple-system,
|
|
@@ -1566,7 +1737,7 @@ McpConsent.styles = (0, lit_1.css) `
|
|
|
1566
1737
|
.otp-resend button {
|
|
1567
1738
|
background: none;
|
|
1568
1739
|
border: none;
|
|
1569
|
-
color: var(--_primary);
|
|
1740
|
+
color: var(--consent-link, var(--_primary));
|
|
1570
1741
|
cursor: pointer;
|
|
1571
1742
|
text-decoration: underline;
|
|
1572
1743
|
}
|
|
@@ -1670,6 +1841,12 @@ __decorate([
|
|
|
1670
1841
|
__decorate([
|
|
1671
1842
|
(0, decorators_js_1.property)({ type: Boolean, attribute: "native-scope-selection" })
|
|
1672
1843
|
], McpConsent.prototype, "nativeScopeSelection", void 0);
|
|
1844
|
+
__decorate([
|
|
1845
|
+
(0, decorators_js_1.property)({ type: Number, attribute: "request-expires-at" })
|
|
1846
|
+
], McpConsent.prototype, "requestExpiresAt", void 0);
|
|
1847
|
+
__decorate([
|
|
1848
|
+
(0, decorators_js_1.state)()
|
|
1849
|
+
], McpConsent.prototype, "approvalRecovery", void 0);
|
|
1673
1850
|
__decorate([
|
|
1674
1851
|
(0, decorators_js_1.property)({
|
|
1675
1852
|
type: Array,
|