How naliyev02/identity-service works
This is an ASP.NET identity service for registration, authentication, account recovery, session management, and role/permission administration. The primary flow is a client request through an API controller, dispatched with MediatR to an application feature, which applies identity rules and uses persistence or security abstractions. The graph also preserves user administration, RBAC, verification email, and token/session concerns. Relationships involving unsampled handlers are included only where the SOURCE INDEX names the dependency; optional email delivery is marked unverified.
Main entry points: Authentication Authentication features · AppDbContext.cs Identity database context · UsersController.cs Users API · Roles Role features
Components 20
HTTP API
- Authentication API
src/Identity.API/Controllers/AuthController.cs - Users API
src/Identity.API/Controllers/UsersController.cs - Roles API
src/Identity.API/Controllers/RolesController.cs - Sessions API
src/Identity.API/Controllers/SessionsController.cs
Application workflows
- Authentication features
src/Identity.Application/Features/Authentication - User features
src/Identity.Application/Features/Users - Role features
src/Identity.Application/Features/Roles - Permission queries
src/Identity.Application/Features/Permissions - Session services
src/Identity.Application/Services/CurrentSessionLocator.cs - Persistence contracts
src/Identity.Application/Abstractions/Persistence/ISessionRepository.cs - Email sender contract
src/Identity.Application/Abstractions/Messaging/IEmailSender.cs - Token contracts
src/Identity.Application/Abstractions/Security/IAccessTokenIssuer.cs
Identity domain
- User and session model
src/Identity.Domain/User/Entities/User.cs - Role and permission model
src/Identity.Domain/Role/Entities/Role.cs - Verification token model
src/Identity.Domain/User/Entities/EmailVerificationToken.cs
Infrastructure
- Entity repositories
src/Identity.Infrastructure/Persistence/Repositories - Identity database context
src/Identity.Infrastructure/Persistence/AppDbContext.cs - Email delivery
src/Identity.Infrastructure/Email/SmtpEmailSender.cs - Token implementations
src/Identity.Infrastructure/Security/JwtAccessTokenIssuer.cs
Other components
- API client
Connections 21
- API client → Authentication API: sends auth requests
src/Identity.API/Controllers/AuthController.cs - API client → Users API: sends user requests
src/Identity.API/Controllers/UsersController.cs - API client → Roles API: sends role requests
src/Identity.API/Controllers/RolesController.cs - API client → Sessions API: sends session requests
src/Identity.API/Controllers/SessionsController.cs - Authentication API → Authentication features: dispatches commands
src/Identity.API/Controllers/AuthController.cs - Users API → User features: dispatches queries
src/Identity.API/Controllers/UsersController.cs - Users API → Role features: dispatches role assignment
src/Identity.API/Controllers/UsersController.cs - Roles API → Role features: dispatches role requests
src/Identity.API/Controllers/RolesController.cs - Sessions API → Authentication features: dispatches session actions
src/Identity.API/Controllers/SessionsController.cs - Authentication features → Persistence contracts: uses session repository
src/Identity.Application/Features/Authentication/Commands/RevokeMySession/RevokeMySessionHandler.cs - Authentication features → Session services: locates current session
src/Identity.Application/Features/Authentication/Commands/RevokeMySession/RevokeMySessionHandler.cs - Authentication features → User and session model: uses user entity
src/Identity.API/Controllers/AuthController.cs - Entity repositories → Identity database context: queries and updates
src/Identity.Infrastructure/Persistence/Repositories/SessionRepository.cs - Identity database context → User and session model: maps entities
src/Identity.Infrastructure/Persistence/AppDbContext.cs - Identity database context → Role and permission model: maps entities
src/Identity.Infrastructure/Persistence/AppDbContext.cs - Identity database context → Verification token model: maps entities
src/Identity.Infrastructure/Persistence/AppDbContext.cs - Authentication features → Email sender contract: may send verification mail
- Email sender contract → Email delivery: may deliver email
- Authentication features → Token contracts: uses token services
src/Identity.Application/Features/Authentication/Commands/Login/LoginHandler.cs - User features → Persistence contracts: uses persistence contracts
- Role features → Persistence contracts: uses persistence contracts