crypticorn-utils 0.1.1rc1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- crypticorn_utils-0.1.2/MANIFEST.in +2 -0
- {crypticorn_utils-0.1.1rc1/crypticorn_utils.egg-info → crypticorn_utils-0.1.2}/PKG-INFO +26 -2
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/README.md +24 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/auth.py +13 -4
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/enums.py +0 -2
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2/crypticorn_utils.egg-info}/PKG-INFO +26 -2
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils.egg-info/SOURCES.txt +0 -6
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils.egg-info/requires.txt +1 -1
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/pyproject.toml +1 -1
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/requirements/main.txt +1 -1
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/requirements/test.txt +0 -1
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/tests/test_auth_client.py +1 -1
- crypticorn_utils-0.1.1rc1/MANIFEST.in +0 -3
- crypticorn_utils-0.1.1rc1/crypticorn_utils/cli/__init__.py +0 -4
- crypticorn_utils-0.1.1rc1/crypticorn_utils/cli/__main__.py +0 -17
- crypticorn_utils-0.1.1rc1/crypticorn_utils/cli/init.py +0 -127
- crypticorn_utils-0.1.1rc1/crypticorn_utils/cli/templates/__init__.py +0 -0
- crypticorn_utils-0.1.1rc1/crypticorn_utils/cli/templates/auth.py +0 -33
- crypticorn_utils-0.1.1rc1/crypticorn_utils/cli/version.py +0 -8
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/LICENSE +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/__init__.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/_migration.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/ansi_colors.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/decorators.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/errors.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/exceptions.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/logging.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/metrics.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/middleware.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/mixins.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/openapi.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/pagination.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/router/admin_router.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/router/status_router.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/utils.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/warnings.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils.egg-info/dependency_links.txt +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils.egg-info/entry_points.txt +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils.egg-info/top_level.txt +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/requirements/dev.txt +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/setup.cfg +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/tests/test_common_routers.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/tests/test_config.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/tests/test_enums.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/tests/test_errors.py +0 -0
- {crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/tests/test_pagination.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: crypticorn_utils
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.2
|
4
4
|
Summary: Shared utilities for the Crypticorn APIs
|
5
5
|
Author-email: Crypticorn <timon@crypticorn.com>
|
6
6
|
License-Expression: MIT
|
@@ -26,6 +26,7 @@ Requires-Dist: psutil<8.0.0,>=7.0.0
|
|
26
26
|
Requires-Dist: setuptools<81.0.0,>=80.0.0
|
27
27
|
Requires-Dist: strenum
|
28
28
|
Requires-Dist: prometheus-client<1.0.0,>=0.22.0
|
29
|
+
Requires-Dist: crypticorn<3.0.0,>=2.17.0
|
29
30
|
Provides-Extra: dev
|
30
31
|
Requires-Dist: build; extra == "dev"
|
31
32
|
Requires-Dist: twine; extra == "dev"
|
@@ -42,7 +43,6 @@ Requires-Dist: pytest-cov==6.1.1; extra == "test"
|
|
42
43
|
Requires-Dist: python-dotenv==1.0.1; extra == "test"
|
43
44
|
Requires-Dist: PyJWT==2.10.0; extra == "test"
|
44
45
|
Requires-Dist: httpx>=0.27.0; extra == "test"
|
45
|
-
Requires-Dist: crypticorn>=2.17.0; extra == "test"
|
46
46
|
Dynamic: license-file
|
47
47
|
|
48
48
|
This module serves as a central place for providing utilities for our python backends.
|
@@ -68,6 +68,30 @@ This module serves as a central place for providing utilities for our python bac
|
|
68
68
|
|
69
69
|
<!-- changelog-insertion -->
|
70
70
|
|
71
|
+
## v0.1.2 (2025-07-22)
|
72
|
+
|
73
|
+
### Bug Fixes
|
74
|
+
|
75
|
+
- Failing scope comparison in some environments
|
76
|
+
([`004495d`](https://github.com/crypticorn-ai/util-libraries/commit/004495da87b973f43b3e32abe96493dac1b6204a))
|
77
|
+
|
78
|
+
|
79
|
+
## v0.1.1 (2025-07-20)
|
80
|
+
|
81
|
+
|
82
|
+
## v0.1.1-rc.2 (2025-07-18)
|
83
|
+
|
84
|
+
### Bug Fixes
|
85
|
+
|
86
|
+
- Change verify api key request
|
87
|
+
([`11af6c2`](https://github.com/crypticorn-ai/util-libraries/commit/11af6c2c12a92b0a4c1c3b83ba86aca2a401ac45))
|
88
|
+
|
89
|
+
### Testing
|
90
|
+
|
91
|
+
- Fix failing auth test
|
92
|
+
([`03a3db1`](https://github.com/crypticorn-ai/util-libraries/commit/03a3db1341aaf51c6162454924cb929d6cfee94a))
|
93
|
+
|
94
|
+
|
71
95
|
## v0.1.1-rc.1 (2025-07-02)
|
72
96
|
|
73
97
|
### Bug Fixes
|
@@ -21,6 +21,30 @@ This module serves as a central place for providing utilities for our python bac
|
|
21
21
|
|
22
22
|
<!-- changelog-insertion -->
|
23
23
|
|
24
|
+
## v0.1.2 (2025-07-22)
|
25
|
+
|
26
|
+
### Bug Fixes
|
27
|
+
|
28
|
+
- Failing scope comparison in some environments
|
29
|
+
([`004495d`](https://github.com/crypticorn-ai/util-libraries/commit/004495da87b973f43b3e32abe96493dac1b6204a))
|
30
|
+
|
31
|
+
|
32
|
+
## v0.1.1 (2025-07-20)
|
33
|
+
|
34
|
+
|
35
|
+
## v0.1.1-rc.2 (2025-07-18)
|
36
|
+
|
37
|
+
### Bug Fixes
|
38
|
+
|
39
|
+
- Change verify api key request
|
40
|
+
([`11af6c2`](https://github.com/crypticorn-ai/util-libraries/commit/11af6c2c12a92b0a4c1c3b83ba86aca2a401ac45))
|
41
|
+
|
42
|
+
### Testing
|
43
|
+
|
44
|
+
- Fix failing auth test
|
45
|
+
([`03a3db1`](https://github.com/crypticorn-ai/util-libraries/commit/03a3db1341aaf51c6162454924cb929d6cfee94a))
|
46
|
+
|
47
|
+
|
24
48
|
## v0.1.1-rc.1 (2025-07-02)
|
25
49
|
|
26
50
|
### Bug Fixes
|
@@ -61,8 +61,8 @@ class AuthHandler:
|
|
61
61
|
"""
|
62
62
|
Verifies the API key.
|
63
63
|
"""
|
64
|
-
|
65
|
-
return await self.client.login.
|
64
|
+
self.client.config.api_key = {"APIKeyHeader": api_key}
|
65
|
+
return await self.client.login.verify()
|
66
66
|
|
67
67
|
async def _verify_bearer(
|
68
68
|
self, bearer: HTTPAuthorizationCredentials
|
@@ -80,7 +80,7 @@ class AuthHandler:
|
|
80
80
|
return await self.client.login.verify_basic_auth(basic.username, basic.password)
|
81
81
|
|
82
82
|
async def _validate_scopes(
|
83
|
-
self, api_scopes: list[
|
83
|
+
self, api_scopes: list[str], user_scopes: list[str]
|
84
84
|
) -> bool:
|
85
85
|
"""
|
86
86
|
Checks if the required scopes are a subset of the user scopes.
|
@@ -92,6 +92,10 @@ class AuthHandler:
|
|
92
92
|
message="Insufficient scopes to access this resource (required: "
|
93
93
|
+ ", ".join(api_scopes)
|
94
94
|
+ ")",
|
95
|
+
details={
|
96
|
+
"required_scopes": api_scopes,
|
97
|
+
"granted_scopes": user_scopes,
|
98
|
+
},
|
95
99
|
),
|
96
100
|
)
|
97
101
|
|
@@ -277,7 +281,12 @@ class AuthHandler:
|
|
277
281
|
if res is None:
|
278
282
|
continue
|
279
283
|
if sec:
|
280
|
-
|
284
|
+
required = [
|
285
|
+
s.value if isinstance(s, Scope) else str(s)
|
286
|
+
for s in sec.scopes
|
287
|
+
]
|
288
|
+
granted = [str(s) for s in res.scopes]
|
289
|
+
await self._validate_scopes(required, granted)
|
281
290
|
return res
|
282
291
|
|
283
292
|
except Exception as e:
|
@@ -50,8 +50,6 @@ class Scope(StrEnum):
|
|
50
50
|
READ_PAY_PAYMENTS = "read:pay:payments"
|
51
51
|
READ_PAY_PRODUCTS = "read:pay:products"
|
52
52
|
WRITE_PAY_PRODUCTS = "write:pay:products"
|
53
|
-
READ_PAY_NOW = "read:pay:now"
|
54
|
-
WRITE_PAY_NOW = "write:pay:now"
|
55
53
|
WRITE_PAY_COUPONS = "write:pay:coupons"
|
56
54
|
READ_PAY_COUPONS = "read:pay:coupons"
|
57
55
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: crypticorn_utils
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.2
|
4
4
|
Summary: Shared utilities for the Crypticorn APIs
|
5
5
|
Author-email: Crypticorn <timon@crypticorn.com>
|
6
6
|
License-Expression: MIT
|
@@ -26,6 +26,7 @@ Requires-Dist: psutil<8.0.0,>=7.0.0
|
|
26
26
|
Requires-Dist: setuptools<81.0.0,>=80.0.0
|
27
27
|
Requires-Dist: strenum
|
28
28
|
Requires-Dist: prometheus-client<1.0.0,>=0.22.0
|
29
|
+
Requires-Dist: crypticorn<3.0.0,>=2.17.0
|
29
30
|
Provides-Extra: dev
|
30
31
|
Requires-Dist: build; extra == "dev"
|
31
32
|
Requires-Dist: twine; extra == "dev"
|
@@ -42,7 +43,6 @@ Requires-Dist: pytest-cov==6.1.1; extra == "test"
|
|
42
43
|
Requires-Dist: python-dotenv==1.0.1; extra == "test"
|
43
44
|
Requires-Dist: PyJWT==2.10.0; extra == "test"
|
44
45
|
Requires-Dist: httpx>=0.27.0; extra == "test"
|
45
|
-
Requires-Dist: crypticorn>=2.17.0; extra == "test"
|
46
46
|
Dynamic: license-file
|
47
47
|
|
48
48
|
This module serves as a central place for providing utilities for our python backends.
|
@@ -68,6 +68,30 @@ This module serves as a central place for providing utilities for our python bac
|
|
68
68
|
|
69
69
|
<!-- changelog-insertion -->
|
70
70
|
|
71
|
+
## v0.1.2 (2025-07-22)
|
72
|
+
|
73
|
+
### Bug Fixes
|
74
|
+
|
75
|
+
- Failing scope comparison in some environments
|
76
|
+
([`004495d`](https://github.com/crypticorn-ai/util-libraries/commit/004495da87b973f43b3e32abe96493dac1b6204a))
|
77
|
+
|
78
|
+
|
79
|
+
## v0.1.1 (2025-07-20)
|
80
|
+
|
81
|
+
|
82
|
+
## v0.1.1-rc.2 (2025-07-18)
|
83
|
+
|
84
|
+
### Bug Fixes
|
85
|
+
|
86
|
+
- Change verify api key request
|
87
|
+
([`11af6c2`](https://github.com/crypticorn-ai/util-libraries/commit/11af6c2c12a92b0a4c1c3b83ba86aca2a401ac45))
|
88
|
+
|
89
|
+
### Testing
|
90
|
+
|
91
|
+
- Fix failing auth test
|
92
|
+
([`03a3db1`](https://github.com/crypticorn-ai/util-libraries/commit/03a3db1341aaf51c6162454924cb929d6cfee94a))
|
93
|
+
|
94
|
+
|
71
95
|
## v0.1.1-rc.1 (2025-07-02)
|
72
96
|
|
73
97
|
### Bug Fixes
|
@@ -24,12 +24,6 @@ crypticorn_utils.egg-info/dependency_links.txt
|
|
24
24
|
crypticorn_utils.egg-info/entry_points.txt
|
25
25
|
crypticorn_utils.egg-info/requires.txt
|
26
26
|
crypticorn_utils.egg-info/top_level.txt
|
27
|
-
crypticorn_utils/cli/__init__.py
|
28
|
-
crypticorn_utils/cli/__main__.py
|
29
|
-
crypticorn_utils/cli/init.py
|
30
|
-
crypticorn_utils/cli/version.py
|
31
|
-
crypticorn_utils/cli/templates/__init__.py
|
32
|
-
crypticorn_utils/cli/templates/auth.py
|
33
27
|
crypticorn_utils/router/admin_router.py
|
34
28
|
crypticorn_utils/router/status_router.py
|
35
29
|
requirements/dev.txt
|
@@ -207,7 +207,7 @@ async def test_combined_auth_with_valid_prediction_bearer_token(
|
|
207
207
|
api_key=None,
|
208
208
|
)
|
209
209
|
assert all(
|
210
|
-
[key in res.scopes for key in
|
210
|
+
[key in res.scopes for key in ['read:predictions']]
|
211
211
|
), "non admin which purchased predictions should have access to purchaseable scopes"
|
212
212
|
assert all(
|
213
213
|
[key not in res.scopes for key in ADMIN_SCOPES]
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# crypticorn/cli.py
|
2
|
-
|
3
|
-
import click
|
4
|
-
from crypticorn.cli import init_group, version
|
5
|
-
|
6
|
-
|
7
|
-
@click.group()
|
8
|
-
def cli():
|
9
|
-
"""🧙 Crypticorn CLI — magic for our microservices."""
|
10
|
-
pass
|
11
|
-
|
12
|
-
|
13
|
-
cli.add_command(init_group, name="init")
|
14
|
-
cli.add_command(version, name="version")
|
15
|
-
|
16
|
-
if __name__ == "__main__":
|
17
|
-
cli()
|
@@ -1,127 +0,0 @@
|
|
1
|
-
import click
|
2
|
-
from pathlib import Path
|
3
|
-
import subprocess
|
4
|
-
import importlib.resources
|
5
|
-
import crypticorn.cli.templates as templates
|
6
|
-
|
7
|
-
|
8
|
-
def get_git_root() -> Path:
|
9
|
-
"""Get the root directory of the git repository."""
|
10
|
-
try:
|
11
|
-
return Path(
|
12
|
-
subprocess.check_output(
|
13
|
-
["git", "rev-parse", "--show-toplevel"], text=True
|
14
|
-
).strip()
|
15
|
-
)
|
16
|
-
except Exception:
|
17
|
-
return Path.cwd()
|
18
|
-
|
19
|
-
|
20
|
-
def copy_template(template_name: str, target_path: Path):
|
21
|
-
"""Copy a template file to the target path."""
|
22
|
-
with importlib.resources.files(templates).joinpath(template_name).open(
|
23
|
-
"r"
|
24
|
-
) as template_file:
|
25
|
-
content = template_file.read()
|
26
|
-
|
27
|
-
target_path.parent.mkdir(parents=True, exist_ok=True)
|
28
|
-
with target_path.open("w") as f:
|
29
|
-
f.write(content)
|
30
|
-
|
31
|
-
click.secho(f"✅ Created: {target_path}", fg="green")
|
32
|
-
|
33
|
-
|
34
|
-
def check_file_exists(path: Path, force: bool):
|
35
|
-
if path.exists() and not force:
|
36
|
-
click.secho("File already exists, use --force / -f to overwrite", fg="red")
|
37
|
-
return False
|
38
|
-
return True
|
39
|
-
|
40
|
-
|
41
|
-
@click.group()
|
42
|
-
def init_group():
|
43
|
-
"""Initialize files like CI configs, linters, etc."""
|
44
|
-
pass
|
45
|
-
|
46
|
-
|
47
|
-
@init_group.command("ruff")
|
48
|
-
@click.option("-f", "--force", is_flag=True, help="Force overwrite the ruff.yml")
|
49
|
-
def init_ruff(force):
|
50
|
-
"""Add .github/workflows/ruff.yml"""
|
51
|
-
root = get_git_root()
|
52
|
-
target = root / ".github/workflows/ruff.yml"
|
53
|
-
if target.exists() and not force:
|
54
|
-
click.secho("File already exists, use --force / -f to overwrite", fg="red")
|
55
|
-
return
|
56
|
-
copy_template("ruff.yml", target)
|
57
|
-
|
58
|
-
|
59
|
-
@init_group.command("docker")
|
60
|
-
@click.option(
|
61
|
-
"-o", "--output", type=click.Path(), help="Custom output path for the Dockerfile"
|
62
|
-
)
|
63
|
-
@click.option("-f", "--force", is_flag=True, help="Force overwrite the Dockerfile")
|
64
|
-
def init_docker(output, force):
|
65
|
-
"""Add Dockerfile"""
|
66
|
-
root = get_git_root()
|
67
|
-
if output and Path(output).is_file():
|
68
|
-
click.secho("Output path is a file, please provide a directory path", fg="red")
|
69
|
-
return
|
70
|
-
target = (Path(output) if output else root) / "Dockerfile"
|
71
|
-
if not check_file_exists(target, force):
|
72
|
-
return
|
73
|
-
copy_template("Dockerfile", target)
|
74
|
-
click.secho("Make sure to update the Dockerfile", fg="yellow")
|
75
|
-
|
76
|
-
|
77
|
-
@init_group.command("auth")
|
78
|
-
@click.option(
|
79
|
-
"-o", "--output", type=click.Path(), help="Custom output path for the auth handler"
|
80
|
-
)
|
81
|
-
@click.option("-f", "--force", is_flag=True, help="Force overwrite the auth handler")
|
82
|
-
def init_auth(output, force):
|
83
|
-
"""Add auth.py with auth handler. Everything you need to start using the auth service."""
|
84
|
-
root = get_git_root()
|
85
|
-
if output and Path(output).is_file():
|
86
|
-
click.secho("Output path is a file, please provide a directory path", fg="red")
|
87
|
-
return
|
88
|
-
target = (Path(output) if output else root) / "auth.py"
|
89
|
-
if not check_file_exists(target, force):
|
90
|
-
return
|
91
|
-
copy_template("auth.py", target)
|
92
|
-
click.secho(
|
93
|
-
"""
|
94
|
-
Make sure to update the .env and .env.example files with:
|
95
|
-
IS_DOCKER=0
|
96
|
-
API_ENV=local
|
97
|
-
and the docker-compose.yml file with:
|
98
|
-
environment:
|
99
|
-
- IS_DOCKER=1
|
100
|
-
and the .github/workflows/main.yaml file with:
|
101
|
-
env:
|
102
|
-
API_ENV: ${{ github.ref == 'refs/heads/main' && 'prod' || 'dev' }}
|
103
|
-
""",
|
104
|
-
fg="yellow",
|
105
|
-
)
|
106
|
-
|
107
|
-
|
108
|
-
@init_group.command("dependabot")
|
109
|
-
@click.option("-f", "--force", is_flag=True, help="Force overwrite the dependabot.yml")
|
110
|
-
def init_dependabot(force):
|
111
|
-
"""Add dependabot.yml"""
|
112
|
-
root = get_git_root()
|
113
|
-
target = root / ".github/dependabot.yml"
|
114
|
-
if not check_file_exists(target, force):
|
115
|
-
return
|
116
|
-
copy_template("dependabot.yml", target)
|
117
|
-
|
118
|
-
|
119
|
-
@init_group.command("merge-env")
|
120
|
-
@click.option("-f", "--force", is_flag=True, help="Force overwrite the .env file")
|
121
|
-
def init_merge_env(force):
|
122
|
-
"""Add script to merge environment and file variables into .env"""
|
123
|
-
root = get_git_root()
|
124
|
-
target = root / "scripts/merge-env.sh"
|
125
|
-
if not check_file_exists(target, force):
|
126
|
-
return
|
127
|
-
copy_template("merge-env.sh", target)
|
File without changes
|
@@ -1,33 +0,0 @@
|
|
1
|
-
from crypticorn.common import (
|
2
|
-
AuthHandler as AuthHandler,
|
3
|
-
Scope as Scope,
|
4
|
-
Verify200Response as Verify200Response,
|
5
|
-
BaseUrl as BaseUrl,
|
6
|
-
ApiEnv as ApiEnv,
|
7
|
-
)
|
8
|
-
from fastapi import Security as Security
|
9
|
-
import os
|
10
|
-
import dotenv
|
11
|
-
import logging
|
12
|
-
|
13
|
-
dotenv.load_dotenv()
|
14
|
-
|
15
|
-
logger = logging.getLogger(__name__)
|
16
|
-
|
17
|
-
DOCKER_ENV = os.getenv("IS_DOCKER", "0")
|
18
|
-
API_ENV = os.getenv("API_ENV")
|
19
|
-
|
20
|
-
if not API_ENV:
|
21
|
-
raise ValueError(
|
22
|
-
"API_ENV is not set. Please set it to 'prod', 'dev' or 'local' in .env (of type ApiEnv)."
|
23
|
-
)
|
24
|
-
|
25
|
-
if DOCKER_ENV == "0":
|
26
|
-
logger.info(f"Using {API_ENV} environment")
|
27
|
-
base_url = BaseUrl.from_env(ApiEnv(API_ENV))
|
28
|
-
else:
|
29
|
-
base_url = BaseUrl.DOCKER
|
30
|
-
logger.info("Using docker environment")
|
31
|
-
|
32
|
-
auth_handler = AuthHandler(base_url=base_url)
|
33
|
-
logger.info(f"Auth URL: {auth_handler.client.config.host}")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/router/admin_router.py
RENAMED
File without changes
|
{crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils/router/status_router.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils.egg-info/dependency_links.txt
RENAMED
File without changes
|
{crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils.egg-info/entry_points.txt
RENAMED
File without changes
|
{crypticorn_utils-0.1.1rc1 → crypticorn_utils-0.1.2}/crypticorn_utils.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|