feat(oauth2): provider.toml config file with template

This commit is contained in:
Maieul BOYER 2025-10-25 15:47:42 +02:00 committed by Maix0
parent bc7a615dcf
commit 7557a7aa76
3 changed files with 208 additions and 0 deletions

View file

@ -0,0 +1,186 @@
{
"type": "object",
"properties": {
"providers": {
"type": "object",
"patternProperties": {
"^(.*)$": {
"anyOf": [
{
"type": "object",
"properties": {
"token_url": {
"type": "string"
},
"auth_url": {
"type": "string"
},
"info_url": {
"type": "string"
},
"client_id": {
"type": "string"
},
"client_secret": {
"anyOf": [
{
"type": "object",
"properties": {
"env": {
"description": "Secret is stored in the env var",
"type": "string"
}
},
"required": [
"env"
]
},
{
"type": "object",
"properties": {
"inline": {
"description": "Secret is inline here",
"type": "string"
}
},
"required": [
"inline"
]
}
]
},
"scopes": {
"type": "array",
"items": {
"type": "string"
}
},
"redirect_url": {
"type": "string"
},
"user": {
"default": {
"unique_id": "email",
"name": "name"
},
"type": "object",
"properties": {
"unique_id": {
"description": "A unique identifier for this provider",
"default": "email",
"type": "string"
},
"name": {
"description": "A name for this provider",
"default": "name",
"type": "string"
}
},
"required": [
"unique_id",
"name"
]
}
},
"required": [
"token_url",
"auth_url",
"info_url",
"client_id",
"client_secret",
"scopes",
"redirect_url",
"user"
]
},
{
"type": "object",
"properties": {
"openid_url": {
"type": "string"
},
"client_id": {
"type": "string"
},
"client_secret": {
"anyOf": [
{
"type": "object",
"properties": {
"env": {
"description": "Secret is stored in the env var",
"type": "string"
}
},
"required": [
"env"
]
},
{
"type": "object",
"properties": {
"inline": {
"description": "Secret is inline here",
"type": "string"
}
},
"required": [
"inline"
]
}
]
},
"scopes": {
"type": "array",
"items": {
"type": "string"
}
},
"redirect_url": {
"type": "string"
},
"user": {
"default": {
"unique_id": "email",
"name": "name"
},
"type": "object",
"properties": {
"unique_id": {
"description": "A unique identifier for this provider",
"default": "email",
"type": "string"
},
"name": {
"description": "A name for this provider",
"default": "name",
"type": "string"
}
},
"required": [
"unique_id",
"name"
]
}
},
"required": [
"openid_url",
"client_id",
"client_secret",
"scopes",
"redirect_url",
"user"
]
}
]
}
}
},
"$schema": {
"type": "string"
}
},
"required": [
"providers"
]
}