Skip to content

Commit 3ca4c28

Browse files
authored
Merge pull request lightspeed-core#834 from tisnik/lcore-973-decriptions-for-tls-configuration
LCORE-973: descriptions for TLS configuration
2 parents 1cdb5a1 + 5e13497 commit 3ca4c28

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

src/models/config.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,23 @@ class ConfigurationBase(BaseModel):
3838
class TLSConfiguration(ConfigurationBase):
3939
"""TLS configuration."""
4040

41-
tls_certificate_path: Optional[FilePath] = None
42-
tls_key_path: Optional[FilePath] = None
43-
tls_key_password: Optional[FilePath] = None
41+
tls_certificate_path: Optional[FilePath] = Field(
42+
None,
43+
title="TLS certificate path",
44+
description="SSL/TLS certificate file path for HTTPS support.",
45+
)
46+
47+
tls_key_path: Optional[FilePath] = Field(
48+
None,
49+
title="TLS key path",
50+
description="SSL/TLS private key file path for HTTPS support.",
51+
)
52+
53+
tls_key_password: Optional[FilePath] = Field(
54+
None,
55+
title="SSL/TLS key password path",
56+
description="Path to file containing the password to decrypt the SSL/TLS private key.",
57+
)
4458

4559
@model_validator(mode="after")
4660
def check_tls_configuration(self) -> Self:
@@ -155,7 +169,11 @@ class ServiceConfiguration(ConfigurationBase):
155169
workers: PositiveInt = 1
156170
color_log: bool = True
157171
access_log: bool = True
158-
tls_config: TLSConfiguration = Field(default_factory=TLSConfiguration)
172+
tls_config: TLSConfiguration = Field(
173+
default_factory=lambda: TLSConfiguration(
174+
tls_certificate_path=None, tls_key_path=None, tls_key_password=None
175+
)
176+
)
159177
cors: CORSConfiguration = Field(default_factory=CORSConfiguration)
160178

161179
@model_validator(mode="after")

0 commit comments

Comments
 (0)