Skip to content

Commit 0e537f6

Browse files
authored
fix(namespace): address CodeRabbit review feedback and sync versioning (#2)
- Replace wildcard imports with explicit named imports and __all__ declarations - Use consistent relative imports in all namespace __init__.py files - Sort __all__ lists per RUF022 (ASCII case-sensitive ordering) - Remove stale noqa comments - Sync all version references to 0.2.3 (server.json, website/package.json) - Add missing 0.2.2 changelog entry and 0.2.3 Fixed section
1 parent 51ce3f0 commit 0e537f6

19 files changed

Lines changed: 151 additions & 62 deletions

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to Attestix are documented here.
44

55
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7-
## [0.2.3] - 2026-02-28
7+
## [0.2.3] - 2026-02-27
88

99
### Added
1010
- **Namespace package support**: Added `attestix` namespace package for cleaner imports
@@ -16,6 +16,19 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
1616
- Package structure now includes both flat modules and `attestix.*` namespace
1717
- Updated pyproject.toml to include attestix namespace packages
1818

19+
### Fixed
20+
- Replaced wildcard imports with explicit named imports and `__all__` declarations across all namespace shim modules
21+
- Consistent relative imports in `attestix/auth/__init__.py` and `attestix/blockchain/__init__.py`
22+
- Sorted `__all__` lists per RUF022 (ASCII case-sensitive ordering)
23+
- Removed redundant `# noqa` comments from namespace modules
24+
25+
## [0.2.2] - 2026-02-22
26+
27+
### Added
28+
- MCP Registry listing: published as `io.github.VibeTensor/attestix`
29+
- `server.json` for MCP Registry verification
30+
- Research paper page with citation references (BibTeX, APA, IEEE)
31+
1932
## [0.2.1] - 2026-02-21
2033

2134
### Added

attestix/auth/__init__.py

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,55 +6,51 @@
66
- token_parser: Identity token parsing utilities
77
"""
88

9-
# Re-export all from the flat auth module
10-
from auth.crypto import (
9+
# Re-export all from the flat auth module via relative imports
10+
from .crypto import (
11+
canonicalize_json,
12+
did_key_fragment,
13+
did_key_to_public_key,
1114
generate_ed25519_keypair,
1215
load_or_create_signing_key,
13-
private_key_to_bytes,
14-
public_key_to_bytes,
1516
private_key_from_bytes,
17+
private_key_to_bytes,
1618
public_key_from_bytes,
19+
public_key_to_bytes,
1720
public_key_to_did_key,
18-
did_key_to_public_key,
19-
did_key_fragment,
2021
sign_json_payload,
21-
verify_json_signature,
2222
sign_message,
23+
verify_json_signature,
2324
verify_signature,
24-
canonicalize_json,
2525
)
2626

27-
from auth.ssrf import validate_url_host
27+
from .ssrf import validate_url_host
2828

29-
from auth.token_parser import extract_identity_from_token
29+
from .token_parser import extract_identity_from_token
3030

31-
# Re-export submodules
32-
from auth import crypto
33-
from auth import ssrf
34-
from auth import token_parser
31+
# Re-export submodules for namespace access
32+
from . import crypto
33+
from . import ssrf
34+
from . import token_parser
3535

3636
__all__ = [
37-
# Crypto functions
37+
"canonicalize_json",
38+
"crypto",
39+
"did_key_fragment",
40+
"did_key_to_public_key",
41+
"extract_identity_from_token",
3842
"generate_ed25519_keypair",
3943
"load_or_create_signing_key",
40-
"private_key_to_bytes",
41-
"public_key_to_bytes",
4244
"private_key_from_bytes",
45+
"private_key_to_bytes",
4346
"public_key_from_bytes",
47+
"public_key_to_bytes",
4448
"public_key_to_did_key",
45-
"did_key_to_public_key",
46-
"did_key_fragment",
4749
"sign_json_payload",
48-
"verify_json_signature",
4950
"sign_message",
50-
"verify_signature",
51-
"canonicalize_json",
52-
# SSRF
53-
"validate_url_host",
54-
# Token parser
55-
"extract_identity_from_token",
56-
# Submodules
57-
"crypto",
5851
"ssrf",
5952
"token_parser",
53+
"validate_url_host",
54+
"verify_json_signature",
55+
"verify_signature",
6056
]

attestix/auth/crypto.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
11
"""Re-export from flat module for namespace compatibility."""
2-
from auth.crypto import *
2+
from auth.crypto import (
3+
ED25519_MULTICODEC_PREFIX,
4+
canonicalize_json,
5+
did_key_fragment,
6+
did_key_to_public_key,
7+
generate_ed25519_keypair,
8+
load_or_create_signing_key,
9+
private_key_from_bytes,
10+
private_key_to_bytes,
11+
public_key_from_bytes,
12+
public_key_to_bytes,
13+
public_key_to_did_key,
14+
sign_json_payload,
15+
sign_message,
16+
verify_json_signature,
17+
verify_signature,
18+
)
19+
20+
__all__ = [
21+
"ED25519_MULTICODEC_PREFIX",
22+
"canonicalize_json",
23+
"did_key_fragment",
24+
"did_key_to_public_key",
25+
"generate_ed25519_keypair",
26+
"load_or_create_signing_key",
27+
"private_key_from_bytes",
28+
"private_key_to_bytes",
29+
"public_key_from_bytes",
30+
"public_key_to_bytes",
31+
"public_key_to_did_key",
32+
"sign_json_payload",
33+
"sign_message",
34+
"verify_json_signature",
35+
"verify_signature",
36+
]

attestix/auth/ssrf.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
"""Re-export from flat module for namespace compatibility."""
2-
from auth.ssrf import *
2+
from auth.ssrf import (
3+
MAX_REDIRECTS,
4+
validate_and_pin_url,
5+
validate_redirect_target,
6+
validate_url_host,
7+
)
8+
9+
__all__ = [
10+
"MAX_REDIRECTS",
11+
"validate_and_pin_url",
12+
"validate_redirect_target",
13+
"validate_url_host",
14+
]

attestix/auth/token_parser.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
11
"""Re-export from flat module for namespace compatibility."""
2-
from auth.token_parser import *
2+
from auth.token_parser import (
3+
API_KEY_PATTERN,
4+
DID_PATTERN,
5+
JWT_PATTERN,
6+
TokenType,
7+
URL_PATTERN,
8+
detect_token_type,
9+
extract_identity_from_token,
10+
parse_jwt_claims,
11+
)
12+
13+
__all__ = [
14+
"API_KEY_PATTERN",
15+
"DID_PATTERN",
16+
"JWT_PATTERN",
17+
"TokenType",
18+
"URL_PATTERN",
19+
"detect_token_type",
20+
"extract_identity_from_token",
21+
"parse_jwt_claims",
22+
]

attestix/blockchain/__init__.py

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,27 @@
55
- abi: EAS contract ABI definitions
66
"""
77

8-
# Re-export from the flat blockchain module
9-
from blockchain.merkle import (
10-
hash_leaf,
11-
hash_pair,
8+
# Re-export from the flat blockchain module via relative imports
9+
from .merkle import (
1210
build_merkle_tree,
1311
compute_merkle_root,
12+
hash_leaf,
13+
hash_pair,
1414
)
1515

16-
from blockchain.abi import EAS_ABI, SCHEMA_REGISTRY_ABI
16+
from .abi import EAS_ABI, SCHEMA_REGISTRY_ABI
1717

18-
# Re-export submodules
19-
from blockchain import merkle
20-
from blockchain import abi
18+
# Re-export submodules for namespace access
19+
from . import abi
20+
from . import merkle
2121

2222
__all__ = [
23-
# Merkle functions
24-
"hash_leaf",
25-
"hash_pair",
26-
"build_merkle_tree",
27-
"compute_merkle_root",
28-
# ABI
2923
"EAS_ABI",
3024
"SCHEMA_REGISTRY_ABI",
31-
# Submodules
32-
"merkle",
3325
"abi",
26+
"build_merkle_tree",
27+
"compute_merkle_root",
28+
"hash_leaf",
29+
"hash_pair",
30+
"merkle",
3431
]

attestix/blockchain/abi.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
11
"""Re-export from flat module for namespace compatibility."""
2-
from blockchain.abi import *
2+
from blockchain.abi import (
3+
ATTESTIX_SCHEMA,
4+
EAS_ABI,
5+
EAS_CONTRACT_ADDRESS,
6+
SCHEMA_REGISTRY_ABI,
7+
SCHEMA_REGISTRY_ADDRESS,
8+
)
9+
10+
__all__ = [
11+
"ATTESTIX_SCHEMA",
12+
"EAS_ABI",
13+
"EAS_CONTRACT_ADDRESS",
14+
"SCHEMA_REGISTRY_ABI",
15+
"SCHEMA_REGISTRY_ADDRESS",
16+
]

attestix/blockchain/merkle.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
"""Re-export from flat module for namespace compatibility."""
2-
from blockchain.merkle import *
2+
from blockchain.merkle import (
3+
build_merkle_tree,
4+
compute_merkle_root,
5+
hash_leaf,
6+
hash_pair,
7+
)
8+
9+
__all__ = [
10+
"build_merkle_tree",
11+
"compute_merkle_root",
12+
"hash_leaf",
13+
"hash_pair",
14+
]
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Re-export from flat module for namespace compatibility."""
2-
from services.agent_card_service import *
32
from services.agent_card_service import AgentCardService
43

54
__all__ = ["AgentCardService"]
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Re-export from flat module for namespace compatibility."""
2-
from services.blockchain_service import *
32
from services.blockchain_service import BlockchainService
43

54
__all__ = ["BlockchainService"]

0 commit comments

Comments
 (0)