How t4ke0/pwm works
Password Manager is a multi-service password vault: users register or log in, receive a token carrying their user-key information, and use the gateway to manage encrypted credentials or generate passwords. The manager validates tokens with the authenticator, encrypts and decrypts vault entries, and accesses PostgreSQL; the key manager generates user keys and protects them with the server key. The excerpts show the main service calls and storage operations, but not all wiring or database schema details, so unsupported connections are omitted.
Main entry points: serve/main.go Registration and login · server/main.go Vault manager · server.go Key manager · db.go Database access
Components 16
HTTP access
- REST gateway
gateway/cmd/serve/main.go - Gateway API models
gateway/pkg/http/api/api.go
Identity and keys
- Registration and login
pwm_authenticator/cmd/serve/main.go - Auth request models
pwm_authenticator/api/request_api.go - JWT handling
pwm_authenticator/cmd/serve/jwt_token.go - Password hashing
pwm_authenticator/passwords/manage_passwords.go - Key manager
keys_manager/server/server.go - Key cryptography
keys_manager/common/encryption_keys.go - Key RPC contract
keys_manager/proto/keymanager.proto
Password vault
- Vault manager
pwm_manager/server/main.go - Vault RPC contract
pwm_manager/proto/pwm_manager.proto - Credential encryption
pwm_manager/passwords/passwords_encryption.go - Password generator
pwm_manager/pw_generator/generator.go
Persistence
- Database access
pwm_db_api/db.go - PostgreSQL
pwm_db_api/schema.sql
Other components
- Vault user
Connections 18
- Vault user → REST gateway: uses
gateway/cmd/serve/main.go - REST gateway → Gateway API models: maps requests
gateway/cmd/serve/main.go - REST gateway → Vault manager: calls RPC
gateway/cmd/serve/main.go - Vault user → Registration and login: registers or logs in
pwm_authenticator/cmd/serve/main.go - Registration and login → Auth request models: binds requests
pwm_authenticator/cmd/serve/main.go - Registration and login → Password hashing: hashes passwords
pwm_authenticator/cmd/serve/main.go - Registration and login → JWT handling: issues and parses
pwm_authenticator/cmd/serve/main.go - Registration and login → Key manager: requests keys
pwm_authenticator/cmd/serve/main.go - Key manager → Key RPC contract: implements RPC
keys_manager/server/server.go - Key manager → Key cryptography: generates and decrypts
keys_manager/server/server.go - Vault manager → Vault RPC contract: implements RPC
pwm_manager/server/main.go - Vault manager → Registration and login: fetches token claims
pwm_manager/server/main.go - Vault manager → Credential encryption: encrypts and decrypts
pwm_manager/server/main.go - Vault manager → Password generator: generates passwords
pwm_manager/server/main.go - Registration and login → Database access: reads and writes users
pwm_authenticator/cmd/serve/main.go - Key manager → Database access: loads and stores keys
keys_manager/server/server.go - Vault manager → Database access: reads and writes credentials
pwm_manager/server/main.go - Database access → PostgreSQL: queries
pwm_db_api/db.go