Alon Bar-Lev has posted comments on this change. Change subject: aaa: Introducing format to id of User and Group API entities ......................................................................
Patch Set 3: (2 comments) http://gerrit.ovirt.org/#/c/26191/3//COMMIT_MSG Commit Message: Line 14: internal_id= the primary key of the user or group as stored in db Line 15: provider_id = <directory_name>:<id_of_entity_in_directory> Line 16: Line 17: directory_name = name of the directory Line 18: entity_in_directory = id of principal or group it should be one of the options, not both in any case. Or: url_encode(id=<internal>) Or: url_encode(provider_id=<directory>:<id_with_directory) There should never be both, unless there is a reason... but I do not see any. Line 19: Line 20: Topic: AAA Line 21: Change-Id: Iaecb5d43945769db82475edde1c7075c1a343c07 http://gerrit.ovirt.org/#/c/26191/3/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/utils/DirectoryEntryIdUtils.java File backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/utils/DirectoryEntryIdUtils.java: Line 9: public class DirectoryEntryIdUtils { Line 10: Line 11: // ID is in format of "id=<UUID>:provider_name=<string>:<string>" Line 12: private static final Pattern ID_PATTERN = Line 13: Pattern.compile("(id=)([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}):(provider_id=)(.+:.+)"); please always use named groups[1] In your case it should be something like: (id=(?<id>.*)|(providerid=(?<provider>([^:]*):(?<provider_id>.*)) then you have group("id") != null for internal and group("provider") != null && group("provider_id") != null for provider no point to verify the uuid, as you simply won't find it in table. [1] http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=blob;f=backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/filter/FirstMatchSimpleFilter.java;hb=HEAD#l19 Line 14: Line 15: /** Line 16: * Gets the internal id part from the id string Line 17: * @param id the id string -- To view, visit http://gerrit.ovirt.org/26191 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaecb5d43945769db82475edde1c7075c1a343c07 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches