Pick the fix
Which responsibility belongs in the gateway, not the order service?
Hint 1 of 1
Which check needs no business data?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Rejecting requests with an invalid or expired access token
Correct. A uniform edge check every service benefits from.
A gateway can check what every request has in common, like whether the token is valid. Whether this user may touch order 42 needs the order's data, so that check stays in the service that owns it.
Why not the others?
- B Checking the user owns order 42 before editing. Object-level authorization needs order data.
- C Calculating discounts. Business logic.
- D Deciding which warehouse ships. Domain logic.