Skip to content

Commit b5e0e8e

Browse files
add logging message and change field order in dsms config
1 parent 703a950 commit b5e0e8e

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

dsms/core/configuration.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,6 @@ class Configuration(BaseSettings):
4949
host_url: AnyUrl = Field(
5050
..., description="Url of the DSMS instance to connect."
5151
)
52-
request_timeout: int = Field(
53-
120,
54-
description="Timeout in seconds until the request to the DSMS is timed out.",
55-
)
56-
57-
ssl_verify: bool = Field(
58-
True,
59-
description="Whether the SSL of the DSMS shall be verified during connection.",
60-
)
61-
62-
strict_validation: bool = Field(
63-
True,
64-
description="""Whether the validation of custom properties shall be strict.
65-
Disabling this might be helpful when e.g. the schema of a KType has been changed
66-
and the custom properties are not compatible anymore and should be updated accordingly.""",
67-
)
6852

6953
username: Optional[SecretStr] = Field(
7054
None,
@@ -102,17 +86,28 @@ class Configuration(BaseSettings):
10286
validation_alias=AliasChoices("DSMS_REALM", "KEYCLOAK_REALM_NAME"),
10387
)
10488

105-
loglevel: Optional[Union[Loglevel, str]] = Field(
106-
None,
107-
description="Set level of logging messages",
108-
alias=AliasChoices("loglevel", "log_level"),
109-
)
110-
11189
token: Optional[SecretStr] = Field(
11290
None,
11391
description="JWT bearer token for connecting to the DSMS instance",
11492
)
11593

94+
request_timeout: int = Field(
95+
120,
96+
description="Timeout in seconds until the request to the DSMS is timed out.",
97+
)
98+
99+
ssl_verify: bool = Field(
100+
True,
101+
description="Whether the SSL of the DSMS shall be verified during connection.",
102+
)
103+
104+
strict_validation: bool = Field(
105+
True,
106+
description="""Whether the validation of custom properties shall be strict.
107+
Disabling this might be helpful when e.g. the schema of a KType has been changed
108+
and the custom properties are not compatible anymore and should be updated accordingly.""",
109+
)
110+
116111
enable_auto_reauth: bool = Field(
117112
True,
118113
description="""Whether to automatically reauthenticate with username and password
@@ -178,6 +173,12 @@ class Configuration(BaseSettings):
178173
description="Repository of the triplestore for KItems in the DSMS",
179174
)
180175

176+
loglevel: Optional[Union[Loglevel, str]] = Field(
177+
None,
178+
description="Set level of logging messages",
179+
alias=AliasChoices("loglevel", "log_level"),
180+
)
181+
181182
qudt_units: AnyUrl = Field(
182183
"http://qudt.org/2.1/vocab/unit",
183184
description="URI to QUDT Unit ontology for unit conversion",

dsms/core/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def _perform_request(
7070
and dsms.config.enable_auto_reauth
7171
and retry
7272
):
73+
logger.info("Token expired. Will re-authenticate.")
7374
dsms.config = dsms.config.model_validate(dsms.config)
7475
response = _perform_request(
7576
dsms, route, method, retry=False, headers=None, **kwargs

0 commit comments

Comments
 (0)