Extract identity/account bounded context into Identity service - #91
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the identity/account bounded context out of
quickapp-monolithintosrc/Services/Identity, keeping the route shape and token behavior identical so the Angular client works unchanged when pointed at the gateway. Everything lands behind the existing YARP route/api/identity/*(prefix stripped), so/api/identity/connect/tokenand/api/identity/api/account/*answer on:5000.src/ApiGateway/**is untouched.Layout follows the boundaries doc:
Identity.Domain—ApplicationUser,ApplicationRole,ApplicationPermission,ApplicationPermissions,CustomClaims, account exceptions, service interfaces. No EF, no ASP.NET.Identity.Infrastructure—IdentityDbContext(ASP.NET Identity + OpenIddict tables, auditing viaIUserIdAccessor),UserAccountService,UserRoleService,DatabaseSeeder, initial Npgsql migration.Identity.API—AuthorizationController(~/connect/token, password + refresh_token),UserAccountController(api/account/users*),UserRoleController(api/account/roles*,api/account/permissions),OidcServerConfig, authorization policies/requirements/handlers,ViewModels/Account/*, AutoMapper profile.Identity.Tests— xUnit, added tosrc/Microservices.sln.Cross-context links cut
The two places the monolith reached into Order-owned data are gone; no other behavior was redesigned:
MappingProfilekeeps only the account maps (the monolith'sCustomer/Product/Ordermaps are dropped), andDatabaseSeederseeds only roles/users/OpenIddict clients — no shop demo data.Seeded state (unchanged from the monolith)
administrator(all permission values) anduser(none); accountsadmin/user, bothtempP@ss123; OpenIddict clientsquickapp_spaandswagger_ui; custom claimsfullname,jobtitle,configuration,permission, with the Identity security stamp excluded from tokens.Notable deltas from a straight copy
DatabaseSeederretriesMigrateAsync()(10 × 5s) — compose hasdepends_on: postgresbut no healthcheck, so a coldupotherwise races the database and the service exits.OIDC:Certificates:Pathis set, otherwise ephemeral keys (the monolith's dev-certificate store isn't usable in the container). Tokens do not survive a service restart in compose; production needs the cert config.15.1.1, not the monolith's13.0.1: 13.x/14.x are flagged by GHSA-rvv3-g6hj-g44x. This changes only the registration call (AddAutoMapper(cfg => cfg.AddMaps(...))).Verification
Through the gateway on
:5000(compose,postgres+identity-service+api-gateway):Blockers hit while verifying (not fixed here)
docker compose -f src/docker-compose.yml up --builddoes not complete:notification-servicefails to build on the known pre-existing bug —Notification.API.csprojreferences..\..\Sharedinstead of..\..\..\Shared. Per the boundaries doc that file is not mine to touch, so the boot above was scoped topostgres,identity-serviceandapi-gateway(--no-deps). Everything else in the compose file builds.rabbitmq:3-management-alpinecould not be pulled on this machine (Docker Hub 429 / mirror data cap). Identity does not use RabbitMQ, so it was skipped.Expected conflicts with the Customer PR (#88)
Two overlaps, both trivial, to be resolved by rebasing onto
mainafter #88 merges:src/Microservices.sln— this PR only addsIdentity.Tests.src/Services/Identity/Identity.API/Identity.API.csproj— this PR rewrites the file wholesale (packages + references) and already uses the correct..\..\..\Sharedpaths that Extract Customer bounded context into the Customer service #88 fixes. No other service's csproj is touched, and nothing was copied from Extract Customer bounded context into the Customer service #88's branch.Leftover TODOs: persistent signing/encryption certificates for non-local environments; a compose healthcheck on
postgreswould let the seeder retry loop go away.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/edccab73d9404e79bc20b6d17042f787