Add resource provider settings
This commit is contained in:
parent
572d2a7b0d
commit
7ab715da5a
1 changed files with 3 additions and 2 deletions
|
@ -4,7 +4,7 @@ import random
|
||||||
from typing import Type, Tuple
|
from typing import Type, Tuple
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from pydantic import BaseModel, computed_field
|
from pydantic import BaseModel, computed_field, AnyUrl
|
||||||
from pydantic_settings import (
|
from pydantic_settings import (
|
||||||
BaseSettings,
|
BaseSettings,
|
||||||
SettingsConfigDict,
|
SettingsConfigDict,
|
||||||
|
@ -18,7 +18,6 @@ class Resource(BaseModel):
|
||||||
|
|
||||||
id: str
|
id: str
|
||||||
name: str
|
name: str
|
||||||
url: str
|
|
||||||
|
|
||||||
|
|
||||||
class OIDCProvider(BaseModel):
|
class OIDCProvider(BaseModel):
|
||||||
|
@ -48,6 +47,7 @@ class OIDCProvider(BaseModel):
|
||||||
class ResourceProvider(BaseModel):
|
class ResourceProvider(BaseModel):
|
||||||
id: str
|
id: str
|
||||||
name: str
|
name: str
|
||||||
|
base_url: AnyUrl
|
||||||
resources: list[Resource] = []
|
resources: list[Resource] = []
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ class Settings(BaseSettings):
|
||||||
"""Settings wil be read from an .env file"""
|
"""Settings wil be read from an .env file"""
|
||||||
|
|
||||||
oidc: OIDCSettings = OIDCSettings()
|
oidc: OIDCSettings = OIDCSettings()
|
||||||
|
resource_providers: list[ResourceProvider] = []
|
||||||
secret_key: str = "".join(random.choice(string.ascii_letters) for _ in range(16))
|
secret_key: str = "".join(random.choice(string.ascii_letters) for _ in range(16))
|
||||||
log: bool = False
|
log: bool = False
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue