Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Config Schema #301

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 171 additions & 1 deletion nautobot_chatops/app-config-schema.json
Original file line number Diff line number Diff line change
@@ -1 +1,171 @@
true
{
"type": "object",
"properties": {
"enable_slack": {
"type": "boolean",
"default": false
},
"enable_ms_teams": {
"type": "boolean",
"default": false
},
"enable_mattermost": {
"type": "boolean",
"default": false
},
"enable_webex": {
"type": "boolean",
"default": false
},
"slack_api_token": {
"$ref": "#/definitions/secret"
},
"slack_signing_secret": {
"$ref": "#/definitions/secret"
},
"microsoft_app_id": {
"type": "string"
},
"microsoft_app_password": {
"$ref": "#/definitions/secret"
},
"microsoft_tenant_id": {
"$ref": "#/definitions/secret"
},
"mattermost_api_token": {
"$ref": "#/definitions/secret"
},
"mattermost_url": {
"type": "string"
},
"webex_token": {
"$ref": "#/definitions/secret"
},
"webex_signing_secret": {
"$ref": "#/definitions/secret"
},
"webex_msg_char_limit": {
"type": "integer",
"default": 7439
},
"primary": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
}
}
},
"default": [
{
"name": "enable_slack",
"label": "Enable Slack"
},
{
"name": "enable_ms_teams",
"label": "Enable MsTeams"
},
{
"name": "enable_mattermost",
"label": "Enable Mattermost"
},
{
"name": "enable_webex",
"label": "Enable Webex"
},
{
"name": "slack_api_token",
"label": "Slack API Token"
},
{
"name": "slack_signing_secret",
"label": "Slack Signing Secret"
},
{
"name": "microsoft_app_id",
"label": "Microsoft App Id"
},
{
"name": "microsoft_app_password",
"label": "Microsoft App Password"
},
{
"name": "microsoft_tenant_id",
"label": "Microsoft Tenant Id"
},
{
"name": "mattermost_api_token",
"label": "Mattermost API Token"
},
{
"name": "mattermost_url",
"label": "Mattermost Url"
},
{
"name": "webex_token",
"label": "Webex Token"
},
{
"name": "webex_signing_secret",
"label": "Webex Signing Secret"
},
{
"name": "webex_msg_char_limit",
"label": "Webex Message Character Limit"
}
]
}
},
"allOf": [
{
"if": {
"properties": {
"enable_slack": { "const": true }
},
"required": ["enable_slack"]
},
"then": {
"required": ["slack_api_token", "slack_signing_secret"]
}
},
{
"if": {
"properties": {
"enable_ms_teams": { "const": true }
},
"required": ["enable_ms_teams"]
},
"then": {
"required": ["microsoft_app_id", "microsoft_app_password", "microsoft_tenant_id"]
}
},
{
"if": {
"properties": {
"enable_mattermost": { "const": true }
},
"required": ["enable_mattermost"]
},
"then": {
"required": ["mattermost_api_token", "mattermost_url"]
}
},
{
"if": {
"properties": {
"enable_webex": { "const": true }
},
"required": ["enable_webex"]
},
"then": {
"required": ["webex_token", "webex_signing_secret"]
}
}
],
"additionalProperties": false
}
Loading