Skip to content

Commit 75dd090

Browse files
committed
feat: check for missing token ciphertext in request header
1 parent d5e12e3 commit 75dd090

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

grpc_services/v3/revoke_oauth2_token.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ def RevokeOAuth2Token(self, request, context):
2525
if auth_error:
2626
return auth_error
2727

28+
if not payload_bin:
29+
logger.error("missing token ciphertext in request payload")
30+
return self.handle_create_grpc_error_response(
31+
context,
32+
response,
33+
"token ciphertext is required in the request payload",
34+
grpc.StatusCode.INVALID_ARGUMENT,
35+
)
36+
2837
invalid = self.handle_request_field_validation(
2938
context, request, response, ["token_id", "key_id"]
3039
)

grpc_services/v3/revoke_pnba_token.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ def RevokePNBAToken(self, request, context):
2525
if auth_error:
2626
return auth_error
2727

28+
if not payload_bin:
29+
logger.error("missing token ciphertext in request payload")
30+
return self.handle_create_grpc_error_response(
31+
context,
32+
response,
33+
"token ciphertext is required in the request payload",
34+
grpc.StatusCode.INVALID_ARGUMENT,
35+
)
36+
2837
invalid = self.handle_request_field_validation(
2938
context, request, response, ["token_id", "key_id"]
3039
)

0 commit comments

Comments
 (0)