-
Notifications
You must be signed in to change notification settings - Fork 140
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
Add KRA KeyRequestService to v2 APIs #4821
Conversation
b27d24c
to
df22cd9
Compare
df22cd9
to
9740d25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some comments but overall it LGTM.
"approve")); | ||
|
||
} catch (EAuthzAccessDenied e) { | ||
throw new UnauthorizedException("Not authorized to approve request", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is identical to the original code, but do you think we should log an audit event here? No need to fix the code now, but maybe just add a TODO comment for a future review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this exception (and some other) there is no audit failure while in other there is. I have added the TODO in all cases for future evaluation.
In my opinion this should not generate a failure event for the operation in the audit because the authorisation stop any processing before it start. An authorisation failure event could be possible but not one related to the following operation.
An improvement of this would be to move the authorisation check in the ACL filter and decide what the audit should include for the authorisation event.
id, | ||
"reject")); | ||
}catch (EAuthzAccessDenied e) { | ||
throw new UnauthorizedException("Not authorized to reject request", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here.
id, | ||
"cancel")); | ||
} catch (EAuthzAccessDenied e) { | ||
throw new UnauthorizedException("Not authorized to cancel request", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here.
} | ||
} | ||
|
||
private KeyRequestResponse generateASymKey(Principal userPrincipal, String baseUrl, AsymKeyGenerationRequest data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC this method is generating an asymmetric key (as opposed to a symmetric key), so the method probably should be called generateAsymKey()
with lower case s
to avoid confusions.
return createKeyRequestResponse(request, baseUrl); | ||
} | ||
|
||
private KeyRequestResponse submitGenerateASymKeyRequest(AsymKeyGenerationRequest data, String userName, String baseUrl) throws EBaseException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here with AsymKey
instead of ASymKey
.
RequestId requestID; | ||
if (ephemeral) { | ||
requestID = createEphemeralRequestID(); | ||
} else { | ||
requestID = requestRepository.createRequestID(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issue here, I just want to point out that ephemeral request ID is probably no longer needed with RSNv3, so it's something that can be removed in the future.
9740d25
to
525435b
Compare
@edewata Thanks! I have update the method name and added the |
|
There is a difference related to the start parameter for the list request. In the v1 APIs this is the RequestId to start from but here it is just an index. A similar change was implemented in #4672 and it is in the right direction moving from sequential to random ids.