@friggframework/schemas 2.0.0--canary.669.5f3833b.0 → 2.0.0--canary.671.dc3e89f.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/package.json +2 -2
- package/schemas/api-authorization.schema.json +41 -7
- package/schemas/api-credentials.schema.json +5 -5
- package/schemas/api-entities.schema.json +7 -7
- package/schemas/api-module-definition.schema.json +34 -0
- package/schemas/api-proxy.schema.json +26 -13
- package/schemas/app-definition.schema.json +95 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/schemas",
|
|
3
|
-
"version": "2.0.0--canary.
|
|
3
|
+
"version": "2.0.0--canary.671.dc3e89f.0",
|
|
4
4
|
"description": "Canonical JSON Schema definitions for Frigg Framework",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"middleware/",
|
|
42
42
|
"index.js"
|
|
43
43
|
],
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "dc3e89fb7d431925d91d652e1e55801da77e2e45"
|
|
45
45
|
}
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"definitions": {
|
|
7
7
|
"authorizationRequirements": {
|
|
8
8
|
"type": "object",
|
|
9
|
-
"description": "Authorization requirements response from GET /api/authorize",
|
|
9
|
+
"description": "Authorization requirements response from GET /api/v2/authorize (GET /api/authorize in v1 returns the module requirements unwrapped)",
|
|
10
10
|
"required": ["type", "step", "totalSteps", "isMultiStep"],
|
|
11
11
|
"properties": {
|
|
12
12
|
"type": {
|
|
13
13
|
"type": "string",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"description": "Type of authentication required: oauth2, form, api-key, basic, or a module-defined step type (e.g. email, otp)",
|
|
15
|
+
"examples": ["oauth2", "form", "api-key", "basic", "otp"]
|
|
16
16
|
},
|
|
17
17
|
"step": {
|
|
18
18
|
"type": "integer",
|
|
@@ -112,13 +112,13 @@
|
|
|
112
112
|
},
|
|
113
113
|
"getEntityTypeRequirementsResponse": {
|
|
114
114
|
"type": "object",
|
|
115
|
-
"description": "Authorization requirements response from GET /api/entities/types/:
|
|
115
|
+
"description": "Authorization requirements response from GET /api/v2/entities/types/:entityType/requirements",
|
|
116
116
|
"required": ["type", "step", "totalSteps", "isMultiStep"],
|
|
117
117
|
"properties": {
|
|
118
118
|
"type": {
|
|
119
119
|
"type": "string",
|
|
120
|
-
"
|
|
121
|
-
"
|
|
120
|
+
"description": "Type of authentication required: oauth2, form, api-key, basic, or a module-defined step type (e.g. email, otp)",
|
|
121
|
+
"examples": ["oauth2", "form", "api-key", "basic", "otp"]
|
|
122
122
|
},
|
|
123
123
|
"step": {
|
|
124
124
|
"type": "integer",
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
},
|
|
152
152
|
"authorizationRequest": {
|
|
153
153
|
"type": "object",
|
|
154
|
-
"description": "Authorization request to POST /api/authorize",
|
|
154
|
+
"description": "Authorization request to POST /api/v2/authorize (and v1 POST /api/authorize)",
|
|
155
155
|
"required": ["entityType"],
|
|
156
156
|
"properties": {
|
|
157
157
|
"entityType": {
|
|
@@ -238,6 +238,40 @@
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
},
|
|
241
|
+
"authorizeComplete": {
|
|
242
|
+
"type": "object",
|
|
243
|
+
"description": "POST /api/v2/authorize (or /api/v2/credentials/:credentialId/reauthorize) when the flow is complete. The credential is masked.",
|
|
244
|
+
"required": ["status", "entity", "credential"],
|
|
245
|
+
"properties": {
|
|
246
|
+
"status": { "const": "complete" },
|
|
247
|
+
"entity": { "type": "object", "description": "api-entities#/definitions/entity" },
|
|
248
|
+
"credential": { "type": "object", "description": "api-credentials#/definitions/credential, masked" },
|
|
249
|
+
"previousCredentialId": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"description": "Re-authorization only: set when the provider account changed and a new credential was stored"
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"authorizePending": {
|
|
256
|
+
"type": "object",
|
|
257
|
+
"description": "POST /api/v2/authorize when another step is needed",
|
|
258
|
+
"required": ["status", "step", "totalSteps", "sessionId", "requirements"],
|
|
259
|
+
"properties": {
|
|
260
|
+
"status": { "const": "pending" },
|
|
261
|
+
"step": { "type": "integer", "minimum": 2 },
|
|
262
|
+
"totalSteps": { "type": "integer", "minimum": 2 },
|
|
263
|
+
"sessionId": { "type": "string" },
|
|
264
|
+
"requirements": { "$ref": "#/definitions/authorizationRequirements" },
|
|
265
|
+
"message": { "type": "string" }
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"authorizeV2Response": {
|
|
269
|
+
"description": "Response from POST /api/v2/authorize and POST /api/v2/credentials/:credentialId/reauthorize",
|
|
270
|
+
"oneOf": [
|
|
271
|
+
{ "$ref": "#/definitions/authorizeComplete" },
|
|
272
|
+
{ "$ref": "#/definitions/authorizePending" }
|
|
273
|
+
]
|
|
274
|
+
},
|
|
241
275
|
"authorizationSession": {
|
|
242
276
|
"type": "object",
|
|
243
277
|
"description": "Authorization session stored in database",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"listCredentialsResponse": {
|
|
50
50
|
"type": "object",
|
|
51
|
-
"description": "Response from GET /api/credentials - returns list of credentials for the authenticated user",
|
|
51
|
+
"description": "Response from GET /api/v2/credentials - returns list of credentials for the authenticated user",
|
|
52
52
|
"required": ["credentials"],
|
|
53
53
|
"properties": {
|
|
54
54
|
"credentials": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"getCredentialResponse": {
|
|
64
|
-
"description": "Response from GET /api/credentials/:
|
|
64
|
+
"description": "Response from GET /api/v2/credentials/:credentialId - returns a single credential",
|
|
65
65
|
"allOf": [
|
|
66
66
|
{
|
|
67
67
|
"$ref": "#/definitions/credential"
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"deleteCredentialResponse": {
|
|
72
72
|
"type": "object",
|
|
73
|
-
"description": "
|
|
73
|
+
"description": "Legacy delete result. DELETE /api/v2/credentials/:credentialId answers 204 No Content.",
|
|
74
74
|
"required": ["success"],
|
|
75
75
|
"properties": {
|
|
76
76
|
"success": {
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"reauthorizeCredentialRequest": {
|
|
87
87
|
"type": "object",
|
|
88
|
-
"description": "Request to POST /api/credentials/:
|
|
88
|
+
"description": "Request to POST /api/v2/credentials/:credentialId/reauthorize - refresh or update credential authentication",
|
|
89
89
|
"required": ["data"],
|
|
90
90
|
"properties": {
|
|
91
91
|
"data": {
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
},
|
|
108
108
|
"reauthorizeCredentialResponse": {
|
|
109
109
|
"type": "object",
|
|
110
|
-
"description": "
|
|
110
|
+
"description": "Legacy re-authorization result. POST /api/v2/credentials/:credentialId/reauthorize answers api-authorization#/definitions/authorizeV2Response.",
|
|
111
111
|
"oneOf": [
|
|
112
112
|
{
|
|
113
113
|
"$ref": "#/definitions/reauthorizeCredentialSuccess"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"listEntitiesResponse": {
|
|
53
53
|
"type": "object",
|
|
54
|
-
"description": "Response from GET /api/entities",
|
|
54
|
+
"description": "Response from GET /api/v2/entities",
|
|
55
55
|
"required": ["entities"],
|
|
56
56
|
"properties": {
|
|
57
57
|
"entities": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"createEntityRequest": {
|
|
67
67
|
"type": "object",
|
|
68
|
-
"description": "Request to POST /api/entities",
|
|
68
|
+
"description": "Request to POST /api/entities (v1 POST /api/entity). Not served by v2: POST /api/v2/authorize creates the entity.",
|
|
69
69
|
"required": ["entityType", "data"],
|
|
70
70
|
"properties": {
|
|
71
71
|
"entityType": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
},
|
|
89
89
|
"createEntityResponse": {
|
|
90
90
|
"type": "object",
|
|
91
|
-
"description": "Response from POST /api/entities",
|
|
91
|
+
"description": "Response from POST /api/entities (v1 POST /api/entity). Not served by v2.",
|
|
92
92
|
"required": ["entity_id", "credential_id", "type"],
|
|
93
93
|
"properties": {
|
|
94
94
|
"entity_id": {
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
},
|
|
148
148
|
"listEntityTypesResponse": {
|
|
149
149
|
"type": "object",
|
|
150
|
-
"description": "Response from GET /api/entities/types",
|
|
150
|
+
"description": "Response from GET /api/v2/entities/types",
|
|
151
151
|
"required": ["types"],
|
|
152
152
|
"properties": {
|
|
153
153
|
"types": {
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
},
|
|
162
162
|
"getEntityTypeResponse": {
|
|
163
163
|
"type": "object",
|
|
164
|
-
"description": "Response from GET /api/entities/types/:
|
|
164
|
+
"description": "Response from GET /api/v2/entities/types/:entityType",
|
|
165
165
|
"required": ["type", "name"],
|
|
166
166
|
"properties": {
|
|
167
167
|
"type": {
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
},
|
|
202
202
|
"reauthorizeEntityRequest": {
|
|
203
203
|
"type": "object",
|
|
204
|
-
"description": "Request to POST /api/
|
|
204
|
+
"description": "Request to re-authorize an entity. Not served in 2.0.1: use POST /api/v2/credentials/:credentialId/reauthorize.",
|
|
205
205
|
"required": ["data"],
|
|
206
206
|
"properties": {
|
|
207
207
|
"data": {
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
},
|
|
224
224
|
"reauthorizeEntityResponse": {
|
|
225
225
|
"type": "object",
|
|
226
|
-
"description": "
|
|
226
|
+
"description": "Entity re-authorization result. Not served in 2.0.1: POST /api/v2/credentials/:credentialId/reauthorize answers api-authorization#/definitions/authorizeV2Response.",
|
|
227
227
|
"oneOf": [
|
|
228
228
|
{
|
|
229
229
|
"$ref": "#/definitions/reauthorizeEntitySuccess"
|
|
@@ -94,6 +94,40 @@
|
|
|
94
94
|
},
|
|
95
95
|
"additionalProperties": false
|
|
96
96
|
},
|
|
97
|
+
"proxy": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"description": "Opt in to the Management API entity proxy (ADR-052). Without allow, nothing can be proxied.",
|
|
100
|
+
"properties": {
|
|
101
|
+
"allow": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"description": "Operations that may be proxied. :param matches one segment; a trailing /** matches a subtree. Wildcards (method * or path /**) are ignored here and only accepted in the app definition.",
|
|
104
|
+
"items": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"required": ["method", "path"],
|
|
107
|
+
"properties": {
|
|
108
|
+
"method": { "type": "string", "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"] },
|
|
109
|
+
"path": { "type": "string", "pattern": "^/" }
|
|
110
|
+
},
|
|
111
|
+
"additionalProperties": false
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"headers": {
|
|
115
|
+
"type": "array",
|
|
116
|
+
"description": "Provider-specific request headers callers may send, in addition to accept, content-type, accept-language, if-match and if-none-match",
|
|
117
|
+
"items": { "type": "string" }
|
|
118
|
+
},
|
|
119
|
+
"baseUrl": {
|
|
120
|
+
"description": "Proxy base URL (https). A string, or a function of the Api instance for tenant hosts. Defaults to the Api's baseUrl.",
|
|
121
|
+
"type": ["string", "object"]
|
|
122
|
+
},
|
|
123
|
+
"binary": {
|
|
124
|
+
"type": "boolean",
|
|
125
|
+
"default": false,
|
|
126
|
+
"description": "Return binary upstream bodies base64-encoded instead of refusing them (415)"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"additionalProperties": false
|
|
130
|
+
},
|
|
97
131
|
"env": {
|
|
98
132
|
"type": "object",
|
|
99
133
|
"description": "Environment variable configuration",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"definitions": {
|
|
7
7
|
"proxyRequest": {
|
|
8
8
|
"type": "object",
|
|
9
|
-
"description": "Proxy request to POST /api/entities/:
|
|
9
|
+
"description": "Proxy request to POST /api/v2/entities/:entityId/proxy (ADR-052). Off unless the app sets managementApi.proxy.enable, and only for paths the module (or the app definition) allow-lists.",
|
|
10
10
|
"required": ["method", "path"],
|
|
11
11
|
"properties": {
|
|
12
12
|
"method": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"path": {
|
|
18
18
|
"type": "string",
|
|
19
|
-
"description": "
|
|
19
|
+
"description": "Path relative to the module's base URL (e.g. '/v3/contacts'). Must start with a single /. Rejected: //, backslashes, ? and # (use query), . and .. segments, encoded separators (%2f, %5c), double encoding, control and whitespace characters other than %20. The host always comes from the module.",
|
|
20
20
|
"pattern": "^/",
|
|
21
21
|
"minLength": 1
|
|
22
22
|
},
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"headers": {
|
|
39
39
|
"type": "object",
|
|
40
|
-
"description": "
|
|
40
|
+
"description": "Request headers. Only accept, content-type, accept-language, if-match, if-none-match and headers the module lists in proxy.headers are forwarded; others are dropped. Authorization, Proxy-Authorization, Cookie, Host, Forwarded, X-Forwarded-*, X-Real-IP, X-API-Key and the module's own auth header are refused (400). Auth headers come only from the module.",
|
|
41
41
|
"additionalProperties": { "type": "string" }
|
|
42
42
|
},
|
|
43
43
|
"body": {
|
|
@@ -84,19 +84,23 @@
|
|
|
84
84
|
},
|
|
85
85
|
"proxyResponse": {
|
|
86
86
|
"type": "object",
|
|
87
|
-
"description": "
|
|
87
|
+
"description": "Upstream answer relayed by the proxy. The HTTP status of the Frigg response equals `status`; `success` is false for upstream 4xx.",
|
|
88
88
|
"required": ["success", "status", "data"],
|
|
89
89
|
"properties": {
|
|
90
90
|
"success": {
|
|
91
91
|
"type": "boolean",
|
|
92
|
-
"
|
|
93
|
-
"description": "Indicates successful proxy operation"
|
|
92
|
+
"description": "True when the upstream status is below 400"
|
|
94
93
|
},
|
|
95
94
|
"status": {
|
|
96
95
|
"type": "integer",
|
|
97
96
|
"minimum": 200,
|
|
98
|
-
"maximum":
|
|
99
|
-
"description": "HTTP status code from the upstream API response"
|
|
97
|
+
"maximum": 499,
|
|
98
|
+
"description": "HTTP status code from the upstream API response (5xx, 401 and 429 are reported as proxy errors)"
|
|
99
|
+
},
|
|
100
|
+
"dataEncoding": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"enum": ["base64"],
|
|
103
|
+
"description": "Present when data is a base64-encoded binary body (only for modules with proxy.binary: true)"
|
|
100
104
|
},
|
|
101
105
|
"headers": {
|
|
102
106
|
"type": "object",
|
|
@@ -171,16 +175,25 @@
|
|
|
171
175
|
"type": "string",
|
|
172
176
|
"description": "Error code identifying the type of failure",
|
|
173
177
|
"enum": [
|
|
174
|
-
"
|
|
175
|
-
"
|
|
178
|
+
"INVALID_PROXY_REQUEST",
|
|
179
|
+
"PROXY_NOT_ALLOWED",
|
|
180
|
+
"PROXY_NOT_CONFIGURED",
|
|
181
|
+
"PAYLOAD_TOO_LARGE",
|
|
182
|
+
"UNSUPPORTED_MEDIA_TYPE",
|
|
183
|
+
"RESPONSE_TOO_LARGE",
|
|
184
|
+
"INVALID_CREDENTIALS",
|
|
185
|
+
"RATE_LIMITED",
|
|
176
186
|
"UPSTREAM_ERROR",
|
|
177
187
|
"TIMEOUT",
|
|
178
188
|
"NETWORK_ERROR",
|
|
179
|
-
"
|
|
180
|
-
"INVALID_REQUEST",
|
|
189
|
+
"ENTITY_NOT_FOUND",
|
|
181
190
|
"NOT_FOUND",
|
|
191
|
+
"UNAUTHORIZED",
|
|
192
|
+
"VALIDATION_ERROR",
|
|
193
|
+
"INVALID_AUTH",
|
|
194
|
+
"EXPIRED_TOKEN",
|
|
195
|
+
"INVALID_REQUEST",
|
|
182
196
|
"PERMISSION_DENIED",
|
|
183
|
-
"INVALID_CREDENTIALS",
|
|
184
197
|
"SERVICE_UNAVAILABLE"
|
|
185
198
|
]
|
|
186
199
|
},
|
|
@@ -643,6 +643,101 @@
|
|
|
643
643
|
},
|
|
644
644
|
"additionalProperties": false
|
|
645
645
|
},
|
|
646
|
+
"managementApi": {
|
|
647
|
+
"type": "object",
|
|
648
|
+
"description": "Management API settings (ADR-053 versioning, ADR-052 entity proxy).",
|
|
649
|
+
"properties": {
|
|
650
|
+
"v1": {
|
|
651
|
+
"type": "boolean",
|
|
652
|
+
"default": true,
|
|
653
|
+
"description": "Serve the deprecated v1 routes (unprefixed /api/*). false removes them from the router and from the generated API Gateway routes."
|
|
654
|
+
},
|
|
655
|
+
"proxy": {
|
|
656
|
+
"type": "object",
|
|
657
|
+
"description": "Entity proxy, POST /api/v2/entities/:id/proxy (ADR-052). Off by default.",
|
|
658
|
+
"properties": {
|
|
659
|
+
"enable": {
|
|
660
|
+
"type": "boolean",
|
|
661
|
+
"default": false,
|
|
662
|
+
"description": "Mount the entity proxy route and advertise the entityProxy capability."
|
|
663
|
+
},
|
|
664
|
+
"timeoutMs": {
|
|
665
|
+
"type": "integer",
|
|
666
|
+
"minimum": 1,
|
|
667
|
+
"maximum": 25000,
|
|
668
|
+
"default": 25000,
|
|
669
|
+
"description": "Upstream timeout for one proxied call, in milliseconds (can only be lowered)."
|
|
670
|
+
},
|
|
671
|
+
"maxRequestBytes": {
|
|
672
|
+
"type": "integer",
|
|
673
|
+
"minimum": 1,
|
|
674
|
+
"maximum": 10485760,
|
|
675
|
+
"default": 1048576,
|
|
676
|
+
"description": "Largest proxied request body, in bytes."
|
|
677
|
+
},
|
|
678
|
+
"maxResponseBytes": {
|
|
679
|
+
"type": "integer",
|
|
680
|
+
"minimum": 1,
|
|
681
|
+
"maximum": 5242880,
|
|
682
|
+
"default": 5242880,
|
|
683
|
+
"description": "Largest proxied response body, in bytes (can only be lowered)."
|
|
684
|
+
},
|
|
685
|
+
"modules": {
|
|
686
|
+
"type": "object",
|
|
687
|
+
"description": "Per-module allow-list override, keyed by module name. 'module' uses the module's own proxy.allow list.",
|
|
688
|
+
"additionalProperties": {
|
|
689
|
+
"type": "object",
|
|
690
|
+
"properties": {
|
|
691
|
+
"allow": {
|
|
692
|
+
"oneOf": [
|
|
693
|
+
{
|
|
694
|
+
"type": "string",
|
|
695
|
+
"enum": [
|
|
696
|
+
"module"
|
|
697
|
+
]
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
"type": "array",
|
|
701
|
+
"items": {
|
|
702
|
+
"type": "object",
|
|
703
|
+
"required": [
|
|
704
|
+
"method",
|
|
705
|
+
"path"
|
|
706
|
+
],
|
|
707
|
+
"properties": {
|
|
708
|
+
"method": {
|
|
709
|
+
"type": "string",
|
|
710
|
+
"enum": [
|
|
711
|
+
"GET",
|
|
712
|
+
"POST",
|
|
713
|
+
"PUT",
|
|
714
|
+
"PATCH",
|
|
715
|
+
"DELETE",
|
|
716
|
+
"*"
|
|
717
|
+
],
|
|
718
|
+
"description": "HTTP method, or * for any (app definition only; frigg validate warns)"
|
|
719
|
+
},
|
|
720
|
+
"path": {
|
|
721
|
+
"type": "string",
|
|
722
|
+
"pattern": "^/",
|
|
723
|
+
"description": "Path pattern relative to the module's base URL. `:param` matches one segment; a trailing `/**` matches a subtree."
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
"additionalProperties": false
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
]
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
"additionalProperties": false
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
},
|
|
736
|
+
"additionalProperties": false
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
"additionalProperties": false
|
|
740
|
+
},
|
|
646
741
|
"custom": {
|
|
647
742
|
"type": "object",
|
|
648
743
|
"description": "Custom application-specific configuration",
|