@despia-native/kernel 0.0.0-coming-soon.0 → 0.3.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/LICENSE +202 -0
- package/NOTICE +1414 -0
- package/README.md +16 -1
- package/dist/.dsx-build-stamp.json +7 -0
- package/dist/api-cohort.d.ts +27 -0
- package/dist/api-cohort.d.ts.map +1 -0
- package/dist/api-cohort.js +94 -0
- package/dist/api-cohort.js.map +1 -0
- package/dist/api.d.ts +454 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +2442 -0
- package/dist/api.js.map +1 -0
- package/dist/app-consts.d.ts +10 -0
- package/dist/app-consts.d.ts.map +1 -0
- package/dist/app-consts.js +39 -0
- package/dist/app-consts.js.map +1 -0
- package/dist/app-update.d.ts +12 -0
- package/dist/app-update.d.ts.map +1 -0
- package/dist/app-update.js +32 -0
- package/dist/app-update.js.map +1 -0
- package/dist/aria.d.ts +152 -0
- package/dist/aria.d.ts.map +1 -0
- package/dist/aria.js +524 -0
- package/dist/aria.js.map +1 -0
- package/dist/audio-core.d.ts +260 -0
- package/dist/audio-core.d.ts.map +1 -0
- package/dist/audio-core.js +1440 -0
- package/dist/audio-core.js.map +1 -0
- package/dist/audio-edit.d.ts +100 -0
- package/dist/audio-edit.d.ts.map +1 -0
- package/dist/audio-edit.js +489 -0
- package/dist/audio-edit.js.map +1 -0
- package/dist/audio-mix.d.ts +84 -0
- package/dist/audio-mix.d.ts.map +1 -0
- package/dist/audio-mix.js +393 -0
- package/dist/audio-mix.js.map +1 -0
- package/dist/auth-proof.d.ts +145 -0
- package/dist/auth-proof.d.ts.map +1 -0
- package/dist/auth-proof.js +644 -0
- package/dist/auth-proof.js.map +1 -0
- package/dist/availability-explain.d.ts +3 -0
- package/dist/availability-explain.d.ts.map +1 -0
- package/dist/availability-explain.js +322 -0
- package/dist/availability-explain.js.map +1 -0
- package/dist/availability.d.ts +246 -0
- package/dist/availability.d.ts.map +1 -0
- package/dist/availability.js +615 -0
- package/dist/availability.js.map +1 -0
- package/dist/background.d.ts +116 -0
- package/dist/background.d.ts.map +1 -0
- package/dist/background.js +235 -0
- package/dist/background.js.map +1 -0
- package/dist/boot-tables-flag.d.ts +2 -0
- package/dist/boot-tables-flag.d.ts.map +1 -0
- package/dist/boot-tables-flag.js +16 -0
- package/dist/boot-tables-flag.js.map +1 -0
- package/dist/boot-tables.d.ts +40 -0
- package/dist/boot-tables.d.ts.map +1 -0
- package/dist/boot-tables.js +102 -0
- package/dist/boot-tables.js.map +1 -0
- package/dist/border-edges.d.ts +5 -0
- package/dist/border-edges.d.ts.map +1 -0
- package/dist/border-edges.js +47 -0
- package/dist/border-edges.js.map +1 -0
- package/dist/bus.d.ts +1203 -0
- package/dist/bus.d.ts.map +1 -0
- package/dist/bus.js +2647 -0
- package/dist/bus.js.map +1 -0
- package/dist/calendar-core.d.ts +143 -0
- package/dist/calendar-core.d.ts.map +1 -0
- package/dist/calendar-core.js +372 -0
- package/dist/calendar-core.js.map +1 -0
- package/dist/call-value.d.ts +16 -0
- package/dist/call-value.d.ts.map +1 -0
- package/dist/call-value.js +54 -0
- package/dist/call-value.js.map +1 -0
- package/dist/camera-core.d.ts +222 -0
- package/dist/camera-core.d.ts.map +1 -0
- package/dist/camera-core.js +980 -0
- package/dist/camera-core.js.map +1 -0
- package/dist/canvas-core.d.ts +404 -0
- package/dist/canvas-core.d.ts.map +1 -0
- package/dist/canvas-core.js +2186 -0
- package/dist/canvas-core.js.map +1 -0
- package/dist/capture-core.d.ts +74 -0
- package/dist/capture-core.d.ts.map +1 -0
- package/dist/capture-core.js +158 -0
- package/dist/capture-core.js.map +1 -0
- package/dist/compile/codegen.d.ts +146 -0
- package/dist/compile/codegen.d.ts.map +1 -0
- package/dist/compile/codegen.js +1949 -0
- package/dist/compile/codegen.js.map +1 -0
- package/dist/compile/jstier.d.ts +44 -0
- package/dist/compile/jstier.d.ts.map +1 -0
- package/dist/compile/jstier.js +181 -0
- package/dist/compile/jstier.js.map +1 -0
- package/dist/compile/tier-door.d.ts +41 -0
- package/dist/compile/tier-door.d.ts.map +1 -0
- package/dist/compile/tier-door.js +167 -0
- package/dist/compile/tier-door.js.map +1 -0
- package/dist/compile/tier-realm.d.ts +49 -0
- package/dist/compile/tier-realm.d.ts.map +1 -0
- package/dist/compile/tier-realm.js +368 -0
- package/dist/compile/tier-realm.js.map +1 -0
- package/dist/compile/tier.d.ts +23 -0
- package/dist/compile/tier.d.ts.map +1 -0
- package/dist/compile/tier.js +157 -0
- package/dist/compile/tier.js.map +1 -0
- package/dist/compose-core.d.ts +86 -0
- package/dist/compose-core.d.ts.map +1 -0
- package/dist/compose-core.js +112 -0
- package/dist/compose-core.js.map +1 -0
- package/dist/config-validate.d.ts +31 -0
- package/dist/config-validate.d.ts.map +1 -0
- package/dist/config-validate.js +147 -0
- package/dist/config-validate.js.map +1 -0
- package/dist/config-values.d.ts +106 -0
- package/dist/config-values.d.ts.map +1 -0
- package/dist/config-values.js +340 -0
- package/dist/config-values.js.map +1 -0
- package/dist/contacts-core.d.ts +127 -0
- package/dist/contacts-core.d.ts.map +1 -0
- package/dist/contacts-core.js +211 -0
- package/dist/contacts-core.js.map +1 -0
- package/dist/content-transition.d.ts +58 -0
- package/dist/content-transition.d.ts.map +1 -0
- package/dist/content-transition.js +94 -0
- package/dist/content-transition.js.map +1 -0
- package/dist/controls-core.d.ts +227 -0
- package/dist/controls-core.d.ts.map +1 -0
- package/dist/controls-core.js +652 -0
- package/dist/controls-core.js.map +1 -0
- package/dist/cookies.d.ts +78 -0
- package/dist/cookies.d.ts.map +1 -0
- package/dist/cookies.js +265 -0
- package/dist/cookies.js.map +1 -0
- package/dist/corner-shape-core.d.ts +69 -0
- package/dist/corner-shape-core.d.ts.map +1 -0
- package/dist/corner-shape-core.js +261 -0
- package/dist/corner-shape-core.js.map +1 -0
- package/dist/crypto-core.d.ts +57 -0
- package/dist/crypto-core.d.ts.map +1 -0
- package/dist/crypto-core.js +128 -0
- package/dist/crypto-core.js.map +1 -0
- package/dist/dataviz.d.ts +436 -0
- package/dist/dataviz.d.ts.map +1 -0
- package/dist/dataviz.js +956 -0
- package/dist/dataviz.js.map +1 -0
- package/dist/debug.d.ts +293 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/debug.js +767 -0
- package/dist/debug.js.map +1 -0
- package/dist/device-ownership.d.ts +50 -0
- package/dist/device-ownership.d.ts.map +1 -0
- package/dist/device-ownership.js +105 -0
- package/dist/device-ownership.js.map +1 -0
- package/dist/effects.d.ts +86 -0
- package/dist/effects.d.ts.map +1 -0
- package/dist/effects.js +98 -0
- package/dist/effects.js.map +1 -0
- package/dist/element.d.ts +108 -0
- package/dist/element.d.ts.map +1 -0
- package/dist/element.js +63 -0
- package/dist/element.js.map +1 -0
- package/dist/file-watch.d.ts +16 -0
- package/dist/file-watch.d.ts.map +1 -0
- package/dist/file-watch.js +49 -0
- package/dist/file-watch.js.map +1 -0
- package/dist/filepaths.d.ts +72 -0
- package/dist/filepaths.d.ts.map +1 -0
- package/dist/filepaths.js +271 -0
- package/dist/filepaths.js.map +1 -0
- package/dist/film.d.ts +264 -0
- package/dist/film.d.ts.map +1 -0
- package/dist/film.js +313 -0
- package/dist/film.js.map +1 -0
- package/dist/fonts.d.ts +66 -0
- package/dist/fonts.d.ts.map +1 -0
- package/dist/fonts.js +135 -0
- package/dist/fonts.js.map +1 -0
- package/dist/forms.d.ts +191 -0
- package/dist/forms.d.ts.map +1 -0
- package/dist/forms.js +663 -0
- package/dist/forms.js.map +1 -0
- package/dist/geo.d.ts +289 -0
- package/dist/geo.d.ts.map +1 -0
- package/dist/geo.js +460 -0
- package/dist/geo.js.map +1 -0
- package/dist/handler-announce.d.ts +46 -0
- package/dist/handler-announce.d.ts.map +1 -0
- package/dist/handler-announce.js +96 -0
- package/dist/handler-announce.js.map +1 -0
- package/dist/handoff.d.ts +71 -0
- package/dist/handoff.d.ts.map +1 -0
- package/dist/handoff.js +250 -0
- package/dist/handoff.js.map +1 -0
- package/dist/identity-durability.d.ts +76 -0
- package/dist/identity-durability.d.ts.map +1 -0
- package/dist/identity-durability.js +150 -0
- package/dist/identity-durability.js.map +1 -0
- package/dist/image-core.d.ts +240 -0
- package/dist/image-core.d.ts.map +1 -0
- package/dist/image-core.js +618 -0
- package/dist/image-core.js.map +1 -0
- package/dist/image-schemes.d.ts +10 -0
- package/dist/image-schemes.d.ts.map +1 -0
- package/dist/image-schemes.js +28 -0
- package/dist/image-schemes.js.map +1 -0
- package/dist/index.d.ts +143 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +299 -0
- package/dist/index.js.map +1 -0
- package/dist/ink-core.d.ts +53 -0
- package/dist/ink-core.d.ts.map +1 -0
- package/dist/ink-core.js +119 -0
- package/dist/ink-core.js.map +1 -0
- package/dist/input.d.ts +148 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +358 -0
- package/dist/input.js.map +1 -0
- package/dist/integrity.d.ts +63 -0
- package/dist/integrity.d.ts.map +1 -0
- package/dist/integrity.js +150 -0
- package/dist/integrity.js.map +1 -0
- package/dist/intents.d.ts +95 -0
- package/dist/intents.d.ts.map +1 -0
- package/dist/intents.js +282 -0
- package/dist/intents.js.map +1 -0
- package/dist/interpolate-core.d.ts +37 -0
- package/dist/interpolate-core.d.ts.map +1 -0
- package/dist/interpolate-core.js +443 -0
- package/dist/interpolate-core.js.map +1 -0
- package/dist/jse/color.d.ts +12 -0
- package/dist/jse/color.d.ts.map +1 -0
- package/dist/jse/color.js +196 -0
- package/dist/jse/color.js.map +1 -0
- package/dist/jse/core.d.ts +54 -0
- package/dist/jse/core.d.ts.map +1 -0
- package/dist/jse/core.js +1519 -0
- package/dist/jse/core.js.map +1 -0
- package/dist/jse/dispatch.d.ts +28 -0
- package/dist/jse/dispatch.d.ts.map +1 -0
- package/dist/jse/dispatch.js +116 -0
- package/dist/jse/dispatch.js.map +1 -0
- package/dist/jse/highlight-grammar.d.ts +15 -0
- package/dist/jse/highlight-grammar.d.ts.map +1 -0
- package/dist/jse/highlight-grammar.js +161 -0
- package/dist/jse/highlight-grammar.js.map +1 -0
- package/dist/jse/highlight-grammars.generated.d.ts +2 -0
- package/dist/jse/highlight-grammars.generated.d.ts.map +1 -0
- package/dist/jse/highlight-grammars.generated.js +4 -0
- package/dist/jse/highlight-grammars.generated.js.map +1 -0
- package/dist/jse/highlight.d.ts +37 -0
- package/dist/jse/highlight.d.ts.map +1 -0
- package/dist/jse/highlight.js +323 -0
- package/dist/jse/highlight.js.map +1 -0
- package/dist/jse/jse.d.ts +674 -0
- package/dist/jse/jse.d.ts.map +1 -0
- package/dist/jse/jse.js +5841 -0
- package/dist/jse/jse.js.map +1 -0
- package/dist/jse/pathmatch.d.ts +10 -0
- package/dist/jse/pathmatch.d.ts.map +1 -0
- package/dist/jse/pathmatch.js +73 -0
- package/dist/jse/pathmatch.js.map +1 -0
- package/dist/jse/regex.d.ts +33 -0
- package/dist/jse/regex.d.ts.map +1 -0
- package/dist/jse/regex.js +375 -0
- package/dist/jse/regex.js.map +1 -0
- package/dist/jse/stdlib.d.ts +8 -0
- package/dist/jse/stdlib.d.ts.map +1 -0
- package/dist/jse/stdlib.js +765 -0
- package/dist/jse/stdlib.js.map +1 -0
- package/dist/jse/tokens.d.ts +102 -0
- package/dist/jse/tokens.d.ts.map +1 -0
- package/dist/jse/tokens.js +982 -0
- package/dist/jse/tokens.js.map +1 -0
- package/dist/jse/values.d.ts +206 -0
- package/dist/jse/values.d.ts.map +1 -0
- package/dist/jse/values.js +846 -0
- package/dist/jse/values.js.map +1 -0
- package/dist/keyboard.d.ts +196 -0
- package/dist/keyboard.d.ts.map +1 -0
- package/dist/keyboard.js +186 -0
- package/dist/keyboard.js.map +1 -0
- package/dist/label-choices.d.ts +3 -0
- package/dist/label-choices.d.ts.map +1 -0
- package/dist/label-choices.js +168 -0
- package/dist/label-choices.js.map +1 -0
- package/dist/language.d.ts +33 -0
- package/dist/language.d.ts.map +1 -0
- package/dist/language.js +50 -0
- package/dist/language.js.map +1 -0
- package/dist/length-units.d.ts +30 -0
- package/dist/length-units.d.ts.map +1 -0
- package/dist/length-units.js +83 -0
- package/dist/length-units.js.map +1 -0
- package/dist/lightsensor.d.ts +48 -0
- package/dist/lightsensor.d.ts.map +1 -0
- package/dist/lightsensor.js +97 -0
- package/dist/lightsensor.js.map +1 -0
- package/dist/link-refresh.d.ts +27 -0
- package/dist/link-refresh.d.ts.map +1 -0
- package/dist/link-refresh.js +166 -0
- package/dist/link-refresh.js.map +1 -0
- package/dist/link.d.ts +57 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +333 -0
- package/dist/link.js.map +1 -0
- package/dist/linkpreview.d.ts +114 -0
- package/dist/linkpreview.d.ts.map +1 -0
- package/dist/linkpreview.js +439 -0
- package/dist/linkpreview.js.map +1 -0
- package/dist/list-presence.d.ts +32 -0
- package/dist/list-presence.d.ts.map +1 -0
- package/dist/list-presence.js +48 -0
- package/dist/list-presence.js.map +1 -0
- package/dist/live-stream.d.ts +27 -0
- package/dist/live-stream.d.ts.map +1 -0
- package/dist/live-stream.js +274 -0
- package/dist/live-stream.js.map +1 -0
- package/dist/livelogs.d.ts +134 -0
- package/dist/livelogs.d.ts.map +1 -0
- package/dist/livelogs.js +409 -0
- package/dist/livelogs.js.map +1 -0
- package/dist/logs.d.ts +80 -0
- package/dist/logs.d.ts.map +1 -0
- package/dist/logs.js +206 -0
- package/dist/logs.js.map +1 -0
- package/dist/mcp/apps.d.ts +82 -0
- package/dist/mcp/apps.d.ts.map +1 -0
- package/dist/mcp/apps.js +219 -0
- package/dist/mcp/apps.js.map +1 -0
- package/dist/mcp/entities.d.ts +25 -0
- package/dist/mcp/entities.d.ts.map +1 -0
- package/dist/mcp/entities.js +71 -0
- package/dist/mcp/entities.js.map +1 -0
- package/dist/mcp/result.d.ts +73 -0
- package/dist/mcp/result.d.ts.map +1 -0
- package/dist/mcp/result.js +119 -0
- package/dist/mcp/result.js.map +1 -0
- package/dist/mcp/webmcp.d.ts +162 -0
- package/dist/mcp/webmcp.d.ts.map +1 -0
- package/dist/mcp/webmcp.js +214 -0
- package/dist/mcp/webmcp.js.map +1 -0
- package/dist/mcp.d.ts +5 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +14 -0
- package/dist/mcp.js.map +1 -0
- package/dist/media-core.d.ts +191 -0
- package/dist/media-core.d.ts.map +1 -0
- package/dist/media-core.js +446 -0
- package/dist/media-core.js.map +1 -0
- package/dist/media-timeline-core.d.ts +94 -0
- package/dist/media-timeline-core.d.ts.map +1 -0
- package/dist/media-timeline-core.js +620 -0
- package/dist/media-timeline-core.js.map +1 -0
- package/dist/message.d.ts +42 -0
- package/dist/message.d.ts.map +1 -0
- package/dist/message.js +582 -0
- package/dist/message.js.map +1 -0
- package/dist/missing-element.d.ts +29 -0
- package/dist/missing-element.d.ts.map +1 -0
- package/dist/missing-element.js +76 -0
- package/dist/missing-element.js.map +1 -0
- package/dist/motion-core.d.ts +160 -0
- package/dist/motion-core.d.ts.map +1 -0
- package/dist/motion-core.js +752 -0
- package/dist/motion-core.js.map +1 -0
- package/dist/motion-pose.d.ts +65 -0
- package/dist/motion-pose.d.ts.map +1 -0
- package/dist/motion-pose.js +143 -0
- package/dist/motion-pose.js.map +1 -0
- package/dist/motion.d.ts +132 -0
- package/dist/motion.d.ts.map +1 -0
- package/dist/motion.js +260 -0
- package/dist/motion.js.map +1 -0
- package/dist/mount-core.d.ts +203 -0
- package/dist/mount-core.d.ts.map +1 -0
- package/dist/mount-core.js +437 -0
- package/dist/mount-core.js.map +1 -0
- package/dist/net-core.d.ts +110 -0
- package/dist/net-core.d.ts.map +1 -0
- package/dist/net-core.js +225 -0
- package/dist/net-core.js.map +1 -0
- package/dist/notify.d.ts +399 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +964 -0
- package/dist/notify.js.map +1 -0
- package/dist/orientation-binding.d.ts +39 -0
- package/dist/orientation-binding.d.ts.map +1 -0
- package/dist/orientation-binding.js +64 -0
- package/dist/orientation-binding.js.map +1 -0
- package/dist/orientation.d.ts +55 -0
- package/dist/orientation.d.ts.map +1 -0
- package/dist/orientation.js +89 -0
- package/dist/orientation.js.map +1 -0
- package/dist/ota.d.ts +52 -0
- package/dist/ota.d.ts.map +1 -0
- package/dist/ota.js +122 -0
- package/dist/ota.js.map +1 -0
- package/dist/passkeys.d.ts +91 -0
- package/dist/passkeys.d.ts.map +1 -0
- package/dist/passkeys.js +307 -0
- package/dist/passkeys.js.map +1 -0
- package/dist/payment.d.ts +85 -0
- package/dist/payment.d.ts.map +1 -0
- package/dist/payment.js +270 -0
- package/dist/payment.js.map +1 -0
- package/dist/pending-presenter.d.ts +31 -0
- package/dist/pending-presenter.d.ts.map +1 -0
- package/dist/pending-presenter.js +119 -0
- package/dist/pending-presenter.js.map +1 -0
- package/dist/permission-core.d.ts +59 -0
- package/dist/permission-core.d.ts.map +1 -0
- package/dist/permission-core.js +102 -0
- package/dist/permission-core.js.map +1 -0
- package/dist/persist.d.ts +169 -0
- package/dist/persist.d.ts.map +1 -0
- package/dist/persist.js +361 -0
- package/dist/persist.js.map +1 -0
- package/dist/phase-plan.d.ts +114 -0
- package/dist/phase-plan.d.ts.map +1 -0
- package/dist/phase-plan.js +837 -0
- package/dist/phase-plan.js.map +1 -0
- package/dist/playback-core.d.ts +64 -0
- package/dist/playback-core.d.ts.map +1 -0
- package/dist/playback-core.js +176 -0
- package/dist/playback-core.js.map +1 -0
- package/dist/player-sources.d.ts +12 -0
- package/dist/player-sources.d.ts.map +1 -0
- package/dist/player-sources.js +44 -0
- package/dist/player-sources.js.map +1 -0
- package/dist/proxy-denylist.d.ts +11 -0
- package/dist/proxy-denylist.d.ts.map +1 -0
- package/dist/proxy-denylist.js +44 -0
- package/dist/proxy-denylist.js.map +1 -0
- package/dist/public-config.d.ts +20 -0
- package/dist/public-config.d.ts.map +1 -0
- package/dist/public-config.js +109 -0
- package/dist/public-config.js.map +1 -0
- package/dist/qoe-core.d.ts +72 -0
- package/dist/qoe-core.d.ts.map +1 -0
- package/dist/qoe-core.js +113 -0
- package/dist/qoe-core.js.map +1 -0
- package/dist/reactive-request.d.ts +80 -0
- package/dist/reactive-request.d.ts.map +1 -0
- package/dist/reactive-request.js +192 -0
- package/dist/reactive-request.js.map +1 -0
- package/dist/read-cache.d.ts +129 -0
- package/dist/read-cache.d.ts.map +1 -0
- package/dist/read-cache.js +566 -0
- package/dist/read-cache.js.map +1 -0
- package/dist/recorder-core.d.ts +57 -0
- package/dist/recorder-core.d.ts.map +1 -0
- package/dist/recorder-core.js +136 -0
- package/dist/recorder-core.js.map +1 -0
- package/dist/ref.d.ts +41 -0
- package/dist/ref.d.ts.map +1 -0
- package/dist/ref.js +98 -0
- package/dist/ref.js.map +1 -0
- package/dist/refusal.d.ts +82 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +218 -0
- package/dist/refusal.js.map +1 -0
- package/dist/region-insets.d.ts +61 -0
- package/dist/region-insets.d.ts.map +1 -0
- package/dist/region-insets.js +67 -0
- package/dist/region-insets.js.map +1 -0
- package/dist/rive-core.d.ts +323 -0
- package/dist/rive-core.d.ts.map +1 -0
- package/dist/rive-core.js +677 -0
- package/dist/rive-core.js.map +1 -0
- package/dist/runner.d.ts +595 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +4094 -0
- package/dist/runner.js.map +1 -0
- package/dist/scene/a11y.d.ts +11 -0
- package/dist/scene/a11y.d.ts.map +1 -0
- package/dist/scene/a11y.js +67 -0
- package/dist/scene/a11y.js.map +1 -0
- package/dist/scene/anim.d.ts +149 -0
- package/dist/scene/anim.d.ts.map +1 -0
- package/dist/scene/anim.js +396 -0
- package/dist/scene/anim.js.map +1 -0
- package/dist/scene/bind.d.ts +33 -0
- package/dist/scene/bind.d.ts.map +1 -0
- package/dist/scene/bind.js +66 -0
- package/dist/scene/bind.js.map +1 -0
- package/dist/scene/collide.d.ts +56 -0
- package/dist/scene/collide.d.ts.map +1 -0
- package/dist/scene/collide.js +146 -0
- package/dist/scene/collide.js.map +1 -0
- package/dist/scene/frame.d.ts +22 -0
- package/dist/scene/frame.d.ts.map +1 -0
- package/dist/scene/frame.js +57 -0
- package/dist/scene/frame.js.map +1 -0
- package/dist/scene/gltf.d.ts +79 -0
- package/dist/scene/gltf.d.ts.map +1 -0
- package/dist/scene/gltf.js +409 -0
- package/dist/scene/gltf.js.map +1 -0
- package/dist/scene/ir.d.ts +293 -0
- package/dist/scene/ir.d.ts.map +1 -0
- package/dist/scene/ir.js +692 -0
- package/dist/scene/ir.js.map +1 -0
- package/dist/scene/math.d.ts +50 -0
- package/dist/scene/math.d.ts.map +1 -0
- package/dist/scene/math.js +180 -0
- package/dist/scene/math.js.map +1 -0
- package/dist/scene/orbit.d.ts +19 -0
- package/dist/scene/orbit.d.ts.map +1 -0
- package/dist/scene/orbit.js +60 -0
- package/dist/scene/orbit.js.map +1 -0
- package/dist/scene/physics.d.ts +228 -0
- package/dist/scene/physics.d.ts.map +1 -0
- package/dist/scene/physics.js +1500 -0
- package/dist/scene/physics.js.map +1 -0
- package/dist/scene/registry.d.ts +85 -0
- package/dist/scene/registry.d.ts.map +1 -0
- package/dist/scene/registry.js +75 -0
- package/dist/scene/registry.js.map +1 -0
- package/dist/scene/skin.d.ts +82 -0
- package/dist/scene/skin.d.ts.map +1 -0
- package/dist/scene/skin.js +351 -0
- package/dist/scene/skin.js.map +1 -0
- package/dist/scene/sprite.d.ts +36 -0
- package/dist/scene/sprite.d.ts.map +1 -0
- package/dist/scene/sprite.js +107 -0
- package/dist/scene/sprite.js.map +1 -0
- package/dist/scene/viewer.d.ts +96 -0
- package/dist/scene/viewer.d.ts.map +1 -0
- package/dist/scene/viewer.js +235 -0
- package/dist/scene/viewer.js.map +1 -0
- package/dist/scoped-slots.d.ts +9 -0
- package/dist/scoped-slots.d.ts.map +1 -0
- package/dist/scoped-slots.js +42 -0
- package/dist/scoped-slots.js.map +1 -0
- package/dist/screen.d.ts +109 -0
- package/dist/screen.d.ts.map +1 -0
- package/dist/screen.js +309 -0
- package/dist/screen.js.map +1 -0
- package/dist/scroll.d.ts +525 -0
- package/dist/scroll.d.ts.map +1 -0
- package/dist/scroll.js +1226 -0
- package/dist/scroll.js.map +1 -0
- package/dist/settings-plane.d.ts +58 -0
- package/dist/settings-plane.d.ts.map +1 -0
- package/dist/settings-plane.js +86 -0
- package/dist/settings-plane.js.map +1 -0
- package/dist/share-inbox.d.ts +56 -0
- package/dist/share-inbox.d.ts.map +1 -0
- package/dist/share-inbox.js +114 -0
- package/dist/share-inbox.js.map +1 -0
- package/dist/shared-transition.d.ts +152 -0
- package/dist/shared-transition.d.ts.map +1 -0
- package/dist/shared-transition.js +257 -0
- package/dist/shared-transition.js.map +1 -0
- package/dist/sheet-content-padding.d.ts +24 -0
- package/dist/sheet-content-padding.d.ts.map +1 -0
- package/dist/sheet-content-padding.js +32 -0
- package/dist/sheet-content-padding.js.map +1 -0
- package/dist/shot-devices.d.ts +36 -0
- package/dist/shot-devices.d.ts.map +1 -0
- package/dist/shot-devices.js +90 -0
- package/dist/shot-devices.js.map +1 -0
- package/dist/shot-guards.d.ts +100 -0
- package/dist/shot-guards.d.ts.map +1 -0
- package/dist/shot-guards.js +260 -0
- package/dist/shot-guards.js.map +1 -0
- package/dist/shot-scope.d.ts +140 -0
- package/dist/shot-scope.d.ts.map +1 -0
- package/dist/shot-scope.js +302 -0
- package/dist/shot-scope.js.map +1 -0
- package/dist/slot-partition.d.ts +9 -0
- package/dist/slot-partition.d.ts.map +1 -0
- package/dist/slot-partition.js +38 -0
- package/dist/slot-partition.js.map +1 -0
- package/dist/snackbar.d.ts +165 -0
- package/dist/snackbar.d.ts.map +1 -0
- package/dist/snackbar.js +220 -0
- package/dist/snackbar.js.map +1 -0
- package/dist/socket.d.ts +96 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +370 -0
- package/dist/socket.js.map +1 -0
- package/dist/spotlight.d.ts +77 -0
- package/dist/spotlight.d.ts.map +1 -0
- package/dist/spotlight.js +174 -0
- package/dist/spotlight.js.map +1 -0
- package/dist/state-primitive.d.ts +37 -0
- package/dist/state-primitive.d.ts.map +1 -0
- package/dist/state-primitive.js +91 -0
- package/dist/state-primitive.js.map +1 -0
- package/dist/store-query.d.ts +25 -0
- package/dist/store-query.d.ts.map +1 -0
- package/dist/store-query.js +88 -0
- package/dist/store-query.js.map +1 -0
- package/dist/store-value.d.ts +48 -0
- package/dist/store-value.d.ts.map +1 -0
- package/dist/store-value.js +264 -0
- package/dist/store-value.js.map +1 -0
- package/dist/store-versioning.d.ts +70 -0
- package/dist/store-versioning.d.ts.map +1 -0
- package/dist/store-versioning.js +188 -0
- package/dist/store-versioning.js.map +1 -0
- package/dist/store.d.ts +282 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +1144 -0
- package/dist/store.js.map +1 -0
- package/dist/strings.d.ts +141 -0
- package/dist/strings.d.ts.map +1 -0
- package/dist/strings.js +581 -0
- package/dist/strings.js.map +1 -0
- package/dist/telemetry.d.ts +95 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +255 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/transform-core.d.ts +228 -0
- package/dist/transform-core.d.ts.map +1 -0
- package/dist/transform-core.js +921 -0
- package/dist/transform-core.js.map +1 -0
- package/dist/transition-core.d.ts +58 -0
- package/dist/transition-core.d.ts.map +1 -0
- package/dist/transition-core.js +352 -0
- package/dist/transition-core.js.map +1 -0
- package/dist/trim-trailing.d.ts +3 -0
- package/dist/trim-trailing.d.ts.map +1 -0
- package/dist/trim-trailing.js +14 -0
- package/dist/trim-trailing.js.map +1 -0
- package/dist/upload.d.ts +51 -0
- package/dist/upload.d.ts.map +1 -0
- package/dist/upload.js +68 -0
- package/dist/upload.js.map +1 -0
- package/dist/vendor-face.d.ts +44 -0
- package/dist/vendor-face.d.ts.map +1 -0
- package/dist/vendor-face.js +80 -0
- package/dist/vendor-face.js.map +1 -0
- package/dist/vendor-session.d.ts +166 -0
- package/dist/vendor-session.d.ts.map +1 -0
- package/dist/vendor-session.js +423 -0
- package/dist/vendor-session.js.map +1 -0
- package/dist/vendor-surface.d.ts +290 -0
- package/dist/vendor-surface.d.ts.map +1 -0
- package/dist/vendor-surface.js +439 -0
- package/dist/vendor-surface.js.map +1 -0
- package/dist/version-rules.generated.d.ts +17 -0
- package/dist/version-rules.generated.d.ts.map +1 -0
- package/dist/version-rules.generated.js +99 -0
- package/dist/version-rules.generated.js.map +1 -0
- package/dist/view-transition-core.d.ts +99 -0
- package/dist/view-transition-core.d.ts.map +1 -0
- package/dist/view-transition-core.js +127 -0
- package/dist/view-transition-core.js.map +1 -0
- package/dist/view-transition-door.d.ts +26 -0
- package/dist/view-transition-door.d.ts.map +1 -0
- package/dist/view-transition-door.js +88 -0
- package/dist/view-transition-door.js.map +1 -0
- package/dist/window-identity.d.ts +3 -0
- package/dist/window-identity.d.ts.map +1 -0
- package/dist/window-identity.js +27 -0
- package/dist/window-identity.js.map +1 -0
- package/package.json +141 -2
|
@@ -0,0 +1,644 @@
|
|
|
1
|
+
//
|
|
2
|
+
// auth-proof.ts — THE AUTHENTICATION PROOF PURE CORE (A1,
|
|
3
|
+
// the launch design notes). Two folds, and a
|
|
4
|
+
// login is the one flow where a fail-open default is a compromise:
|
|
5
|
+
//
|
|
6
|
+
// 1. THE TRIGGER FOLD — `matchesConfiguredTrigger` / `isAllowedAuthorizationUrl`.
|
|
7
|
+
// LoginHelper decides on every main-frame navigation whether the URL about to load is a
|
|
8
|
+
// configured identity provider; a match cancels the app's own navigation and hands the
|
|
9
|
+
// URL to a web view that carries a provider-accepted user agent and SHARES the app's
|
|
10
|
+
// cookie jar. A raw string prefix therefore gives anyone who controls
|
|
11
|
+
// `idp.example.attacker.invalid` a login surface wearing the IdP's clothes. A configured
|
|
12
|
+
// prefix that parses as an absolute URL is pinned to its exact scheme, host and port and
|
|
13
|
+
// refuses userinfo; one that does not parse keeps raw-prefix behaviour, because
|
|
14
|
+
// deployments configure bare host fragments and silently dropping them disables their
|
|
15
|
+
// logins.
|
|
16
|
+
//
|
|
17
|
+
// 2. THE PROOF FOLD — PKCE (RFC 7636), `state` (RFC 6749 §10.12, RFC 9700 §2.1) and OIDC
|
|
18
|
+
// `nonce`. Which proofs a module owns for a given authorize URL (adopt what the caller
|
|
19
|
+
// wrote, mint what is missing), the exact URL it builds, and the verdict a returning
|
|
20
|
+
// callback earns. `unproven` is the compatibility floor — a flow this module never armed
|
|
21
|
+
// keeps the behaviour it has today, because refusing there breaks working logins to fix
|
|
22
|
+
// nothing. Everything else refuses, and a refusal never resolves and never echoes the
|
|
23
|
+
// received value back: that value is attacker-controlled and a message is a log line.
|
|
24
|
+
//
|
|
25
|
+
// The law is the corpus, OpenSource/Conformance/auth/{trigger,pkce}.json; the Kotlin twin is
|
|
26
|
+
// :core AuthProof.kt and the Swift twin is Engine/Swift/AuthProof.swift.
|
|
27
|
+
//
|
|
28
|
+
// NOTHING here hashes and nothing here draws entropy. RFC 7636's S256 is
|
|
29
|
+
// BASE64URL-ENCODE(SHA256(ASCII(verifier))): the SHA-256 half is the platform's job
|
|
30
|
+
// (CryptoKit / MessageDigest / WebCrypto), exactly as crypto-core.ts says, and the CSPRNG
|
|
31
|
+
// behind a minted value is the platform's too. What lives here is the half that has no
|
|
32
|
+
// platform answer and would therefore drift — an ABNF, an alphabet, a dropped padding
|
|
33
|
+
// character, a URL parse, and a verdict — which is also what makes a login proof testable
|
|
34
|
+
// without an identity provider.
|
|
35
|
+
//
|
|
36
|
+
// PURE by construction: no DOM, no URL, no RegExp on any security decision, no imports. The
|
|
37
|
+
// URL splitter is hand-rolled precisely BECAUSE three platform URL parsers disagree about
|
|
38
|
+
// userinfo, backslashes and percent-escaped hosts, and a security fold cannot be the union of
|
|
39
|
+
// three parsers' bugs.
|
|
40
|
+
//
|
|
41
|
+
function isDigit(ch) { return ch >= "0" && ch <= "9"; }
|
|
42
|
+
function isAlpha(ch) { return (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z"); }
|
|
43
|
+
/** Characters that must never appear inside an authority. A backslash is the whole reason this
|
|
44
|
+
* list exists: some parsers normalize `\` to `/`, some do not, and `https://idp.example\@evil`
|
|
45
|
+
* therefore means two different hosts on two renderers. Anything ambiguous is refused, never
|
|
46
|
+
* guessed — the cost of a false refusal here is a login that is not intercepted, which is the
|
|
47
|
+
* behaviour the navigation already had. */
|
|
48
|
+
function authorityIsClean(authority) {
|
|
49
|
+
for (const ch of authority) {
|
|
50
|
+
const c = ch.charCodeAt(0);
|
|
51
|
+
if (c <= 0x20 || c === 0x7f)
|
|
52
|
+
return false;
|
|
53
|
+
if (ch === "\\" || ch === "<" || ch === ">" || ch === '"' || ch === "^" ||
|
|
54
|
+
ch === "{" || ch === "}" || ch === "|" || ch === "`")
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
/** Split an absolute `scheme://authority…` URL into its origin, or null when it is not one or
|
|
60
|
+
* is not unambiguous. A percent escape in the host is refused rather than decoded: `%2e` is a
|
|
61
|
+
* dot to some parsers and a literal to others, and either answer is a lookalike host. */
|
|
62
|
+
export function splitOrigin(raw) {
|
|
63
|
+
const text = String(raw ?? "");
|
|
64
|
+
if (text.length === 0)
|
|
65
|
+
return null;
|
|
66
|
+
let i = 0;
|
|
67
|
+
if (!isAlpha(text[0]))
|
|
68
|
+
return null;
|
|
69
|
+
while (i < text.length) {
|
|
70
|
+
const ch = text[i];
|
|
71
|
+
if (ch === ":")
|
|
72
|
+
break;
|
|
73
|
+
if (!isAlpha(ch) && !isDigit(ch) && ch !== "+" && ch !== "-" && ch !== ".")
|
|
74
|
+
return null;
|
|
75
|
+
i += 1;
|
|
76
|
+
}
|
|
77
|
+
if (i >= text.length || text[i] !== ":")
|
|
78
|
+
return null;
|
|
79
|
+
const scheme = text.slice(0, i).toLowerCase();
|
|
80
|
+
if (!text.startsWith("://", i))
|
|
81
|
+
return null;
|
|
82
|
+
let end = i + 3;
|
|
83
|
+
while (end < text.length) {
|
|
84
|
+
const ch = text[end];
|
|
85
|
+
if (ch === "/" || ch === "?" || ch === "#")
|
|
86
|
+
break;
|
|
87
|
+
end += 1;
|
|
88
|
+
}
|
|
89
|
+
const authority = text.slice(i + 3, end);
|
|
90
|
+
if (!authorityIsClean(authority))
|
|
91
|
+
return null;
|
|
92
|
+
const at = authority.lastIndexOf("@");
|
|
93
|
+
const hasUserInfo = at >= 0;
|
|
94
|
+
const hostPort = hasUserInfo ? authority.slice(at + 1) : authority;
|
|
95
|
+
let host = hostPort;
|
|
96
|
+
let port = -1;
|
|
97
|
+
if (hostPort.startsWith("[")) {
|
|
98
|
+
const close = hostPort.indexOf("]");
|
|
99
|
+
if (close < 0)
|
|
100
|
+
return null;
|
|
101
|
+
host = hostPort.slice(0, close + 1);
|
|
102
|
+
const rest = hostPort.slice(close + 1);
|
|
103
|
+
if (rest.length > 0) {
|
|
104
|
+
if (rest[0] !== ":")
|
|
105
|
+
return null;
|
|
106
|
+
const digits = rest.slice(1);
|
|
107
|
+
if (digits.length === 0)
|
|
108
|
+
return null;
|
|
109
|
+
for (const ch of digits)
|
|
110
|
+
if (!isDigit(ch))
|
|
111
|
+
return null;
|
|
112
|
+
port = Number(digits);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
const colon = hostPort.indexOf(":");
|
|
117
|
+
if (colon >= 0) {
|
|
118
|
+
host = hostPort.slice(0, colon);
|
|
119
|
+
const digits = hostPort.slice(colon + 1);
|
|
120
|
+
if (digits.length === 0)
|
|
121
|
+
return null;
|
|
122
|
+
for (const ch of digits)
|
|
123
|
+
if (!isDigit(ch))
|
|
124
|
+
return null;
|
|
125
|
+
port = Number(digits);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (host.length === 0)
|
|
129
|
+
return null;
|
|
130
|
+
for (const ch of host)
|
|
131
|
+
if (ch === "%" || ch === ":" || ch === "@")
|
|
132
|
+
return null;
|
|
133
|
+
return { scheme, host: host.toLowerCase(), port, hasUserInfo };
|
|
134
|
+
}
|
|
135
|
+
/** Does this text CLAIM a URI scheme, whether or not it parses into an origin? The distinction
|
|
136
|
+
* matters exactly once, and it is a security decision: `https://` and `javascript:alert` both
|
|
137
|
+
* claim a scheme and neither yields an origin, so treating either as a legacy raw prefix would
|
|
138
|
+
* make the first match every https URL there is and the second hand a script URL to a login
|
|
139
|
+
* surface. A claim that does not parse is refused; only text that never claimed is legacy. */
|
|
140
|
+
export function claimsUriScheme(raw) {
|
|
141
|
+
const text = String(raw ?? "");
|
|
142
|
+
if (text.length === 0 || !isAlpha(text[0]))
|
|
143
|
+
return false;
|
|
144
|
+
let i = 0;
|
|
145
|
+
while (i < text.length) {
|
|
146
|
+
const ch = text[i];
|
|
147
|
+
if (ch === ":")
|
|
148
|
+
return true;
|
|
149
|
+
if (!isAlpha(ch) && !isDigit(ch) && ch !== "+" && ch !== "-" && ch !== ".")
|
|
150
|
+
return false;
|
|
151
|
+
i += 1;
|
|
152
|
+
}
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
/** The port an origin comparison uses: the written one, else the scheme's default, else -1 so
|
|
156
|
+
* two custom-scheme origins still compare equal to each other. */
|
|
157
|
+
export function normalizedPort(origin) {
|
|
158
|
+
if (origin.port >= 0)
|
|
159
|
+
return origin.port;
|
|
160
|
+
if (origin.scheme === "https")
|
|
161
|
+
return 443;
|
|
162
|
+
if (origin.scheme === "http")
|
|
163
|
+
return 80;
|
|
164
|
+
return -1;
|
|
165
|
+
}
|
|
166
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
167
|
+
// 1 · THE TRIGGER FOLD — a configured login trigger is an origin, not a prefix
|
|
168
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
169
|
+
/** Does `candidate` belong to the identity provider configured as `configuredPrefix`?
|
|
170
|
+
*
|
|
171
|
+
* The raw prefix is NECESSARY, never sufficient: it runs first so nothing that already failed
|
|
172
|
+
* the legacy test starts matching, and an absolute prefix then additionally pins scheme, host
|
|
173
|
+
* and port and refuses userinfo. Case is deliberately not folded on the prefix test — an
|
|
174
|
+
* uppercase host that fails the byte prefix simply is not intercepted, which is the direction
|
|
175
|
+
* that costs nothing. */
|
|
176
|
+
export function matchesConfiguredTrigger(candidate, configuredPrefix) {
|
|
177
|
+
const prefix = String(configuredPrefix ?? "");
|
|
178
|
+
const target = String(candidate ?? "");
|
|
179
|
+
if (prefix.length === 0 || !target.startsWith(prefix))
|
|
180
|
+
return false;
|
|
181
|
+
const trigger = splitOrigin(prefix);
|
|
182
|
+
if (trigger === null)
|
|
183
|
+
return !claimsUriScheme(prefix); // legacy non-URL prefix configuration
|
|
184
|
+
const actual = splitOrigin(target);
|
|
185
|
+
if (actual === null)
|
|
186
|
+
return false;
|
|
187
|
+
return actual.scheme === trigger.scheme &&
|
|
188
|
+
actual.host === trigger.host &&
|
|
189
|
+
normalizedPort(actual) === normalizedPort(trigger) &&
|
|
190
|
+
!actual.hasUserInfo;
|
|
191
|
+
}
|
|
192
|
+
/** May this URL be handed to a browser as an authorization START? Confidential transport, a
|
|
193
|
+
* real host, and no URL credentials: a `javascript:` / `intent:` / `file:` authorization start
|
|
194
|
+
* is not an authorization start, and userinfo in an authorization URL is a phishing primitive
|
|
195
|
+
* some browsers still render. */
|
|
196
|
+
export function isAllowedAuthorizationUrl(raw) {
|
|
197
|
+
const origin = splitOrigin(raw);
|
|
198
|
+
if (origin === null)
|
|
199
|
+
return false;
|
|
200
|
+
return origin.scheme === "https" && origin.host.length > 0 && !origin.hasUserInfo;
|
|
201
|
+
}
|
|
202
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
203
|
+
// 2 · THE PROOF FOLD — base64url, the verifier ABNF, the S256 challenge
|
|
204
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
205
|
+
/** RFC 7636 §4.1: code-verifier = 43*128unreserved. */
|
|
206
|
+
export const PKCE_VERIFIER_MIN_LENGTH = 43;
|
|
207
|
+
export const PKCE_VERIFIER_MAX_LENGTH = 128;
|
|
208
|
+
/** RFC 7636 §7.1: "a minimum of 256 bits of entropy… a 32-octet sequence". 32 octets
|
|
209
|
+
* base64url-encode to exactly 43 characters, which is also the ABNF floor — the two
|
|
210
|
+
* constraints meet, which is why 32 is the number and not a taste. */
|
|
211
|
+
export const PKCE_VERIFIER_ENTROPY_BYTES = 32;
|
|
212
|
+
/** `state` and `nonce` are unguessability tokens, not key material; 128 bits is the floor. */
|
|
213
|
+
export const AUTH_PROOF_ENTROPY_BYTES = 16;
|
|
214
|
+
/** The only challenge method this core will build. RFC 7636 §4.2 makes S256 mandatory to
|
|
215
|
+
* implement on the server, and `plain` exists only for clients that cannot hash — which
|
|
216
|
+
* describes no platform this runs on. */
|
|
217
|
+
export const PKCE_CHALLENGE_METHOD = "S256";
|
|
218
|
+
const B64URL = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
219
|
+
/** RFC 4648 §5 with "all trailing '=' characters omitted" (RFC 7636 §A). One encoder serves the
|
|
220
|
+
* verifier, the challenge, `state` and `nonce`, so a padding character can never appear in any
|
|
221
|
+
* of them. Octets are read unsigned so no runtime has to agree about signed bytes first. */
|
|
222
|
+
export function base64UrlNoPad(bytes) {
|
|
223
|
+
let out = "";
|
|
224
|
+
let i = 0;
|
|
225
|
+
const n = bytes.length;
|
|
226
|
+
while (i + 2 < n) {
|
|
227
|
+
const a = bytes[i] & 0xff, b = bytes[i + 1] & 0xff, c = bytes[i + 2] & 0xff;
|
|
228
|
+
out += B64URL[a >> 2] + B64URL[((a & 0x03) << 4) | (b >> 4)] +
|
|
229
|
+
B64URL[((b & 0x0f) << 2) | (c >> 6)] + B64URL[c & 0x3f];
|
|
230
|
+
i += 3;
|
|
231
|
+
}
|
|
232
|
+
const left = n - i;
|
|
233
|
+
if (left === 1) {
|
|
234
|
+
const a = bytes[i] & 0xff;
|
|
235
|
+
out += B64URL[a >> 2] + B64URL[(a & 0x03) << 4];
|
|
236
|
+
}
|
|
237
|
+
else if (left === 2) {
|
|
238
|
+
const a = bytes[i] & 0xff, b = bytes[i + 1] & 0xff;
|
|
239
|
+
out += B64URL[a >> 2] + B64URL[((a & 0x03) << 4) | (b >> 4)] + B64URL[(b & 0x0f) << 2];
|
|
240
|
+
}
|
|
241
|
+
return out;
|
|
242
|
+
}
|
|
243
|
+
/** RFC 4648 §5 the other way, to UTF-8 text. Refuses padding, refuses an alphabet outside
|
|
244
|
+
* base64url, refuses the impossible residue of one, and refuses bytes that are not UTF-8 —
|
|
245
|
+
* every one of those is a malformed token rather than something to salvage. */
|
|
246
|
+
export function base64UrlDecodeUtf8(segment) {
|
|
247
|
+
const text = String(segment ?? "");
|
|
248
|
+
if (text.length === 0 || text.length % 4 === 1)
|
|
249
|
+
return null;
|
|
250
|
+
const bytes = [];
|
|
251
|
+
let acc = 0;
|
|
252
|
+
let bits = 0;
|
|
253
|
+
for (const ch of text) {
|
|
254
|
+
const v = B64URL.indexOf(ch);
|
|
255
|
+
if (v < 0)
|
|
256
|
+
return null;
|
|
257
|
+
acc = (acc << 6) | v;
|
|
258
|
+
bits += 6;
|
|
259
|
+
if (bits >= 8) {
|
|
260
|
+
bits -= 8;
|
|
261
|
+
bytes.push((acc >> bits) & 0xff);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return utf8Decode(bytes);
|
|
265
|
+
}
|
|
266
|
+
/** A hand-rolled UTF-8 decode: `TextDecoder` substitutes U+FFFD for malformed input on the web
|
|
267
|
+
* and the JVM does something else again, so a shared fold cannot delegate. Overlong forms,
|
|
268
|
+
* surrogates and out-of-range scalars are refusals, not replacements. */
|
|
269
|
+
function utf8Decode(bytes) {
|
|
270
|
+
let out = "";
|
|
271
|
+
let i = 0;
|
|
272
|
+
while (i < bytes.length) {
|
|
273
|
+
const b0 = bytes[i];
|
|
274
|
+
let cp = 0;
|
|
275
|
+
let extra = 0;
|
|
276
|
+
let min = 0;
|
|
277
|
+
if (b0 < 0x80) {
|
|
278
|
+
cp = b0;
|
|
279
|
+
extra = 0;
|
|
280
|
+
min = 0;
|
|
281
|
+
}
|
|
282
|
+
else if (b0 >= 0xc2 && b0 <= 0xdf) {
|
|
283
|
+
cp = b0 & 0x1f;
|
|
284
|
+
extra = 1;
|
|
285
|
+
min = 0x80;
|
|
286
|
+
}
|
|
287
|
+
else if (b0 >= 0xe0 && b0 <= 0xef) {
|
|
288
|
+
cp = b0 & 0x0f;
|
|
289
|
+
extra = 2;
|
|
290
|
+
min = 0x800;
|
|
291
|
+
}
|
|
292
|
+
else if (b0 >= 0xf0 && b0 <= 0xf4) {
|
|
293
|
+
cp = b0 & 0x07;
|
|
294
|
+
extra = 3;
|
|
295
|
+
min = 0x10000;
|
|
296
|
+
}
|
|
297
|
+
else
|
|
298
|
+
return null;
|
|
299
|
+
if (i + extra >= bytes.length)
|
|
300
|
+
return null;
|
|
301
|
+
for (let k = 1; k <= extra; k += 1) {
|
|
302
|
+
const b = bytes[i + k];
|
|
303
|
+
if (b < 0x80 || b > 0xbf)
|
|
304
|
+
return null;
|
|
305
|
+
cp = (cp << 6) | (b & 0x3f);
|
|
306
|
+
}
|
|
307
|
+
if (cp < min)
|
|
308
|
+
return null;
|
|
309
|
+
if (cp > 0x10ffff)
|
|
310
|
+
return null;
|
|
311
|
+
if (cp >= 0xd800 && cp <= 0xdfff)
|
|
312
|
+
return null;
|
|
313
|
+
out += String.fromCodePoint(cp);
|
|
314
|
+
i += extra + 1;
|
|
315
|
+
}
|
|
316
|
+
return out;
|
|
317
|
+
}
|
|
318
|
+
/** RFC 7636 §4.1 verbatim: 43*128 of ALPHA / DIGIT / "-" / "." / "_" / "~". No trimming, no
|
|
319
|
+
* case folding — a verifier is compared byte for byte at the token endpoint, so a fold that
|
|
320
|
+
* accepts what the server will not is a login that dies there with a useless message. */
|
|
321
|
+
export function isCodeVerifier(value) {
|
|
322
|
+
const text = String(value ?? "");
|
|
323
|
+
if (text.length < PKCE_VERIFIER_MIN_LENGTH || text.length > PKCE_VERIFIER_MAX_LENGTH)
|
|
324
|
+
return false;
|
|
325
|
+
for (const ch of text) {
|
|
326
|
+
if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z") || (ch >= "0" && ch <= "9"))
|
|
327
|
+
continue;
|
|
328
|
+
if (ch === "-" || ch === "." || ch === "_" || ch === "~")
|
|
329
|
+
continue;
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
return true;
|
|
333
|
+
}
|
|
334
|
+
/** A verifier from platform entropy, or null when there is not enough of it. Expressed as a
|
|
335
|
+
* refusal rather than a short value on purpose: a silently-padded verifier is a weak one that
|
|
336
|
+
* still works, which is the failure nobody finds. */
|
|
337
|
+
export function codeVerifierFromEntropy(bytes) {
|
|
338
|
+
if (bytes.length < PKCE_VERIFIER_ENTROPY_BYTES)
|
|
339
|
+
return null;
|
|
340
|
+
return base64UrlNoPad(bytes);
|
|
341
|
+
}
|
|
342
|
+
/** A `state` or `nonce` from platform entropy, or null when there is not enough of it. */
|
|
343
|
+
export function opaqueProof(bytes) {
|
|
344
|
+
if (bytes.length < AUTH_PROOF_ENTROPY_BYTES)
|
|
345
|
+
return null;
|
|
346
|
+
return base64UrlNoPad(bytes);
|
|
347
|
+
}
|
|
348
|
+
/** RFC 7636 §4.2: code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier))). The digest
|
|
349
|
+
* arrives already computed, because hashing is the platform's. A digest of any other length is
|
|
350
|
+
* refused rather than encoded: a short one produces a challenge the server accepts and no
|
|
351
|
+
* verifier can ever satisfy, which strands every login on that build. */
|
|
352
|
+
export function codeChallengeS256(digest) {
|
|
353
|
+
if (digest.length !== 32)
|
|
354
|
+
return null;
|
|
355
|
+
return base64UrlNoPad(digest);
|
|
356
|
+
}
|
|
357
|
+
/** Every proof comparison runs through here. No early return on the first differing byte and
|
|
358
|
+
* none on a length difference: both lengths and every position fold into one accumulator, so a
|
|
359
|
+
* wrong `state` costs the same time as a right one. */
|
|
360
|
+
export function constantTimeEquals(a, b) {
|
|
361
|
+
const left = String(a ?? "");
|
|
362
|
+
const right = String(b ?? "");
|
|
363
|
+
let diff = left.length ^ right.length;
|
|
364
|
+
const span = left.length > right.length ? left.length : right.length;
|
|
365
|
+
for (let i = 0; i < span; i += 1) {
|
|
366
|
+
const l = i < left.length ? left.charCodeAt(i) : 0;
|
|
367
|
+
const r = i < right.length ? right.charCodeAt(i) : 0;
|
|
368
|
+
diff |= l ^ r;
|
|
369
|
+
}
|
|
370
|
+
return diff === 0;
|
|
371
|
+
}
|
|
372
|
+
/** Percent-decode a query value the way a form-encoded query is read: `+` is a space, `%XX` is
|
|
373
|
+
* a byte, an incomplete escape is left literal rather than dropped. The authorization server
|
|
374
|
+
* echoes `state` back through this same encoding, so adopting it decoded is what makes the
|
|
375
|
+
* later comparison compare the same two things. */
|
|
376
|
+
function decodeQueryValue(raw) {
|
|
377
|
+
const bytes = [];
|
|
378
|
+
let i = 0;
|
|
379
|
+
while (i < raw.length) {
|
|
380
|
+
const ch = raw[i];
|
|
381
|
+
if (ch === "+") {
|
|
382
|
+
bytes.push(0x20);
|
|
383
|
+
i += 1;
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
if (ch === "%" && i + 2 < raw.length) {
|
|
387
|
+
const hi = hexValue(raw[i + 1]);
|
|
388
|
+
const lo = hexValue(raw[i + 2]);
|
|
389
|
+
if (hi >= 0 && lo >= 0) {
|
|
390
|
+
bytes.push((hi << 4) | lo);
|
|
391
|
+
i += 3;
|
|
392
|
+
continue;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
for (const b of utf8Encode(ch))
|
|
396
|
+
bytes.push(b);
|
|
397
|
+
i += 1;
|
|
398
|
+
}
|
|
399
|
+
return utf8Decode(bytes) ?? "";
|
|
400
|
+
}
|
|
401
|
+
function hexValue(ch) {
|
|
402
|
+
if (ch >= "0" && ch <= "9")
|
|
403
|
+
return ch.charCodeAt(0) - 48;
|
|
404
|
+
if (ch >= "a" && ch <= "f")
|
|
405
|
+
return ch.charCodeAt(0) - 87;
|
|
406
|
+
if (ch >= "A" && ch <= "F")
|
|
407
|
+
return ch.charCodeAt(0) - 55;
|
|
408
|
+
return -1;
|
|
409
|
+
}
|
|
410
|
+
function utf8Encode(text) {
|
|
411
|
+
const out = [];
|
|
412
|
+
for (const ch of text) {
|
|
413
|
+
const cp = ch.codePointAt(0);
|
|
414
|
+
if (cp < 0x80)
|
|
415
|
+
out.push(cp);
|
|
416
|
+
else if (cp < 0x800)
|
|
417
|
+
out.push(0xc0 | (cp >> 6), 0x80 | (cp & 0x3f));
|
|
418
|
+
else if (cp < 0x10000)
|
|
419
|
+
out.push(0xe0 | (cp >> 12), 0x80 | ((cp >> 6) & 0x3f), 0x80 | (cp & 0x3f));
|
|
420
|
+
else
|
|
421
|
+
out.push(0xf0 | (cp >> 18), 0x80 | ((cp >> 12) & 0x3f), 0x80 | ((cp >> 6) & 0x3f), 0x80 | (cp & 0x3f));
|
|
422
|
+
}
|
|
423
|
+
return out;
|
|
424
|
+
}
|
|
425
|
+
/** The query string of a URL: everything between the first `?` and the first `#` after it. */
|
|
426
|
+
function queryOf(url) {
|
|
427
|
+
const hash = url.indexOf("#");
|
|
428
|
+
const stop = hash < 0 ? url.length : hash;
|
|
429
|
+
const q = url.indexOf("?");
|
|
430
|
+
if (q < 0 || q > stop)
|
|
431
|
+
return "";
|
|
432
|
+
return url.slice(q + 1, stop);
|
|
433
|
+
}
|
|
434
|
+
/** The first value of `name` in a form-encoded query, decoded, or null. An empty value is null:
|
|
435
|
+
* `state=` is not a state, it is a caller who built the parameter and forgot the value. */
|
|
436
|
+
function queryValue(query, name) {
|
|
437
|
+
let i = 0;
|
|
438
|
+
while (i <= query.length) {
|
|
439
|
+
let end = query.indexOf("&", i);
|
|
440
|
+
if (end < 0)
|
|
441
|
+
end = query.length;
|
|
442
|
+
const pair = query.slice(i, end);
|
|
443
|
+
i = end + 1;
|
|
444
|
+
if (pair.length === 0)
|
|
445
|
+
continue;
|
|
446
|
+
const eq = pair.indexOf("=");
|
|
447
|
+
const key = decodeQueryValue(eq < 0 ? pair : pair.slice(0, eq));
|
|
448
|
+
if (key !== name)
|
|
449
|
+
continue;
|
|
450
|
+
if (eq < 0)
|
|
451
|
+
return null;
|
|
452
|
+
const value = decodeQueryValue(pair.slice(eq + 1));
|
|
453
|
+
return value.length === 0 ? null : value;
|
|
454
|
+
}
|
|
455
|
+
return null;
|
|
456
|
+
}
|
|
457
|
+
/** Does a space-separated `response_type` carry `token` (bare) as a token? */
|
|
458
|
+
function responseTypeHas(responseType, token) {
|
|
459
|
+
if (responseType === null)
|
|
460
|
+
return false;
|
|
461
|
+
for (const part of responseType.split(" ")) {
|
|
462
|
+
if (part.toLowerCase() === token)
|
|
463
|
+
return true;
|
|
464
|
+
}
|
|
465
|
+
return false;
|
|
466
|
+
}
|
|
467
|
+
/** Which proofs this module owns for `authorizeUrl`.
|
|
468
|
+
*
|
|
469
|
+
* A parameter already in the URL is ADOPTED — the caller built it, the module verifies what
|
|
470
|
+
* comes back — and one that is absent is MINTED. That is what makes this non-breaking: every
|
|
471
|
+
* integration shipped against the old contract keeps the exact authorize URL it built, plus a
|
|
472
|
+
* `state` it did not have to write.
|
|
473
|
+
*
|
|
474
|
+
* `nonce` is owned only for an OIDC request (`scope` contains `openid`, or `response_type`
|
|
475
|
+
* contains `id_token`): minting one onto a plain OAuth request is noise, and RFC 9700 §2.1
|
|
476
|
+
* says PKCE carries the same protection.
|
|
477
|
+
*
|
|
478
|
+
* PKCE is ON BY DEFAULT in Core/Auth/OAuth (RFC 9700 §2.1.1, RFC 8252 §8.1): the package passes
|
|
479
|
+
* `wantsPkce` true for a code flow without a `code_challenge` of its own. This fold only applies
|
|
480
|
+
* that answer: a challenge the caller (or its backend) already wrote is kept, and a `wantsPkce`
|
|
481
|
+
* request that cannot take one is refused. A module-minted verifier is one the module must
|
|
482
|
+
* redeem, so a code the caller's server exchanges carries the server's own challenge. */
|
|
483
|
+
export function planAuthorizeProofs(authorizeUrl, wantsPkce) {
|
|
484
|
+
const query = queryOf(String(authorizeUrl ?? ""));
|
|
485
|
+
const state = queryValue(query, "state");
|
|
486
|
+
const nonce = queryValue(query, "nonce");
|
|
487
|
+
const challenge = queryValue(query, "code_challenge");
|
|
488
|
+
const responseType = queryValue(query, "response_type");
|
|
489
|
+
const scope = queryValue(query, "scope");
|
|
490
|
+
const isCodeFlow = responseTypeHas(responseType, "code");
|
|
491
|
+
if (wantsPkce && (challenge !== null || !isCodeFlow)) {
|
|
492
|
+
return {
|
|
493
|
+
refusal: "pkce_unsupported",
|
|
494
|
+
mintState: false, adoptedState: null, mintNonce: false, adoptedNonce: null, mintPkce: false,
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
const oidc = responseTypeHas(responseType, "id_token") ||
|
|
498
|
+
(scope !== null && scope.split(" ").some((s) => s.toLowerCase() === "openid"));
|
|
499
|
+
return {
|
|
500
|
+
refusal: null,
|
|
501
|
+
mintState: state === null,
|
|
502
|
+
adoptedState: state,
|
|
503
|
+
mintNonce: oidc && nonce === null,
|
|
504
|
+
adoptedNonce: nonce,
|
|
505
|
+
mintPkce: wantsPkce,
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
/** Percent-escape everything outside RFC 3986's unreserved set. Minted values are base64url and
|
|
509
|
+
* pass through untouched; the escaping exists so a value that came from somewhere else can
|
|
510
|
+
* never break out of its parameter. */
|
|
511
|
+
function encodeQueryValue(value) {
|
|
512
|
+
let out = "";
|
|
513
|
+
for (const b of utf8Encode(value)) {
|
|
514
|
+
const ch = String.fromCharCode(b);
|
|
515
|
+
if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z") || (ch >= "0" && ch <= "9") ||
|
|
516
|
+
ch === "-" || ch === "." || ch === "_" || ch === "~") {
|
|
517
|
+
out += ch;
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
out += "%" + b.toString(16).toUpperCase().padStart(2, "0");
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
return out;
|
|
524
|
+
}
|
|
525
|
+
/** The authorize URL with the minted parameters appended, in a fixed order so three runtimes
|
|
526
|
+
* build the same string. Appending, never rewriting: the caller's URL is reproduced byte for
|
|
527
|
+
* byte. A fragment stays last, because a query appended after a fragment is not a query. */
|
|
528
|
+
export function applyAuthorizeProofs(authorizeUrl, minted) {
|
|
529
|
+
const url = String(authorizeUrl ?? "");
|
|
530
|
+
const pairs = [];
|
|
531
|
+
if (minted.state !== undefined && minted.state !== null && minted.state.length > 0) {
|
|
532
|
+
pairs.push("state=" + encodeQueryValue(minted.state));
|
|
533
|
+
}
|
|
534
|
+
if (minted.nonce !== undefined && minted.nonce !== null && minted.nonce.length > 0) {
|
|
535
|
+
pairs.push("nonce=" + encodeQueryValue(minted.nonce));
|
|
536
|
+
}
|
|
537
|
+
if (minted.challenge !== undefined && minted.challenge !== null && minted.challenge.length > 0) {
|
|
538
|
+
pairs.push("code_challenge=" + encodeQueryValue(minted.challenge));
|
|
539
|
+
pairs.push("code_challenge_method=" + PKCE_CHALLENGE_METHOD);
|
|
540
|
+
}
|
|
541
|
+
if (pairs.length === 0)
|
|
542
|
+
return url;
|
|
543
|
+
const hash = url.indexOf("#");
|
|
544
|
+
const head = hash < 0 ? url : url.slice(0, hash);
|
|
545
|
+
const tail = hash < 0 ? "" : url.slice(hash);
|
|
546
|
+
const q = head.indexOf("?");
|
|
547
|
+
const joiner = q < 0 ? "?" : (head.endsWith("?") || head.endsWith("&") ? "" : "&");
|
|
548
|
+
return head + joiner + pairs.join("&") + tail;
|
|
549
|
+
}
|
|
550
|
+
/** The verdict a returning callback earns.
|
|
551
|
+
*
|
|
552
|
+
* `unproven` is the compatibility floor and is deliberately permissive: a cold start after the
|
|
553
|
+
* process died behind the browser, or a deep link that is not a callback at all, has no armed
|
|
554
|
+
* expectation, and refusing there would break working logins to fix nothing.
|
|
555
|
+
*
|
|
556
|
+
* `replayed` exists because clearing the expectation on success is not enough. A one-shot
|
|
557
|
+
* authorization code replayed a second later would otherwise land in the `unproven` arm and be
|
|
558
|
+
* delivered, which is the exact attack `state` is there to stop. */
|
|
559
|
+
export function verifyCallbackProofs(expectedState, consumedStates, receivedState, expectedNonce, idTokenNonce) {
|
|
560
|
+
const expected = expectedState === undefined || expectedState === null || expectedState.length === 0
|
|
561
|
+
? null : expectedState;
|
|
562
|
+
const received = receivedState === undefined || receivedState === null || receivedState.length === 0
|
|
563
|
+
? null : receivedState;
|
|
564
|
+
if (expected === null) {
|
|
565
|
+
if (received !== null) {
|
|
566
|
+
for (const seen of consumedStates) {
|
|
567
|
+
if (constantTimeEquals(seen, received))
|
|
568
|
+
return "replayed";
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
return "unproven";
|
|
572
|
+
}
|
|
573
|
+
if (received === null)
|
|
574
|
+
return "missing_state";
|
|
575
|
+
if (!constantTimeEquals(expected, received))
|
|
576
|
+
return "state_mismatch";
|
|
577
|
+
const wantNonce = expectedNonce === undefined || expectedNonce === null || expectedNonce.length === 0
|
|
578
|
+
? null : expectedNonce;
|
|
579
|
+
if (wantNonce === null)
|
|
580
|
+
return "ok";
|
|
581
|
+
// No id_token in this callback means the nonce rides the token exchange instead; an id_token
|
|
582
|
+
// that carries no nonce claim at all, against an armed nonce, is the injection this refuses.
|
|
583
|
+
if (idTokenNonce === undefined || idTokenNonce === null)
|
|
584
|
+
return "ok";
|
|
585
|
+
return constantTimeEquals(wantNonce, idTokenNonce) ? "ok" : "nonce_mismatch";
|
|
586
|
+
}
|
|
587
|
+
/** RFC 9207 §2.4: may this authorization response be processed, judged by its `iss`?
|
|
588
|
+
*
|
|
589
|
+
* `expectedIssuer` is the issuer the caller armed for this request (absent: nothing to judge,
|
|
590
|
+
* so true). A present `iss` must equal it by simple string comparison (RFC 3986 §6.2.1, which
|
|
591
|
+
* RFC 9207 §2.4 names), never normalized. An absent `iss` is accepted unless the caller said the
|
|
592
|
+
* server advertises `authorization_response_iss_parameter_supported`, in which case RFC 9207
|
|
593
|
+
* §2.4 makes it a MUST to reject. Error responses carry `iss` too (RFC 9207 §2), so the lanes
|
|
594
|
+
* run this before reading `error`. https://www.rfc-editor.org/rfc/rfc9207.html#section-2.4 */
|
|
595
|
+
export function issuerMatches(expectedIssuer, issuerRequired, receivedIssuer) {
|
|
596
|
+
const expected = expectedIssuer === undefined || expectedIssuer === null || expectedIssuer.length === 0
|
|
597
|
+
? null : expectedIssuer;
|
|
598
|
+
if (expected === null)
|
|
599
|
+
return true;
|
|
600
|
+
const received = receivedIssuer === undefined || receivedIssuer === null ? null : receivedIssuer;
|
|
601
|
+
if (received === null)
|
|
602
|
+
return !issuerRequired;
|
|
603
|
+
return constantTimeEquals(expected, received);
|
|
604
|
+
}
|
|
605
|
+
/** A JWT's middle segment, base64url-decoded to UTF-8, and nothing else. The signature is NOT
|
|
606
|
+
* checked and the result has exactly one use: REFUSING a callback whose nonce does not match.
|
|
607
|
+
* It never makes a token valid, and reading the claim out of the returned JSON is each
|
|
608
|
+
* renderer's own parser — which is why this stops at the decoded string. */
|
|
609
|
+
export function idTokenPayload(jwt) {
|
|
610
|
+
const text = String(jwt ?? "");
|
|
611
|
+
const first = text.indexOf(".");
|
|
612
|
+
if (first < 0)
|
|
613
|
+
return null;
|
|
614
|
+
const second = text.indexOf(".", first + 1);
|
|
615
|
+
if (second < 0)
|
|
616
|
+
return null;
|
|
617
|
+
if (text.indexOf(".", second + 1) >= 0)
|
|
618
|
+
return null;
|
|
619
|
+
return base64UrlDecodeUtf8(text.slice(first + 1, second));
|
|
620
|
+
}
|
|
621
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
622
|
+
// 5 · THE VERIFIER RELEASE BOUNDARY
|
|
623
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
624
|
+
/** May a module-minted verifier be sent to this token endpoint?
|
|
625
|
+
*
|
|
626
|
+
* The verifier is the one secret this core's consumer holds, and the token exchange is the
|
|
627
|
+
* only path that sends it anywhere. The destination is therefore not the caller's to choose
|
|
628
|
+
* freely: it must be an https origin the APP declared in config. An empty declaration allows
|
|
629
|
+
* nothing, so a build that never opted in cannot leak a verifier at all — the fail-closed
|
|
630
|
+
* direction, and the reason this is an allowlist rather than a shape check. */
|
|
631
|
+
export function tokenEndpointAllowed(tokenUrl, declaredOrigins) {
|
|
632
|
+
const target = splitOrigin(tokenUrl);
|
|
633
|
+
if (target === null || target.scheme !== "https" || target.hasUserInfo)
|
|
634
|
+
return false;
|
|
635
|
+
for (const declared of declaredOrigins) {
|
|
636
|
+
const origin = splitOrigin(declared);
|
|
637
|
+
if (origin === null || origin.scheme !== "https")
|
|
638
|
+
continue;
|
|
639
|
+
if (origin.host === target.host && normalizedPort(origin) === normalizedPort(target))
|
|
640
|
+
return true;
|
|
641
|
+
}
|
|
642
|
+
return false;
|
|
643
|
+
}
|
|
644
|
+
//# sourceMappingURL=auth-proof.js.map
|