clarifications
This commit is contained in:
parent
f6032829cd
commit
d6702165b8
1 changed files with 15 additions and 15 deletions
|
@ -169,12 +169,12 @@ class JWTConfig(BaseModel):
|
|||
return username
|
||||
|
||||
|
||||
class ToggleString(BaseModel):
|
||||
class LockableString(BaseModel):
|
||||
value: str
|
||||
allow: bool
|
||||
locked: bool
|
||||
|
||||
|
||||
class ToggleCountry(ToggleString):
|
||||
class LockableCountry(LockableString):
|
||||
value: constr(max_length=2)
|
||||
|
||||
|
||||
|
@ -183,11 +183,11 @@ class DNParts(BaseModel):
|
|||
This server's "distinguished name"
|
||||
"""
|
||||
|
||||
country: ToggleCountry
|
||||
state: ToggleString
|
||||
city: ToggleString
|
||||
organization: ToggleString
|
||||
organizational_unit: ToggleString
|
||||
country: LockableCountry
|
||||
state: LockableString
|
||||
city: LockableString
|
||||
organization: LockableString
|
||||
organizational_unit: LockableString
|
||||
|
||||
|
||||
class CertificateAlgo(Enum):
|
||||
|
@ -200,15 +200,13 @@ class CertificateAlgo(Enum):
|
|||
|
||||
class CryptoConfig(BaseModel):
|
||||
"""
|
||||
Configuration for hash algorithms
|
||||
Configuration for cryptography
|
||||
"""
|
||||
|
||||
# password hash algorithms
|
||||
schemes: list[str] = ["bcrypt"]
|
||||
|
||||
force_cipher: ToggleString
|
||||
force_tls_cipher: ToggleString
|
||||
force_auth: ToggleString
|
||||
|
||||
# pki settings
|
||||
cert_algo: CertificateAlgo
|
||||
expiry_days: int
|
||||
|
||||
|
@ -225,13 +223,15 @@ class Config(BaseModel):
|
|||
Configuration for `kiwi-vpn-api`
|
||||
"""
|
||||
|
||||
# common name for the server
|
||||
server_name: str
|
||||
server_extra_config: dict[str, Any]
|
||||
# may include client-to-client, cipher etc.
|
||||
openvpn_extra_options: dict[str, Any]
|
||||
|
||||
db: DBConfig
|
||||
jwt: JWTConfig
|
||||
crypto: CryptoConfig
|
||||
dnparts: DNParts
|
||||
default_dn: DNParts
|
||||
|
||||
__singleton: Config | None = None
|
||||
|
||||
|
|
Loading…
Reference in a new issue