Skip to content

Add auth credential domain, infra & use-cases - #119

Draft
mzpx wants to merge 6 commits into
devfrom
feature/auth-credentials
Draft

Add auth credential domain, infra & use-cases#119
mzpx wants to merge 6 commits into
devfrom
feature/auth-credentials

Conversation

@mzpx

@mzpx mzpx commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Introduce Credential functionality across the auth module: adds Credential domain model with validation and update/create patterns; CredentialRepository and CredentialQueries protocols; database access layer (CredentialTable), repository (DatabaseCredentialRepository) and queries (DatabaseCredentialQueries); application DTOs/adapters, scopes, and use-cases (Add/Edit/Get/Remove) with authorization and password hashing; permission keys for credentials; DB migration to create auth_credentials table; and unit tests for Credential domain behavior. Also wires credential permissions into AuthPermissions and updates tests.

mzpx added 2 commits July 17, 2026 13:54
Introduce Credential functionality across the auth module: adds Credential domain model with validation and update/create patterns; CredentialRepository and CredentialQueries protocols; database access layer (CredentialTable), repository (DatabaseCredentialRepository) and queries (DatabaseCredentialQueries); application DTOs/adapters, scopes, and use-cases (Add/Edit/Get/Remove) with authorization and password hashing; permission keys for credentials; DB migration to create auth_credentials table; and unit tests for Credential domain behavior. Also wires credential permissions into AuthPermissions and updates tests.
@mzpx
mzpx requested a review from viaszkadi July 17, 2026 12:27
mzpx added 4 commits July 20, 2026 10:46
Updated VSCode tasks to automatically manage Docker containers: 'Ensure Local Dependencies' now runs `make docker-up` after dependencies, and 'Stop running app' now runs `make docker-down` to clean up containers.
Add complete CRUD and search API for managing user credentials in the admin panel. Includes credential creation, listing, searching, updating (PUT/PATCH), bulk deletion, and filtering. Implements both application-layer use cases and HTTP handlers following FATHOMS pattern. Adds new CredentialList DTO and extends auth permissions with list action.
Add a dedicated UserCredentialSearchFilterSchema to the OpenAPI spec (admin.yaml and versioned files) and regenerate client types. Update server to return the new filter shape (default search="", accountID=nil) and normalize empty accountID to nil when searching. Update generated response mapping and tests to expect the new schema. This makes credential list filtering explicit and avoids treating empty account IDs as real values.
Register DatabaseCredentialRepository in AuthModule builders and add CredentialRepository to the WriteAuth scope. Update SignInWithCredentials to fetch the credential first, verify the password against credential.passwordHash, and then load the account by credential.accountID. Add credential seeding to TableSeedMigration: import BCrypt and NIOPosix, hash initial passwords on the NIOThreadPool, and insert auth_credentials rows (root/manager/user). This centralizes credential access and seeds initial credentials securely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant