Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: decision record about Protocol Services refactor #3665

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
wolf4ood marked this conversation as resolved.
Show resolved Hide resolved
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 in `DspRequest`

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.
2 changes: 2 additions & 0 deletions docs/developer/decision-records/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@
- [2023-09-07 Policy Monitor](./2023-09-07-policy-monitor)
- [2023-10-04 JSON-LD Scopes](./2023-10-04-json-ld-scopes)
- [2023-11-09 API Versioning](./2023-11-09-api-versioning)
- [2023-11-09 Protocol Services Refactor](./2023-11-27-refactor-protocol-services)

Loading