Skip to content

Commit aa7a238

Browse files
committed
Renaming custom FilePath to PossibleFilePath
1 parent 95fe87e commit aa7a238

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

‎src/osw/auth.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import yaml
1010
from pydantic.v1 import PrivateAttr
1111

12-
from osw.custom_types import FilePath
12+
from osw.custom_types import PossibleFilePath
1313
from osw.model.static import OswBaseModel
1414

1515
CREDENTIALS_FN_DEFAULT = "credentials.pwd.yaml"
@@ -18,9 +18,13 @@
1818
class CredentialManager(OswBaseModel):
1919
"""Handles credentials"""
2020

21-
cred_filepath: Optional[Union[Union[str, FilePath], List[Union[str, FilePath]]]]
21+
cred_filepath: Optional[
22+
Union[Union[str, PossibleFilePath], List[Union[str, PossibleFilePath]]]
23+
]
2224
"""Filepath to yaml file with credentials for osw and connected services"""
23-
cert_filepath: Optional[Union[Union[str, FilePath], List[Union[str, FilePath]]]]
25+
cert_filepath: Optional[
26+
Union[Union[str, PossibleFilePath], List[Union[str, PossibleFilePath]]]
27+
]
2428
"""Filepath to the certificates for osw and connected services"""
2529

2630
_credentials: List[BaseCredential] = PrivateAttr([])
@@ -234,7 +238,7 @@ def iri_in_file(self, iri: str) -> bool:
234238

235239
def save_credentials_to_file(
236240
self,
237-
filepath: Union[str, FilePath] = None,
241+
filepath: Union[str, PossibleFilePath] = None,
238242
set_cred_filepath: bool = False,
239243
):
240244
"""Saves the in memory credentials to a file

‎src/osw/custom_types.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from types import NoneType # noqa: F401
1111

1212

13-
class FilePath(PydanticFilePath):
13+
class PossibleFilePath(PydanticFilePath):
1414
# Overwrite the Pydantic FilePath class to allow non-existing paths
1515
@classmethod
1616
def __get_validators__(cls):

0 commit comments

Comments
 (0)