crypticorn-utils 0.1.0__tar.gz → 0.1.1__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.1/MANIFEST.in +2 -0
- {crypticorn_utils-0.1.0/crypticorn_utils.egg-info → crypticorn_utils-0.1.1}/PKG-INFO +29 -2
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/README.md +27 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/auth.py +2 -2
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/enums.py +0 -3
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/errors.py +4 -4
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1/crypticorn_utils.egg-info}/PKG-INFO +29 -2
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils.egg-info/SOURCES.txt +0 -6
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils.egg-info/requires.txt +1 -1
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/pyproject.toml +1 -1
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/requirements/main.txt +1 -1
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/requirements/test.txt +0 -1
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/tests/test_auth_client.py +1 -1
- crypticorn_utils-0.1.0/MANIFEST.in +0 -3
- crypticorn_utils-0.1.0/crypticorn_utils/cli/__init__.py +0 -4
- crypticorn_utils-0.1.0/crypticorn_utils/cli/__main__.py +0 -17
- crypticorn_utils-0.1.0/crypticorn_utils/cli/init.py +0 -127
- crypticorn_utils-0.1.0/crypticorn_utils/cli/templates/__init__.py +0 -0
- crypticorn_utils-0.1.0/crypticorn_utils/cli/templates/auth.py +0 -33
- crypticorn_utils-0.1.0/crypticorn_utils/cli/version.py +0 -8
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/LICENSE +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/__init__.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/_migration.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/ansi_colors.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/decorators.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/exceptions.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/logging.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/metrics.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/middleware.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/mixins.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/openapi.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/pagination.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/router/admin_router.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/router/status_router.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/utils.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils/warnings.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils.egg-info/dependency_links.txt +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils.egg-info/entry_points.txt +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils.egg-info/top_level.txt +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/requirements/dev.txt +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/setup.cfg +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/tests/test_common_routers.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/tests/test_config.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/tests/test_enums.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/tests/test_errors.py +0 -0
- {crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/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.1
|
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,33 @@ 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.1 (2025-07-20)
|
72
|
+
|
73
|
+
|
74
|
+
## v0.1.1-rc.2 (2025-07-18)
|
75
|
+
|
76
|
+
### Bug Fixes
|
77
|
+
|
78
|
+
- Change verify api key request
|
79
|
+
([`11af6c2`](https://github.com/crypticorn-ai/util-libraries/commit/11af6c2c12a92b0a4c1c3b83ba86aca2a401ac45))
|
80
|
+
|
81
|
+
### Testing
|
82
|
+
|
83
|
+
- Fix failing auth test
|
84
|
+
([`03a3db1`](https://github.com/crypticorn-ai/util-libraries/commit/03a3db1341aaf51c6162454924cb929d6cfee94a))
|
85
|
+
|
86
|
+
|
87
|
+
## v0.1.1-rc.1 (2025-07-02)
|
88
|
+
|
89
|
+
### Bug Fixes
|
90
|
+
|
91
|
+
- Assign correct status code to invalid coupon
|
92
|
+
([`e4068ac`](https://github.com/crypticorn-ai/util-libraries/commit/e4068ac5a739bac69313b18bc3f4c208d024d06d))
|
93
|
+
|
94
|
+
- Make read coupons scope public
|
95
|
+
([`6f5f213`](https://github.com/crypticorn-ai/util-libraries/commit/6f5f213a53cf7a51c0f9a5bb19c927b5348255a9))
|
96
|
+
|
97
|
+
|
71
98
|
## v0.1.0 (2025-06-27)
|
72
99
|
|
73
100
|
|
@@ -21,6 +21,33 @@ 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.1 (2025-07-20)
|
25
|
+
|
26
|
+
|
27
|
+
## v0.1.1-rc.2 (2025-07-18)
|
28
|
+
|
29
|
+
### Bug Fixes
|
30
|
+
|
31
|
+
- Change verify api key request
|
32
|
+
([`11af6c2`](https://github.com/crypticorn-ai/util-libraries/commit/11af6c2c12a92b0a4c1c3b83ba86aca2a401ac45))
|
33
|
+
|
34
|
+
### Testing
|
35
|
+
|
36
|
+
- Fix failing auth test
|
37
|
+
([`03a3db1`](https://github.com/crypticorn-ai/util-libraries/commit/03a3db1341aaf51c6162454924cb929d6cfee94a))
|
38
|
+
|
39
|
+
|
40
|
+
## v0.1.1-rc.1 (2025-07-02)
|
41
|
+
|
42
|
+
### Bug Fixes
|
43
|
+
|
44
|
+
- Assign correct status code to invalid coupon
|
45
|
+
([`e4068ac`](https://github.com/crypticorn-ai/util-libraries/commit/e4068ac5a739bac69313b18bc3f4c208d024d06d))
|
46
|
+
|
47
|
+
- Make read coupons scope public
|
48
|
+
([`6f5f213`](https://github.com/crypticorn-ai/util-libraries/commit/6f5f213a53cf7a51c0f9a5bb19c927b5348255a9))
|
49
|
+
|
50
|
+
|
24
51
|
## v0.1.0 (2025-06-27)
|
25
52
|
|
26
53
|
|
@@ -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
|
@@ -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
|
|
@@ -75,7 +73,6 @@ class Scope(StrEnum):
|
|
75
73
|
cls.WRITE_TRADE_STRATEGIES,
|
76
74
|
cls.WRITE_PAY_PRODUCTS,
|
77
75
|
cls.WRITE_PAY_COUPONS,
|
78
|
-
cls.READ_PAY_COUPONS,
|
79
76
|
cls.WRITE_ADMIN,
|
80
77
|
cls.READ_ADMIN,
|
81
78
|
]
|
@@ -866,6 +866,10 @@ class StatusCodeMapper:
|
|
866
866
|
status.HTTP_400_BAD_REQUEST,
|
867
867
|
status.WS_1008_POLICY_VIOLATION,
|
868
868
|
),
|
869
|
+
ApiError.COUPON_INVALID: (
|
870
|
+
status.HTTP_400_BAD_REQUEST,
|
871
|
+
status.WS_1008_POLICY_VIOLATION,
|
872
|
+
),
|
869
873
|
# Success cases
|
870
874
|
ApiError.SUCCESS: (status.HTTP_200_OK, status.WS_1000_NORMAL_CLOSURE),
|
871
875
|
ApiError.BOT_STOPPING_COMPLETED: (
|
@@ -893,10 +897,6 @@ class StatusCodeMapper:
|
|
893
897
|
status.HTTP_200_OK,
|
894
898
|
status.WS_1008_POLICY_VIOLATION,
|
895
899
|
),
|
896
|
-
ApiError.COUPON_INVALID: (
|
897
|
-
status.HTTP_200_OK,
|
898
|
-
status.WS_1000_NORMAL_CLOSURE,
|
899
|
-
),
|
900
900
|
# Miscellaneous
|
901
901
|
ApiError.OBJECT_LOCKED: (
|
902
902
|
status.HTTP_423_LOCKED,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: crypticorn_utils
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.1
|
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,33 @@ 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.1 (2025-07-20)
|
72
|
+
|
73
|
+
|
74
|
+
## v0.1.1-rc.2 (2025-07-18)
|
75
|
+
|
76
|
+
### Bug Fixes
|
77
|
+
|
78
|
+
- Change verify api key request
|
79
|
+
([`11af6c2`](https://github.com/crypticorn-ai/util-libraries/commit/11af6c2c12a92b0a4c1c3b83ba86aca2a401ac45))
|
80
|
+
|
81
|
+
### Testing
|
82
|
+
|
83
|
+
- Fix failing auth test
|
84
|
+
([`03a3db1`](https://github.com/crypticorn-ai/util-libraries/commit/03a3db1341aaf51c6162454924cb929d6cfee94a))
|
85
|
+
|
86
|
+
|
87
|
+
## v0.1.1-rc.1 (2025-07-02)
|
88
|
+
|
89
|
+
### Bug Fixes
|
90
|
+
|
91
|
+
- Assign correct status code to invalid coupon
|
92
|
+
([`e4068ac`](https://github.com/crypticorn-ai/util-libraries/commit/e4068ac5a739bac69313b18bc3f4c208d024d06d))
|
93
|
+
|
94
|
+
- Make read coupons scope public
|
95
|
+
([`6f5f213`](https://github.com/crypticorn-ai/util-libraries/commit/6f5f213a53cf7a51c0f9a5bb19c927b5348255a9))
|
96
|
+
|
97
|
+
|
71
98
|
## v0.1.0 (2025-06-27)
|
72
99
|
|
73
100
|
|
@@ -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
|
File without changes
|
File without changes
|
File without changes
|
{crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils.egg-info/dependency_links.txt
RENAMED
File without changes
|
{crypticorn_utils-0.1.0 → crypticorn_utils-0.1.1}/crypticorn_utils.egg-info/entry_points.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
|
File without changes
|