Ori Liel has posted comments on this change.
Change subject: restapi: cloud-init - rest api for start vm
......................................................................
Patch Set 14:
(1 comment)
....................................................
File
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
Line 903: entity.setHostname(model.getHostName());
Line 904: }
Line 905:
Line 906: if (model.isSetAuthorizedKeys() &&
!model.getAuthorizedKeys().getAuthorizedKey().isEmpty()) {
Line 907: StringBuilder keys = new StringBuilder();
I agree with this API modelling, which leaves flexibility to support more users
(not just 'root') in the future without breaking or deprecating API.
But it comes with a price. API-wise a client may legally supply two or more
users, and obviously only one of them would be 'root'. It's not ok for the
application to regard only 'root' and *silently* ignore the other user/s. The
client would not know that only part of his request was executed.
I believe that there must be a validation. If the user supplied a user which is
not 'root' - his request should fail with a meaningful message (something like:
"Currently only 'root' user supported...") This validation may exist either in
the API layer, or in the Engine layer, as a canDoAction() predicate. I believe
the latter is better, because that way other clients of this command would
benefit from it.
Line 908: for (AuthorizedKey authKey :
model.getAuthorizedKeys().getAuthorizedKey()) {
Line 909: if ("root".equals(authKey.getUser().getName())) {
Line 910: if (keys.length() > 0) {
Line 911: keys.append("\n");
--
To view, visit http://gerrit.ovirt.org/15537
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I6ad0bfeca23cf8d4b2887010081d63c258032611
Gerrit-PatchSet: 14
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Ori Liel <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches