Skip to content

Comments

refactor: separate struct for several services and create a wrapper#542

Merged
NathaelB merged 10 commits intomainfrom
538-refactor-service-struct-to-group-repositories-by-domain
Nov 25, 2025
Merged

refactor: separate struct for several services and create a wrapper#542
NathaelB merged 10 commits intomainfrom
538-refactor-service-struct-to-group-repositories-by-domain

Conversation

@NathaelB
Copy link
Member

No description provided.

Introduce a services module containing ApplicationService which wraps a
SecurityEventServiceImpl parameterized over Postgres repo type aliases.
Add a seawatch module that implements SecurityEventService for
ApplicationService by delegating fetch_events to the inner service.
Export both modules from application mod.
@NathaelB NathaelB self-assigned this Nov 25, 2025
@NathaelB NathaelB linked an issue Nov 25, 2025 that may be closed by this pull request
Implement CredentialServiceImpl with get_credentials and
delete_credential (realm lookup, policy checks, repository calls). Add
PostgresCredentialRepository type and wire credential_service into
ApplicationService. Expose application::credential and implement
CredentialService for ApplicationService. Add TODO webhook notifier in
delete flow.
Add ClientServiceImpl providing client, redirect-uri and role management
with policy checks, webhook notifications and security event recording.
Add application-level client adapter (app/client) that delegates
ClientService to ApplicationService and wire required repositories and
types into the services setup.
@LeadcodeDev LeadcodeDev added this to the v0.2.0 milestone Nov 25, 2025
Change create_service to build and return ApplicationService. Wrap
repositories and shared FerriskeyPolicy in Arc and pass cloned Arcs into
service implementations. Add new(...) constructors for many domain
services to accept Arc dependencies. Update
RandBytesRecoveryCodeRepository to take an Arc<HasherRepository> Add Arc
constructors and application builder
Remove the monolithic Service generic and its wide impl blocks across
domains. Introduce concrete *Impl structs (CoreServiceImpl,
AuthServiceImpl, ClientServiceImpl, etc.), move GenerateTokenInput into
authentication value_objects, simplify imports/type parameters, and
delete now-unused modules (authenticate.rs, grant_type_service.rs) and
the FerrisKeyService alias.
@NathaelB NathaelB marked this pull request as ready for review November 25, 2025 20:28
@NathaelB NathaelB merged commit 75d73a1 into main Nov 25, 2025
8 checks passed
@NathaelB NathaelB deleted the 538-refactor-service-struct-to-group-repositories-by-domain branch November 25, 2025 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Refactor service struct to group repositories by domain

2 participants