UNPKG

@unito/integration-cli

Version:

Integration CLI

210 lines (209 loc) 7.14 kB
{ "$id": "https://unito.io/integration_cli/authorization.schema.json", "title": "Authorization", "type": "object", "description": "An authorization is a way to obtain and generate credentials for an integration", "additionalProperties": false, "required": ["name", "method"], "properties": { "name": { "type": "string" }, "development": { "type": "boolean", "description": "Whether the authorization is used locally for development purposes only" }, "instructionsImage": { "description": "The Base64-encoded data URL of an <img> src content or null. For example: 'data:image/png;base64,<base64>'", "anyOf": [{ "type": "null" }, { "type": "string" }] }, "instructionsMarkdown": { "description": "A string representing a markdown document or null", "anyOf": [{ "type": "null" }, { "type": "string" }] }, "method": { "type": "string", "description": "The method of authorization", "enum": ["custom", "oauth2"], "tsEnumNames": ["CUSTOM", "OAUTH2"] }, "oauth2": { "$ref": "#/$defs/oauth2" }, "variables": { "type": "object", "description": "Variables to obtain credentials from an end-user", "additionalProperties": false, "patternProperties": { "^(?!refreshToken$)(?!accessToken$)(?!scope$)(?!expiresIn$)(?!tokenType$)(?!oauth2ExtraParameters$).*$": { "type": "object", "additionalProperties": false, "required": ["type"], "properties": { "type": { "type": "string", "enum": ["boolean", "number", "password", "string", "text"], "tsEnumNames": ["BOOLEAN", "NUMBER", "PASSWORD", "STRING", "TEXT"] }, "format": { "type": "string", "description": "The JSON Schema format that the value of the variable must comply to", "enum": ["email", "uri"], "tsEnumNames": ["EMAIL", "URI"] }, "pattern": { "description": "The JSON Schema regular expression template for the string value. Only the values that match this template will be accepted. The regular expression syntax used is from JavaScript (more specifically, ECMA 262)", "type": "string" }, "label": { "type": "string" }, "required": { "type": "boolean" }, "defaultValue": { "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean" } ] }, "placeholder": { "type": "string" }, "help": { "type": "string" }, "documentationUrl": { "type": "string", "format": "uri" } } } } } }, "$defs": { "authorizationResponseContentType": { "type": "string", "description": "The content type of exchanged information with the provider", "enum": ["application/x-www-form-urlencoded", "application/json"], "tsEnumNames": ["URL_ENCODED", "JSON"] }, "authorizationRequestParameters": { "type": "object", "description": "The extra information used to communicate with the provider", "additionalProperties": false, "properties": { "header": { "type": "object", "description": "Extra information to include in the HTTP request headers", "additionalProperties": { "oneOf": [ { "description": "A string", "type": "string" }, { "description": "A number", "type": "number" }, { "description": "A boolean", "type": "boolean" } ] } }, "body": { "type": "object", "description": "Extra information to include in the HTTP request body", "additionalProperties": { "oneOf": [ { "description": "A string", "type": "string" }, { "description": "A number", "type": "number" }, { "description": "A boolean", "type": "boolean" } ] } } } }, "oauth2": { "type": "object", "description": "Parameters to obtain OAuth 2 credentials from an end-user", "additionalProperties": false, "required": ["tokenUrl", "scopes"], "properties": { "clientSecret": { "type": "string", "description": "The Client Secret obtained from the provider." }, "clientId": { "type": "string", "description": "The Client Id obtained from the provider." }, "authorizationUrl": { "type": "string", "description": "The URL to grant or deny access to the user account.", "format": "uri-template" }, "tokenUrl": { "type": "string", "description": "The URL to obtain or refresh an access token.", "format": "uri-template" }, "legacyRedirectUrl": { "type": "string", "description": "The legacy redirect callback URL used for specific connectors where an existing app definition with a predefined redirect URL must be reused.", "format": "uri-template" }, "grantType": { "type": "string", "description": "The type of grant of the OAuth 2 authorization.", "enum": ["authorization_code", "password", "client_credentials", "urn:ietf:params:oauth:grant-type:jwt-bearer"], "tsEnumNames": ["AUTHORIZATION_CODE", "PASSWORD", "CLIENT_CREDENTIALS", "JWT_BEARER"] }, "scopes": { "type": "array", "items": { "type": "object", "description": "The requested scope of access to the user account.", "additionalProperties": false, "required": ["name"], "properties": { "name": { "type": "string", "description": "The name of the scope" }, "help": { "type": "string", "description": "Message to the end-user to explain the usage of the scope by Unito" } } } }, "tokenRequestParameters": { "$ref": "#/$defs/authorizationRequestParameters" }, "refreshRequestParameters": { "$ref": "#/$defs/authorizationRequestParameters" }, "requestContentType": { "$ref": "#/$defs/authorizationResponseContentType" }, "responseContentType": { "$ref": "#/$defs/authorizationResponseContentType" } } } } }