auth 2.4.0__tar.gz → 2.4.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.
- {auth-2.4.0 → auth-2.4.1}/PKG-INFO +7 -3
- {auth-2.4.0 → auth-2.4.1}/README.md +5 -0
- {auth-2.4.0 → auth-2.4.1}/auth/docs_page.py +10 -0
- {auth-2.4.0 → auth-2.4.1}/auth.egg-info/PKG-INFO +7 -3
- {auth-2.4.0 → auth-2.4.1}/auth.egg-info/SOURCES.txt +0 -1
- {auth-2.4.0 → auth-2.4.1}/auth.egg-info/requires.txt +1 -2
- {auth-2.4.0 → auth-2.4.1}/pyproject.toml +4 -6
- {auth-2.4.0 → auth-2.4.1}/tests/test_api_keys_encryption.py +0 -2
- auth-2.4.0/tests/test_migrations.py +0 -45
- {auth-2.4.0 → auth-2.4.1}/LICENSE +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/__init__.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/api_keys.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/audit.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/circuit_breaker.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/client.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/cmd/__init__.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/cmd/server.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/config.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/core/REST/__init__.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/core/REST/client.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/core/__init__.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/core/models/__init__.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/database.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/decorators.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/encryption.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/logging_config.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/main.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/models/sql.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/response_format.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/routes.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/sanitizer.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/server.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/services/service.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/validation.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth/workflow_checker.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth.egg-info/dependency_links.txt +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth.egg-info/entry_points.txt +0 -0
- {auth-2.4.0 → auth-2.4.1}/auth.egg-info/top_level.txt +0 -0
- {auth-2.4.0 → auth-2.4.1}/setup.cfg +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_api_keys.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_audit_integrity.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_client.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_client_rest.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_cmd_server.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_config.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_correctness_hardening.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_docs_page.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_encryption.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_encryption_integration.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_flask.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_key_rotation.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_log_redaction.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_phase_a_hardening.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_reencryption.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_routes_errors.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_server.py +0 -0
- {auth-2.4.0 → auth-2.4.1}/tests/test_service_lifecycle.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: auth
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.1
|
|
4
4
|
Summary: Authorization for humans
|
|
5
5
|
Author-email: Farshid Ashouri <farsheed.ashouri@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -41,11 +41,10 @@ Provides-Extra: ratelimit
|
|
|
41
41
|
Requires-Dist: flask-limiter>=3.0.0; extra == "ratelimit"
|
|
42
42
|
Provides-Extra: migrations
|
|
43
43
|
Requires-Dist: migretti>=0.10.0; extra == "migrations"
|
|
44
|
-
Requires-Dist: alembic>=1.13.0; extra == "migrations"
|
|
45
44
|
Provides-Extra: dev
|
|
46
45
|
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
47
46
|
Requires-Dist: pytest-cov>=2.0; extra == "dev"
|
|
48
|
-
Requires-Dist:
|
|
47
|
+
Requires-Dist: migretti>=0.10.0; extra == "dev"
|
|
49
48
|
Requires-Dist: ruff>=0.0.260; extra == "dev"
|
|
50
49
|
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
51
50
|
Requires-Dist: types-requests; extra == "dev"
|
|
@@ -121,6 +120,11 @@ with Client(api_key=KEY, service_url="https://auth.rodmena.app") as c:
|
|
|
121
120
|
a hash, and validates them inside your namespace — an identity UI fronts the
|
|
122
121
|
lifecycle, backends validate then use the RBAC checks. Client methods:
|
|
123
122
|
`create_api_key`, `list_api_keys`, `revoke_api_key`, `validate_api_key`.
|
|
123
|
+
- **DEPRECATED — bare user strings.** Asserting a `<user>` that no validated API
|
|
124
|
+
key backs is scheduled for decommission: 2.5.0 adds opt-in per-tenant strict
|
|
125
|
+
mode, **3.0.0 makes key-backed users mandatory** (each phase ships only after
|
|
126
|
+
every consuming platform confirms). Migrate backends to
|
|
127
|
+
`validate → user → has_permission` now. Details: [docs/DEPRECATIONS.md](docs/DEPRECATIONS.md).
|
|
124
128
|
|
|
125
129
|
## Documentation
|
|
126
130
|
|
|
@@ -64,6 +64,11 @@ with Client(api_key=KEY, service_url="https://auth.rodmena.app") as c:
|
|
|
64
64
|
a hash, and validates them inside your namespace — an identity UI fronts the
|
|
65
65
|
lifecycle, backends validate then use the RBAC checks. Client methods:
|
|
66
66
|
`create_api_key`, `list_api_keys`, `revoke_api_key`, `validate_api_key`.
|
|
67
|
+
- **DEPRECATED — bare user strings.** Asserting a `<user>` that no validated API
|
|
68
|
+
key backs is scheduled for decommission: 2.5.0 adds opt-in per-tenant strict
|
|
69
|
+
mode, **3.0.0 makes key-backed users mandatory** (each phase ships only after
|
|
70
|
+
every consuming platform confirms). Migrate backends to
|
|
71
|
+
`validate → user → has_permission` now. Details: [docs/DEPRECATIONS.md](docs/DEPRECATIONS.md).
|
|
67
72
|
|
|
68
73
|
## Documentation
|
|
69
74
|
|
|
@@ -142,6 +142,16 @@ authenticate `/api/*` itself — the Bearer header always takes your client key.
|
|
|
142
142
|
Rotating your client key moves your users' API keys with the namespace; the
|
|
143
143
|
secrets keep validating afterwards.
|
|
144
144
|
|
|
145
|
+
**DEPRECATION — bare user strings (decommission target: 3.0.0).** Today any
|
|
146
|
+
`<user>` string answers authorization checks whether or not a key backs it.
|
|
147
|
+
That is being retired: 2.5.0 adds per-tenant opt-in strict mode (a user with no
|
|
148
|
+
active API key answers negatively, reason `user_not_key_backed`, same response
|
|
149
|
+
shapes) plus `POST /api/apikeys/check_permission` (validate + permission check
|
|
150
|
+
in one round trip); 3.0.0 makes strict identity the default. Each phase ships
|
|
151
|
+
only after every consuming platform has confirmed readiness. Migrate now:
|
|
152
|
+
issue keys to your users and derive the user from `/api/apikeys/validate`
|
|
153
|
+
instead of asserting it.
|
|
154
|
+
|
|
145
155
|
## 4. Endpoints
|
|
146
156
|
|
|
147
157
|
All paths need the `Authorization` header except `/ping` and `/health`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: auth
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.1
|
|
4
4
|
Summary: Authorization for humans
|
|
5
5
|
Author-email: Farshid Ashouri <farsheed.ashouri@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -41,11 +41,10 @@ Provides-Extra: ratelimit
|
|
|
41
41
|
Requires-Dist: flask-limiter>=3.0.0; extra == "ratelimit"
|
|
42
42
|
Provides-Extra: migrations
|
|
43
43
|
Requires-Dist: migretti>=0.10.0; extra == "migrations"
|
|
44
|
-
Requires-Dist: alembic>=1.13.0; extra == "migrations"
|
|
45
44
|
Provides-Extra: dev
|
|
46
45
|
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
47
46
|
Requires-Dist: pytest-cov>=2.0; extra == "dev"
|
|
48
|
-
Requires-Dist:
|
|
47
|
+
Requires-Dist: migretti>=0.10.0; extra == "dev"
|
|
49
48
|
Requires-Dist: ruff>=0.0.260; extra == "dev"
|
|
50
49
|
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
51
50
|
Requires-Dist: types-requests; extra == "dev"
|
|
@@ -121,6 +120,11 @@ with Client(api_key=KEY, service_url="https://auth.rodmena.app") as c:
|
|
|
121
120
|
a hash, and validates them inside your namespace — an identity UI fronts the
|
|
122
121
|
lifecycle, backends validate then use the RBAC checks. Client methods:
|
|
123
122
|
`create_api_key`, `list_api_keys`, `revoke_api_key`, `validate_api_key`.
|
|
123
|
+
- **DEPRECATED — bare user strings.** Asserting a `<user>` that no validated API
|
|
124
|
+
key backs is scheduled for decommission: 2.5.0 adds opt-in per-tenant strict
|
|
125
|
+
mode, **3.0.0 makes key-backed users mandatory** (each phase ships only after
|
|
126
|
+
every consuming platform confirms). Migrate backends to
|
|
127
|
+
`validate → user → has_permission` now. Details: [docs/DEPRECATIONS.md](docs/DEPRECATIONS.md).
|
|
124
128
|
|
|
125
129
|
## Documentation
|
|
126
130
|
|
|
@@ -14,7 +14,7 @@ python-json-logger<4,>=3.1.0
|
|
|
14
14
|
[dev]
|
|
15
15
|
pytest>=6.0
|
|
16
16
|
pytest-cov>=2.0
|
|
17
|
-
|
|
17
|
+
migretti>=0.10.0
|
|
18
18
|
ruff>=0.0.260
|
|
19
19
|
mypy>=1.0
|
|
20
20
|
types-requests
|
|
@@ -25,7 +25,6 @@ responses>=0.23
|
|
|
25
25
|
|
|
26
26
|
[migrations]
|
|
27
27
|
migretti>=0.10.0
|
|
28
|
-
alembic>=1.13.0
|
|
29
28
|
|
|
30
29
|
[ratelimit]
|
|
31
30
|
flask-limiter>=3.0.0
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "auth"
|
|
7
|
-
version = "2.4.
|
|
7
|
+
version = "2.4.1"
|
|
8
8
|
description = "Authorization for humans"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -58,17 +58,15 @@ dependencies = [
|
|
|
58
58
|
ratelimit = [
|
|
59
59
|
"flask-limiter>=3.0.0",
|
|
60
60
|
]
|
|
61
|
-
# Database schema migrations
|
|
62
|
-
#
|
|
63
|
-
# migrations_legacy_alembic/. Not required to import or serve the app.
|
|
61
|
+
# Database schema migrations (migretti, SQL-first house standard). Not
|
|
62
|
+
# required to import or serve the app.
|
|
64
63
|
migrations = [
|
|
65
64
|
"migretti>=0.10.0",
|
|
66
|
-
"alembic>=1.13.0",
|
|
67
65
|
]
|
|
68
66
|
dev = [
|
|
69
67
|
"pytest>=6.0",
|
|
70
68
|
"pytest-cov>=2.0",
|
|
71
|
-
"
|
|
69
|
+
"migretti>=0.10.0",
|
|
72
70
|
"ruff>=0.0.260",
|
|
73
71
|
"mypy>=1.0",
|
|
74
72
|
"types-requests",
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"""The RETIRED Alembic migration stack still loads, applies, and reverses.
|
|
2
|
-
|
|
3
|
-
Alembic is frozen at its single legacy revision (0001_widen_text, applied in
|
|
4
|
-
production) and lives in migrations_legacy_alembic/; NEW migrations are
|
|
5
|
-
migretti SQL files in migrations/ (see MIGRATIONS.md). These tests keep the
|
|
6
|
-
legacy tree loadable so the recorded history stays reproducible.
|
|
7
|
-
|
|
8
|
-
On SQLite the widening migration is a no-op (SQLite ignores varchar length), so
|
|
9
|
-
these assert the framework wiring — env.py resolves the app's database, the
|
|
10
|
-
revision imports, and upgrade/downgrade run without error. The real varchar->TEXT
|
|
11
|
-
behaviour is exercised against PostgreSQL in the integration run.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
import os
|
|
15
|
-
|
|
16
|
-
import pytest
|
|
17
|
-
|
|
18
|
-
pytest.importorskip("alembic")
|
|
19
|
-
|
|
20
|
-
from alembic import command # noqa: E402
|
|
21
|
-
from alembic.config import Config # noqa: E402
|
|
22
|
-
|
|
23
|
-
from auth.database import create_tables # noqa: E402
|
|
24
|
-
|
|
25
|
-
_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def _config() -> Config:
|
|
29
|
-
cfg = Config(os.path.join(_ROOT, "alembic.ini"))
|
|
30
|
-
cfg.set_main_option(
|
|
31
|
-
"script_location", os.path.join(_ROOT, "migrations_legacy_alembic")
|
|
32
|
-
)
|
|
33
|
-
return cfg
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def test_upgrade_head_runs():
|
|
37
|
-
# Alembic owns changes; create_tables owns creation. Tables must exist first.
|
|
38
|
-
create_tables(raise_on_error=True)
|
|
39
|
-
command.upgrade(_config(), "head") # must not raise
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
def test_downgrade_then_upgrade_roundtrips():
|
|
43
|
-
cfg = _config()
|
|
44
|
-
command.downgrade(cfg, "base")
|
|
45
|
-
command.upgrade(cfg, "head")
|
|
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
|
|
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
|
|
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
|