Skip to content

T4: Fix gateway routing for Identity service#66

Open
devin-ai-integration[bot] wants to merge 1 commit into
devin/identity-t3-apifrom
devin/identity-t4-gateway
Open

T4: Fix gateway routing for Identity service#66
devin-ai-integration[bot] wants to merge 1 commit into
devin/identity-t3-apifrom
devin/identity-t4-gateway

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove the PathRemovePrefix transform from the identity-route in src/ApiGateway/appsettings.json.

The Identity service controller uses [Route("api/[controller]")], so it expects the full /api/identity/… prefix on incoming requests. The PathRemovePrefix: "/api/identity" transform was stripping that prefix before forwarding, causing the service to receive bare paths like /login instead of /api/identity/login — resulting in 404s.

 "identity-route": {
   "ClusterId": "identity-cluster",
-  "Match": { "Path": "/api/identity/{**catch-all}" },
-  "Transforms": [{ "PathRemovePrefix": "/api/identity" }]
+  "Match": { "Path": "/api/identity/{**catch-all}" }
 }

Verified via docker compose: register, login, and 401 on /users without token all work correctly through the gateway at localhost:5000.

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/0f07b7a8f1014aec962930431c54da9f
Requested by: @mbatchelor81


Open in Devin Review

The Identity service controller uses [Route("api/[controller]")] which
expects the full /api/identity prefix. Removing the PathRemovePrefix
transform so the gateway forwards the original path as-is.
@mbatchelor81 mbatchelor81 self-assigned this Jun 26, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

"Match": { "Path": "/api/identity/{**catch-all}" }
},
"customer-route": {
"ClusterId": "customer-cluster",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Other service routes may have the same prefix-stripping mismatch that was fixed here for identity

The identity route's PathRemovePrefix was removed because the Identity service controller uses [Route("api/[controller]")] (IdentityController.cs:9), which means it expects the full path /api/identity/.... The same pattern applies to the other services — for example, CustomerController uses [Route("api/[controller]")] (Customer.API/Controllers/CustomerController.cs:6), resolving to api/customer (singular). But the gateway matches /api/customers/ (plural) and strips that prefix, forwarding bare paths like / or /{id} to the customer service, which expects api/customer/.... This means the customer, order, product, and notification routes likely have the same bug that was just fixed for identity — the PathRemovePrefix transforms would result in 404s unless those services use different route prefixes or the controller names happen to match the plural gateway paths. Worth verifying whether the remaining four routes need the same fix.

(Refers to lines 16-34)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid observation — the other service routes may indeed have similar routing mismatches (especially the plural/singular discrepancy like /api/customers/ vs api/customer). However, this PR is intentionally scoped to the identity route only per task requirements. The other routes should be evaluated and fixed in a separate PR.

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