Key
Key
Bases: BaseModel
Utility class for creating keys.
Source code in src/api_key_factory/factory/key.py
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 44 45 46 47 48 49 50 | |
__init__(prefix='')
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prefix
|
str
|
Prefix of the token. Default empty. |
''
|
Source code in src/api_key_factory/factory/key.py
15 16 17 18 19 20 21 22 23 | |
get_hash()
Get the token as a hashed SHA-256 string.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The hashed token string. |
Source code in src/api_key_factory/factory/key.py
38 39 40 41 42 43 44 45 46 47 48 49 50 | |
get_value()
Get the token as a string.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The token string. |
Source code in src/api_key_factory/factory/key.py
25 26 27 28 29 30 31 32 33 34 35 36 | |