python-authz 0.8.0__tar.gz → 0.8.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-authz
3
- Version: 0.8.0
3
+ Version: 0.8.1
4
4
  Summary: A framework-agnostic ReBAC/RBAC/ABAC authorization engine built on one Zanzibar-style relationship graph
5
5
  Author: Anupam Gupta
6
6
  Author-email: Anupam Gupta <anupam@trois.in>
@@ -54,7 +54,7 @@ kept in agreement with each other.
54
54
 
55
55
  ## Status
56
56
 
57
- Release, version 0.8.0, a security release. [`docs/security.md`](docs/security.md) analyses the library end to end and records what changed; [`CHANGELOG.md`](CHANGELOG.md) lists the upgrade notes. The library provides:
57
+ Release, version 0.8.1. Version 0.8.0 was a security release: [`docs/security.md`](docs/security.md) analyses the library end to end and records what changed, and [`CHANGELOG.md`](CHANGELOG.md) lists the upgrade notes. The library provides:
58
58
 
59
59
  - **Unified ReBAC + RBAC + ABAC**: Zanzibar-style relationship graphs with conditions evaluated against stored policy and request context. Stored context takes precedence.
60
60
  - **Three-Valued Conditions**: a condition may return `None` when its context is missing or invalid; rewrite rules combine `True`, `False`, and `None` with Kleene logic, and a check allows only on `True`, so missing context never grants access, even under `Exclusion`.
@@ -26,7 +26,7 @@ kept in agreement with each other.
26
26
 
27
27
  ## Status
28
28
 
29
- Release, version 0.8.0, a security release. [`docs/security.md`](docs/security.md) analyses the library end to end and records what changed; [`CHANGELOG.md`](CHANGELOG.md) lists the upgrade notes. The library provides:
29
+ Release, version 0.8.1. Version 0.8.0 was a security release: [`docs/security.md`](docs/security.md) analyses the library end to end and records what changed, and [`CHANGELOG.md`](CHANGELOG.md) lists the upgrade notes. The library provides:
30
30
 
31
31
  - **Unified ReBAC + RBAC + ABAC**: Zanzibar-style relationship graphs with conditions evaluated against stored policy and request context. Stored context takes precedence.
32
32
  - **Three-Valued Conditions**: a condition may return `None` when its context is missing or invalid; rewrite rules combine `True`, `False`, and `None` with Kleene logic, and a check allows only on `True`, so missing context never grants access, even under `Exclusion`.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-authz"
3
- version = "0.8.0"
3
+ version = "0.8.1"
4
4
  description = "A framework-agnostic ReBAC/RBAC/ABAC authorization engine built on one Zanzibar-style relationship graph"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-authz"
3
- version = "0.8.0"
3
+ version = "0.8.1"
4
4
  description = "A framework-agnostic ReBAC/RBAC/ABAC authorization engine built on one Zanzibar-style relationship graph"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -205,13 +205,11 @@ class PostgresStorage:
205
205
  async def current_token(self) -> Token:
206
206
  conn, must_release = await self._connection()
207
207
  try:
208
- # last_value alone is misleading: Postgres pre-seeds a freshly
209
- # created (or RESTART IDENTITY-reset) sequence's last_value to
210
- # its start value even before anything has actually consumed
211
- # it. is_called distinguishes "really advanced" from "just
212
- # initialized" -- only count it once nextval() has actually run.
208
+ # pg_sequence_last_value is NULL until nextval() has run (a fresh
209
+ # or RESTART IDENTITY-reset sequence), and it needs only USAGE on
210
+ # the sequence, where SELECT FROM the sequence needs SELECT.
213
211
  value = await conn.fetchval(
214
- f"SELECT CASE WHEN is_called THEN last_value ELSE 0 END FROM {self._sequence}"
212
+ "SELECT COALESCE(pg_sequence_last_value($1::regclass), 0)", self._sequence
215
213
  )
216
214
  return str(value)
217
215
  finally:
File without changes