[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16310935#comment-16310935 ] ASF GitHub Bot commented on CLOUDSTACK-10205: - rhtyd closed pull request #2378: CLOUDSTACK-10205 make LinkDomainToLdap return UUID instead of internal id URL: https://github.com/apache/cloudstack/pull/2378 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index 55e8c285e6b..98b5ccb99a1 100644 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -705,6 +705,7 @@ public static final String HAS_ANNOTATION = "hasannotation"; public static final String LAST_ANNOTATED = "lastannotated"; +public static final String LDAP_DOMAIN = "ldapdomain"; public enum HostDetails { all, capacity, events, stats, min; diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/response/LinkDomainToLdapResponse.java b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/response/LinkDomainToLdapResponse.java index b0032b04b4d..050eb6c3eb5 100644 --- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/response/LinkDomainToLdapResponse.java +++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/response/LinkDomainToLdapResponse.java @@ -27,12 +27,17 @@ @SerializedName(ApiConstants.DOMAIN_ID) @Param(description = "id of the Domain which is linked to LDAP") -private long domainId; +private String domainId; +@Deprecated @SerializedName(ApiConstants.NAME) @Param(description = "name of the group or OU in LDAP which is linked to the domain") private String name; +@SerializedName(ApiConstants.LDAP_DOMAIN) +@Param(description = "name of the group or OU in LDAP which is linked to the domain") +private String ldapDomain; + @SerializedName(ApiConstants.TYPE) @Param(description = "type of the name in LDAP which is linke to the domain") private String type; @@ -45,19 +50,25 @@ @Param(description = "Domain Admin accountId that is created") private String adminId; -public LinkDomainToLdapResponse(long domainId, String type, String name, short accountType) { +public LinkDomainToLdapResponse(String domainId, String type, String ldapDomain, short accountType) { this.domainId = domainId; -this.name = name; +this.name = ldapDomain; +this.ldapDomain = ldapDomain; this.type = type; this.accountType = accountType; } -public long getDomainId() { +public String getDomainId() { return domainId; } +public String getLdapDomain() { +return ldapDomain == null ? name : ldapDomain; +} + +@Deprecated public String getName() { -return name; +return ldapDomain == null ? name : ldapDomain; } public String getType() { diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java index a4d340647f4..beb7a61cd70 100644 --- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java +++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapManagerImpl.java @@ -44,6 +44,8 @@ import org.apache.log4j.Logger; import org.springframework.stereotype.Component; +import com.cloud.domain.DomainVO; +import com.cloud.domain.dao.DomainDao; import com.cloud.exception.InvalidParameterValueException; import com.cloud.utils.Pair; @@ -54,6 +56,9 @@ @Inject private LdapConfigurationDao _ldapConfigurationDao; +@Inject +private DomainDao domainDao; + @Inject private LdapContextFactory _ldapContextFactory; @@ -270,7 +275,14 @@ public LinkDomainToLdapResponse linkDomainToLdap(Long domainId, String type, Str Validate.isTrue(accountType==0 || accountType==2, "accountype should be either 0(normal user) or 2(domain admin)"); LinkType linkType = LdapManager.LinkType.valueOf(type.toUpperCase()); LdapTrustMapVO vo = _ldapTrustMapDao.persist(new LdapTrustMapVO(domainId, linkType, name, accountType)); -LinkDomainToLdapResponse response = new LinkDomainToLdapResponse(vo.getDomainId(), vo.getType().toString(), vo.getName(), vo.getAccountType()); +DomainVO domain = domainDao.findById(vo.getDomainId()); +String domainUuid = ""; +if (domain == null) { +s_logger.error("no domain in database for id " +
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16310933#comment-16310933 ] ASF GitHub Bot commented on CLOUDSTACK-10205: - rhtyd commented on issue #2378: CLOUDSTACK-10205 make LinkDomainToLdap return UUID instead of internal id URL: https://github.com/apache/cloudstack/pull/2378#issuecomment-355219656 Merging this based on code reviews (2x) lgtms and test results. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should contain the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16310934#comment-16310934 ] ASF subversion and git services commented on CLOUDSTACK-10205: -- Commit 8131bccd979d764cbab44705dd7f1d9539fd06ef in cloudstack's branch refs/heads/master from [~dahn] [ https://gitbox.apache.org/repos/asf?p=cloudstack.git;h=8131bcc ] CLOUDSTACK-10205: LinkDomainToLdap returns UUID instead of internal id (#2378) The internal id is not usefull to the user. It is a bug to return it instead of a uuid. In the process of fixing the above "name" was deprecated in favour of "ldap_domain". > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should contain the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16310764#comment-16310764 ] ASF GitHub Bot commented on CLOUDSTACK-10205: - rhtyd commented on issue #2378: CLOUDSTACK-10205 make LinkDomainToLdap return UUID instead of internal id URL: https://github.com/apache/cloudstack/pull/2378#issuecomment-355203722 @nvazquez @borisstoyanov can you review this? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should contain the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16308009#comment-16308009 ] ASF GitHub Bot commented on CLOUDSTACK-10205: - rhtyd commented on issue #2378: CLOUDSTACK-10205 make LinkDomainToLdap return UUID instead of internal id URL: https://github.com/apache/cloudstack/pull/2378#issuecomment-354762379 Tests LGTM, additional review requested for merging this. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should contain the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305722#comment-16305722 ] ASF GitHub Bot commented on CLOUDSTACK-10205: - blueorangutan commented on issue #2378: CLOUDSTACK-10205 make LinkDomainToLdap return UUID instead of internal id URL: https://github.com/apache/cloudstack/pull/2378#issuecomment-354353577 Trillian test result (tid-1938) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 35673 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2378-t1938-kvm-centos7.zip Intermitten failure detected: /marvin/tests/smoke/test_deploy_virtio_scsi_vm.py Intermitten failure detected: /marvin/tests/smoke/test_vpc_redundant.py Intermitten failure detected: /marvin/tests/smoke/test_vpc_vpn.py Intermitten failure detected: /marvin/tests/smoke/test_hostha_kvm.py Smoke tests completed. 65 look OK, 1 have error(s) Only failed tests results shown below: Test | Result | Time (s) | Test File --- | --- | --- | --- test_hostha_kvm_host_fencing | `Error` | 639.73 | test_hostha_kvm.py This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should contain the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305311#comment-16305311 ] ASF GitHub Bot commented on CLOUDSTACK-10205: - blueorangutan commented on issue #2378: CLOUDSTACK-10205 make LinkDomainToLdap return UUID instead of internal id URL: https://github.com/apache/cloudstack/pull/2378#issuecomment-354267065 @rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should contain the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305310#comment-16305310 ] ASF GitHub Bot commented on CLOUDSTACK-10205: - rhtyd commented on issue #2378: CLOUDSTACK-10205 make LinkDomainToLdap return UUID instead of internal id URL: https://github.com/apache/cloudstack/pull/2378#issuecomment-354266931 @blueorangutan test This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should contain the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305301#comment-16305301 ] ASF GitHub Bot commented on CLOUDSTACK-10205: - blueorangutan commented on issue #2378: CLOUDSTACK-10205 make LinkDomainToLdap return UUID instead of internal id URL: https://github.com/apache/cloudstack/pull/2378#issuecomment-354265926 Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1511 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should contain the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305277#comment-16305277 ] ASF GitHub Bot commented on CLOUDSTACK-10205: - DaanHoogland commented on issue #2378: CLOUDSTACK-10205 make LinkDomainToLdap return UUID instead of internal id URL: https://github.com/apache/cloudstack/pull/2378#issuecomment-35426 @rhtyd I changed the title back. it describes the situation as it is implemented not as it was (that is more a title of an issue reported) litle improvement added This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should contain the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305260#comment-16305260 ] ASF GitHub Bot commented on CLOUDSTACK-10205: - DaanHoogland commented on issue #2378: CLOUDSTACK-10205 LinkDomainToLdap return UUID instead of internal id URL: https://github.com/apache/cloudstack/pull/2378#issuecomment-35426 @rhtyd I changed the title back. it describes the situation as it is implemented not as it was (that is more a title of an issue reported) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should contain the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305244#comment-16305244 ] ASF GitHub Bot commented on CLOUDSTACK-10205: - blueorangutan commented on issue #2378: CLOUDSTACK-10205 LinkDomainToLdap returns internal id instead of UUID URL: https://github.com/apache/cloudstack/pull/2378#issuecomment-354260440 @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should contain the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305242#comment-16305242 ] ASF GitHub Bot commented on CLOUDSTACK-10205: - rhtyd commented on issue #2378: CLOUDSTACK-10205 LinkDomainToLdap returns internal id instead of UUID URL: https://github.com/apache/cloudstack/pull/2378#issuecomment-354260336 @DaanHoogland I've fixed the title based on description and code (returns internal id than uuid). Actually, the APIs do support listing by internal id (long). I'll kick some tests. @blueorangutan package This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should contain the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16304463#comment-16304463 ] ASF GitHub Bot commented on CLOUDSTACK-10205: - DaanHoogland opened a new pull request #2378: CLOUDSTACK-10205 LinkDomainToLdap returns UUID instead of internal id URL: https://github.com/apache/cloudstack/pull/2378 the internal id is not usefull to the user. It is a bug to return it instead of a uuid. In the process of fixing the above "name" was deprecated in favour of "ldap_domain". This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should contain the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CLOUDSTACK-10205) LinkDomainToLdap returns internal id
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16301492#comment-16301492 ] Daan Hoogland commented on CLOUDSTACK-10205: this is an standalone issue but was found during development of CLOUDSTACK-10117 > LinkDomainToLdap returns internal id > > > Key: CLOUDSTACK-10205 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10205 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Daan Hoogland > > The response should conatin the uuid for the domain and not the internal db > id. -- This message was sent by Atlassian JIRA (v6.4.14#64029)