forked from anancarv/python-artifactory
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth.py
More file actions
43 lines (28 loc) · 874 Bytes
/
auth.py
File metadata and controls
43 lines (28 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
Definition of all auth models.
"""
from __future__ import annotations
from typing import Optional, Tuple, Union
from pydantic import BaseModel, SecretStr
class AuthModel(BaseModel):
"""Models an auth response."""
url: str
auth: Optional[Tuple[str, SecretStr]] = None
access_token: Optional[str] = None
verify: Union[bool, str] = True
cert: Optional[str] = None
api_version: int = 1
timeout: Optional[int] = None
class ApiKeyModel(BaseModel):
"""Models an api key."""
apiKey: SecretStr
class PasswordModel(BaseModel):
"""Models a password."""
password: SecretStr
class AccessTokenModel(BaseModel):
"""Model an access token."""
access_token: str
expires_in: Optional[int] = 3600
scope: str
refresh_token: Optional[str] = None
token_type: str