@toa.io/extensions.exposition 1.0.0-alpha.300 → 1.0.0-alpha.302
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/components/exposition.octets/operations/delete.js +1 -3
- package/components/exposition.octets/operations/get.js +1 -3
- package/components/exposition.octets/operations/head.js +1 -3
- package/components/exposition.octets/operations/put.js +1 -3
- package/components/exposition.octets/package.json +2 -2
- package/components/identity.basic/source/add.ts +1 -1
- package/components/identity.basic/source/authenticate.ts +2 -2
- package/components/identity.basic/source/check.ts +1 -1
- package/components/identity.basic/source/delete.ts +1 -1
- package/components/identity.basic/source/incept.ts +2 -2
- package/components/identity.basic/source/info.ts +1 -1
- package/components/identity.basic/source/transit.ts +1 -1
- package/components/identity.basic/types/index.d.ts +1 -1
- package/components/identity.clients/source/describe.ts +2 -2
- package/components/identity.clients/source/lib/Context.ts +3 -4
- package/components/identity.clients/source/lib/canonical.ts +1 -1
- package/components/identity.clients/source/lib/cimd.ts +3 -3
- package/components/identity.clients/source/lib/index.ts +6 -6
- package/components/identity.clients/source/register.ts +2 -2
- package/components/identity.federation/source/authenticate.ts +2 -2
- package/components/identity.federation/source/create.ts +2 -2
- package/components/identity.federation/source/decode.ts +2 -2
- package/components/identity.federation/source/delete.ts +1 -1
- package/components/identity.federation/source/incept.ts +3 -3
- package/components/identity.federation/source/lib/Ctx.ts +2 -2
- package/components/identity.federation/source/lib/decode.ts +4 -4
- package/components/identity.federation/source/lib/discovery.ts +2 -2
- package/components/identity.federation/source/lib/exchange.ts +5 -5
- package/components/identity.federation/source/lib/index.ts +5 -5
- package/components/identity.federation/source/lib/principal.ts +1 -1
- package/components/identity.federation/source/lib/resolve.ts +5 -5
- package/components/identity.federation/source/list.ts +1 -1
- package/components/identity.federation/source/types/context.ts +2 -2
- package/components/identity.federation/source/types/index.ts +4 -4
- package/components/identity.grants/source/authorize.ts +2 -2
- package/components/identity.grants/source/exchange.ts +2 -2
- package/components/identity.grants/source/lib/code.ts +1 -1
- package/components/identity.grants/source/lib/index.ts +3 -3
- package/components/identity.grants/source/list.ts +1 -1
- package/components/identity.grants/source/revoke.ts +1 -1
- package/components/identity.grants/types/index.d.ts +2 -3
- package/components/identity.otp/source/authenticate.ts +1 -1
- package/components/identity.otp/source/issue.ts +1 -1
- package/components/identity.otp/source/lib/Context.ts +1 -1
- package/components/identity.otp/source/lib/index.ts +1 -1
- package/components/identity.passkeys/source/authenticate.ts +1 -1
- package/components/identity.passkeys/source/challenge.ts +2 -2
- package/components/identity.passkeys/source/create.ts +1 -1
- package/components/identity.passkeys/source/delete.ts +1 -1
- package/components/identity.passkeys/source/list.ts +2 -2
- package/components/identity.passkeys/source/types/Context.ts +3 -3
- package/components/identity.passkeys/source/types/index.ts +2 -2
- package/components/identity.passkeys/source/use.ts +1 -1
- package/components/identity.roles/manifest.toa.yaml +4 -8
- package/components/identity.roles/source/grant.ts +1 -1
- package/components/identity.roles/source/list.ts +1 -1
- package/components/identity.roles/source/principal.ts +2 -2
- package/components/identity.tokens/source/authenticate.ts +2 -2
- package/components/identity.tokens/source/decrypt.ts +2 -2
- package/components/identity.tokens/source/encrypt.ts +2 -2
- package/components/identity.tokens/source/issue.ts +1 -1
- package/components/identity.tokens/source/lib/index.ts +4 -4
- package/components/identity.tokens/source/revoke.ts +1 -1
- package/components/identity.tokens/types/index.d.ts +2 -8
- package/package.json +10 -10
- package/readme.md +2 -0
- package/transpiled/Branch.d.ts +2 -2
- package/transpiled/Composition.d.ts +1 -1
- package/transpiled/Context.d.ts +1 -1
- package/transpiled/Directive.d.ts +6 -6
- package/transpiled/Discovery/Explorer.d.ts +2 -2
- package/transpiled/Discovery/Site.d.ts +2 -2
- package/transpiled/Discovery/index.d.ts +3 -3
- package/transpiled/Discovery/tree.d.ts +3 -3
- package/transpiled/Discovery/trunk.d.ts +1 -1
- package/transpiled/Endpoint.d.ts +6 -6
- package/transpiled/Factory.d.ts +1 -1
- package/transpiled/Gateway.d.ts +6 -6
- package/transpiled/HTTP/Context.d.ts +4 -4
- package/transpiled/HTTP/Server.d.ts +6 -4
- package/transpiled/HTTP/Server.js.map +1 -1
- package/transpiled/HTTP/Timing.d.ts +1 -1
- package/transpiled/HTTP/address.d.ts +1 -1
- package/transpiled/HTTP/exceptions.d.ts +3 -0
- package/transpiled/HTTP/exceptions.js +5 -0
- package/transpiled/HTTP/exceptions.js.map +1 -1
- package/transpiled/HTTP/index.d.ts +6 -6
- package/transpiled/HTTP/messages.d.ts +2 -2
- package/transpiled/HTTP/messages.js +6 -1
- package/transpiled/HTTP/messages.js.map +1 -1
- package/transpiled/Interception.d.ts +2 -2
- package/transpiled/Introspection.d.ts +1 -1
- package/transpiled/MCP/Server.d.ts +2 -2
- package/transpiled/MCP/errors.d.ts +2 -2
- package/transpiled/MCP/index.d.ts +1 -1
- package/transpiled/MCP/schema.d.ts +2 -2
- package/transpiled/MCP/tools.d.ts +3 -3
- package/transpiled/Mapping.d.ts +6 -6
- package/transpiled/Query.d.ts +4 -4
- package/transpiled/RPC/Context.d.ts +2 -2
- package/transpiled/RPC/Dispatcher.d.ts +1 -1
- package/transpiled/RPC/errors.d.ts +1 -1
- package/transpiled/RPC/index.d.ts +1 -1
- package/transpiled/RPC/names.d.ts +2 -2
- package/transpiled/RTD/Context.d.ts +3 -3
- package/transpiled/RTD/Directives.d.ts +5 -5
- package/transpiled/RTD/Endpoint.d.ts +5 -5
- package/transpiled/RTD/Match.d.ts +1 -1
- package/transpiled/RTD/Method.d.ts +5 -5
- package/transpiled/RTD/Node.d.ts +7 -7
- package/transpiled/RTD/Route.d.ts +3 -3
- package/transpiled/RTD/Tree.d.ts +5 -5
- package/transpiled/RTD/factory.d.ts +3 -3
- package/transpiled/RTD/index.d.ts +8 -8
- package/transpiled/RTD/segment.d.ts +1 -1
- package/transpiled/Remotes.d.ts +1 -1
- package/transpiled/Tenant.d.ts +2 -2
- package/transpiled/directives/auth/Anonymous.d.ts +2 -2
- package/transpiled/directives/auth/Anyone.d.ts +2 -2
- package/transpiled/directives/auth/Assert.d.ts +1 -1
- package/transpiled/directives/auth/Authorization.d.ts +7 -7
- package/transpiled/directives/auth/Delegate.d.ts +2 -2
- package/transpiled/directives/auth/Echo.d.ts +2 -2
- package/transpiled/directives/auth/Federation.d.ts +3 -3
- package/transpiled/directives/auth/Id.d.ts +3 -3
- package/transpiled/directives/auth/Incept.d.ts +2 -2
- package/transpiled/directives/auth/Input.d.ts +2 -2
- package/transpiled/directives/auth/Role.d.ts +3 -3
- package/transpiled/directives/auth/Rule.d.ts +3 -3
- package/transpiled/directives/auth/Scheme.d.ts +1 -1
- package/transpiled/directives/auth/create.d.ts +1 -1
- package/transpiled/directives/auth/index.d.ts +1 -1
- package/transpiled/directives/auth/schemes.d.ts +1 -1
- package/transpiled/directives/auth/split.d.ts +1 -1
- package/transpiled/directives/auth/types.d.ts +4 -4
- package/transpiled/directives/cache/Cache.d.ts +4 -4
- package/transpiled/directives/cache/Control.d.ts +1 -1
- package/transpiled/directives/cache/Exact.d.ts +1 -1
- package/transpiled/directives/cache/index.d.ts +1 -1
- package/transpiled/directives/cache/types.d.ts +1 -1
- package/transpiled/directives/censor/Censor.d.ts +10 -0
- package/transpiled/directives/censor/Censor.js +20 -0
- package/transpiled/directives/censor/Censor.js.map +1 -0
- package/transpiled/directives/censor/index.d.ts +2 -0
- package/transpiled/directives/censor/index.js +3 -0
- package/transpiled/directives/censor/index.js.map +1 -0
- package/transpiled/directives/cors/CORS.d.ts +2 -2
- package/transpiled/directives/cors/index.d.ts +1 -1
- package/transpiled/directives/dev/Development.d.ts +3 -3
- package/transpiled/directives/dev/Faulty.d.ts +2 -2
- package/transpiled/directives/dev/Sleep.d.ts +2 -2
- package/transpiled/directives/dev/Stub.d.ts +2 -2
- package/transpiled/directives/dev/Throw.d.ts +2 -2
- package/transpiled/directives/dev/index.d.ts +1 -1
- package/transpiled/directives/dev/types.d.ts +1 -1
- package/transpiled/directives/flow/Compose.d.ts +2 -2
- package/transpiled/directives/flow/Fetch.d.ts +5 -5
- package/transpiled/directives/flow/Flow.d.ts +4 -4
- package/transpiled/directives/flow/index.d.ts +1 -1
- package/transpiled/directives/flow/types.d.ts +2 -2
- package/transpiled/directives/help/Family.d.ts +6 -7
- package/transpiled/directives/help/Parameters.d.ts +1 -1
- package/transpiled/directives/help/index.d.ts +9 -9
- package/transpiled/directives/index.d.ts +5 -4
- package/transpiled/directives/index.js +5 -3
- package/transpiled/directives/index.js.map +1 -1
- package/transpiled/directives/io/Directive.d.ts +4 -4
- package/transpiled/directives/io/IO.d.ts +5 -5
- package/transpiled/directives/io/Input.d.ts +2 -2
- package/transpiled/directives/io/Output.d.ts +2 -2
- package/transpiled/directives/io/Status.d.ts +2 -2
- package/transpiled/directives/io/Throttle.d.ts +4 -4
- package/transpiled/directives/io/index.d.ts +1 -1
- package/transpiled/directives/io/lib/throttle/Keys.d.ts +5 -5
- package/transpiled/directives/io/lib/throttle/Quotas.d.ts +5 -5
- package/transpiled/directives/io/lib/throttle/Sync.d.ts +1 -1
- package/transpiled/directives/io/lib/throttle/components/Component.d.ts +2 -2
- package/transpiled/directives/io/lib/throttle/components/IP.d.ts +2 -2
- package/transpiled/directives/io/lib/throttle/components/Identity.d.ts +2 -2
- package/transpiled/directives/io/lib/throttle/components/Path.d.ts +2 -2
- package/transpiled/directives/io/lib/throttle/components/Route.d.ts +1 -1
- package/transpiled/directives/io/lib/throttle/components/Segment.d.ts +3 -3
- package/transpiled/directives/io/lib/throttle/components/index.d.ts +3 -3
- package/transpiled/directives/io/lib/throttle/components/index.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/conditions/Condition.d.ts +1 -1
- package/transpiled/directives/io/lib/throttle/conditions/Status.d.ts +2 -2
- package/transpiled/directives/io/lib/throttle/conditions/index.d.ts +3 -3
- package/transpiled/directives/io/lib/throttle/conditions/index.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/index.d.ts +4 -4
- package/transpiled/directives/io/schemas.d.ts +4 -4
- package/transpiled/directives/map/Authority.d.ts +2 -2
- package/transpiled/directives/map/Buffer.d.ts +2 -2
- package/transpiled/directives/map/Claims.d.ts +3 -3
- package/transpiled/directives/map/Directive.d.ts +2 -2
- package/transpiled/directives/map/Headers.d.ts +3 -3
- package/transpiled/directives/map/Instance.d.ts +4 -4
- package/transpiled/directives/map/Language.d.ts +4 -4
- package/transpiled/directives/map/Languages.d.ts +1 -1
- package/transpiled/directives/map/Map.d.ts +7 -7
- package/transpiled/directives/map/Mapping.d.ts +5 -5
- package/transpiled/directives/map/Segments.d.ts +3 -3
- package/transpiled/directives/map/index.d.ts +1 -1
- package/transpiled/directives/mcp/MCP.d.ts +4 -4
- package/transpiled/directives/mcp/index.d.ts +3 -3
- package/transpiled/directives/oauth/Discovery.d.ts +3 -3
- package/transpiled/directives/oauth/index.d.ts +1 -1
- package/transpiled/directives/octets/Context.d.ts +2 -2
- package/transpiled/directives/octets/Delete.d.ts +6 -6
- package/transpiled/directives/octets/Directive.d.ts +4 -4
- package/transpiled/directives/octets/Get.d.ts +3 -3
- package/transpiled/directives/octets/Octets.d.ts +6 -6
- package/transpiled/directives/octets/Put.d.ts +7 -7
- package/transpiled/directives/octets/Workflow.d.ts +6 -6
- package/transpiled/directives/octets/index.d.ts +1 -1
- package/transpiled/directives/octets/schemas.d.ts +4 -4
- package/transpiled/directives/octets/types.d.ts +2 -2
- package/transpiled/directives/octets/workflows/Execution.d.ts +2 -2
- package/transpiled/directives/octets/workflows/Workflow.d.ts +3 -3
- package/transpiled/directives/octets/workflows/index.d.ts +2 -2
- package/transpiled/directives/require/Directive.d.ts +1 -1
- package/transpiled/directives/require/Headers.d.ts +2 -2
- package/transpiled/directives/require/Require.d.ts +3 -3
- package/transpiled/directives/require/index.d.ts +1 -1
- package/transpiled/exceptions.d.ts +1 -1
- package/transpiled/index.d.ts +5 -5
- package/transpiled/io.d.ts +1 -1
- package/transpiled/root.d.ts +1 -1
- package/transpiled/service.d.ts +1 -1
- package/ui/dist/_app/immutable/chunks/{C_DmHQYW.js → BNmwbB_m.js} +2 -2
- package/ui/dist/_app/immutable/chunks/{Bu6-PFR2.js → CyQvDdUS.js} +41 -41
- package/ui/dist/_app/immutable/chunks/D8WVrjO4.js +1 -0
- package/ui/dist/_app/immutable/chunks/{DWKNKsnY.js → Wl536IQX.js} +1 -1
- package/ui/dist/_app/immutable/entry/{app.BGsFlGMF.js → app.BnIDHdVY.js} +2 -2
- package/ui/dist/_app/immutable/entry/start.BhKXzsOH.js +1 -0
- package/ui/dist/_app/immutable/nodes/{0.CoZD8TUK.js → 0.DV2orh1u.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{1.CK_wvdhC.js → 1.Bgonurdo.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{2.C8Ba-vjq.js → 2.C0ZHj2rR.js} +1 -1
- package/ui/dist/_app/immutable/nodes/3.DOixCoug.js +1 -0
- package/ui/dist/_app/immutable/nodes/{4.Bbw5GORo.js → 4.fXuZ_LUX.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{5.B1Jp9o4B.js → 5.BN65yDZR.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{6.DeLSCU5t.js → 6.gez_DiIA.js} +1 -1
- package/ui/dist/_app/version.json +1 -1
- package/ui/dist/index.html +10 -10
- package/ui/dist/_app/immutable/chunks/CxYJ7ZeC.js +0 -1
- package/ui/dist/_app/immutable/entry/start.Dy23hery.js +0 -1
- package/ui/dist/_app/immutable/nodes/3.DMVojOYg.js +0 -1
|
@@ -2,7 +2,7 @@ import { Readable } from 'node:stream'
|
|
|
2
2
|
import { posix } from 'node:path'
|
|
3
3
|
import { match } from 'matchacho'
|
|
4
4
|
|
|
5
|
-
async function
|
|
5
|
+
export async function effect(input, context) {
|
|
6
6
|
const { storage, request, location, accept, limit, trust } = input
|
|
7
7
|
const url = request.url
|
|
8
8
|
const id = request.headers['content-id']
|
|
@@ -138,5 +138,3 @@ const ID_RX = /^[a-zA-Z0-9-_]{1,32}$/
|
|
|
138
138
|
|
|
139
139
|
/** @typedef {Array<string | RegExp>} Trust */
|
|
140
140
|
/** @typedef {import('node:stream').Readable} Readable */
|
|
141
|
-
|
|
142
|
-
export { put as effect }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { compare } from '@node-rs/bcrypt'
|
|
2
2
|
import { quote } from '@toa.io/generic'
|
|
3
3
|
import type { Query, Maybe } from '@toa.io/core/types'
|
|
4
|
-
import { split } from './lib/credentials.
|
|
5
|
-
import {
|
|
4
|
+
import { split } from './lib/credentials.ts'
|
|
5
|
+
import type { Context } from '../types/index.d.ts'
|
|
6
6
|
|
|
7
7
|
export async function computation(
|
|
8
8
|
input: Input,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { split } from './lib/credentials.
|
|
2
|
-
import type { Context } from '../types/index.
|
|
1
|
+
import { split } from './lib/credentials.ts'
|
|
2
|
+
import type { Context } from '../types/index.d.ts'
|
|
3
3
|
import type { Maybe } from '@toa.io/core/types'
|
|
4
4
|
|
|
5
5
|
export async function effect(input: Input, context: Context): Promise<Maybe<Output>> {
|
|
@@ -3,7 +3,7 @@ export * from './toa.d.ts'
|
|
|
3
3
|
// What a manifest does not state belongs here, and every run keeps it.
|
|
4
4
|
|
|
5
5
|
import type { Query, RemoteError } from '@toa.io/core/types'
|
|
6
|
-
import type { Component, Configuration } from './toa.
|
|
6
|
+
import type { Component, Configuration } from './toa.d.ts'
|
|
7
7
|
|
|
8
8
|
/** Credentials whose Identity is granted the `system` role. */
|
|
9
9
|
export type Principal = NonNullable<Configuration['principal']>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ERR_UNKNOWN_CLIENT, permits, read } from './lib/index.
|
|
1
|
+
import { ERR_UNKNOWN_CLIENT, permits, read } from './lib/index.ts'
|
|
2
2
|
import type { Maybe } from '@toa.io/core/types'
|
|
3
3
|
import type { Operation } from '@toa.io/bridges.node'
|
|
4
|
-
import type { Client, Context } from './lib/index.
|
|
4
|
+
import type { Client, Context } from './lib/index.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* What a client is, whichever way it came to be known: a `client_id` that is an https URL
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { Call, Observation
|
|
1
|
+
import type { Call, Observation } from '@toa.io/core/types'
|
|
2
|
+
export type { Transition } from '@toa.io/core/types'
|
|
2
3
|
import type { Stash } from '@toa.io/extensions.stash'
|
|
3
4
|
import type { Logs } from '@toa.io/extensions.telemetry'
|
|
4
|
-
import type { Entity } from './Entity.
|
|
5
|
+
import type { Entity } from './Entity.ts'
|
|
5
6
|
|
|
6
7
|
export interface Context {
|
|
7
8
|
stash: Stash
|
|
@@ -37,5 +38,3 @@ export interface Configuration {
|
|
|
37
38
|
/** Milliseconds a document has to arrive. */
|
|
38
39
|
readonly timeout: number
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
-
export type { Transition }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto'
|
|
2
|
-
import { ERR_UNKNOWN_CLIENT } from './errors.
|
|
3
|
-
import type { Context } from './Context.
|
|
4
|
-
import type { Client, Metadata } from './Entity.
|
|
2
|
+
import { ERR_UNKNOWN_CLIENT } from './errors.ts'
|
|
3
|
+
import type { Context } from './Context.ts'
|
|
4
|
+
import type { Client, Metadata } from './Entity.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A Client ID Metadata Document: the client publishes what it is at an https URL, and that
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './canonical.
|
|
2
|
-
export * from './cimd.
|
|
3
|
-
export * from './Context.
|
|
4
|
-
export * from './Entity.
|
|
5
|
-
export * from './errors.
|
|
6
|
-
export * from './redirect.
|
|
1
|
+
export * from './canonical.ts'
|
|
2
|
+
export * from './cimd.ts'
|
|
3
|
+
export * from './Context.ts'
|
|
4
|
+
export * from './Entity.ts'
|
|
5
|
+
export * from './errors.ts'
|
|
6
|
+
export * from './redirect.ts'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { identify } from './lib/index.
|
|
1
|
+
import { identify } from './lib/index.ts'
|
|
2
2
|
import type { Maybe } from '@toa.io/core/types'
|
|
3
3
|
import type { Operation } from '@toa.io/bridges.node'
|
|
4
|
-
import type { Context, Metadata } from './lib/index.
|
|
4
|
+
import type { Context, Metadata } from './lib/index.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Dynamic Client Registration, RFC 7591: the client sends what it is and is given an
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { newid, quote } from '@toa.io/generic'
|
|
2
|
-
import { principal, resolve } from './lib/index.
|
|
2
|
+
import { principal, resolve } from './lib/index.ts'
|
|
3
3
|
import type { JWTPayload } from 'jose'
|
|
4
4
|
import type { Maybe } from '@toa.io/core/types'
|
|
5
|
-
import type { Context, Scheme } from './types/index.
|
|
5
|
+
import type { Context, Scheme } from './types/index.ts'
|
|
6
6
|
|
|
7
7
|
export async function effect(
|
|
8
8
|
{ scheme, authority, credentials }: Input,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { quote } from '@toa.io/generic'
|
|
2
|
-
import { resolve } from './lib/index.
|
|
3
|
-
import type { Context, Entity, Scheme } from './types/index.
|
|
2
|
+
import { resolve } from './lib/index.ts'
|
|
3
|
+
import type { Context, Entity, Scheme } from './types/index.ts'
|
|
4
4
|
|
|
5
5
|
export async function effect(input: Input, context: Context): Promise<Entity | Error> {
|
|
6
6
|
const claims = await resolve(input.scheme, input.credentials, context)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { decode } from './lib/index.
|
|
1
|
+
import { decode } from './lib/index.ts'
|
|
2
2
|
import type { JWTPayload } from 'jose'
|
|
3
|
-
import type { Context } from './types/index.
|
|
3
|
+
import type { Context } from './types/index.ts'
|
|
4
4
|
|
|
5
5
|
export async function effect(
|
|
6
6
|
token: string,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { effect as create } from './create.
|
|
2
|
-
import { principal } from './lib/index.
|
|
3
|
-
import type { Context, Scheme } from './types/index.
|
|
1
|
+
import { effect as create } from './create.ts'
|
|
2
|
+
import { principal } from './lib/index.ts'
|
|
3
|
+
import type { Context, Scheme } from './types/index.ts'
|
|
4
4
|
|
|
5
5
|
export async function effect(input: Input, context: Context): Promise<Output | Error> {
|
|
6
6
|
const credential = await create(input, context)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Logs } from '@toa.io/extensions.telemetry'
|
|
2
|
-
import type { Trust } from '../types/index.
|
|
3
|
-
import type { Fetch } from '../types/context.
|
|
2
|
+
import type { Trust } from '../types/index.ts'
|
|
3
|
+
import type { Fetch } from '../types/context.ts'
|
|
4
4
|
|
|
5
5
|
export interface Ctx {
|
|
6
6
|
trust: Trust[]
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { load } from './jose.js'
|
|
2
|
-
import { createRemoteJWKSet } from './discovery.
|
|
3
|
-
import { ERR_TRUST, ERR_ISS, ERR_SUB, ERR_TOKEN } from './errors.
|
|
2
|
+
import { createRemoteJWKSet } from './discovery.ts'
|
|
3
|
+
import { ERR_TRUST, ERR_ISS, ERR_SUB, ERR_TOKEN } from './errors.ts'
|
|
4
4
|
import type { JWTPayload } from 'jose'
|
|
5
|
-
import type { Ctx } from './Ctx.
|
|
6
|
-
import type { Payload } from './Payload.
|
|
5
|
+
import type { Ctx } from './Ctx.ts'
|
|
6
|
+
import type { Payload } from './Payload.ts'
|
|
7
7
|
|
|
8
8
|
export async function decode(token: string, ctx: Ctx): Promise<Payload | Error> {
|
|
9
9
|
const jose = await load()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { load } from './jose.js'
|
|
2
2
|
import type * as jose from 'jose'
|
|
3
|
-
import type { Configuration } from './Configuration.
|
|
4
|
-
import type { Fetch } from '../types/context.
|
|
3
|
+
import type { Configuration } from './Configuration.ts'
|
|
4
|
+
import type { Fetch } from '../types/context.ts'
|
|
5
5
|
|
|
6
6
|
const cache = new Map<string, Configuration>()
|
|
7
7
|
const resolvers = new WeakMap<Fetch, Map<string, Promise<jose.RemoteJWKSet>>>()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { load } from './jose.js'
|
|
2
|
-
import { createRemoteJWKSet, discover } from './discovery.
|
|
3
|
-
import * as errors from './errors.
|
|
4
|
-
import type { Trust } from '../types/index.
|
|
5
|
-
import type { Ctx } from './Ctx.
|
|
6
|
-
import type { Payload } from './Payload.
|
|
2
|
+
import { createRemoteJWKSet, discover } from './discovery.ts'
|
|
3
|
+
import * as errors from './errors.ts'
|
|
4
|
+
import type { Trust } from '../types/index.ts'
|
|
5
|
+
import type { Ctx } from './Ctx.ts'
|
|
6
|
+
import type { Payload } from './Payload.ts'
|
|
7
7
|
|
|
8
8
|
export async function exchange(credentials: string, ctx: Ctx): Promise<Payload | Error> {
|
|
9
9
|
const jose = await load()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { decode } from './decode.
|
|
2
|
-
export { exchange } from './exchange.
|
|
3
|
-
export { principal } from './principal.
|
|
4
|
-
export { resolve } from './resolve.
|
|
5
|
-
export { type Ctx } from './Ctx.
|
|
1
|
+
export { decode } from './decode.ts'
|
|
2
|
+
export { exchange } from './exchange.ts'
|
|
3
|
+
export { principal } from './principal.ts'
|
|
4
|
+
export { resolve } from './resolve.ts'
|
|
5
|
+
export { type Ctx } from './Ctx.ts'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { decode } from './decode.
|
|
2
|
-
import { exchange } from './exchange.
|
|
3
|
-
import type { Ctx } from './Ctx.
|
|
4
|
-
import type { Payload } from './Payload.
|
|
5
|
-
import type { Context, Scheme } from '../types/index.
|
|
1
|
+
import { decode } from './decode.ts'
|
|
2
|
+
import { exchange } from './exchange.ts'
|
|
3
|
+
import type { Ctx } from './Ctx.ts'
|
|
4
|
+
import type { Payload } from './Payload.ts'
|
|
5
|
+
import type { Context, Scheme } from '../types/index.ts'
|
|
6
6
|
|
|
7
7
|
export async function resolve(
|
|
8
8
|
scheme: Scheme,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { JWTPayload } from 'jose'
|
|
2
2
|
import type { Call, Observation, Query, Transition } from '@toa.io/core/types'
|
|
3
3
|
import type { Logs } from '@toa.io/extensions.telemetry'
|
|
4
|
-
import type { Entity } from './entity.
|
|
5
|
-
import type { Configuration } from './configuration.
|
|
4
|
+
import type { Entity } from './entity.ts'
|
|
5
|
+
import type { Configuration } from './configuration.ts'
|
|
6
6
|
|
|
7
7
|
export interface Context {
|
|
8
8
|
fetch: Fetch
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './configuration.
|
|
2
|
-
export * from './context.
|
|
3
|
-
export * from './entity.
|
|
4
|
-
export * from './Scheme.
|
|
1
|
+
export * from './configuration.ts'
|
|
2
|
+
export * from './context.ts'
|
|
3
|
+
export * from './entity.ts'
|
|
4
|
+
export * from './Scheme.ts'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { hold, identify } from './lib/index.
|
|
1
|
+
import { hold, identify } from './lib/index.ts'
|
|
2
2
|
import type { Maybe } from '@toa.io/core/types'
|
|
3
3
|
import type { Operation } from '@toa.io/bridges.node'
|
|
4
|
-
import type { Context } from './lib/index.
|
|
4
|
+
import type { Context } from './lib/index.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* What the consent page calls when a user allows a client. The page holds the user's own
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { identify, spend, verifies } from './lib/index.
|
|
1
|
+
import { identify, spend, verifies } from './lib/index.ts'
|
|
2
2
|
import type { Maybe } from '@toa.io/core/types'
|
|
3
3
|
import type { Operation } from '@toa.io/bridges.node'
|
|
4
|
-
import type { Code, Context } from './lib/index.
|
|
4
|
+
import type { Code, Context } from './lib/index.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The token endpoint, RFC 6749 §4.1.3. Anonymous, because the clients this server knows are
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash, randomBytes } from 'node:crypto'
|
|
2
|
-
import type { Code, Context } from '../../types/index.
|
|
2
|
+
import type { Code, Context } from '../../types/index.d.ts'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* An authorization code is a bearer credential that lives for seconds. It is held under a
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './code.
|
|
2
|
-
export * from './identify.
|
|
3
|
-
export type * from '../../types/index.
|
|
1
|
+
export * from './code.ts'
|
|
2
|
+
export * from './identify.ts'
|
|
3
|
+
export type * from '../../types/index.d.ts'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { quote } from '@toa.io/generic'
|
|
2
2
|
import type { Operation } from '@toa.io/bridges.node'
|
|
3
|
-
import type { Context, Entity } from './lib/index.
|
|
3
|
+
import type { Context, Entity } from './lib/index.ts'
|
|
4
4
|
|
|
5
5
|
/** What a user has allowed, for a screen that lets them take it back. */
|
|
6
6
|
export class Computation implements Operation {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Maybe } from '@toa.io/core/types'
|
|
2
2
|
import type { Operation } from '@toa.io/bridges.node'
|
|
3
|
-
import type { Context, Entity } from './lib/index.
|
|
3
|
+
import type { Context, Entity } from './lib/index.ts'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Taking back what was allowed. The token itself is not deleted — it is out in the world —
|
|
@@ -3,9 +3,10 @@ export * from './toa.d.ts'
|
|
|
3
3
|
// What a manifest does not state belongs here, and every run keeps it.
|
|
4
4
|
|
|
5
5
|
import type { Query } from '@toa.io/core/types'
|
|
6
|
+
export type { Query } from '@toa.io/core/types'
|
|
6
7
|
import type { Logs } from '@toa.io/extensions.telemetry'
|
|
7
8
|
import type { Stash } from '@toa.io/extensions.stash'
|
|
8
|
-
import type { Component, Configuration } from './toa.
|
|
9
|
+
import type { Component, Configuration } from './toa.d.ts'
|
|
9
10
|
|
|
10
11
|
/** A client as `identity.clients` describes it. */
|
|
11
12
|
export interface Client {
|
|
@@ -57,5 +58,3 @@ export interface Context {
|
|
|
57
58
|
}
|
|
58
59
|
configuration: Configuration
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
-
export type { Query }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Call, Observation } from '@toa.io/core/types'
|
|
2
2
|
import type { Stash } from '@toa.io/extensions.stash'
|
|
3
3
|
import type { Logs } from '@toa.io/extensions.telemetry'
|
|
4
|
-
import type { Entity } from './Entity.
|
|
4
|
+
import type { Entity } from './Entity.ts'
|
|
5
5
|
|
|
6
6
|
export interface Context {
|
|
7
7
|
stash: Stash
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Context } from './Context.
|
|
1
|
+
export type { Context } from './Context.ts'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { quote } from '@toa.io/generic'
|
|
2
|
-
import type { Context } from './types/index.
|
|
2
|
+
import type { Context } from './types/index.ts'
|
|
3
3
|
import type { AuthenticationResponseJSON } from '@simplewebauthn/server'
|
|
4
4
|
import type { Operation } from '@toa.io/bridges.node'
|
|
5
5
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { randomBytes } from 'node:crypto'
|
|
2
2
|
import { newid, quote } from '@toa.io/generic'
|
|
3
|
-
import { MAX_KEYS } from './lib/const.
|
|
3
|
+
import { MAX_KEYS } from './lib/const.ts'
|
|
4
4
|
import type { Operation } from '@toa.io/bridges.node'
|
|
5
|
-
import type { Context } from './types/index.
|
|
5
|
+
import type { Context } from './types/index.ts'
|
|
6
6
|
|
|
7
7
|
export class Effect implements Operation {
|
|
8
8
|
private timeout!: number
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
type RegistrationResponseJSON
|
|
4
4
|
} from '@simplewebauthn/server'
|
|
5
5
|
import type { Operation } from '@toa.io/bridges.node'
|
|
6
|
-
import type { Context, Passkey } from './types/index.
|
|
6
|
+
import type { Context, Passkey } from './types/index.ts'
|
|
7
7
|
|
|
8
8
|
// https://github.com/MasterKale/SimpleWebAuthn/blob/master/packages/server/src/registration/verifyRegistrationResponse.ts#L51
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { quote } from '@toa.io/generic'
|
|
2
|
-
import { MAX_KEYS } from './lib/const.
|
|
3
|
-
import type { Context, Passkey } from './types/index.
|
|
2
|
+
import { MAX_KEYS } from './lib/const.ts'
|
|
3
|
+
import type { Context, Passkey } from './types/index.ts'
|
|
4
4
|
|
|
5
5
|
export async function computation(
|
|
6
6
|
{ authority, identity }: Input,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Observation, Transition } from '@toa.io/core/types'
|
|
2
2
|
import type { Stash } from '@toa.io/extensions.stash'
|
|
3
3
|
import type { Logs } from '@toa.io/extensions.telemetry'
|
|
4
|
-
import type { Configuration } from './Configuration.
|
|
5
|
-
import type { Passkey } from './Passkey.
|
|
6
|
-
import type { Input as UseInput, Output as UseOutput } from '../use.
|
|
4
|
+
import type { Configuration } from './Configuration.ts'
|
|
5
|
+
import type { Passkey } from './Passkey.ts'
|
|
6
|
+
import type { Input as UseInput, Output as UseOutput } from '../use.ts'
|
|
7
7
|
|
|
8
8
|
export interface Context {
|
|
9
9
|
configuration: Configuration
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { Context } from './Context.
|
|
2
|
-
export type { Passkey } from './Passkey.
|
|
1
|
+
export type { Context } from './Context.ts'
|
|
2
|
+
export type { Passkey } from './Passkey.ts'
|
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
WebAuthnCredential
|
|
5
5
|
} from '@simplewebauthn/server'
|
|
6
6
|
import type { Operation } from '@toa.io/bridges.node'
|
|
7
|
-
import type { Context, Passkey } from './types/index.
|
|
7
|
+
import type { Context, Passkey } from './types/index.ts'
|
|
8
8
|
|
|
9
9
|
export class Transition implements Operation {
|
|
10
10
|
private stash!: Context['stash']
|
|
@@ -5,10 +5,10 @@ entity:
|
|
|
5
5
|
properties:
|
|
6
6
|
grantor:
|
|
7
7
|
type: string
|
|
8
|
-
identity:
|
|
8
|
+
identity: &identity
|
|
9
9
|
type: string
|
|
10
10
|
pattern: '[a-z0-9]{32}'
|
|
11
|
-
role:
|
|
11
|
+
role: &role
|
|
12
12
|
type: string
|
|
13
13
|
pattern: ^[a-zA-Z0-9]{0,32}(:[a-zA-Z0-9]{0,32}){0,8}$
|
|
14
14
|
required:
|
|
@@ -29,12 +29,8 @@ operations:
|
|
|
29
29
|
items:
|
|
30
30
|
type: string
|
|
31
31
|
type: object
|
|
32
|
-
identity:
|
|
33
|
-
|
|
34
|
-
default: .
|
|
35
|
-
role:
|
|
36
|
-
type: string
|
|
37
|
-
default: .
|
|
32
|
+
identity: *identity
|
|
33
|
+
role: *role
|
|
38
34
|
type: object
|
|
39
35
|
required:
|
|
40
36
|
- identity
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { quote } from '@toa.io/generic'
|
|
2
|
-
import type { Entity } from './lib/Entity.
|
|
2
|
+
import type { Entity } from './lib/Entity.ts'
|
|
3
3
|
import type { Call, Query } from '@toa.io/core/types'
|
|
4
|
-
import type { Input as GrantInput } from './grant.
|
|
4
|
+
import type { Input as GrantInput } from './grant.ts'
|
|
5
5
|
|
|
6
6
|
const SYSTEM = 'system'
|
|
7
7
|
|