repository
stringclasses
528 values
commit
stringlengths
40
40
commitDate
unknown
path
stringlengths
11
149
repoStars
int64
5
94.9k
repoLastFetched
stringclasses
528 values
content
stringlengths
48
736k
license
stringclasses
14 values
language
stringclasses
7 values
joaopgrassi/otel-recipes
cc408bf60ce7bf07a4c61531df10a25695171559
"2022-04-19T20:03:22"
otel-recipes-schema.json
43
2024-05-27T05:31:02.973173Z
{ "$id": "https://github.com/joaopgrassi/otel-recipes/otel-recipes-schema.json", "$schema": "http://json-schema.org/draft-04/schema", "definitions": { "dependencyContent": { "properties": { "id": { "description": "The identifier of the dependency/package the user needs to install", "type": "string" }, "version": { "description": "The version of the depedency/package required for the sample", "type": "string" } }, "required": [ "id", "version" ], "type": "object" }, "sampleContent": { "properties": { "dependencies": { "description": "The list of dependencies (packages) necessary to configure OpenTelemetry for the sample", "items": { "$ref": "#/definitions/dependencyContent" }, "minItems": 1, "type": "array", "uniqueItems": true }, "description": { "description": "A brief description of the sample app. This is shown in the 'sample metadata' section on the website", "type": "string" }, "displayName": { "description": "The user friendly name of the sample app. This is shown on the website (filters)", "type": "string" }, "id": { "description": "The unique identifier of the sample app. E.g. console, webapp, rest-api", "type": "string" }, "sourceRoot": { "description": "The URL to the root directory of the sample app on GitHub. It's best to use a link with a ref to a tag/release version instead of using 'main'", "format": "uri", "type": "string" }, "steps": { "description": "The list steps necessary to configure OpenTelemetry for the sample", "items": { "$ref": "#/definitions/stepContent" }, "minItems": 1, "type": "array", "uniqueItems": true } }, "required": [ "id", "displayName", "description", "sourceRoot", "steps", "dependencies" ], "type": "object" }, "signalContent": { "properties": { "id": { "description": "The unique identifier of the telemetry signal. MUST be one of the suggested by the schema", "enum": [ "trace", "metrics", "logs" ], "type": "string" }, "samples": { "description": "The list of available sample apps for the telemetry signal", "items": { "$ref": "#/definitions/sampleContent" }, "type": "array", "uniqueItems": true } }, "required": [ "id", "samples" ], "type": "object" }, "stepContent": { "properties": { "description": { "description": "A brief description of the step", "type": "string" }, "displayName": { "description": "The user friendly name of the step. This is shown on the website in the list of steps to follow. E.g. Configure the exporter, Configure the Trace Provider", "type": "string" }, "order": { "default": 1, "description": "The order in which this step should appear in the list. Starting with 1 for the first step", "type": "integer" }, "required": { "default": true, "description": "Indicates if this step is mandatory for the user or not", "type": "boolean" }, "source": { "description": "The raw URL (raw.githubusercontent.com) to the file in the sample app that contains the code for this step. It's best to use a link with a ref to a tag/release version instead of using 'main'", "format": "uri", "type": "string" } }, "required": [ "displayName", "order", "source" ], "type": "object" } }, "properties": { "languageId": { "description": "The unique identifier of the programming language. MUST be one of the suggested by the schema", "enum": [ "csharp", "js", "go", "java", "python" ], "type": "string" }, "signals": { "description": "The list of telemetry signals for the programming language", "items": { "$ref": "#/definitions/signalContent" }, "type": "array", "uniqueItems": true } }, "required": [ "languageId", "signals" ], "title": "JSON Schema for OTel recipe files", "type": "object" }
MIT
en
joaopgrassi/otel-recipes
f013074cde46e45692dba32912188d895c65bd7e
"2024-04-14T13:45:11"
otel-recipes-schema.json
43
2024-05-27T05:31:02.973173Z
{ "$id": "https://github.com/joaopgrassi/otel-recipes/otel-recipes-schema.json", "$schema": "http://json-schema.org/draft-04/schema", "definitions": { "dependencyContent": { "properties": { "id": { "description": "The identifier of the dependency/package the user needs to install", "type": "string" }, "version": { "description": "The version of the depedency/package required for the sample", "type": "string" } }, "required": [ "id", "version" ], "type": "object" }, "stepContent": { "properties": { "description": { "description": "A brief description of the step", "type": "string" }, "displayName": { "description": "The user friendly name of the step. This is shown on the website in the list of steps to follow. E.g. Configure the exporter, Configure the Trace Provider", "type": "string" }, "order": { "default": 1, "description": "The order in which this step should appear in the list. Starting with 1 for the first step", "type": "integer" }, "required": { "default": true, "description": "Indicates if this step is mandatory for the user or not", "type": "boolean" }, "source": { "description": "The raw URL (raw.githubusercontent.com) to the file in the sample app that contains the code for this step. It's best to use a link with a ref to a tag/release version instead of using 'main'", "format": "uri", "type": "string" } }, "required": [ "displayName", "order", "source" ], "type": "object" } }, "properties": { "dependencies": { "description": "The list of dependencies (packages) necessary to configure OpenTelemetry for the sample", "items": { "$ref": "#/definitions/dependencyContent" }, "minItems": 1, "type": "array", "uniqueItems": true }, "description": { "description": "A brief description of the sample app. This is shown in the 'sample metadata' section on the website", "maxLength": 250, "type": "string" }, "displayName": { "description": "The user friendly name of the sample app. This is shown on the website (filters)", "maxLength": 100, "type": "string" }, "id": { "description": "The unique identifier of the sample app. E.g. console, webapp, rest-api", "type": "string" }, "languageId": { "description": "The unique identifier of the programming language. MUST be one of the suggested by the schema", "enum": [ "csharp", "js", "go", "java", "python" ], "type": "string" }, "signal": { "description": "The unique identifier of the telemetry signal. MUST be one of the suggested by the schema", "enum": [ "traces", "metrics", "logs" ], "type": "string" }, "sourceRoot": { "description": "The URL to the root directory of the sample app on GitHub. It's best to use a link with a ref to a tag/release version instead of using 'main'", "format": "uri", "type": "string" }, "steps": { "description": "The list steps necessary to configure OpenTelemetry for the sample", "items": { "$ref": "#/definitions/stepContent" }, "minItems": 1, "type": "array", "uniqueItems": true }, "tags": { "description": "Related tags with the language/technology of the recipe.", "type": "array" } }, "required": [ "id", "languageId", "signal", "displayName", "description", "sourceRoot", "steps", "dependencies" ], "title": "JSON Schema for OTel recipe files", "type": "object" }
MIT
en
joaopgrassi/otel-recipes
164c0cb2d2f7af2b0fa599582d1cc5411adee376
"2024-04-30T18:47:43"
otel-recipes-schema.json
43
2024-05-27T05:31:02.973173Z
{ "$id": "https://github.com/joaopgrassi/otel-recipes/otel-recipes-schema.json", "$schema": "https://json-schema.org/draft-07/schema", "definitions": { "dependencyContent": { "properties": { "id": { "description": "The identifier of the dependency/package the user needs to install", "type": "string" }, "version": { "description": "The version of the depedency/package required for the sample", "type": "string" } }, "required": [ "id", "version" ], "type": "object" }, "stepContent": { "properties": { "description": { "description": "A brief description of the step", "type": "string" }, "displayName": { "description": "The user friendly name of the step. This is shown on the website in the list of steps to follow. E.g. Configure the exporter, Configure the Trace Provider", "type": "string" }, "order": { "default": 1, "description": "The order in which this step should appear in the list. Starting with 1 for the first step", "type": "integer" }, "required": { "default": true, "description": "Indicates if this step is mandatory for the user or not", "type": "boolean" }, "source": { "description": "The raw URL (raw.githubusercontent.com) to the file in the sample app that contains the code for this step. It's best to use a link with a ref to a tag/release version instead of using 'main'", "format": "uri", "type": "string" } }, "required": [ "displayName", "order", "source" ], "type": "object" } }, "properties": { "dependencies": { "description": "The list of dependencies (packages) necessary to configure OpenTelemetry for the sample", "items": { "$ref": "#/definitions/dependencyContent" }, "minItems": 1, "type": "array", "uniqueItems": true }, "description": { "description": "A brief description of the sample app. This is shown in the 'sample metadata' section on the website", "maxLength": 250, "type": "string" }, "displayName": { "description": "The user friendly name of the sample app. This is shown on the website (filters)", "maxLength": 100, "type": "string" }, "id": { "description": "The unique identifier of the sample app. E.g. console, webapp, rest-api", "type": "string" }, "languageId": { "description": "The unique identifier of the programming language. MUST be one of the suggested by the schema", "enum": [ "csharp", "js", "go", "java", "python" ], "type": "string" }, "signal": { "description": "The unique identifier of the telemetry signal. MUST be one of the suggested by the schema", "enum": [ "traces", "metrics", "logs" ], "type": "string" }, "sourceRoot": { "description": "The URL to the root directory of the sample app on GitHub. It's best to use a link with a ref to a tag/release version instead of using 'main'", "format": "uri", "type": "string" }, "steps": { "description": "The list steps necessary to configure OpenTelemetry for the sample", "items": { "$ref": "#/definitions/stepContent" }, "minItems": 1, "type": "array", "uniqueItems": true }, "tags": { "additionalItems": false, "description": "Related tags with the language/technology of the recipe.", "items": { "enum": [ "console", "api", "db", "http", "web", "manual", "automatic" ], "type": "string" }, "maxItems": 4, "type": "array" } }, "required": [ "id", "languageId", "signal", "displayName", "description", "sourceRoot", "steps", "dependencies" ], "title": "JSON Schema for OTel recipe files", "type": "object" }
MIT
en
joaopgrassi/otel-recipes
712e6f49ef1c0089220feb823472a23170ce53ac
"2021-12-23T09:04:04"
otel-recipes-schema.json
43
2024-05-27T05:31:02.973173Z
{ "$id": "https://example.com/product.schema.json", "$schema": "http://json-schema.org/draft-04/schema", "definitions": { "appContent": { "properties": { "dependencies": { "description": "The list of OpenTelemetry dependencies.", "items": { "$ref": "#/definitions/dependencyContent" }, "minItems": 1, "type": "array", "uniqueItems": true }, "recipeFile": { "description": "The name of the file that contains the recipe to display on the website.", "type": "string" }, "source": { "description": "The link to the source code of the app on GitHub.", "format": "uri", "type": "string" }, "type": { "default": "console", "description": "The type of app.", "enum": [ "console", "api", "webapp" ], "type": "string" } }, "required": [ "type", "source", "recipeFile", "dependencies" ], "type": "object" }, "dependencyContent": { "properties": { "id": { "description": "The id/name of the dependency.", "type": "string" }, "version": { "description": "The version of the depedency needed.", "type": "string" } }, "required": [ "id", "version" ], "type": "object" }, "signalContent": { "properties": { "apps": { "description": "The list of the signal's sample apps", "items": { "$ref": "#/definitions/appContent" }, "type": "array", "uniqueItems": true }, "type": { "description": "The type of the signal", "enum": [ "trace", "metric", "log" ], "type": "string" } }, "required": [ "type", "apps" ], "type": "object" } }, "properties": { "lang": { "description": "The name of the language.", "enum": [ "csharp", "js", "go", "java", "python" ], "type": "string" }, "signals": { "description": "The list of the languages's signals", "items": { "$ref": "#/definitions/signalContent" }, "type": "array", "uniqueItems": true } }, "required": [ "lang", "signals" ], "title": "JSON Schema for OTel recipe files", "type": "object" }
MIT
en
joaopgrassi/otel-recipes
26d0722a114bdc7f21f83322a22a8c2a6ec2581f
"2022-01-08T16:02:49"
otel-recipes-schema.json
43
2024-05-27T05:31:02.973173Z
{ "$id": "https://github.com/joaopgrassi/otel-recipes/otel-recipes-schema.json", "$schema": "http://json-schema.org/draft-04/schema", "definitions": { "appContent": { "properties": { "dependencies": { "description": "The list of OpenTelemetry dependencies.", "items": { "$ref": "#/definitions/dependencyContent" }, "minItems": 1, "type": "array", "uniqueItems": true }, "recipeFile": { "description": "The name of the file that contains the recipe to display on the website.", "type": "string" }, "source": { "description": "The link to the source code of the app on GitHub.", "format": "uri", "type": "string" }, "type": { "default": "console", "description": "The type of app.", "enum": [ "console", "api", "webapp" ], "type": "string" } }, "required": [ "type", "source", "recipeFile", "dependencies" ], "type": "object" }, "dependencyContent": { "properties": { "id": { "description": "The id/name of the dependency.", "type": "string" }, "version": { "description": "The version of the depedency needed.", "type": "string" } }, "required": [ "id", "version" ], "type": "object" }, "signalContent": { "properties": { "apps": { "description": "The list of the signal's sample apps", "items": { "$ref": "#/definitions/appContent" }, "type": "array", "uniqueItems": true }, "type": { "description": "The type of the signal", "enum": [ "trace", "metric", "log" ], "type": "string" } }, "required": [ "type", "apps" ], "type": "object" } }, "properties": { "lang": { "description": "The name of the language.", "enum": [ "csharp", "js", "go", "java", "python" ], "type": "string" }, "signals": { "description": "The list of the languages's signals", "items": { "$ref": "#/definitions/signalContent" }, "type": "array", "uniqueItems": true } }, "required": [ "lang", "signals" ], "title": "JSON Schema for OTel recipe files", "type": "object" }
MIT
en
joaopgrassi/otel-recipes
dd51a71a6c8bdde8d463a358890afa8fb4135166
"2022-04-19T19:30:23"
otel-recipes-schema.json
43
2024-05-27T05:31:02.973173Z
{ "$id": "https://github.com/joaopgrassi/otel-recipes/otel-recipes-schema.json", "$schema": "http://json-schema.org/draft-04/schema", "definitions": { "dependencyContent": { "properties": { "id": { "description": "The identifier of the dependency/package the user needs to install", "type": "string" }, "version": { "description": "The version of the depedency/package required for the sample", "type": "string" } }, "required": [ "id", "version" ], "type": "object" }, "sampleContent": { "properties": { "dependencies": { "description": "The list of dependencies (packages) necessary to configure OpenTelemetry for the sample", "items": { "$ref": "#/definitions/dependencyContent" }, "minItems": 1, "type": "array", "uniqueItems": true }, "description": { "description": "A brief description of the sample app. This is shown in the 'sample metadata' section on the website", "type": "string" }, "displayName": { "description": "The user friendly name of the sample app. This is shown on the website (filters)", "type": "string" }, "id": { "description": "The unique identifier of the sample app. E.g. console, webapp, rest-api", "type": "string" }, "sourceRoot": { "description": "The URL to the root directory of the sample app on GitHub. It's best to use a link with a ref to a tag/release version instead of using 'main'", "format": "uri", "type": "string" }, "steps": { "description": "The list steps necessary to configure OpenTelemetry for the sample", "items": { "$ref": "#/definitions/stepContent" }, "minItems": 1, "type": "array", "uniqueItems": true } }, "required": [ "id", "displayName", "description", "sourceRoot", "steps", "dependencies" ], "type": "object" }, "signalContent": { "properties": { "id": { "description": "The unique identifier of the telemetry signal. MUST be one of the suggested by the schema", "enum": [ "trace", "metric", "log" ], "type": "string" }, "samples": { "description": "The list of available sample apps for the telemetry signal", "items": { "$ref": "#/definitions/sampleContent" }, "type": "array", "uniqueItems": true } }, "required": [ "id", "samples" ], "type": "object" }, "stepContent": { "properties": { "description": { "description": "A brief description of the step", "type": "string" }, "displayName": { "description": "The user friendly name of the step. This is shown on the website in the list of steps to follow. E.g. Configure the exporter, Configure the Trace Provider", "type": "string" }, "order": { "default": 1, "description": "The order in which this step should appear in the list. Starting with 1 for the first step", "type": "integer" }, "required": { "default": true, "description": "Indicates if this step is mandatory for the user or not", "type": "boolean" }, "source": { "description": "The raw URL (raw.githubusercontent.com) to the file in the sample app that contains the code for this step. It's best to use a link with a ref to a tag/release version instead of using 'main'", "format": "uri", "type": "string" } }, "required": [ "displayName", "order", "source" ], "type": "object" } }, "properties": { "languageId": { "description": "The unique identifier of the programming language. MUST be one of the suggested by the schema", "enum": [ "csharp", "js", "go", "java", "python" ], "type": "string" }, "signals": { "description": "The list of telemetry signals for the programming language", "items": { "$ref": "#/definitions/signalContent" }, "type": "array", "uniqueItems": true } }, "required": [ "languageId", "signals" ], "title": "JSON Schema for OTel recipe files", "type": "object" }
MIT
en
joaopgrassi/otel-recipes
7c2ff72b21d594e31ce415338062cccf1de764c9
"2024-03-13T22:25:12"
otel-recipes-schema.json
43
2024-05-27T05:31:02.973173Z
{ "$id": "https://github.com/joaopgrassi/otel-recipes/otel-recipes-schema.json", "$schema": "http://json-schema.org/draft-04/schema", "definitions": { "dependencyContent": { "properties": { "id": { "description": "The identifier of the dependency/package the user needs to install", "type": "string" }, "version": { "description": "The version of the depedency/package required for the sample", "type": "string" } }, "required": [ "id", "version" ], "type": "object" }, "stepContent": { "properties": { "description": { "description": "A brief description of the step", "type": "string" }, "displayName": { "description": "The user friendly name of the step. This is shown on the website in the list of steps to follow. E.g. Configure the exporter, Configure the Trace Provider", "type": "string" }, "order": { "default": 1, "description": "The order in which this step should appear in the list. Starting with 1 for the first step", "type": "integer" }, "required": { "default": true, "description": "Indicates if this step is mandatory for the user or not", "type": "boolean" }, "source": { "description": "The raw URL (raw.githubusercontent.com) to the file in the sample app that contains the code for this step. It's best to use a link with a ref to a tag/release version instead of using 'main'", "format": "uri", "type": "string" } }, "required": [ "displayName", "order", "source" ], "type": "object" } }, "properties": { "dependencies": { "description": "The list of dependencies (packages) necessary to configure OpenTelemetry for the sample", "items": { "$ref": "#/definitions/dependencyContent" }, "minItems": 1, "type": "array", "uniqueItems": true }, "description": { "description": "A brief description of the sample app. This is shown in the 'sample metadata' section on the website", "maxLength": 250, "type": "string" }, "displayName": { "description": "The user friendly name of the sample app. This is shown on the website (filters)", "maxLength": 100, "type": "string" }, "id": { "description": "The unique identifier of the sample app. E.g. console, webapp, rest-api", "type": "string" }, "languageId": { "description": "The unique identifier of the programming language. MUST be one of the suggested by the schema", "enum": [ "csharp", "js", "go", "java", "python" ], "type": "string" }, "signal": { "description": "The unique identifier of the telemetry signal. MUST be one of the suggested by the schema", "enum": [ "trace", "metrics", "logs" ], "type": "string" }, "sourceRoot": { "description": "The URL to the root directory of the sample app on GitHub. It's best to use a link with a ref to a tag/release version instead of using 'main'", "format": "uri", "type": "string" }, "steps": { "description": "The list steps necessary to configure OpenTelemetry for the sample", "items": { "$ref": "#/definitions/stepContent" }, "minItems": 1, "type": "array", "uniqueItems": true }, "tags": { "description": "Related tags with the language/technology of the recipe.", "type": "array" } }, "required": [ "id", "languageId", "signal", "displayName", "description", "sourceRoot", "steps", "dependencies" ], "title": "JSON Schema for OTel recipe files", "type": "object" }
MIT
en
gravitee-io/gravitee-ui-particles
2b5ba9e55b57327d2bb82922a5b207f1de72f255
"2024-04-24T07:14:17"
projects/ui-particles-angular/src/lib/gio-monaco-editor/data/el-schema.json
6
2024-05-27T08:20:34.525566Z
{ "$defs": { "HttpHeaders": { "additionalProperties": { "enum": [ "Accept", "Accept-Charset", "Accept-Encoding", "Accept-Language", "Accept-Ranges", "Access-Control-Allow-Credentials", "Access-Control-Allow-Headers", "Access-Control-Allow-Methods", "Access-Control-Allow-Origin", "Access-Control-Expose-Headers", "Access-Control-Max-Age", "Access-Control-Request-Headers", "Access-Control-Request-Method", "Age", "Allow", "Authorization", "Cache-Control", "Connection", "Content-Disposition", "Content-Encoding", "Content-ID", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Cookie", "Date", "ETag", "Expires", "Expect", "Forwarded", "From", "Host", "If-Match", "If-Modified-Since", "If-None-Match", "If-Unmodified-Since", "Keep-Alive", "Last-Modified", "Location", "Link", "Max-Forwards", "MIME-Version", "Origin", "Pragma", "Proxy-Authenticate", "Proxy-Authorization", "Proxy-Connection", "Range", "Referer", "Retry-After", "Server", "Set-Cookie", "Set-Cookie2", "TE", "Trailer", "Transfer-Encoding", "Upgrade", "User-Agent", "Vary", "Via", "Warning", "WWW-Authenticate", "X-Forwarded-For", "X-Forwarded-Proto", "X-Forwarded-Server", "X-Forwarded-Host", "X-Forwarded-Port", "X-Forwarded-Prefix" ], "type": "string" }, "type": "object" }, "SSLPrincipal": { "properties": { "attributes": { "additionalProperties": { "items": { "type": "string" }, "type": "array" }, "type": "object" }, "businessCategory": { "type": "string" }, "c": { "type": "string" }, "cn": { "type": "string" }, "countryOfCitizenship": { "type": "string" }, "countryOfResidence": { "type": "string" }, "dateOfBirth": { "type": "string" }, "dc": { "type": "string" }, "description": { "type": "string" }, "dmdName": { "type": "string" }, "dn": { "type": "string" }, "dnQualifier": { "type": "string" }, "e": { "type": "string" }, "emailAddress": { "type": "string" }, "gender": { "type": "string" }, "generation": { "type": "string" }, "givenname": { "type": "string" }, "initials": { "type": "string" }, "l": { "type": "string" }, "name": { "type": "string" }, "nameAtBirth": { "type": "string" }, "o": { "type": "string" }, "organizationIdentifier": { "type": "string" }, "ou": { "type": "string" }, "placeOfBirth": { "type": "string" }, "postalAddress": { "type": "string" }, "postalCode": { "type": "string" }, "pseudonym": { "type": "string" }, "role": { "type": "string" }, "serialnumber": { "type": "string" }, "st": { "type": "string" }, "street": { "type": "string" }, "surname": { "type": "string" }, "t": { "type": "string" }, "telephoneNumber": { "type": "string" }, "uid": { "type": "string" }, "uniqueIdentifier": { "type": "string" }, "unstructuredAddress": { "type": "string" } }, "type": "object" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "api": { "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "properties": { "additionalProperties": { "type": "string" }, "type": "object" }, "version": { "type": "string" } }, "type": "object" }, "context": { "properties": { "attributes": { "additionalProperties": { "type": "object" }, "type": "object" } }, "type": "object" }, "dictionaries": { "additionalProperties": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": "object" }, "node": { "properties": { "id": { "type": "string" }, "shardingTags": { "items": { "type": "string" }, "type": "array" }, "tenant": { "type": "string" }, "version": { "type": "string" }, "zone": { "type": "string" } }, "type": "object" }, "request": { "properties": { "content": { "type": "string" }, "contextPath": { "type": "string" }, "headers": { "$ref": "#/$defs/HttpHeaders" }, "host": { "type": "string" }, "id": { "type": "string" }, "jsonContent": { "additionalProperties": { "type": "object" }, "type": "object" }, "localAddress": { "type": "string" }, "method": { "type": "string" }, "params": { "additionalProperties": { "items": { "type": "string" }, "type": "array" }, "type": "object" }, "path": { "type": "string" }, "pathInfo": { "type": "string" }, "pathInfos": { "items": { "type": "string" }, "type": "array" }, "pathParams": { "additionalProperties": { "items": { "type": "string" }, "type": "array" }, "type": "object" }, "paths": { "items": { "type": "string" }, "type": "array" }, "remoteAddress": { "type": "string" }, "scheme": { "type": "string" }, "ssl": { "properties": { "client": { "$ref": "#/$defs/SSLPrincipal" }, "clientHost": { "type": "string" }, "clientPort": { "type": "integer" }, "server": { "$ref": "#/$defs/SSLPrincipal" } }, "type": "object" }, "timestamp": { "type": "integer" }, "transactionId": { "type": "string" }, "uri": { "type": "string" }, "version": { "type": "string" }, "xmlContent": { "additionalProperties": { "type": "object" }, "type": "object" } }, "type": "object" }, "response": { "properties": { "content": { "type": "string" }, "headers": { "$ref": "#/$defs/HttpHeaders" }, "jsonContent": { "additionalProperties": { "type": "object" }, "type": "object" }, "status": { "type": "integer" }, "xmlContent": { "additionalProperties": { "type": "object" }, "type": "object" } }, "type": "object" }, "subscription": { "properties": { "id": { "type": "string" }, "metadata": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": { "enum": [ "STANDARD", "PUSH" ], "type": "string" } }, "type": "object" } }, "type": "object" }
Apache-2.0
en
the-guild-org/conductor
39be00b2e2831bf9de67523d13abf987cad5bd02
"2023-12-21T08:42:39"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/persisted", "plugins": [ { "config": { "allow_non_persisted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "persisted_operations" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PersistedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "PersistedOperationHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "PersistedOperationsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `persisted_operations.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "enabled": true, "type": "persisted_operations" }, { "$metadata": { "description": "This example uses a local file store called `persisted_operations.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "enabled": true, "type": "persisted_operations" } ], "properties": { "allow_non_persisted": { "description": "By default, this plugin does not allow non-persisted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/PersistedOperationsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/PersistedOperationsPluginStoreConfig", "description": "The store defines the source of persisted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "PersistedOperationsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/PersistedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "PersistedOperationsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/PersistedOperationsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "persisted_operations" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor-t2:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor-t2/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
b38c94fb35814a87a2863e9351031a458b55939b
"2023-11-27T13:28:02"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/persisted", "plugins": [ { "config": { "allow_non_persisted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "persisted_operations" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PersistedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "PersistedOperationHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "PersistedOperationsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `persisted_operations.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" }, { "$metadata": { "description": "This example uses a local file store called `persisted_operations.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" } ], "properties": { "allow_non_persisted": { "description": "By default, this plugin does not allow non-persisted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/PersistedOperationsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/PersistedOperationsPluginStoreConfig", "description": "The store defines the source of persisted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "PersistedOperationsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/PersistedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "PersistedOperationsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/PersistedOperationsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "persisted_operations" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor-t2:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor-t2/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
a106fbd8fa3d4a6dc31422dd622ac389baef64bc
"2024-01-10T12:41:16"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/trusted", "plugins": [ { "config": { "allow_untrusted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "trusted_documents" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used." }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "MockedSourceConfig": { "description": "A mocked upstream with a static response for all executed operations.", "properties": { "response_data": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "response_data" ], "type": "object" }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TrustedDocumentsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "trusted_documents" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/MockedSourceConfig", "description": "The configuration for the mocked source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "mock" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "TrustedDocumentHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "TrustedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "TrustedDocumentsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `trusted_documents.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" }, { "$metadata": { "description": "This example uses a local file store called `trusted_documents.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" } ], "properties": { "allow_untrusted": { "description": "By default, this plugin does not allow untrusted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/TrustedDocumentsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/TrustedDocumentsPluginStoreConfig", "description": "The store defines the source of trusted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "TrustedDocumentsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/TrustedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "TrustedDocumentsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor-t2:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor-t2/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
1af650fe38adb4f239d358415f9426ef0f1263ea
"2023-11-19T09:01:42"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "CorsListStringConfig": { "anyOf": [ { "type": "null" }, { "items": { "type": "string" }, "type": "array" } ] }, "CorsPluginConfig": { "properties": { "allow_credentials": { "description": "Access-Control-Allow-Credentials (default: false)", "type": [ "boolean", "null" ] }, "allow_private_network": { "description": "Access-Control-Allow-Origin (default: false)", "type": [ "boolean", "null" ] }, "allowed_headers": { "anyOf": [ { "$ref": "#/definitions/CorsListStringConfig" }, { "type": "null" } ], "description": "Access-Control-Allow-Headers (default: Any)" }, "allowed_methods": { "anyOf": [ { "$ref": "#/definitions/CorsListStringConfig" }, { "type": "null" } ], "description": "Access-Control-Allow-Methods (default: Any)" }, "allowed_origin": { "anyOf": [ { "$ref": "#/definitions/CorsStringConfig" }, { "type": "null" } ], "description": "Access-Control-Allow-Origin (default: Any)" }, "max_age": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "description": "Access-Control-Max-Age (default: empty)" } }, "type": "object" }, "CorsStringConfig": { "anyOf": [ { "type": "null" }, { "type": "string" } ] }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "properties": { "from": { "description": "The identifier of the source to be used. This must match the `id` field of a source definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "GraphQLSourceConfig": { "properties": { "endpoint": { "description": "The endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "HttpGetPluginConfig": { "properties": { "mutations": { "description": "Allow mutations over GET requests. Disabled by default. This is not recommended. This restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "allOf": [ { "$ref": "#/definitions/Level" } ], "description": "Log level" } }, "type": "object" }, "PersistedDocumentsFileFormat": { "oneOf": [ { "description": "Apollo Persisted Query Manifest format, see https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest", "enum": [ "apollo_persisted_query_manifest" ], "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: {\"key1\": \"query { __typename }\"}", "enum": [ "json_key_value" ], "type": "string" } ] }, "PersistedOperationHttpGetParameterLocation": { "oneOf": [ { "description": "The parameter is obtained from the query string of the HTTP request.", "properties": { "name": { "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "type": "object" }, { "description": "The parameter is obtained from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "type": "object" }, { "description": "The parameter is obtained from a header in the HTTP request.", "properties": { "name": { "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "type": "object" } ] }, "PersistedOperationsPluginConfig": { "properties": { "allow_non_persisted": { "description": "By default, enabling this plugin does not allow non-persisted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be used to execute persisted operations.", "items": { "$ref": "#/definitions/PersistedOperationsProtocolConfig" }, "type": "array" }, "store": { "allOf": [ { "$ref": "#/definitions/PersistedOperationsPluginStoreConfig" } ], "description": "The store defines the source of persisted documents." } }, "required": [ "protocols", "store" ], "type": "object" }, "PersistedOperationsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration.", "properties": { "format": { "allOf": [ { "$ref": "#/definitions/PersistedDocumentsFileFormat" } ], "description": "The format and the expected structure of the loaded store file." }, "path": { "allOf": [ { "$ref": "#/definitions/LocalFileReference" } ], "description": "A path to a local file on the file-system." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "type": "object" } ] }, "PersistedOperationsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on Apollo's Persisted Query Extensions (see https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest) The GraphQL operation key is sent over POST and contains \"extensions\" field with the GraphQL document hash.\n\nExample: POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "This protocol is based on a POST request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}", "properties": { "field_name": { "default": "documentId", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "This protocol is based on a GET request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nExample: GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test", "properties": { "document_id_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation" }, "operation_name_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation" }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation" } }, "required": [ "type" ], "type": "object" } ] }, "PluginDefinition": { "oneOf": [ { "description": "CORS plugin", "properties": { "config": { "allOf": [ { "$ref": "#/definitions/CorsPluginConfig" } ], "description": "CORS configuration object. You may also specify an empty object ( {} ) to use the default permissive configuration." }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "description": "GraphiQL over HTTP GET plugin.", "properties": { "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ], "description": "HTTP-GET GraphQL execution, based on GraphQL-Over-HTTP specification: https://graphql.github.io/graphql-over-http/draft/" }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "allOf": [ { "$ref": "#/definitions/PersistedOperationsPluginConfig" } ], "description": "Persisted Documents plugin for improved performance, reduced network traffic and hardened GraphQL layer." }, "type": { "enum": [ "persisted_operations" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "allOf": [ { "$ref": "#/definitions/GraphQLSourceConfig" } ], "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] } }, "description": "The top-level configuration object for Conductor gateway.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "allOf": [ { "$ref": "#/definitions/LoggerConfig" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "allOf": [ { "$ref": "#/definitions/ServerConfig" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
28f16b483708523d9d027db80f6277f1c8e9616c
"2023-11-26T11:19:05"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "config": null, "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/persisted", "plugins": [ { "config": { "allow_non_persisted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "persisted_operations" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PersistedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "PersistedOperationHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "PersistedOperationsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `persisted_operations.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" }, { "$metadata": { "description": "This example uses a local file store called `persisted_operations.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" } ], "properties": { "allow_non_persisted": { "description": "By default, this plugin does not allow non-persisted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/PersistedOperationsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/PersistedOperationsPluginStoreConfig", "description": "The store defines the source of persisted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "PersistedOperationsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/PersistedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "PersistedOperationsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/PersistedOperationsPluginConfig" }, "type": { "enum": [ "persisted_operations" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```\n\n./conductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor-t2:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor-t2/releases).", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
29a2ce3e24857eec35cddd9e4b1590b1ca752cfd
"2024-01-11T08:56:00"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/trusted", "plugins": [ { "config": { "allow_untrusted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "trusted_documents" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used." }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "MockedSourceConfig": { "description": "A mocked upstream with a static response for all executed operations.", "properties": { "response_data": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "response_data" ], "type": "object" }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TrustedDocumentsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "trusted_documents" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/MockedSourceConfig", "description": "The configuration for the mocked source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "mock" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "TrustedDocumentHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "TrustedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "TrustedDocumentsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `trusted_documents.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" }, { "$metadata": { "description": "This example uses a local file store called `trusted_documents.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" } ], "properties": { "allow_untrusted": { "description": "By default, this plugin does not allow untrusted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/TrustedDocumentsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/TrustedDocumentsPluginStoreConfig", "description": "The store defines the source of trusted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "TrustedDocumentsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/TrustedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "TrustedDocumentsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
dc8f0d3197922d612816fd3f443d69158eb934d7
"2023-12-18T06:42:24"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/persisted", "plugins": [ { "config": { "allow_non_persisted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "persisted_operations" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n### Query Parameters\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n- `query`: The GraphQL query to execute\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n- `operationName` (optional): The name of the GraphQL operation to execute\n### Headers\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PersistedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "PersistedOperationHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "PersistedOperationsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `persisted_operations.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" }, { "$metadata": { "description": "This example uses a local file store called `persisted_operations.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" } ], "properties": { "allow_non_persisted": { "description": "By default, this plugin does not allow non-persisted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/PersistedOperationsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/PersistedOperationsPluginStoreConfig", "description": "The store defines the source of persisted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "PersistedOperationsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/PersistedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "PersistedOperationsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the CORS plugin. This plugin allows you to specify Cross-Origin Resource Sharing (CORS) policies.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/PersistedOperationsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "persisted_operations" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n### Writing VRL\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n#### Variables and Functions\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n```vrl\nmyVar = \"my value\"\nlog(myVar, level:\"info\")\n```\n#### Assignment\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n```vrl\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n```\n#### Metadata\nThe `%` is used to access metadata values. Note that metadata values are read only.\nThe following program is printing a metadata value to the console:\n```vrl\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n```\n#### Further Reading\n- [VRL Playground](https://playground.vrl.dev/)\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n### Runtime Failure Handling\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n```vrl\n# This function is fallible, and can create errors, so it must be handled.\nparsed, err = parse_json(\"invalid json\")\n```\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n```vrl\nparsed = parse_json!(\"invalid json\")\n```\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n### Input/Output\n#### `on_downstream_http_request`\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\nThe following metadata inputs are available to the hook:\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\nThe following output values are available to the hook:\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n#### `on_downstream_graphql_request`\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\nThe following metadata inputs are available to the hook:\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\nThe following output values are available to the hook:\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n#### `on_upstream_http_request`\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\nThe following metadata inputs are available to the hook:\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\nThe following output values are available to the hook:\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n#### `on_downstream_http_response`\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\nThe following metadata inputs are available to the hook:\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\nThe following output values are available to the hook:\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n### Shared State\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\nYou can find an example for this in the **Examples** section below.\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\n short_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\nConductor supports both YAML and JSON format for the configuration file.\n## Loading the config file\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n### Binary\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n```sh\nconductor my-config-file.json\n```\n> By default, Conductor will look for a file named `config.json` in the current directory.\n### Docker\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n```sh\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor-t2:latest /app/config.json\n```\n### CloudFlare Worker\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n## Autocomplete/validation in VSCode\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n```json filename=\"config.json\"\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\" }\n```\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n```yaml filename=\"config.yaml\"\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\"\n```\n### JSONSchema\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor-t2/releases).\n### Configuration Interpolation with Environment Variables\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
6a0f9344baff3fd1270cc0770532e85bcceefbb2
"2024-01-22T09:42:51"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/trusted", "plugins": [ { "config": { "allow_untrusted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "trusted_documents" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "FederationSourceConfig": { "description": "A source capable of loading a Supergraph schema based on the [Apollo Federation specification](https://www.apollographql.com/docs/federation/).\n\nThe loaded supergraph will be used to orchestrate the execution of the queries across the federated sources.\n\nThe input for this source can be a local file, an environment variable, or a remote endpoint.\n\nThe content of the Supergraph input needs to be a valid GraphQL SDL schema, with the Apollo Federation execution directives, usually produced by a schema registry.", "examples": [ { "$metadata": { "description": "This example is loading a Supergraph schema from a remote endpoint, using the Hive CDN. ", "title": "Hive" }, "config": { "expose_query_plan": false, "supergraph": { "remote": { "fetch_every": "10s", "headers": { "X-Hive-CDN-Key": "CDN_TOKEN" }, "url": "https://cdn.graphql-hive.com/artifacts/v1/TARGET_ID/supergraph" } } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From a file" }, "config": { "expose_query_plan": false, "supergraph": { "file": "./supergraph.graphql" } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From Env Var" }, "config": { "expose_query_plan": false, "supergraph": { "env": "SUPERGRAPH" } }, "id": "my-source", "type": "federation" } ], "properties": { "expose_query_plan": { "default": false, "description": "Exposes the query plan as JSON under \"extensions\"", "type": "boolean" }, "supergraph": { "$ref": "#/definitions/SupergraphSourceConfig", "description": "The endpoint URL for the GraphQL source." } }, "required": [ "supergraph" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used." }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TrustedDocumentsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "trusted_documents" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "federation endpoint", "properties": { "config": { "$ref": "#/definitions/FederationSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "federation" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "SupergraphSourceConfig": { "oneOf": [ { "additionalProperties": false, "description": "The file path for the Supergraph schema.\n\n> This provider is not supported on WASM runtime.", "properties": { "file": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "file" ], "title": "file", "type": "object" }, { "additionalProperties": false, "description": "The environment variable that contains the Supergraph schema.", "properties": { "env": { "type": "string" } }, "required": [ "env" ], "title": "env", "type": "object" }, { "additionalProperties": false, "description": "The remote endpoint where the Supergraph schema can be fetched.", "properties": { "remote": { "properties": { "fetch_every": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "1m", "description": "Polling interval for fetching the Supergraph schema from the remote." }, "headers": { "additionalProperties": { "type": "string" }, "description": "Optional headers to include in the request (ex: for authentication)", "type": [ "object", "null" ] }, "url": { "description": "The URL endpoint from where to fetch the Supergraph schema.", "type": "string" } }, "required": [ "url" ], "type": "object" } }, "required": [ "remote" ], "title": "remote", "type": "object" } ] }, "TrustedDocumentHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "TrustedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "TrustedDocumentsPluginConfig": { "description": "This plugin allows you to define a list of trusted GraphQL documents that can be executed by the gateway (also called **Persisted Operations**).\n\nFor additional information, please refer to [Trusted Documents](https://benjie.dev/graphql/trusted-documents).", "examples": [ { "$metadata": { "description": "This example is using a local file called `trusted_documents.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" }, { "$metadata": { "description": "This example uses a local file store called `trusted_documents.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" } ], "properties": { "allow_untrusted": { "description": "By default, this plugin does not allow untrusted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/TrustedDocumentsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/TrustedDocumentsPluginStoreConfig", "description": "The store defines the source of trusted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "TrustedDocumentsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/TrustedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "TrustedDocumentsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
533fa08b153897a1a5112791c2a57c1368919eda
"2024-01-01T07:03:49"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/persisted", "plugins": [ { "config": { "allow_non_persisted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "persisted_operations" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used." }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PersistedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "PersistedOperationHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "PersistedOperationsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `persisted_operations.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "enabled": true, "type": "persisted_operations" }, { "$metadata": { "description": "This example uses a local file store called `persisted_operations.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "enabled": true, "type": "persisted_operations" } ], "properties": { "allow_non_persisted": { "description": "By default, this plugin does not allow non-persisted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/PersistedOperationsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/PersistedOperationsPluginStoreConfig", "description": "The store defines the source of persisted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "PersistedOperationsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/PersistedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "PersistedOperationsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/PersistedOperationsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "persisted_operations" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor-t2:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor-t2/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
7435f486f084659e3a23c72551ebca0307c30ca8
"2023-11-27T08:13:55"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "config": null, "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/persisted", "plugins": [ { "config": { "allow_non_persisted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "persisted_operations" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PersistedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "PersistedOperationHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "PersistedOperationsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `persisted_operations.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" }, { "$metadata": { "description": "This example uses a local file store called `persisted_operations.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" } ], "properties": { "allow_non_persisted": { "description": "By default, this plugin does not allow non-persisted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/PersistedOperationsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/PersistedOperationsPluginStoreConfig", "description": "The store defines the source of persisted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "PersistedOperationsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/PersistedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "PersistedOperationsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/PersistedOperationsPluginConfig" }, "type": { "enum": [ "persisted_operations" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor-t2:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor-t2/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
4dedc4eee86b4fbf14d7ad2ecc16ee5f88c08e9c
"2024-01-11T15:47:48"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/trusted", "plugins": [ { "config": { "allow_untrusted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "trusted_documents" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "FederationSourceConfig": { "properties": { "supergraph": { "$ref": "#/definitions/SupergraphSourceConfig", "description": "The endpoint URL for the GraphQL source." } }, "required": [ "supergraph" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used." }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TrustedDocumentsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "trusted_documents" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "federation endpoint", "properties": { "config": { "$ref": "#/definitions/FederationSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "federation" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "SupergraphSourceConfig": { "oneOf": [ { "additionalProperties": false, "description": "The file path for the Supergraph schema.", "properties": { "file": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "file" ], "type": "object" }, { "additionalProperties": false, "description": "The environment variable that contains the Supergraph schema.", "properties": { "env": { "type": "string" } }, "required": [ "env" ], "type": "object" }, { "additionalProperties": false, "description": "The remote endpoint where the Supergraph schema can be fetched.", "properties": { "remote": { "properties": { "fetch_every": { "type": [ "string", "null" ] }, "headers": { "additionalProperties": { "type": "string" }, "description": "Optional headers to include in the request (ex: for authentication)", "type": [ "object", "null" ] }, "url": { "description": "The URL endpoint from where to fetch the Supergraph schema.", "type": "string" } }, "required": [ "url" ], "type": "object" } }, "required": [ "remote" ], "type": "object" } ] }, "TrustedDocumentHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "TrustedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "TrustedDocumentsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `trusted_documents.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" }, { "$metadata": { "description": "This example uses a local file store called `trusted_documents.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" } ], "properties": { "allow_untrusted": { "description": "By default, this plugin does not allow untrusted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/TrustedDocumentsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/TrustedDocumentsPluginStoreConfig", "description": "The store defines the source of trusted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "TrustedDocumentsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/TrustedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "TrustedDocumentsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
a474fcf7e0659b12fbe808043baff65cfc3e97a1
"2024-03-04T08:45:52"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/trusted", "plugins": [ { "config": { "allow_untrusted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "trusted_documents" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "FederationSourceConfig": { "description": "A source capable of loading a Supergraph schema based on the [Apollo Federation specification](https://www.apollographql.com/docs/federation/).\n\nThe loaded supergraph will be used to orchestrate the execution of the queries across the federated sources.\n\nThe input for this source can be a local file, an environment variable, or a remote endpoint.\n\nThe content of the Supergraph input needs to be a valid GraphQL SDL schema, with the Apollo Federation execution directives, usually produced by a schema registry.", "examples": [ { "$metadata": { "description": "This example is loading a Supergraph schema from a remote endpoint, using the Hive CDN. ", "title": "Hive" }, "config": { "expose_query_plan": false, "supergraph": { "remote": { "fetch_every": "10s", "headers": { "X-Hive-CDN-Key": "CDN_TOKEN" }, "url": "https://cdn.graphql-hive.com/artifacts/v1/TARGET_ID/supergraph" } } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From a file" }, "config": { "expose_query_plan": false, "supergraph": { "file": "./supergraph.graphql" } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From Env Var" }, "config": { "expose_query_plan": false, "supergraph": { "env": "SUPERGRAPH" } }, "id": "my-source", "type": "federation" } ], "properties": { "expose_query_plan": { "default": false, "description": "Exposes the query plan as JSON under \"extensions\"", "type": "boolean" }, "supergraph": { "$ref": "#/definitions/SupergraphSourceConfig", "description": "The endpoint URL for the GraphQL source." } }, "required": [ "supergraph" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used.", "type": "string" }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "filter": { "default": "info", "description": "Environment filter configuration as a string. This allows extremely powerful control over Conductor's logging.\n\nThe `filter` can specify various directives to filter logs based on module paths, span names, and specific fields. These directives can also be combined using commas as a separator.\n\n**Basic Usage:**\n\n- `info` (logs all messages at info level and higher across all modules)\n\n- `error` (logs all messages at error level only, as it's the highest level of severity)\n\n**Module-Specific Logging:**\n\n- `conductor::gateway=debug` (logs all debug messages for the 'conductor::gateway' module)\n\n- `conductor::engine::source=trace` (logs all trace messages for the 'conductor::engine::source' module)\n\n**Combining Directives:**\n\n- `conductor::gateway=info,conductor::engine::source=trace` (sets info level for the gateway module and trace level for the engine's source module)\n\nThe syntax of directives is very flexible, allowing complex logging configurations.\n\nSee [tracing_subscriber::EnvFilter](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html) for more information.", "type": "string" }, "format": { "$ref": "#/definitions/LoggerConfigFormat", "default": "pretty", "description": "Configured the logger format. See options below.\n\n- `pretty` format is human-readable, ideal for development and debugging.\n\n- `json` format is structured, suitable for production environments and log analysis tools.\n\nBy default, `pretty` is used in TTY environments, and `json` is used in non-TTY environments." }, "print_performance_info": { "default": false, "description": "Emits performance information on in crucial areas of the gateway.\n\nLook for `close` and `idle` spans printed in the logs.\n\nNote: this option is not enabled on WASM runtime, and will be ignored if specified.", "type": "boolean" } }, "type": "object" }, "LoggerConfigFormat": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "This logging format outputs minimal, compact logs. It focuses on the essential parts of the log message and its fields, making it suitable for production environments where performance and log size are crucial.\n\nPros:\n\n- Efficient in terms of space and performance.\n\n- Easy to read for brief messages and simple logs.\n\nCons:\n\n- May lack detailed context, making debugging a bit more challenging.", "enum": [ "compact" ], "title": "compact", "type": "string" }, { "description": "The pretty format is designed for enhanced readability, featuring more verbose output including well-formatted fields and context. Ideal for development and debugging purposes.\n\nPros:\n\n- Highly readable and provides detailed context.\n\n- Easier to understand complex log messages.\n\nCons:\n\n- More verbose, resulting in larger log sizes.\n\n- Potentially slower performance due to the additional formatting overhead.", "enum": [ "pretty" ], "title": "pretty", "type": "string" }, { "description": "This format outputs logs in JSON. It is particularly useful when integrating with tools that consume or process JSON logs, such as log aggregators and analysis systems.\n\nPros:\n\n- Structured format makes it easy to parse and integrate with various tools.\n\n- Consistent and predictable output.\n\nCons:\n\n- Can be verbose and harder to read directly by developers.\n\n- Slightly more overhead compared to simpler formats like compact.", "enum": [ "json" ], "title": "json", "type": "string" } ] }, "MockedSourceConfig": { "description": "A mocked upstream with a static response for all executed operations.", "properties": { "response_data": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "response_data" ], "type": "object" }, "OtlpProtcol": { "oneOf": [ { "description": "Uses GRPC with `tonic` to send telemetry data.", "enum": [ "grpc" ], "title": "grpc", "type": "string" }, { "description": "Uses HTTP with `http-proto` to send telemetry data.", "enum": [ "http" ], "title": "http", "type": "string" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TrustedDocumentsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "trusted_documents" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TelemetryPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "telemetry" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/MockedSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "mock" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "federation endpoint", "properties": { "config": { "$ref": "#/definitions/FederationSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "federation" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "SupergraphSourceConfig": { "oneOf": [ { "additionalProperties": false, "description": "The file path for the Supergraph schema.\n\n> This provider is not supported on WASM runtime.", "properties": { "file": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "file" ], "title": "file", "type": "object" }, { "additionalProperties": false, "description": "The environment variable that contains the Supergraph schema.", "properties": { "env": { "type": "string" } }, "required": [ "env" ], "title": "env", "type": "object" }, { "additionalProperties": false, "description": "The remote endpoint where the Supergraph schema can be fetched.", "properties": { "remote": { "properties": { "fetch_every": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "1m", "description": "Polling interval for fetching the Supergraph schema from the remote." }, "headers": { "additionalProperties": { "type": "string" }, "description": "Optional headers to include in the request (ex: for authentication)", "type": [ "object", "null" ] }, "url": { "description": "The URL endpoint from where to fetch the Supergraph schema.", "type": "string" } }, "required": [ "url" ], "type": "object" } }, "required": [ "remote" ], "title": "remote", "type": "object" } ] }, "TelemetryPluginConfig": { "description": "The `telemetry` plugin exports traces information about Conductor to a telemetry backend.\n\nThe telemetry plugin exports traces information about the following aspects of Conductor:\n\n- GraphQL parser (timing)\n\n- GraphQL execution (operation type, operation body, operation name, timing, errors)\n\n- Query planning (timing, operation body, operation name)\n\n- Incoming HTTP requests (attributes, timing, errors)\n\n- Outgoing HTTP requests (attributes, timing, errors)\n\nWhen used with a telemtry backend, you can expect to see the following information:\n\n![img](https://raw.githubusercontent.com/the-guild-org/conductor/master/website/public/assets/telemetry.png)", "properties": { "service_name": { "default": "conductor", "description": "Configures the service name that reports the telemetry data. This will appear in the telemetry data as the `service.name` attribute.", "type": "string" }, "targets": { "description": "A list of telemetry targets to send telemetry data to.\n\nThe telemtry data is scoped per endpoint, and you can specify multiple targets if you need to export stats to multiple backends.", "items": { "$ref": "#/definitions/TelemetryTarget" }, "type": "array" } }, "required": [ "targets" ], "type": "object" }, "TelemetryTarget": { "oneOf": [ { "description": "Sends telemetry data to `stdout` in a human-readable format.\n\nUse this source for debugging purposes, or if you want to pipe the telemetry data to another process.", "properties": { "type": { "enum": [ "stdout" ], "type": "string" } }, "required": [ "type" ], "title": "stdout", "type": "object" }, { "description": "Sends telemetry traces data to a [Zipkin](https://zipkin.io/) collector, using the HTTP protocol.\n\nTo get started with Zipkin, use the following command to start the Zipkin collector and UI in your local machine, using Docker:\n\n`docker run -d -p 9411:9411 openzipkin/zipkin`", "properties": { "collector_endpoint": { "default": "http://127.0.0.1:9411/api/v2/spans", "description": "The Zipkin endpoint. Please use full URL endpoint format, e.g. `http://127.0.0.1:9411/api/v2/spans`.", "type": "string" }, "type": { "enum": [ "zipkin" ], "type": "string" } }, "required": [ "type" ], "title": "zipkin", "type": "object" }, { "description": "Sends telemetry traces data to an [OpenTelemetry](https://opentelemetry.io/) backend, using the [OTLP protocol](https://opentelemetry.io/docs/specs/otel/protocol/).\n\nYou can find [here a list backends that supports the OTLP format](https://github.com/magsther/awesome-opentelemetry#open-source).", "properties": { "endpoint": { "description": "The OTLP backend endpoint. The format is based on full URL, e.g. `http://localhost:7201`.", "type": "string" }, "gzip_compression": { "default": false, "description": "Whether to use gzip compression when sending telemetry data.\n\nPlease verify your backend supports and enables `gzip` compression before enabling this option.", "type": "boolean" }, "protocol": { "$ref": "#/definitions/OtlpProtcol", "default": "grpc", "description": "The OTLP transport to use to export telemetry data.\n\n> \u2757\ufe0f The gRPC transport is not supported on WASM runtime (CloudFlare Worker)." }, "timeout": { "default": "10s", "description": "Export timeout. You can use the human-readable format in this field, e.g. `10s`.", "type": "string" }, "type": { "enum": [ "otlp" ], "type": "string" } }, "required": [ "endpoint", "type" ], "title": "Open Telemetry (OTLP)", "type": "object" }, { "description": "Sends telemetry traces data to a [Datadog](https://www.datadoghq.com/) agent (local or remote).\n\nTo get started with Datadog, make sure you have a [Datadog agent running](https://docs.datadoghq.com/agent/?tab=source).", "properties": { "agent_endpoint": { "default": "127.0.0.1:8126", "description": "The Datadog agent endpoint. The format is based on hostname and port only, e.g. `127.0.0.1:8126`.", "type": "string" }, "type": { "enum": [ "datadog" ], "type": "string" } }, "required": [ "type" ], "title": "Datadog", "type": "object" }, { "description": "Sends telemetry traces data to a [Jaeger](https://www.jaegertracing.io/) backend, using the native protocol of [Jaeger (UDP) using `thrift`](https://www.jaegertracing.io/docs/next-release/getting-started/).\n\n> Note: Jaeger also [supports OTLP format](https://opentelemetry.io/blog/2022/jaeger-native-otlp/), so it's preferred to use the `otlp` target.\n\n> \u2757\ufe0f This target is not available on WASM runtime (CloudFlare Worker).\n\nTo get started with Jaeger, use the following command to start the Jaeger backend and UI in your local machine, using Docker:\n\n`docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 jaegertracing/all-in-one:latest`", "properties": { "endpoint": { "default": "127.0.0.1:6831", "description": "The UDP endpoint of the Jaeger backend. The format is based on hostname and port only, e.g. `127.0.0.1:6831`.", "type": "string" }, "type": { "enum": [ "jaeger" ], "type": "string" } }, "required": [ "type" ], "title": "Jaeger", "type": "object" } ] }, "TrustedDocumentHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "TrustedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "TrustedDocumentsPluginConfig": { "description": "This plugin allows you to define a list of trusted GraphQL documents that can be executed by the gateway (also called **Persisted Operations**).\n\nFor additional information, please refer to [Trusted Documents](https://benjie.dev/graphql/trusted-documents).", "examples": [ { "$metadata": { "description": "This example is using a local file called `trusted_documents.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" }, { "$metadata": { "description": "This example uses a local file store called `trusted_documents.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" } ], "properties": { "allow_untrusted": { "description": "By default, this plugin does not allow untrusted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/TrustedDocumentsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/TrustedDocumentsPluginStoreConfig", "description": "The store defines the source of trusted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "TrustedDocumentsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/TrustedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "TrustedDocumentsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor:TAG /app/config.json\n\n```\n\n> Replace `TAG` with a specific [release version](https://github.com/the-guild-org/conductor/releases).\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
9741c0fec164a8900eb0146231138096f011292d
"2023-11-27T05:12:17"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "config": null, "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/persisted", "plugins": [ { "config": { "allow_non_persisted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "persisted_operations" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PersistedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "PersistedOperationHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "PersistedOperationsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `persisted_operations.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" }, { "$metadata": { "description": "This example uses a local file store called `persisted_operations.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" } ], "properties": { "allow_non_persisted": { "description": "By default, this plugin does not allow non-persisted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/PersistedOperationsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/PersistedOperationsPluginStoreConfig", "description": "The store defines the source of persisted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "PersistedOperationsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/PersistedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "PersistedOperationsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/PersistedOperationsPluginConfig" }, "type": { "enum": [ "persisted_operations" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\n./conductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor-t2:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor-t2/releases).", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
ed100b32fa3d384a4ba2bd78434be0e1558484c7
"2024-03-05T12:09:17"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/trusted", "plugins": [ { "config": { "allow_untrusted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "trusted_documents" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "FederationSourceConfig": { "description": "A source capable of loading a Supergraph schema based on the [Apollo Federation specification](https://www.apollographql.com/docs/federation/).\n\nThe loaded supergraph will be used to orchestrate the execution of the queries across the federated sources.\n\nThe input for this source can be a local file, an environment variable, or a remote endpoint.\n\nThe content of the Supergraph input needs to be a valid GraphQL SDL schema, with the Apollo Federation execution directives, usually produced by a schema registry.", "examples": [ { "$metadata": { "description": "This example is loading a Supergraph schema from a remote endpoint, using the Hive CDN. ", "title": "Hive" }, "config": { "expose_query_plan": false, "supergraph": { "remote": { "fetch_every": "10s", "headers": { "X-Hive-CDN-Key": "CDN_TOKEN" }, "url": "https://cdn.graphql-hive.com/artifacts/v1/TARGET_ID/supergraph" } } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From a file" }, "config": { "expose_query_plan": false, "supergraph": { "file": "./supergraph.graphql" } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From Env Var" }, "config": { "expose_query_plan": false, "supergraph": { "env": "SUPERGRAPH" } }, "id": "my-source", "type": "federation" } ], "properties": { "expose_query_plan": { "default": false, "description": "Exposes the query plan as JSON under \"extensions\"", "type": "boolean" }, "supergraph": { "$ref": "#/definitions/SupergraphSourceConfig", "description": "The endpoint URL for the GraphQL source." } }, "required": [ "supergraph" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used.", "type": "string" }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "filter": { "default": "info", "description": "Environment filter configuration as a string. This allows extremely powerful control over Conductor's logging.\n\nThe `filter` can specify various directives to filter logs based on module paths, span names, and specific fields. These directives can also be combined using commas as a separator.\n\n**Basic Usage:**\n\n- `info` (logs all messages at info level and higher across all modules)\n\n- `error` (logs all messages at error level only, as it's the highest level of severity)\n\n**Module-Specific Logging:**\n\n- `conductor::gateway=debug` (logs all debug messages for the 'conductor::gateway' module)\n\n- `conductor::engine::source=trace` (logs all trace messages for the 'conductor::engine::source' module)\n\n**Combining Directives:**\n\n- `conductor::gateway=info,conductor::engine::source=trace` (sets info level for the gateway module and trace level for the engine's source module)\n\nThe syntax of directives is very flexible, allowing complex logging configurations.\n\nSee [tracing_subscriber::EnvFilter](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html) for more information.", "type": "string" }, "format": { "$ref": "#/definitions/LoggerConfigFormat", "default": "pretty", "description": "Configured the logger format. See options below.\n\n- `pretty` format is human-readable, ideal for development and debugging.\n\n- `json` format is structured, suitable for production environments and log analysis tools.\n\nBy default, `pretty` is used in TTY environments, and `json` is used in non-TTY environments." }, "print_performance_info": { "default": false, "description": "Emits performance information on in crucial areas of the gateway.\n\nLook for `close` and `idle` spans printed in the logs.\n\nNote: this option is not enabled on WASM runtime, and will be ignored if specified.", "type": "boolean" } }, "type": "object" }, "LoggerConfigFormat": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "This logging format outputs minimal, compact logs. It focuses on the essential parts of the log message and its fields, making it suitable for production environments where performance and log size are crucial.\n\nPros:\n\n- Efficient in terms of space and performance.\n\n- Easy to read for brief messages and simple logs.\n\nCons:\n\n- May lack detailed context, making debugging a bit more challenging.", "enum": [ "compact" ], "title": "compact", "type": "string" }, { "description": "The pretty format is designed for enhanced readability, featuring more verbose output including well-formatted fields and context. Ideal for development and debugging purposes.\n\nPros:\n\n- Highly readable and provides detailed context.\n\n- Easier to understand complex log messages.\n\nCons:\n\n- More verbose, resulting in larger log sizes.\n\n- Potentially slower performance due to the additional formatting overhead.", "enum": [ "pretty" ], "title": "pretty", "type": "string" }, { "description": "This format outputs logs in JSON. It is particularly useful when integrating with tools that consume or process JSON logs, such as log aggregators and analysis systems.\n\nPros:\n\n- Structured format makes it easy to parse and integrate with various tools.\n\n- Consistent and predictable output.\n\nCons:\n\n- Can be verbose and harder to read directly by developers.\n\n- Slightly more overhead compared to simpler formats like compact.", "enum": [ "json" ], "title": "json", "type": "string" } ] }, "MockedSourceConfig": { "description": "A mocked upstream with a static response for all executed operations.", "properties": { "response_data": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "response_data" ], "type": "object" }, "OtlpProtcol": { "oneOf": [ { "description": "Uses GRPC with `tonic` to send telemetry data.", "enum": [ "grpc" ], "title": "grpc", "type": "string" }, { "description": "Uses HTTP with `http-proto` to send telemetry data.", "enum": [ "http" ], "title": "http", "type": "string" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TrustedDocumentsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "trusted_documents" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TelemetryPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "telemetry" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/MockedSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "mock" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "federation endpoint", "properties": { "config": { "$ref": "#/definitions/FederationSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "federation" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "SupergraphSourceConfig": { "oneOf": [ { "additionalProperties": false, "description": "The file path for the Supergraph schema.\n\n> This provider is not supported on WASM runtime.", "properties": { "file": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "file" ], "title": "file", "type": "object" }, { "additionalProperties": false, "description": "The environment variable that contains the Supergraph schema.", "properties": { "env": { "type": "string" } }, "required": [ "env" ], "title": "env", "type": "object" }, { "additionalProperties": false, "description": "The remote endpoint where the Supergraph schema can be fetched.", "properties": { "remote": { "properties": { "fetch_every": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "1m", "description": "Polling interval for fetching the Supergraph schema from the remote." }, "headers": { "additionalProperties": { "type": "string" }, "description": "Optional headers to include in the request (ex: for authentication)", "type": [ "object", "null" ] }, "url": { "description": "The URL endpoint from where to fetch the Supergraph schema.", "type": "string" } }, "required": [ "url" ], "type": "object" } }, "required": [ "remote" ], "title": "remote", "type": "object" } ] }, "TelemetryPluginConfig": { "description": "The `telemetry` plugin exports traces information about Conductor to a telemetry backend.\n\nThe telemetry plugin exports traces information about the following aspects of Conductor:\n\n- GraphQL parser (timing)\n\n- GraphQL execution (operation type, operation body, operation name, timing, errors)\n\n- Query planning (timing, operation body, operation name)\n\n- Incoming HTTP requests (attributes, timing, errors)\n\n- Outgoing HTTP requests (attributes, timing, errors)\n\nWhen used with a telemtry backend, you can expect to see the following information:\n\n![img](https://raw.githubusercontent.com/the-guild-org/conductor/master/website/public/assets/telemetry.png)", "properties": { "service_name": { "default": "conductor", "description": "Configures the service name that reports the telemetry data. This will appear in the telemetry data as the `service.name` attribute.", "type": "string" }, "targets": { "description": "A list of telemetry targets to send telemetry data to.\n\nThe telemtry data is scoped per endpoint, and you can specify multiple targets if you need to export stats to multiple backends.", "items": { "$ref": "#/definitions/TelemetryTarget" }, "type": "array" } }, "required": [ "targets" ], "type": "object" }, "TelemetryTarget": { "oneOf": [ { "description": "Sends telemetry data to `stdout` in a human-readable format.\n\nUse this source for debugging purposes, or if you want to pipe the telemetry data to another process.", "properties": { "type": { "enum": [ "stdout" ], "type": "string" } }, "required": [ "type" ], "title": "stdout", "type": "object" }, { "description": "Sends telemetry traces data to a [Zipkin](https://zipkin.io/) collector, using the HTTP protocol.\n\nTo get started with Zipkin, use the following command to start the Zipkin collector and UI in your local machine, using Docker:\n\n`docker run -d -p 9411:9411 openzipkin/zipkin`", "properties": { "collector_endpoint": { "default": "http://127.0.0.1:9411/api/v2/spans", "description": "The Zipkin endpoint. Please use full URL endpoint format, e.g. `http://127.0.0.1:9411/api/v2/spans`.", "type": "string" }, "type": { "enum": [ "zipkin" ], "type": "string" } }, "required": [ "type" ], "title": "zipkin", "type": "object" }, { "description": "Sends telemetry traces data to an [OpenTelemetry](https://opentelemetry.io/) backend, using the [OTLP protocol](https://opentelemetry.io/docs/specs/otel/protocol/).\n\nYou can find [here a list backends that supports the OTLP format](https://github.com/magsther/awesome-opentelemetry#open-source).", "properties": { "endpoint": { "description": "The OTLP backend endpoint. The format is based on full URL, e.g. `http://localhost:7201`.", "type": "string" }, "gzip_compression": { "default": false, "description": "Whether to use gzip compression when sending telemetry data.\n\nPlease verify your backend supports and enables `gzip` compression before enabling this option.", "type": "boolean" }, "protocol": { "$ref": "#/definitions/OtlpProtcol", "default": "grpc", "description": "The OTLP transport to use to export telemetry data.\n\n> \u2757\ufe0f The gRPC transport is not supported on WASM runtime (CloudFlare Worker)." }, "timeout": { "default": "10s", "description": "Export timeout. You can use the human-readable format in this field, e.g. `10s`.", "type": "string" }, "type": { "enum": [ "otlp" ], "type": "string" } }, "required": [ "endpoint", "type" ], "title": "Open Telemetry (OTLP)", "type": "object" }, { "description": "Sends telemetry traces data to a [Datadog](https://www.datadoghq.com/) agent (local or remote).\n\nTo get started with Datadog, make sure you have a [Datadog agent running](https://docs.datadoghq.com/agent/?tab=source).", "properties": { "agent_endpoint": { "default": "127.0.0.1:8126", "description": "The Datadog agent endpoint. The format is based on hostname and port only, e.g. `127.0.0.1:8126`.", "type": "string" }, "type": { "enum": [ "datadog" ], "type": "string" } }, "required": [ "type" ], "title": "Datadog", "type": "object" }, { "description": "Sends telemetry traces data to a [Jaeger](https://www.jaegertracing.io/) backend, using the native protocol of [Jaeger (UDP) using `thrift`](https://www.jaegertracing.io/docs/next-release/getting-started/).\n\n> Note: Jaeger also [supports OTLP format](https://opentelemetry.io/blog/2022/jaeger-native-otlp/), so it's preferred to use the `otlp` target.\n\n> \u2757\ufe0f This target is not available on WASM runtime (CloudFlare Worker).\n\nTo get started with Jaeger, use the following command to start the Jaeger backend and UI in your local machine, using Docker:\n\n`docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 jaegertracing/all-in-one:latest`", "properties": { "endpoint": { "default": "127.0.0.1:6831", "description": "The UDP endpoint of the Jaeger backend. The format is based on hostname and port only, e.g. `127.0.0.1:6831`.", "type": "string" }, "type": { "enum": [ "jaeger" ], "type": "string" } }, "required": [ "type" ], "title": "Jaeger", "type": "object" } ] }, "TrustedDocumentHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "TrustedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "TrustedDocumentsPluginConfig": { "description": "This plugin allows you to define a list of trusted GraphQL documents that can be executed by the gateway (also called **Persisted Operations**).\n\nFor additional information, please refer to [Trusted Documents](https://benjie.dev/graphql/trusted-documents).", "examples": [ { "$metadata": { "description": "This example is using a local file called `trusted_documents.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" }, { "$metadata": { "description": "This example uses a local file store called `trusted_documents.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" } ], "properties": { "allow_untrusted": { "description": "By default, this plugin does not allow untrusted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/TrustedDocumentsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/TrustedDocumentsPluginStoreConfig", "description": "The store defines the source of trusted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "TrustedDocumentsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/TrustedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "TrustedDocumentsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "default": { "host": "127.0.0.1", "port": 9000 }, "description": "Configuration for the HTTP server.\n\nNote: for CloudFlare Worker runtime, this configuration is ignored." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
b59483b9ea7eb1fe1721e908de6940f217cfe2bd
"2024-01-18T10:45:34"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/trusted", "plugins": [ { "config": { "allow_untrusted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "trusted_documents" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "FederationSourceConfig": { "properties": { "expose_query_plan": { "default": null, "description": "Exposes the query plan as JSON under \"extensions\"", "type": [ "boolean", "null" ] }, "supergraph": { "$ref": "#/definitions/SupergraphSourceConfig", "description": "The endpoint URL for the GraphQL source." } }, "required": [ "supergraph" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used." }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TrustedDocumentsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "trusted_documents" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "federation endpoint", "properties": { "config": { "$ref": "#/definitions/FederationSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "federation" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "SupergraphSourceConfig": { "oneOf": [ { "additionalProperties": false, "description": "The file path for the Supergraph schema.", "properties": { "file": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "file" ], "type": "object" }, { "additionalProperties": false, "description": "The environment variable that contains the Supergraph schema.", "properties": { "env": { "type": "string" } }, "required": [ "env" ], "type": "object" }, { "additionalProperties": false, "description": "The remote endpoint where the Supergraph schema can be fetched.", "properties": { "remote": { "properties": { "fetch_every": { "type": [ "string", "null" ] }, "headers": { "additionalProperties": { "type": "string" }, "description": "Optional headers to include in the request (ex: for authentication)", "type": [ "object", "null" ] }, "url": { "description": "The URL endpoint from where to fetch the Supergraph schema.", "type": "string" } }, "required": [ "url" ], "type": "object" } }, "required": [ "remote" ], "type": "object" } ] }, "TrustedDocumentHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "TrustedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "TrustedDocumentsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `trusted_documents.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" }, { "$metadata": { "description": "This example uses a local file store called `trusted_documents.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" } ], "properties": { "allow_untrusted": { "description": "By default, this plugin does not allow untrusted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/TrustedDocumentsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/TrustedDocumentsPluginStoreConfig", "description": "The store defines the source of trusted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "TrustedDocumentsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/TrustedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "TrustedDocumentsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
4f70b6c3633c8cfe8a4093db8003b699ebee55a6
"2024-01-10T07:54:51"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/trusted", "plugins": [ { "config": { "allow_untrusted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "trusted_documents" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used." }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TrustedDocumentsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "trusted_documents" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "TrustedDocumentHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "TrustedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "TrustedDocumentsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `trusted_documents.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" }, { "$metadata": { "description": "This example uses a local file store called `trusted_documents.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" } ], "properties": { "allow_untrusted": { "description": "By default, this plugin does not allow untrusted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/TrustedDocumentsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/TrustedDocumentsPluginStoreConfig", "description": "The store defines the source of trusted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "TrustedDocumentsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/TrustedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "TrustedDocumentsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor-t2:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor-t2/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
a65e3b2a94fa0781f9a0afaca1b319c86f38d7fe
"2023-12-18T10:02:44"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/persisted", "plugins": [ { "config": { "allow_non_persisted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "persisted_operations" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PersistedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "PersistedOperationHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "PersistedOperationsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `persisted_operations.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" }, { "$metadata": { "description": "This example uses a local file store called `persisted_operations.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" } ], "properties": { "allow_non_persisted": { "description": "By default, this plugin does not allow non-persisted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/PersistedOperationsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/PersistedOperationsPluginStoreConfig", "description": "The store defines the source of persisted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "PersistedOperationsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/PersistedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "PersistedOperationsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the CORS plugin. This plugin allows you to specify Cross-Origin Resource Sharing (CORS) policies.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/PersistedOperationsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "persisted_operations" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\n short_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor-t2:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor-t2/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
be4e0e4410119ab8953c74da6875488737a01c1f
"2023-12-17T12:58:00"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/persisted", "plugins": [ { "config": { "allow_non_persisted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "persisted_operations" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n### Query Parameters\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n- `query`: The GraphQL query to execute\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n- `operationName` (optional): The name of the GraphQL operation to execute\n### Headers\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PersistedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "PersistedOperationHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "PersistedOperationsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `persisted_operations.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" }, { "$metadata": { "description": "This example uses a local file store called `persisted_operations.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "persisted_operations.json", "source": "file" } }, "type": "persisted_operations" } ], "properties": { "allow_non_persisted": { "description": "By default, this plugin does not allow non-persisted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/PersistedOperationsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/PersistedOperationsPluginStoreConfig", "description": "The store defines the source of persisted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "PersistedOperationsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/PersistedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "PersistedOperationsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/PersistedOperationHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/PersistedOperationsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "persisted_operations" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n### Writing VRL\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n#### Variables and Functions\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n```vrl\nmyVar = \"my value\"\nlog(myVar, level:\"info\")\n```\n#### Assignment\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n```vrl\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n```\n#### Metadata\nThe `%` is used to access metadata values. Note that metadata values are read only.\nThe following program is printing a metadata value to the console:\n```vrl\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n```\n#### Further Reading\n- [VRL Playground](https://playground.vrl.dev/)\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n### Runtime Failure Handling\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n```vrl\n# This function is fallible, and can create errors, so it must be handled.\nparsed, err = parse_json(\"invalid json\")\n```\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n```vrl\nparsed = parse_json!(\"invalid json\")\n```\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n### Input/Output\n#### `on_downstream_http_request`\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\nThe following metadata inputs are available to the hook:\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\nThe following output values are available to the hook:\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n#### `on_downstream_graphql_request`\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\nThe following metadata inputs are available to the hook:\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\nThe following output values are available to the hook:\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n#### `on_upstream_http_request`\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\nThe following metadata inputs are available to the hook:\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\nThe following output values are available to the hook:\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n#### `on_downstream_http_response`\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\nThe following metadata inputs are available to the hook:\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\nThe following output values are available to the hook:\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n### Shared State\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\nYou can find an example for this in the **Examples** section below.\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\n short_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\nConductor supports both YAML and JSON format for the configuration file.\n## Loading the config file\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n### Binary\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n```sh\nconductor my-config-file.json\n```\n> By default, Conductor will look for a file named `config.json` in the current directory.\n### Docker\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n```sh\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor-t2:latest /app/config.json\n```\n### CloudFlare Worker\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n## Autocomplete/validation in VSCode\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n```json filename=\"config.json\"\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\" }\n```\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n```yaml filename=\"config.yaml\"\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor-t2/master/libs/config/conductor.schema.json\"\n```\n### JSONSchema\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor-t2/releases).\n### Configuration Interpolation with Environment Variables\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
ab9c74dd7394b397268f229116793915704cc29b
"2024-01-22T09:39:24"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/trusted", "plugins": [ { "config": { "allow_untrusted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "trusted_documents" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "FederationSourceConfig": { "description": "A source capable of loading a Supergraph schema based on the [Apollo Federation specification](https://www.apollographql.com/docs/federation/).\n\nThe loaded supergraph will be used to orchestrate the execution of the queries across the federated sources.\n\nThe input for this source can be a local file, an environment variable, or a remote endpoint.\n\nThe content of the Supergraph input needs to be a valid GraphQL SDL schema, with the Apollo Federation execution directives, usually produced by a schema registry.", "examples": [ { "$metadata": { "description": "This example is loading a Supergraph schema from a remote endpoint, using the Hive CDN. ", "title": "Hive" }, "config": { "expose_query_plan": false, "supergraph": { "remote": { "fetch_every": "10s", "headers": { "X-Hive-CDN-Key": "CDN_TOKEN" }, "url": "https://cdn.graphql-hive.com/artifacts/v1/TARGET_ID/supergraph" } } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From a file" }, "config": { "expose_query_plan": false, "supergraph": { "file": "./supergraph.graphql" } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From Env Var" }, "config": { "expose_query_plan": false, "supergraph": { "env": "SUPERGRAPH" } }, "id": "my-source", "type": "federation" } ], "properties": { "expose_query_plan": { "default": false, "description": "Exposes the query plan as JSON under \"extensions\"", "type": "boolean" }, "supergraph": { "$ref": "#/definitions/SupergraphSourceConfig", "description": "The endpoint URL for the GraphQL source." } }, "required": [ "supergraph" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used." }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "Level": { "enum": [ "trace", "debug", "info", "warn", "error" ], "type": "string" }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "level": { "$ref": "#/definitions/Level", "default": "info", "description": "Log level" } }, "type": "object" }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TrustedDocumentsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "trusted_documents" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "federation endpoint", "properties": { "config": { "$ref": "#/definitions/FederationSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "federation" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "SupergraphSourceConfig": { "oneOf": [ { "additionalProperties": false, "description": "The file path for the Supergraph schema.\n\n> This provider is not supported on WASM runtime.", "properties": { "file": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "file" ], "title": "file", "type": "object" }, { "additionalProperties": false, "description": "The environment variable that contains the Supergraph schema.", "properties": { "env": { "type": "string" } }, "required": [ "env" ], "title": "env", "type": "object" }, { "additionalProperties": false, "description": "The remote endpoint where the Supergraph schema can be fetched.", "properties": { "remote": { "properties": { "fetch_every": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "1m", "description": "Polling interval for fetching the Supergraph schema from the remote." }, "headers": { "additionalProperties": { "type": "string" }, "description": "Optional headers to include in the request (ex: for authentication)", "type": [ "object", "null" ] }, "url": { "description": "The URL endpoint from where to fetch the Supergraph schema.", "type": "string" } }, "required": [ "url" ], "type": "object" } }, "required": [ "remote" ], "title": "remote", "type": "object" } ] }, "TrustedDocumentHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "TrustedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "TrustedDocumentsPluginConfig": { "examples": [ { "$metadata": { "description": "This example is using a local file called `trusted_documents.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" }, { "$metadata": { "description": "This example uses a local file store called `trusted_documents.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" } ], "properties": { "allow_untrusted": { "description": "By default, this plugin does not allow untrusted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/TrustedDocumentsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/TrustedDocumentsPluginStoreConfig", "description": "The store defines the source of trusted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "TrustedDocumentsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/TrustedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "TrustedDocumentsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
61b99c8223f10bcc8002a4e71da212ccc390aa82
"2024-02-11T09:31:25"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/trusted", "plugins": [ { "config": { "allow_untrusted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "trusted_documents" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "FederationSourceConfig": { "description": "A source capable of loading a Supergraph schema based on the [Apollo Federation specification](https://www.apollographql.com/docs/federation/).\n\nThe loaded supergraph will be used to orchestrate the execution of the queries across the federated sources.\n\nThe input for this source can be a local file, an environment variable, or a remote endpoint.\n\nThe content of the Supergraph input needs to be a valid GraphQL SDL schema, with the Apollo Federation execution directives, usually produced by a schema registry.", "examples": [ { "$metadata": { "description": "This example is loading a Supergraph schema from a remote endpoint, using the Hive CDN. ", "title": "Hive" }, "config": { "expose_query_plan": false, "supergraph": { "remote": { "fetch_every": "10s", "headers": { "X-Hive-CDN-Key": "CDN_TOKEN" }, "url": "https://cdn.graphql-hive.com/artifacts/v1/TARGET_ID/supergraph" } } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From a file" }, "config": { "expose_query_plan": false, "supergraph": { "file": "./supergraph.graphql" } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From Env Var" }, "config": { "expose_query_plan": false, "supergraph": { "env": "SUPERGRAPH" } }, "id": "my-source", "type": "federation" } ], "properties": { "expose_query_plan": { "default": false, "description": "Exposes the query plan as JSON under \"extensions\"", "type": "boolean" }, "supergraph": { "$ref": "#/definitions/SupergraphSourceConfig", "description": "The endpoint URL for the GraphQL source." } }, "required": [ "supergraph" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used.", "type": "string" }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "filter": { "default": "info", "description": "Environment filter configuration as a string. This allows extremely powerful control over Conductor's logging.\n\nThe `filter` can specify various directives to filter logs based on module paths, span names, and specific fields. These directives can also be combined using commas as a separator.\n\n**Basic Usage:**\n\n- `info` (logs all messages at info level and higher across all modules)\n\n- `error` (logs all messages at error level only, as it's the highest level of severity)\n\n**Module-Specific Logging:**\n\n- `conductor::gateway=debug` (logs all debug messages for the 'conductor::gateway' module)\n\n- `conductor::engine::source=trace` (logs all trace messages for the 'conductor::engine::source' module)\n\n**Combining Directives:**\n\n- `conductor::gateway=info,conductor::engine::source=trace` (sets info level for the gateway module and trace level for the engine's source module)\n\nThe syntax of directives is very flexible, allowing complex logging configurations.\n\nSee [tracing_subscriber::EnvFilter](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html) for more information.", "type": "string" }, "format": { "$ref": "#/definitions/LoggerConfigFormat", "default": "pretty", "description": "Configured the logger format. See options below.\n\n- `pretty` format is human-readable, ideal for development and debugging.\n\n- `json` format is structured, suitable for production environments and log analysis tools.\n\nBy default, `pretty` is used in TTY environments, and `json` is used in non-TTY environments." }, "print_performance_info": { "default": false, "description": "Emits performance information on in crucial areas of the gateway.\n\nLook for `close` and `idle` spans printed in the logs.\n\nNote: this option is not enabled on WASM runtime, and will be ignored if specified.", "type": "boolean" } }, "type": "object" }, "LoggerConfigFormat": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "This logging format outputs minimal, compact logs. It focuses on the essential parts of the log message and its fields, making it suitable for production environments where performance and log size are crucial.\n\nPros:\n\n- Efficient in terms of space and performance.\n\n- Easy to read for brief messages and simple logs.\n\nCons:\n\n- May lack detailed context, making debugging a bit more challenging.", "enum": [ "compact" ], "title": "compact", "type": "string" }, { "description": "The pretty format is designed for enhanced readability, featuring more verbose output including well-formatted fields and context. Ideal for development and debugging purposes.\n\nPros:\n\n- Highly readable and provides detailed context.\n\n- Easier to understand complex log messages.\n\nCons:\n\n- More verbose, resulting in larger log sizes.\n\n- Potentially slower performance due to the additional formatting overhead.", "enum": [ "pretty" ], "title": "pretty", "type": "string" }, { "description": "This format outputs logs in JSON. It is particularly useful when integrating with tools that consume or process JSON logs, such as log aggregators and analysis systems.\n\nPros:\n\n- Structured format makes it easy to parse and integrate with various tools.\n\n- Consistent and predictable output.\n\nCons:\n\n- Can be verbose and harder to read directly by developers.\n\n- Slightly more overhead compared to simpler formats like compact.", "enum": [ "json" ], "title": "json", "type": "string" } ] }, "MockedSourceConfig": { "description": "A mocked upstream with a static response for all executed operations.", "properties": { "response_data": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "response_data" ], "type": "object" }, "OtlpProtcol": { "oneOf": [ { "description": "Uses GRPC with `tonic` to send telemetry data.", "enum": [ "grpc" ], "title": "grpc", "type": "string" }, { "description": "Uses HTTP with `http-proto` to send telemetry data.", "enum": [ "http" ], "title": "http", "type": "string" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TrustedDocumentsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "trusted_documents" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TelemetryPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "telemetry" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/MockedSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "mock" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "federation endpoint", "properties": { "config": { "$ref": "#/definitions/FederationSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "federation" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "SupergraphSourceConfig": { "oneOf": [ { "additionalProperties": false, "description": "The file path for the Supergraph schema.\n\n> This provider is not supported on WASM runtime.", "properties": { "file": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "file" ], "title": "file", "type": "object" }, { "additionalProperties": false, "description": "The environment variable that contains the Supergraph schema.", "properties": { "env": { "type": "string" } }, "required": [ "env" ], "title": "env", "type": "object" }, { "additionalProperties": false, "description": "The remote endpoint where the Supergraph schema can be fetched.", "properties": { "remote": { "properties": { "fetch_every": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "1m", "description": "Polling interval for fetching the Supergraph schema from the remote." }, "headers": { "additionalProperties": { "type": "string" }, "description": "Optional headers to include in the request (ex: for authentication)", "type": [ "object", "null" ] }, "url": { "description": "The URL endpoint from where to fetch the Supergraph schema.", "type": "string" } }, "required": [ "url" ], "type": "object" } }, "required": [ "remote" ], "title": "remote", "type": "object" } ] }, "TelemetryPluginConfig": { "description": "The `telemetry` plugin exports traces information about Conductor to a telemetry backend.\n\nThe telemetry plugin exports traces information about the following aspects of Conductor:\n\n- GraphQL parser (timing)\n\n- GraphQL execution (operation type, operation body, operation name, timing, errors)\n\n- Query planning (timing, operation body, operation name)\n\n- Incoming HTTP requests (attributes, timing, errors)\n\n- Outgoing HTTP requests (attributes, timing, errors)\n\nWhen used with a telemtry backend, you can expect to see the following information:\n\n![img](https://raw.githubusercontent.com/the-guild-org/conductor/master/website/public/assets/telemetry.png)", "properties": { "service_name": { "default": "conductor", "description": "Configures the service name that reports the telemetry data. This will appear in the telemetry data as the `service.name` attribute.", "type": "string" }, "targets": { "description": "A list of telemetry targets to send telemetry data to.\n\nThe telemtry data is scoped per endpoint, and you can specify multiple targets if you need to export stats to multiple backends.", "items": { "$ref": "#/definitions/TelemetryTarget" }, "type": "array" } }, "required": [ "targets" ], "type": "object" }, "TelemetryTarget": { "oneOf": [ { "description": "Sends telemetry data to `stdout` in a human-readable format.\n\nUse this source for debugging purposes, or if you want to pipe the telemetry data to another process.", "properties": { "type": { "enum": [ "stdout" ], "type": "string" } }, "required": [ "type" ], "title": "stdout", "type": "object" }, { "description": "Sends telemetry traces data to a [Zipkin](https://zipkin.io/) collector, using the HTTP protocol.\n\nTo get started with Zipkin, use the following command to start the Zipkin collector and UI in your local machine, using Docker:\n\n`docker run -d -p 9411:9411 openzipkin/zipkin`", "properties": { "collector_endpoint": { "default": "http://127.0.0.1:9411/api/v2/spans", "description": "The Zipkin endpoint. Please use full URL endpoint format, e.g. `http://127.0.0.1:9411/api/v2/spans`.", "type": "string" }, "type": { "enum": [ "zipkin" ], "type": "string" } }, "required": [ "type" ], "title": "zipkin", "type": "object" }, { "description": "Sends telemetry traces data to an [OpenTelemetry](https://opentelemetry.io/) backend, using the [OTLP protocol](https://opentelemetry.io/docs/specs/otel/protocol/).\n\nYou can find [here a list backends that supports the OTLP format](https://github.com/magsther/awesome-opentelemetry#open-source).", "properties": { "endpoint": { "description": "The OTLP backend endpoint. The format is based on full URL, e.g. `http://localhost:7201`.", "type": "string" }, "gzip_compression": { "default": false, "description": "Whether to use gzip compression when sending telemetry data.\n\nPlease verify your backend supports and enables `gzip` compression before enabling this option.", "type": "boolean" }, "protocol": { "$ref": "#/definitions/OtlpProtcol", "default": "grpc", "description": "The OTLP transport to use to export telemetry data.\n\n> \u2757\ufe0f The gRPC transport is not supported on WASM runtime (CloudFlare Worker)." }, "timeout": { "default": "10s", "description": "Export timeout. You can use the human-readable format in this field, e.g. `10s`.", "type": "string" }, "type": { "enum": [ "otlp" ], "type": "string" } }, "required": [ "endpoint", "type" ], "title": "Open Telemetry (OTLP)", "type": "object" }, { "description": "Sends telemetry traces data to a [Datadog](https://www.datadoghq.com/) agent (local or remote).\n\nTo get started with Datadog, make sure you have a [Datadog agent running](https://docs.datadoghq.com/agent/?tab=source).", "properties": { "agent_endpoint": { "default": "127.0.0.1:8126", "description": "The Datadog agent endpoint. The format is based on hostname and port only, e.g. `127.0.0.1:8126`.", "type": "string" }, "type": { "enum": [ "datadog" ], "type": "string" } }, "required": [ "type" ], "title": "Datadog", "type": "object" }, { "description": "Sends telemetry traces data to a [Jaeger](https://www.jaegertracing.io/) backend, using the native protocol of [Jaeger (UDP) using `thrift`](https://www.jaegertracing.io/docs/next-release/getting-started/).\n\n> Note: Jaeger also [supports OTLP format](https://opentelemetry.io/blog/2022/jaeger-native-otlp/), so it's preferred to use the `otlp` target.\n\n> \u2757\ufe0f This target is not available on WASM runtime (CloudFlare Worker).\n\nTo get started with Jaeger, use the following command to start the Jaeger backend and UI in your local machine, using Docker:\n\n`docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 jaegertracing/all-in-one:latest`", "properties": { "endpoint": { "default": "127.0.0.1:6831", "description": "The UDP endpoint of the Jaeger backend. The format is based on hostname and port only, e.g. `127.0.0.1:6831`.", "type": "string" }, "type": { "enum": [ "jaeger" ], "type": "string" } }, "required": [ "type" ], "title": "Jaeger", "type": "object" } ] }, "TrustedDocumentHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "TrustedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "TrustedDocumentsPluginConfig": { "description": "This plugin allows you to define a list of trusted GraphQL documents that can be executed by the gateway (also called **Persisted Operations**).\n\nFor additional information, please refer to [Trusted Documents](https://benjie.dev/graphql/trusted-documents).", "examples": [ { "$metadata": { "description": "This example is using a local file called `trusted_documents.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" }, { "$metadata": { "description": "This example uses a local file store called `trusted_documents.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" } ], "properties": { "allow_untrusted": { "description": "By default, this plugin does not allow untrusted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/TrustedDocumentsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/TrustedDocumentsPluginStoreConfig", "description": "The store defines the source of trusted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "TrustedDocumentsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/TrustedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "TrustedDocumentsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
4b4fde20c2ca8c4fe7e59803135dbba450187817
"2024-01-23T15:55:13"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/trusted", "plugins": [ { "config": { "allow_untrusted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "trusted_documents" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "FederationSourceConfig": { "description": "A source capable of loading a Supergraph schema based on the [Apollo Federation specification](https://www.apollographql.com/docs/federation/).\n\nThe loaded supergraph will be used to orchestrate the execution of the queries across the federated sources.\n\nThe input for this source can be a local file, an environment variable, or a remote endpoint.\n\nThe content of the Supergraph input needs to be a valid GraphQL SDL schema, with the Apollo Federation execution directives, usually produced by a schema registry.", "examples": [ { "$metadata": { "description": "This example is loading a Supergraph schema from a remote endpoint, using the Hive CDN. ", "title": "Hive" }, "config": { "expose_query_plan": false, "supergraph": { "remote": { "fetch_every": "10s", "headers": { "X-Hive-CDN-Key": "CDN_TOKEN" }, "url": "https://cdn.graphql-hive.com/artifacts/v1/TARGET_ID/supergraph" } } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From a file" }, "config": { "expose_query_plan": false, "supergraph": { "file": "./supergraph.graphql" } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From Env Var" }, "config": { "expose_query_plan": false, "supergraph": { "env": "SUPERGRAPH" } }, "id": "my-source", "type": "federation" } ], "properties": { "expose_query_plan": { "default": false, "description": "Exposes the query plan as JSON under \"extensions\"", "type": "boolean" }, "supergraph": { "$ref": "#/definitions/SupergraphSourceConfig", "description": "The endpoint URL for the GraphQL source." } }, "required": [ "supergraph" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used." }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "filter": { "default": "info", "description": "Environment filter configuration as a string. This allows extremely powerful control over Conductor's logging.\n\nThe `filter` can specify various directives to filter logs based on module paths, span names, and specific fields. These directives can also be combined using commas as a separator.\n\n**Basic Usage:**\n\n- `info` (logs all messages at info level and higher across all modules)\n\n- `error` (logs all messages at error level only, as it's the highest level of severity)\n\n**Module-Specific Logging:**\n\n- `conductor::gateway=debug` (logs all debug messages for the 'conductor::gateway' module)\n\n- `conductor::engine::source=trace` (logs all trace messages for the 'conductor::engine::source' module)\n\n**Combining Directives:**\n\n- `conductor::gateway=info,conductor::engine::source=trace` (sets info level for the gateway module and trace level for the engine's source module)\n\nThe syntax of directives is very flexible, allowing complex logging configurations.\n\nSee [tracing_subscriber::EnvFilter](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html) for more information.", "type": "string" }, "format": { "$ref": "#/definitions/LoggerConfigFormat", "default": "pretty", "description": "Configured the logger format. See options below.\n\n- `pretty` format is human-readable, ideal for development and debugging.\n\n- `json` format is structured, suitable for production environments and log analysis tools.\n\nBy default, `pretty` is used in TTY environments, and `json` is used in non-TTY environments." }, "print_performance_info": { "default": false, "description": "Emits performance information on in crucial areas of the gateway.\n\nLook for `close` and `idle` spans printed in the logs.\n\nNote: this option is not enabled on WASM runtime, and will be ignored if specified.", "type": "boolean" } }, "type": "object" }, "LoggerConfigFormat": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "This logging format outputs minimal, compact logs. It focuses on the essential parts of the log message and its fields, making it suitable for production environments where performance and log size are crucial.\n\nPros:\n\n- Efficient in terms of space and performance.\n\n- Easy to read for brief messages and simple logs.\n\nCons:\n\n- May lack detailed context, making debugging a bit more challenging.", "enum": [ "compact" ], "title": "compact", "type": "string" }, { "description": "The pretty format is designed for enhanced readability, featuring more verbose output including well-formatted fields and context. Ideal for development and debugging purposes.\n\nPros:\n\n- Highly readable and provides detailed context.\n\n- Easier to understand complex log messages.\n\nCons:\n\n- More verbose, resulting in larger log sizes.\n\n- Potentially slower performance due to the additional formatting overhead.", "enum": [ "pretty" ], "title": "pretty", "type": "string" }, { "description": "This format outputs logs in JSON. It is particularly useful when integrating with tools that consume or process JSON logs, such as log aggregators and analysis systems.\n\nPros:\n\n- Structured format makes it easy to parse and integrate with various tools.\n\n- Consistent and predictable output.\n\nCons:\n\n- Can be verbose and harder to read directly by developers.\n\n- Slightly more overhead compared to simpler formats like compact.", "enum": [ "json" ], "title": "json", "type": "string" } ] }, "MockedSourceConfig": { "description": "A mocked upstream with a static response for all executed operations.", "properties": { "response_data": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "response_data" ], "type": "object" }, "OtlpProtcol": { "oneOf": [ { "description": "Uses GRPC with `tonic` to send telemetry data.", "enum": [ "grpc" ], "title": "grpc", "type": "string" }, { "description": "Uses HTTP with `http-proto` to send telemetry data.", "enum": [ "http" ], "title": "http", "type": "string" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TrustedDocumentsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "trusted_documents" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TelemetryPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "telemetry" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/MockedSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "mocl" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "federation endpoint", "properties": { "config": { "$ref": "#/definitions/FederationSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "federation" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "SupergraphSourceConfig": { "oneOf": [ { "additionalProperties": false, "description": "The file path for the Supergraph schema.\n\n> This provider is not supported on WASM runtime.", "properties": { "file": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "file" ], "title": "file", "type": "object" }, { "additionalProperties": false, "description": "The environment variable that contains the Supergraph schema.", "properties": { "env": { "type": "string" } }, "required": [ "env" ], "title": "env", "type": "object" }, { "additionalProperties": false, "description": "The remote endpoint where the Supergraph schema can be fetched.", "properties": { "remote": { "properties": { "fetch_every": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "1m", "description": "Polling interval for fetching the Supergraph schema from the remote." }, "headers": { "additionalProperties": { "type": "string" }, "description": "Optional headers to include in the request (ex: for authentication)", "type": [ "object", "null" ] }, "url": { "description": "The URL endpoint from where to fetch the Supergraph schema.", "type": "string" } }, "required": [ "url" ], "type": "object" } }, "required": [ "remote" ], "title": "remote", "type": "object" } ] }, "TelemetryPluginConfig": { "description": "The `telemetry` plugin exports traces information about Conductor to a telemetry backend.\n\n<Callout>\n\nAt the moment, this plugin is not supported on WASM (CloudFlare Worker) runtime.\n\nYou may follow [this GitHub issue](https://github.com/the-guild-org/conductor/issues/354) for additional information.\n\n</Callout>\n\nThe telemetry plugin exports traces information about the following aspects of Conductor:\n\n- GraphQL parser (timing)\n\n- GraphQL execution (operation type, operation body, operation name, timing, errors)\n\n- Query planning (timing, operation body, operation name)\n\n- Incoming HTTP requests (attributes, timing, errors)\n\n- Outgoing HTTP requests (attributes, timing, errors)\n\nWhen used with a telemtry backend, you can expect to see the following information:\n\n![img](/assets/telemetry.png)", "properties": { "service_name": { "default": "conductor", "description": "Configures the service name that reports the telemetry data. This will appear in the telemetry data as the `service.name` attribute.", "type": "string" }, "targets": { "description": "A list of telemetry targets to send telemetry data to.\n\nThe telemtry data is scoped per endpoint, and you can specify multiple targets if you need to export stats to multiple backends.", "items": { "$ref": "#/definitions/TelemetryTarget" }, "type": "array" } }, "required": [ "targets" ], "type": "object" }, "TelemetryTarget": { "oneOf": [ { "description": "Sends telemetry data to `stdout` in a human-readable format.\n\nUse this source for debugging purposes, or if you want to pipe the telemetry data to another process.", "properties": { "type": { "enum": [ "stdout" ], "type": "string" } }, "required": [ "type" ], "title": "stdout", "type": "object" }, { "description": "Sends telemetry traces data to an [OpenTelemetry](https://opentelemetry.io/) backend, using the [OTLP protocol](https://opentelemetry.io/docs/specs/otel/protocol/).\n\nYou can find [here a list backends that supports the OTLP format](https://github.com/magsther/awesome-opentelemetry#open-source).", "properties": { "endpoint": { "description": "The OTLP backend endpoint. The format is based on full URL, e.g. `http://localhost:7201`.", "type": "string" }, "gzip_compression": { "default": false, "description": "Whether to use gzip compression when sending telemetry data.\n\nPlease verify your backend supports and enables `gzip` compression before enabling this option.", "type": "boolean" }, "protocol": { "$ref": "#/definitions/OtlpProtcol", "default": "grpc", "description": "The OTLP transport to use to export telemetry data." }, "timeout": { "default": "10s", "description": "Export timeout. You can use the human-readable format in this field, e.g. `10s`.", "type": "string" }, "type": { "enum": [ "otlp" ], "type": "string" } }, "required": [ "endpoint", "type" ], "title": "Open Telemetry (OTLP)", "type": "object" }, { "description": "Sends telemetry traces data to a [Datadog](https://www.datadoghq.com/) agent (local or remote).\n\nTo get started with Datadog, make sure you have a [Datadog agent running](https://docs.datadoghq.com/agent/?tab=source).", "properties": { "agent_endpoint": { "default": "127.0.0.1:8126", "description": "The Datadog agent endpoint. The format is based on hostname and port only, e.g. `127.0.0.1:8126`.", "type": "string" }, "type": { "enum": [ "datadog" ], "type": "string" } }, "required": [ "type" ], "title": "Datadog", "type": "object" }, { "description": "Sends telemetry traces data to a [Jaeger](https://www.jaegertracing.io/) backend, using the native protocol of [Jaeger (UDP) using `thrift`](https://www.jaegertracing.io/docs/next-release/getting-started/).\n\n> Note: Jaeger also [supports OTLP format](https://opentelemetry.io/blog/2022/jaeger-native-otlp/), so it's preferred to use the `otlp` target.\n\nTo get started with Jaeger, make sure you have a Jaeger backend running, and then use the following command to start the Jaeger backend and UI in your local machine, using Docker:\n\n`docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 jaegertracing/all-in-one:latest`", "properties": { "endpoint": { "default": "127.0.0.1:6831", "description": "The UDP endpoint of the Jaeger backend. The format is based on hostname and port only, e.g. `127.0.0.1:6831`.", "type": "string" }, "type": { "enum": [ "jaeger" ], "type": "string" } }, "required": [ "type" ], "title": "Jaeger", "type": "object" } ] }, "TrustedDocumentHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "TrustedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "TrustedDocumentsPluginConfig": { "description": "This plugin allows you to define a list of trusted GraphQL documents that can be executed by the gateway (also called **Persisted Operations**).\n\nFor additional information, please refer to [Trusted Documents](https://benjie.dev/graphql/trusted-documents).", "examples": [ { "$metadata": { "description": "This example is using a local file called `trusted_documents.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" }, { "$metadata": { "description": "This example uses a local file store called `trusted_documents.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" } ], "properties": { "allow_untrusted": { "description": "By default, this plugin does not allow untrusted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/TrustedDocumentsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/TrustedDocumentsPluginStoreConfig", "description": "The store defines the source of trusted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "TrustedDocumentsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/TrustedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "TrustedDocumentsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
598d3d55653193f71ce0ccd5c6969c3ae23cc5d2
"2024-03-20T16:12:56"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql", "schema_awareness": null }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/trusted", "plugins": [ { "config": { "allow_untrusted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "trusted_documents" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql", "schema_awareness": null }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "FederationSourceConfig": { "description": "A source capable of loading a Supergraph schema based on the [Apollo Federation specification](https://www.apollographql.com/docs/federation/).\n\nThe loaded supergraph will be used to orchestrate the execution of the queries across the federated sources.\n\nThe input for this source can be a local file, an environment variable, or a remote endpoint.\n\nThe content of the Supergraph input needs to be a valid GraphQL SDL schema, with the Apollo Federation execution directives, usually produced by a schema registry.", "examples": [ { "$metadata": { "description": "This example is loading a Supergraph schema from a remote endpoint, using the Hive CDN. ", "title": "Hive" }, "config": { "expose_query_plan": false, "supergraph": { "polling_interval": "1m", "source": { "headers": { "x-hive-cdn-key": "CDN_TOKEN" }, "method": "GET", "type": "remote", "url": "https://cdn.graphql-hive.com/artifacts/v1/TARGET_ID/supergraph" } } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From a file" }, "config": { "expose_query_plan": false, "supergraph": { "polling_interval": null, "source": { "path": "./supergraph.graphql", "type": "file" } } }, "id": "my-source", "type": "federation" } ], "properties": { "expose_query_plan": { "default": false, "description": "Exposes the query plan as JSON under \"extensions\"", "type": "boolean" }, "supergraph": { "$ref": "#/definitions/SchemaAwarenessSupergraphConfig", "description": "The endpoint URL for the GraphQL source." } }, "required": [ "supergraph" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.\n\n## Schema Awareness\n\nThis source supports `schema_awareness` configuration. With schema awareness, the gateway will load the upstream GraphQL schema and use that information during plugins execution.\n\nPlugins can access the schema and provide meaningful features, such as running GraphQL validation as part of the gateway.\n\n> Note: Schema Awareness is optional for the `graphql` source. When it's not specified, the gateway will act as a simple proxy, without any knowledge of the upstream schema. Plugins that rely on the schema will emit a warning and will be skipped.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql", "schema_awareness": null }, "id": "my-source", "type": "graphql" }, { "$metadata": { "description": "This example demonstrates how to enable schema awareness for a GraphQL source. The gateway will load the upstream schema and use that information in other plugins.", "title": "Schema Awareness (remote introspection)" }, "config": { "endpoint": "https://my-source.com/graphql", "schema_awareness": { "format": "introspection", "on_error": "terminate", "polling_interval": "1m", "source": { "headers": { "authorization": "Bearer TOKEN" }, "method": "POST", "type": "remote", "url": "https://my-source.com/graphql" } } }, "id": "my-source", "type": "graphql" }, { "$metadata": { "description": "This example demonstrates how to enable schema awareness for a GraphQL source. The gateway will load the upstream schema and use that information in other plugins.", "title": "Schema Awareness (local sdl)" }, "config": { "endpoint": "https://my-source.com/graphql", "schema_awareness": { "format": "sdl", "on_error": "terminate", "polling_interval": null, "source": { "path": "./introspection.json", "type": "file" } } }, "id": "my-source", "type": "graphql" }, { "$metadata": { "description": "This example demonstrates how to enable schema awareness for a GraphQL source. The gateway will load the upstream schema and use that information in other plugins.", "title": "Schema Awareness (inline)" }, "config": { "endpoint": "https://my-source.com/graphql", "schema_awareness": { "format": "sdl", "on_error": "terminate", "polling_interval": null, "source": { "content": "type Query { noop: String }", "type": "inline" } } }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" }, "schema_awareness": { "anyOf": [ { "$ref": "#/definitions/SchemaAwarenessConfig" }, { "type": "null" } ], "description": "Schema Awareness configuration for the source. Enabling this configuration will configure the gateway to load the upstream GraphQL schema and use that information in other plugins.\n\nWhen this configuration is not specified, Schema Awareness is disabled, and plugins will not have access to the upstream schema. In that case, the gateway will act as a simple proxy, without any knowledge of the upstream schema." } }, "required": [ "endpoint" ], "type": "object" }, "GraphQLValidationPluginConfig": { "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used.", "type": "string" }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "filter": { "default": "info", "description": "Environment filter configuration as a string. This allows extremely powerful control over Conductor's logging.\n\nThe `filter` can specify various directives to filter logs based on module paths, span names, and specific fields. These directives can also be combined using commas as a separator.\n\n**Basic Usage:**\n\n- `info` (logs all messages at info level and higher across all modules)\n\n- `error` (logs all messages at error level only, as it's the highest level of severity)\n\n**Module-Specific Logging:**\n\n- `conductor::gateway=debug` (logs all debug messages for the 'conductor::gateway' module)\n\n- `conductor::engine::source=trace` (logs all trace messages for the 'conductor::engine::source' module)\n\n**Combining Directives:**\n\n- `conductor::gateway=info,conductor::engine::source=trace` (sets info level for the gateway module and trace level for the engine's source module)\n\nThe syntax of directives is very flexible, allowing complex logging configurations.\n\nSee [tracing_subscriber::EnvFilter](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html) for more information.", "type": "string" }, "format": { "$ref": "#/definitions/LoggerConfigFormat", "default": "pretty", "description": "Configured the logger format. See options below.\n\n- `pretty` format is human-readable, ideal for development and debugging.\n\n- `json` format is structured, suitable for production environments and log analysis tools.\n\nBy default, `pretty` is used in TTY environments, and `json` is used in non-TTY environments." }, "print_performance_info": { "default": false, "description": "Emits performance information on in crucial areas of the gateway.\n\nLook for `close` and `idle` spans printed in the logs.\n\nNote: this option is not enabled on WASM runtime, and will be ignored if specified.", "type": "boolean" } }, "type": "object" }, "LoggerConfigFormat": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "This logging format outputs minimal, compact logs. It focuses on the essential parts of the log message and its fields, making it suitable for production environments where performance and log size are crucial.\n\nPros:\n\n- Efficient in terms of space and performance.\n\n- Easy to read for brief messages and simple logs.\n\nCons:\n\n- May lack detailed context, making debugging a bit more challenging.", "enum": [ "compact" ], "title": "compact", "type": "string" }, { "description": "The pretty format is designed for enhanced readability, featuring more verbose output including well-formatted fields and context. Ideal for development and debugging purposes.\n\nPros:\n\n- Highly readable and provides detailed context.\n\n- Easier to understand complex log messages.\n\nCons:\n\n- More verbose, resulting in larger log sizes.\n\n- Potentially slower performance due to the additional formatting overhead.", "enum": [ "pretty" ], "title": "pretty", "type": "string" }, { "description": "This format outputs logs in JSON. It is particularly useful when integrating with tools that consume or process JSON logs, such as log aggregators and analysis systems.\n\nPros:\n\n- Structured format makes it easy to parse and integrate with various tools.\n\n- Consistent and predictable output.\n\nCons:\n\n- Can be verbose and harder to read directly by developers.\n\n- Slightly more overhead compared to simpler formats like compact.", "enum": [ "json" ], "title": "json", "type": "string" } ] }, "MockedSourceConfig": { "description": "A mocked upstream with a static response for all executed operations.", "properties": { "response_data": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "response_data" ], "type": "object" }, "OtlpProtcol": { "oneOf": [ { "description": "Uses GRPC with `tonic` to send telemetry data.", "enum": [ "grpc" ], "title": "grpc", "type": "string" }, { "description": "Uses HTTP with `http-proto` to send telemetry data.", "enum": [ "http" ], "title": "http", "type": "string" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TrustedDocumentsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "trusted_documents" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphQLValidationPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphql_validation" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TelemetryPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "telemetry" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "SchemaAwarenessConfig": { "properties": { "format": { "$ref": "#/definitions/SchemaAwarenessFormat", "description": "The expected format of the response/file." }, "on_error": { "$ref": "#/definitions/SchemaAwarenessConfigOnError", "default": "terminate", "description": "What to do in case of a failure to load the schema awareness." }, "polling_interval": { "default": "1m", "description": "Polling interval for reloading the schema awareness.\n\nThis field is ignored on WASM runtime.", "type": [ "string", "null" ] }, "source": { "$ref": "#/definitions/SchemaAwarenessSource", "description": "The source of the schema awareness. Can be either a local file, an inline string (hardcoded or from environment variables), or a remote endpoint." } }, "required": [ "format", "source" ], "type": "object" }, "SchemaAwarenessConfigOnError": { "oneOf": [ { "description": "On binary runtime, this configuration will stop the gateway with an error.\n\nOn WASM runtime, this field will return 500 in case of a failure to load.", "enum": [ "terminate" ], "title": "terminate", "type": "string" }, { "description": "Ignores the failure and report it to the log, without stopping the gateway or interrupting the execution.", "enum": [ "ignore" ], "title": "ignore", "type": "string" } ] }, "SchemaAwarenessFormat": { "oneOf": [ { "description": "The schema awareness is provided as a GraphQL introspection response.\n\nPlease note that GraphQL introspection does not contain information about GraphQL directives usage, so it's not suitable for runtimes/plugins that rely on directives.", "enum": [ "introspection" ], "title": "introspection", "type": "string" }, { "description": "The schema awareness is provided as a GraphQL SDL schema.", "enum": [ "sdl" ], "title": "sdl", "type": "string" } ] }, "SchemaAwarenessSource": { "oneOf": [ { "description": "Loads schema awareness from a local file.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference" }, "type": { "enum": [ "file" ], "type": "string" } }, "required": [ "path", "type" ], "title": "file", "type": "object" }, { "description": "Loads schema awareness from an inline string. You can also use environment variable intropolation in this field.", "properties": { "content": { "type": "string" }, "type": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "type" ], "title": "inline", "type": "object" }, { "description": "Loads schema awareness from a remote endpoint.", "properties": { "headers": { "additionalProperties": { "type": "string" }, "default": {}, "description": "Optional headers to include in the request (for example: authentication).\n\nBy default, when `format: introspection` is used, the gateway will add `Content-Type: application/json` and `Accept: application/json` to the request headers.", "type": "object" }, "method": { "default": "GET", "description": "HTTP method to use when fetching the schema awareness from the remote endpoint.\n\nBy default, this field is set to `GET`. If you are using `format: introspection`, you should change this property to be `POST`.", "type": "string" }, "type": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "Endpoint to load the schema awareness from.", "type": "string" } }, "required": [ "type", "url" ], "title": "remote", "type": "object" } ] }, "SchemaAwarenessSupergraphConfig": { "properties": { "polling_interval": { "default": "1m", "description": "Polling interval for reloading the schema awareness.\n\nThis field is ignored on WASM runtime.", "type": [ "string", "null" ] }, "source": { "$ref": "#/definitions/SchemaAwarenessSource", "description": "The source of the schema awareness. Can be either a local file, an inline string (hardcoded or from environment variables), or a remote endpoint." } }, "required": [ "source" ], "type": "object" }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/MockedSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "mock" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "federation endpoint", "properties": { "config": { "$ref": "#/definitions/FederationSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "federation" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "TelemetryPluginConfig": { "description": "The `telemetry` plugin exports traces information about Conductor to a telemetry backend.\n\nThe telemetry plugin exports traces information about the following aspects of Conductor:\n\n- GraphQL parser (timing)\n\n- GraphQL execution (operation type, operation body, operation name, timing, errors)\n\n- Query planning (timing, operation body, operation name)\n\n- Incoming HTTP requests (attributes, timing, errors)\n\n- Outgoing HTTP requests (attributes, timing, errors)\n\nWhen used with a telemtry backend, you can expect to see the following information:\n\n![img](https://raw.githubusercontent.com/the-guild-org/conductor/master/website/public/assets/telemetry.png)", "properties": { "service_name": { "default": "conductor", "description": "Configures the service name that reports the telemetry data. This will appear in the telemetry data as the `service.name` attribute.", "type": "string" }, "targets": { "description": "A list of telemetry targets to send telemetry data to.\n\nThe telemtry data is scoped per endpoint, and you can specify multiple targets if you need to export stats to multiple backends.", "items": { "$ref": "#/definitions/TelemetryTarget" }, "type": "array" } }, "required": [ "targets" ], "type": "object" }, "TelemetryTarget": { "oneOf": [ { "description": "Sends telemetry data to `stdout` in a human-readable format.\n\nUse this source for debugging purposes, or if you want to pipe the telemetry data to another process.", "properties": { "type": { "enum": [ "stdout" ], "type": "string" } }, "required": [ "type" ], "title": "stdout", "type": "object" }, { "description": "Sends telemetry traces data to a [Zipkin](https://zipkin.io/) collector, using the HTTP protocol.\n\nTo get started with Zipkin, use the following command to start the Zipkin collector and UI in your local machine, using Docker:\n\n`docker run -d -p 9411:9411 openzipkin/zipkin`", "properties": { "collector_endpoint": { "default": "http://127.0.0.1:9411/api/v2/spans", "description": "The Zipkin endpoint. Please use full URL endpoint format, e.g. `http://127.0.0.1:9411/api/v2/spans`.", "type": "string" }, "type": { "enum": [ "zipkin" ], "type": "string" } }, "required": [ "type" ], "title": "zipkin", "type": "object" }, { "description": "Sends telemetry traces data to an [OpenTelemetry](https://opentelemetry.io/) backend, using the [OTLP protocol](https://opentelemetry.io/docs/specs/otel/protocol/).\n\nYou can find [here a list backends that supports the OTLP format](https://github.com/magsther/awesome-opentelemetry#open-source).", "properties": { "endpoint": { "description": "The OTLP backend endpoint. The format is based on full URL, e.g. `http://localhost:7201`.", "type": "string" }, "gzip_compression": { "default": false, "description": "Whether to use gzip compression when sending telemetry data.\n\nPlease verify your backend supports and enables `gzip` compression before enabling this option.", "type": "boolean" }, "protocol": { "$ref": "#/definitions/OtlpProtcol", "default": "grpc", "description": "The OTLP transport to use to export telemetry data.\n\n> \u2757\ufe0f The gRPC transport is not supported on WASM runtime (CloudFlare Worker)." }, "timeout": { "default": "10s", "description": "Export timeout. You can use the human-readable format in this field, e.g. `10s`.", "type": "string" }, "type": { "enum": [ "otlp" ], "type": "string" } }, "required": [ "endpoint", "type" ], "title": "Open Telemetry (OTLP)", "type": "object" }, { "description": "Sends telemetry traces data to a [Datadog](https://www.datadoghq.com/) agent (local or remote).\n\nTo get started with Datadog, make sure you have a [Datadog agent running](https://docs.datadoghq.com/agent/?tab=source).", "properties": { "agent_endpoint": { "default": "127.0.0.1:8126", "description": "The Datadog agent endpoint. The format is based on hostname and port only, e.g. `127.0.0.1:8126`.", "type": "string" }, "type": { "enum": [ "datadog" ], "type": "string" } }, "required": [ "type" ], "title": "Datadog", "type": "object" }, { "description": "Sends telemetry traces data to a [Jaeger](https://www.jaegertracing.io/) backend, using the native protocol of [Jaeger (UDP) using `thrift`](https://www.jaegertracing.io/docs/next-release/getting-started/).\n\n> Note: Jaeger also [supports OTLP format](https://opentelemetry.io/blog/2022/jaeger-native-otlp/), so it's preferred to use the `otlp` target.\n\n> \u2757\ufe0f This target is not available on WASM runtime (CloudFlare Worker).\n\nTo get started with Jaeger, use the following command to start the Jaeger backend and UI in your local machine, using Docker:\n\n`docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 jaegertracing/all-in-one:latest`", "properties": { "endpoint": { "default": "127.0.0.1:6831", "description": "The UDP endpoint of the Jaeger backend. The format is based on hostname and port only, e.g. `127.0.0.1:6831`.", "type": "string" }, "type": { "enum": [ "jaeger" ], "type": "string" } }, "required": [ "type" ], "title": "Jaeger", "type": "object" } ] }, "TrustedDocumentHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "TrustedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "TrustedDocumentsPluginConfig": { "description": "This plugin allows you to define a list of trusted GraphQL documents that can be executed by the gateway (also called **Persisted Operations**).\n\nFor additional information, please refer to [Trusted Documents](https://benjie.dev/graphql/trusted-documents).", "examples": [ { "$metadata": { "description": "This example is using a local file called `trusted_documents.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" }, { "$metadata": { "description": "This example uses a local file store called `trusted_documents.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" } ], "properties": { "allow_untrusted": { "description": "By default, this plugin does not allow untrusted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/TrustedDocumentsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/TrustedDocumentsPluginStoreConfig", "description": "The store defines the source of trusted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "TrustedDocumentsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/TrustedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "TrustedDocumentsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "default": { "host": "127.0.0.1", "port": 9000 }, "description": "Configuration for the HTTP server.\n\nNote: for CloudFlare Worker runtime, this configuration is ignored." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
the-guild-org/conductor
a82d687b2fd7c1f6e03052d52aba288fcee4da63
"2024-01-30T10:00:23"
libs/config/conductor.schema.json
83
2024-05-27T05:50:38.229357Z
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "definitions": { "CorsPluginConfig": { "description": "The `cors` plugin enables [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) configuration for your GraphQL API.\n\nBy using this plugin, you can define rules for allowing cross-origin requests to your GraphQL server. This is essential for web applications that need to interact with your API from different domains.", "examples": [ { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a strict list of methods, headers and origins.", "title": "Strict CORS" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "Content-Type, Authorization", "allowed_methods": "GET, POST", "allowed_origin": "https://example.com", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a permissive setup.", "title": "Permissive CORS" }, "config": { "allow_credentials": true, "allow_private_network": true, "allowed_headers": "*", "allowed_methods": "*", "allowed_origin": "*", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" }, { "$metadata": { "description": "This example demonstrates how to configure the CORS plugin with a reflect Origin setup.", "title": "Reflect Origin" }, "config": { "allow_credentials": true, "allow_private_network": false, "allowed_headers": "*", "allowed_methods": "GET, POST", "allowed_origin": "reflect", "exposed_headers": "*", "max_age": 3600 }, "enabled": true, "type": "cors" } ], "properties": { "allow_credentials": { "default": false, "description": "`Access-Control-Allow-Credentials`: Specifies whether to include credentials in the CORS headers. Credentials can include cookies, authorization headers, or TLS client certificates. Indicates whether the response to the request can be exposed when the credentials flag is true.", "type": [ "boolean", "null" ] }, "allow_private_network": { "default": false, "description": "`Access-Control-Allow-Private-Network`: Indicates whether requests from private networks are allowed when originating from public networks.", "type": [ "boolean", "null" ] }, "allowed_headers": { "default": "*", "description": "`Access-Control-Allow-Headers`: Lists the headers allowed in actual requests. This helps in specifying which headers can be used when making the actual request. Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request. You can also specify a special value \"*\" to allow any headers to be used when making the actual request, and the `Access-Control-Request-Headers` will be used from the incoming request.", "type": [ "string", "null" ] }, "allowed_methods": { "default": "*", "description": "`Access-Control-Allow-Methods`: Defines the HTTP methods allowed when accessing the resource. This is used in response to a CORS preflight request. Specifies the method or methods allowed when accessing the resource in response to a preflight request. You can also specify a special value \"*\" to allow any HTTP method to access the resource.", "type": [ "string", "null" ] }, "allowed_origin": { "default": "*", "description": "`Access-Control-Allow-Origin`: Determines which origins are allowed to access the resource. It can be a specific origin or a wildcard for allowing any origin. You can also specify a special value \"*\" to allow any origin to access the resource. You can also specify a special value \"reflect\" to allow the origin of the incoming request to access the resource.", "type": [ "string", "null" ] }, "exposed_headers": { "default": "*", "description": "`Access-Control-Expose-Headers`: The \"Access-Control-Expose-Headers\" response header allows a server to indicate which response headers should be made available to scripts running in the browser, in response to a cross-origin request. You can also specify a special value \"*\" to allow any headers to be exposed to scripts running in the browser.", "type": [ "string", "null" ] }, "max_age": { "description": "`Access-Control-Max-Age`: Indicates how long the results of a preflight request can be cached. This field represents the duration in seconds.", "format": "uint64", "minimum": 0.0, "type": [ "integer", "null" ] } }, "type": "object" }, "DisableIntrospectionPluginConfig": { "description": "The `disable_introspection` plugin allows you to disable introspection for your GraphQL API.\n\nA [GraphQL introspection query](https://graphql.org/learn/introspection/) is a special GraphQL query that returns information about the GraphQL schema of your API.\n\nIt it [recommended to disable introspection for production environments](https://escape.tech/blog/should-i-disable-introspection-in-graphql/), unless you have a specific use-case for it.\n\nIt can either disable introspection for all requests, or only for requests that match a specific condition (using VRL scripting language).", "examples": [ { "$metadata": { "description": "This example disables introspection for all requests for the configured Endpoint.", "title": "Disable Introspection" }, "config": {}, "enabled": true, "type": "disable_introspection" }, { "$metadata": { "description": "This example disables introspection for all requests that doesn't have the \"bypass-introspection\" HTTP header.", "title": "Conditional" }, "config": { "condition": { "content": "%downstream_http_req.headers.\"bypass-introspection\" != \"1\"", "from": "inline" } }, "enabled": true, "type": "disable_introspection" } ], "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A VRL condition that determines whether to disable introspection for the request. This condition is evaluated only if the incoming GraphQL request is detected as an introspection query.\n\nThe condition is evaluated in the context of the incoming request and have access to the metadata field `%downstream_http_req` (fields: `body`, `uri`, `query_string`, `method`, `headers`).\n\nThe condition must return a boolean value: return `true` to continue and disable the introspection, and `false` to allow the introspection to run.\n\nIn case of a runtime error, or an unexpected return value, the script will be ignored and introspection will be disabled for the incoming request." } }, "type": "object" }, "Duration": { "properties": { "nanos": { "format": "uint32", "minimum": 0.0, "type": "integer" }, "secs": { "format": "uint64", "minimum": 0.0, "type": "integer" } }, "required": [ "nanos", "secs" ], "type": "object" }, "EndpointDefinition": { "description": "The `Endpoint` object exposes a GraphQL source with set of plugins applied to it.\n\nEach Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.", "examples": [ { "$metadata": { "description": "This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.", "title": "Basic Example" }, "endpoints": [ { "from": "my-source", "path": "/graphql", "plugins": [ { "type": "graphiql" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] }, { "$metadata": { "description": "This example shows how to expose a single GraphQL source with different plugins applied to it. In this example, we expose the same, one time with persised operations, and one time with HTTP GET for arbitrary queries.", "title": "Multiple Endpoints" }, "endpoints": [ { "from": "my-source", "path": "/trusted", "plugins": [ { "config": { "allow_untrusted": false, "protocols": [ { "field_name": "", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "store.json", "source": "file" } }, "type": "trusted_documents" } ] }, { "from": "my-source", "path": "/data", "plugins": [ { "config": { "mutations": false }, "type": "http_get" } ] } ], "sources": [ { "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ] } ], "properties": { "from": { "description": "The identifier of the `Source` to be used.\n\nThis must match the `id` field of a `Source` definition.", "type": "string" }, "path": { "description": "A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.", "type": "string" }, "plugins": { "description": "A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.\n\nOrder of plugins is important: plugins are applied in the order they are defined.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] } }, "required": [ "from", "path" ], "type": "object" }, "FederationSourceConfig": { "description": "A source capable of loading a Supergraph schema based on the [Apollo Federation specification](https://www.apollographql.com/docs/federation/).\n\nThe loaded supergraph will be used to orchestrate the execution of the queries across the federated sources.\n\nThe input for this source can be a local file, an environment variable, or a remote endpoint.\n\nThe content of the Supergraph input needs to be a valid GraphQL SDL schema, with the Apollo Federation execution directives, usually produced by a schema registry.", "examples": [ { "$metadata": { "description": "This example is loading a Supergraph schema from a remote endpoint, using the Hive CDN. ", "title": "Hive" }, "config": { "expose_query_plan": false, "supergraph": { "remote": { "fetch_every": "10s", "headers": { "X-Hive-CDN-Key": "CDN_TOKEN" }, "url": "https://cdn.graphql-hive.com/artifacts/v1/TARGET_ID/supergraph" } } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From a file" }, "config": { "expose_query_plan": false, "supergraph": { "file": "./supergraph.graphql" } }, "id": "my-source", "type": "federation" }, { "$metadata": { "description": null, "title": "From Env Var" }, "config": { "expose_query_plan": false, "supergraph": { "env": "SUPERGRAPH" } }, "id": "my-source", "type": "federation" } ], "properties": { "expose_query_plan": { "default": false, "description": "Exposes the query plan as JSON under \"extensions\"", "type": "boolean" }, "supergraph": { "$ref": "#/definitions/SupergraphSourceConfig", "description": "The endpoint URL for the GraphQL source." } }, "required": [ "supergraph" ], "type": "object" }, "GraphQLSourceConfig": { "description": "An upstream based on a simple, single GraphQL endpoint.\n\nBy using this source, you can easily wrap an existing GraphQL upstream server, and enrich it with features and plugins.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": { "endpoint": "https://my-source.com/graphql" }, "id": "my-source", "type": "graphql" } ], "properties": { "endpoint": { "description": "The HTTP(S) endpoint URL for the GraphQL source.", "type": "string" } }, "required": [ "endpoint" ], "type": "object" }, "GraphiQLPluginConfig": { "description": "This plugin adds a GraphiQL interface to your Endpoint.\n\nThis plugin is rendering the GraphiQL interface for HTTP `GET` requests, that are not intercepted by other plugins.", "examples": [ { "$metadata": { "description": null, "title": "Enable GraphiQL" }, "config": {}, "enabled": true, "type": "graphiql" } ], "properties": { "headers_editor_enabled": { "default": true, "description": "Enable/disable the HTTP headers editor in the GraphiQL interface.", "type": [ "boolean", "null" ] } }, "type": "object" }, "HttpGetPluginConfig": { "description": "The `http_get` plugin allows you to expose your GraphQL API over HTTP `GET` requests. This feature is fully compliant with the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/).\n\nBy enabling this plugin, you can execute GraphQL queries and mutations over HTTP `GET` requests, using HTTP query parameters, for example:\n\n`GET /graphql?query=query%20%7B%20__typename%20%7D`\n\n### Query Parameters\n\nFor complete documentation of the supported query parameters, see the [GraphQL over HTTP specification](https://graphql.github.io/graphql-over-http/draft/#sec-GET).\n\n- `query`: The GraphQL query to execute\n\n- `variables` (optional): A JSON-encoded string containing the GraphQL variables\n\n- `operationName` (optional): The name of the GraphQL operation to execute\n\n### Headers\n\nTo execute GraphQL queries over HTTP `GET` requests, you must set the `Content-Type` header to `application/json`, **or** the `Accept` header to `application/x-www-form-urlencoded` / `application/graphql-response+json`.", "examples": [ { "$metadata": { "description": null, "title": "Simple" }, "config": {}, "enabled": true, "type": "http_get" }, { "$metadata": { "description": "This example enables mutations over HTTP GET requests.", "title": "Enable Mutations" }, "config": { "mutations": true }, "enabled": true, "type": "http_get" } ], "properties": { "mutations": { "default": false, "description": "Allow mutations over GET requests.\n\n**The option is disabled by default:** this restriction is necessary to conform with the long-established semantics of safe methods within HTTP.", "type": [ "boolean", "null" ] } }, "type": "object" }, "JwksProviderSourceConfig": { "oneOf": [ { "description": "A local file on the file-system. This file will be read once on startup and cached.", "properties": { "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "local" ], "type": "string" } }, "required": [ "path", "source" ], "title": "local", "type": "object" }, { "description": "A remote JWKS provider. The JWKS will be fetched via HTTP/HTTPS and cached.", "properties": { "cache_duration": { "default": "10m", "description": "Duration after which the cached JWKS should be expired. If not specified, the default value will be used.", "type": "string" }, "prefetch": { "description": "If set to `true`, the JWKS will be fetched on startup and cached. In case of invalid JWKS, the error will be ignored and the plugin will try to fetch again when server receives the first request. If set to `false`, the JWKS will be fetched on-demand, when the first request comes in.", "type": [ "boolean", "null" ] }, "source": { "enum": [ "remote" ], "type": "string" }, "url": { "description": "The URL to fetch the JWKS key set from, via HTTP/HTTPS.", "type": "string" } }, "required": [ "source", "url" ], "title": "remote", "type": "object" } ] }, "JwtAuthPluginConfig": { "description": "The `jwt_auth` plugin implements the [JSON Web Tokens](https://jwt.io/introduction) specification.\n\nIt can be used to verify the JWT signature, and optionally validate the token issuer and audience. It can also forward the token and its claims to the upstream service.\n\nThe JWKS configuration can be either a local file on the file-system, or a remote JWKS provider.\n\nBy default, the plugin will look for the JWT token in the `Authorization` header, with the `Bearer` prefix.\n\nYou can also configure the plugin to reject requests that don't have a valid JWT token.", "examples": [ { "$metadata": { "description": "This example is loading a JWKS file from the local file-system. The token is looked up in the `Authorization` header.", "title": "Local JWKS" }, "config": { "jwks_providers": [ { "path": "jwks.json", "source": "local" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, when the server starts (prefetch). The token is looked up in the `Authorization` header.", "title": "Remote JWKS with prefetch" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ] }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `auth` cookie. If the token is not present, the request will be rejected.", "title": "Reject Unauthenticated" }, "config": { "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "auth", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is loading a remote JWKS, and looks for the token in the `jwt` cookie. If the token is not present, the request will be rejected. The token and its claims will be forwarded to the upstream service in the `X-Auth-Token` and `X-Auth-Claims` headers.", "title": "Claims Forwarding" }, "config": { "forward_claims_to_upstream_header": "X-Auth-Claims", "forward_token_to_upstream_header": "X-Auth-Token", "jwks_providers": [ { "cache_duration": "10m", "prefetch": true, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ], "reject_unauthenticated_requests": true }, "enabled": true, "type": "jwt_auth" }, { "$metadata": { "description": "This example is using strict validation, where the token issuer and audience are checked.", "title": "Strict Validation" }, "config": { "audiences": [ "realm.myapp.com" ], "issuers": [ "https://example.com" ], "jwks_providers": [ { "cache_duration": "10m", "prefetch": null, "source": "remote", "url": "https://example.com/jwks.json" } ], "lookup_locations": [ { "name": "jwt", "source": "cookies" } ] }, "enabled": true, "type": "jwt_auth" } ], "properties": { "allowed_algorithms": { "default": [ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "ES256", "ES384", "PS256", "PS384", "PS512", "EdDSA" ], "description": "List of allowed algorithms for verifying the JWT signature. If not specified, the default list of all supported algorithms in [`jsonwebtoken` crate](https://crates.io/crates/jsonwebtoken) are used.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "audiences": { "description": "The list of [JWT audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3) are allowed to access. If this field is set, the token's `aud` field must be one of the values in this list, otherwise the token's `aud` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "forward_claims_to_upstream_header": { "description": "Forward the JWT claims to the upstream service in the specified header.", "type": [ "string", "null" ] }, "forward_token_to_upstream_header": { "description": "Forward the JWT token to the upstream service in the specified header.", "type": [ "string", "null" ] }, "issuers": { "description": "Specify the [principal](https://tools.ietf.org/html/rfc7519#section-4.1.1) that issued the JWT, usually a URL or an email address. If specified, it has to match the `iss` field in JWT, otherwise the token's `iss` field is not checked.", "items": { "type": "string" }, "type": [ "array", "null" ] }, "jwks_providers": { "description": "A list of JWKS providers to use for verifying the JWT signature. Can be either a path to a local JSON of the file-system, or a URL to a remote JWKS provider.", "items": { "$ref": "#/definitions/JwksProviderSourceConfig" }, "type": "array" }, "lookup_locations": { "default": [ { "name": "Authorization", "prefix": "Bearer", "source": "header" } ], "description": "A list of locations to look up for the JWT token in the incoming HTTP request. The first one that is found will be used.", "items": { "$ref": "#/definitions/JwtAuthPluginLookupLocation" }, "type": "array" }, "reject_unauthenticated_requests": { "description": "If set to `true`, the entire request will be rejected if the JWT token is not present in the request.", "type": [ "boolean", "null" ] } }, "required": [ "jwks_providers" ], "type": "object" }, "JwtAuthPluginLookupLocation": { "oneOf": [ { "properties": { "name": { "type": "string" }, "prefix": { "type": [ "string", "null" ] }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "query_param" ], "type": "string" } }, "required": [ "name", "source" ], "title": "query_param", "type": "object" }, { "properties": { "name": { "type": "string" }, "source": { "enum": [ "cookies" ], "type": "string" } }, "required": [ "name", "source" ], "title": "cookies", "type": "object" } ] }, "LocalFileReference": { "format": "path", "type": "string" }, "LoggerConfig": { "properties": { "filter": { "default": "info", "description": "Environment filter configuration as a string. This allows extremely powerful control over Conductor's logging.\n\nThe `filter` can specify various directives to filter logs based on module paths, span names, and specific fields. These directives can also be combined using commas as a separator.\n\n**Basic Usage:**\n\n- `info` (logs all messages at info level and higher across all modules)\n\n- `error` (logs all messages at error level only, as it's the highest level of severity)\n\n**Module-Specific Logging:**\n\n- `conductor::gateway=debug` (logs all debug messages for the 'conductor::gateway' module)\n\n- `conductor::engine::source=trace` (logs all trace messages for the 'conductor::engine::source' module)\n\n**Combining Directives:**\n\n- `conductor::gateway=info,conductor::engine::source=trace` (sets info level for the gateway module and trace level for the engine's source module)\n\nThe syntax of directives is very flexible, allowing complex logging configurations.\n\nSee [tracing_subscriber::EnvFilter](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html) for more information.", "type": "string" }, "format": { "$ref": "#/definitions/LoggerConfigFormat", "default": "pretty", "description": "Configured the logger format. See options below.\n\n- `pretty` format is human-readable, ideal for development and debugging.\n\n- `json` format is structured, suitable for production environments and log analysis tools.\n\nBy default, `pretty` is used in TTY environments, and `json` is used in non-TTY environments." }, "print_performance_info": { "default": false, "description": "Emits performance information on in crucial areas of the gateway.\n\nLook for `close` and `idle` spans printed in the logs.\n\nNote: this option is not enabled on WASM runtime, and will be ignored if specified.", "type": "boolean" } }, "type": "object" }, "LoggerConfigFormat": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "This logging format outputs minimal, compact logs. It focuses on the essential parts of the log message and its fields, making it suitable for production environments where performance and log size are crucial.\n\nPros:\n\n- Efficient in terms of space and performance.\n\n- Easy to read for brief messages and simple logs.\n\nCons:\n\n- May lack detailed context, making debugging a bit more challenging.", "enum": [ "compact" ], "title": "compact", "type": "string" }, { "description": "The pretty format is designed for enhanced readability, featuring more verbose output including well-formatted fields and context. Ideal for development and debugging purposes.\n\nPros:\n\n- Highly readable and provides detailed context.\n\n- Easier to understand complex log messages.\n\nCons:\n\n- More verbose, resulting in larger log sizes.\n\n- Potentially slower performance due to the additional formatting overhead.", "enum": [ "pretty" ], "title": "pretty", "type": "string" }, { "description": "This format outputs logs in JSON. It is particularly useful when integrating with tools that consume or process JSON logs, such as log aggregators and analysis systems.\n\nPros:\n\n- Structured format makes it easy to parse and integrate with various tools.\n\n- Consistent and predictable output.\n\nCons:\n\n- Can be verbose and harder to read directly by developers.\n\n- Slightly more overhead compared to simpler formats like compact.", "enum": [ "json" ], "title": "json", "type": "string" } ] }, "MockedSourceConfig": { "description": "A mocked upstream with a static response for all executed operations.", "properties": { "response_data": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "response_data" ], "type": "object" }, "OtlpProtcol": { "oneOf": [ { "description": "Uses GRPC with `tonic` to send telemetry data.", "enum": [ "grpc" ], "title": "grpc", "type": "string" }, { "description": "Uses HTTP with `http-proto` to send telemetry data.", "enum": [ "http" ], "title": "http", "type": "string" } ] }, "PluginDefinition": { "oneOf": [ { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/GraphiQLPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "graphiql" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/CorsPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "cors" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "description": "Configuration for the Disable Introspection plugin.", "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/DisableIntrospectionPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "disable_introspection" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "anyOf": [ { "$ref": "#/definitions/HttpGetPluginConfig" }, { "type": "null" } ] }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "http_get" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/VrlPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "vrl" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TrustedDocumentsPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "trusted_documents" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/JwtAuthPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "jwt_auth" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" }, { "properties": { "config": { "$ref": "#/definitions/TelemetryPluginConfig" }, "enabled": { "default": true, "type": [ "boolean", "null" ] }, "type": { "enum": [ "telemetry" ], "type": "string" } }, "required": [ "config", "type" ], "type": "object" } ] }, "ServerConfig": { "properties": { "host": { "default": "127.0.0.1", "description": "The host to listen on, default to 127.0.0.1", "type": "string" }, "port": { "default": 9000, "description": "The port to listen on, default to 9000", "format": "uint16", "minimum": 0.0, "type": "integer" } }, "type": "object" }, "SourceDefinition": { "description": "A source definition for a GraphQL endpoint or a federated GraphQL implementation.", "oneOf": [ { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/GraphQLSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "graphql" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "A simple, single GraphQL endpoint", "properties": { "config": { "$ref": "#/definitions/MockedSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "mock" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" }, { "description": "federation endpoint", "properties": { "config": { "$ref": "#/definitions/FederationSourceConfig", "description": "The configuration for the GraphQL source." }, "id": { "description": "The identifier of the source. This is used to reference the source in the `from` field of an endpoint definition.", "type": "string" }, "type": { "enum": [ "federation" ], "type": "string" } }, "required": [ "config", "id", "type" ], "type": "object" } ] }, "SupergraphSourceConfig": { "oneOf": [ { "additionalProperties": false, "description": "The file path for the Supergraph schema.\n\n> This provider is not supported on WASM runtime.", "properties": { "file": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "file" ], "title": "file", "type": "object" }, { "additionalProperties": false, "description": "The environment variable that contains the Supergraph schema.", "properties": { "env": { "type": "string" } }, "required": [ "env" ], "title": "env", "type": "object" }, { "additionalProperties": false, "description": "The remote endpoint where the Supergraph schema can be fetched.", "properties": { "remote": { "properties": { "fetch_every": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ], "default": "1m", "description": "Polling interval for fetching the Supergraph schema from the remote." }, "headers": { "additionalProperties": { "type": "string" }, "description": "Optional headers to include in the request (ex: for authentication)", "type": [ "object", "null" ] }, "url": { "description": "The URL endpoint from where to fetch the Supergraph schema.", "type": "string" } }, "required": [ "url" ], "type": "object" } }, "required": [ "remote" ], "title": "remote", "type": "object" } ] }, "TelemetryPluginConfig": { "description": "The `telemetry` plugin exports traces information about Conductor to a telemetry backend.\n\n<Callout>\n\nAt the moment, this plugin is not supported on WASM (CloudFlare Worker) runtime.\n\nYou may follow [this GitHub issue](https://github.com/the-guild-org/conductor/issues/354) for additional information.\n\n</Callout>\n\nThe telemetry plugin exports traces information about the following aspects of Conductor:\n\n- GraphQL parser (timing)\n\n- GraphQL execution (operation type, operation body, operation name, timing, errors)\n\n- Query planning (timing, operation body, operation name)\n\n- Incoming HTTP requests (attributes, timing, errors)\n\n- Outgoing HTTP requests (attributes, timing, errors)\n\nWhen used with a telemtry backend, you can expect to see the following information:\n\n![img](/assets/telemetry.png)", "properties": { "service_name": { "default": "conductor", "description": "Configures the service name that reports the telemetry data. This will appear in the telemetry data as the `service.name` attribute.", "type": "string" }, "targets": { "description": "A list of telemetry targets to send telemetry data to.\n\nThe telemtry data is scoped per endpoint, and you can specify multiple targets if you need to export stats to multiple backends.", "items": { "$ref": "#/definitions/TelemetryTarget" }, "type": "array" } }, "required": [ "targets" ], "type": "object" }, "TelemetryTarget": { "oneOf": [ { "description": "Sends telemetry data to `stdout` in a human-readable format.\n\nUse this source for debugging purposes, or if you want to pipe the telemetry data to another process.", "properties": { "type": { "enum": [ "stdout" ], "type": "string" } }, "required": [ "type" ], "title": "stdout", "type": "object" }, { "description": "Sends telemetry traces data to an [OpenTelemetry](https://opentelemetry.io/) backend, using the [OTLP protocol](https://opentelemetry.io/docs/specs/otel/protocol/).\n\nYou can find [here a list backends that supports the OTLP format](https://github.com/magsther/awesome-opentelemetry#open-source).", "properties": { "endpoint": { "description": "The OTLP backend endpoint. The format is based on full URL, e.g. `http://localhost:7201`.", "type": "string" }, "gzip_compression": { "default": false, "description": "Whether to use gzip compression when sending telemetry data.\n\nPlease verify your backend supports and enables `gzip` compression before enabling this option.", "type": "boolean" }, "protocol": { "$ref": "#/definitions/OtlpProtcol", "default": "grpc", "description": "The OTLP transport to use to export telemetry data." }, "timeout": { "default": "10s", "description": "Export timeout. You can use the human-readable format in this field, e.g. `10s`.", "type": "string" }, "type": { "enum": [ "otlp" ], "type": "string" } }, "required": [ "endpoint", "type" ], "title": "Open Telemetry (OTLP)", "type": "object" }, { "description": "Sends telemetry traces data to a [Datadog](https://www.datadoghq.com/) agent (local or remote).\n\nTo get started with Datadog, make sure you have a [Datadog agent running](https://docs.datadoghq.com/agent/?tab=source).", "properties": { "agent_endpoint": { "default": "127.0.0.1:8126", "description": "The Datadog agent endpoint. The format is based on hostname and port only, e.g. `127.0.0.1:8126`.", "type": "string" }, "type": { "enum": [ "datadog" ], "type": "string" } }, "required": [ "type" ], "title": "Datadog", "type": "object" }, { "description": "Sends telemetry traces data to a [Jaeger](https://www.jaegertracing.io/) backend, using the native protocol of [Jaeger (UDP) using `thrift`](https://www.jaegertracing.io/docs/next-release/getting-started/).\n\n> Note: Jaeger also [supports OTLP format](https://opentelemetry.io/blog/2022/jaeger-native-otlp/), so it's preferred to use the `otlp` target.\n\nTo get started with Jaeger, make sure you have a Jaeger backend running, and then use the following command to start the Jaeger backend and UI in your local machine, using Docker:\n\n`docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 jaegertracing/all-in-one:latest`", "properties": { "endpoint": { "default": "127.0.0.1:6831", "description": "The UDP endpoint of the Jaeger backend. The format is based on hostname and port only, e.g. `127.0.0.1:6831`.", "type": "string" }, "type": { "enum": [ "jaeger" ], "type": "string" } }, "required": [ "type" ], "title": "Jaeger", "type": "object" } ] }, "TrustedDocumentHttpGetParameterLocation": { "oneOf": [ { "description": "Instructs the plugin to extract this parameter from the query string of the HTTP request.", "properties": { "name": { "description": "The name of the HTTP query parameter.", "type": "string" }, "source": { "enum": [ "search_query" ], "type": "string" } }, "required": [ "name", "source" ], "title": "search_query", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from the path of the HTTP request.", "properties": { "position": { "description": "The numeric value specific the location of the argument (starting from 0).", "format": "uint", "minimum": 0.0, "type": "integer" }, "source": { "enum": [ "path" ], "type": "string" } }, "required": [ "position", "source" ], "title": "path", "type": "object" }, { "description": "Instructs the plugin to extract this parameter from a header in the HTTP request.", "properties": { "name": { "description": "The name of the HTTP header.", "type": "string" }, "source": { "enum": [ "header" ], "type": "string" } }, "required": [ "name", "source" ], "title": "header", "type": "object" } ] }, "TrustedDocumentsFileFormat": { "oneOf": [ { "description": "JSON file formated based on [Apollo Persisted Query Manifest](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#1-generate-operation-manifest).", "enum": [ "apollo_persisted_query_manifest" ], "title": "apollo_persisted_query_manifest", "type": "string" }, { "description": "A simple JSON map of key-value pairs.\n\nExample: `{\"key1\": \"query { __typename }\"}`", "enum": [ "json_key_value" ], "title": "json_key_value", "type": "string" } ] }, "TrustedDocumentsPluginConfig": { "description": "This plugin allows you to define a list of trusted GraphQL documents that can be executed by the gateway (also called **Persisted Operations**).\n\nFor additional information, please refer to [Trusted Documents](https://benjie.dev/graphql/trusted-documents).", "examples": [ { "$metadata": { "description": "This example is using a local file called `trusted_documents.json` as a store, using the Key->Value map format. The protocol exposed is based on HTTP `POST`, using the `documentId` parameter from the request body.", "title": "Local File Store" }, "config": { "protocols": [ { "field_name": "documentId", "type": "document_id" } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" }, { "$metadata": { "description": "This example uses a local file store called `trusted_documents.json`, using the Key->Value map format. The protocol exposed is based on HTTP `GET`, and extracts all parameters from the query string.", "title": "HTTP GET" }, "config": { "protocols": [ { "document_id_from": { "name": "documentId", "source": "search_query" }, "operation_name_from": { "name": "operationName", "source": "search_query" }, "type": "http_get", "variables_from": { "name": "variables", "source": "search_query" } } ], "store": { "format": "json_key_value", "path": "trusted_documents.json", "source": "file" } }, "enabled": true, "type": "trusted_documents" } ], "properties": { "allow_untrusted": { "description": "By default, this plugin does not allow untrusted operations to be executed. This is a security measure to prevent accidental exposure of operations that are not persisted.", "type": [ "boolean", "null" ] }, "protocols": { "description": "A list of protocols to be exposed by this plugin. Each protocol defines how to obtain the document ID from the incoming request. You can specify multiple kinds of protocols, if needed.", "items": { "$ref": "#/definitions/TrustedDocumentsProtocolConfig" }, "type": "array" }, "store": { "$ref": "#/definitions/TrustedDocumentsPluginStoreConfig", "description": "The store defines the source of trusted documents. The store contents is a list of hashes and GraphQL documents that are allowed to be executed." } }, "required": [ "protocols", "store" ], "type": "object" }, "TrustedDocumentsPluginStoreConfig": { "oneOf": [ { "description": "File-based store configuration. The path specified is relative to the location of the root configuration file. The file contents are loaded into memory on startup. The file is not reloaded automatically. The file format is specified by the `format` field, based on the structure of your file.", "properties": { "format": { "$ref": "#/definitions/TrustedDocumentsFileFormat", "description": "The format and the expected structure of the loaded store file." }, "path": { "$ref": "#/definitions/LocalFileReference", "description": "A path to a local file on the file-system. Relative to the location of the root configuration file." }, "source": { "enum": [ "file" ], "type": "string" } }, "required": [ "format", "path", "source" ], "title": "file", "type": "object" } ] }, "TrustedDocumentsProtocolConfig": { "oneOf": [ { "description": "This protocol is based on [Apollo's Persisted Query Extensions](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries/#2-publish-operation-manifest). The GraphQL operation key is sent over `POST` and contains `extensions` field with the GraphQL document hash.\n\nExample: `POST /graphql {\"extensions\": {\"persistedQuery\": {\"version\": 1, \"sha256Hash\": \"123\"}}`", "properties": { "type": { "enum": [ "apollo_manifest_extensions" ], "type": "string" } }, "required": [ "type" ], "title": "apollo_manifest_extensions", "type": "object" }, { "description": "This protocol is based on a `POST` request with a JSON body containing a field with the document ID. By default, the field name is `documentId`.\n\nExample: `POST /graphql {\"documentId\": \"123\", \"variables\": {\"code\": \"AF\"}, \"operationName\": \"test\"}`", "properties": { "field_name": { "default": "documentId", "description": "The name of the JSON field containing the document ID in the incoming request.", "type": "string" }, "type": { "enum": [ "document_id" ], "type": "string" } }, "required": [ "type" ], "title": "document_id", "type": "object" }, { "description": "This protocol is based on a HTTP `GET` request. You can customize where to fetch each one of the parameters from. Each request parameter can be obtained from a different source: query, path, or header. By defualt, all parameters are obtained from the query string.\n\nUnlike other protocols, this protocol does not support sending GraphQL mutations.\n\nExample: `GET /graphql?documentId=123&variables=%7B%22code%22%3A%22AF%22%7D&operationName=test`", "properties": { "document_id_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "documentId", "source": "search_query" }, "description": "Instructions for fetching the document ID parameter from the incoming HTTP request." }, "operation_name_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "operationName", "source": "search_query" }, "description": "Instructions for fetching the operationName parameter from the incoming HTTP request." }, "type": { "enum": [ "http_get" ], "type": "string" }, "variables_from": { "$ref": "#/definitions/TrustedDocumentHttpGetParameterLocation", "default": { "name": "variables", "source": "search_query" }, "description": "Instructions for fetching the variables parameter from the incoming HTTP request. GraphQL variables must be passed as a JSON-encoded string." } }, "required": [ "type" ], "title": "http_get", "type": "object" } ] }, "VrlConfigReference": { "oneOf": [ { "description": "Inline string for a VRL code snippet. The string is parsed and executed as a VRL plugin.", "properties": { "content": { "type": "string" }, "from": { "enum": [ "inline" ], "type": "string" } }, "required": [ "content", "from" ], "title": "inline", "type": "object" }, { "description": "File reference to a VRL file. The file is loaded and executed as a VRL plugin.", "properties": { "from": { "enum": [ "file" ], "type": "string" }, "path": { "$ref": "#/definitions/LocalFileReference" } }, "required": [ "from", "path" ], "title": "file", "type": "object" } ] }, "VrlPluginConfig": { "description": "To simplify the process of extending the functionality of the GraphQL Gateway, we adopted a Rust-based script language called [VRL](https://vector.dev/docs/reference/vrl/).\n\nVRL language is intended for writing simple scripts that can be executed in the context of the GraphQL Gateway. VRL is focused around safety and performance: the script is compiled into Rust code when the server starts, and executed as a native Rust code ([you can find a comparison between VRL and other scripting languages here](https://github.com/YassinEldeeb/rust-embedded-langs-vs-native-benchmark)).\n\n> VRL was initially created to allow users to extend [Vector](https://vector.dev/), a high-performance observability data router, and adopted for Conductor to allow developers to extend the functionality of the GraphQL Gateway easily.\n\n### Writing VRL\n\nVRL is an expression-oriented language. A VRL program consists entirely of expressions, with every expression returning a value. You can define variables, call functions, and use operators to manipulate values.\n\n#### Variables and Functions\n\nThe following program defines a variable `myVar` with the value `\"myValue\"` and prints it to the console:\n\n```vrl\n\nmyVar = \"my value\"\n\nlog(myVar, level:\"info\")\n\n```\n\n#### Assignment\n\nThe `.` is used to set output values. In this example, we are setting the `x-authorization` header of the upstream HTTP request to `my-value`.\n\nHere's an example for a VRL program that extends Conductor's behavior by adding a custom HTTP header to all upstream HTTP requests:\n\n```vrl\n\n.upstream_http_req.headers.\"x-authorization\" = \"my-value\"\n\n```\n\n#### Metadata\n\nThe `%` is used to access metadata values. Note that metadata values are read only.\n\nThe following program is printing a metadata value to the console:\n\n```vrl\n\nlog(%downstream_http_req.headers.authorization, level:\"info\")\n\n```\n\n#### Further Reading\n\n- [VRL Playground](https://playground.vrl.dev/)\n\n- [VRL concepts documentation](https://vector.dev/docs/reference/vrl/#concepts)\n\n- [VRL syntax documentation](https://vector.dev/docs/reference/vrl/expressions/)\n\n- [Compiler errors documentation](https://vector.dev/docs/reference/vrl/errors/)\n\n- [VRL program examples](https://vector.dev/docs/reference/vrl/examples/)\n\n### Runtime Failure Handling\n\nSome VRL functions are fallible, meaning that they can error. Any potential errors thrown by fallible functions must be handled, a requirement enforced at compile time.\n\n```vrl\n\n# This function is fallible, and can create errors, so it must be handled.\n\nparsed, err = parse_json(\"invalid json\")\n\n```\n\nVRL function calls can be marked as infallible by adding a `!` suffix to the function call: (note that this might lead to runtime errors)\n\n```vrl\n\nparsed = parse_json!(\"invalid json\")\n\n```\n\n> In case of a runtime error of a fallible function call, an error will be returned to the end-user, and the gateway will not continue with the execution.\n\n### Input/Output\n\n#### `on_downstream_http_request`\n\nThe `on_downstream_http_request` hook is executed when a downstream HTTP request is received to the gateway from the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_req.body` (type: `string`): The body string of the incoming HTTP request.\n\n- `%downstream_http_req.uri` (type: `string`): The URI of the incoming HTTP request.\n\n- `%downstream_http_req.query_string` (type: `string`): The query string of the incoming HTTP request.\n\n- `%downstream_http_req.method` (type: `string`): The HTTP method of the incoming HTTP request.\n\n- `%downstream_http_req.headers` (type: `object`): The HTTP headers of the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, the gateway will skip the lookup phase, and will use this GraphQL operation instead.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can specify the executable operation by setting this value.\n\n- `.graphql.variables` (type: `object`): The GraphQL variables to be used when executing the GraphQL operation.\n\n- `.graphql.extensions` (type: `object`): The GraphQL extensions to be used when executing the GraphQL operation.\n\n#### `on_downstream_graphql_request`\n\nThe `on_downstream_graphql_request` hook is executed when a GraphQL operation is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_graphql_req.operation` (type: `string`): The GraphQL operation string, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.operation_name`(type: `string`) : If multiple GraphQL operations are set in `%downstream_graphql_req.operation`, you can specify the executable operation by setting this value.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request.\n\nThe following output values are available to the hook:\n\n- `.graphql.operation` (type: `string`): The GraphQL operation string to be executed. If this value is set, it will override the existing operation.\n\n- `.graphql.operation_name` (type: `string`): If multiple GraphQL operations are set in `.graphql.operation`, you can override the extracted value by setting this field.\n\n- `%downstream_graphql_req.variables` (type: `object`): The GraphQL variables, as extracted from the incoming HTTP request. Setting this value will override the existing variables.\n\n- `%downstream_graphql_req.extensions` (type: `object`): The GraphQL extensions, as extracted from the incoming HTTP request. Setting this value will override the existing extensions.\n\n#### `on_upstream_http_request`\n\nThe `on_upstream_http_request` hook is executed when an HTTP request is about to be sent to the upstream GraphQL server.\n\nThe following metadata inputs are available to the hook:\n\n- `%upstream_http_req.body` (type: `string`): The body string of the planned HTTP request.\n\n- `%upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request.\n\n- `%upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request.\n\n- `%upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request.\n\n- `%upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request.\n\nThe following output values are available to the hook:\n\n- `.upstream_http_req.body` (type: `string`): The body string of the planned HTTP request. Setting this value will override the existing body.\n\n- `.upstream_http_req.uri` (type: `string`): The URI of the planned HTTP request. Setting this value will override the existing URI.\n\n- `.upstream_http_req.query_string` (type: `string`): The query string of the planned HTTP request. Setting this value will override the existing query string.\n\n- `.upstream_http_req.method` (type: `string`): The HTTP method of the planned HTTP request. Setting this value will override the existing HTTP method.\n\n- `.upstream_http_req.headers` (type: `object`): The HTTP headers of the planned HTTP request. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n#### `on_downstream_http_response`\n\nThe `on_downstream_http_response` hook is executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user.\n\nThe following metadata inputs are available to the hook:\n\n- `%downstream_http_res.body` (type: `string`): The body string of the HTTP response.\n\n- `%downstream_http_res.status` (type: `number`): The status code of the HTTP response.\n\n- `%downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response.\n\nThe following output values are available to the hook:\n\n- `.downstream_http_res.body` (type: `string`): The body string of the HTTP response. Setting this value will override the existing body.\n\n- `.downstream_http_res.status` (type: `number`): The status code of the HTTP response. Setting this value will override the existing status code.\n\n- `.downstream_http_res.headers` (type: `object`): The HTTP headers of the HTTP response. Headers set here will only extend the existing headers. You can use `null` value if you wish to remove an existing header.\n\n### Shared State\n\nDuring the execution of VRL programs, Conductor configures a shared state object for every incoming HTTP request.\n\nThis means that you can create type-safe shared state objects, and use them to share data between different VRL programs and hooks.\n\nYou can find an example for this in the **Examples** section below.\n\n### Available Functions", "examples": [ { "$metadata": { "description": "Load and execute VRL plugins using inline configuration.", "title": "Inline" }, "config": { "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-authorization\" = \"some-value\"\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "Load and execute VRL plugins using an external '.vrl' file.", "title": "File" }, "config": { "on_upstream_http_request": { "from": "file", "path": "my_plugin.vrl" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "This example is using the shared-state feature to store the headers from the incoming HTTP request, and it pass it through to upstream calls.", "title": "Headers Passthrough" }, "config": { "on_downstream_http_request": { "content": "incoming_headers = %downstream_http_req.headers\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers = incoming_headers\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is configuring a variable, and use it later", "title": "Shared State" }, "config": { "on_downstream_http_request": { "content": "authorization_header = %downstream_http_req.headers.authorization\n ", "from": "inline" }, "on_upstream_http_request": { "content": ".upstream_http_req.headers.\"x-auth\" = authorization_header\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example rejects all incoming requests that doesn't have the \"authorization\" header set.", "title": "Short Circuit" }, "config": { "on_downstream_http_request": { "content": "if %downstream_http_req.headers.authorization == null {\nshort_circuit!(403, \"Missing authorization header\")\n}\n ", "from": "inline" } }, "enabled": true, "type": "vrl" }, { "$metadata": { "description": "The following example is using a custom GraphQL extraction, overriding the default gateway behavior. In this example, we parse the incoming body as JSON and use the parsed value to find the GraphQL operation. Assuming the body structure is: `{ \"runThisQuery\": \"query { __typename }\", \"variables\": { }`.", "title": "Custom GraphQL Extraction" }, "config": { "on_downstream_http_request": { "content": "parsed_body = parse_json!(%downstream_http_req.body)\n.graphql.operation = parsed_body.runThisQuery\n.graphql.variables = parsed_body.variables\n ", "from": "inline" } }, "enabled": true, "type": "vrl" } ], "properties": { "on_downstream_graphql_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL query is extracted from a downstream HTTP request, and before the upstream GraphQL request is sent. This hooks allow you to easily manipulate the incoming GraphQL request." }, "on_downstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a downstream HTTP request is received to the gateway from the end-user. This hook allow you to extract information from the request, for later use, or to reject a request quickly." }, "on_downstream_http_response": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when a GraphQL response is received from the upstream GraphQL server, and before the response is sent to the end-user. This hook allow you to manipulate the end-user response easily." }, "on_upstream_http_request": { "anyOf": [ { "$ref": "#/definitions/VrlConfigReference" }, { "type": "null" } ], "description": "A hook executed when an HTTP request is about to be sent to the upstream GraphQL server. This hook allow you to manipulate upstream HTTP calls easily." } }, "type": "object" } }, "description": "This section describes the top-level configuration object for Conductor gateway.\n\nConductor supports both YAML and JSON format for the configuration file.\n\n## Loading the config file\n\nThe configuration is loaded when server starts, based on the runtime environment you are using:\n\n### Binary\n\nIf you are running the Conductor binary directly, you can specify the configuration file path using the first argument:\n\n```sh\n\nconductor my-config-file.json\n\n```\n\n> By default, Conductor will look for a file named `config.json` in the current directory.\n\n### Docker\n\nIf you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:\n\n```sh\n\ndocker run -v my-config-file.json:/app/config.json the-guild-org/conductor:latest /app/config.json\n\n```\n\n### CloudFlare Worker\n\nWASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named `CONDUCTOR_CONFIG`.\n\n## Autocomplete/validation in VSCode\n\nFor JSON files, you can specify the `$schema` property to enable autocomplete and validation in VSCode:\n\n```json filename=\"config.json\"\n\n{ \"$schema\": \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\" }\n\n```\n\nFor YAML auto-complete and validation, you can install the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension and enable it by adding the following to your YAML file:\n\n```yaml filename=\"config.yaml\"\n\n$schema: \"https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json\"\n\n```\n\n### JSONSchema\n\nAs part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.\n\nYou can find [here the latest version of the schema](https://github.com/the-guild-org/conductor/releases).\n\n### Configuration Interpolation with Environment Variables\n\nThis feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.\n\nSyntax for Environment Variable Interpolation: - Use `${VAR_NAME}` to insert the value of an environment variable. If `VAR_NAME` is not set, an error will pop up. - Specify a default value with `${VAR_NAME:default_value}` which is used when `VAR_NAME` is not set. - Escape a dollar sign by preceding it with a backslash (e.g., `\\$`) to use it as a literal character instead of triggering interpolation.\n\nExamples: - `endpoint: ${API_ENDPOINT:https://api.example.com/}` - Uses the `API_ENDPOINT` variable or defaults to the provided URL. - `name: \\$super` - Results in the literal string `name: \\$super` in the configuration.", "properties": { "endpoints": { "description": "List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.\n\nFor additional information, please refer to the [Endpoints section](./endpoints).", "items": { "$ref": "#/definitions/EndpointDefinition" }, "type": "array" }, "logger": { "anyOf": [ { "$ref": "#/definitions/LoggerConfig" }, { "type": "null" } ], "description": "Conductor logger configuration." }, "plugins": { "description": "List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.", "items": { "$ref": "#/definitions/PluginDefinition" }, "type": [ "array", "null" ] }, "server": { "anyOf": [ { "$ref": "#/definitions/ServerConfig" }, { "type": "null" } ], "description": "Configuration for the HTTP server." }, "sources": { "description": "List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.\n\nFor additional information, please refer to the [Sources section](./sources/graphql).", "items": { "$ref": "#/definitions/SourceDefinition" }, "type": "array" } }, "required": [ "endpoints", "sources" ], "title": "ConductorConfig", "type": "object" }
MIT
en
Efficy/bootstrap-vue-3
958638099d9172b8c4c15d6fbb9905d1ef7eb000
"2022-09-09T22:14:27"
apps/docs/docs/component-references/schema.json
6
2024-05-28T04:29:50.936537Z
{ "$id": "https://example.com/product.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "A schema for component-references", "properties": { "meta": { "properties": { "components": { "items": { "properties": { "component": { "type": "string" }, "emits": { "items": { "properties": { "args": { "items": { "properties": { "arg": { "type": "string" }, "description": { "type": "string" }, "type": { "type": "string" } }, "type": "object" }, "type": "array" }, "description": { "type": "string" }, "emit": { "type": "string" } }, "type": "object" }, "type": "array" }, "props": { "items": { "properties": { "description": { "type": "string" }, "prop": { "type": "string" }, "type": { "items": { "type": "string" }, "type": [ "string", "array" ] } }, "type": "object" }, "type": "array" }, "slots": { "items": { "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "scope": { "items": { "properties": { "description": { "type": "string" }, "prop": { "type": "string" }, "type": { "items": { "type": "string" }, "type": [ "array", "string" ] } }, "type": "object" }, "type": "array" } }, "type": "object" }, "type": "array" } }, "type": "object" }, "type": "array" }, "description": { "type": "string" }, "title": { "type": "string" } }, "type": "object" }, "name": { "description": "The name of the component", "type": "string" }, "version": { "description": "The version", "type": "string" } }, "title": "Component Schema", "type": "object" }
MIT
en
Efficy/bootstrap-vue-3
f6201ddba3f971d8f51bb12736c29156eef440fe
"2022-09-13T21:44:06"
apps/docs/docs/component-references/schema.json
6
2024-05-28T04:29:50.936537Z
{ "$id": "https://example.com/product.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "A schema for component-references", "properties": { "meta": { "properties": { "components": { "items": { "properties": { "component": { "type": "string" }, "emits": { "items": { "properties": { "args": { "items": { "properties": { "arg": { "type": "string" }, "description": { "type": "string" }, "type": { "type": "string" } }, "required": [ "arg", "type" ], "type": "object" }, "type": "array" }, "description": { "type": "string" }, "emit": { "type": "string" } }, "required": [ "emit", "args" ], "type": "object" }, "type": "array" }, "props": { "items": { "properties": { "description": { "type": "string" }, "prop": { "type": "string" }, "type": { "items": { "type": "string" }, "type": [ "string", "array" ] } }, "required": [ "prop", "type" ], "type": "object" }, "type": "array" }, "slots": { "items": { "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "scope": { "items": { "properties": { "description": { "type": "string" }, "prop": { "type": "string" }, "type": { "items": { "type": "string" }, "type": [ "array", "string" ] } }, "type": "object" }, "type": "array" } }, "required": [ "name", "scope" ], "type": "object" }, "type": "array" } }, "required": [ "component", "props", "emits", "slots" ], "type": "object" }, "type": "array" }, "description": { "type": "string" }, "title": { "type": "string" } }, "required": [ "title", "description", "components" ], "type": "object" }, "name": { "description": "The name of the component", "type": "string" }, "version": { "description": "The version", "type": "string" } }, "required": [ "name", "version", "meta" ], "title": "Component Schema", "type": "object" }
MIT
en
arenadata/adcm
cd7db319d95fbbc6c1b6801834b910e2f8d5500f
"2023-11-01T13:28:13"
python/api_v2/tests/files/responses/config_schemas/for_cluster_group_config.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "activatable_group": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": { "isAllowChange": true } }, "additionalProperties": false, "default": {}, "description": "", "properties": { "integer": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": { "isAllowChange": true } }, "default": 10, "description": "", "readOnly": false, "title": "integer", "type": "integer" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "integer" ], "title": "activatable_group", "type": "object" }, "boolean": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": { "isAllowChange": true } }, "default": true, "description": "", "readOnly": false, "title": "boolean", "type": "boolean" }, "group": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "float": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": { "isAllowChange": true } }, "default": 0.1, "description": "", "readOnly": false, "title": "float", "type": "number" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "float" ], "title": "group", "type": "object" }, "list": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": { "isAllowChange": true } }, "default": [ "value1", "value2", "value3" ], "description": "", "items": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "", "type": "string" }, "readOnly": false, "title": "list", "type": "array" }, { "type": "null" } ] }, "variant_not_strict": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false, "suggestions": [ "value1", "value2", "value3" ] }, "synchronization": { "isAllowChange": true } }, "default": "value1", "description": "", "readOnly": false, "title": "variant_not_strict", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "boolean", "group", "variant_not_strict", "list", "activatable_group" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
cd7db319d95fbbc6c1b6801834b910e2f8d5500f
"2023-11-01T13:28:13"
python/api_v2/tests/files/responses/config_schemas/for_service_group_config.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "activatable_group": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": { "isAllowChange": true } }, "additionalProperties": false, "default": {}, "description": "", "properties": { "text": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": true }, "synchronization": { "isAllowChange": true } }, "default": "text", "description": "", "readOnly": false, "title": "text", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "text" ], "title": "activatable_group", "type": "object" }, "group": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "password": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": { "isAllowChange": true } }, "default": "password", "description": "", "minLength": 1, "readOnly": false, "title": "password", "type": "string" } }, "readOnly": false, "required": [ "password" ], "title": "group", "type": "object" }, "string": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": { "isAllowChange": true } }, "default": "string", "description": "", "readOnly": false, "title": "string", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "string", "group", "activatable_group" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
015b569ea018ab4618ad738d2074f71f2c9f9efd
"2023-11-03T15:41:08"
python/api_v2/tests/files/responses/config_schemas/for_action_with_config.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "activatable_group": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "text": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": true }, "synchronization": null }, "default": "text", "description": "", "minLength": 1, "readOnly": false, "title": "text", "type": "string" } }, "readOnly": false, "required": [ "text" ], "title": "activatable_group", "type": "object" }, "after": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": [ "1", "woohoo" ], "description": "", "items": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "", "type": "string" }, "minItems": 1, "readOnly": false, "title": "after", "type": "array" }, "grouped": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "second": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 4.3, "description": "", "readOnly": false, "title": "second", "type": "number" }, "simple": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 4, "description": "", "readOnly": false, "title": "simple", "type": "integer" } }, "readOnly": false, "required": [ "simple", "second" ], "title": "grouped", "type": "object" }, "simple": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "simple", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "simple", "grouped", "after", "activatable_group" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
cd7db319d95fbbc6c1b6801834b910e2f8d5500f
"2023-11-01T13:28:13"
python/api_v2/tests/files/responses/config_schemas/for_cluster.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "activatable_group": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "integer": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 10, "description": "", "readOnly": false, "title": "integer", "type": "integer" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "integer" ], "title": "activatable_group", "type": "object" }, "boolean": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": true, "description": "", "readOnly": false, "title": "boolean", "type": "boolean" }, "group": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "float": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 0.1, "description": "", "readOnly": false, "title": "float", "type": "number" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "float" ], "title": "group", "type": "object" }, "list": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": [ "value1", "value2", "value3" ], "description": "", "items": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "", "type": "string" }, "readOnly": false, "title": "list", "type": "array" }, { "type": "null" } ] }, "variant_not_strict": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false, "suggestions": [ "value1", "value2", "value3" ] }, "synchronization": null }, "default": "value1", "description": "", "readOnly": false, "title": "variant_not_strict", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "boolean", "group", "variant_not_strict", "list", "activatable_group" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
cd7db319d95fbbc6c1b6801834b910e2f8d5500f
"2023-11-01T13:28:13"
python/api_v2/tests/files/responses/config_schemas/for_hostprovider.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "activatable_group": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "secretmap": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": null, "synchronization": null }, "additionalProperties": true, "default": { "integer_key": "10", "string_key": "string" }, "description": "", "properties": {}, "readOnly": false, "title": "secretmap", "type": "object" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "secretmap" ], "title": "activatable_group", "type": "object" }, "group": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "map": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": true, "default": { "integer_key": "10", "string_key": "string" }, "description": "", "properties": {}, "readOnly": false, "title": "map", "type": "object" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "map" ], "title": "group", "type": "object" }, "json": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": true }, "synchronization": null }, "default": "{\"key\": \"value\"}", "description": "", "format": "json", "readOnly": false, "title": "json", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "json", "group", "activatable_group" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
cd7db319d95fbbc6c1b6801834b910e2f8d5500f
"2023-11-01T13:28:13"
python/api_v2/tests/files/responses/config_schemas/for_adcm.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "ansible_settings": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "forks": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 5, "description": "This is the default number of parallel processes to spawn when communicating with remote hosts.\n", "maximum": 100, "minimum": 1, "readOnly": false, "title": "Forks", "type": "integer" } }, "readOnly": false, "required": [ "forks" ], "title": "Ansible Settings", "type": "object" }, "audit_data_retention": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "config_rotation_in_db": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 0, "description": "You can set the time (number of days) after which the Objects configuration will be deleted from the database. 0 is infinite storing.\n", "minimum": 0, "readOnly": false, "title": "Objects configurations retention period", "type": "integer" }, { "type": "null" } ] }, "data_archiving": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": false, "description": "Enable/disable archiving of data on operations and authorizations after the period specified in \"Audit data retention period\".\n", "readOnly": false, "title": "Enable audit data archiving", "type": "boolean" }, { "type": "null" } ] }, "log_rotation_in_db": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 365, "description": "You can set the time (number of days) after which the logs will be deleted from the database.\n", "minimum": 0, "readOnly": false, "title": "Job log retention period from database", "type": "integer" }, { "type": "null" } ] }, "log_rotation_on_fs": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 365, "description": "You can set the time (number of days) after which the logs will be deleted from the file system.\n", "minimum": 0, "readOnly": false, "title": "Job log retention period from file system", "type": "integer" }, { "type": "null" } ] }, "retention_period": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 1825, "description": "Data storage period (in days) for operations and authorizations in ADCM.\n", "readOnly": false, "title": "Audit data retention period", "type": "integer" } }, "readOnly": false, "required": [ "log_rotation_on_fs", "log_rotation_in_db", "config_rotation_in_db", "retention_period", "data_archiving" ], "title": "Data retention policy", "type": "object" }, "auth_policy": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "block_time": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 5, "description": "Defines a period (in min) of inactivity after which old failed login attempts will be cleared", "minimum": 1, "readOnly": false, "title": "Blocking time period", "type": "integer" }, "login_attempt_limit": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 5, "description": "The number of login attempts allowed before user account is locked out", "minimum": 1, "readOnly": false, "title": "Login attempt limit", "type": "integer" }, "max_password_length": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 128, "description": "", "maximum": 128, "minimum": 1, "readOnly": false, "title": "Maximum password length", "type": "integer" }, "min_password_length": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 12, "description": "", "maximum": 128, "minimum": 1, "readOnly": false, "title": "Minimum password length", "type": "integer" } }, "readOnly": false, "required": [ "min_password_length", "max_password_length", "login_attempt_limit", "block_time" ], "title": "Authentication policy", "type": "object" }, "global": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "adcm_url": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "http://127.0.0.1:8000/", "description": "We have to know ADCM's Url to send information from host. We try to guess that information from url you enter in browser.\nBut if your network has more complicated structure and we guess wrong, please fix that here.\n", "minLength": 1, "readOnly": false, "title": "ADCM's URL", "type": "string" }, "verification_public_key": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": true }, "synchronization": null }, "default": "\n", "description": "Bundle verification GPG public key to verify the signature of the bundle (*.sig file) when uploading the bundle to ADCM.\n", "minLength": 1, "readOnly": false, "title": "Bundle verification public key", "type": "string" } }, "readOnly": false, "required": [ "adcm_url", "verification_public_key" ], "title": "Global Options", "type": "object" }, "google_oauth": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "client_id": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "client_id", "type": "string" }, { "type": "null" } ] }, "secret": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "secret", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "client_id", "secret" ], "title": "Google Auth", "type": "object" }, "ldap_integration": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "group_member_attribute_name": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "member", "description": "Attribute from group entry that is list of members.\n", "minLength": 1, "readOnly": false, "title": "Group member attribute name", "type": "string" }, "group_name_attribute": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "cn", "description": "Attribute from group entry that would be treated as group name.\n", "minLength": 1, "readOnly": false, "title": "Group name attribute", "type": "string" }, "group_object_class": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "group", "description": "Object class to identify group entries.\n", "minLength": 1, "readOnly": false, "title": "Group object class", "type": "string" }, "group_search_base": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The distinguished name (DN) of the directory object from which to search for entries. For example: \"ou=Groups,dc=ad,dc=ranger-test\".\n", "readOnly": false, "title": "Group search base", "type": "string" }, { "type": "null" } ] }, "group_search_filter": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "Additional filter constraining the groups selected for syncing.\n", "readOnly": false, "title": "Group search filter", "type": "string" }, { "type": "null" } ] }, "ldap_password": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "Password for access to the LDAP server of the user specified in the \"LDAP User\" field.\n", "minLength": 1, "readOnly": false, "title": "Bind Password", "type": "string" }, "ldap_uri": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The URI of the LDAP server.\n", "minLength": 1, "readOnly": false, "title": "LDAP URI", "type": "string" }, "ldap_user": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The distinguished name (DN) of the user that is used to connect to the LDAP server. For example: \"cn=admin,dc=ad,dc=ranger-test\".\n", "minLength": 1, "readOnly": false, "title": "Bind DN", "type": "string" }, "sync_interval": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 60, "description": "Amount of time in minutes that group memberships and user distinguished names are synchronized between AD and ADCM.\n", "readOnly": false, "title": "Sync interval", "type": "integer" }, "tls_ca_cert_file": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "CA certificate path in ADCM container volume.\n", "readOnly": false, "title": "TLS CA certificate file path", "type": "string" }, { "type": "null" } ] }, "user_name_attribute": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "sAMAccountName", "description": "Attribute from user entry that would be treated as user name.\n", "minLength": 1, "readOnly": false, "title": "User name attribute", "type": "string" }, "user_object_class": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "user", "description": "Object class to identify user entries.\n", "minLength": 1, "readOnly": false, "title": "User object class", "type": "string" }, "user_search_base": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The distinguished name (DN) of the directory object from which to search for entries. For example: \"ou=Peoples,dc=ad,dc=ranger-test\".\n", "minLength": 1, "readOnly": false, "title": "User search base", "type": "string" }, "user_search_filter": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "Additional filter constraining the users selected for syncing.\n", "readOnly": false, "title": "User search filter", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "ldap_uri", "ldap_user", "ldap_password", "user_search_base", "user_search_filter", "user_object_class", "user_name_attribute", "group_search_base", "group_search_filter", "group_object_class", "group_name_attribute", "group_member_attribute_name", "sync_interval", "tls_ca_cert_file" ], "title": "LDAP integration", "type": "object" }, "logrotate": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "compress": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": false, "description": "Compress the rotated files\n", "readOnly": false, "title": "Enable compression", "type": "boolean" }, "max_history": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 10, "description": "Controls the maximum number of archive files to keep\n", "minimum": 1, "readOnly": false, "title": "Max files history", "type": "integer" }, "size": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "10M", "description": "Specifies the allowed size the log file can reach before it is archived\n", "minLength": 1, "readOnly": false, "title": "Max file size", "type": "string" } }, "readOnly": false, "required": [ "size", "max_history", "compress" ], "title": "Nginx Server Logrotate", "type": "object" }, "statistics_collection": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": true, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "url": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "adcm-usage-ss.arenadata.io", "description": "URL to send collected statistic", "minLength": 1, "readOnly": false, "title": "url", "type": "string" } }, "readOnly": false, "required": [ "url" ], "title": "Statistics Collection", "type": "object" }, "yandex_oauth": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "client_id": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "client_id", "type": "string" }, { "type": "null" } ] }, "secret": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "secret", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "client_id", "secret" ], "title": "Yandex Auth", "type": "object" } }, "readOnly": false, "required": [ "global", "statistics_collection", "google_oauth", "yandex_oauth", "ansible_settings", "logrotate", "audit_data_retention", "ldap_integration", "auth_policy" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
e1e1c7a914063d0e26ef5699d531c7cdd08579aa
"2024-03-13T11:51:32"
python/api_v2/tests/files/responses/config_schemas/for_adcm.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "ansible_settings": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "forks": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 5, "description": "This is the default number of parallel processes to spawn when communicating with remote hosts.\n", "maximum": 100, "minimum": 1, "readOnly": false, "title": "Forks", "type": "integer" } }, "readOnly": false, "required": [ "forks" ], "title": "Ansible Settings", "type": "object" }, "audit_data_retention": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "config_rotation_in_db": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 0, "description": "You can set the time (number of days) after which the Objects configuration will be deleted from the database. 0 is infinite storing.\n", "minimum": 0, "readOnly": false, "title": "Objects configurations retention period", "type": "integer" }, "data_archiving": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": false, "description": "Enable/disable archiving of data on operations and authorizations after the period specified in \"Audit data retention period\".\n", "readOnly": false, "title": "Enable audit data archiving", "type": "boolean" }, "log_rotation_in_db": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 365, "description": "You can set the time (number of days) after which the logs will be deleted from the database. 0 is infinite storing.\n", "minimum": 0, "readOnly": false, "title": "Job log retention period from database", "type": "integer" }, "log_rotation_on_fs": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 365, "description": "You can set the time (number of days) after which the logs will be deleted from the file system. 0 is infinite storing.\n", "minimum": 0, "readOnly": false, "title": "Job log retention period from file system", "type": "integer" }, "retention_period": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 1825, "description": "Data storage period (in days) for operations and authorizations in ADCM.\n", "readOnly": false, "title": "Audit data retention period", "type": "integer" } }, "readOnly": false, "required": [ "log_rotation_on_fs", "log_rotation_in_db", "config_rotation_in_db", "retention_period", "data_archiving" ], "title": "Data retention policy", "type": "object" }, "auth_policy": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "block_time": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 5, "description": "Defines a period (in min) of inactivity after which old failed login attempts will be cleared", "minimum": 1, "readOnly": false, "title": "Blocking time period", "type": "integer" }, "login_attempt_limit": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 5, "description": "The number of login attempts allowed before user account is locked out", "minimum": 1, "readOnly": false, "title": "Login attempt limit", "type": "integer" }, "max_password_length": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 128, "description": "", "maximum": 128, "minimum": 1, "readOnly": false, "title": "Maximum password length", "type": "integer" }, "min_password_length": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 12, "description": "", "maximum": 128, "minimum": 1, "readOnly": false, "title": "Minimum password length", "type": "integer" } }, "readOnly": false, "required": [ "min_password_length", "max_password_length", "login_attempt_limit", "block_time" ], "title": "Authentication policy", "type": "object" }, "global": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "adcm_url": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "We have to know ADCM's Url to send information from host. We try to guess that information from url you enter in browser.\nBut if your network has more complicated structure and we guess wrong, please fix that here.\n", "minLength": 1, "readOnly": false, "title": "ADCM's URL", "type": "string" }, "verification_public_key": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": true }, "synchronization": null }, "default": "\n", "description": "Bundle verification GPG public key to verify the signature of the bundle (*.sig file) when uploading the bundle to ADCM.\n", "minLength": 1, "readOnly": false, "title": "Bundle verification public key", "type": "string" } }, "readOnly": false, "required": [ "adcm_url", "verification_public_key" ], "title": "Global Options", "type": "object" }, "google_oauth": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "client_id": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "client_id", "type": "string" }, { "type": "null" } ] }, "secret": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "secret", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "client_id", "secret" ], "title": "Google Auth", "type": "object" }, "ldap_integration": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "group_dn_adcm_admin": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": [], "description": "The distinguished name (DN) of the group list whose members are granted ADCM Administrator rights. List element example: \"cn=adcm_admin,ou=Groups,dc=ad,dc=ranger-test\".\n", "items": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "", "type": "string" }, "readOnly": false, "title": "Group DN for granting ADCM Administrator rights", "type": "array" }, { "type": "null" } ] }, "group_member_attribute_name": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "member", "description": "Attribute from group entry that is list of members.\n", "minLength": 1, "readOnly": false, "title": "Group member attribute name", "type": "string" }, "group_name_attribute": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "cn", "description": "Attribute from group entry that would be treated as group name.\n", "minLength": 1, "readOnly": false, "title": "Group name attribute", "type": "string" }, "group_object_class": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "group", "description": "Object class to identify group entries.\n", "minLength": 1, "readOnly": false, "title": "Group object class", "type": "string" }, "group_search_base": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The distinguished name (DN) of the directory object from which to search for entries. For example: \"ou=Groups,dc=ad,dc=ranger-test\".\n", "readOnly": false, "title": "Group search base", "type": "string" }, { "type": "null" } ] }, "group_search_filter": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "Additional filter constraining the groups selected for syncing.\n", "readOnly": false, "title": "Group search filter", "type": "string" }, { "type": "null" } ] }, "ldap_password": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "Password for access to the LDAP server of the user specified in the \"LDAP User\" field.\n", "minLength": 1, "readOnly": false, "title": "Bind Password", "type": "string" }, "ldap_uri": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The URI of the LDAP server.\n", "minLength": 1, "readOnly": false, "title": "LDAP URI", "type": "string" }, "ldap_user": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The distinguished name (DN) of the user that is used to connect to the LDAP server. For example: \"cn=admin,dc=ad,dc=ranger-test\".\n", "minLength": 1, "readOnly": false, "title": "Bind DN", "type": "string" }, "sync_interval": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 60, "description": "Amount of time in minutes that group memberships and user distinguished names are synchronized between AD and ADCM.\n", "readOnly": false, "title": "Sync interval", "type": "integer" }, "tls_ca_cert_file": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "CA certificate path in ADCM container volume.\n", "readOnly": false, "title": "TLS CA certificate file path", "type": "string" }, { "type": "null" } ] }, "user_name_attribute": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "sAMAccountName", "description": "Attribute from user entry that would be treated as user name.\n", "minLength": 1, "readOnly": false, "title": "User name attribute", "type": "string" }, "user_object_class": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "user", "description": "Object class to identify user entries.\n", "minLength": 1, "readOnly": false, "title": "User object class", "type": "string" }, "user_search_base": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The distinguished name (DN) of the directory object from which to search for entries. For example: \"ou=Peoples,dc=ad,dc=ranger-test\".\n", "minLength": 1, "readOnly": false, "title": "User search base", "type": "string" }, "user_search_filter": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "Additional filter constraining the users selected for syncing.\n", "readOnly": false, "title": "User search filter", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "ldap_uri", "ldap_user", "ldap_password", "user_search_base", "user_search_filter", "user_object_class", "user_name_attribute", "group_search_base", "group_search_filter", "group_object_class", "group_name_attribute", "group_member_attribute_name", "group_dn_adcm_admin", "sync_interval", "tls_ca_cert_file" ], "title": "LDAP integration", "type": "object" }, "logrotate": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "compress": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": false, "description": "Compress the rotated files\n", "readOnly": false, "title": "Enable compression", "type": "boolean" }, "max_history": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 10, "description": "Controls the maximum number of archive files to keep\n", "minimum": 1, "readOnly": false, "title": "Max files history", "type": "integer" }, "size": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "10M", "description": "Specifies the allowed size the log file can reach before it is archived\n", "minLength": 1, "readOnly": false, "title": "Max file size", "type": "string" } }, "readOnly": false, "required": [ "size", "max_history", "compress" ], "title": "Nginx Server Logrotate", "type": "object" }, "statistics_collection": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": true, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "url": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "adcm-usage-ss.arenadata.io", "description": "URL to send collected statistic", "minLength": 1, "readOnly": false, "title": "url", "type": "string" } }, "readOnly": false, "required": [ "url" ], "title": "Statistics Collection", "type": "object" }, "yandex_oauth": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "client_id": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "client_id", "type": "string" }, { "type": "null" } ] }, "secret": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "secret", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "client_id", "secret" ], "title": "Yandex Auth", "type": "object" } }, "readOnly": false, "required": [ "global", "statistics_collection", "google_oauth", "yandex_oauth", "ansible_settings", "logrotate", "audit_data_retention", "ldap_integration", "auth_policy" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
d37ac5450710072c3fc87acfe7228d5c0628cc63
"2023-11-07T11:51:51"
python/api_v2/tests/files/responses/config_schemas/for_adcm.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "ansible_settings": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "forks": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 5, "description": "This is the default number of parallel processes to spawn when communicating with remote hosts.\n", "maximum": 100, "minimum": 1, "readOnly": false, "title": "Forks", "type": "integer" } }, "readOnly": false, "required": [ "forks" ], "title": "Ansible Settings", "type": "object" }, "audit_data_retention": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "config_rotation_in_db": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 0, "description": "You can set the time (number of days) after which the Objects configuration will be deleted from the database. 0 is infinite storing.\n", "minimum": 0, "readOnly": false, "title": "Objects configurations retention period", "type": "integer" }, { "type": "null" } ] }, "data_archiving": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": false, "description": "Enable/disable archiving of data on operations and authorizations after the period specified in \"Audit data retention period\".\n", "readOnly": false, "title": "Enable audit data archiving", "type": "boolean" }, { "type": "null" } ] }, "log_rotation_in_db": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 365, "description": "You can set the time (number of days) after which the logs will be deleted from the database.\n", "minimum": 0, "readOnly": false, "title": "Job log retention period from database", "type": "integer" }, { "type": "null" } ] }, "log_rotation_on_fs": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 365, "description": "You can set the time (number of days) after which the logs will be deleted from the file system.\n", "minimum": 0, "readOnly": false, "title": "Job log retention period from file system", "type": "integer" }, { "type": "null" } ] }, "retention_period": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 1825, "description": "Data storage period (in days) for operations and authorizations in ADCM.\n", "readOnly": false, "title": "Audit data retention period", "type": "integer" } }, "readOnly": false, "required": [ "log_rotation_on_fs", "log_rotation_in_db", "config_rotation_in_db", "retention_period", "data_archiving" ], "title": "Data retention policy", "type": "object" }, "auth_policy": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "block_time": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 5, "description": "Defines a period (in min) of inactivity after which old failed login attempts will be cleared", "minimum": 1, "readOnly": false, "title": "Blocking time period", "type": "integer" }, "login_attempt_limit": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 5, "description": "The number of login attempts allowed before user account is locked out", "minimum": 1, "readOnly": false, "title": "Login attempt limit", "type": "integer" }, "max_password_length": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 128, "description": "", "maximum": 128, "minimum": 1, "readOnly": false, "title": "Maximum password length", "type": "integer" }, "min_password_length": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 12, "description": "", "maximum": 128, "minimum": 1, "readOnly": false, "title": "Minimum password length", "type": "integer" } }, "readOnly": false, "required": [ "min_password_length", "max_password_length", "login_attempt_limit", "block_time" ], "title": "Authentication policy", "type": "object" }, "global": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "adcm_url": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "We have to know ADCM's Url to send information from host. We try to guess that information from url you enter in browser.\nBut if your network has more complicated structure and we guess wrong, please fix that here.\n", "minLength": 1, "readOnly": false, "title": "ADCM's URL", "type": "string" }, "verification_public_key": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": true }, "synchronization": null }, "default": "\n", "description": "Bundle verification GPG public key to verify the signature of the bundle (*.sig file) when uploading the bundle to ADCM.\n", "minLength": 1, "readOnly": false, "title": "Bundle verification public key", "type": "string" } }, "readOnly": false, "required": [ "adcm_url", "verification_public_key" ], "title": "Global Options", "type": "object" }, "google_oauth": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "client_id": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "client_id", "type": "string" }, { "type": "null" } ] }, "secret": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "secret", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "client_id", "secret" ], "title": "Google Auth", "type": "object" }, "ldap_integration": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "group_member_attribute_name": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "member", "description": "Attribute from group entry that is list of members.\n", "minLength": 1, "readOnly": false, "title": "Group member attribute name", "type": "string" }, "group_name_attribute": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "cn", "description": "Attribute from group entry that would be treated as group name.\n", "minLength": 1, "readOnly": false, "title": "Group name attribute", "type": "string" }, "group_object_class": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "group", "description": "Object class to identify group entries.\n", "minLength": 1, "readOnly": false, "title": "Group object class", "type": "string" }, "group_search_base": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The distinguished name (DN) of the directory object from which to search for entries. For example: \"ou=Groups,dc=ad,dc=ranger-test\".\n", "readOnly": false, "title": "Group search base", "type": "string" }, { "type": "null" } ] }, "group_search_filter": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "Additional filter constraining the groups selected for syncing.\n", "readOnly": false, "title": "Group search filter", "type": "string" }, { "type": "null" } ] }, "ldap_password": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "Password for access to the LDAP server of the user specified in the \"LDAP User\" field.\n", "minLength": 1, "readOnly": false, "title": "Bind Password", "type": "string" }, "ldap_uri": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The URI of the LDAP server.\n", "minLength": 1, "readOnly": false, "title": "LDAP URI", "type": "string" }, "ldap_user": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The distinguished name (DN) of the user that is used to connect to the LDAP server. For example: \"cn=admin,dc=ad,dc=ranger-test\".\n", "minLength": 1, "readOnly": false, "title": "Bind DN", "type": "string" }, "sync_interval": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 60, "description": "Amount of time in minutes that group memberships and user distinguished names are synchronized between AD and ADCM.\n", "readOnly": false, "title": "Sync interval", "type": "integer" }, "tls_ca_cert_file": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "CA certificate path in ADCM container volume.\n", "readOnly": false, "title": "TLS CA certificate file path", "type": "string" }, { "type": "null" } ] }, "user_name_attribute": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "sAMAccountName", "description": "Attribute from user entry that would be treated as user name.\n", "minLength": 1, "readOnly": false, "title": "User name attribute", "type": "string" }, "user_object_class": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "user", "description": "Object class to identify user entries.\n", "minLength": 1, "readOnly": false, "title": "User object class", "type": "string" }, "user_search_base": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The distinguished name (DN) of the directory object from which to search for entries. For example: \"ou=Peoples,dc=ad,dc=ranger-test\".\n", "minLength": 1, "readOnly": false, "title": "User search base", "type": "string" }, "user_search_filter": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "Additional filter constraining the users selected for syncing.\n", "readOnly": false, "title": "User search filter", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "ldap_uri", "ldap_user", "ldap_password", "user_search_base", "user_search_filter", "user_object_class", "user_name_attribute", "group_search_base", "group_search_filter", "group_object_class", "group_name_attribute", "group_member_attribute_name", "sync_interval", "tls_ca_cert_file" ], "title": "LDAP integration", "type": "object" }, "logrotate": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "compress": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": false, "description": "Compress the rotated files\n", "readOnly": false, "title": "Enable compression", "type": "boolean" }, "max_history": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 10, "description": "Controls the maximum number of archive files to keep\n", "minimum": 1, "readOnly": false, "title": "Max files history", "type": "integer" }, "size": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "10M", "description": "Specifies the allowed size the log file can reach before it is archived\n", "minLength": 1, "readOnly": false, "title": "Max file size", "type": "string" } }, "readOnly": false, "required": [ "size", "max_history", "compress" ], "title": "Nginx Server Logrotate", "type": "object" }, "statistics_collection": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": true, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "url": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "adcm-usage-ss.arenadata.io", "description": "URL to send collected statistic", "minLength": 1, "readOnly": false, "title": "url", "type": "string" } }, "readOnly": false, "required": [ "url" ], "title": "Statistics Collection", "type": "object" }, "yandex_oauth": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "client_id": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "client_id", "type": "string" }, { "type": "null" } ] }, "secret": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "secret", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "client_id", "secret" ], "title": "Yandex Auth", "type": "object" } }, "readOnly": false, "required": [ "global", "statistics_collection", "google_oauth", "yandex_oauth", "ansible_settings", "logrotate", "audit_data_retention", "ldap_integration", "auth_policy" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
cd7db319d95fbbc6c1b6801834b910e2f8d5500f
"2023-11-01T13:28:13"
python/api_v2/tests/files/responses/config_schemas/for_component.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "activatable_group": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "secretfile": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": true }, "synchronization": null }, "default": "content", "description": "", "minLength": 1, "readOnly": false, "title": "secretfile", "type": "string" } }, "readOnly": false, "required": [ "secretfile" ], "title": "activatable_group", "type": "object" }, "group": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "file": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": true }, "synchronization": null }, "default": "content", "description": "", "readOnly": false, "title": "file", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "file" ], "title": "group", "type": "object" }, "secrettext": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": true }, "synchronization": null }, "default": "secrettext", "description": "", "minLength": 1, "readOnly": false, "title": "secrettext", "type": "string" } }, "readOnly": false, "required": [ "secrettext", "group", "activatable_group" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
cd7db319d95fbbc6c1b6801834b910e2f8d5500f
"2023-11-01T13:28:13"
python/api_v2/tests/files/responses/config_schemas/for_component_group_config.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "activatable_group": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": { "isAllowChange": true } }, "additionalProperties": false, "default": {}, "description": "", "properties": { "secretfile": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": true }, "synchronization": { "isAllowChange": true } }, "default": "content", "description": "", "minLength": 1, "readOnly": false, "title": "secretfile", "type": "string" } }, "readOnly": false, "required": [ "secretfile" ], "title": "activatable_group", "type": "object" }, "group": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "file": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": true }, "synchronization": { "isAllowChange": true } }, "default": "content", "description": "", "readOnly": false, "title": "file", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "file" ], "title": "group", "type": "object" }, "secrettext": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": true }, "synchronization": { "isAllowChange": true } }, "default": "secrettext", "description": "", "minLength": 1, "readOnly": false, "title": "secrettext", "type": "string" } }, "readOnly": false, "required": [ "secrettext", "group", "activatable_group" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
cd7db319d95fbbc6c1b6801834b910e2f8d5500f
"2023-11-01T13:28:13"
python/api_v2/tests/files/responses/config_schemas/for_hostprovider_group_config.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "activatable_group": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": { "isAllowChange": true } }, "additionalProperties": false, "default": {}, "description": "", "properties": { "secretmap": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": null, "synchronization": { "isAllowChange": true } }, "additionalProperties": true, "default": { "integer_key": "10", "string_key": "string" }, "description": "", "properties": {}, "readOnly": false, "title": "secretmap", "type": "object" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "secretmap" ], "title": "activatable_group", "type": "object" }, "group": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "map": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": { "isAllowChange": true } }, "additionalProperties": true, "default": { "integer_key": "10", "string_key": "string" }, "description": "", "properties": {}, "readOnly": false, "title": "map", "type": "object" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "map" ], "title": "group", "type": "object" }, "json": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": true }, "synchronization": { "isAllowChange": true } }, "default": "{\"key\": \"value\"}", "description": "", "format": "json", "readOnly": false, "title": "json", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "json", "group", "activatable_group" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
cd7db319d95fbbc6c1b6801834b910e2f8d5500f
"2023-11-01T13:28:13"
python/api_v2/tests/files/responses/config_schemas/for_service.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "activatable_group": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "text": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": true }, "synchronization": null }, "default": "text", "description": "", "readOnly": false, "title": "text", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "text" ], "title": "activatable_group", "type": "object" }, "group": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "password": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "password", "description": "", "minLength": 1, "readOnly": false, "title": "password", "type": "string" } }, "readOnly": false, "required": [ "password" ], "title": "group", "type": "object" }, "string": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "string", "description": "", "readOnly": false, "title": "string", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "string", "group", "activatable_group" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
015b569ea018ab4618ad738d2074f71f2c9f9efd
"2023-11-03T15:41:08"
python/api_v2/tests/files/responses/config_schemas/for_action_with_jinja_config.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "activatable_group": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "text": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": true }, "synchronization": null }, "default": "text", "description": "", "minLength": 1, "readOnly": false, "title": "text", "type": "string" } }, "readOnly": false, "required": [ "text" ], "title": "activatable_group", "type": "object" }, "boolean": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": true, "description": "", "readOnly": false, "title": "boolean", "type": "boolean" }, { "type": "null" } ] }, "boolean1": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": false, "description": "", "readOnly": false, "title": "boolean1", "type": "boolean" }, { "type": "null" } ] }, "float": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 2.0, "description": "", "readOnly": false, "title": "float", "type": "number" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "boolean", "float", "activatable_group", "boolean1" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
271600adef30b6808c47259cd74f6a9c0fdbcbea
"2023-11-17T08:14:34"
python/api_v2/tests/files/responses/config_schemas/for_adcm.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "ansible_settings": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "forks": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 5, "description": "This is the default number of parallel processes to spawn when communicating with remote hosts.\n", "maximum": 100, "minimum": 1, "readOnly": false, "title": "Forks", "type": "integer" } }, "readOnly": false, "required": [ "forks" ], "title": "Ansible Settings", "type": "object" }, "audit_data_retention": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "config_rotation_in_db": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 0, "description": "You can set the time (number of days) after which the Objects configuration will be deleted from the database. 0 is infinite storing.\n", "minimum": 0, "readOnly": false, "title": "Objects configurations retention period", "type": "integer" }, "data_archiving": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": false, "description": "Enable/disable archiving of data on operations and authorizations after the period specified in \"Audit data retention period\".\n", "readOnly": false, "title": "Enable audit data archiving", "type": "boolean" }, "log_rotation_in_db": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 365, "description": "You can set the time (number of days) after which the logs will be deleted from the database. 0 is infinite storing.\n", "minimum": 0, "readOnly": false, "title": "Job log retention period from database", "type": "integer" }, "log_rotation_on_fs": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 365, "description": "You can set the time (number of days) after which the logs will be deleted from the file system. 0 is infinite storing.\n", "minimum": 0, "readOnly": false, "title": "Job log retention period from file system", "type": "integer" }, "retention_period": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 1825, "description": "Data storage period (in days) for operations and authorizations in ADCM.\n", "readOnly": false, "title": "Audit data retention period", "type": "integer" } }, "readOnly": false, "required": [ "log_rotation_on_fs", "log_rotation_in_db", "config_rotation_in_db", "retention_period", "data_archiving" ], "title": "Data retention policy", "type": "object" }, "auth_policy": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "block_time": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 5, "description": "Defines a period (in min) of inactivity after which old failed login attempts will be cleared", "minimum": 1, "readOnly": false, "title": "Blocking time period", "type": "integer" }, "login_attempt_limit": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 5, "description": "The number of login attempts allowed before user account is locked out", "minimum": 1, "readOnly": false, "title": "Login attempt limit", "type": "integer" }, "max_password_length": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 128, "description": "", "maximum": 128, "minimum": 1, "readOnly": false, "title": "Maximum password length", "type": "integer" }, "min_password_length": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 12, "description": "", "maximum": 128, "minimum": 1, "readOnly": false, "title": "Minimum password length", "type": "integer" } }, "readOnly": false, "required": [ "min_password_length", "max_password_length", "login_attempt_limit", "block_time" ], "title": "Authentication policy", "type": "object" }, "global": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "adcm_url": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "We have to know ADCM's Url to send information from host. We try to guess that information from url you enter in browser.\nBut if your network has more complicated structure and we guess wrong, please fix that here.\n", "minLength": 1, "readOnly": false, "title": "ADCM's URL", "type": "string" }, "verification_public_key": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": true }, "synchronization": null }, "default": "\n", "description": "Bundle verification GPG public key to verify the signature of the bundle (*.sig file) when uploading the bundle to ADCM.\n", "minLength": 1, "readOnly": false, "title": "Bundle verification public key", "type": "string" } }, "readOnly": false, "required": [ "adcm_url", "verification_public_key" ], "title": "Global Options", "type": "object" }, "google_oauth": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "client_id": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "client_id", "type": "string" }, { "type": "null" } ] }, "secret": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "secret", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "client_id", "secret" ], "title": "Google Auth", "type": "object" }, "ldap_integration": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "group_member_attribute_name": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "member", "description": "Attribute from group entry that is list of members.\n", "minLength": 1, "readOnly": false, "title": "Group member attribute name", "type": "string" }, "group_name_attribute": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "cn", "description": "Attribute from group entry that would be treated as group name.\n", "minLength": 1, "readOnly": false, "title": "Group name attribute", "type": "string" }, "group_object_class": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "group", "description": "Object class to identify group entries.\n", "minLength": 1, "readOnly": false, "title": "Group object class", "type": "string" }, "group_search_base": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The distinguished name (DN) of the directory object from which to search for entries. For example: \"ou=Groups,dc=ad,dc=ranger-test\".\n", "readOnly": false, "title": "Group search base", "type": "string" }, { "type": "null" } ] }, "group_search_filter": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "Additional filter constraining the groups selected for syncing.\n", "readOnly": false, "title": "Group search filter", "type": "string" }, { "type": "null" } ] }, "ldap_password": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "Password for access to the LDAP server of the user specified in the \"LDAP User\" field.\n", "minLength": 1, "readOnly": false, "title": "Bind Password", "type": "string" }, "ldap_uri": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The URI of the LDAP server.\n", "minLength": 1, "readOnly": false, "title": "LDAP URI", "type": "string" }, "ldap_user": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The distinguished name (DN) of the user that is used to connect to the LDAP server. For example: \"cn=admin,dc=ad,dc=ranger-test\".\n", "minLength": 1, "readOnly": false, "title": "Bind DN", "type": "string" }, "sync_interval": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 60, "description": "Amount of time in minutes that group memberships and user distinguished names are synchronized between AD and ADCM.\n", "readOnly": false, "title": "Sync interval", "type": "integer" }, "tls_ca_cert_file": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "CA certificate path in ADCM container volume.\n", "readOnly": false, "title": "TLS CA certificate file path", "type": "string" }, { "type": "null" } ] }, "user_name_attribute": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "sAMAccountName", "description": "Attribute from user entry that would be treated as user name.\n", "minLength": 1, "readOnly": false, "title": "User name attribute", "type": "string" }, "user_object_class": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "user", "description": "Object class to identify user entries.\n", "minLength": 1, "readOnly": false, "title": "User object class", "type": "string" }, "user_search_base": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "The distinguished name (DN) of the directory object from which to search for entries. For example: \"ou=Peoples,dc=ad,dc=ranger-test\".\n", "minLength": 1, "readOnly": false, "title": "User search base", "type": "string" }, "user_search_filter": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "Additional filter constraining the users selected for syncing.\n", "readOnly": false, "title": "User search filter", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "ldap_uri", "ldap_user", "ldap_password", "user_search_base", "user_search_filter", "user_object_class", "user_name_attribute", "group_search_base", "group_search_filter", "group_object_class", "group_name_attribute", "group_member_attribute_name", "sync_interval", "tls_ca_cert_file" ], "title": "LDAP integration", "type": "object" }, "logrotate": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "compress": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": false, "description": "Compress the rotated files\n", "readOnly": false, "title": "Enable compression", "type": "boolean" }, "max_history": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": 10, "description": "Controls the maximum number of archive files to keep\n", "minimum": 1, "readOnly": false, "title": "Max files history", "type": "integer" }, "size": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "10M", "description": "Specifies the allowed size the log file can reach before it is archived\n", "minLength": 1, "readOnly": false, "title": "Max file size", "type": "string" } }, "readOnly": false, "required": [ "size", "max_history", "compress" ], "title": "Nginx Server Logrotate", "type": "object" }, "statistics_collection": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": true, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "url": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "adcm-usage-ss.arenadata.io", "description": "URL to send collected statistic", "minLength": 1, "readOnly": false, "title": "url", "type": "string" } }, "readOnly": false, "required": [ "url" ], "title": "Statistics Collection", "type": "object" }, "yandex_oauth": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": true, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "client_id": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "client_id", "type": "string" }, { "type": "null" } ] }, "secret": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": true, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "secret", "type": "string" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "client_id", "secret" ], "title": "Yandex Auth", "type": "object" } }, "readOnly": false, "required": [ "global", "statistics_collection", "google_oauth", "yandex_oauth", "ansible_settings", "logrotate", "audit_data_retention", "ldap_integration", "auth_policy" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
arenadata/adcm
cd7db319d95fbbc6c1b6801834b910e2f8d5500f
"2023-11-01T13:28:13"
python/api_v2/tests/files/responses/config_schemas/for_host.json
26
2024-05-28T05:46:19.783058Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "description": "", "properties": { "activatable_group": { "adcmMeta": { "activation": { "isAllowChange": true }, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "option": { "adcmMeta": { "activation": null, "enumExtra": { "labels": [ "string1", "string2" ] }, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": "string1", "description": "", "enum": [ "string1", "string2" ], "readOnly": false, "title": "option" } }, "readOnly": false, "required": [ "option" ], "title": "activatable_group", "type": "object" }, "group": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "list": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": [ "value1", "value2", "value3" ], "description": "", "items": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "nullValue": null, "stringExtra": null, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "", "type": "string" }, "readOnly": false, "title": "list", "type": "array" }, { "type": "null" } ] } }, "readOnly": false, "required": [ "list" ], "title": "group", "type": "object" }, "structure": { "oneOf": [ { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": [ { "integer": 1, "string": "string1" }, { "integer": 2, "string": "string2" } ], "description": "", "items": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "additionalProperties": false, "default": {}, "description": "", "properties": { "integer": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "description": "", "readOnly": false, "title": "integer", "type": "integer" }, "string": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": null, "synchronization": null }, "default": null, "description": "", "readOnly": false, "title": "string", "type": "string" } }, "readOnly": false, "required": [ "string" ], "title": "", "type": "object" }, "readOnly": false, "title": "structure", "type": "array" }, { "type": "null" } ] }, "variant": { "adcmMeta": { "activation": null, "enumExtra": null, "isAdvanced": false, "isInvisible": false, "isSecret": false, "stringExtra": { "isMultiline": false }, "synchronization": null }, "default": "value1", "description": "", "enum": [ "value1", "value2", "value3" ], "readOnly": false, "title": "variant" } }, "readOnly": false, "required": [ "structure", "variant", "group", "activatable_group" ], "title": "Configuration", "type": "object" }
Apache-2.0
en
unjs/undocs
ececa1d60adf4111e6d41abac7f8d271e2b90b16
"2024-02-21T09:32:37"
schema/config.json
123
2024-05-27T09:27:27.344077Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "properties": { "$schema": { "type": "string" }, "automd": { "description": "Enable integration with https://automd.unjs.io", "type": "boolean" }, "description": { "description": "The description of the documentation site.", "type": "string" }, "dir": { "description": "Documentation directory\n\nNote: This option will be automatically set", "type": "string" }, "github": { "description": "The GitHub repository for the documentation site.", "type": "string" }, "landing": { "oneOf": [ { "const": false, "type": "boolean" }, { "additionalProperties": false, "description": "Landing page configuration", "properties": { "contributors": { "description": "Show contributors section", "type": "boolean" }, "description": { "description": "Page description", "type": "string" }, "features": { "description": "Features section description", "items": { "properties": { "description": { "type": "string" }, "icon": { "type": "string" }, "title": { "type": "string" } }, "type": "object" }, "type": "array" }, "featuresLayout": { "description": "Features section layout to be in default place or in the hero (only if there is no code)", "enum": [ "default", "hero" ], "type": "string" }, "featuresTitle": { "description": "Features section title", "type": "string" }, "heroCode": { "anyOf": [ { "type": "string" }, { "additionalProperties": false, "properties": { "content": { "type": "string" }, "lang": { "type": "string" }, "title": { "type": "string" } }, "required": [ "content" ], "type": "object" } ], "description": "Hero Codes" }, "heroDescription": { "description": "Additional text in hero (default is same as description)", "type": "string" }, "heroLinks": { "additionalProperties": { "type": "object" }, "description": "Hero Links", "type": "object" }, "heroSubtitle": { "description": "second hero title (default is same as shortDescription)", "type": "string" }, "heroTitle": { "description": "main title (default is same as page title)", "type": "string" }, "title": { "description": "Page title", "type": "string" } }, "type": "object" } ] }, "name": { "description": "The name of the documentation site.", "type": "string" }, "redirects": { "additionalProperties": { "type": "string" }, "description": "Redirects for the documentation site.", "type": "object" }, "shortDescription": { "description": "The description of the documentation site.", "type": "string" }, "themeColor": { "description": "The theme color of the documentation site.\nIt will be used as the `theme-color` meta tag and a full palette of colors will be generated from it.", "type": "string" }, "url": { "description": "The URL of the documentation site.", "type": "string" } }, "type": "object" }
MIT
en
unjs/undocs
00761a3aedbcf2f859523eba6895c9edbce4cd19
"2024-02-20T19:48:02"
schema/config.json
123
2024-05-27T09:27:27.344077Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "properties": { "$schema": { "type": "string" }, "description": { "description": "The description of the documentation site.", "type": "string" }, "dir": { "description": "Documentation directory\n\nNote: This option will be automatically set", "type": "string" }, "github": { "description": "The GitHub repository for the documentation site.", "type": "string" }, "landing": { "oneOf": [ { "const": false, "type": "boolean" }, { "additionalProperties": false, "description": "Landing page configuration", "properties": { "description": { "description": "Page description", "type": "string" }, "features": { "description": "Features section description", "items": { "properties": { "description": { "type": "string" }, "icon": { "type": "string" }, "title": { "type": "string" } }, "type": "object" }, "type": "array" }, "featuresTitle": { "description": "Features section title", "type": "string" }, "heroCode": { "anyOf": [ { "type": "string" }, { "additionalProperties": false, "properties": { "content": { "type": "string" }, "lang": { "type": "string" }, "title": { "type": "string" } }, "required": [ "content" ], "type": "object" } ], "description": "Hero Codes" }, "heroDescription": { "description": "Additional text in hero (default is same as description)", "type": "string" }, "heroLinks": { "additionalProperties": { "type": "object" }, "description": "Hero Links", "type": "object" }, "heroSubtitle": { "description": "second hero title (default is same as shortDescription)", "type": "string" }, "heroTitle": { "description": "main title (default is same as page title)", "type": "string" }, "title": { "description": "Page title", "type": "string" } }, "type": "object" } ] }, "name": { "description": "The name of the documentation site.", "type": "string" }, "redirects": { "additionalProperties": { "type": "string" }, "description": "Redirects for the documentation site.", "type": "object" }, "shortDescription": { "description": "The description of the documentation site.", "type": "string" }, "themeColor": { "description": "The theme color of the documentation site.\nIt will be used as the `theme-color` meta tag and a full palette of colors will be generated from it.", "type": "string" }, "url": { "description": "The URL of the documentation site.", "type": "string" } }, "type": "object" }
MIT
en
unjs/undocs
d750691e6890ff92792471ee75f8d1c332bb36ef
"2024-02-21T00:09:54"
schema/config.json
123
2024-05-27T09:27:27.344077Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "properties": { "$schema": { "type": "string" }, "automd": { "description": "Enable integration with https://automd.unjs.io", "type": "boolean" }, "description": { "description": "The description of the documentation site.", "type": "string" }, "dir": { "description": "Documentation directory\n\nNote: This option will be automatically set", "type": "string" }, "github": { "description": "The GitHub repository for the documentation site.", "type": "string" }, "landing": { "oneOf": [ { "const": false, "type": "boolean" }, { "additionalProperties": false, "description": "Landing page configuration", "properties": { "contributors": { "description": "Show contributors section", "type": "boolean" }, "description": { "description": "Page description", "type": "string" }, "features": { "description": "Features section description", "items": { "properties": { "description": { "type": "string" }, "icon": { "type": "string" }, "title": { "type": "string" } }, "type": "object" }, "type": "array" }, "featuresTitle": { "description": "Features section title", "type": "string" }, "heroCode": { "anyOf": [ { "type": "string" }, { "additionalProperties": false, "properties": { "content": { "type": "string" }, "lang": { "type": "string" }, "title": { "type": "string" } }, "required": [ "content" ], "type": "object" } ], "description": "Hero Codes" }, "heroDescription": { "description": "Additional text in hero (default is same as description)", "type": "string" }, "heroLinks": { "additionalProperties": { "type": "object" }, "description": "Hero Links", "type": "object" }, "heroSubtitle": { "description": "second hero title (default is same as shortDescription)", "type": "string" }, "heroTitle": { "description": "main title (default is same as page title)", "type": "string" }, "title": { "description": "Page title", "type": "string" } }, "type": "object" } ] }, "name": { "description": "The name of the documentation site.", "type": "string" }, "redirects": { "additionalProperties": { "type": "string" }, "description": "Redirects for the documentation site.", "type": "object" }, "shortDescription": { "description": "The description of the documentation site.", "type": "string" }, "themeColor": { "description": "The theme color of the documentation site.\nIt will be used as the `theme-color` meta tag and a full palette of colors will be generated from it.", "type": "string" }, "url": { "description": "The URL of the documentation site.", "type": "string" } }, "type": "object" }
MIT
en
unjs/undocs
e0115d0ba78377d1135bbc4fb16d86db4db3a106
"2024-02-02T19:11:33"
schema/config.json
123
2024-05-27T09:27:27.344077Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "properties": { "$schema": { "type": "string" }, "description": { "description": "The description of the documentation site.", "type": "string" }, "dir": { "description": "Documentation directory\n\nNote: This option will be automatically set", "type": "string" }, "github": { "description": "The GitHub repository for the documentation site.", "type": "string" }, "landing": { "additionalProperties": false, "description": "Landing page configuration", "properties": { "description": { "description": "Page description", "type": "string" }, "features": { "description": "Features section description", "items": { "properties": { "description": { "type": "string" }, "icon": { "type": "string" }, "title": { "type": "string" } }, "type": "object" }, "type": "array" }, "featuresTitle": { "description": "Features section title", "type": "string" }, "heroCode": { "anyOf": [ { "type": "string" }, { "additionalProperties": false, "properties": { "content": { "type": "string" }, "lang": { "type": "string" }, "title": { "type": "string" } }, "required": [ "content" ], "type": "object" } ], "description": "Hero Codes" }, "heroDescription": { "description": "Additional text in hero (default is same as description)", "type": "string" }, "heroLinks": { "additionalProperties": { "type": "object" }, "description": "Hero Links", "type": "object" }, "heroSubtitle": { "description": "second hero title (default is same as shortDescription)", "type": "string" }, "heroTitle": { "description": "main title (default is same as page title)", "type": "string" }, "title": { "description": "Page title", "type": "string" } }, "type": "object" }, "name": { "description": "The name of the documentation site.", "type": "string" }, "redirects": { "additionalProperties": { "type": "string" }, "description": "Redirects for the documentation site.", "type": "object" }, "shortDescription": { "description": "The description of the documentation site.", "type": "string" }, "themeColor": { "description": "The theme color of the documentation site.\nIt will be used as the `theme-color` meta tag and a full palette of colors will be generated from it.", "type": "string" }, "url": { "description": "The URL of the documentation site.", "type": "string" } }, "type": "object" }
MIT
en
unjs/undocs
c8606293206d9687b3364eb2c78489cfc004a4b7
"2024-02-20T20:18:38"
schema/config.json
123
2024-05-27T09:27:27.344077Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "properties": { "$schema": { "type": "string" }, "automd": { "description": "Enable integration with https://automd.unjs.io", "type": "boolean" }, "description": { "description": "The description of the documentation site.", "type": "string" }, "dir": { "description": "Documentation directory\n\nNote: This option will be automatically set", "type": "string" }, "github": { "description": "The GitHub repository for the documentation site.", "type": "string" }, "landing": { "oneOf": [ { "const": false, "type": "boolean" }, { "additionalProperties": false, "description": "Landing page configuration", "properties": { "description": { "description": "Page description", "type": "string" }, "features": { "description": "Features section description", "items": { "properties": { "description": { "type": "string" }, "icon": { "type": "string" }, "title": { "type": "string" } }, "type": "object" }, "type": "array" }, "featuresTitle": { "description": "Features section title", "type": "string" }, "heroCode": { "anyOf": [ { "type": "string" }, { "additionalProperties": false, "properties": { "content": { "type": "string" }, "lang": { "type": "string" }, "title": { "type": "string" } }, "required": [ "content" ], "type": "object" } ], "description": "Hero Codes" }, "heroDescription": { "description": "Additional text in hero (default is same as description)", "type": "string" }, "heroLinks": { "additionalProperties": { "type": "object" }, "description": "Hero Links", "type": "object" }, "heroSubtitle": { "description": "second hero title (default is same as shortDescription)", "type": "string" }, "heroTitle": { "description": "main title (default is same as page title)", "type": "string" }, "title": { "description": "Page title", "type": "string" } }, "type": "object" } ] }, "name": { "description": "The name of the documentation site.", "type": "string" }, "redirects": { "additionalProperties": { "type": "string" }, "description": "Redirects for the documentation site.", "type": "object" }, "shortDescription": { "description": "The description of the documentation site.", "type": "string" }, "themeColor": { "description": "The theme color of the documentation site.\nIt will be used as the `theme-color` meta tag and a full palette of colors will be generated from it.", "type": "string" }, "url": { "description": "The URL of the documentation site.", "type": "string" } }, "type": "object" }
MIT
en
unjs/undocs
a04d9aad26bbe381da6073c7a6310d4f696fbc55
"2024-02-02T19:04:17"
schema/config.json
123
2024-05-27T09:27:27.344077Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "properties": { "$schema": { "type": "string" }, "description": { "description": "The description of the documentation site.", "type": "string" }, "dir": { "description": "Documentation directory\n\nNote: This option will be automatically set", "type": "string" }, "github": { "description": "The GitHub repository for the documentation site.", "type": "string" }, "landing": { "additionalProperties": false, "description": "Landing page configuration", "properties": { "description": { "description": "Page description", "type": "string" }, "features": { "description": "Features section description", "items": { "properties": { "description": { "type": "string" }, "icon": { "type": "string" }, "title": { "type": "string" } }, "type": "object" }, "type": "array" }, "featuresTitle": { "description": "Features section title", "type": "string" }, "heroCode": { "anyOf": [ { "type": "string" }, { "additionalProperties": false, "properties": { "content": { "type": "string" }, "lang": { "type": "string" }, "title": { "type": "string" } }, "required": [ "content" ], "type": "object" } ], "description": "Hero Codes" }, "heroDescription": { "description": "Additional text in hero (default is same as description)", "type": "string" }, "heroLinks": { "additionalProperties": { "type": "object" }, "description": "Hero Links", "type": "object" }, "heroSubtitle": { "description": "second hero title (default is same as shortDescription)", "type": "string" }, "heroTitle": { "description": "main title (default is same as page title)", "type": "string" }, "title": { "description": "Page title", "type": "string" } }, "type": "object" }, "name": { "description": "The name of the documentation site.", "type": "string" }, "redirects": { "additionalProperties": { "type": "string" }, "description": "Redirects for the documentation site.", "type": "object" }, "shortDescription": { "description": "The description of the documentation site.", "type": "string" }, "themeColor": { "description": "The theme color of the documentation site.\nIt will be used as the `theme-color` meta tag and a full palette of colors will be generated from it.", "type": "string" } }, "type": "object" }
MIT
en
unjs/undocs
6af9c6e4669c344f222a3bc03b836c70e4523628
"2024-02-01T01:23:30"
schema/config.json
123
2024-05-27T09:27:27.344077Z
{ "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "Record<string,string>": { "type": "object" }, "Record<string,string|{label?:string;icon?:string;to?:string;size?:string;order?:number;}>": { "type": "object" } }, "properties": { "description": { "description": "The description of the documentation site.", "type": "string" }, "dir": { "description": "Documentation directory\n\nNote: This option will be automatically set", "type": "string" }, "github": { "description": "The GitHub repository for the documentation site.", "type": "string" }, "landing": { "description": "Landing page configuration", "properties": { "_heroMdTitle": { "description": "Full hero title (auto generated markdown)", "type": "string" }, "description": { "description": "Page description", "type": "string" }, "features": { "description": "Features section description", "items": { "properties": { "description": { "type": "string" }, "icon": { "type": "string" }, "title": { "type": "string" } }, "type": "object" }, "type": "array" }, "featuresTitle": { "description": "Features section title", "type": "string" }, "heroCode": { "anyOf": [ { "properties": { "content": { "type": "string" }, "lang": { "type": "string" }, "title": { "type": "string" } }, "type": "object" }, { "type": "string" } ], "description": "Hero Codes" }, "heroDescription": { "description": "Additional text in hero (default is same as description)", "type": "string" }, "heroLinks": { "$ref": "#/definitions/Record<string,string|{label?:string;icon?:string;to?:string;size?:string;order?:number;}>", "description": "Hero Links" }, "heroSubtitle": { "description": "second hero title (default is same as shortDescription)", "type": "string" }, "heroTitle": { "description": "main title (default is same as page title)", "type": "string" }, "title": { "description": "Page title", "type": "string" } }, "type": "object" }, "name": { "description": "The name of the documentation site.", "type": "string" }, "redirects": { "$ref": "#/definitions/Record<string,string>", "description": "Redirects for the documentation site." }, "shortDescription": { "description": "The description of the documentation site.", "type": "string" }, "themeColor": { "description": "The theme color of the documentation site.\nIt will be used as the `theme-color` meta tag and a full palette of colors will be generated from it.", "type": "string" } }, "type": "object" }
MIT
en
unjs/undocs
32d59b69a0cbc3dd90f0c6805ee10a3640fbffe5
"2024-02-21T23:55:35"
schema/config.json
123
2024-05-27T09:27:27.344077Z
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "properties": { "$schema": { "type": "string" }, "automd": { "description": "Enable integration with https://automd.unjs.io", "type": "boolean" }, "buildCache": { "description": "Enable build cache (experimental)", "type": "boolean" }, "description": { "description": "The description of the documentation site.", "type": "string" }, "dir": { "description": "Documentation directory\n\nNote: This option will be automatically set", "type": "string" }, "github": { "description": "The GitHub repository for the documentation site.", "type": "string" }, "landing": { "oneOf": [ { "const": false, "type": "boolean" }, { "additionalProperties": false, "description": "Landing page configuration", "properties": { "contributors": { "description": "Show contributors section", "type": "boolean" }, "description": { "description": "Page description", "type": "string" }, "features": { "description": "Features section description", "items": { "properties": { "description": { "type": "string" }, "icon": { "type": "string" }, "title": { "type": "string" } }, "type": "object" }, "type": "array" }, "featuresLayout": { "description": "Features section layout to be in default place or in the hero (only if there is no code)", "enum": [ "default", "hero" ], "type": "string" }, "featuresTitle": { "description": "Features section title", "type": "string" }, "heroCode": { "anyOf": [ { "type": "string" }, { "additionalProperties": false, "properties": { "content": { "type": "string" }, "lang": { "type": "string" }, "title": { "type": "string" } }, "required": [ "content" ], "type": "object" } ], "description": "Hero Codes" }, "heroDescription": { "description": "Additional text in hero (default is same as description)", "type": "string" }, "heroLinks": { "additionalProperties": { "type": "object" }, "description": "Hero Links", "type": "object" }, "heroSubtitle": { "description": "second hero title (default is same as shortDescription)", "type": "string" }, "heroTitle": { "description": "main title (default is same as page title)", "type": "string" }, "title": { "description": "Page title", "type": "string" } }, "type": "object" } ] }, "name": { "description": "The name of the documentation site.", "type": "string" }, "redirects": { "additionalProperties": { "type": "string" }, "description": "Redirects for the documentation site.", "type": "object" }, "shortDescription": { "description": "The description of the documentation site.", "type": "string" }, "themeColor": { "description": "The theme color of the documentation site.\nIt will be used as the `theme-color` meta tag and a full palette of colors will be generated from it.", "type": "string" }, "url": { "description": "The URL of the documentation site.", "type": "string" } }, "type": "object" }
MIT
en
mapproxy/mapproxy
7d6283e7300dacc97fb9f1d371b368007ccc52e1
"2024-04-11T16:03:43"
mapproxy/config/config-schema.json
525
2024-05-29T09:25:41.539483Z
{ "$defs": { "bandMerge": { "description": "Band merging configs", "items": { "properties": { "additionalProperties": false, "band": { "description": "The band index starting from 0", "type": "integer" }, "source": { "oneOf": [ { "description": "A source name", "type": "string" }, { "description": "A source name", "type": "integer" }, { "description": "An array of source names", "items": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "minItems": 1, "type": "array" } ] } }, "required": [ "source", "band" ], "title": "sources", "type": "object" }, "minItems": 1, "type": "array" }, "cache": { "properties": { "grids": { "items": { "type": "string" }, "type": "array" }, "sources": { "description": "Sources of the cache", "oneOf": [ { "description": "Source or cache name", "type": "string" }, { "description": "Source or cache name", "type": "integer" }, { "description": "Sources or caches name", "items": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array" }, { "additionalProperties": false, "description": "Band merging config", "properties": { "b": { "$ref": "#/$defs/bandMerge" }, "g": { "$ref": "#/$defs/bandMerge" }, "l": { "$ref": "#/$defs/bandMerge" }, "r": { "$ref": "#/$defs/bandMerge" } }, "title": "sources", "type": "object" } ] } }, "title": "cache", "type": "object" }, "layer": { "anyOf": [ { "required": [ "sources" ] }, { "required": [ "layers" ] }, { "required": [ "tile_sources" ] } ], "description": "Configuration of a published layer", "properties": { "layers": { "description": "Child layers of the layer", "item": { "$ref": "#/$defs/layer" }, "minItems": 1, "type": "array", "uniqueItems": true }, "name": { "description": "The addressable name of the layer", "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "sources": { "description": "Associated sources for the layer", "items": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "minItems": 1, "type": "array", "uniqueItems": true }, "tile_sources": { "description": "Associated tile sources for the layer", "items": { "type": "string" }, "minItems": 1, "type": "array", "uniqueItems": true }, "title": { "description": "The title of the layer", "type": "string" } }, "title": "layer", "type": "object" }, "metadata": { "additionalProperties": false, "properties": { "abstract": { "type": "string" }, "access_constraints": { "type": "string" }, "contact": { "additionalProperties": false, "properties": { "address": { "type": "string" }, "city": { "type": "string" }, "country": { "type": "string" }, "email": { "type": "string" }, "fax": { "type": "string" }, "organization": { "type": "string" }, "person": { "type": "string" }, "phone": { "type": "string" }, "position": { "type": "string" }, "postcode": { "type": "integer" }, "state": { "type": "string" } }, "title": "contact", "type": "object" }, "fees": { "type": "string" }, "keyword_list": { "items": { "additionalProperties": false, "properties": { "keywords": { "items": { "type": "string" }, "minItems": 1, "type": "array" }, "vocabulary": { "type": "string" } }, "required": [ "keywords" ], "type": "object" }, "minItems": 1, "type": "array" }, "online_resource": { "type": "string" }, "title": { "type": "string" } }, "type": "object" }, "source": { "if": { "properties": { "type": { "const": "wms" } } }, "properties": { "layers": {}, "req": { "properties": { "layers": {} }, "title": "req", "type": "object" }, "type": { "type": "string" } }, "required": [ "type" ], "then": { "$ref": "#/$defs/source-wms" }, "title": "source", "type": "object" }, "source-wms": { "anyOf": [ { "required": [ "layers" ] }, { "properties": { "req": { "title": "req", "type": "object" } }, "required": [ "req" ] } ], "title": "source", "type": "object" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Configuration for a MapProxy server", "properties": { "caches": { "additionalProperties": { "$ref": "#/$defs/cache" }, "description": "The configured caches", "title": "caches", "type": "object" }, "globals": {}, "grids": {}, "layers": { "description": "The published layers", "items": { "$ref": "#/$defs/layer" }, "type": "array" }, "services": { "additionalProperties": false, "description": "The available services and their configurations", "properties": { "demo": { "type": "null" }, "kml": { "oneOf": [ { "type": "null" }, { "additionalProperties": false, "description": "KML service configuration", "properties": { "use_grid_names": { "description": "Use name of grid instead of srs identifier in url", "type": "boolean" } }, "title": "kml", "type": "object" } ] }, "tms": { "oneOf": [ { "type": "null" }, { "additionalProperties": false, "description": "TMS service configuration", "properties": { "use_grid_names": { "description": "Use name of grid instead of srs identifier in url", "type": "boolean" } }, "title": "tms", "type": "object" } ] }, "wms": { "oneOf": [ { "type": "null" }, { "additionalProperties": false, "description": "WMS service configuration", "properties": { "attribution": { "additionalProperties": false, "properties": { "text": { "type": "string" } }, "type": "object" }, "bbox_srs": { "description": "Supported SRS of the BBOX of the WMS service", "items": { "oneOf": [ { "type": "string" }, { "additionalProperties": false, "properties": { "bbox": { "items": { "type": "number" }, "maxItems": 4, "minItems": 4, "type": "array" }, "srs": { "type": "string" } }, "required": [ "srs", "bbox" ], "type": "object" } ] }, "minItems": 1, "title": "bbox_srs", "type": "array" }, "featureinfo_types": { "description": "List of feature info types", "items": { "oneOf": [ { "const": "text" }, { "const": "html" }, { "const": "xml" } ] }, "minItems": 1, "title": "featureinfo_types", "type": "array" }, "featureinfo_xslt": { "description": "XSLT to transform feature info", "oneOf": [ { "type": "string" }, { "additionalProperties": false, "properties": { "html": { "type": "string" }, "xml": { "type": "string" } }, "title": "featureinfo_xslt", "type": "object" } ] }, "image_formats": { "description": "List of image mime types", "items": { "type": "string" }, "minItems": 1, "title": "image_formats", "type": "array" }, "max_output_pixels": { "description": "Maximum output size for a WMS requests in pixel", "items": { "type": "integer" }, "maxItems": 2, "minItems": 2, "type": "array" }, "md": { "$ref": "#/$defs/metadata", "description": "The metadata config for the wms service", "title": "md" }, "on_source_errors": { "description": "What to do when one or more sources return errors or no response at all", "oneOf": [ { "const": "notify" }, { "const": "raise" } ] }, "srs": { "description": "Supported SRS of the WMS service", "items": { "type": "string" }, "minItems": 1, "title": "srs", "type": "array" }, "strict": { "description": "Require wms feature info request to contain all required parameters", "type": "boolean" }, "versions": { "description": "Versions the the MapProxy WMS should support", "items": { "type": "string" }, "minItems": 1, "type": "array" } }, "title": "wms", "type": "object" } ] }, "wmts": { "oneOf": [ { "type": "null" }, { "description": "WMTS service configuration", "properties": { "featureinfo_formats": { "description": "List of feature info formats", "items": { "additionalProperties": false, "properties": { "mimetype": { "type": "string" }, "suffix": { "type": "string" } }, "type": "object" }, "minItems": 1, "title": "featureinfo_formats", "type": "array" }, "kvp": { "description": "Enable KVP requests", "title": "kvp", "type": "boolean" }, "md": { "$ref": "#/$defs/metadata", "description": "The metadata config for the wmts service", "title": "md" }, "restful": { "description": "Enable restful requests", "title": "restful", "type": "boolean" }, "restful_fi_template": { "description": "URL Template for restful feature info request", "title": "restful_fi_template", "type": "string" }, "restful_template": { "description": "URL Template for restful tile request", "title": "restful_template", "type": "string" } }, "title": "wmts", "type": "object" } ] } }, "title": "services", "type": "object" }, "sources": { "additionalProperties": { "$ref": "#/$defs/source" }, "description": "The map data sources", "title": "sources", "type": "object" } }, "required": [ "layers", "services" ], "title": "MapProxy Configuration", "type": "object" }
Apache-2.0
en
mapproxy/mapproxy
c3f7d2d5fd0862acabade83111b9bc9575db9193
"2024-04-11T16:53:51"
mapproxy/config/config-schema.json
525
2024-05-29T09:25:41.539483Z
{ "$defs": { "bandMerge": { "description": "Band merging configs", "items": { "properties": { "additionalProperties": false, "band": { "description": "The band index starting from 0", "type": "integer" }, "source": { "oneOf": [ { "description": "A source name", "type": "string" }, { "description": "A source name", "type": "integer" }, { "description": "An array of source names", "items": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "minItems": 1, "type": "array" } ] } }, "required": [ "source", "band" ], "title": "sources", "type": "object" }, "minItems": 1, "type": "array" }, "cache": { "additionalProperties": false, "properties": { "bulk_meta_tiles": { "description": "Enables bulk loading of meta tiles", "type": "boolean" }, "cache": { "description": "Configure type of the cache", "title": "cache" }, "cache_dir": { "description": "Directory to store data for this cache", "type": "string" }, "cache_rescaled_tiles": { "description": "Cache rescaled tiles", "type": "boolean" }, "disable_storage": { "description": "Do not use cache, get everything from source", "type": "boolean" }, "downscale_tiles": { "description": "Downscale tiles by this many zoom levels if not available in cache", "type": "integer" }, "format": { "description": "Internal image format", "type": "string" }, "grids": { "description": "Grids used for storing by the cache", "item": { "type": "string" }, "type": "array" }, "image": { "description": "Image options", "title": "image", "type": "object" }, "link_single_color_images": { "description": "How to store single color images", "oneOf": [ { "const": true }, { "const": "symlink" }, { "const": "hardlink" } ] }, "meta_buffer": { "$ref": "#/$defs/metaBuffer" }, "meta_size": { "$ref": "#/$defs/metaSize" }, "minimize_meta_requests": { "description": "Only issue a single request to the source", "type": "boolean" }, "refresh_before": { "description": "Refresh tiles if requested before this time", "title": "refresh_before", "type": "object" }, "request_format": { "description": "Image format used in request", "type": "string" }, "sources": { "description": "Sources of the cache", "oneOf": [ { "type": "string" }, { "type": "integer" }, { "items": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array" }, { "additionalProperties": false, "description": "Band merging config", "properties": { "b": { "$ref": "#/$defs/bandMerge" }, "g": { "$ref": "#/$defs/bandMerge" }, "l": { "$ref": "#/$defs/bandMerge" }, "r": { "$ref": "#/$defs/bandMerge" } }, "title": "sources", "type": "object" } ] }, "upscale_tiles": { "description": "Upscale tiles by this many zoom levels if not available in cache", "type": "integer" }, "use_direct_from_level": { "description": "Requests below this level will not be stored", "type": "boolean" }, "use_direct_from_res": { "description": "Requests below this resolution will not be stored", "type": "boolean" }, "watermark": { "additionalProperties": false, "description": "Watermark for cached tiles", "properties": { "color": { "oneOf": [ { "type": "string" }, { "item": { "type": "integer" }, "maxItems": 3, "minItems": 3, "type": "array" } ] }, "font_size": { "type": "number" }, "opacity": { "type": "number" }, "spacing": { "const": "wide" }, "text": { "type": "string" } }, "required": [ "text" ], "title": "watermark", "type": "object" } }, "title": "cache", "type": "object" }, "layer": { "additionalProperties": false, "anyOf": [ { "required": [ "sources" ] }, { "required": [ "layers" ] }, { "required": [ "tile_sources" ] } ], "description": "Configuration of a published layer", "properties": { "dimensions": { "additionalProperties": { "additionalProperties": false, "properties": { "default": { "oneOf": [ { "type": "string" }, { "type": "number" } ] }, "values": { "item": { "oneOf": [ { "type": "string" }, { "type": "number" } ] }, "minItems": 1, "type": "array" } }, "type": "object" }, "description": "Configure dimensions for the layer", "title": "dimensions", "type": "object" }, "layers": { "description": "Child layers of the layer", "item": { "$ref": "#/$defs/layer" }, "minItems": 1, "type": "array", "uniqueItems": true }, "legendurl": { "description": "URL to an image used as a legend for this layer", "type": "string" }, "max_res": { "description": "Maximum resolution", "type": "number" }, "max_scale": { "description": "Maximum scale", "type": "number" }, "md": { "description": "Additional metadata for this layer", "title": "md", "type": "object" }, "min_res": { "description": "Minimum resolution", "type": "number" }, "min_scale": { "description": "Minimum scale", "type": "number" }, "name": { "description": "The addressable name of the layer", "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "sources": { "description": "Associated sources for the layer", "items": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "minItems": 1, "type": "array", "uniqueItems": true }, "tile_sources": { "description": "Associated tile sources for the layer", "items": { "type": "string" }, "minItems": 1, "type": "array", "uniqueItems": true }, "title": { "description": "The title of the layer", "type": "string" } }, "title": "layer", "type": "object" }, "metaBuffer": { "description": "Buffer around each meta tile", "type": "integer" }, "metaSize": { "description": "Size of meta tile in tiles", "item": { "type": "integer" }, "maxItems": 2, "minItems": 2, "type": "array" }, "metadata": { "additionalProperties": false, "properties": { "abstract": { "type": "string" }, "access_constraints": { "type": "string" }, "contact": { "additionalProperties": false, "properties": { "address": { "type": "string" }, "city": { "type": "string" }, "country": { "type": "string" }, "email": { "type": "string" }, "fax": { "type": "string" }, "organization": { "type": "string" }, "person": { "type": "string" }, "phone": { "type": "string" }, "position": { "type": "string" }, "postcode": { "type": "integer" }, "state": { "type": "string" } }, "title": "contact", "type": "object" }, "fees": { "type": "string" }, "keyword_list": { "items": { "additionalProperties": false, "properties": { "keywords": { "items": { "type": "string" }, "minItems": 1, "type": "array" }, "vocabulary": { "type": "string" } }, "required": [ "keywords" ], "type": "object" }, "minItems": 1, "type": "array" }, "online_resource": { "type": "string" }, "title": { "type": "string" } }, "type": "object" }, "source": { "if": { "properties": { "type": { "const": "wms" } } }, "properties": { "layers": {}, "req": { "properties": { "layers": {} }, "title": "req", "type": "object" }, "type": { "type": "string" } }, "required": [ "type" ], "then": { "$ref": "#/$defs/source-wms" }, "title": "source", "type": "object" }, "source-wms": { "anyOf": [ { "required": [ "layers" ] }, { "properties": { "req": { "title": "req", "type": "object" } }, "required": [ "req" ] } ], "title": "source", "type": "object" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Configuration for a MapProxy server", "properties": { "caches": { "additionalProperties": { "$ref": "#/$defs/cache" }, "description": "The configured caches", "title": "caches", "type": "object" }, "globals": {}, "grids": {}, "layers": { "description": "The published layers", "items": { "$ref": "#/$defs/layer" }, "type": "array" }, "services": { "additionalProperties": false, "description": "The available services and their configurations", "properties": { "demo": { "type": "null" }, "kml": { "oneOf": [ { "type": "null" }, { "additionalProperties": false, "description": "KML service configuration", "properties": { "use_grid_names": { "description": "Use name of grid instead of srs identifier in url", "type": "boolean" } }, "title": "kml", "type": "object" } ] }, "tms": { "oneOf": [ { "type": "null" }, { "additionalProperties": false, "description": "TMS service configuration", "properties": { "origin": { "description": "Change the default origin for the tiles", "oneOf": [ { "const": "nw" }, { "const": "sw" } ] }, "use_grid_names": { "description": "Use name of grid instead of srs identifier in url", "type": "boolean" } }, "title": "tms", "type": "object" } ] }, "wms": { "oneOf": [ { "type": "null" }, { "additionalProperties": false, "description": "WMS service configuration", "properties": { "attribution": { "additionalProperties": false, "properties": { "text": { "type": "string" } }, "type": "object" }, "bbox_srs": { "description": "Supported SRS of the BBOX of the WMS service", "items": { "oneOf": [ { "type": "string" }, { "additionalProperties": false, "properties": { "bbox": { "items": { "type": "number" }, "maxItems": 4, "minItems": 4, "type": "array" }, "srs": { "type": "string" } }, "required": [ "srs", "bbox" ], "type": "object" } ] }, "minItems": 1, "title": "bbox_srs", "type": "array" }, "featureinfo_types": { "description": "List of feature info types", "items": { "oneOf": [ { "const": "text" }, { "const": "html" }, { "const": "xml" } ] }, "minItems": 1, "title": "featureinfo_types", "type": "array" }, "featureinfo_xslt": { "description": "XSLT to transform feature info", "oneOf": [ { "type": "string" }, { "additionalProperties": false, "properties": { "html": { "type": "string" }, "xml": { "type": "string" } }, "title": "featureinfo_xslt", "type": "object" } ] }, "image_formats": { "description": "List of image mime types", "items": { "type": "string" }, "minItems": 1, "title": "image_formats", "type": "array" }, "max_output_pixels": { "description": "Maximum output size for a WMS requests in pixel", "items": { "type": "integer" }, "maxItems": 2, "minItems": 2, "type": "array" }, "md": { "$ref": "#/$defs/metadata", "description": "The metadata config for the wms service", "title": "md" }, "on_source_errors": { "description": "What to do when one or more sources return errors or no response at all", "oneOf": [ { "const": "notify" }, { "const": "raise" } ] }, "srs": { "description": "Supported SRS of the WMS service", "items": { "type": "string" }, "minItems": 1, "title": "srs", "type": "array" }, "strict": { "description": "Require wms feature info request to contain all required parameters", "type": "boolean" }, "versions": { "description": "Versions the the MapProxy WMS should support", "items": { "type": "string" }, "minItems": 1, "type": "array" } }, "title": "wms", "type": "object" } ] }, "wmts": { "oneOf": [ { "type": "null" }, { "description": "WMTS service configuration", "properties": { "featureinfo_formats": { "description": "List of feature info formats", "items": { "additionalProperties": false, "properties": { "mimetype": { "type": "string" }, "suffix": { "type": "string" } }, "type": "object" }, "minItems": 1, "title": "featureinfo_formats", "type": "array" }, "kvp": { "description": "Enable KVP requests", "title": "kvp", "type": "boolean" }, "md": { "$ref": "#/$defs/metadata", "description": "The metadata config for the wmts service", "title": "md" }, "restful": { "description": "Enable restful requests", "title": "restful", "type": "boolean" }, "restful_fi_template": { "description": "URL Template for restful feature info request", "title": "restful_fi_template", "type": "string" }, "restful_template": { "description": "URL Template for restful tile request", "title": "restful_template", "type": "string" } }, "title": "wmts", "type": "object" } ] } }, "title": "services", "type": "object" }, "sources": { "additionalProperties": { "$ref": "#/$defs/source" }, "description": "The map data sources", "title": "sources", "type": "object" } }, "required": [ "layers", "services" ], "title": "MapProxy Configuration", "type": "object" }
Apache-2.0
en
mapproxy/mapproxy
7400609678f6af163f011076f586ecf81cfa471c
"2024-04-11T07:32:12"
mapproxy/config/config-schema.json
525
2024-05-29T09:25:41.539483Z
{ "$defs": { "cache": { "properties": { "grids": { "items": { "type": "string" }, "type": "array" }, "sources": { "oneOf": [ { "additionalProperties": { "type": "string" }, "type": "object" }, { "items": { "type": "string" }, "type": "array" } ] } }, "type": "object" }, "layer": { "anyOf": [ { "required": [ "sources" ] }, { "required": [ "child_layers" ] }, { "required": [ "tile_sources" ] } ], "description": "Configuration of a published layer", "properties": { "child_layers": { "description": "Child layers of the layer", "item": { "$ref": "#/$defs/layer" }, "type": "array" }, "sources": { "description": "Associated source for the layer", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "source": { "if": { "properties": { "type": { "const": "wms" } } }, "properties": { "layers": {}, "req": { "properties": { "layers": {} }, "type": "object" }, "type": { "type": "string" } }, "required": [ "type" ], "then": { "$ref": "#/$defs/source-wms" }, "type": "object" }, "source-wms": { "anyOf": [ { "required": [ "layers" ] }, { "properties": { "req": { "required": [ "layers" ] } }, "required": [ "req" ] } ], "type": "object" } }, "$id": "https://mapproxy.org/mapproxy.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Configuration for a MapProxy server", "properties": { "caches": { "additionalProperties": { "$ref": "#/$defs/cache" }, "description": "The configured caches", "type": "object" }, "globals": {}, "grids": {}, "layers": { "description": "The published layers", "items": { "$ref": "#/$defs/layer" }, "type": "array" }, "services": { "type": "object" }, "sources": { "additionalProperties": { "$ref": "#/$defs/source" }, "description": "The map data sources", "type": "object" } }, "required": [ "layers", "services" ], "title": "MapProxy Configuration", "type": "object" }
Apache-2.0
en
mapproxy/mapproxy
2b00010b2b81fa196671123bf4e5f580019485eb
"2024-04-11T14:37:19"
mapproxy/config/config-schema.json
525
2024-05-29T09:25:41.539483Z
{ "$defs": { "bandMerge": { "description": "Band merging configs", "items": { "properties": { "additionalProperties": false, "band": { "description": "The band index starting from 0", "type": "integer" }, "source": { "oneOf": [ { "description": "A source name", "type": "string" }, { "description": "An array of source names", "items": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "minItems": 1, "type": "array" } ] } }, "required": [ "source", "band" ], "title": "sources", "type": "object" }, "minItems": 1, "type": "array" }, "cache": { "properties": { "grids": { "items": { "type": "string" }, "type": "array" }, "sources": { "description": "Sources of the cache", "oneOf": [ { "description": "Source or cache name", "type": "string" }, { "description": "Source or cache name", "type": "integer" }, { "description": "Sources or caches name", "items": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array" }, { "additionalProperties": false, "description": "Band merging config", "properties": { "b": { "$ref": "#/$defs/bandMerge" }, "g": { "$ref": "#/$defs/bandMerge" }, "l": { "$ref": "#/$defs/bandMerge" }, "r": { "$ref": "#/$defs/bandMerge" } }, "title": "sources", "type": "object" } ] } }, "title": "cache", "type": "object" }, "layer": { "anyOf": [ { "required": [ "sources" ] }, { "required": [ "layers" ] }, { "required": [ "tile_sources" ] } ], "description": "Configuration of a published layer", "properties": { "layers": { "description": "Child layers of the layer", "item": { "$ref": "#/$defs/layer" }, "minItems": 1, "type": "array", "uniqueItems": true }, "name": { "description": "The addressable name of the layer", "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "sources": { "description": "Associated sources for the layer", "items": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "minItems": 1, "type": "array", "uniqueItems": true }, "tile_sources": { "description": "Associated tile sources for the layer", "items": { "type": "string" }, "minItems": 1, "type": "array", "uniqueItems": true }, "title": { "description": "The title of the layer", "type": "string" } }, "title": "layer", "type": "object" }, "source": { "if": { "properties": { "type": { "const": "wms" } } }, "properties": { "layers": {}, "req": { "properties": { "layers": {} }, "title": "req", "type": "object" }, "type": { "type": "string" } }, "required": [ "type" ], "then": { "$ref": "#/$defs/source-wms" }, "title": "source", "type": "object" }, "source-wms": { "anyOf": [ { "required": [ "layers" ] }, { "properties": { "req": { "title": "req", "type": "object" } }, "required": [ "req" ] } ], "title": "source", "type": "object" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Configuration for a MapProxy server", "properties": { "caches": { "additionalProperties": { "$ref": "#/$defs/cache" }, "description": "The configured caches", "title": "caches", "type": "object" }, "globals": {}, "grids": {}, "layers": { "description": "The published layers", "items": { "$ref": "#/$defs/layer" }, "type": "array" }, "services": { "title": "services", "type": "object" }, "sources": { "additionalProperties": { "$ref": "#/$defs/source" }, "description": "The map data sources", "title": "sources", "type": "object" } }, "required": [ "layers", "services" ], "title": "MapProxy Configuration", "type": "object" }
Apache-2.0
en
kubernetes/minikube
6c72f9378b6958a3f4a30573c48d2a460b8b3950
"2022-02-02T01:11:33"
deploy/minikube/schema.json
28,533
2024-05-29T15:55:02.524623Z
{ "$defs": { "sha": { "pattern": "^[A-Fa-f0-9]{64}$", "type": "string" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "items": { "properties": { "checksums": { "properties": { "darwin": { "$ref": "#/$defs/sha" }, "linux": { "$ref": "#/$defs/sha" }, "windows": { "$ref": "#/$defs/sha" } }, "required": [ "darwin", "linux", "windows" ], "type": "object" }, "name": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "type": "array" }
Apache-2.0
en
kubernetes/minikube
a22a155fdf6a16c0f382024cc5d7de03c6a609ee
"2016-07-22T11:25:37"
deploy/minikube/schema.json
28,533
2024-05-29T15:55:02.524623Z
{ "$schema": "http://json-schema.org/draft-04/schema#", "items": { "properties": { "checksums": { "properties": { "darwin": { "pattern": "^[A-Fa-f0-9]{64}$", "type": "number" }, "linux": { "pattern": "^[A-Fa-f0-9]{64}$", "type": "number" }, "windows": { "pattern": "^[A-Fa-f0-9]{64}$", "type": "number" } }, "required": [ "windows", "darwin", "linux" ], "type": "object" }, "name": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "type": "array" }
Apache-2.0
en
kubernetes/minikube
595a9cbbc67f73bd3d385e23ecbd9f14b857d2e7
"2016-06-26T18:54:22"
deploy/minikube/schema.json
28,533
2024-05-29T15:55:02.524623Z
{ "$schema": "http://json-schema.org/draft-04/schema#", "items": { "properties": { "name": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "type": "array" }
Apache-2.0
en
kubernetes/minikube
6c72f9378b6958a3f4a30573c48d2a460b8b3950
"2022-02-02T01:11:33"
deploy/minikube/schema-v2.json
28,533
2024-05-29T15:55:02.524623Z
{ "$defs": { "arch": { "properties": { "darwin": { "$ref": "#/$defs/sha" }, "linux": { "$ref": "#/$defs/sha" }, "windows": { "$ref": "#/$defs/sha" } }, "type": "object" }, "sha": { "pattern": "^[A-Fa-f0-9]{64}$", "type": "string" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "items": { "properties": { "checksums": { "properties": { "amd64": { "$ref": "#/$defs/arch" }, "arm": { "$ref": "#/$defs/arch" }, "arm64": { "$ref": "#/$defs/arch" }, "darwin": { "$ref": "#/$defs/sha" }, "linux": { "$ref": "#/$defs/sha" }, "ppc64le": { "$ref": "#/$defs/arch" }, "s390x": { "$ref": "#/$defs/arch" }, "windows": { "$ref": "#/$defs/sha" } }, "required": [ "darwin", "linux", "windows" ], "type": "object" }, "name": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "type": "array" }
Apache-2.0
en
kubernetes/minikube
1a7cfcc355d51a574650c762944e7d517360edff
"2016-08-03T18:39:43"
deploy/minikube/schema.json
28,533
2024-05-29T15:55:02.524623Z
{ "$schema": "http://json-schema.org/draft-04/schema#", "items": { "properties": { "checksums": { "properties": { "darwin": { "pattern": "^[A-Fa-f0-9]{64}$", "type": "string" }, "linux": { "pattern": "^[A-Fa-f0-9]{64}$", "type": "string" }, "windows": { "pattern": "^[A-Fa-f0-9]{64}$", "type": "string" } }, "required": [ "darwin", "linux", "windows" ], "type": "object" }, "name": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "type": "array" }
Apache-2.0
en
open-rmf/rmf_ros2
e9b6c0932c213ea96d14592a48cc2c4ae7348495
"2022-02-13T16:56:25"
rmf_fleet_adapter/schemas/task_description__clean.json
65
2024-05-28T01:23:32.754953Z
{ "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/task_description__clean.json", "$ref": "event_description__clean.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Clean a zone", "title": "Clean Task" }
Apache-2.0
en
open-rmf/rmf_ros2
e9b6c0932c213ea96d14592a48cc2c4ae7348495
"2022-02-13T16:56:25"
rmf_fleet_adapter/schemas/task_description__delivery.json
65
2024-05-28T01:23:32.754953Z
{ "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/task_description__delivery.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Description for a simple delivery task category", "properties": { "dropoff": { "$ref": "event_description__dropoff.json" }, "pickup": { "$ref": "event_description__pickup.json" } }, "required": [ "pickup", "dropoff" ], "title": "Delivery Task Description", "type": "object" }
Apache-2.0
en
open-rmf/rmf_ros2
e9b6c0932c213ea96d14592a48cc2c4ae7348495
"2022-02-13T16:56:25"
rmf_fleet_adapter/schemas/place.json
65
2024-05-28T01:23:32.754953Z
{ "$defs": { "waypoint": { "oneOf": [ { "type": "string" }, { "minimum": 0, "type": "integer" } ] } }, "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/place.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Description of a place that the robot can go to", "oneOf": [ { "$ref": "#/$defs/waypoint" }, { "properties": { "orientation": { "type": "number" }, "waypoint": { "$ref": "#/$defs/waypoint" } }, "required": [ "waypoint" ], "type": "object" } ], "title": "Place Description" }
Apache-2.0
en
open-rmf/rmf_ros2
77ef0dbd0625f802316e991829323f0425096c00
"2023-12-21T13:07:46"
rmf_fleet_adapter/schemas/event_description__go_to_place.json
65
2024-05-28T01:23:32.754953Z
{ "$defs": { "constraint": { "properties": { "category": { "description": "The type of constraint, e.g. prefer_same_map", "type": "string" }, "description": { "description": "A complete description of the constraint" } }, "required": [ "category" ], "type": "object" } }, "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/event_description__go_to_place.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Have a robot go to a place", "oneOf": [ { "$ref": "place.json" }, { "properties": { "followed_by": { "description": "A list of places that the robot might go after it reaches this one. It will not actually go to these places unless other activities bring it there, but the traffic system will be told to expect the robot to proceed through these places.", "items": { "$ref": "place.json" }, "type": "array" }, "place": { "$ref": "place.json" } }, "required": [ "place" ], "type": "object" }, { "properties": { "constraints": { "description": "list of constraints to use", "items": { "$ref": "#/$defs/constraint" }, "type": "array" }, "one_of": { "description": "A list of places to choose from. Will try to go to the nearest one.", "items": { "$ref": "place.json" }, "minItems": 1, "type": "array" } }, "required": [ "one_of" ], "type": "object" } ], "title": "Go To Place Event Description" }
Apache-2.0
en
open-rmf/rmf_ros2
e9b6c0932c213ea96d14592a48cc2c4ae7348495
"2022-02-13T16:56:25"
rmf_fleet_adapter/schemas/task_description__patrol.json
65
2024-05-28T01:23:32.754953Z
{ "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/task_description__patrol.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Description of a patrolling task", "properties": { "places": { "description": "A list of which places to patrol between", "items": { "$ref": "place.json" }, "type": "array" }, "rounds": { "description": "How many times the patrol should be performed. By default this is 1.", "minimum": 1, "type": "integer" } }, "required": [ "places" ], "title": "Patrol Task Description", "type": "object" }
Apache-2.0
en
open-rmf/rmf_ros2
e9b6c0932c213ea96d14592a48cc2c4ae7348495
"2022-02-13T16:56:25"
rmf_fleet_adapter/schemas/event_description__pickup.json
65
2024-05-28T01:23:32.754953Z
{ "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/event_description__pickup.json", "$ref": "event_description__payload_transfer.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Pick Up Event Description" }
Apache-2.0
en
open-rmf/rmf_ros2
b1676a0cbe7157a616f460c4fb9ed4db5c9bad7e
"2022-05-17T08:15:42"
rmf_fleet_adapter/schemas/event_description__go_to_place.json
65
2024-05-28T01:23:32.754953Z
{ "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/event_description__go_to_place.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Have a robot go to a place", "oneOf": [ { "$ref": "place.json" }, { "properties": { "followed_by": { "description": "A list of places that the robot might go after it reaches this one. It will not actually go to these places unless other activities bring it there, but the traffic system will be told to expect the robot to proceed through these places.", "items": { "$ref": "place.json" }, "type": "array" }, "place": { "$ref": "place.json" } }, "type": "object" } ], "title": "Go To Place Event Description" }
Apache-2.0
en
open-rmf/rmf_ros2
3be4edfce77e1a4ecb5ce99504e7696eb61658d9
"2022-07-14T08:33:41"
rmf_fleet_adapter/schemas/event_description__go_to_place.json
65
2024-05-28T01:23:32.754953Z
{ "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/event_description__go_to_place.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Have a robot go to a place", "oneOf": [ { "$ref": "place.json" }, { "properties": { "followed_by": { "description": "A list of places that the robot might go after it reaches this one. It will not actually go to these places unless other activities bring it there, but the traffic system will be told to expect the robot to proceed through these places.", "items": { "$ref": "place.json" }, "type": "array" }, "place": { "$ref": "place.json" } }, "required": [ "place" ], "type": "object" } ], "title": "Go To Place Event Description" }
Apache-2.0
en
open-rmf/rmf_ros2
e9b6c0932c213ea96d14592a48cc2c4ae7348495
"2022-02-13T16:56:25"
rmf_fleet_adapter/schemas/event_description__payload_transfer.json
65
2024-05-28T01:23:32.754953Z
{ "$defs": { "payload_component": { "properties": { "compartment": { "type": "string" }, "quantity": { "minimum": 0, "type": "integer" }, "sku": { "type": "string" } }, "required": [ "sku", "quantity" ], "type": "object" } }, "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/event_description__payload_transfer.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Description for a drop off or a pick up event category", "properties": { "handler": { "type": "string" }, "payload": { "oneOf": [ { "$ref": "#/$defs/payload_component" }, { "items": { "$ref": "#/$defs/payload_component" }, "type": "array" } ] }, "place": { "$ref": "place.json" } }, "required": [ "place", "payload" ], "title": "Item Transfer Event Description", "type": "object" }
Apache-2.0
en
open-rmf/rmf_ros2
e9b6c0932c213ea96d14592a48cc2c4ae7348495
"2022-02-13T16:56:25"
rmf_fleet_adapter/schemas/event_description__sequence.json
65
2024-05-28T01:23:32.754953Z
{ "$defs": { "activity_array": { "items": { "properties": { "category": { "description": "The category of the activity", "type": "string" }, "description": { "description": "A description of the activity. This must match a schema supported by a fleet for the activity category." } }, "required": [ "category", "description" ], "type": "object" }, "minimum": 1, "type": "array" } }, "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/event_description__sequence.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "A sequence of activities", "oneOf": [ { "$ref": "#/$defs/activity_array" }, { "properties": { "activities": { "$ref": "#/$defs/activity_array" }, "category": { "description": "Customize the category display for this sequence", "type": "string" }, "detail": { "description": "Customize the detail display for this sequence" } }, "required": [ "activities" ], "type": "object" } ], "title": "Activity Sequence" }
Apache-2.0
en
open-rmf/rmf_ros2
e9b6c0932c213ea96d14592a48cc2c4ae7348495
"2022-02-13T16:56:25"
rmf_fleet_adapter/schemas/event_description__clean.json
65
2024-05-28T01:23:32.754953Z
{ "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/event_description__clean.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Clean a zone", "properties": { "type": { "type": "string" }, "zone": { "type": "string" } }, "required": [ "zone" ], "title": "Clean Event", "type": "object" }
Apache-2.0
en
open-rmf/rmf_ros2
e9b6c0932c213ea96d14592a48cc2c4ae7348495
"2022-02-13T16:56:25"
rmf_fleet_adapter/schemas/task_description__compose.json
65
2024-05-28T01:23:32.754953Z
{ "$defs": { "activity": { "description": "Describe the activity of the phase. This must match an activity description supported by one of the fleets. If there should be multiple activities within a phase, then use a Sequence activity.", "properties": { "category": { "description": "The category of this phase's activity.", "type": "string" }, "description": { "description": "A description of the activity. This must match a schema supported by a fleet for the category of this activity." } }, "required": [ "category", "description" ], "type": "object" } }, "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/task_description__compose.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Compose a task description based on activities that are supported by fleets. When supported by fleets, this can be used as a task description for task_request.", "properties": { "category": { "description": "Specify the category for this composed task, as the operators should see it.", "type": "string" }, "detail": { "description": "Specify the detail for this composed task, as the operators should see it.", "type": "string" }, "phases": { "description": "List the phases of the task in the order that they should be performed.", "items": { "properties": { "activity": { "$ref": "#/$defs/activity" }, "on_cancel": { "description": "A list of activities to perform if the task is canceled during this phase. Each activity is given its own phase which can be skipped but not canceled.", "items": { "$ref": "#/$defs/activity" }, "type": "array" } }, "required": [ "activity" ], "type": "object" }, "minimum": 1, "type": "array" } }, "required": [ "phases" ], "title": "Compose Task Description", "type": "object" }
Apache-2.0
en
open-rmf/rmf_ros2
e9b6c0932c213ea96d14592a48cc2c4ae7348495
"2022-02-13T16:56:25"
rmf_fleet_adapter/schemas/event_description__go_to_place.json
65
2024-05-28T01:23:32.754953Z
{ "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/event_description__go_to_place.json", "$ref": "place.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Have a robot go to a place", "title": "Go To Place Event Description" }
Apache-2.0
en
open-rmf/rmf_ros2
e9b6c0932c213ea96d14592a48cc2c4ae7348495
"2022-02-13T16:56:25"
rmf_fleet_adapter/schemas/event_description__perform_action.json
65
2024-05-28T01:23:32.754953Z
{ "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/event_description__perform_action.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Description schema for the perform_action category", "properties": { "category": { "description": "A string that describes the nature of this action. It should match that passed into FleetUpdateHandle::add_performable_action()", "type": "string" }, "description": { "description": "Additional information that will be passed along to the action executor." }, "expected_finish_location": { "$ref": "place.json", "description": "(Optional) A place that the robot will end up after the action. Default to last known location" }, "unix_millis_action_duration_estimate": { "description": "(Recommended) The estimated duration for this action", "type": "integer" }, "use_tool_sink": { "description": "(Optional) Whether the tool on the robot will be powered during the action. Default to false", "type": "boolean" } }, "required": [ "category", "description" ], "title": "PerformAction event Description", "type": "object" }
Apache-2.0
en
open-rmf/rmf_ros2
e9b6c0932c213ea96d14592a48cc2c4ae7348495
"2022-02-13T16:56:25"
rmf_fleet_adapter/schemas/event_description__dropoff.json
65
2024-05-28T01:23:32.754953Z
{ "$id": "https://raw.githubusercontent.com/open-rmf/rmf_ros2/main/rmf_fleet_adapter/schemas/event_description__dropoff.json", "$ref": "event_description__payload_transfer.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Drop Off Event Description" }
Apache-2.0
en
open-rmf/rmf_task
27f28653dfd4bcf24af8be4c453fb96c81d3d57c
"2022-02-13T16:56:16"
rmf_task_sequence/samples/description_PickUp.schema.json
18
2024-05-28T01:23:36.32808Z
{ "$id": "https://open-rmf.org/rmf_task_sequence/description_PickUp/0.1", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "The description of a Pick Up task", "properties": { "dispenser": { "enum": [ "pharmacist", "soda_dispenser", "candy_dispenser", "chef" ], "type": "string" }, "payload": { "items": { "properties": { "compartment": { "type": "string" }, "quantity": { "type": "integer" }, "sku": { "type": "string" } }, "required": [ "sku", "quantity" ], "type": "object" }, "type": "array" }, "pickup_location": { "enum": [ "pharmacy", "vending_machines", "kitchen" ], "type": "string" } }, "required": [ "pickup_location", "dispenser", "payload" ], "title": "Pick Up Description" }
Apache-2.0
en
open-rmf/rmf_task
4fdead0849e683e61cf3f0c982f5d23c2af02ff3
"2022-02-28T07:01:53"
rmf_task_sequence/schemas/backup/backup_PhaseSequenceTask_v0_1.schema.json
18
2024-05-28T01:23:36.32808Z
{ "$id": "https://open-rmf.org/rmf_task_sequence/backup_PhaseSequenceTask/0.1", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "A backup state for a task which is defined by a fixed sequence of phases", "oneOf": [ { "properties": { "current_phase": { "description": "The current phase of the task when the backup occurred", "properties": { "cancelled_from": { "description": "The integer ID of the phase that was cancelled to reach the current phase", "minimum": 0, "type": "integer" }, "id": { "description": "The integer ID of the phase", "minimum": 0, "type": "integer" }, "state": { "description": "The serialized state of the backed up current phase" } }, "required": [ "id", "state" ] }, "schema_version": { "description": "The version of the Phase Sequence Task Backup schema being used", "enum": [ 1 ], "type": "integer" }, "skip_phases": { "description": "A list of pending phases that are supposed to be skipped", "items": { "minimum": 0, "type": "integer" }, "type": "array" } }, "required": [ "schema_version", "current_phase" ] }, { "properties": { "finished": { "description": "True if the task is finished, or false if the task has not started", "type": "boolean" }, "schema_version": { "description": "The version of the Phase Sequence Task Backup schema being used", "enum": [ 1 ], "type": "integer" } }, "required": [ "schema_version", "finished" ] } ], "title": "Phase Sequence Task Backup" }
Apache-2.0
en
open-rmf/rmf_task
27f28653dfd4bcf24af8be4c453fb96c81d3d57c
"2022-02-13T16:56:16"
rmf_task_sequence/schemas/backup/backup_PhaseSequenceTask_v0_1.schema.json
18
2024-05-28T01:23:36.32808Z
{ "$id": "https://open-rmf.org/rmf_task_sequence/backup_PhaseSequenceTask/0.1", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "A backup state for a task which is defined by a fixed sequence of phases", "properties": { "current_phase": { "description": "The current phase of the task when the backup occurred", "properties": { "cancelled_from": { "description": "The integer ID of the phase that was cancelled to reach the current phase", "minimum": 0, "type": "integer" }, "id": { "description": "The integer ID of the phase", "minimum": 0, "type": "integer" }, "state": { "description": "The serialized state of the backed up current phase" } }, "required": [ "id", "state" ] }, "schema_version": { "const": "0.1", "description": "The version of the Phase Sequence Task Backup schema being used" }, "skip_phases": { "description": "A list of pending phases that are supposed to be skipped", "items": { "minimum": 0, "type": "integer" }, "type": "array" } }, "required": [ "schema_version", "current_phase" ], "title": "Phase Sequence Task Backup" }
Apache-2.0
en
open-rmf/rmf_task
27f28653dfd4bcf24af8be4c453fb96c81d3d57c
"2022-02-13T16:56:16"
rmf_task_sequence/schemas/backup/backup_EventSequence_v0_1.schema.json
18
2024-05-28T01:23:36.32808Z
{ "$id": "https://open-rmf.org/rmf_task_sequence/backup_EventSequence/0.1", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "A backup state for a sequence of events", "properties": { "current_event": { "description": "The current event in the sequence when the backup occurred", "properties": { "index": { "description": "The index of the current phase within the sequence", "minimum": 0, "type": "integer" }, "state": { "description": "The serialized state of the backed up current event" } }, "required": [ "index", "state" ] }, "schema_version": { "const": "0.1", "description": "The version of the Event Sequence schema being used" } }, "required": [ "schema_version", "current_event" ], "title": "Event Sequence Backup" }
Apache-2.0
en
open-rmf/rmf_task
27f28653dfd4bcf24af8be4c453fb96c81d3d57c
"2022-02-13T16:56:16"
rmf_task_sequence/samples/description_Clean.schema.json
18
2024-05-28T01:23:36.32808Z
{ "$id": "https://open-rmf.org/rmf_task_sequence/description_Clean/0.1", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "The description of a Pick Up task", "properties": { "type": { "enum": [ "vacuum", "mop" ], "type": "string" }, "zone": { "enum": [ "pharmacy", "ward_0", "ward_1", "ward_2", "kitchen" ], "type": "string" } }, "required": [ "zone", "type" ], "title": "Pick Up Description" }
Apache-2.0
en
nfdi4plants/Swate
165f9d54094fac8cf20f3f793059756fc5ed4be6
"2021-10-22T14:09:31"
src/Server/public/TemplateMetadataSchema.json
29
2024-05-28T05:12:54.468205Z
{ "$id": "https://raw.githubusercontent.com/nfdi4plants/SWATE_templates/FormattingDocs/templates/TemplatingSchema.json", "$schema": "https://json-schema.org/draft/2019-09/schema", "description": "The schema regarding Swate templating-related JSON files.", "properties": { "authors": { "description": "The author(s) of this template.", "items": { "$ref": "https://raw.githubusercontent.com/ISA-tools/isa-api/master/isatools/resources/schemas/isa_model_version_1_0_schemas/core/person_schema.json" }, "minItems": 1, "type": "array", "uniqueItems": true }, "description": { "description": "The description of this template. Use few sentences for succinctness.", "type": "string" }, "docslink": { "description": "The URL to the documentation page.", "type": "string" }, "er": { "description": "A list of all ERs (endpoint repositories) targeted with this template. ERs are realized as Terms: <term ref here>", "items": { "$ref": "https://raw.githubusercontent.com/ISA-tools/isa-api/master/isatools/resources/schemas/isa_model_version_1_0_schemas/core/ontology_annotation_schema.json" }, "minItems": 1, "type": "array", "uniqueItems": true }, "name": { "description": "The name of the Swate template.", "type": "string" }, "organisation": { "description": "The name of the template associated organisation.", "type": "string" }, "table": { "description": "The name of the Swate annotation table in the worksheet of the template's excel file.", "type": "string" }, "tags": { "description": "A list of all tags associated with this template. Tags are realized as Terms: <term ref here>", "items": { "$ref": "https://raw.githubusercontent.com/ISA-tools/isa-api/master/isatools/resources/schemas/isa_model_version_1_0_schemas/core/ontology_annotation_schema.json" }, "minItems": 1, "type": "array", "uniqueItems": true }, "templateId": { "description": "The unique identifier of this template. It will be auto generated.", "type": "string" }, "version": { "description": "The current version of this template in SemVer notation.", "type": "string" } }, "required": [ "name", "version", "description", "docslink", "organisation", "table", "er", "tags", "authors" ], "title": "Template Metadata Schema", "type": "object" }
MIT
en
adrielp/schemacheck
c6a6933e877ceddc32c3b6781156b4ddd34cf304
"2022-06-20T20:39:50"
test_data/schema.json
22
2024-05-27T04:38:17.699928Z
{ "$id": "https://example.com/product.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "A JSON File.", "properties": { "key1": { "description": "Super cool key name", "type": "string" }, "key2": { "properties": { "coolOrNot": { "description": "Whether or not we're cool", "type": "boolean" }, "id": { "description": "Super cool ID number", "type": "integer" }, "name": { "description": "Super cool name", "type": "string" } }, "type": "object" }, "key3": { "description": "Coolness factor", "type": "integer" } }, "required": [ "key1", "key2" ], "title": "Environment", "type": "object" }
MIT
en
steve-bate/activitypub-mincore
ee049076d497ebc1dea15a76c3cf7e58f3272884
"2023-09-26T16:16:49"
activitypub_mincore/schemas/activity-schema.json
7
2024-05-27T05:43:06.000597Z
{ "$id": "schema:activity", "$ref": "schema:object", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "An Activity. https://www.w3.org/TR/activitystreams-core/#activities", "properties": { "actor": { "format": "uri", "type": "string" }, "object": { "$ref": "schema:object#/definitions/UriOrObject" }, "type": { "$ref": "schema:known-activities" } }, "required": [ "object" ], "type": "object" }
MIT
en
steve-bate/activitypub-mincore
ee049076d497ebc1dea15a76c3cf7e58f3272884
"2023-09-26T16:16:49"
activitypub_mincore/schemas/actor-schema.json
7
2024-05-27T05:43:06.000597Z
{ "$id": "schema:actor", "$ref": "schema:object", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "An Actor. https://www.w3.org/TR/activitystreams-core/#actors", "properties": { "id": { "format": "uri", "type": "string" }, "inbox": { "format": "uri", "type": "string" }, "outbox": { "format": "uri", "type": "string" }, "type": { "oneOf": [ { "const": "Person" }, { "const": "Group" }, { "const": "Service" } ] } }, "required": [ "id", "type", "inbox", "outbox" ], "type": "object" }
MIT
en
steve-bate/activitypub-mincore
ee049076d497ebc1dea15a76c3cf7e58f3272884
"2023-09-26T16:16:49"
activitypub_mincore/schemas/object-schema.json
7
2024-05-27T05:43:06.000597Z
{ "$id": "schema:object", "$schema": "https://json-schema.org/draft/2020-12/schema", "definitions": { "UriOrObject": { "anyOf": [ { "format": "uri", "type": "string" }, { "type": "object" } ] } }, "description": "An Object. Restriction of https://www.w3.org/TR/activitystreams-core/#asobject", "properties": { "id": true, "type": { "type": "string" } }, "required": [ "type" ], "type": "object" }
MIT
en
map3xyz/assets
0c24e7f31769c28c3cf492862c0072fad83c5aa6
"2022-10-25T19:57:07"
schema/assets.schema.json
16
2024-05-27T06:36:59.321451Z
{ "$id": "http://example.com/example.json", "$schema": "https://json-schema.org/draft/2019-09/schema", "default": {}, "examples": [ { "active": true, "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "color": null, "decimals": 6, "description": null, "id": "57f5c072-b121-4536-b181-e7d40a20208f", "links": null, "logo": { "png": "https://raw.githubusercontent.com/map3xyz/ethereum-tokenlist/master/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png" }, "name": "USD Coin", "networkCode": "ethereum", "spam": false, "symbol": "USDC", "tags": [ "stablecoin" ], "type": "asset", "verifications": [], "version": "0.0.1" } ], "properties": { "active": { "default": false, "examples": [ true ], "title": "The active Schema", "type": "boolean" }, "address": { "default": "", "examples": [ "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" ], "title": "The address Schema", "type": "string" }, "color": { "default": null, "examples": [ null, "#FF5733" ], "title": "The color Schema", "type": "null" }, "decimals": { "default": 0, "examples": [ 6 ], "title": "The decimals Schema", "type": "integer" }, "description": { "default": null, "examples": [ null ], "title": "The description Schema", "type": "null" }, "id": { "default": "", "examples": [ "57f5c072-b121-4536-b181-e7d40a20208f" ], "title": "The id Schema", "type": "string" }, "identifiers": { "default": {}, "examples": [ { "coinmarketcap": 1 } ], "properties": { "coinmarketcap": { "default": 0, "examples": [ 1 ], "title": "The unique CoinMarketCap id", "type": "integer" } }, "required": [], "title": "The identifiers Schema", "type": "object" }, "links": { "default": null, "examples": [ null ], "title": "The links Schema", "type": "null" }, "logo": { "default": {}, "examples": [ { "png": "https://raw.githubusercontent.com/map3xyz/ethereum-tokenlist/master/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png" } ], "properties": { "png": { "default": "", "examples": [ "https://raw.githubusercontent.com/map3xyz/ethereum-tokenlist/master/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png" ], "title": "The png Schema", "type": "string" } }, "required": [ "png" ], "title": "The logo Schema", "type": "object" }, "name": { "default": "", "examples": [ "USD Coin" ], "title": "The name Schema", "type": "string" }, "networkCode": { "default": "", "examples": [ "ethereum" ], "title": "The networkCode Schema", "type": "string" }, "spam": { "default": false, "examples": [ false ], "title": "The spam Schema", "type": "boolean" }, "symbol": { "default": "", "examples": [ "USDC" ], "title": "The symbol Schema", "type": "string" }, "tags": { "default": [], "examples": [ [ "stablecoin" ] ], "items": { "default": "", "examples": [ "stablecoin" ], "title": "A Schema", "type": "string" }, "title": "The tags Schema", "type": "array" }, "type": { "default": "", "examples": [ "asset" ], "title": "The type Schema", "type": "string" }, "verifications": { "default": [], "examples": [ [] ], "items": {}, "title": "The verifications Schema", "type": "array" }, "version": { "default": "", "examples": [ "0.0.1" ], "title": "The version Schema", "type": "string" } }, "required": [ "active", "address", "color", "decimals", "description", "id", "links", "logo", "name", "networkCode", "spam", "symbol", "tags", "type", "verifications", "version" ], "title": "Root Schema", "type": "object" }
Apache-2.0
en
map3xyz/assets
68ceda2fcb752918c02df1138cfb6afc1cde28cf
"2022-08-09T12:44:36"
schema/assets.schema.json
16
2024-05-27T06:36:59.321451Z
{ "$id": "http://example.com/example.json", "$schema": "https://json-schema.org/draft/2019-09/schema", "default": {}, "examples": [ { "active": true, "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "color": null, "decimals": 6, "description": null, "id": "57f5c072-b121-4536-b181-e7d40a20208f", "links": null, "logo": { "png": "https://raw.githubusercontent.com/map3xyz/ethereum-tokenlist/master/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png" }, "name": "USD Coin", "networkId": "ethereum", "spam": false, "symbol": "USDC", "tags": [ "stablecoin" ], "type": "asset", "verifications": [], "version": "0.0.1" } ], "properties": { "active": { "default": false, "examples": [ true ], "title": "The active Schema", "type": "boolean" }, "address": { "default": "", "examples": [ "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" ], "title": "The address Schema", "type": "string" }, "color": { "default": null, "examples": [ null, "#FF5733" ], "title": "The color Schema", "type": "null" }, "decimals": { "default": 0, "examples": [ 6 ], "title": "The decimals Schema", "type": "integer" }, "description": { "default": null, "examples": [ null ], "title": "The description Schema", "type": "null" }, "id": { "default": "", "examples": [ "57f5c072-b121-4536-b181-e7d40a20208f" ], "title": "The id Schema", "type": "string" }, "links": { "default": null, "examples": [ null ], "title": "The links Schema", "type": "null" }, "logo": { "default": {}, "examples": [ { "png": "https://raw.githubusercontent.com/map3xyz/ethereum-tokenlist/master/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png" } ], "properties": { "png": { "default": "", "examples": [ "https://raw.githubusercontent.com/map3xyz/ethereum-tokenlist/master/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png" ], "title": "The png Schema", "type": "string" } }, "required": [ "png" ], "title": "The logo Schema", "type": "object" }, "name": { "default": "", "examples": [ "USD Coin" ], "title": "The name Schema", "type": "string" }, "networkId": { "default": "", "examples": [ "ethereum" ], "title": "The networkId Schema", "type": "string" }, "spam": { "default": false, "examples": [ false ], "title": "The spam Schema", "type": "boolean" }, "symbol": { "default": "", "examples": [ "USDC" ], "title": "The symbol Schema", "type": "string" }, "tags": { "default": [], "examples": [ [ "stablecoin" ] ], "items": { "default": "", "examples": [ "stablecoin" ], "title": "A Schema", "type": "string" }, "title": "The tags Schema", "type": "array" }, "type": { "default": "", "examples": [ "asset" ], "title": "The type Schema", "type": "string" }, "verifications": { "default": [], "examples": [ [] ], "items": {}, "title": "The verifications Schema", "type": "array" }, "version": { "default": "", "examples": [ "0.0.1" ], "title": "The version Schema", "type": "string" } }, "required": [ "active", "address", "color", "decimals", "description", "id", "links", "logo", "name", "networkId", "spam", "symbol", "tags", "type", "verifications", "version" ], "title": "Root Schema", "type": "object" }
Apache-2.0
en
map3xyz/assets
0c24e7f31769c28c3cf492862c0072fad83c5aa6
"2022-10-25T19:57:07"
schema/networks.schema.json
16
2024-05-27T06:36:59.321451Z
{ "$id": "http://example.com/example.json", "$schema": "https://json-schema.org/draft/2019-09/schema", "default": {}, "examples": [ { "active": true, "color": "#3c3c3d", "decimals": 18, "description": { "en": "Open source platform to write and distribute decentralized applications." }, "id": "da5eb9b1-7e2b-4976-a260-07a3eab89618", "identifiers": { "bip44": 60, "chainId": 1 }, "links": { "explorer": "https://etherscan.io/", "github": "https://github.com/ethereum", "reddit": "https://reddit.com/r/ethereum", "research": "https://research.binance.com/en/projects/ethereum", "twitter": "https://twitter.com/ethereum", "website": "https://ethereum.org/", "whitepaper": "https://github.com/ethereum/wiki/wiki/White-Paper" }, "logo": { "png": "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.png", "svg": "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.svg" }, "name": "Ethereum", "networkCode": "ethereum", "regex": { "address": "^0x[a-fA-F0-9]{40}$" }, "spam": false, "symbol": "ETH", "tags": [], "type": "network", "verifications": [] } ], "properties": { "active": { "default": false, "examples": [ true ], "title": "The active Schema", "type": "boolean" }, "color": { "default": null, "examples": [ "#3c3c3d" ], "title": "The color Schema", "type": "string" }, "decimals": { "default": 0, "examples": [ 18 ], "title": "The decimals Schema", "type": "integer" }, "description": { "examples": [ { "en": "Open source platform to write and distribute decentralized applications." } ], "properties": {}, "required": [], "title": "The description Schema", "type": "object" }, "id": { "default": "", "examples": [ "da5eb9b1-7e2b-4976-a260-07a3eab89618" ], "title": "The id Schema", "type": "string" }, "identifiers": { "default": {}, "examples": [ { "bip44": 60, "chainId": 1, "coinmarketcap": 1 } ], "properties": { "bip44": { "default": 0, "examples": [ 60 ], "title": "The bip44 Schema", "type": "integer" }, "chainId": { "default": 0, "examples": [ 1 ], "title": "The chainId Schema", "type": "integer" }, "coinmarketcap": { "default": 0, "examples": [ 1 ], "title": "The unique CoinMarketCap id", "type": "integer" } }, "required": [], "title": "The identifiers Schema", "type": "object" }, "links": { "default": {}, "examples": [ { "explorer": "https://etherscan.io/", "github": "https://github.com/ethereum", "reddit": "https://reddit.com/r/ethereum", "research": "https://research.binance.com/en/projects/ethereum", "twitter": "https://twitter.com/ethereum", "website": "https://ethereum.org/", "whitepaper": "https://github.com/ethereum/wiki/wiki/White-Paper" } ], "properties": { "explorer": { "default": "", "examples": [ "https://etherscan.io/" ], "title": "The explorer Schema", "type": "string" }, "github": { "default": "", "examples": [ "https://github.com/ethereum" ], "title": "The github Schema", "type": "string" }, "reddit": { "default": "", "examples": [ "https://reddit.com/r/ethereum" ], "title": "The reddit Schema", "type": "string" }, "research": { "default": "", "examples": [ "https://research.binance.com/en/projects/ethereum" ], "title": "The research Schema", "type": "string" }, "twitter": { "default": "", "examples": [ "https://twitter.com/ethereum" ], "title": "The twitter Schema", "type": "string" }, "website": { "default": "", "examples": [ "https://ethereum.org/" ], "title": "The website Schema", "type": "string" }, "whitepaper": { "default": "", "examples": [ "https://github.com/ethereum/wiki/wiki/White-Paper" ], "title": "The whitepaper Schema", "type": "string" } }, "required": [], "title": "The links Schema", "type": "object" }, "logo": { "default": {}, "examples": [ { "png": "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.png", "svg": "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.svg" } ], "properties": { "png": { "default": "", "examples": [ "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.png" ], "title": "The png Schema", "type": "string" }, "svg": { "default": "", "examples": [ "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.svg" ], "title": "The svg Schema", "type": "string" } }, "required": [], "title": "The logo Schema", "type": "object" }, "name": { "default": "", "examples": [ "Ethereum" ], "title": "The name Schema", "type": "string" }, "networkCode": { "default": "", "examples": [ "ethereum" ], "title": "The networkCode Schema", "type": "string" }, "regex": { "default": {}, "examples": [ { "address": "^0x[a-fA-F0-9]{40}$" } ], "properties": { "address": { "default": "", "examples": [ "^0x[a-fA-F0-9]{40}$" ], "title": "The address Schema", "type": "string" }, "memo": {} }, "required": [], "title": "The regex Schema", "type": "object" }, "spam": { "default": false, "examples": [ false ], "title": "The spam Schema", "type": "boolean" }, "symbol": { "default": "", "examples": [ "ETH" ], "title": "The symbol Schema", "type": "string" }, "tags": { "default": [], "examples": [ [] ], "items": {}, "title": "The tags Schema", "type": "array" }, "type": { "default": "", "examples": [ "network" ], "title": "The type Schema", "type": "string" }, "verifications": { "default": [], "examples": [ [] ], "items": {}, "title": "The verifications Schema", "type": "array" } }, "required": [ "active", "color", "decimals", "description", "id", "identifiers", "links", "logo", "name", "networkCode", "regex", "spam", "symbol", "tags", "type", "verifications" ], "title": "Root Schema", "type": "object" }
Apache-2.0
en
map3xyz/assets
68ceda2fcb752918c02df1138cfb6afc1cde28cf
"2022-08-09T12:44:36"
schema/networks.schema.json
16
2024-05-27T06:36:59.321451Z
{ "$id": "http://example.com/example.json", "$schema": "https://json-schema.org/draft/2019-09/schema", "default": {}, "examples": [ { "active": true, "color": "#3c3c3d", "decimals": 18, "description": { "en": "Open source platform to write and distribute decentralized applications." }, "id": "da5eb9b1-7e2b-4976-a260-07a3eab89618", "identifiers": { "bip44": 60, "chainId": 1 }, "links": { "explorer": "https://etherscan.io/", "github": "https://github.com/ethereum", "reddit": "https://reddit.com/r/ethereum", "research": "https://research.binance.com/en/projects/ethereum", "twitter": "https://twitter.com/ethereum", "website": "https://ethereum.org/", "whitepaper": "https://github.com/ethereum/wiki/wiki/White-Paper" }, "logo": { "png": "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.png", "svg": "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.svg" }, "name": "Ethereum", "networkId": "ethereum", "regex": { "address": "^0x[a-fA-F0-9]{40}$" }, "spam": false, "symbol": "ETH", "tags": [], "type": "network", "verifications": [] } ], "properties": { "active": { "default": false, "examples": [ true ], "title": "The active Schema", "type": "boolean" }, "color": { "default": null, "examples": [ "#3c3c3d" ], "title": "The color Schema", "type": "string" }, "decimals": { "default": 0, "examples": [ 18 ], "title": "The decimals Schema", "type": "integer" }, "description": { "examples": [ { "en": "Open source platform to write and distribute decentralized applications." } ], "properties": {}, "required": [], "title": "The description Schema", "type": "object" }, "id": { "default": "", "examples": [ "da5eb9b1-7e2b-4976-a260-07a3eab89618" ], "title": "The id Schema", "type": "string" }, "identifiers": { "default": {}, "examples": [ { "bip44": 60, "chainId": 1 } ], "properties": { "bip44": { "default": 0, "examples": [ 60 ], "title": "The bip44 Schema", "type": "integer" }, "chainId": { "default": 0, "examples": [ 1 ], "title": "The chainId Schema", "type": "integer" } }, "required": [], "title": "The identifiers Schema", "type": "object" }, "links": { "default": {}, "examples": [ { "explorer": "https://etherscan.io/", "github": "https://github.com/ethereum", "reddit": "https://reddit.com/r/ethereum", "research": "https://research.binance.com/en/projects/ethereum", "twitter": "https://twitter.com/ethereum", "website": "https://ethereum.org/", "whitepaper": "https://github.com/ethereum/wiki/wiki/White-Paper" } ], "properties": { "explorer": { "default": "", "examples": [ "https://etherscan.io/" ], "title": "The explorer Schema", "type": "string" }, "github": { "default": "", "examples": [ "https://github.com/ethereum" ], "title": "The github Schema", "type": "string" }, "reddit": { "default": "", "examples": [ "https://reddit.com/r/ethereum" ], "title": "The reddit Schema", "type": "string" }, "research": { "default": "", "examples": [ "https://research.binance.com/en/projects/ethereum" ], "title": "The research Schema", "type": "string" }, "twitter": { "default": "", "examples": [ "https://twitter.com/ethereum" ], "title": "The twitter Schema", "type": "string" }, "website": { "default": "", "examples": [ "https://ethereum.org/" ], "title": "The website Schema", "type": "string" }, "whitepaper": { "default": "", "examples": [ "https://github.com/ethereum/wiki/wiki/White-Paper" ], "title": "The whitepaper Schema", "type": "string" } }, "required": [], "title": "The links Schema", "type": "object" }, "logo": { "default": {}, "examples": [ { "png": "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.png", "svg": "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.svg" } ], "properties": { "png": { "default": "", "examples": [ "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.png" ], "title": "The png Schema", "type": "string" }, "svg": { "default": "", "examples": [ "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.svg" ], "title": "The svg Schema", "type": "string" } }, "required": [], "title": "The logo Schema", "type": "object" }, "name": { "default": "", "examples": [ "Ethereum" ], "title": "The name Schema", "type": "string" }, "networkId": { "default": "", "examples": [ "ethereum" ], "title": "The networkId Schema", "type": "string" }, "regex": { "default": {}, "examples": [ { "address": "^0x[a-fA-F0-9]{40}$" } ], "properties": { "address": { "default": "", "examples": [ "^0x[a-fA-F0-9]{40}$" ], "title": "The address Schema", "type": "string" }, "memo": {} }, "required": [], "title": "The regex Schema", "type": "object" }, "spam": { "default": false, "examples": [ false ], "title": "The spam Schema", "type": "boolean" }, "symbol": { "default": "", "examples": [ "ETH" ], "title": "The symbol Schema", "type": "string" }, "tags": { "default": [], "examples": [ [] ], "items": {}, "title": "The tags Schema", "type": "array" }, "type": { "default": "", "examples": [ "network" ], "title": "The type Schema", "type": "string" }, "verifications": { "default": [], "examples": [ [] ], "items": {}, "title": "The verifications Schema", "type": "array" } }, "required": [ "active", "color", "decimals", "description", "id", "identifiers", "links", "logo", "name", "networkId", "regex", "spam", "symbol", "tags", "type", "verifications" ], "title": "Root Schema", "type": "object" }
Apache-2.0
en
map3xyz/assets
e699cefc50485c4dd62fdfef673b5a6c1b8f0ba0
"2022-08-16T15:33:03"
schema/networks.schema.json
16
2024-05-27T06:36:59.321451Z
{ "$id": "http://example.com/example.json", "$schema": "https://json-schema.org/draft/2019-09/schema", "default": {}, "examples": [ { "active": true, "color": "#3c3c3d", "decimals": 18, "description": { "en": "Open source platform to write and distribute decentralized applications." }, "id": "da5eb9b1-7e2b-4976-a260-07a3eab89618", "identifiers": { "bip44": 60, "chainId": 1 }, "links": { "explorer": "https://etherscan.io/", "github": "https://github.com/ethereum", "reddit": "https://reddit.com/r/ethereum", "research": "https://research.binance.com/en/projects/ethereum", "twitter": "https://twitter.com/ethereum", "website": "https://ethereum.org/", "whitepaper": "https://github.com/ethereum/wiki/wiki/White-Paper" }, "logo": { "png": "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.png", "svg": "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.svg" }, "name": "Ethereum", "networkCode": "ethereum", "regex": { "address": "^0x[a-fA-F0-9]{40}$" }, "spam": false, "symbol": "ETH", "tags": [], "type": "network", "verifications": [] } ], "properties": { "active": { "default": false, "examples": [ true ], "title": "The active Schema", "type": "boolean" }, "color": { "default": null, "examples": [ "#3c3c3d" ], "title": "The color Schema", "type": "string" }, "decimals": { "default": 0, "examples": [ 18 ], "title": "The decimals Schema", "type": "integer" }, "description": { "examples": [ { "en": "Open source platform to write and distribute decentralized applications." } ], "properties": {}, "required": [], "title": "The description Schema", "type": "object" }, "id": { "default": "", "examples": [ "da5eb9b1-7e2b-4976-a260-07a3eab89618" ], "title": "The id Schema", "type": "string" }, "identifiers": { "default": {}, "examples": [ { "bip44": 60, "chainId": 1 } ], "properties": { "bip44": { "default": 0, "examples": [ 60 ], "title": "The bip44 Schema", "type": "integer" }, "chainId": { "default": 0, "examples": [ 1 ], "title": "The chainId Schema", "type": "integer" } }, "required": [], "title": "The identifiers Schema", "type": "object" }, "links": { "default": {}, "examples": [ { "explorer": "https://etherscan.io/", "github": "https://github.com/ethereum", "reddit": "https://reddit.com/r/ethereum", "research": "https://research.binance.com/en/projects/ethereum", "twitter": "https://twitter.com/ethereum", "website": "https://ethereum.org/", "whitepaper": "https://github.com/ethereum/wiki/wiki/White-Paper" } ], "properties": { "explorer": { "default": "", "examples": [ "https://etherscan.io/" ], "title": "The explorer Schema", "type": "string" }, "github": { "default": "", "examples": [ "https://github.com/ethereum" ], "title": "The github Schema", "type": "string" }, "reddit": { "default": "", "examples": [ "https://reddit.com/r/ethereum" ], "title": "The reddit Schema", "type": "string" }, "research": { "default": "", "examples": [ "https://research.binance.com/en/projects/ethereum" ], "title": "The research Schema", "type": "string" }, "twitter": { "default": "", "examples": [ "https://twitter.com/ethereum" ], "title": "The twitter Schema", "type": "string" }, "website": { "default": "", "examples": [ "https://ethereum.org/" ], "title": "The website Schema", "type": "string" }, "whitepaper": { "default": "", "examples": [ "https://github.com/ethereum/wiki/wiki/White-Paper" ], "title": "The whitepaper Schema", "type": "string" } }, "required": [], "title": "The links Schema", "type": "object" }, "logo": { "default": {}, "examples": [ { "png": "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.png", "svg": "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.svg" } ], "properties": { "png": { "default": "", "examples": [ "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.png" ], "title": "The png Schema", "type": "string" }, "svg": { "default": "", "examples": [ "https://raw.githubusercontent.com/map3xyz/assets/master/networks/ethereum/logo.svg" ], "title": "The svg Schema", "type": "string" } }, "required": [], "title": "The logo Schema", "type": "object" }, "name": { "default": "", "examples": [ "Ethereum" ], "title": "The name Schema", "type": "string" }, "networkCode": { "default": "", "examples": [ "ethereum" ], "title": "The networkCode Schema", "type": "string" }, "regex": { "default": {}, "examples": [ { "address": "^0x[a-fA-F0-9]{40}$" } ], "properties": { "address": { "default": "", "examples": [ "^0x[a-fA-F0-9]{40}$" ], "title": "The address Schema", "type": "string" }, "memo": {} }, "required": [], "title": "The regex Schema", "type": "object" }, "spam": { "default": false, "examples": [ false ], "title": "The spam Schema", "type": "boolean" }, "symbol": { "default": "", "examples": [ "ETH" ], "title": "The symbol Schema", "type": "string" }, "tags": { "default": [], "examples": [ [] ], "items": {}, "title": "The tags Schema", "type": "array" }, "type": { "default": "", "examples": [ "network" ], "title": "The type Schema", "type": "string" }, "verifications": { "default": [], "examples": [ [] ], "items": {}, "title": "The verifications Schema", "type": "array" } }, "required": [ "active", "color", "decimals", "description", "id", "identifiers", "links", "logo", "name", "networkCode", "regex", "spam", "symbol", "tags", "type", "verifications" ], "title": "Root Schema", "type": "object" }
Apache-2.0
en
map3xyz/assets
e699cefc50485c4dd62fdfef673b5a6c1b8f0ba0
"2022-08-16T15:33:03"
schema/assets.schema.json
16
2024-05-27T06:36:59.321451Z
{ "$id": "http://example.com/example.json", "$schema": "https://json-schema.org/draft/2019-09/schema", "default": {}, "examples": [ { "active": true, "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "color": null, "decimals": 6, "description": null, "id": "57f5c072-b121-4536-b181-e7d40a20208f", "links": null, "logo": { "png": "https://raw.githubusercontent.com/map3xyz/ethereum-tokenlist/master/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png" }, "name": "USD Coin", "networkCode": "ethereum", "spam": false, "symbol": "USDC", "tags": [ "stablecoin" ], "type": "asset", "verifications": [], "version": "0.0.1" } ], "properties": { "active": { "default": false, "examples": [ true ], "title": "The active Schema", "type": "boolean" }, "address": { "default": "", "examples": [ "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" ], "title": "The address Schema", "type": "string" }, "color": { "default": null, "examples": [ null, "#FF5733" ], "title": "The color Schema", "type": "null" }, "decimals": { "default": 0, "examples": [ 6 ], "title": "The decimals Schema", "type": "integer" }, "description": { "default": null, "examples": [ null ], "title": "The description Schema", "type": "null" }, "id": { "default": "", "examples": [ "57f5c072-b121-4536-b181-e7d40a20208f" ], "title": "The id Schema", "type": "string" }, "links": { "default": null, "examples": [ null ], "title": "The links Schema", "type": "null" }, "logo": { "default": {}, "examples": [ { "png": "https://raw.githubusercontent.com/map3xyz/ethereum-tokenlist/master/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png" } ], "properties": { "png": { "default": "", "examples": [ "https://raw.githubusercontent.com/map3xyz/ethereum-tokenlist/master/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png" ], "title": "The png Schema", "type": "string" } }, "required": [ "png" ], "title": "The logo Schema", "type": "object" }, "name": { "default": "", "examples": [ "USD Coin" ], "title": "The name Schema", "type": "string" }, "networkCode": { "default": "", "examples": [ "ethereum" ], "title": "The networkCode Schema", "type": "string" }, "spam": { "default": false, "examples": [ false ], "title": "The spam Schema", "type": "boolean" }, "symbol": { "default": "", "examples": [ "USDC" ], "title": "The symbol Schema", "type": "string" }, "tags": { "default": [], "examples": [ [ "stablecoin" ] ], "items": { "default": "", "examples": [ "stablecoin" ], "title": "A Schema", "type": "string" }, "title": "The tags Schema", "type": "array" }, "type": { "default": "", "examples": [ "asset" ], "title": "The type Schema", "type": "string" }, "verifications": { "default": [], "examples": [ [] ], "items": {}, "title": "The verifications Schema", "type": "array" }, "version": { "default": "", "examples": [ "0.0.1" ], "title": "The version Schema", "type": "string" } }, "required": [ "active", "address", "color", "decimals", "description", "id", "links", "logo", "name", "networkCode", "spam", "symbol", "tags", "type", "verifications", "version" ], "title": "Root Schema", "type": "object" }
Apache-2.0
en
appliedengdesign/cnccodes-json-schema
411e7954789e9519f5d441f0ad99badd926ffc5c
"2022-06-15T22:44:00"
src/schema/cnccodes.schema.json
5
2024-05-28T01:43:26.291082Z
{ "$defs": { "parameters": { "description": "An array of possible parameters to the code", "patternProperties": { "^[A-Z]{1}": { "properties": { "desc": { "description": "A description of the parameter", "type": "string" }, "optional": { "description": "Parameter is required (boolean)", "type": "boolean" } }, "type": "object" } }, "type": "object" } }, "$id": "https://appliedengdesign.github.io/cnccodes-json-schema/draft/2021-12/schema", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "JSON Schema for CNC G & M Codes", "properties": { "$schema": { "description": "Link to this schema", "type": "string" }, "codes": { "description": "Individual G-Codes", "patternProperties": { "^G|^M": { "additionalProperties": false, "properties": { "category": { "description": "Category for the code", "enum": [ "motion", "coordinate", "compensation", "canned", "other", "mcode" ], "type": "string" }, "desc": { "description": "A longer description with markdown formatting", "type": "string" }, "modal": { "description": "Modal / Non-Modal (boolean)", "type": "boolean" }, "parameters": { "$ref": "#/$defs/parameters" }, "shortDesc": { "description": "A short description of the code", "type": "string" } }, "required": [ "category", "shortDesc" ], "type": "object" }, "additionalProperties": false }, "type": "object" }, "machineType": { "description": "The type of CNC machine", "enum": [ "edm", "mill", "lathe", "laser", "printer", "swiss" ], "type": "string" }, "title": { "description": "Descriptive title of the JSON", "type": "string" }, "type": { "description": "The type of code (G or M)", "enum": [ "gcode", "mcode" ], "type": "string" } }, "required": [ "type", "machineType", "title" ], "title": "G/M Code Dictionary", "type": "object" }
MIT
en
appliedengdesign/cnccodes-json-schema
0f1b71a165b569a80d7563c15d9a307778f78925
"2021-03-17T01:07:19"
src/schema/cnccodes.schema.json
5
2024-05-28T01:43:26.291082Z
{ "$defs": { "parameters": { "description": "An array of possible parameters to the code", "patternProperties": { "^[A-Z]{1}": { "properties": { "desc": { "description": "A description of the parameter", "type": "string" }, "optional": { "description": "Parameter is required (boolean)", "type": "boolean" } }, "type": "object" } }, "type": "object" } }, "$id": "https://appliedengdesign.github.io/cnccodes-json-schema/draft/2021-03/schema", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "JSON Schema for CNC G & M Codes", "properties": { "$schema": { "description": "Link to this schema", "type": "string" }, "codes": { "description": "Individual G-Codes", "patternProperties": { "^G|^M": { "additionalProperties": false, "properties": { "category": { "description": "Category for the code", "enum": [ "motion", "coordinate", "compensation", "canned", "other" ], "type": "string" }, "desc": { "description": "A longer description with markdown formatting", "type": "string" }, "modal": { "description": "Modal / Non-Modal (boolean)", "type": "boolean" }, "parameters": { "$ref": "#/$defs/parameters" }, "shortDesc": { "description": "A short description of the code", "type": "string" } }, "required": [ "category", "modal" ], "type": "object" }, "additionalProperties": false }, "type": "object" }, "machineType": { "description": "The type of CNC machine", "enum": [ "mill", "lathe", "3dprinter" ], "type": "string" }, "title": { "description": "Descriptive title of the JSON", "type": "string" }, "type": { "description": "The type of code (G or M)", "enum": [ "gcode", "mcode" ], "type": "string" } }, "required": [ "type", "machineType", "title" ], "title": "G/M Code Dictionary", "type": "object" }
MIT
en
appliedengdesign/cnccodes-json-schema
3f5a9e9a629cd14f5da351a4c5619c89b25fc543
"2021-12-04T03:01:02"
src/schema/cnccodes.schema.json
5
2024-05-28T01:43:26.291082Z
{ "$defs": { "parameters": { "description": "An array of possible parameters to the code", "patternProperties": { "^[A-Z]{1}": { "properties": { "desc": { "description": "A description of the parameter", "type": "string" }, "optional": { "description": "Parameter is required (boolean)", "type": "boolean" } }, "type": "object" } }, "type": "object" } }, "$id": "https://appliedengdesign.github.io/cnccodes-json-schema/draft/2021-03/schema", "$schema": "http://json-schema.org/schema", "additionalProperties": false, "description": "JSON Schema for CNC G & M Codes", "properties": { "$schema": { "description": "Link to this schema", "type": "string" }, "codes": { "description": "Individual G-Codes", "patternProperties": { "^G|^M": { "additionalProperties": false, "properties": { "category": { "description": "Category for the code", "enum": [ "motion", "coordinate", "compensation", "canned", "other", "mcode" ], "type": "string" }, "desc": { "description": "A longer description with markdown formatting", "type": "string" }, "modal": { "description": "Modal / Non-Modal (boolean)", "type": "boolean" }, "parameters": { "$ref": "#/$defs/parameters" }, "shortDesc": { "description": "A short description of the code", "type": "string" } }, "required": [ "category", "shortDesc" ], "type": "object" }, "additionalProperties": false }, "type": "object" }, "machineType": { "description": "The type of CNC machine", "enum": [ "edm", "mill", "lathe", "laser", "printer", "swiss" ], "type": "string" }, "title": { "description": "Descriptive title of the JSON", "type": "string" }, "type": { "description": "The type of code (G or M)", "enum": [ "gcode", "mcode" ], "type": "string" } }, "required": [ "type", "machineType", "title" ], "title": "G/M Code Dictionary", "type": "object" }
MIT
en
appliedengdesign/cnccodes-json-schema
a8b7657aec9fd7fa6b3393167940f44762eac6ea
"2022-06-16T22:19:41"
src/schema/cnccodes.schema.json
5
2024-05-28T01:43:26.291082Z
{ "$defs": { "parameters": { "description": "An array of possible parameters to the code", "patternProperties": { "^[A-Z]{1}": { "additionalProperties": false, "properties": { "desc": { "description": "A description of the parameter", "minLength": 3, "type": "string" }, "optional": { "description": "Parameter is required (boolean)", "type": "boolean" }, "shortDesc": { "description": "A short description of the parameter", "minLength": 3, "type": "string" } }, "required": [ "shortDesc", "optional" ], "type": "object" } }, "type": "object" } }, "$id": "https://appliedengdesign.github.io/cnccodes-json-schema/draft/2022-06/schema", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "JSON Schema for CNC G & M Codes", "properties": { "$schema": { "description": "Link to this schema", "type": "string" }, "codes": { "description": "Individual G/M Codes", "patternProperties": { "^G|^M": { "additionalProperties": false, "properties": { "category": { "description": "Category for the code", "enum": [ "motion", "coordinate", "compensation", "canned", "other", "mcode" ], "type": "string" }, "desc": { "description": "A longer description with markdown formatting", "minLength": 3, "type": "string" }, "modal": { "description": "Modal / Non-Modal (boolean)", "type": "boolean" }, "parameters": { "$ref": "#/$defs/parameters" }, "shortDesc": { "description": "A short description of the code", "minLength": 3, "type": "string" } }, "required": [ "category", "shortDesc" ], "type": "object" }, "additionalProperties": false }, "type": "object" }, "machineType": { "description": "The type of CNC machine", "enum": [ "edm", "mill", "lathe", "laser", "printer", "swiss" ], "type": "string" }, "title": { "description": "Descriptive title of the JSON", "type": "string" }, "type": { "description": "The type of code (G or M)", "enum": [ "gcode", "mcode" ], "type": "string" }, "variant": { "description": "Defined if G/M Codes are for specific MTB/3DP Variant. (Must be lower case, 3-8 characters)", "maxLength": 8, "minLength": 3, "pattern": "[A-Za-z0-9]", "type": "string" } }, "required": [ "type", "machineType", "title" ], "title": "G/M Code Dictionary", "type": "object" }
MIT
en