@toa.io/extensions.exposition 1.0.0-alpha.5 → 1.0.0-alpha.7
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/identity.basic/manifest.toa.yaml +2 -0
- package/components/identity.federation/manifest.toa.yaml +0 -6
- package/components/identity.roles/manifest.toa.yaml +1 -0
- package/documentation/io.md +56 -0
- package/documentation/query.md +9 -7
- package/documentation/tree.md +22 -4
- package/features/access.feature +11 -1
- package/features/annotation.feature +1 -0
- package/features/body.feature +1 -0
- package/features/cache.feature +3 -0
- package/features/directives.feature +2 -0
- package/features/dynamic.feature +14 -7
- package/features/errors.feature +3 -2
- package/features/etag.feature +1 -0
- package/features/identity.basic.feature +23 -0
- package/features/identity.federation.feature +3 -5
- package/features/identity.roles.feature +1 -0
- package/features/identity.tokens.feature +3 -0
- package/features/io.feature +167 -0
- package/features/octets.entries.feature +2 -0
- package/features/octets.feature +2 -0
- package/features/octets.meta.feature +4 -3
- package/features/octets.workflows.feature +1 -0
- package/features/queries.feature +9 -1
- package/features/response.feature +3 -0
- package/features/routes.feature +17 -10
- package/features/steps/components/pots/manifest.toa.yaml +2 -0
- package/features/steps/components/users/manifest.toa.yaml +1 -0
- package/features/steps/components/users.properties/manifest.toa.yaml +1 -0
- package/features/timing.feature +23 -0
- package/features/vary.feature +33 -3
- package/package.json +7 -7
- package/schemas/io/input.cos.yaml +3 -0
- package/schemas/io/message.cos.yaml +5 -0
- package/schemas/io/output.cos.yaml +5 -0
- package/source/Gateway.ts +4 -4
- package/source/HTTP/Server.ts +2 -2
- package/source/HTTP/messages.ts +1 -1
- package/source/directives/auth/Authorization.ts +3 -3
- package/source/directives/index.ts +4 -3
- package/source/directives/io/Directive.ts +11 -0
- package/source/directives/io/IO.ts +43 -0
- package/source/directives/io/Input.ts +50 -0
- package/source/directives/io/Message.ts +1 -0
- package/source/directives/io/Output.ts +69 -0
- package/source/directives/io/index.ts +3 -0
- package/source/directives/io/schemas.ts +12 -0
- package/source/directives/octets/Context.ts +4 -3
- package/source/directives/octets/Delete.ts +4 -2
- package/source/directives/octets/Directive.ts +10 -0
- package/source/directives/octets/Fetch.ts +4 -3
- package/source/directives/octets/List.ts +4 -2
- package/source/directives/octets/Octets.ts +3 -2
- package/source/directives/octets/Permute.ts +4 -3
- package/source/directives/octets/Store.ts +4 -2
- package/source/directives/octets/Workflow.ts +10 -3
- package/source/directives/octets/types.ts +0 -7
- package/source/directives/vary/embeddings/Header.ts +8 -6
- package/source/root.ts +5 -0
- package/transpiled/Gateway.js +4 -4
- package/transpiled/Gateway.js.map +1 -1
- package/transpiled/HTTP/Server.js +2 -2
- package/transpiled/HTTP/Server.js.map +1 -1
- package/transpiled/HTTP/messages.js +1 -1
- package/transpiled/HTTP/messages.js.map +1 -1
- package/transpiled/directives/auth/Authorization.js +3 -3
- package/transpiled/directives/auth/Authorization.js.map +1 -1
- package/transpiled/directives/index.js +4 -3
- package/transpiled/directives/index.js.map +1 -1
- package/transpiled/directives/io/Directive.d.ts +8 -0
- package/transpiled/directives/io/Directive.js +3 -0
- package/transpiled/directives/io/Directive.js.map +1 -0
- package/transpiled/directives/io/IO.d.ts +9 -0
- package/transpiled/directives/io/IO.js +33 -0
- package/transpiled/directives/io/IO.js.map +1 -0
- package/transpiled/directives/io/Input.d.ts +11 -0
- package/transpiled/directives/io/Input.js +63 -0
- package/transpiled/directives/io/Input.js.map +1 -0
- package/transpiled/directives/io/Message.d.ts +1 -0
- package/transpiled/directives/io/Message.js +3 -0
- package/transpiled/directives/io/Message.js.map +1 -0
- package/transpiled/directives/io/Output.d.ts +13 -0
- package/transpiled/directives/io/Output.js +76 -0
- package/transpiled/directives/io/Output.js.map +1 -0
- package/transpiled/directives/io/index.d.ts +2 -0
- package/transpiled/directives/io/index.js +6 -0
- package/transpiled/directives/io/index.js.map +1 -0
- package/transpiled/directives/io/schemas.d.ts +7 -0
- package/transpiled/directives/io/schemas.js +14 -0
- package/transpiled/directives/io/schemas.js.map +1 -0
- package/transpiled/directives/octets/Context.d.ts +3 -3
- package/transpiled/directives/octets/Context.js +4 -2
- package/transpiled/directives/octets/Context.js.map +1 -1
- package/transpiled/directives/octets/Delete.d.ts +3 -2
- package/transpiled/directives/octets/Delete.js +3 -1
- package/transpiled/directives/octets/Delete.js.map +1 -1
- package/transpiled/directives/octets/Directive.d.ts +8 -0
- package/transpiled/directives/octets/Directive.js +8 -0
- package/transpiled/directives/octets/Directive.js.map +1 -0
- package/transpiled/directives/octets/Fetch.d.ts +3 -2
- package/transpiled/directives/octets/Fetch.js +3 -1
- package/transpiled/directives/octets/Fetch.js.map +1 -1
- package/transpiled/directives/octets/List.d.ts +3 -2
- package/transpiled/directives/octets/List.js +3 -1
- package/transpiled/directives/octets/List.js.map +1 -1
- package/transpiled/directives/octets/Octets.d.ts +2 -1
- package/transpiled/directives/octets/Octets.js +1 -1
- package/transpiled/directives/octets/Octets.js.map +1 -1
- package/transpiled/directives/octets/Permute.d.ts +3 -2
- package/transpiled/directives/octets/Permute.js +3 -1
- package/transpiled/directives/octets/Permute.js.map +1 -1
- package/transpiled/directives/octets/Store.d.ts +3 -2
- package/transpiled/directives/octets/Store.js +3 -1
- package/transpiled/directives/octets/Store.js.map +1 -1
- package/transpiled/directives/octets/Workflow.d.ts +3 -2
- package/transpiled/directives/octets/Workflow.js +9 -2
- package/transpiled/directives/octets/Workflow.js.map +1 -1
- package/transpiled/directives/octets/types.d.ts +0 -5
- package/transpiled/directives/vary/embeddings/Header.js +8 -6
- package/transpiled/directives/vary/embeddings/Header.js.map +1 -1
- package/transpiled/root.js +5 -0
- package/transpiled/root.js.map +1 -1
- package/transpiled/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Output } from './Output'
|
|
2
|
+
import { Input } from './Input'
|
|
3
|
+
import type { Constructor, Directive } from './Directive'
|
|
4
|
+
import type { Input as Context } from '../../io'
|
|
5
|
+
import type { DirectiveFamily } from '../../RTD'
|
|
6
|
+
|
|
7
|
+
export class IO implements DirectiveFamily<Directive> {
|
|
8
|
+
public readonly name = 'io'
|
|
9
|
+
public readonly mandatory = true
|
|
10
|
+
|
|
11
|
+
public create (name: string, value: unknown): Directive {
|
|
12
|
+
if (!(name in constructors))
|
|
13
|
+
throw new Error(`Directive 'io:${name}' is not implemented.`)
|
|
14
|
+
|
|
15
|
+
const Directive = constructors[name]
|
|
16
|
+
|
|
17
|
+
Directive.validate(value)
|
|
18
|
+
|
|
19
|
+
return new Directive(value)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public preflight (directives: Directive[], context: Context): null {
|
|
23
|
+
let restricted = false
|
|
24
|
+
|
|
25
|
+
for (const directive of directives) {
|
|
26
|
+
restricted ||= directive instanceof Output
|
|
27
|
+
|
|
28
|
+
directive.attach(context)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!restricted)
|
|
32
|
+
DENIAL.attach(context)
|
|
33
|
+
|
|
34
|
+
return null
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const constructors: Record<string, Constructor> = {
|
|
39
|
+
output: Output,
|
|
40
|
+
input: Input
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const DENIAL: Output = new Output([])
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BadRequest } from '../../HTTP'
|
|
2
|
+
import * as schemas from './schemas'
|
|
3
|
+
import type { Message } from './Message'
|
|
4
|
+
import type { Directive } from './Directive'
|
|
5
|
+
import type { Input as Context } from '../../io'
|
|
6
|
+
|
|
7
|
+
export class Input implements Directive {
|
|
8
|
+
private readonly permissions: Permissions
|
|
9
|
+
|
|
10
|
+
public constructor (permissions: Permissions) {
|
|
11
|
+
this.permissions = permissions
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public static validate (permissions: unknown): asserts permissions is Permissions {
|
|
15
|
+
schemas.input.validate(permissions, 'Incorrect \'io:input\' format')
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public attach (context: Context): void {
|
|
19
|
+
context.pipelines.body.push((body) => this.check(body))
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
private check (body: unknown): unknown {
|
|
23
|
+
try {
|
|
24
|
+
schemas.message.validate(body)
|
|
25
|
+
} catch {
|
|
26
|
+
throw new BadRequest('Invalid request body.')
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const property = this.violation(body)
|
|
30
|
+
|
|
31
|
+
if (property !== undefined)
|
|
32
|
+
throw new BadRequest(`Unexpected input: ${property}.`)
|
|
33
|
+
|
|
34
|
+
return body
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private violation (value: Message | Message[]): string | undefined {
|
|
38
|
+
if (!Array.isArray(value))
|
|
39
|
+
return Object.keys(value).find((key) => !this.permissions.includes(key))
|
|
40
|
+
|
|
41
|
+
for (const item of value) {
|
|
42
|
+
const property = this.violation(item)
|
|
43
|
+
|
|
44
|
+
if (property !== undefined)
|
|
45
|
+
return property
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type Permissions = string[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Message = Record<string, unknown>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Stream } from 'node:stream'
|
|
2
|
+
import * as schemas from './schemas'
|
|
3
|
+
import type { Message } from './Message'
|
|
4
|
+
import type { Directive } from './Directive'
|
|
5
|
+
import type { Input as Context } from '../../io'
|
|
6
|
+
import type { OutgoingMessage } from '../../HTTP'
|
|
7
|
+
|
|
8
|
+
export class Output implements Directive {
|
|
9
|
+
private readonly disabled: boolean = false
|
|
10
|
+
private readonly omitted: boolean = true
|
|
11
|
+
private readonly permissions: string[] = []
|
|
12
|
+
|
|
13
|
+
public constructor (permissions: Permissions) {
|
|
14
|
+
if (typeof permissions === 'boolean')
|
|
15
|
+
if (permissions)
|
|
16
|
+
this.disabled = true
|
|
17
|
+
else
|
|
18
|
+
this.omitted = false
|
|
19
|
+
|
|
20
|
+
else
|
|
21
|
+
this.permissions = permissions
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public static validate (permissions: unknown): asserts permissions is Permissions {
|
|
25
|
+
schemas.output.validate(permissions, 'Incorrect \'io:output\' format')
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public attach (context: Context): void {
|
|
29
|
+
context.pipelines.response.push(this.restriction(context))
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private restriction (context: Context) {
|
|
33
|
+
return (message: OutgoingMessage): void => {
|
|
34
|
+
const error = message.status !== undefined && message.status >= 300
|
|
35
|
+
const stream = message.body instanceof Stream
|
|
36
|
+
const none = message.body === undefined || message.body === null
|
|
37
|
+
|
|
38
|
+
if (this.disabled || error || stream || none)
|
|
39
|
+
return
|
|
40
|
+
|
|
41
|
+
if (typeof message.body !== 'object' || this.permissions.length === 0) {
|
|
42
|
+
if (this.omitted)
|
|
43
|
+
console.warn('Permissions for \'io:output\' are not specified properly ' +
|
|
44
|
+
`(${context.request.url}). Response omitted.`)
|
|
45
|
+
|
|
46
|
+
delete message.body
|
|
47
|
+
|
|
48
|
+
return
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
schemas.message.validate(message.body,
|
|
52
|
+
'\'io:output\' expects response to be an object or array of objects')
|
|
53
|
+
|
|
54
|
+
if (Array.isArray(message.body))
|
|
55
|
+
message.body = message.body.map((entity) => this.fit(entity))
|
|
56
|
+
else
|
|
57
|
+
message.body = this.fit(message.body)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private fit (message: Message): Message | undefined {
|
|
62
|
+
const entries = Object.entries(message)
|
|
63
|
+
.filter(([key]) => this.permissions.includes(key))
|
|
64
|
+
|
|
65
|
+
return Object.fromEntries(entries)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type Permissions = string[] | boolean
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { resolve } from 'node:path'
|
|
2
|
+
import schemas, { type Schema } from '@toa.io/schemas'
|
|
3
|
+
import type { Permissions as InputPermissions } from './Input'
|
|
4
|
+
import type { Permissions as OutputPermissions } from './Output'
|
|
5
|
+
import type { Message } from './Message'
|
|
6
|
+
|
|
7
|
+
const path = resolve(__dirname, '../../../schemas/io')
|
|
8
|
+
const namespace = schemas.namespace(path)
|
|
9
|
+
|
|
10
|
+
export const message: Schema<Message | Message[]> = namespace.schema('message')
|
|
11
|
+
export const input: Schema<InputPermissions> = namespace.schema('input')
|
|
12
|
+
export const output: Schema<OutputPermissions> = namespace.schema('output')
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import * as schemas from './schemas'
|
|
2
|
+
import { Directive } from './Directive'
|
|
2
3
|
import type { Output } from '../../io'
|
|
3
|
-
import type { Directive } from './types'
|
|
4
4
|
|
|
5
|
-
export class Context
|
|
5
|
+
export class Context extends Directive {
|
|
6
6
|
public readonly targeted = false
|
|
7
7
|
public readonly storage: string
|
|
8
8
|
|
|
9
9
|
public constructor (value: unknown) {
|
|
10
|
+
super()
|
|
10
11
|
schemas.context.validate(value)
|
|
11
12
|
|
|
12
13
|
this.storage = value
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
public apply (): Output {
|
|
16
|
+
public async apply (): Promise<Output> {
|
|
16
17
|
return null
|
|
17
18
|
}
|
|
18
19
|
}
|
|
@@ -2,16 +2,17 @@ import { Readable } from 'stream'
|
|
|
2
2
|
import { NotFound } from '../../HTTP'
|
|
3
3
|
import * as schemas from './schemas'
|
|
4
4
|
import { Workflow } from './workflows'
|
|
5
|
+
import { Directive } from './Directive'
|
|
5
6
|
import type { Parameter } from '../../RTD'
|
|
6
7
|
import type { Unit } from './workflows'
|
|
7
8
|
import type { Maybe } from '@toa.io/types'
|
|
8
9
|
import type { Component } from '@toa.io/core'
|
|
9
10
|
import type { Output } from '../../io'
|
|
10
|
-
import type {
|
|
11
|
+
import type { Input } from './types'
|
|
11
12
|
import type { Remotes } from '../../Remotes'
|
|
12
13
|
import type { Entry } from '@toa.io/extensions.storages'
|
|
13
14
|
|
|
14
|
-
export class Delete
|
|
15
|
+
export class Delete extends Directive {
|
|
15
16
|
public readonly targeted = true
|
|
16
17
|
|
|
17
18
|
private readonly workflow?: Workflow
|
|
@@ -19,6 +20,7 @@ export class Delete implements Directive {
|
|
|
19
20
|
private storage: Component | null = null
|
|
20
21
|
|
|
21
22
|
public constructor (options: Options | null, discovery: Promise<Component>, remotes: Remotes) {
|
|
23
|
+
super()
|
|
22
24
|
schemas.remove.validate(options)
|
|
23
25
|
|
|
24
26
|
if (options?.workflow !== undefined)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Input } from './types'
|
|
2
|
+
import type { Parameter } from '../../RTD'
|
|
3
|
+
import type * as io from '../../io'
|
|
4
|
+
|
|
5
|
+
export abstract class Directive {
|
|
6
|
+
public readonly name = 'octets.' + this.constructor.name.toLowerCase()
|
|
7
|
+
public abstract readonly targeted: boolean
|
|
8
|
+
|
|
9
|
+
public abstract apply (storage: string, input: Input, parameters: Parameter[]): Promise<io.Output>
|
|
10
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { posix } from 'node:path'
|
|
2
2
|
import { Forbidden, NotFound } from '../../HTTP'
|
|
3
3
|
import * as schemas from './schemas'
|
|
4
|
+
import { Directive } from './Directive'
|
|
4
5
|
import type { Maybe } from '@toa.io/types'
|
|
5
6
|
import type { Entry } from '@toa.io/extensions.storages'
|
|
6
7
|
import type { Readable } from 'node:stream'
|
|
7
8
|
import type { Component } from '@toa.io/core'
|
|
8
9
|
import type { Output } from '../../io'
|
|
10
|
+
import type { Input } from './types'
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export class Fetch implements Directive {
|
|
12
|
+
export class Fetch extends Directive {
|
|
13
13
|
public readonly targeted = true
|
|
14
14
|
|
|
15
15
|
private readonly permissions: Required<Permissions> = {
|
|
@@ -21,6 +21,7 @@ export class Fetch implements Directive {
|
|
|
21
21
|
private storage: Component = null as unknown as Component
|
|
22
22
|
|
|
23
23
|
public constructor (permissions: Permissions | null, discovery: Promise<Component>) {
|
|
24
|
+
super()
|
|
24
25
|
schemas.fetch.validate(permissions)
|
|
25
26
|
|
|
26
27
|
Object.assign(this.permissions, permissions)
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { posix } from 'node:path'
|
|
2
2
|
import { Forbidden, NotFound } from '../../HTTP'
|
|
3
3
|
import * as schemas from './schemas'
|
|
4
|
+
import { Directive } from './Directive'
|
|
4
5
|
import type { Entry } from '@toa.io/extensions.storages'
|
|
5
6
|
import type { Maybe } from '@toa.io/types'
|
|
6
7
|
import type { Component } from '@toa.io/core'
|
|
7
8
|
import type { Output } from '../../io'
|
|
8
9
|
|
|
9
|
-
import type {
|
|
10
|
+
import type { Input } from './types'
|
|
10
11
|
|
|
11
|
-
export class List
|
|
12
|
+
export class List extends Directive {
|
|
12
13
|
public readonly targeted = false
|
|
13
14
|
|
|
14
15
|
private readonly permissions: Required<Permissions> = { meta: false }
|
|
@@ -16,6 +17,7 @@ export class List implements Directive {
|
|
|
16
17
|
private storage: Component | null = null
|
|
17
18
|
|
|
18
19
|
public constructor (permissions: Permissions | null, discovery: Promise<Component>) {
|
|
20
|
+
super()
|
|
19
21
|
schemas.list.validate(permissions)
|
|
20
22
|
|
|
21
23
|
Object.assign(this.permissions, permissions)
|
|
@@ -6,11 +6,12 @@ import { List } from './List'
|
|
|
6
6
|
import { Delete } from './Delete'
|
|
7
7
|
import { Permute } from './Permute'
|
|
8
8
|
import { WorkflowDirective } from './Workflow'
|
|
9
|
+
import type { Directive } from './Directive'
|
|
9
10
|
import type { Output } from '../../io'
|
|
10
11
|
import type { Component } from '@toa.io/core'
|
|
11
12
|
import type { Remotes } from '../../Remotes'
|
|
12
13
|
import type { Parameter, DirectiveFamily } from '../../RTD'
|
|
13
|
-
import type {
|
|
14
|
+
import type { Input } from './types'
|
|
14
15
|
|
|
15
16
|
export class Octets implements DirectiveFamily<Directive> {
|
|
16
17
|
public readonly name: string = 'octets'
|
|
@@ -55,7 +56,7 @@ export class Octets implements DirectiveFamily<Directive> {
|
|
|
55
56
|
throw new NotFound(`Trailing slash is ${action.targeted ? 'redundant' : 'required'}.`)
|
|
56
57
|
|
|
57
58
|
// noinspection JSObjectNullOrUndefined
|
|
58
|
-
return action.apply(context.storage, input, parameters)
|
|
59
|
+
return await input.timing.capture(action.name, action.apply(context.storage, input, parameters))
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { NotAcceptable, NotFound } from '../../HTTP'
|
|
2
2
|
import * as schemas from './schemas'
|
|
3
|
+
import { Directive } from './Directive'
|
|
3
4
|
import type { Maybe } from '@toa.io/types'
|
|
4
5
|
import type { Component } from '@toa.io/core'
|
|
5
6
|
import type { Output } from '../../io'
|
|
7
|
+
import type { Input } from './types'
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export class Permute implements Directive {
|
|
9
|
+
export class Permute extends Directive {
|
|
10
10
|
public readonly targeted = false
|
|
11
11
|
|
|
12
12
|
private readonly discovery: Promise<Component>
|
|
13
13
|
private storage: Component | null = null
|
|
14
14
|
|
|
15
15
|
public constructor (value: null, discovery: Promise<Component>) {
|
|
16
|
+
super()
|
|
16
17
|
schemas.permute.validate(value)
|
|
17
18
|
|
|
18
19
|
this.discovery = discovery
|
|
@@ -4,6 +4,7 @@ import { BadRequest, UnsupportedMediaType } from '../../HTTP'
|
|
|
4
4
|
import { cors } from '../cors'
|
|
5
5
|
import * as schemas from './schemas'
|
|
6
6
|
import { Workflow } from './workflows'
|
|
7
|
+
import { Directive } from './Directive'
|
|
7
8
|
import type { Readable } from 'stream'
|
|
8
9
|
import type { Parameter } from '../../RTD'
|
|
9
10
|
import type { Unit } from './workflows'
|
|
@@ -12,9 +13,9 @@ import type { Remotes } from '../../Remotes'
|
|
|
12
13
|
import type { ErrorType } from 'error-value'
|
|
13
14
|
import type { Component } from '@toa.io/core'
|
|
14
15
|
import type { Output } from '../../io'
|
|
15
|
-
import type {
|
|
16
|
+
import type { Input } from './types'
|
|
16
17
|
|
|
17
|
-
export class Store
|
|
18
|
+
export class Store extends Directive {
|
|
18
19
|
public readonly targeted = false
|
|
19
20
|
|
|
20
21
|
private readonly accept?: string
|
|
@@ -24,6 +25,7 @@ export class Store implements Directive {
|
|
|
24
25
|
|
|
25
26
|
public constructor
|
|
26
27
|
(options: Options | null, discovery: Promise<Component>, remotes: Remotes) {
|
|
28
|
+
super()
|
|
27
29
|
schemas.store.validate(options)
|
|
28
30
|
|
|
29
31
|
this.accept = match(options?.accept,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { NotFound } from '../../HTTP'
|
|
2
2
|
import * as schemas from './schemas'
|
|
3
3
|
import { Workflow } from './workflows'
|
|
4
|
+
import { Directive } from './Directive'
|
|
4
5
|
import type { Unit } from './workflows'
|
|
5
|
-
import type {
|
|
6
|
+
import type { Input } from './types'
|
|
6
7
|
import type { Component } from '@toa.io/core'
|
|
7
8
|
import type { Output } from '../../io'
|
|
8
9
|
import type { Remotes } from '../../Remotes'
|
|
@@ -10,7 +11,7 @@ import type { Maybe } from '@toa.io/types'
|
|
|
10
11
|
import type { Entry } from '@toa.io/extensions.storages'
|
|
11
12
|
import type { Parameter } from '../../RTD'
|
|
12
13
|
|
|
13
|
-
export class WorkflowDirective
|
|
14
|
+
export class WorkflowDirective extends Directive {
|
|
14
15
|
public readonly targeted = true
|
|
15
16
|
|
|
16
17
|
private readonly workflow: Workflow
|
|
@@ -18,6 +19,7 @@ export class WorkflowDirective implements Directive {
|
|
|
18
19
|
private storage: Component | null = null
|
|
19
20
|
|
|
20
21
|
public constructor (units: Unit[] | Unit, discovery: Promise<Component>, remotes: Remotes) {
|
|
22
|
+
super()
|
|
21
23
|
schemas.workflow.validate(units)
|
|
22
24
|
|
|
23
25
|
this.workflow = new Workflow(units, remotes)
|
|
@@ -28,7 +30,12 @@ export class WorkflowDirective implements Directive {
|
|
|
28
30
|
this.storage ??= await this.discovery
|
|
29
31
|
|
|
30
32
|
const entry = await this.storage.invoke<Maybe<Entry>>('get',
|
|
31
|
-
{
|
|
33
|
+
{
|
|
34
|
+
input: {
|
|
35
|
+
storage,
|
|
36
|
+
path: input.request.url
|
|
37
|
+
}
|
|
38
|
+
})
|
|
32
39
|
|
|
33
40
|
if (entry instanceof Error)
|
|
34
41
|
throw new NotFound()
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import type { Parameter } from '../../RTD'
|
|
2
1
|
import type * as io from '../../io'
|
|
3
2
|
|
|
4
|
-
export interface Directive {
|
|
5
|
-
readonly targeted: boolean
|
|
6
|
-
|
|
7
|
-
apply: (storage: string, input: Input, parameters: Parameter[]) => io.Output | Promise<io.Output>
|
|
8
|
-
}
|
|
9
|
-
|
|
10
3
|
export interface Extension {
|
|
11
4
|
octets?: string
|
|
12
5
|
}
|
|
@@ -6,9 +6,10 @@ export class Header implements Embedding {
|
|
|
6
6
|
private readonly name: string
|
|
7
7
|
|
|
8
8
|
public constructor (name: string) {
|
|
9
|
-
this.name = name
|
|
9
|
+
this.name = name.toLowerCase()
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
if (this.name !== 'host')
|
|
12
|
+
cors.allow(this.name)
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
public resolve (input: Input): string | undefined {
|
|
@@ -17,10 +18,11 @@ export class Header implements Embedding {
|
|
|
17
18
|
if (value === undefined)
|
|
18
19
|
return value
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
response.
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
if (this.name !== 'host')
|
|
22
|
+
input.pipelines.response.push((response) => {
|
|
23
|
+
response.headers ??= new Headers()
|
|
24
|
+
response.headers.append('vary', this.name)
|
|
25
|
+
})
|
|
24
26
|
|
|
25
27
|
if (Array.isArray(value))
|
|
26
28
|
return value.join(', ')
|
package/source/root.ts
CHANGED
package/transpiled/Gateway.js
CHANGED
|
@@ -39,7 +39,7 @@ class Gateway extends core_1.Connector {
|
|
|
39
39
|
this.depends(broadcast);
|
|
40
40
|
}
|
|
41
41
|
async process(context) {
|
|
42
|
-
const interception = await context.timing.capture('
|
|
42
|
+
const interception = await context.timing.capture('intercept', this.interceptor.intercept(context));
|
|
43
43
|
if (interception !== null)
|
|
44
44
|
return interception;
|
|
45
45
|
const match = this.tree.match(context.url.pathname);
|
|
@@ -49,10 +49,10 @@ class Gateway extends core_1.Connector {
|
|
|
49
49
|
if (!(context.request.method in node.methods))
|
|
50
50
|
throw new http.MethodNotAllowed();
|
|
51
51
|
const method = node.methods[context.request.method];
|
|
52
|
-
const interruption = await context.timing.capture('
|
|
52
|
+
const interruption = await context.timing.capture('preflight', method.directives.preflight(context, parameters));
|
|
53
53
|
const response = interruption ??
|
|
54
|
-
await context.timing.capture('
|
|
55
|
-
await context.timing.capture('
|
|
54
|
+
await context.timing.capture('call', this.call(method, context, parameters));
|
|
55
|
+
await context.timing.capture('settle', method.directives.settle(context, response));
|
|
56
56
|
return response;
|
|
57
57
|
}
|
|
58
58
|
async open() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Gateway.js","sourceRoot":"","sources":["../source/Gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuD;AACvD,6CAA8B;AAC9B,6CAAsC;AAMtC,MAAa,OAAQ,SAAQ,gBAAS;IACnB,SAAS,CAAW;IACpB,IAAI,CAAM;IACV,WAAW,CAAc;IAE1C,YAAoB,SAAoB,EAAE,IAAU,EAAE,YAA0B;QAC9E,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,WAAW,GAAG,YAAY,CAAA;QAE/B,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAA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EnC,OAAO,MAAM,MAAM,CAAC,QAAQ;aACzB,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC;aACzB,KAAK,CAAC,oBAAO,CAAyB,CAAA;IAC3C,CAAC;IAEO,KAAK,CAAC,QAAQ;QACpB,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAS,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;QACrE,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAO,MAAM,EAAE,IAAI,CAAC,CAAA;IACnD,CAAC;IAEO,KAAK,CAAE,MAAc;QAC3B,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;YAEpC,OAAO,CAAC,IAAI,CAAC,qBAAqB;gBAChC,IAAI,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,oBAAoB,CAAC,CAAA;QACjE,CAAC;QAAC,OAAO,SAAS,EAAE,CAAC;YACnB,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QAC1B,CAAC;IACH,CAAC;CACF;AAzFD,0BAyFC"}
|
|
@@ -101,7 +101,7 @@ class Server extends core_1.Connector {
|
|
|
101
101
|
status = 204;
|
|
102
102
|
else
|
|
103
103
|
status = 200;
|
|
104
|
-
response.statusCode = status;
|
|
104
|
+
response.statusCode = message.status = status;
|
|
105
105
|
(0, messages_1.write)(context, response, message);
|
|
106
106
|
};
|
|
107
107
|
}
|
|
@@ -112,7 +112,7 @@ class Server extends core_1.Connector {
|
|
|
112
112
|
response.statusCode = exception instanceof exceptions_1.Exception
|
|
113
113
|
? exception.status
|
|
114
114
|
: 500;
|
|
115
|
-
const message = {};
|
|
115
|
+
const message = { status: response.statusCode };
|
|
116
116
|
const verbose = exception instanceof exceptions_1.ClientError || this.properties.debug;
|
|
117
117
|
if (verbose)
|
|
118
118
|
message.body = exception instanceof exceptions_1.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A;IAEhB,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,MAAM,QAAQ,GAAe;IAC3B,OAAO,EAAE,IAAI,GAAG,CAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC9E,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;CACX,CAAA"}
|
|
@@ -23,7 +23,7 @@ async function read(context) {
|
|
|
23
23
|
if (!(type in formats_1.formats))
|
|
24
24
|
throw new exceptions_1.UnsupportedMediaType();
|
|
25
25
|
const format = formats_1.formats[type];
|
|
26
|
-
const buf = await context.timing.capture('
|
|
26
|
+
const buf = await context.timing.capture('buffer', (0, consumers_1.buffer)(context.request));
|
|
27
27
|
try {
|
|
28
28
|
return format.decode(buf);
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../source/HTTP/messages.ts"],"names":[],"mappings":";;;AAAA,6CAAsC;AACtC,qDAA8C;AAC9C,uCAAmC;AACnC,6CAA8E;AAI9E,SAAgB,KAAK,CACpB,OAAgB,EAAE,QAA6B,EAAE,OAAwB;IACxE,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,QAAQ;QAChD,SAAS,CAAC,OAAO,CAAC,CAAA;IAEpB,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;IACxE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAE/B,IAAI,OAAO,CAAC,IAAI,YAAY,sBAAQ;QAClC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;;QAElC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CA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-48,8 +48,8 @@ class Authorization {
|
|
|
48
48
|
tokens = null;
|
|
49
49
|
bans = null;
|
|
50
50
|
create(name, value, remotes) {
|
|
51
|
-
node_assert_1.default.ok(name in
|
|
52
|
-
const Class =
|
|
51
|
+
node_assert_1.default.ok(name in constructors, `Directive '${name}' is not provided by the '${this.name}' family.`);
|
|
52
|
+
const Class = constructors[name];
|
|
53
53
|
for (const name of REMOTES)
|
|
54
54
|
this.discovery[name] ??= remotes.discover('identity', name);
|
|
55
55
|
return (0, matchacho_1.match)(Class, Role_1.Role, () => new Role_1.Role(value, this.discovery.roles), Rule_1.Rule, () => new Rule_1.Rule(value, this.create.bind(this)), Incept_1.Incept, () => new Incept_1.Incept(value, this.discovery), () => new Class(value));
|
|
@@ -112,7 +112,7 @@ class Authorization {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
exports.Authorization = Authorization;
|
|
115
|
-
const
|
|
115
|
+
const constructors = {
|
|
116
116
|
anonymous: Anonymous_1.Anonymous,
|
|
117
117
|
id: Id_1.Id,
|
|
118
118
|
role: Role_1.Role,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authorization.js","sourceRoot":"","sources":["../../../source/directives/auth/Authorization.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAAgC;AAChC,yCAAiC;AACjC,iDAAkC;AAClC,2CAAuC;AACvC,6BAAyB;AACzB,iCAA6B;AAC7B,iCAA6B;AAC7B,qCAAiC;AACjC,iCAA6B;AAC7B,mCAA+B;AAC/B,qCAAiC;AACjC,uCAA8C;AAiB9C,MAAa,aAAa;IACR,OAAO,GAAa,CAAC,MAAM,CAAC,CAAA;IAC5B,IAAI,GAAW,MAAM,CAAA;IACrB,SAAS,GAAY,IAAI,CAAA;IAExB,OAAO,GAAG,EAAwB,CAAA;IAClC,SAAS,GAAG,EAA0B,CAAA;IAC/C,MAAM,GAAqB,IAAI,CAAA;IAC/B,IAAI,GAAqB,IA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