How truthly/pg-webauthn works
Main Components
a. Core Components:
• WebAuthn Extension Module (Central Component)
• Database Tables Layer
• Function Layer
• Enumeration Types Layer
• External Dependencies Layer
b. Integration Points:
• Browser/Client Interface
• PostgreSQL Core Integration
• External Dependencies Integration
Client Layer (Browser)
↕️
WebAuthn Extension Interface
↕️
Core Processing Layer
↕️
Storage Layer
↕️
External Dependencies
Specific Components
a. Tables (Storage Layer):
• credential_challenges
• credentials
• assertion_challenges
• assertions
b. Core Functions (Group by Flow):
• Sign-up Flow Functions:
• init_credential()
• store_credential()
• Sign-in Flow Functions:
• get_credentials()
• verify_assertion()
• Utility Functions:
• base64url_encode/decode
• parse_attestation_object
• parse_authenticator_data
• etc.
c. External Dependencies:
• pgcrypto
• pg_ecdsa_verify
• cbor
Flow Representations
a. Sign-up Flow:
Browser → init_credential() → credential_challenges table
Browser → store_credential() → credentials table
b. Sign-in Flow:
Browser → get_credentials() → assertion_challenges table
Browser → verify_assertion() → assertions table
Important Details
a. Security Flow Indicators:
• Challenge-response mechanisms
• Signature verification paths
• User verification requirements
b. Data Transformations:
• Base64URL encoding/decoding points
• CBOR processing points
• Cryptographic verification points