How crydensync/cryden works
CrydenSync is an embeddable Go authentication engine: a host application configures an Engine with stores and security dependencies, calls the framework-neutral public facade for identity operations, and receives tokens or operation results. The product spans account authentication, sessions and tokens, optional second factors and integrations, plus administration and safe AI-assisted querying. The README documents these capabilities and storage choices; sampled source confirms engine wiring, WebAuthn handling, and safe-query behavior. Some subsystem links therefore cite the README rather than unsampled implementation.
Main entry points: cryden.go Public facade · engine.go Engine wiring · login.go Account auth · webauthn.go MFA and passkeys
Components 22
Engine and identity
- Public facade
cryden.go - Engine wiring
engine.go - Account auth
auth/login.go - OAuth identities
auth/oauth.go - API keys
auth/apikeys.go
Security and sessions
- Tokens and claims
token/jwt.go - Session lifecycle
session/session.go - MFA and passkeys
auth/webauthn.go - Security controls
security/anomaly.go
Persistence backends
- Store interfaces
store/interfaces.go - Memory stores
store/memory/user_store.go - Postgres stores
store/postgres/user_store.go - SQLite stores
store/sqlite/user_store.go
Product extensions
- Email delivery hooks
notify/email_sender.go - Webhook events
webhooks.go - Audit digest
admin/digest.go - Config advisor
admin/tuning.go - Support assistant
admin/support.go - AI query widget
widget/ask.go - Query validation
ai/validate.go - Safe query store
store/sqlite/safe_query_store.go
Other components
- Host application
Connections 28
- Host application → Engine wiring: configures
- Host application → Public facade: calls operations
- Public facade → Engine wiring: uses
engine.go - Engine wiring → Account auth: wires dependencies
- Public facade → Account auth: dispatches auth
- Public facade → OAuth identities: dispatches OAuth
- Public facade → API keys: dispatches key auth
- Account auth → Tokens and claims: issues tokens
- Account auth → Session lifecycle: creates sessions
- Account auth → MFA and passkeys: supports second factor
- Engine wiring → Tokens and claims: constructs issuer
engine.go - Engine wiring → Security controls: wires controls
engine.go - Engine wiring → Store interfaces: accepts stores
engine.go - MFA and passkeys → Tokens and claims: verifies pending token
auth/webauthn.go - MFA and passkeys → Store interfaces: stores credentials
auth/webauthn.go - Public facade → Email delivery hooks: invokes sender
- Public facade → Webhook events: delivers events
webhooks.go - Public facade → Audit digest: offers digest
- Public facade → Config advisor: offers tuning advice
- Public facade → Support assistant: offers support tools
- Host application → AI query widget: uses widget
- AI query widget → Query validation: requests query
widget/ask.go - Query validation → Safe query store: validates then queries
- Safe query store → SQLite stores: reads safely
store/sqlite/safe_query_store.go - Safe query store → Postgres stores: alternate backend
- Engine wiring → Memory stores: can use
- Engine wiring → Postgres stores: can use
- Engine wiring → SQLite stores: can use