feat: Web3 Authentication Framework (EIP-4361 SIWE)#574
Conversation
…nance#87) - Add OpenSea API v2 integration (collections, listings, events) - Add Blur marketplace integration (collections, prices, sales) - Add trait-based rarity scoring engine with Jaccard similarity - Add unified Marketplace aggregator for cross-platform data - Add integration tests for all NFT modules - Add documentation guide with usage examples
Implements Sign-In with Ethereum authentication: - lib/lux/auth/web3.ex: SIWE message construction, nonce management, auth flow - lib/lux/auth/web3/signature.ex: ECDSA secp256k1 signature recovery (EIP-191) - lib/lux/auth/web3/session.ex: HMAC-SHA256 token-based sessions with revocation - lib/lux/auth/web3/rbac.ex: Role-based access control (admin/user/viewer) - lib/lux/auth/web3/audit.ex: Auth event logging and rate limiting - test/unit/auth/web3_test.exs: Comprehensive unit tests - guides/auth/web3.md: Integration documentation Closes Spectral-Finance#77
|
Review assist for #77 acceptance criteria: This PR has a useful SIWE/session/RBAC skeleton, but I would tighten a few gaps before treating it as complete for the Web3 Authentication and Authorization Framework bounty:
The strongest next step is an integration test that exercises |
|
Follow-up review-assist pass for the I would tighten these before this is used as an authentication boundary:
Suggested verification slice: domain mismatch fails; URI/version mismatch fails; malformed token segments return tuples instead of raising; a fresh session cannot be refreshed until the threshold; repeated failed auth attempts hit the rate limiter through |
|
Follow-up2 review-assist pass for the I would tighten these before treating this as an auth boundary:
Suggested verification slice: role promotion/demotion invalidates gate decisions; public ETS tampering cannot forge/revoke auth state; invalid permission atoms are rejected; session create/refresh events appear in audit queries; malformed addresses return tuples rather than process crashes. |
…Finance#574) Round 1 fixes: - Add multi-signature support with threshold policy (MultiSig module) - Add TokenGate module with on-chain ERC-20/721 balance verification - Add SIWE signature known-answer test vectors - Add session expiry/refresh with cleanup_expired/0 and active_count/0 Round 2 fixes: - Add domain allowlist validation in authenticate/2 via validate_domain/1 - Session store already uses ETS; added cleanup_expired/0 for maintenance - RBAC cache invalidation on role/permission changes Round 3 fixes: - assign_role/2 now calls invalidate_token_gate_cache/1 - grant_resource_permission/3 and revoke_resource_permission/3 invalidate cache - Added invalidate_all_token_gate_caches/0 for global invalidation - Added invalidate_caches_for_state_change/2 for token-balance/provider changes
…Finance#574) Round 1 fixes: - Add multi-signature support with threshold policy (MultiSig module) - Add TokenGate module with on-chain ERC-20/721/native balance verification - Add SIWE signature known-answer test vectors (sign-verify round trip) - Add session expiry/refresh mechanism with cleanup_expired/0 Round 2 fixes: - Add domain allowlist validation in authenticate/2 (validate_domain/1) - Session store uses ETS with cleanup_expired/0 for maintenance - RBAC cache invalidation on role/permission changes Round 3 fixes: - assign_role/2 invalidates token gate cache automatically - grant/revoke_resource_permission invalidate cache - Add invalidate_all_token_gate_caches/0 for global invalidation - Add invalidate_caches_for_state_change/2 for external state changes
…ion, multisig safety
Web3 Authentication Framework
Implements Sign-In with Ethereum (EIP-4361) authentication for the Lux framework.
Closes #77
Modules Added
Files Changed
Key Features
Testing
All modules include comprehensive unit tests covering: