You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We will work on this in chunks, first we will add the 5x CRUD requests for Programs then review the process and make changes as necessary.
The work required should be to create new REST endpoints in a new controller (not public) for these actions that parse request data into the DTO objects degined by the protobuf, and then send this data through to the existing ProgramService exposed through the ProgramServiceFacade. Because all the existing code is designed to handle incoming protobuff generated DTOs and then convert them to the DB model, it may be easiest to continue using these objects.
Additionally, we will need to make a new Authorization handler that works with REST to replace the GRPC Interceptor. The Auth interceptor should implement standard Oauth2 bearer token security, this will look for a Header in the incoming request called Authorization with a value Bearer <JWT>. The JWT needs to be validated agains the Ego public key. There should be standard Sping Security packages to handle this check and return the validated JWT. The class EgoAuthorizationService has the code for interpretting the JWT and converting it into the user's permissions. Any incoming request that does not have the correct permissions should be responded with the following code:
no token or invalid token = 401
valid token but incorrect permissions = 403
The permissions required for each endpoint can be found in the GRPC ProgramServiceImpl.
Goal
Replace all GRPCs functions with REST API.
The list of RPC services that need to be replaced are found in https://github.com/icgc-argo/program-service/blob/develop/src/main/proto/ProgramService.proto
We will work on this in chunks, first we will add the 5x CRUD requests for Programs then review the process and make changes as necessary.
The work required should be to create new REST endpoints in a new controller (not public) for these actions that parse request data into the DTO objects degined by the protobuf, and then send this data through to the existing ProgramService exposed through the ProgramServiceFacade. Because all the existing code is designed to handle incoming protobuff generated DTOs and then convert them to the DB model, it may be easiest to continue using these objects.
Additionally, we will need to make a new Authorization handler that works with REST to replace the GRPC Interceptor. The Auth interceptor should implement standard Oauth2 bearer token security, this will look for a Header in the incoming request called
Authorization
with a valueBearer <JWT>
. The JWT needs to be validated agains the Ego public key. There should be standard Sping Security packages to handle this check and return the validated JWT. The class EgoAuthorizationService has the code for interpretting the JWT and converting it into the user's permissions. Any incoming request that does not have the correct permissions should be responded with the following code:no token or invalid token = 401
valid token but incorrect permissions = 403
The permissions required for each endpoint can be found in the GRPC ProgramServiceImpl.
The text was updated successfully, but these errors were encountered: