-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: decision record about Protocol Services refactor
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
docs/developer/decision-records/2023-11-27-refactor-protocol-services/README.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Protocol Services Refactor | ||
|
||
## Decision | ||
|
||
Decouple the DSP (or other) protocol from the identity service and move the security checks (`IdentityService#verifyJwtToken`) | ||
to the protocol service layer. | ||
|
||
## Rationale | ||
|
||
Implementations of `IdentityService`s may need additional context/request information when verifying the JWT token. At the | ||
DSP (or other protocols) layer we don't have such information. Moving the security checks on the protocol services layer will | ||
allow us to attach contextual information to a specific request (e.g. current policy if any). | ||
|
||
## Approach | ||
|
||
We will remove the usage of `IdentityService` from the `DspRequestHandlerImpl` and change the `serviceCall` field | ||
|
||
from: | ||
|
||
```java | ||
BiFunction<I, ClaimToken, ServiceResult<R>> serviceCall; | ||
``` | ||
to: | ||
```java | ||
BiFunction<I, TokenRepresentation, ServiceResult<R>> serviceCall; | ||
``` | ||
|
||
This will impact each method of the three protocol service we have now: | ||
|
||
- `CatalogProtocolService` | ||
- `TransferProcessProtocolService` | ||
- `ContractNegotiationProtocolService` | ||
|
||
In each implementation of such services, we'd have to call then the `IdentityService` for verifying the JWT token. |
This file contains 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