[10/13] ambari git commit: AMBARI-21307 Feature for supporting LDAP configuration from the UI
http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7a7a70/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java new file mode 100644 index 000..db0e5a9 --- /dev/null +++ b/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java @@ -0,0 +1,215 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.ldap.service; + +import java.util.Map; +import java.util.Set; + +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys; +import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration; +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory; +import org.apache.ambari.server.ldap.domain.TestAmbariLdapConfigurationFactory; +import org.easymock.Capture; +import org.easymock.EasyMock; +import org.easymock.EasyMockRule; +import org.easymock.EasyMockSupport; +import org.easymock.Mock; +import org.easymock.MockType; +import org.easymock.TestSubject; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + +/** + * Unit test suite for the LdapFacade operations. + */ +public class AmbariLdapFacadeTest extends EasyMockSupport { + + @Rule + public EasyMockRule mocks = new EasyMockRule(this); + + @Mock(type = MockType.STRICT) + public LdapConfigurationService ldapConfigurationServiceMock; + + @Mock(type = MockType.STRICT) + public LdapAttributeDetectionService ldapAttributeDetectionServiceMock; + + private AmbariLdapConfigurationFactory ambariLdapConfigurationFactory; + + + @TestSubject + private LdapFacade ldapFacade = new AmbariLdapFacade(); + + private AmbariLdapConfiguration ambariLdapConfiguration; + + + private Capture ambariLdapConfigurationCapture; + + @Before + public void before() { +ambariLdapConfigurationFactory = new TestAmbariLdapConfigurationFactory(); +ambariLdapConfiguration = ambariLdapConfigurationFactory.createLdapConfiguration(Maps.newHashMap()); +ambariLdapConfigurationCapture = Capture.newInstance(); + + +resetAll(); + } + + /** + * Tests whether the facade method call delegates to the proper service call. + * The thest is success if the same instance is passed to the service. + * + * @throws Exception + */ + @Test + public void testShouldConfigurationCheckDelegateToTheRightServiceCall() throws Exception { +// GIVEN +// the mocks are set up + ldapConfigurationServiceMock.checkConnection(EasyMock.capture(ambariLdapConfigurationCapture)); +replayAll(); +// WHEN +// the facade method is called +ldapFacade.checkConnection(ambariLdapConfiguration); + +// THEN +// the captured configuration instance is the same the facade method got called with +Assert.assertEquals("The configuration instance souldn't change before passing it to the service", + ambariLdapConfiguration, ambariLdapConfigurationCapture.getValue()); + } + + @Test(expected = AmbariLdapException.class) + public void testShouldConfigurationCheckFailureResultInAmbariLdapException() throws Exception { +// GIVEN + ldapConfigurationServiceMock.checkConnection(EasyMock.anyObject(AmbariLdapConfiguration.class)); +EasyMock.expectLastCall().andThrow(new AmbariLdapException("Testing ...")); +replayAll(); + +// WHEN +ldapFacade.checkConnection(ambariLdapConfiguration); + +// THEN +// exception is thrown + + } + + @Test + public void testShouldLdapAttributesCheckDelegateToTheRightServiceCalls() throws Exception { +// GIVEN + +Mapparameters = Maps.newHashMap(); + parameters.put(AmbariLdapFacade.Parameters.TEST_USER_NAME.getParameterKey(), "testUser"); + parameters.put(AmbariLdapFacade.Parameters.TEST_USER_PASSWORD.getParameterKey(), "testPassword"); + + +Capture testUserCapture = Capture.newInstance(); +Capture testPasswordCapture = Capture.newInstance(); +Capture userDnCapture = Capture.newInstance(); + + EasyMock.expect(ldapConfigurationServiceMock.checkUserAttributes(EasyMock.capture(testUserCapture),
[05/13] ambari git commit: AMBARI-22315. Log Search: Add docker compose file for Solr (oleewere)
AMBARI-22315. Log Search: Add docker compose file for Solr (oleewere) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/600b06ca Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/600b06ca Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/600b06ca Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 600b06cad1213c5b117fba5032770c7468115168 Parents: a386b35 Author: Oliver SzaboAuthored: Thu Oct 26 20:40:43 2017 +0200 Committer: Oliver Szabo Committed: Sat Oct 28 01:57:13 2017 +0200 -- .../docker/docker-compose-zookeeper.yml | 40 --- ambari-logsearch/docker/solr.yml| 37 ++ ambari-logsearch/docker/solr662.yml | 37 ++ ambari-logsearch/docker/zookeeper.yml | 52 4 files changed, 126 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/600b06ca/ambari-logsearch/docker/docker-compose-zookeeper.yml -- diff --git a/ambari-logsearch/docker/docker-compose-zookeeper.yml b/ambari-logsearch/docker/docker-compose-zookeeper.yml deleted file mode 100644 index a41eaf3..000 --- a/ambari-logsearch/docker/docker-compose-zookeeper.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: '3.1' -services: -zoo1: -image: zookeeper:3.4.10 -restart: always -hostname: zoo1 -networks: -- logsearch-network -ports: -- 2181:2181 -environment: -ZOO_MY_ID: 1 -ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 - -zoo2: -image: zookeeper:3.4.10 -restart: always -hostname: zoo2 -networks: -- logsearch-network -ports: -- 2182:2181 -environment: -ZOO_MY_ID: 2 -ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 - -zoo3: -image: zookeeper:3.4.10 -restart: always -hostname: zoo3 -networks: -- logsearch-network -ports: -- 2183:2181 -environment: -ZOO_MY_ID: 3 -ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 -networks: - logsearch-network: -driver: bridge \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/600b06ca/ambari-logsearch/docker/solr.yml -- diff --git a/ambari-logsearch/docker/solr.yml b/ambari-logsearch/docker/solr.yml new file mode 100644 index 000..727aba1 --- /dev/null +++ b/ambari-logsearch/docker/solr.yml @@ -0,0 +1,37 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License +version: '3.3' +services: + solr: +image: solr:7.1.0 +restart: always +hostname: solr +env_file: + - Profile +ports: + - "8886:8983" +networks: + - logsearch-network +entrypoint: + - docker-entrypoint.sh + - solr + - start + - "-f" + - "-c" + - "-z" + - "zoo1:2181,zoo2:2181,zoo3:2181" +networks: + logsearch-network: + driver: bridge \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/600b06ca/ambari-logsearch/docker/solr662.yml -- diff --git a/ambari-logsearch/docker/solr662.yml b/ambari-logsearch/docker/solr662.yml new file mode 100644 index 000..b0641ed --- /dev/null +++ b/ambari-logsearch/docker/solr662.yml @@ -0,0 +1,37 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with
[06/13] ambari git commit: AMBARI-22329. Log Search: Add docker compose file for Log Search server and Log Feeder (oleewere)
AMBARI-22329. Log Search: Add docker compose file for Log Search server and Log Feeder (oleewere) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/45be7669 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/45be7669 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/45be7669 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 45be766921cd05468fd0cd8bd3923f6d91e243af Parents: 600b06c Author: Oliver SzaboAuthored: Sat Oct 28 21:50:26 2017 +0200 Committer: Oliver Szabo Committed: Sun Oct 29 03:46:03 2017 +0100 -- ambari-logsearch/docker/.gitignore | 1 + ambari-logsearch/docker/Dockerfile | 11 ++- ambari-logsearch/docker/all.yml | 40 + ambari-logsearch/docker/bin/start.sh| 92 +++- ambari-logsearch/docker/docker-compose.yml | 89 +++ ambari-logsearch/docker/logsearch-docker.sh | 50 +++ ambari-logsearch/docker/logsearch-logfeeder.yml | 35 ambari-logsearch/docker/logsearch-server.yml| 35 ambari-logsearch/docker/solr.yml| 11 +-- ambari-logsearch/docker/solr662.yml | 37 ambari-logsearch/pom.xml| 1 + 11 files changed, 317 insertions(+), 85 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/45be7669/ambari-logsearch/docker/.gitignore -- diff --git a/ambari-logsearch/docker/.gitignore b/ambari-logsearch/docker/.gitignore index 99455ed..b73aed0 100644 --- a/ambari-logsearch/docker/.gitignore +++ b/ambari-logsearch/docker/.gitignore @@ -1 +1,2 @@ Profile +.env http://git-wip-us.apache.org/repos/asf/ambari/blob/45be7669/ambari-logsearch/docker/Dockerfile -- diff --git a/ambari-logsearch/docker/Dockerfile b/ambari-logsearch/docker/Dockerfile index 5906a50..70e80b6 100644 --- a/ambari-logsearch/docker/Dockerfile +++ b/ambari-logsearch/docker/Dockerfile @@ -34,11 +34,11 @@ RUN wget --no-check-certificate -O /root/selenium-server-standalone.jar http://s #Install Maven RUN mkdir -p /opt/maven WORKDIR /opt/maven -RUN wget http://archive.apache.org/dist/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz -RUN tar -xvzf /opt/maven/apache-maven-3.0.5-bin.tar.gz -RUN rm -rf /opt/maven/apache-maven-3.0.5-bin.tar.gz +RUN wget http://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz +RUN tar -xvzf /opt/maven/apache-maven-3.3.9-bin.tar.gz +RUN rm -rf /opt/maven/apache-maven-3.3.9-bin.tar.gz -ENV M2_HOME /opt/maven/apache-maven-3.0.5 +ENV M2_HOME /opt/maven/apache-maven-3.3.9 ENV MAVEN_OPTS -Xmx2048m ENV PATH $PATH:$JAVA_HOME/bin:$M2_HOME/bin @@ -84,5 +84,8 @@ RUN mkdir -p /var/run/ambari-logsearch-solr /var/log/ambari-logsearch-solr /var/ RUN cp /root/test-config/solr/solr.xml /root/logsearch_solr_index/data RUN cp /root/test-config/solr/zoo.cfg /root/logsearch_solr_index/data +RUN mkdir -p /root/config +RUN chmod -R 777 /root/config + WORKDIR /root CMD /root/start.sh http://git-wip-us.apache.org/repos/asf/ambari/blob/45be7669/ambari-logsearch/docker/all.yml -- diff --git a/ambari-logsearch/docker/all.yml b/ambari-logsearch/docker/all.yml new file mode 100644 index 000..82f0ff9 --- /dev/null +++ b/ambari-logsearch/docker/all.yml @@ -0,0 +1,40 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License +version: '3.3' +services: +logsearch-all: +image: ambari-logsearch:v1.0 +restart: always +hostname: logsearch.apache.org +container_name: logsearch +env_file: + - Profile +ports: + - 61888:61888 + - 5005:5005 + - 5006:5006 + - 8886:8886 + - 18886:18886 + - 4004:4004 + - 9983:9983 +environment: + DISPLAY: $DOCKERIP:0 +
[04/13] ambari git commit: AMBARI-22291 Adapt Repository Files For Existing Deployments for trunk UT (dgrinenko)
AMBARI-22291 Adapt Repository Files For Existing Deployments for trunk UT (dgrinenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a386b35d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a386b35d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a386b35d Branch: refs/heads/feature-branch-AMBARI-21307 Commit: a386b35d8c32500b7942083cd1048238d816b536 Parents: e455a64 Author: Dmytro GrinenkoAuthored: Fri Oct 27 20:04:06 2017 +0300 Committer: Dmytro Grinenko Committed: Fri Oct 27 20:04:06 2017 +0300 -- .../src/test/python/stacks/2.0.6/configs/repository_file.json | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a386b35d/ambari-server/src/test/python/stacks/2.0.6/configs/repository_file.json -- diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/repository_file.json b/ambari-server/src/test/python/stacks/2.0.6/configs/repository_file.json index 7efb7d9..de458c0 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/configs/repository_file.json +++ b/ambari-server/src/test/python/stacks/2.0.6/configs/repository_file.json @@ -57,6 +57,7 @@ "stackName": "HDP", "repoVersionId": 4, "repoVersion": "2.2.0.1-885", +"repoFileName": "ambari-hdp-4", "repositories": [ { "repoName": "HDP",
[03/13] ambari git commit: AMBARI-22326. String formatting problems
AMBARI-22326. String formatting problems Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e455a642 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e455a642 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e455a642 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: e455a642dd6f3b54354482b9b9cdef6f59af11b7 Parents: 4103b87 Author: Attila DoroszlaiAuthored: Fri Oct 27 14:28:44 2017 +0200 Committer: Attila Doroszlai Committed: Fri Oct 27 16:40:00 2017 +0200 -- .../ambari/server/controller/internal/ServiceResourceProvider.java | 2 +- .../java/org/apache/ambari/server/stack/MasterHostResolver.java| 2 +- .../main/java/org/apache/ambari/server/state/UpgradeContext.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e455a642/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java index e65693b..e55a380 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java @@ -435,7 +435,7 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider if (repositoryVersion.getType() != RepositoryType.STANDARD && cluster.getProvisioningState() == State.INIT) { throw new AmbariException(String.format( -"Unable to add %s to %s because the cluster is still being provisioned and the repository for the service is not %s: $s", +"Unable to add %s to %s because the cluster is still being provisioned and the repository for the service is not %s: %s", request.getServiceName(), cluster.getClusterName(), RepositoryType.STANDARD, repositoryVersion)); } http://git-wip-us.apache.org/repos/asf/ambari/blob/e455a642/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java index fc657c1..99211cb 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java @@ -310,7 +310,7 @@ public class MasterHostResolver { if (!componentHosts.contains(hp.host)){ //This may happen when NN HA is configured on dual network card machines with public/private FQDNs. LOG.error( - String.format( + MessageFormat.format( "Hadoop NameNode HA configuration {0} contains host {1} that does not exist in the NameNode hosts list {3}", key, hp.host, componentHosts.toString())); } http://git-wip-us.apache.org/repos/asf/ambari/blob/e455a642/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java b/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java index cb44adb..2b91bac 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java @@ -1197,7 +1197,7 @@ public class UpgradeContext { } catch (NoSuchResourceException|SystemException|UnsupportedPropertyException|NoSuchParentResourceException e) { throw new AmbariException( String.format("Unable to perform %s. Prerequisite checks could not be run", -direction.getText(false), e)); +direction.getText(false)), e); } List failedResources = new LinkedList<>();
[01/13] ambari git commit: AMBARI-22316. Wrong placement of service versions in versions view (alexantonenko) [Forced Update!]
Repository: ambari Updated Branches: refs/heads/feature-branch-AMBARI-21307 30415a189 -> 6b7a7a706 (forced update) AMBARI-22316. Wrong placement of service versions in versions view (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/793ffebc Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/793ffebc Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/793ffebc Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 793ffebc8a4287b642c0f9a043c7b85493568e3d Parents: 7e6036c Author: Alex AntonenkoAuthored: Fri Oct 27 13:22:04 2017 +0300 Committer: Alex Antonenko Committed: Fri Oct 27 13:22:04 2017 +0300 -- .../views/main/admin/stack_upgrade/upgrade_version_column_view.js | 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/793ffebc/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js -- diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js index 67bde4f..9ddb083 100644 --- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js +++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_column_view.js @@ -42,7 +42,6 @@ App.UpgradeVersionColumnView = App.UpgradeVersionBoxView.extend({ var account = App.RepositoryVersion.find().get('length'); $('.border-extended-table').width(account * 100 + 100 + "%"); $('.border-extended-table').css("max-width", account * 100 + 100 + "%"); -$('.services-section .service-version-info').css('margin-bottom', $(".border-extended-table tr").height() - 25 + "px"); }, services: function() {
[13/13] ambari git commit: AMBARI-21307 Feature for supporting LDAP configuration from the UI
AMBARI-21307 Feature for supporting LDAP configuration from the UI Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6b7a7a70 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6b7a7a70 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6b7a7a70 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 6b7a7a706d6e4d8c4a5e0300666e56f6704eb00a Parents: 9d6ac96 Author: lpuskas <lpus...@apache.org> Authored: Wed Jul 5 14:20:18 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Mon Oct 30 16:33:57 2017 +0200 -- ambari-funtest/pom.xml | 67 ambari-project/pom.xml | 52 +-- ambari-server/pom.xml | 83 + .../resources/ResourceInstanceFactoryImpl.java | 4 + .../AmbariConfigurationRequestSwagger.java | 47 +++ .../AmbariConfigurationResponseSwagger.java | 40 +++ .../services/AmbariConfigurationService.java| 193 +++ .../api/services/ldap/AmbariConfiguration.java | 87 + .../api/services/ldap/LdapConfigOperation.java | 43 +++ .../services/ldap/LdapConfigurationRequest.java | 49 +++ .../services/ldap/LdapConfigurationService.java | 185 +++ .../api/services/ldap/LdapRequestInfo.java | 61 .../stackadvisor/StackAdvisorRequest.java | 12 + .../commands/StackAdvisorCommand.java | 54 +++ .../ambari/server/controller/AmbariServer.java | 3 +- .../server/controller/ControllerModule.java | 3 + .../controller/ResourceProviderFactory.java | 24 +- .../AbstractControllerResourceProvider.java | 2 + .../internal/AbstractProviderModule.java| 2 +- .../AmbariConfigurationResourceProvider.java| 328 +++ .../internal/DefaultProviderModule.java | 24 +- .../ambari/server/controller/spi/Resource.java | 5 +- .../ambari/server/events/AmbariEvent.java | 11 +- .../events/AmbariLdapConfigChangedEvent.java| 37 +++ .../apache/ambari/server/ldap/LdapModule.java | 82 + .../ldap/domain/AmbariLdapConfigKeys.java | 83 + .../ldap/domain/AmbariLdapConfiguration.java| 199 +++ .../domain/AmbariLdapConfigurationFactory.java | 34 ++ .../AmbariLdapConfigurationProvider.java| 120 +++ .../ldap/service/AmbariLdapException.java | 33 ++ .../server/ldap/service/AmbariLdapFacade.java | 140 .../server/ldap/service/AttributeDetector.java | 41 +++ .../service/LdapAttributeDetectionService.java | 40 +++ .../ldap/service/LdapConfigurationService.java | 60 .../service/LdapConnectionConfigService.java| 36 ++ .../ambari/server/ldap/service/LdapFacade.java | 58 .../DefaultLdapAttributeDetectionService.java | 200 +++ .../ads/DefaultLdapConfigurationService.java| 213 .../ads/DefaultLdapConnectionConfigService.java | 113 +++ .../ads/LdapConnectionTemplateFactory.java | 111 +++ .../ads/detectors/AttributeDetectorFactory.java | 75 + .../ads/detectors/ChainedAttributeDetector.java | 73 + .../ads/detectors/GroupMemberAttrDetector.java | 65 .../ads/detectors/GroupNameAttrDetector.java| 70 .../ads/detectors/GroupObjectClassDetector.java | 73 + .../OccurrenceAndWeightBasedDetector.java | 143 .../detectors/UserGroupMemberAttrDetector.java | 64 .../ads/detectors/UserNameAttrDetector.java | 71 .../ads/detectors/UserObjectClassDetector.java | 69 .../server/orm/dao/AmbariConfigurationDAO.java | 89 + .../apache/ambari/server/orm/dao/DaoUtils.java | 13 +- .../orm/entities/AmbariConfigurationEntity.java | 70 .../orm/entities/ConfigurationBaseEntity.java | 159 + .../authorization/RoleAuthorization.java| 95 +++--- .../main/resources/Ambari-DDL-Derby-CREATE.sql | 21 ++ .../main/resources/Ambari-DDL-MySQL-CREATE.sql | 20 ++ .../main/resources/Ambari-DDL-Oracle-CREATE.sql | 20 ++ .../resources/Ambari-DDL-Postgres-CREATE.sql| 25 +- .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 20 ++ .../resources/Ambari-DDL-SQLServer-CREATE.sql | 20 ++ .../src/main/resources/META-INF/persistence.xml | 2 + .../commands/StackAdvisorCommandTest.java | 212 .../server/checks/UpgradeCheckOrderTest.java| 3 +- ...AmbariConfigurationResourceProviderTest.java | 251 ++ .../StackAdvisorResourceProviderTest.java | 97 +++--- .../server/ldap/LdapModuleFunctionalTest.java | 149 + .../TestAmbariLdapConfigurationFactory.java | 29 ++ .../ldap/service/AmbariLdapFacadeTest.java | 215 ...efaultLdapAttributeDetectionServiceTest.java | 188 +++ .../DefaultLdapConfigurationServiceTest.java| 221 + .../detectors/GroupMemberAttrDetec
[07/13] ambari git commit: AMBARI-22329. ADDENDUM - Log Search: Add docker compose file for Log Search server and Log Feeder (oleewere)
AMBARI-22329. ADDENDUM - Log Search: Add docker compose file for Log Search server and Log Feeder (oleewere) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4be5b8d0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4be5b8d0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4be5b8d0 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 4be5b8d0139545e7872f3b4e1c51235c5bb5ad18 Parents: 45be766 Author: Oliver SzaboAuthored: Mon Oct 30 12:46:21 2017 +0100 Committer: Oliver Szabo Committed: Mon Oct 30 12:46:21 2017 +0100 -- ambari-logsearch/docker/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/4be5b8d0/ambari-logsearch/docker/docker-compose.yml -- diff --git a/ambari-logsearch/docker/docker-compose.yml b/ambari-logsearch/docker/docker-compose.yml index f988b06..a6eeb0d 100644 --- a/ambari-logsearch/docker/docker-compose.yml +++ b/ambari-logsearch/docker/docker-compose.yml @@ -17,7 +17,7 @@ services: zookeeper: image: zookeeper:${ZOOKEEPER_VERSION:-3.4.10} restart: always -hostname: zoo1 +hostname: zookeeper networks: - logsearch-network ports:
[09/13] ambari git commit: AMBARI-22298. Refresh config tags at RECONFIGURE command without explicitly setting forceRefreshConfigTags in request (magyari_sandor)
AMBARI-22298. Refresh config tags at RECONFIGURE command without explicitly setting forceRefreshConfigTags in request (magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9d6ac96b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9d6ac96b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9d6ac96b Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 9d6ac96b5abf157ee813c6c6193650ac61a1590c Parents: 0041ab2 Author: Sandor MagyariAuthored: Fri Oct 20 10:19:55 2017 +0200 Committer: Sandor Magyari Committed: Mon Oct 30 15:08:54 2017 +0100 -- ambari-agent/src/main/python/ambari_agent/ActionQueue.py| 5 - .../server/controller/AmbariCustomCommandExecutionHelper.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9d6ac96b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py -- diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py index 1eda5c2..f1b3a42 100644 --- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py +++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py @@ -67,6 +67,7 @@ class ActionQueue(threading.Thread): ROLE_COMMAND_STOP = 'STOP' ROLE_COMMAND_CUSTOM_COMMAND = 'CUSTOM_COMMAND' CUSTOM_COMMAND_RESTART = 'RESTART' + CUSTOM_COMMAND_RECONFIGURE = 'RECONFIGURE' CUSTOM_COMMAND_START = ROLE_COMMAND_START IN_PROGRESS_STATUS = 'IN_PROGRESS' @@ -427,7 +428,9 @@ class ActionQueue(threading.Thread): (command['roleCommand'] == self.ROLE_COMMAND_INSTALL and component in LiveStatus.CLIENT_COMPONENTS) or (command['roleCommand'] == self.ROLE_COMMAND_CUSTOM_COMMAND and 'custom_command' in command['hostLevelParams'] and - command['hostLevelParams']['custom_command'] in (self.CUSTOM_COMMAND_RESTART, self.CUSTOM_COMMAND_START))): + command['hostLevelParams']['custom_command'] in (self.CUSTOM_COMMAND_RESTART, + self.CUSTOM_COMMAND_START, + self.CUSTOM_COMMAND_RECONFIGURE))): configHandler.write_actual_component(command['role'], command['configurationTags']) if 'clientsToUpdateConfigs' in command['hostLevelParams'] and command['hostLevelParams']['clientsToUpdateConfigs']: http://git-wip-us.apache.org/repos/asf/ambari/blob/9d6ac96b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java index 044e6ef..e8febbb 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java @@ -514,6 +514,7 @@ public class AmbariCustomCommandExecutionHelper { if (refreshConfigsCommand != null && !refreshConfigsCommand.equals(RefreshCommandConfiguration.REFRESH_CONFIGS)) { LOG.info("Refreshing configs for {}/{} with command: ", componentName, hostName, refreshConfigsCommand); commandParams.put("reconfigureAction", refreshConfigsCommand); + //execCmd.setForceRefreshConfigTagsBeforeExecution(true); } }
[08/13] ambari git commit: AMBARI-22333 Ambari 3.0: Implement new design for metrics of service summary. (atkach)
AMBARI-22333 Ambari 3.0: Implement new design for metrics of service summary. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0041ab25 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0041ab25 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0041ab25 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 0041ab2540f2ad99481d8e1708e12adbee3aa404 Parents: 4be5b8d Author: Andrii TkachAuthored: Mon Oct 30 14:42:43 2017 +0200 Committer: Andrii Tkach Committed: Mon Oct 30 14:42:43 2017 +0200 -- ambari-web/app/messages.js | 23 ++- ambari-web/app/styles/application.less | 8 +- .../templates/main/service/services/hdfs.hbs| 116 .../templates/main/service/services/yarn.hbs| 184 +++ .../app/views/main/service/services/yarn.js | 21 ++- .../views/main/service/services/yarn_test.js| 22 --- 6 files changed, 253 insertions(+), 121 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0041ab25/ambari-web/app/messages.js -- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 0123356..ebf2f8a 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -2938,8 +2938,8 @@ Em.I18n.translations = { 'dashboard.services.uptime':'{0}', 'dashboard.services.summary.slaves.live': 'Live', 'dashboard.services.hdfs.summary':'{0} of {1} nodes live, {2}% capacity used', - 'dashboard.services.hdfs.summary.components': 'COMPONENT', - 'dashboard.services.hdfs.summary.service-metrics': 'SERVICE METRICS', + 'dashboard.services.hdfs.summary.components': 'Components', + 'dashboard.services.hdfs.summary.service-metrics': 'Service Metrics', 'dashboard.services.hdfs.nanmenode':'NameNode', 'dashboard.services.hdfs.snanmenode':'Secondary NameNode', 'dashboard.services.hdfs.journalnodes':'JournalNodes', @@ -3007,14 +3007,21 @@ Em.I18n.translations = { 'dashboard.services.yarn.nodeManagers.status.tooltip.rebooted': 'This is the number of NodeManagers that are in the rebooted state as reported from the ResourceManager.', 'dashboard.services.yarn.nodeManagers.status.tooltip.decommissioned': 'This is the number of NodeManagers that are decommissioned as reported from the ResourceManager.', 'dashboard.services.yarn.containers': 'Containers', - 'dashboard.services.yarn.containers.msg': '{0} / {1} / {2}', - 'dashboard.services.yarn.containers.msgDesc': 'allocated / pending / reserved', + 'dashboard.services.yarn.containers.allocated': 'allocated', + 'dashboard.services.yarn.containers.pending': 'pending', + 'dashboard.services.yarn.containers.reserved': 'reserved', 'dashboard.services.yarn.apps': 'Applications', - 'dashboard.services.yarn.apps.msg': '{0} / {1} / {2} / {3} / {4} / {5}', - 'dashboard.services.yarn.apps.msgDesc': 'submitted / running / pending / completed / killed / failed', + 'dashboard.services.yarn.apps.submitted': 'submitted', + 'dashboard.services.yarn.apps.running': 'running', + 'dashboard.services.yarn.apps.pending': 'pending', + 'dashboard.services.yarn.apps.completed': 'completed', + 'dashboard.services.yarn.apps.killed': 'killed', + 'dashboard.services.yarn.apps.failed': 'failed', + 'dashboard.services.yarn.memory': 'Cluster Memory', - 'dashboard.services.yarn.memory.msg': '{0} / {1} / {2}', - 'dashboard.services.yarn.memory.msgDesc': 'used / reserved / available', + 'dashboard.services.yarn.memory.used': 'used', + 'dashboard.services.yarn.memory.reserved': 'reserved', + 'dashboard.services.yarn.memory.available': 'available', 'dashboard.services.yarn.queues': 'Queues', 'dashboard.services.yarn.queues.msg': '{0} Queues', 'dashboard.services.hawq.hawqSegments':'HAWQ Segments', http://git-wip-us.apache.org/repos/asf/ambari/blob/0041ab25/ambari-web/app/styles/application.less -- diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less index d40ab8e..df86c7f 100644 --- a/ambari-web/app/styles/application.less +++ b/ambari-web/app/styles/application.less @@ -2754,11 +2754,10 @@ a.abort-icon:hover { } .component-summary, .metrics-summary { .col-md-2 { - float:left; - padding-left: 0px; + float: left; + padding-left: 0; top: 7px; - font-size: 12px; - font-weight: bold; + font-size: 16px; } .col-md-10 { float: right; @@ -2769,6 +2768,7 @@ a.abort-icon:hover { .info-desc { font-size: 12px; color: #99; + text-transform: capitalize; } } }
[11/13] ambari git commit: AMBARI-21307 Feature for supporting LDAP configuration from the UI
http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7a7a70/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java new file mode 100644 index 000..b34a2b2 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java @@ -0,0 +1,64 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.ldap.service.ads.detectors; + +import javax.inject.Inject; + +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys; +import org.apache.directory.api.ldap.model.entry.Entry; + +public class UserGroupMemberAttrDetector extends OccurrenceAndWeightBasedDetector { + + private enum UserGroupMemberAttr { + +MEMBER_OF("memberOf", 1), +IS_MEMBER_OF("ismemberOf", 1); + +private String attrName; +private Integer weight; + +UserGroupMemberAttr(String attr, Integer weght) { + this.attrName = attr; + this.weight = weght; +} + +Integer weight() { + return this.weight; +} + +String attrName() { + return this.attrName; +} + + } + + @Inject + public UserGroupMemberAttrDetector() { +for (UserGroupMemberAttr userGroupMemberAttr : UserGroupMemberAttr.values()) { + occurrenceMap().put(userGroupMemberAttr.attrName(), 0); + weightsMap().put(userGroupMemberAttr.attrName(), userGroupMemberAttr.weight); +} + } + + @Override + protected boolean applies(Entry entry, String attribute) { +return entry.containsAttribute(attribute); + } + + @Override + public String detectedProperty() { +return AmbariLdapConfigKeys.USER_GROUP_MEMBER_ATTRIBUTE.key(); + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7a7a70/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java new file mode 100644 index 000..dec4459 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java @@ -0,0 +1,71 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.ldap.service.ads.detectors; + +import javax.inject.Inject; +import javax.inject.Singleton; + +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys; +import org.apache.directory.api.ldap.model.entry.Entry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Singleton +public class UserNameAttrDetector extends OccurrenceAndWeightBasedDetector { + private static final Logger LOGGER = LoggerFactory.getLogger(UserNameAttrDetector.class); + + private enum UserNameAttrs { +SAM_ACCOUNT_NAME("sAMAccountName", 5), +UID("uid", 3), +CN("cn", 1); + +private String attrName; +private Integer weight; + +UserNameAttrs(String attr, Integer weght) { + this.attrName = attr; + this.weight = weght; +} + +Integer weight() { + return this.weight; +} + +String attrName() { + return this.attrName; +} + + } + + @Inject + public UserNameAttrDetector() { +for (UserNameAttrs nameAttr : UserNameAttrs.values()) { + occurrenceMap().put(nameAttr.attrName(), 0); + weightsMap().put(nameAttr.attrName(), nameAttr.weight()); +} + } + + @Override + protected boolean applies(Entry entry,
[12/13] ambari git commit: AMBARI-21307 Feature for supporting LDAP configuration from the UI
http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7a7a70/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java new file mode 100644 index 000..089da1d --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java @@ -0,0 +1,82 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.apache.ambari.server.ldap; + +import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration; +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory; +import org.apache.ambari.server.ldap.service.AmbariLdapConfigurationProvider; +import org.apache.ambari.server.ldap.service.AmbariLdapFacade; +import org.apache.ambari.server.ldap.service.AttributeDetector; +import org.apache.ambari.server.ldap.service.LdapAttributeDetectionService; +import org.apache.ambari.server.ldap.service.LdapConfigurationService; +import org.apache.ambari.server.ldap.service.LdapConnectionConfigService; +import org.apache.ambari.server.ldap.service.LdapFacade; +import org.apache.ambari.server.ldap.service.ads.DefaultLdapAttributeDetectionService; +import org.apache.ambari.server.ldap.service.ads.DefaultLdapConfigurationService; +import org.apache.ambari.server.ldap.service.ads.DefaultLdapConnectionConfigService; +import org.apache.ambari.server.ldap.service.ads.detectors.AttributeDetectorFactory; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupMemberAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupNameAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupObjectClassDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserGroupMemberAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserNameAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserObjectClassDetector; + +import com.google.inject.AbstractModule; +import com.google.inject.assistedinject.FactoryModuleBuilder; +import com.google.inject.multibindings.Multibinder; +import com.google.inject.name.Names; + +/** + * GUICE configuration module for setting up LDAP related infrastructure. + */ +public class LdapModule extends AbstractModule { + + public static final String USER_ATTRIBUTES_DETECTORS = "UserAttributesDetectors"; + public static final String GROUP_ATTRIBUTES_DETECTORS = "GroupAttributesDetectors"; + + @Override + protected void configure() { +bind(LdapFacade.class).to(AmbariLdapFacade.class); + bind(LdapConfigurationService.class).to(DefaultLdapConfigurationService.class); + bind(LdapAttributeDetectionService.class).to(DefaultLdapAttributeDetectionService.class); + bind(LdapConnectionConfigService.class).to(DefaultLdapConnectionConfigService.class); + +// this binding requires the JPA module! + bind(AmbariLdapConfiguration.class).toProvider(AmbariLdapConfigurationProvider.class); + +bind(AttributeDetectorFactory.class); + +install(new FactoryModuleBuilder().build(AmbariLdapConfigurationFactory.class)); + +// binding the set of user attributes detector +Multibinder userAttributeDetectorBinder = Multibinder.newSetBinder(binder(), AttributeDetector.class, + Names.named(USER_ATTRIBUTES_DETECTORS)); +userAttributeDetectorBinder.addBinding().to(UserObjectClassDetector.class); +userAttributeDetectorBinder.addBinding().to(UserNameAttrDetector.class); + userAttributeDetectorBinder.addBinding().to(UserGroupMemberAttrDetector.class); + + +// binding the set of group attributes detector +Multibinder groupAttributeDetectorBinder = Multibinder.newSetBinder(binder(), AttributeDetector.class, + Names.named(GROUP_ATTRIBUTES_DETECTORS)); + groupAttributeDetectorBinder.addBinding().to(GroupObjectClassDetector.class); +groupAttributeDetectorBinder.addBinding().to(GroupNameAttrDetector.class); + groupAttributeDetectorBinder.addBinding().to(GroupMemberAttrDetector.class); + + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7a7a70/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigKeys.java -- diff --git
[02/13] ambari git commit: AMBARI-22314. Log Search: Add docker-compose file for creating ZooKeeper containers (oleewere)
AMBARI-22314. Log Search: Add docker-compose file for creating ZooKeeper containers (oleewere) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4103b87e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4103b87e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4103b87e Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 4103b87e9d854311827f49525c7b1076771e2aa9 Parents: 793ffeb Author: Oliver SzaboAuthored: Thu Oct 26 14:35:18 2017 +0200 Committer: Oliver Szabo Committed: Fri Oct 27 15:10:41 2017 +0200 -- .../docker/docker-compose-zookeeper.yml | 40 1 file changed, 40 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/4103b87e/ambari-logsearch/docker/docker-compose-zookeeper.yml -- diff --git a/ambari-logsearch/docker/docker-compose-zookeeper.yml b/ambari-logsearch/docker/docker-compose-zookeeper.yml new file mode 100644 index 000..a41eaf3 --- /dev/null +++ b/ambari-logsearch/docker/docker-compose-zookeeper.yml @@ -0,0 +1,40 @@ +version: '3.1' +services: +zoo1: +image: zookeeper:3.4.10 +restart: always +hostname: zoo1 +networks: +- logsearch-network +ports: +- 2181:2181 +environment: +ZOO_MY_ID: 1 +ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 + +zoo2: +image: zookeeper:3.4.10 +restart: always +hostname: zoo2 +networks: +- logsearch-network +ports: +- 2182:2181 +environment: +ZOO_MY_ID: 2 +ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 + +zoo3: +image: zookeeper:3.4.10 +restart: always +hostname: zoo3 +networks: +- logsearch-network +ports: +- 2183:2181 +environment: +ZOO_MY_ID: 3 +ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 +networks: + logsearch-network: +driver: bridge \ No newline at end of file
[2/4] ambari git commit: AMBARI-21307 Feature for supporting LDAP configuration from the UI
http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7a7a70/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java new file mode 100644 index 000..b34a2b2 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java @@ -0,0 +1,64 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.ldap.service.ads.detectors; + +import javax.inject.Inject; + +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys; +import org.apache.directory.api.ldap.model.entry.Entry; + +public class UserGroupMemberAttrDetector extends OccurrenceAndWeightBasedDetector { + + private enum UserGroupMemberAttr { + +MEMBER_OF("memberOf", 1), +IS_MEMBER_OF("ismemberOf", 1); + +private String attrName; +private Integer weight; + +UserGroupMemberAttr(String attr, Integer weght) { + this.attrName = attr; + this.weight = weght; +} + +Integer weight() { + return this.weight; +} + +String attrName() { + return this.attrName; +} + + } + + @Inject + public UserGroupMemberAttrDetector() { +for (UserGroupMemberAttr userGroupMemberAttr : UserGroupMemberAttr.values()) { + occurrenceMap().put(userGroupMemberAttr.attrName(), 0); + weightsMap().put(userGroupMemberAttr.attrName(), userGroupMemberAttr.weight); +} + } + + @Override + protected boolean applies(Entry entry, String attribute) { +return entry.containsAttribute(attribute); + } + + @Override + public String detectedProperty() { +return AmbariLdapConfigKeys.USER_GROUP_MEMBER_ATTRIBUTE.key(); + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7a7a70/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java new file mode 100644 index 000..dec4459 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java @@ -0,0 +1,71 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.ldap.service.ads.detectors; + +import javax.inject.Inject; +import javax.inject.Singleton; + +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys; +import org.apache.directory.api.ldap.model.entry.Entry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Singleton +public class UserNameAttrDetector extends OccurrenceAndWeightBasedDetector { + private static final Logger LOGGER = LoggerFactory.getLogger(UserNameAttrDetector.class); + + private enum UserNameAttrs { +SAM_ACCOUNT_NAME("sAMAccountName", 5), +UID("uid", 3), +CN("cn", 1); + +private String attrName; +private Integer weight; + +UserNameAttrs(String attr, Integer weght) { + this.attrName = attr; + this.weight = weght; +} + +Integer weight() { + return this.weight; +} + +String attrName() { + return this.attrName; +} + + } + + @Inject + public UserNameAttrDetector() { +for (UserNameAttrs nameAttr : UserNameAttrs.values()) { + occurrenceMap().put(nameAttr.attrName(), 0); + weightsMap().put(nameAttr.attrName(), nameAttr.weight()); +} + } + + @Override + protected boolean applies(Entry entry,
[4/4] ambari git commit: AMBARI-21307 Feature for supporting LDAP configuration from the UI
AMBARI-21307 Feature for supporting LDAP configuration from the UI Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6b7a7a70 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6b7a7a70 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6b7a7a70 Branch: refs/heads/trunk Commit: 6b7a7a706d6e4d8c4a5e0300666e56f6704eb00a Parents: 9d6ac96 Author: lpuskas <lpus...@apache.org> Authored: Wed Jul 5 14:20:18 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Mon Oct 30 16:33:57 2017 +0200 -- ambari-funtest/pom.xml | 67 ambari-project/pom.xml | 52 +-- ambari-server/pom.xml | 83 + .../resources/ResourceInstanceFactoryImpl.java | 4 + .../AmbariConfigurationRequestSwagger.java | 47 +++ .../AmbariConfigurationResponseSwagger.java | 40 +++ .../services/AmbariConfigurationService.java| 193 +++ .../api/services/ldap/AmbariConfiguration.java | 87 + .../api/services/ldap/LdapConfigOperation.java | 43 +++ .../services/ldap/LdapConfigurationRequest.java | 49 +++ .../services/ldap/LdapConfigurationService.java | 185 +++ .../api/services/ldap/LdapRequestInfo.java | 61 .../stackadvisor/StackAdvisorRequest.java | 12 + .../commands/StackAdvisorCommand.java | 54 +++ .../ambari/server/controller/AmbariServer.java | 3 +- .../server/controller/ControllerModule.java | 3 + .../controller/ResourceProviderFactory.java | 24 +- .../AbstractControllerResourceProvider.java | 2 + .../internal/AbstractProviderModule.java| 2 +- .../AmbariConfigurationResourceProvider.java| 328 +++ .../internal/DefaultProviderModule.java | 24 +- .../ambari/server/controller/spi/Resource.java | 5 +- .../ambari/server/events/AmbariEvent.java | 11 +- .../events/AmbariLdapConfigChangedEvent.java| 37 +++ .../apache/ambari/server/ldap/LdapModule.java | 82 + .../ldap/domain/AmbariLdapConfigKeys.java | 83 + .../ldap/domain/AmbariLdapConfiguration.java| 199 +++ .../domain/AmbariLdapConfigurationFactory.java | 34 ++ .../AmbariLdapConfigurationProvider.java| 120 +++ .../ldap/service/AmbariLdapException.java | 33 ++ .../server/ldap/service/AmbariLdapFacade.java | 140 .../server/ldap/service/AttributeDetector.java | 41 +++ .../service/LdapAttributeDetectionService.java | 40 +++ .../ldap/service/LdapConfigurationService.java | 60 .../service/LdapConnectionConfigService.java| 36 ++ .../ambari/server/ldap/service/LdapFacade.java | 58 .../DefaultLdapAttributeDetectionService.java | 200 +++ .../ads/DefaultLdapConfigurationService.java| 213 .../ads/DefaultLdapConnectionConfigService.java | 113 +++ .../ads/LdapConnectionTemplateFactory.java | 111 +++ .../ads/detectors/AttributeDetectorFactory.java | 75 + .../ads/detectors/ChainedAttributeDetector.java | 73 + .../ads/detectors/GroupMemberAttrDetector.java | 65 .../ads/detectors/GroupNameAttrDetector.java| 70 .../ads/detectors/GroupObjectClassDetector.java | 73 + .../OccurrenceAndWeightBasedDetector.java | 143 .../detectors/UserGroupMemberAttrDetector.java | 64 .../ads/detectors/UserNameAttrDetector.java | 71 .../ads/detectors/UserObjectClassDetector.java | 69 .../server/orm/dao/AmbariConfigurationDAO.java | 89 + .../apache/ambari/server/orm/dao/DaoUtils.java | 13 +- .../orm/entities/AmbariConfigurationEntity.java | 70 .../orm/entities/ConfigurationBaseEntity.java | 159 + .../authorization/RoleAuthorization.java| 95 +++--- .../main/resources/Ambari-DDL-Derby-CREATE.sql | 21 ++ .../main/resources/Ambari-DDL-MySQL-CREATE.sql | 20 ++ .../main/resources/Ambari-DDL-Oracle-CREATE.sql | 20 ++ .../resources/Ambari-DDL-Postgres-CREATE.sql| 25 +- .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 20 ++ .../resources/Ambari-DDL-SQLServer-CREATE.sql | 20 ++ .../src/main/resources/META-INF/persistence.xml | 2 + .../commands/StackAdvisorCommandTest.java | 212 .../server/checks/UpgradeCheckOrderTest.java| 3 +- ...AmbariConfigurationResourceProviderTest.java | 251 ++ .../StackAdvisorResourceProviderTest.java | 97 +++--- .../server/ldap/LdapModuleFunctionalTest.java | 149 + .../TestAmbariLdapConfigurationFactory.java | 29 ++ .../ldap/service/AmbariLdapFacadeTest.java | 215 ...efaultLdapAttributeDetectionServiceTest.java | 188 +++ .../DefaultLdapConfigurationServiceTest.java| 221 + .../detectors/GroupMemberAttrDetectorTest
[3/4] ambari git commit: AMBARI-21307 Feature for supporting LDAP configuration from the UI
http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7a7a70/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java new file mode 100644 index 000..089da1d --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java @@ -0,0 +1,82 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.apache.ambari.server.ldap; + +import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration; +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory; +import org.apache.ambari.server.ldap.service.AmbariLdapConfigurationProvider; +import org.apache.ambari.server.ldap.service.AmbariLdapFacade; +import org.apache.ambari.server.ldap.service.AttributeDetector; +import org.apache.ambari.server.ldap.service.LdapAttributeDetectionService; +import org.apache.ambari.server.ldap.service.LdapConfigurationService; +import org.apache.ambari.server.ldap.service.LdapConnectionConfigService; +import org.apache.ambari.server.ldap.service.LdapFacade; +import org.apache.ambari.server.ldap.service.ads.DefaultLdapAttributeDetectionService; +import org.apache.ambari.server.ldap.service.ads.DefaultLdapConfigurationService; +import org.apache.ambari.server.ldap.service.ads.DefaultLdapConnectionConfigService; +import org.apache.ambari.server.ldap.service.ads.detectors.AttributeDetectorFactory; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupMemberAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupNameAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupObjectClassDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserGroupMemberAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserNameAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserObjectClassDetector; + +import com.google.inject.AbstractModule; +import com.google.inject.assistedinject.FactoryModuleBuilder; +import com.google.inject.multibindings.Multibinder; +import com.google.inject.name.Names; + +/** + * GUICE configuration module for setting up LDAP related infrastructure. + */ +public class LdapModule extends AbstractModule { + + public static final String USER_ATTRIBUTES_DETECTORS = "UserAttributesDetectors"; + public static final String GROUP_ATTRIBUTES_DETECTORS = "GroupAttributesDetectors"; + + @Override + protected void configure() { +bind(LdapFacade.class).to(AmbariLdapFacade.class); + bind(LdapConfigurationService.class).to(DefaultLdapConfigurationService.class); + bind(LdapAttributeDetectionService.class).to(DefaultLdapAttributeDetectionService.class); + bind(LdapConnectionConfigService.class).to(DefaultLdapConnectionConfigService.class); + +// this binding requires the JPA module! + bind(AmbariLdapConfiguration.class).toProvider(AmbariLdapConfigurationProvider.class); + +bind(AttributeDetectorFactory.class); + +install(new FactoryModuleBuilder().build(AmbariLdapConfigurationFactory.class)); + +// binding the set of user attributes detector +Multibinder userAttributeDetectorBinder = Multibinder.newSetBinder(binder(), AttributeDetector.class, + Names.named(USER_ATTRIBUTES_DETECTORS)); +userAttributeDetectorBinder.addBinding().to(UserObjectClassDetector.class); +userAttributeDetectorBinder.addBinding().to(UserNameAttrDetector.class); + userAttributeDetectorBinder.addBinding().to(UserGroupMemberAttrDetector.class); + + +// binding the set of group attributes detector +Multibinder groupAttributeDetectorBinder = Multibinder.newSetBinder(binder(), AttributeDetector.class, + Names.named(GROUP_ATTRIBUTES_DETECTORS)); + groupAttributeDetectorBinder.addBinding().to(GroupObjectClassDetector.class); +groupAttributeDetectorBinder.addBinding().to(GroupNameAttrDetector.class); + groupAttributeDetectorBinder.addBinding().to(GroupMemberAttrDetector.class); + + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7a7a70/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigKeys.java -- diff --git
[1/4] ambari git commit: AMBARI-21307 Feature for supporting LDAP configuration from the UI
Repository: ambari Updated Branches: refs/heads/trunk 9d6ac96b5 -> 6b7a7a706 http://git-wip-us.apache.org/repos/asf/ambari/blob/6b7a7a70/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java new file mode 100644 index 000..db0e5a9 --- /dev/null +++ b/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java @@ -0,0 +1,215 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.ldap.service; + +import java.util.Map; +import java.util.Set; + +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys; +import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration; +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory; +import org.apache.ambari.server.ldap.domain.TestAmbariLdapConfigurationFactory; +import org.easymock.Capture; +import org.easymock.EasyMock; +import org.easymock.EasyMockRule; +import org.easymock.EasyMockSupport; +import org.easymock.Mock; +import org.easymock.MockType; +import org.easymock.TestSubject; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + +/** + * Unit test suite for the LdapFacade operations. + */ +public class AmbariLdapFacadeTest extends EasyMockSupport { + + @Rule + public EasyMockRule mocks = new EasyMockRule(this); + + @Mock(type = MockType.STRICT) + public LdapConfigurationService ldapConfigurationServiceMock; + + @Mock(type = MockType.STRICT) + public LdapAttributeDetectionService ldapAttributeDetectionServiceMock; + + private AmbariLdapConfigurationFactory ambariLdapConfigurationFactory; + + + @TestSubject + private LdapFacade ldapFacade = new AmbariLdapFacade(); + + private AmbariLdapConfiguration ambariLdapConfiguration; + + + private Capture ambariLdapConfigurationCapture; + + @Before + public void before() { +ambariLdapConfigurationFactory = new TestAmbariLdapConfigurationFactory(); +ambariLdapConfiguration = ambariLdapConfigurationFactory.createLdapConfiguration(Maps.newHashMap()); +ambariLdapConfigurationCapture = Capture.newInstance(); + + +resetAll(); + } + + /** + * Tests whether the facade method call delegates to the proper service call. + * The thest is success if the same instance is passed to the service. + * + * @throws Exception + */ + @Test + public void testShouldConfigurationCheckDelegateToTheRightServiceCall() throws Exception { +// GIVEN +// the mocks are set up + ldapConfigurationServiceMock.checkConnection(EasyMock.capture(ambariLdapConfigurationCapture)); +replayAll(); +// WHEN +// the facade method is called +ldapFacade.checkConnection(ambariLdapConfiguration); + +// THEN +// the captured configuration instance is the same the facade method got called with +Assert.assertEquals("The configuration instance souldn't change before passing it to the service", + ambariLdapConfiguration, ambariLdapConfigurationCapture.getValue()); + } + + @Test(expected = AmbariLdapException.class) + public void testShouldConfigurationCheckFailureResultInAmbariLdapException() throws Exception { +// GIVEN + ldapConfigurationServiceMock.checkConnection(EasyMock.anyObject(AmbariLdapConfiguration.class)); +EasyMock.expectLastCall().andThrow(new AmbariLdapException("Testing ...")); +replayAll(); + +// WHEN +ldapFacade.checkConnection(ambariLdapConfiguration); + +// THEN +// exception is thrown + + } + + @Test + public void testShouldLdapAttributesCheckDelegateToTheRightServiceCalls() throws Exception { +// GIVEN + +Mapparameters = Maps.newHashMap(); + parameters.put(AmbariLdapFacade.Parameters.TEST_USER_NAME.getParameterKey(), "testUser"); + parameters.put(AmbariLdapFacade.Parameters.TEST_USER_PASSWORD.getParameterKey(), "testPassword"); + + +Capture testUserCapture = Capture.newInstance(); +Capture testPasswordCapture = Capture.newInstance(); +Capture userDnCapture = Capture.newInstance(); + +
[2/5] ambari git commit: AMBARI-21307 Feature for supporting LDAP configuration from the UI
http://git-wip-us.apache.org/repos/asf/ambari/blob/30415a18/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java new file mode 100644 index 000..db0e5a9 --- /dev/null +++ b/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java @@ -0,0 +1,215 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.ldap.service; + +import java.util.Map; +import java.util.Set; + +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys; +import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration; +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory; +import org.apache.ambari.server.ldap.domain.TestAmbariLdapConfigurationFactory; +import org.easymock.Capture; +import org.easymock.EasyMock; +import org.easymock.EasyMockRule; +import org.easymock.EasyMockSupport; +import org.easymock.Mock; +import org.easymock.MockType; +import org.easymock.TestSubject; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + +/** + * Unit test suite for the LdapFacade operations. + */ +public class AmbariLdapFacadeTest extends EasyMockSupport { + + @Rule + public EasyMockRule mocks = new EasyMockRule(this); + + @Mock(type = MockType.STRICT) + public LdapConfigurationService ldapConfigurationServiceMock; + + @Mock(type = MockType.STRICT) + public LdapAttributeDetectionService ldapAttributeDetectionServiceMock; + + private AmbariLdapConfigurationFactory ambariLdapConfigurationFactory; + + + @TestSubject + private LdapFacade ldapFacade = new AmbariLdapFacade(); + + private AmbariLdapConfiguration ambariLdapConfiguration; + + + private Capture ambariLdapConfigurationCapture; + + @Before + public void before() { +ambariLdapConfigurationFactory = new TestAmbariLdapConfigurationFactory(); +ambariLdapConfiguration = ambariLdapConfigurationFactory.createLdapConfiguration(Maps.newHashMap()); +ambariLdapConfigurationCapture = Capture.newInstance(); + + +resetAll(); + } + + /** + * Tests whether the facade method call delegates to the proper service call. + * The thest is success if the same instance is passed to the service. + * + * @throws Exception + */ + @Test + public void testShouldConfigurationCheckDelegateToTheRightServiceCall() throws Exception { +// GIVEN +// the mocks are set up + ldapConfigurationServiceMock.checkConnection(EasyMock.capture(ambariLdapConfigurationCapture)); +replayAll(); +// WHEN +// the facade method is called +ldapFacade.checkConnection(ambariLdapConfiguration); + +// THEN +// the captured configuration instance is the same the facade method got called with +Assert.assertEquals("The configuration instance souldn't change before passing it to the service", + ambariLdapConfiguration, ambariLdapConfigurationCapture.getValue()); + } + + @Test(expected = AmbariLdapException.class) + public void testShouldConfigurationCheckFailureResultInAmbariLdapException() throws Exception { +// GIVEN + ldapConfigurationServiceMock.checkConnection(EasyMock.anyObject(AmbariLdapConfiguration.class)); +EasyMock.expectLastCall().andThrow(new AmbariLdapException("Testing ...")); +replayAll(); + +// WHEN +ldapFacade.checkConnection(ambariLdapConfiguration); + +// THEN +// exception is thrown + + } + + @Test + public void testShouldLdapAttributesCheckDelegateToTheRightServiceCalls() throws Exception { +// GIVEN + +Mapparameters = Maps.newHashMap(); + parameters.put(AmbariLdapFacade.Parameters.TEST_USER_NAME.getParameterKey(), "testUser"); + parameters.put(AmbariLdapFacade.Parameters.TEST_USER_PASSWORD.getParameterKey(), "testPassword"); + + +Capture testUserCapture = Capture.newInstance(); +Capture testPasswordCapture = Capture.newInstance(); +Capture userDnCapture = Capture.newInstance(); + + EasyMock.expect(ldapConfigurationServiceMock.checkUserAttributes(EasyMock.capture(testUserCapture),
[4/5] ambari git commit: AMBARI-21307 Feature for supporting LDAP configuration from the UI
http://git-wip-us.apache.org/repos/asf/ambari/blob/30415a18/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java new file mode 100644 index 000..089da1d --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java @@ -0,0 +1,82 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.apache.ambari.server.ldap; + +import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration; +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory; +import org.apache.ambari.server.ldap.service.AmbariLdapConfigurationProvider; +import org.apache.ambari.server.ldap.service.AmbariLdapFacade; +import org.apache.ambari.server.ldap.service.AttributeDetector; +import org.apache.ambari.server.ldap.service.LdapAttributeDetectionService; +import org.apache.ambari.server.ldap.service.LdapConfigurationService; +import org.apache.ambari.server.ldap.service.LdapConnectionConfigService; +import org.apache.ambari.server.ldap.service.LdapFacade; +import org.apache.ambari.server.ldap.service.ads.DefaultLdapAttributeDetectionService; +import org.apache.ambari.server.ldap.service.ads.DefaultLdapConfigurationService; +import org.apache.ambari.server.ldap.service.ads.DefaultLdapConnectionConfigService; +import org.apache.ambari.server.ldap.service.ads.detectors.AttributeDetectorFactory; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupMemberAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupNameAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupObjectClassDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserGroupMemberAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserNameAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserObjectClassDetector; + +import com.google.inject.AbstractModule; +import com.google.inject.assistedinject.FactoryModuleBuilder; +import com.google.inject.multibindings.Multibinder; +import com.google.inject.name.Names; + +/** + * GUICE configuration module for setting up LDAP related infrastructure. + */ +public class LdapModule extends AbstractModule { + + public static final String USER_ATTRIBUTES_DETECTORS = "UserAttributesDetectors"; + public static final String GROUP_ATTRIBUTES_DETECTORS = "GroupAttributesDetectors"; + + @Override + protected void configure() { +bind(LdapFacade.class).to(AmbariLdapFacade.class); + bind(LdapConfigurationService.class).to(DefaultLdapConfigurationService.class); + bind(LdapAttributeDetectionService.class).to(DefaultLdapAttributeDetectionService.class); + bind(LdapConnectionConfigService.class).to(DefaultLdapConnectionConfigService.class); + +// this binding requires the JPA module! + bind(AmbariLdapConfiguration.class).toProvider(AmbariLdapConfigurationProvider.class); + +bind(AttributeDetectorFactory.class); + +install(new FactoryModuleBuilder().build(AmbariLdapConfigurationFactory.class)); + +// binding the set of user attributes detector +Multibinder userAttributeDetectorBinder = Multibinder.newSetBinder(binder(), AttributeDetector.class, + Names.named(USER_ATTRIBUTES_DETECTORS)); +userAttributeDetectorBinder.addBinding().to(UserObjectClassDetector.class); +userAttributeDetectorBinder.addBinding().to(UserNameAttrDetector.class); + userAttributeDetectorBinder.addBinding().to(UserGroupMemberAttrDetector.class); + + +// binding the set of group attributes detector +Multibinder groupAttributeDetectorBinder = Multibinder.newSetBinder(binder(), AttributeDetector.class, + Names.named(GROUP_ATTRIBUTES_DETECTORS)); + groupAttributeDetectorBinder.addBinding().to(GroupObjectClassDetector.class); +groupAttributeDetectorBinder.addBinding().to(GroupNameAttrDetector.class); + groupAttributeDetectorBinder.addBinding().to(GroupMemberAttrDetector.class); + + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/30415a18/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigKeys.java -- diff --git
[1/5] ambari git commit: AMBARI-22310. Get rid of deprecated Solr usages (infra + logsearch) (oleewere) [Forced Update!]
Repository: ambari Updated Branches: refs/heads/feature-branch-AMBARI-21307 735ff7b79 -> 30415a189 (forced update) AMBARI-22310. Get rid of deprecated Solr usages (infra + logsearch) (oleewere) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7e6036c3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7e6036c3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7e6036c3 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 7e6036c3ee7e16384df8ca372e1fa56f1d5e9e46 Parents: 4d3abaf Author: Oliver SzaboAuthored: Thu Oct 26 11:20:14 2017 +0200 Committer: Oliver Szabo Committed: Thu Oct 26 11:20:14 2017 +0200 -- .../ambari/infra/solr/AmbariSolrCloudClientBuilder.java | 4 ++-- .../infra/solr/commands/CreateCollectionCommand.java| 12 +++- .../ambari/infra/solr/commands/CreateShardCommand.java | 5 + .../ambari/infra/solr/commands/GetShardsCommand.java| 2 +- 4 files changed, 7 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7e6036c3/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudClientBuilder.java -- diff --git a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudClientBuilder.java b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudClientBuilder.java index 54c4ae3..a187cdb 100644 --- a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudClientBuilder.java +++ b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudClientBuilder.java @@ -125,7 +125,7 @@ public class AmbariSolrCloudClientBuilder { } public AmbariSolrCloudClientBuilder withSolrCloudClient() { -this.solrCloudClient = new CloudSolrClient(this.zkConnectString); +this.solrCloudClient = new CloudSolrClient.Builder().withZkHost(this.zkConnectString).build(); return this; } @@ -209,7 +209,7 @@ public class AmbariSolrCloudClientBuilder { private void setupSecurity(String jaasFile) { if (jaasFile != null) { System.setProperty("java.security.auth.login.config", jaasFile); - HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer()); + HttpClientUtil.addConfigurer(new Krb5HttpClientConfigurer()); } } } http://git-wip-us.apache.org/repos/asf/ambari/blob/7e6036c3/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateCollectionCommand.java -- diff --git a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateCollectionCommand.java b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateCollectionCommand.java index 53e96fd..317d0b6 100644 --- a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateCollectionCommand.java +++ b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateCollectionCommand.java @@ -23,9 +23,6 @@ import org.apache.ambari.infra.solr.util.ShardUtils; import org.apache.solr.client.solrj.request.CollectionAdminRequest; import org.apache.solr.client.solrj.response.CollectionAdminResponse; -import java.util.ArrayList; -import java.util.List; - public class CreateCollectionCommand extends AbstractSolrRetryCommand { public CreateCollectionCommand(int maxRetries, int interval) { @@ -39,12 +36,9 @@ public class CreateCollectionCommand extends AbstractSolrRetryCommandhttp://git-wip-us.apache.org/repos/asf/ambari/blob/7e6036c3/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateShardCommand.java -- diff --git a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateShardCommand.java b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateShardCommand.java index 9b57827..5492966 100644 --- a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateShardCommand.java +++ b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateShardCommand.java @@ -38,10 +38,7 @@ public class CreateShardCommand extends AbstractSolrRetryCommandhttp://git-wip-us.apache.org/repos/asf/ambari/blob/7e6036c3/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/GetShardsCommand.java
[3/5] ambari git commit: AMBARI-21307 Feature for supporting LDAP configuration from the UI
http://git-wip-us.apache.org/repos/asf/ambari/blob/30415a18/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java new file mode 100644 index 000..b34a2b2 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserGroupMemberAttrDetector.java @@ -0,0 +1,64 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.ldap.service.ads.detectors; + +import javax.inject.Inject; + +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys; +import org.apache.directory.api.ldap.model.entry.Entry; + +public class UserGroupMemberAttrDetector extends OccurrenceAndWeightBasedDetector { + + private enum UserGroupMemberAttr { + +MEMBER_OF("memberOf", 1), +IS_MEMBER_OF("ismemberOf", 1); + +private String attrName; +private Integer weight; + +UserGroupMemberAttr(String attr, Integer weght) { + this.attrName = attr; + this.weight = weght; +} + +Integer weight() { + return this.weight; +} + +String attrName() { + return this.attrName; +} + + } + + @Inject + public UserGroupMemberAttrDetector() { +for (UserGroupMemberAttr userGroupMemberAttr : UserGroupMemberAttr.values()) { + occurrenceMap().put(userGroupMemberAttr.attrName(), 0); + weightsMap().put(userGroupMemberAttr.attrName(), userGroupMemberAttr.weight); +} + } + + @Override + protected boolean applies(Entry entry, String attribute) { +return entry.containsAttribute(attribute); + } + + @Override + public String detectedProperty() { +return AmbariLdapConfigKeys.USER_GROUP_MEMBER_ATTRIBUTE.key(); + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/30415a18/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java new file mode 100644 index 000..dec4459 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserNameAttrDetector.java @@ -0,0 +1,71 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.ldap.service.ads.detectors; + +import javax.inject.Inject; +import javax.inject.Singleton; + +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys; +import org.apache.directory.api.ldap.model.entry.Entry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Singleton +public class UserNameAttrDetector extends OccurrenceAndWeightBasedDetector { + private static final Logger LOGGER = LoggerFactory.getLogger(UserNameAttrDetector.class); + + private enum UserNameAttrs { +SAM_ACCOUNT_NAME("sAMAccountName", 5), +UID("uid", 3), +CN("cn", 1); + +private String attrName; +private Integer weight; + +UserNameAttrs(String attr, Integer weght) { + this.attrName = attr; + this.weight = weght; +} + +Integer weight() { + return this.weight; +} + +String attrName() { + return this.attrName; +} + + } + + @Inject + public UserNameAttrDetector() { +for (UserNameAttrs nameAttr : UserNameAttrs.values()) { + occurrenceMap().put(nameAttr.attrName(), 0); + weightsMap().put(nameAttr.attrName(), nameAttr.weight()); +} + } + + @Override + protected boolean applies(Entry entry,
[5/5] ambari git commit: AMBARI-21307 Feature for supporting LDAP configuration from the UI
AMBARI-21307 Feature for supporting LDAP configuration from the UI Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/30415a18 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/30415a18 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/30415a18 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 30415a18909f37a094e4adcc27ca5f2bf39e2fb1 Parents: 7e6036c Author: lpuskas <lpus...@apache.org> Authored: Wed Jul 5 14:20:18 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Fri Oct 27 11:57:59 2017 +0200 -- ambari-funtest/pom.xml | 67 ambari-project/pom.xml | 52 +-- ambari-server/pom.xml | 83 + .../resources/ResourceInstanceFactoryImpl.java | 4 + .../AmbariConfigurationRequestSwagger.java | 47 +++ .../AmbariConfigurationResponseSwagger.java | 40 +++ .../services/AmbariConfigurationService.java| 193 +++ .../api/services/ldap/AmbariConfiguration.java | 87 + .../api/services/ldap/LdapConfigOperation.java | 43 +++ .../services/ldap/LdapConfigurationRequest.java | 49 +++ .../services/ldap/LdapConfigurationService.java | 185 +++ .../api/services/ldap/LdapRequestInfo.java | 61 .../stackadvisor/StackAdvisorRequest.java | 12 + .../commands/StackAdvisorCommand.java | 54 +++ .../ambari/server/controller/AmbariServer.java | 3 +- .../server/controller/ControllerModule.java | 3 + .../controller/ResourceProviderFactory.java | 24 +- .../AbstractControllerResourceProvider.java | 2 + .../internal/AbstractProviderModule.java| 2 +- .../AmbariConfigurationResourceProvider.java| 328 +++ .../internal/DefaultProviderModule.java | 24 +- .../ambari/server/controller/spi/Resource.java | 5 +- .../ambari/server/events/AmbariEvent.java | 11 +- .../events/AmbariLdapConfigChangedEvent.java| 37 +++ .../apache/ambari/server/ldap/LdapModule.java | 82 + .../ldap/domain/AmbariLdapConfigKeys.java | 83 + .../ldap/domain/AmbariLdapConfiguration.java| 199 +++ .../domain/AmbariLdapConfigurationFactory.java | 34 ++ .../AmbariLdapConfigurationProvider.java| 120 +++ .../ldap/service/AmbariLdapException.java | 33 ++ .../server/ldap/service/AmbariLdapFacade.java | 140 .../server/ldap/service/AttributeDetector.java | 41 +++ .../service/LdapAttributeDetectionService.java | 40 +++ .../ldap/service/LdapConfigurationService.java | 60 .../service/LdapConnectionConfigService.java| 36 ++ .../ambari/server/ldap/service/LdapFacade.java | 58 .../DefaultLdapAttributeDetectionService.java | 200 +++ .../ads/DefaultLdapConfigurationService.java| 213 .../ads/DefaultLdapConnectionConfigService.java | 113 +++ .../ads/LdapConnectionTemplateFactory.java | 111 +++ .../ads/detectors/AttributeDetectorFactory.java | 75 + .../ads/detectors/ChainedAttributeDetector.java | 73 + .../ads/detectors/GroupMemberAttrDetector.java | 65 .../ads/detectors/GroupNameAttrDetector.java| 70 .../ads/detectors/GroupObjectClassDetector.java | 73 + .../OccurrenceAndWeightBasedDetector.java | 143 .../detectors/UserGroupMemberAttrDetector.java | 64 .../ads/detectors/UserNameAttrDetector.java | 71 .../ads/detectors/UserObjectClassDetector.java | 69 .../server/orm/dao/AmbariConfigurationDAO.java | 89 + .../apache/ambari/server/orm/dao/DaoUtils.java | 13 +- .../orm/entities/AmbariConfigurationEntity.java | 70 .../orm/entities/ConfigurationBaseEntity.java | 159 + .../authorization/RoleAuthorization.java| 95 +++--- .../main/resources/Ambari-DDL-Derby-CREATE.sql | 21 ++ .../main/resources/Ambari-DDL-MySQL-CREATE.sql | 20 ++ .../main/resources/Ambari-DDL-Oracle-CREATE.sql | 20 ++ .../resources/Ambari-DDL-Postgres-CREATE.sql| 25 +- .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 20 ++ .../resources/Ambari-DDL-SQLServer-CREATE.sql | 20 ++ .../src/main/resources/META-INF/persistence.xml | 2 + .../commands/StackAdvisorCommandTest.java | 212 .../server/checks/UpgradeCheckOrderTest.java| 3 +- ...AmbariConfigurationResourceProviderTest.java | 251 ++ .../StackAdvisorResourceProviderTest.java | 97 +++--- .../server/ldap/LdapModuleFunctionalTest.java | 149 + .../TestAmbariLdapConfigurationFactory.java | 29 ++ .../ldap/service/AmbariLdapFacadeTest.java | 215 ...efaultLdapAttributeDetectionServiceTest.java | 188 +++ .../DefaultLdapConfigurationServiceTest.java| 221 + .../detectors/GroupMemberAttrDetec
ambari git commit: AMBARI-21307 fixed test and implementation [Forced Update!]
Repository: ambari Updated Branches: refs/heads/feature-branch-AMBARI-21307 25fa701c3 -> 735ff7b79 (forced update) AMBARI-21307 fixed test and implementation Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/735ff7b7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/735ff7b7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/735ff7b7 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 735ff7b79d98124fdeccd514144f8b608dc0c906 Parents: 7800777 Author: lpuskas <lpus...@apache.org> Authored: Tue Oct 24 15:29:32 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 13:35:09 2017 +0200 -- .../server/ldap/service/ads/DefaultLdapConfigurationService.java | 2 +- .../org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java| 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/735ff7b7/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java index d80a636..3f6995c 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java @@ -65,7 +65,7 @@ public class DefaultLdapConfigurationService implements LdapConfigurationService Boolean isConnected = ldapConnectionTemplate.execute(new ConnectionCallback() { @Override public Boolean doWithConnection(LdapConnection connection) throws LdapException { -return connection.isConnected(); +return connection.isConnected() && connection.isAuthenticated(); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/735ff7b7/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java index c43e06c..30f5e22 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java @@ -93,8 +93,6 @@ public class LdapModuleFunctionalTest { Boolean success = template.execute(new ConnectionCallback() { @Override public Boolean doWithConnection(LdapConnection connection) throws LdapException { -connection.unBind(); -connection.bind(ldapConfiguration.bindDn(), ldapConfiguration.bindPassword()); return connection.isConnected() && connection.isAuthenticated(); }
[55/71] [abbrv] ambari git commit: AMBARI-21307 implemented user attribute detection. Organized code
AMBARI-21307 implemented user attribute detection. Organized code Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1f94ba35 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1f94ba35 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1f94ba35 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 1f94ba354c54d6073fdc57028e1900a2475c1030 Parents: edabc94 Author: lpuskas <lpus...@apache.org> Authored: Tue Sep 12 08:10:47 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:49 2017 +0200 -- .../services/ldap/LdapConfigurationService.java | 2 +- .../server/ldap/AmbariLdapConfiguration.java| 9 ++ .../server/ldap/service/AmbariLdapFacade.java | 2 +- .../server/ldap/service/AttributeDetector.java | 38 ++ .../service/LdapAttributeDetectionService.java | 7 +- .../ambari/server/ldap/service/LdapFacade.java | 2 +- .../server/ldap/service/LdapSearchService.java | 18 --- .../ads/DefaultAttributeDetectionService.java | 132 ++- .../ads/DefaultLdapConfigurationService.java| 2 +- .../ldap/service/ads/ObjectClassDetector.java | 81 .../ads/OccurranceAndWeightBasedDetector.java | 81 .../service/ads/UserNameAttributeDetector.java | 75 +++ .../DefaultAttributeDetectionServiceTest.java | 35 ++--- 13 files changed, 440 insertions(+), 44 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1f94ba35/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java index 1b8427b..66809c3 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java @@ -107,7 +107,7 @@ public class LdapConfigurationService extends AmbariConfigurationService { case TEST_ATTRIBUTES: LOGGER.info("Testing LDAP attributes "); - groups = ldapFacade.checkLdapAttibutes(ldapConfigurationRequest.getRequestInfo().getParameters(), ambariLdapConfiguration); + groups = ldapFacade.checkLdapAttributes(ldapConfigurationRequest.getRequestInfo().getParameters(), ambariLdapConfiguration); setResult(groups, result); break; http://git-wip-us.apache.org/repos/asf/ambari/blob/1f94ba35/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java index 76faeed..e28c6ed 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java @@ -98,6 +98,10 @@ public class AmbariLdapConfiguration { return value; } + public void setValueFor(AmbariLdapConfig ambariLdapConfig, Object value) { +configurationMap.put(ambariLdapConfig.key(), value); + } + @Inject public AmbariLdapConfiguration(@Assisted Map<String, Object> configuration) { this.configurationMap = configuration; @@ -219,4 +223,9 @@ public class AmbariLdapConfiguration { return (String) configValue(AmbariLdapConfig.REFERRAL_HANDLING); } + + @Override + public String toString() { +return configurationMap.toString(); + } } http://git-wip-us.apache.org/repos/asf/ambari/blob/1f94ba35/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java index 16bf6b7..f159418 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java @@ -90,7 +90,7 @@ public class AmbariLdapFacade implements LdapFacade { } @Override - public Set checkLdapAttibutes(Map<String, Object> parameters, AmbariLdapConfiguration ldapConfiguration) throws AmbariLdapException { + public Set checkLdapAttribu
[63/71] [abbrv] ambari git commit: AMBARI-21307 Ldapconnection template optimization, basic support for custom trust store
AMBARI-21307 Ldapconnection template optimization, basic support for custom trust store Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8810151b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8810151b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8810151b Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 8810151b3210c9b55df35a24f64620ab7f1eaa02 Parents: c15cc0f Author: lpuskas <lpus...@apache.org> Authored: Mon Oct 9 17:20:38 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:51 2017 +0200 -- .../apache/ambari/server/ldap/LdapModule.java | 8 +- .../service/LdapAttributeDetectionService.java | 4 +- .../service/LdapConnectionConfigService.java| 34 ++ .../service/LdapConnectionTemplateProvider.java | 56 - .../DefaultLdapAttributeDetectionService.java | 4 +- .../ads/DefaultLdapConfigurationService.java| 11 +- .../ads/LdapConnectionTemplateFactory.java | 56 + .../DefaultLdapConnectionConfigService.java | 116 +++ .../server/ldap/LdapModuleFunctionalTest.java | 28 + 9 files changed, 224 insertions(+), 93 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8810151b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java index d59264a..4abf4e7 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java @@ -21,11 +21,11 @@ import org.apache.ambari.server.ldap.service.AmbariLdapConfigurationProvider; import org.apache.ambari.server.ldap.service.AmbariLdapFacade; import org.apache.ambari.server.ldap.service.LdapAttributeDetectionService; import org.apache.ambari.server.ldap.service.LdapConfigurationService; -import org.apache.ambari.server.ldap.service.LdapConnectionTemplateProvider; +import org.apache.ambari.server.ldap.service.LdapConnectionConfigService; import org.apache.ambari.server.ldap.service.LdapFacade; import org.apache.ambari.server.ldap.service.ads.DefaultLdapAttributeDetectionService; import org.apache.ambari.server.ldap.service.ads.DefaultLdapConfigurationService; -import org.apache.directory.ldap.client.template.LdapConnectionTemplate; +import org.apache.ambari.server.ldap.service.ads.detectors.DefaultLdapConnectionConfigService; import com.google.inject.AbstractModule; import com.google.inject.assistedinject.FactoryModuleBuilder; @@ -40,13 +40,11 @@ public class LdapModule extends AbstractModule { bind(LdapFacade.class).to(AmbariLdapFacade.class); bind(LdapConfigurationService.class).to(DefaultLdapConfigurationService.class); bind(LdapAttributeDetectionService.class).to(DefaultLdapAttributeDetectionService.class); + bind(LdapConnectionConfigService.class).to(DefaultLdapConnectionConfigService.class); // this binding requires the JPA module! bind(AmbariLdapConfiguration.class).toProvider(AmbariLdapConfigurationProvider.class); -// bind to the provider implementation (let GUICE deal with instantiating 3rd party instances) - bind(LdapConnectionTemplate.class).toProvider(LdapConnectionTemplateProvider.class); - install(new FactoryModuleBuilder().build(AmbariLdapConfigurationFactory.class)); } } http://git-wip-us.apache.org/repos/asf/ambari/blob/8810151b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/LdapAttributeDetectionService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/LdapAttributeDetectionService.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/LdapAttributeDetectionService.java index 6cd369b..c08a2e0 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/LdapAttributeDetectionService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/LdapAttributeDetectionService.java @@ -27,7 +27,7 @@ public interface LdapAttributeDetectionService { * @param ambariLdapConfiguration configuration instance holding connection details * @return the configuration decorated with user related attributes */ - AmbariLdapConfiguration detectLdapUserAttributes(AmbariLdapConfiguration ambariLdapConfiguration); + AmbariLdapConfiguration detectLdapUserAttributes(AmbariLdapConfiguration ambariLdapConfiguration) throws AmbariLdapException; /** * Decorates the passed in configuration with the detecte
[47/71] [abbrv] ambari git commit: AMBARI-21307 Add all known LDAP properties to AmbariConfigurationEnum (benyoka)
AMBARI-21307 Add all known LDAP properties to AmbariConfigurationEnum (benyoka) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/90b6b13e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/90b6b13e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/90b6b13e Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 90b6b13e0d6b9e66e7f310069d9bf2b5d8dc5b24 Parents: 8bbf83c Author: Balazs Bence Sari <beny...@apache.org> Authored: Mon Sep 4 12:45:07 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:48 2017 +0200 -- .../ambari/server/ldap/AmbariLdapConfiguration.java | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/90b6b13e/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java index b1cbced..e913e77 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java @@ -40,22 +40,35 @@ public class AmbariLdapConfiguration { USE_SSL("ambari.ldap.usessl"), LDAP_SERVER_HOST("ambari.ldap.server.host"), LDAP_SERVER_PORT("ambari.ldap.server.port"), +LDAP_TRUSTSTORE("ambari.ldap.truststore"), LDAP_TRUSTSTORE_TYPE("ambari.ldap.truststore.type"), LDAP_TRUSTSTORE_PATH("ambari.ldap.truststore.path"), +LDAP_TRUSTSTORE_PASSWORD("ambari.ldap.truststore.password"), BASE_DN("ambari.ldap.bind.dn"), +REFERRAL("ambari.ldap.referral"), +PAGINATION_ENABLED("ambari.ldap.pagination.enabled"), BIND_ANONIMOUSLY("ambari.ldap.bindanonymously"), MANAGER_DN("ambari.ldap.managerdn"), MANAGER_PASSWORD("ambari.ldap.managerpassword"), USER_OBJECT_CLASS("ambari.ldap.user.object.class"), USER_NAME_ATTRIBUTE("ambari.ldap.user.name.attribute"), +USER_NAME_FORCE_LOWERCASE("ambari.ldap.username.force.lowercase"), USER_SEARCH_BASE("ambari.ldap.user.search.base"), + SYNC_USER_MEMBER_REPLACE_PATTERN("ambari.ldap.sync.user.member.replacepattern"), +SYNC_USER_MEMBER_FILTER("ambari.ldap.sync.user.member_filter"), +ADMIN_GROUP_MAPPING_RULES ("ambari.ldap.admin.group.mappingrules"), GROUP_OBJECT_CLASS("ambari.ldap.group.object.class"), GROUP_NAME_ATTRIBUTE("ambari.ldap.group.name.attribute"), GROUP_MEMBER_ATTRIBUTE("ambari.ldap.group.member.attribute"), GROUP_SEARCH_BASE("ambari.ldap.group.search.base"), -DN_ATTRIBUTE("authentication.ldap.dnAttribute"); + SYNC_GROUP_MEMBER_REPLACE_PATTERN("ambari.ldap.sync.group.member.replacepattern"), +SYNC_GROUP_MEMBER_FILTER("ambari.ldap.sync.group.member_filter"), +DN_ATTRIBUTE("authentication.ldap.dnAttribute"), + +TEST_USER_NAME("ambari.ldap.test.user.name"), +TEST_USER_PASSWORD("ambari.ldap.test.user.password"); private String propertyName;
[60/71] [abbrv] ambari git commit: AMBARI-21307 Refactor - using the LdapConnectionTemplate for ldap operations
http://git-wip-us.apache.org/repos/asf/ambari/blob/c15cc0f3/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionServiceTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionServiceTest.java deleted file mode 100644 index 878d1f0..000 --- a/ambari-server/src/test/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionServiceTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ambari.server.ldap.service.ads; - - -import java.util.Map; - -import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys; -import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration; -import org.apache.ambari.server.ldap.domain.TestAmbariLdapConfigurationFactory; -import org.apache.ambari.server.ldap.service.LdapConnectionService; -import org.apache.directory.api.ldap.model.constants.SchemaConstants; -import org.apache.directory.ldap.client.api.LdapConnection; -import org.easymock.EasyMockRule; -import org.easymock.TestSubject; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.collect.Maps; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - -public class DefaultLdapAttributeDetectionServiceTest { - - private static final Logger LOGGER = LoggerFactory.getLogger(DefaultLdapAttributeDetectionServiceTest.class); - - @Rule - public EasyMockRule mocks = new EasyMockRule(this); - - private AmbariLdapConfiguration testLdapConfiguration; - private TestAmbariLdapConfigurationFactory ldapConfigurationFactory = new TestAmbariLdapConfigurationFactory(); - - private LdapConnection connection; - - @TestSubject - private DefaultLdapAttributeDetectionService attributeDetectionService = new DefaultLdapAttributeDetectionService(); - - @Before - public void before() { - -MapinitialProps = Maps.newHashMap(); -initialProps.put(AmbariLdapConfigKeys.BIND_DN.key(), ""); -testLdapConfiguration = ldapConfigurationFactory.createLdapConfiguration(initialProps); - } - - @Test - public void testShouldUserNameAttributeBeDetectedWhenSearchReturnsValidUsers() throws Exception { -// GIVEN -// a set of entries returned from the LDAP search - -// WHEN -AmbariLdapConfiguration ambariLdapConfiguration = attributeDetectionService.detectLdapUserAttributes(connection, testLdapConfiguration); - -// THEN -Assert.assertNotNull(ambariLdapConfiguration); -Assert.assertEquals("The username attribute is not the expected", "uid", ambariLdapConfiguration.userNameAttribute()); - - } - - - @Test - public void functionalTest() throws Exception { -// GIVEN -AmbariLdapConfiguration ambariLdapConfiguration = ldapConfigurationFactory.createLdapConfiguration(getTestPropertiesMap()); -LdapConnectionService connectionService = new DefaultLdapConnectionService(); -LdapConnection ldapConnection = connectionService.createLdapConnection(ambariLdapConfiguration); - -// WHEN -AmbariLdapConfiguration config = attributeDetectionService.detectLdapUserAttributes(ldapConnection, ambariLdapConfiguration); -config = attributeDetectionService.detectLdapGroupAttributes(ldapConnection, ambariLdapConfiguration); - -Gson gson = new GsonBuilder().create(); -LOGGER.info(gson.toJson(config)); - -// THEN -ldapConnection.close(); - - } - - private Map getTestPropertiesMap() { -Map ldapPropsMap = Maps.newHashMap(); - -ldapPropsMap.put(AmbariLdapConfigKeys.ANONYMOUS_BIND.key(), "true"); -ldapPropsMap.put(AmbariLdapConfigKeys.SERVER_HOST.key(), "ldap.forumsys.com"); -ldapPropsMap.put(AmbariLdapConfigKeys.SERVER_PORT.key(), "389"); -ldapPropsMap.put(AmbariLdapConfigKeys.BIND_DN.key(), "cn=read-only-admin,dc=example,dc=com"); -ldapPropsMap.put(AmbariLdapConfigKeys.BIND_PASSWORD.key(), "password"); -ldapPropsMap.put(AmbariLdapConfigKeys.DN_ATTRIBUTE.key(), SchemaConstants.CN_AT); - -ldapPropsMap.put(AmbariLdapConfigKeys.USER_SEARCH_BASE.key(),
[06/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/css/bootstrap.css -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/css/bootstrap.css b/contrib/views/storm/src/main/resources/ui/app/styles/css/bootstrap.css new file mode 100644 index 000..6167622 --- /dev/null +++ b/contrib/views/storm/src/main/resources/ui/app/styles/css/bootstrap.css @@ -0,0 +1,6757 @@ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ +html { + font-family: sans-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +body { + margin: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +a { + background-color: transparent; +} +a:active, +a:hover { + outline: 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +dfn { + font-style: italic; +} +h1 { + margin: .67em 0; + font-size: 2em; +} +mark { + color: #000; + background: #ff0; +} +small { + font-size: 80%; +} +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} +sup { + top: -.5em; +} +sub { + bottom: -.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 1em 40px; +} +hr { + height: 0; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +pre { + overflow: auto; +} +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} +button, +input, +optgroup, +select, +textarea { + margin: 0; + font: inherit; + color: inherit; +} +button { + overflow: visible; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + padding: 0; + border: 0; +} +input { + line-height: normal; +} +input[type="checkbox"], +input[type="radio"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} +input[type="search"] { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +fieldset { + padding: .35em .625em .75em; + margin: 0 2px; + border: 1px solid #c0c0c0; +} +legend { + padding: 0; + border: 0; +} +textarea { + overflow: auto; +} +optgroup { + font-weight: bold; +} +table { + border-spacing: 0; + border-collapse: collapse; +} +td, +th { + padding: 0; +} +/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ +@media print { + *, + *:before, + *:after { +color: #000 !important; +text-shadow: none !important; +background: transparent !important; +-webkit-box-shadow: none !important; +box-shadow: none !important; + } + a, + a:visited { +text-decoration: underline; + } + a[href]:after { +content: " (" attr(href) ")"; + } + abbr[title]:after { +content: " (" attr(title) ")"; + } + a[href^="#"]:after, + a[href^="javascript:"]:after { +content: ""; + } + pre, + blockquote { +border: 1px solid #999; + +page-break-inside: avoid; + } + thead { +display: table-header-group; + } + tr, + img { +page-break-inside: avoid; + } + img { +max-width: 100% !important; + } + p, + h2, + h3 { +orphans: 3; +widows: 3; + } + h2, + h3 { +page-break-after: avoid; + } + .navbar { +display: none; + } + .btn > .caret, + .dropup > .btn > .caret { +border-top-color: #000 !important; + } + .label { +border: 1px solid #000; + } + .table { +border-collapse: collapse !important; + } + .table td, + .table th { +background-color: #fff !important; + } + .table-bordered th, + .table-bordered td { +border: 1px solid #ddd !important; + } +} +@font-face { + font-family: 'Glyphicons Halflings'; + + src: url('../fonts/glyphicons-halflings-regular.eot'); + src:
[31/71] [abbrv] ambari git commit: AMBARI-22291 Adapt Repository Files For Existing Deployments for trunk (dgrinenko)
AMBARI-22291 Adapt Repository Files For Existing Deployments for trunk (dgrinenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/467e3448 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/467e3448 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/467e3448 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 467e34487f56cc8ad700a11e1a4d5a0385b2be6a Parents: 5bdede5 Author: Dmytro GrinenkoAuthored: Mon Oct 23 21:55:29 2017 +0300 Committer: Dmytro Grinenko Committed: Mon Oct 23 21:55:29 2017 +0300 -- .../core/providers/package/__init__.py | 2 +- .../core/providers/package/apt.py | 23 -- .../core/providers/package/yumrpm.py| 79 +- .../core/providers/package/zypper.py| 37 +++-- .../libraries/functions/repository_util.py | 79 ++ .../libraries/script/script.py | 4 +- .../ambari/server/agent/CommandRepository.java | 85 .../ambari/server/agent/ExecutionCommand.java | 1 + .../server/configuration/Configuration.java | 13 +++ .../controller/AmbariActionExecutionHelper.java | 1 - .../AmbariCustomCommandExecutionHelper.java | 17 +++- .../orm/entities/RepositoryVersionEntity.java | 27 +++ .../stack/upgrade/RepositoryVersionHelper.java | 21 - .../server/upgrade/UpgradeCatalog260.java | 13 +++ .../main/resources/Ambari-DDL-Derby-CREATE.sql | 1 + .../main/resources/Ambari-DDL-MySQL-CREATE.sql | 1 + .../main/resources/Ambari-DDL-Oracle-CREATE.sql | 1 + .../resources/Ambari-DDL-Postgres-CREATE.sql| 1 + .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 1 + .../resources/Ambari-DDL-SQLServer-CREATE.sql | 1 + .../custom_actions/scripts/install_packages.py | 5 +- ...ClusterStackVersionResourceProviderTest.java | 2 + .../configs/install_packages_config.json| 1 + .../install_packages_repository_file.json | 1 + 24 files changed, 337 insertions(+), 80 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/467e3448/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py -- diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py b/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py index 8728b5e..fc695a7 100644 --- a/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py +++ b/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py @@ -69,7 +69,7 @@ class PackageProvider(Provider): def get_available_packages_in_repos(self, repositories): """ Gets all (both installed and available) packages that are available at given repositories. -:param repositories: from command configs like config['repositoryFile']['repositories'] +:type repositories resource_management.libraries.functions.repository_util.CommandRepository :return: installed and available packages from these repositories """ raise NotImplementedError() http://git-wip-us.apache.org/repos/asf/ambari/blob/467e3448/ambari-common/src/main/python/resource_management/core/providers/package/apt.py -- diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/apt.py b/ambari-common/src/main/python/resource_management/core/providers/package/apt.py index e236697..12631fa 100644 --- a/ambari-common/src/main/python/resource_management/core/providers/package/apt.py +++ b/ambari-common/src/main/python/resource_management/core/providers/package/apt.py @@ -274,24 +274,31 @@ class AptProvider(PackageProvider): return packages - def get_available_packages_in_repos(self, repositories): + def get_available_packages_in_repos(self, repos): """ Gets all (both installed and available) packages that are available at given repositories. -:param repositories: from command configs like config['repositoryFile']['repositories'] +:type repos resource_management.libraries.functions.repository_util.CommandRepository :return: installed and available packages from these repositories """ filtered_packages = [] packages = self.all_available_packages() +repo_ids = [] -for repo in repositories: - repo_url_part = repo['baseUrl'].replace("http://;, "").replace("/", "_") +for repo in repos.items: + repo_ids.append(repo.base_url.replace("http://;, "").replace("/", "_")) - for package in packages: -if repo_url_part in package[2]: -
[28/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Bootstrap/css/bootstrap-editable.css -- diff --git a/contrib/views/storm/src/main/resources/libs/Bootstrap/css/bootstrap-editable.css b/contrib/views/storm/src/main/resources/libs/Bootstrap/css/bootstrap-editable.css deleted file mode 100644 index 50543a7..000 --- a/contrib/views/storm/src/main/resources/libs/Bootstrap/css/bootstrap-editable.css +++ /dev/null @@ -1,663 +0,0 @@ -/*! X-editable - v1.5.1 -* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery -* http://github.com/vitalets/x-editable -* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */ -.editableform { -margin-bottom: 0; /* overwrites bootstrap margin */ -} - -.editableform .control-group { -margin-bottom: 0; /* overwrites bootstrap margin */ -white-space: nowrap; /* prevent wrapping buttons on new line */ -line-height: 20px; /* overwriting bootstrap line-height. See #133 */ -} - -/* - BS3 width:1005 for inputs breaks editable form in popup - See: https://github.com/vitalets/x-editable/issues/393 -*/ -.editableform .form-control { -width: auto; -} - -.editable-buttons { - display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */ - vertical-align: top; - margin-left: 7px; - /* inline-block emulation for IE7*/ - zoom: 1; - *display: inline; -} - -.editable-buttons.editable-buttons-bottom { - display: block; - margin-top: 7px; - margin-left: 0; -} - -.editable-input { -vertical-align: top; -display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */ -width: auto; /* bootstrap-responsive has width: 100% that breakes layout */ -white-space: normal; /* reset white-space decalred in parent*/ - /* display-inline emulation for IE7*/ - zoom: 1; - *display: inline; -} - -.editable-buttons .editable-cancel { - margin-left: 7px; -} - -/*for jquery-ui buttons need set height to look more pretty*/ -.editable-buttons button.ui-button-icon-only { - height: 24px; - width: 30px; -} - -.editableform-loading { -background: url('../images/loading.gif') center center no-repeat; -height: 25px; -width: auto; -min-width: 25px; -} - -.editable-inline .editableform-loading { -background-position: left 5px; -} - - .editable-error-block { -max-width: 300px; -margin: 5px 0 0 0; -width: auto; -white-space: normal; -} - -/*add padding for jquery ui*/ -.editable-error-block.ui-state-error { -padding: 3px; -} - -.editable-error { - color: red; -} - -/* For specific types */ - -.editableform .editable-date { -padding: 0; -margin: 0; -float: left; -} - -/* move datepicker icon to center of add-on button. See https://github.com/vitalets/x-editable/issues/183 */ -.editable-inline .add-on .icon-th { - margin-top: 3px; - margin-left: 1px; -} - - -/* checklist vertical alignment */ -.editable-checklist label input[type="checkbox"], -.editable-checklist label span { -vertical-align: middle; -margin: 0; -} - -.editable-checklist label { -white-space: nowrap; -} - -/* set exact width of textarea to fit buttons toolbar */ -.editable-wysihtml5 { -width: 566px; -height: 250px; -} - -/* clear button shown as link in date inputs */ -.editable-clear { - clear: both; - font-size: 0.9em; - text-decoration: none; - text-align: right; -} - -/* IOS-style clear button for text inputs */ -.editable-clear-x { - background: url('../images/clear.png') center center no-repeat; - display: block; - width: 13px; - height: 13px; - position: absolute; - opacity: 0.6; - z-index: 100; - - top: 50%; - right: 6px; - margin-top: -6px; - -} - -.editable-clear-x:hover { - opacity: 1; -} - -.editable-pre-wrapped { - white-space: pre-wrap; -} -.editable-container.editable-popup { -max-width: none !important; /* without this rule poshytip/tooltip does not stretch */ -} - -.editable-container.popover { -width: auto; /* without this rule popover does not stretch */ -} - -.editable-container.editable-inline { -display: inline-block; -vertical-align: middle; -width: auto; -/* inline-block emulation for IE7*/ -zoom: 1; -*display: inline; -} - -.editable-container.ui-widget { - font-size: inherit; /* jqueryui widget font 1.1em too big, overwrite it */ - z-index: 9990; /* should be less than select2 dropdown z-index to close dropdown first when click */ -} -.editable-click, -a.editable-click, -a.editable-click:hover { -text-decoration: none; -border-bottom: dashed 1px #0088cc; -} - -.editable-click.editable-disabled, -a.editable-click.editable-disabled, -a.editable-click.editable-disabled:hover { - color: #585858; - cursor: default; - border-bottom: none; -} -
[44/71] [abbrv] ambari git commit: AMBARI-21307 Draft skimplementation for the user related ldap config attribute validation
AMBARI-21307 Draft skimplementation for the user related ldap config attribute validation Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/10b40acb Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/10b40acb Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/10b40acb Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 10b40acbfe68e804a10dbbb1139561af3d138a19 Parents: 421391a Author: lpuskas <lpus...@apache.org> Authored: Tue Jul 18 17:48:07 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:47 2017 +0200 -- ambari-project/pom.xml | 1 + ambari-server/pom.xml | 5 + .../AmbariConfigurationRequestSwagger.java | 1 - .../services/ldap/AmbariConfigurationDTO.java | 67 +++ .../ldap/LdapCheckConfigurationRequest.java | 47 + .../api/services/ldap/LdapOperationRequest.java | 18 ++ .../api/services/ldap/LdapRequestInfo.java | 61 +++ .../api/services/ldap/LdapRestService.java | 132 ++ .../ambari/server/controller/AmbariServer.java | 3 +- .../server/controller/ControllerModule.java | 1 + .../server/ldap/AmbariLdapConfiguration.java| 129 ++ .../server/ldap/LdapConfigurationFactory.java | 21 +++ .../ldap/LdapConfigurationValidatorService.java | 52 ++ .../apache/ambari/server/ldap/LdapModule.java | 37 .../ldap/service/AmbariLdapException.java | 33 .../server/ldap/service/AmbariLdapFacade.java | 107 +++ .../ambari/server/ldap/service/LdapFacade.java | 52 ++ .../server/ldap/service/LdapSearchService.java | 18 ++ .../ad/AdLdapConfigurationValidatorService.java | 177 +++ .../service/ad/LdapConfigurationConverter.java | 50 ++ .../api/services/ldap/LDAPServiceTest.java | 85 + ...AdLdapConfigurationValidatorServiceTest.java | 129 ++ 22 files changed, 1224 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/10b40acb/ambari-project/pom.xml -- diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml index 00ba1bc..e4d4423 100644 --- a/ambari-project/pom.xml +++ b/ambari-project/pom.xml @@ -31,6 +31,7 @@ ${project.parent.basedir} 1.6.3 8.1.19.v20160209 +1.0.0 6.19 1.5.10 3.1.4 http://git-wip-us.apache.org/repos/asf/ambari/blob/10b40acb/ambari-server/pom.xml -- diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml index e250da7..8d52821 100644 --- a/ambari-server/pom.xml +++ b/ambari-server/pom.xml @@ -1689,6 +1689,11 @@ 4.2.2 + org.apache.directory.api + api-all + ${ldap-api.version} + + com.networknt json-schema-validator 0.1.10 http://git-wip-us.apache.org/repos/asf/ambari/blob/10b40acb/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java index d6714f9..5e8094e 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java @@ -16,7 +16,6 @@ package org.apache.ambari.server.api.services; import java.util.Map; import org.apache.ambari.server.controller.ApiModel; -import org.apache.ambari.server.orm.entities.ConfigurationBaseEntity; import io.swagger.annotations.ApiModelProperty; http://git-wip-us.apache.org/repos/asf/ambari/blob/10b40acb/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfigurationDTO.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfigurationDTO.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfigurationDTO.java new file mode 100644 index 000..1b134fe --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfigurationDTO.java @@ -0,0 +1,67 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICE
[30/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5bdede50 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5bdede50 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5bdede50 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 5bdede509609a53284462612262ca579686b87dc Parents: f537fe5 Author: Yusaku SakoAuthored: Mon Oct 23 10:26:19 2017 -0700 Committer: Yusaku Sako Committed: Mon Oct 23 10:26:19 2017 -0700 -- .gitignore | 3 + contrib/views/storm/pom.xml | 103 +- .../src/main/resources/images/icon-bolt.png | Bin 2157 -> 0 bytes .../src/main/resources/images/icon-spout.png| Bin 2620 -> 0 bytes .../storm/src/main/resources/images/loader.gif | Bin 15017 -> 0 bytes .../views/storm/src/main/resources/index.html |45 - .../js/backbone-paginator.min.js| 1325 -- .../main/resources/libs/Backbone/js/Backbone.js | 1920 -- .../libs/Bootstrap/css/bootstrap-editable.css | 663 - .../libs/Bootstrap/css/bootstrap-slider.min.css |28 - .../libs/Bootstrap/css/bootstrap-switch.min.css |22 - .../resources/libs/Bootstrap/css/bootstrap.css | 5959 - .../fonts/glyphicons-halflings-regular.eot | Bin 20127 -> 0 bytes .../fonts/glyphicons-halflings-regular.svg | 288 - .../fonts/glyphicons-halflings-regular.ttf | Bin 45404 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff | Bin 23424 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff2| Bin 18028 -> 0 bytes .../resources/libs/Bootstrap/images/clear.png | Bin 509 -> 0 bytes .../resources/libs/Bootstrap/images/loading.gif | Bin 1849 -> 0 bytes .../libs/Bootstrap/js/bootstrap-editable.min.js | 7 - .../libs/Bootstrap/js/bootstrap-notify.min.js | 1 - .../libs/Bootstrap/js/bootstrap-slider.min.js |29 - .../libs/Bootstrap/js/bootstrap-switch.min.js |22 - .../libs/Bootstrap/js/bootstrap.min.js | 7 - .../libs/Font-Awesome/css/font-awesome.min.css | 4 - .../libs/Font-Awesome/fonts/FontAwesome.otf | Bin 109688 -> 0 bytes .../Font-Awesome/fonts/fontawesome-webfont.eot | Bin 70807 -> 0 bytes .../Font-Awesome/fonts/fontawesome-webfont.svg | 655 - .../Font-Awesome/fonts/fontawesome-webfont.ttf | Bin 142072 -> 0 bytes .../Font-Awesome/fonts/fontawesome-webfont.woff | Bin 83588 -> 0 bytes .../fonts/fontawesome-webfont.woff2 | Bin 66624 -> 0 bytes .../resources/libs/Underscore/js/Underscore.js | 1548 -- .../resources/libs/bootbox/js/bootbox.min.js| 6 - .../src/main/resources/libs/d3/js/d3-tip.min.js | 1 - .../src/main/resources/libs/d3/js/d3.min.js | 5 - .../resources/libs/dagre-d3/dagre-d3.min.js |28 - .../libs/jQuery/js/jquery-2.2.3.min.js | 4 - .../main/resources/libs/jsx/JSXTransformer.js | 15201 .../storm/src/main/resources/libs/jsx/jsx.js|75 - .../main/resources/libs/react/js/react-dom.js |42 - .../libs/react/js/react-with-addons.js | 20775 - .../resources/libs/require-js/js/require.min.js |36 - .../main/resources/libs/require-text/js/text.js | 390 - .../scripts/collections/BaseCollection.js | 197 - .../scripts/collections/VNimbusConfigList.js|52 - .../scripts/collections/VNimbusList.js |52 - .../scripts/collections/VSupervisorList.js |52 - .../scripts/collections/VTopologyConfigList.js |49 - .../scripts/collections/VTopologyList.js|52 - .../resources/scripts/components/BarChart.jsx | 402 - .../scripts/components/Breadcrumbs.jsx |50 - .../main/resources/scripts/components/Modal.jsx |60 - .../scripts/components/RadialChart.jsx | 127 - .../resources/scripts/components/SearchLogs.jsx |89 - .../main/resources/scripts/components/Table.jsx | 101 - .../scripts/components/TopologyGraph.jsx| 199 - .../scripts/containers/ClusterSummary.jsx | 122 - .../scripts/containers/NimbusConfigSummary.jsx | 103 - .../scripts/containers/NimbusSummary.jsx| 139 - .../scripts/containers/SupervisorSummary.jsx| 155 - .../containers/TopologyConfiguration.jsx|93 - .../scripts/containers/TopologyDetailGraph.jsx |66 - .../scripts/containers/TopologyListing.jsx | 188 - .../storm/src/main/resources/scripts/main.js|98 - .../main/resources/scripts/models/BaseModel.js |83 - .../main/resources/scripts/models/VCluster.js |42 - .../main/resources/scripts/models/VNimbus.js|42 - .../resources/scripts/models/VNimbusConfig.js |42 -
[65/71] [abbrv] ambari git commit: AMBARI-21307 Added unit tests. Improved logging, refactoring: rename, organized classes into packages
AMBARI-21307 Added unit tests. Improved logging, refactoring: rename, organized classes into packages Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/575102f5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/575102f5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/575102f5 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 575102f5d20aa3767b3714d302054b854fb6cd4b Parents: cd807e1 Author: lpuskas <lpus...@apache.org> Authored: Fri Oct 13 17:19:41 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:51 2017 +0200 -- .../apache/ambari/server/ldap/LdapModule.java | 2 +- .../AmbariLdapConfigurationProvider.java| 13 +- .../server/ldap/service/AmbariLdapFacade.java | 2 +- .../service/LdapConnectionConfigService.java| 4 +- .../ads/DefaultLdapConfigurationService.java| 38 +++- .../ads/DefaultLdapConnectionConfigService.java | 116 ++ .../DefaultLdapConnectionConfigService.java | 116 -- .../server/ldap/LdapModuleFunctionalTest.java | 4 +- ...estAmbariAmbariLdapConfigurationFactory.java | 29 --- .../TestAmbariLdapConfigurationFactory.java | 29 +++ .../ldap/service/AmbariLdapFacadeTest.java | 4 +- .../DefaultLdapConfigurationServiceTest.java| 221 +++ 12 files changed, 414 insertions(+), 164 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/575102f5/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java index 4abf4e7..67e84dc 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java @@ -25,7 +25,7 @@ import org.apache.ambari.server.ldap.service.LdapConnectionConfigService; import org.apache.ambari.server.ldap.service.LdapFacade; import org.apache.ambari.server.ldap.service.ads.DefaultLdapAttributeDetectionService; import org.apache.ambari.server.ldap.service.ads.DefaultLdapConfigurationService; -import org.apache.ambari.server.ldap.service.ads.detectors.DefaultLdapConnectionConfigService; +import org.apache.ambari.server.ldap.service.ads.DefaultLdapConnectionConfigService; import com.google.inject.AbstractModule; import com.google.inject.assistedinject.FactoryModuleBuilder; http://git-wip-us.apache.org/repos/asf/ambari/blob/575102f5/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapConfigurationProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapConfigurationProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapConfigurationProvider.java index 9fad896..c88d420 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapConfigurationProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapConfigurationProvider.java @@ -36,7 +36,8 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; /** - * Provider implementation for LDAP configurations. It needs to be registered in the related GUICE module as a provider + * Provider implementation for LDAP configurations. + * It needs to be registered in the related GUICE module as a provider. * It's responsible for managing LDAP configurations in the application. * Whenever requested, this provider returns an AmbariLdapConfiguration which is always in sync with the persisted LDAP * configuration resource. @@ -85,15 +86,15 @@ public class AmbariLdapConfigurationProvider implements Providerhttp://git-wip-us.apache.org/repos/asf/ambari/blob/575102f5/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java index bbfbc8e..0118840 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java @@ -33,7 +33,7 @@ public class AmbariLdapFacade implements LdapFacade { /** * Additional parameters expected to be provided along with the configuration */ - protected enum Parameters { + public enum Parameters { TE
[40/71] [abbrv] ambari git commit: Added swagger annotations to the new endpoint
Added swagger annotations to the new endpoint Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/981887da Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/981887da Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/981887da Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 981887dae02f0a2a24e26c843f30816b89ccab07 Parents: f5a671e Author: Balázs Bence Sári <bs...@hortonworks.com> Authored: Thu Jul 6 18:36:18 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:46 2017 +0200 -- .../AmbariConfigurationRequestSwagger.java | 48 +++ .../AmbariConfigurationResponseSwagger.java | 40 + .../services/AmbariConfigurationService.java| 62 +--- 3 files changed, 143 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/981887da/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java new file mode 100644 index 000..d6714f9 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java @@ -0,0 +1,48 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.ambari.server.api.services; + +import java.util.Map; + +import org.apache.ambari.server.controller.ApiModel; +import org.apache.ambari.server.orm.entities.ConfigurationBaseEntity; + +import io.swagger.annotations.ApiModelProperty; + +/** + * Request data model for {@link org.apache.ambari.server.api.services.AmbariConfigurationService} + */ +public interface AmbariConfigurationRequestSwagger extends ApiModel { + + @ApiModelProperty(name = "AmbariConfiguration") + AmbariConfigurationRequestInfo getAmbariConfiguration(); + + interface AmbariConfigurationRequestInfo { +@ApiModelProperty +Long getId(); + +@ApiModelProperty +Map<String, Object> getData(); + +@ApiModelProperty +String getType(); + +@ApiModelProperty +Long getVersion(); + +@ApiModelProperty(name = "version_tag") +String getVersionTag(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/981887da/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationResponseSwagger.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationResponseSwagger.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationResponseSwagger.java new file mode 100644 index 000..c55ac1d --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationResponseSwagger.java @@ -0,0 +1,40 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.ambari.server.api.services; + +import java.util.Map; + +import org.apache.ambari.server.controller.ApiModel; + +import io.swagger.annotations.ApiModelProperty; + +/** + * Response data model for {@link org.apache.ambari.server.api.services.AmbariConfigurationService} + */ +public interface AmbariConfigurationResponseSwagger extends ApiModel { + + @ApiModelProperty(name = "AmbariConfiguration") + AmbariConfigurationResponseInfo getAmbariConfigurationResponse(); + + interface AmbariConfigurationResponseInfo { +@ApiMo
[10/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/scripts/views/TopologyDetailView.jsx -- diff --git a/contrib/views/storm/src/main/resources/scripts/views/TopologyDetailView.jsx b/contrib/views/storm/src/main/resources/scripts/views/TopologyDetailView.jsx deleted file mode 100644 index 136d95f..000 --- a/contrib/views/storm/src/main/resources/scripts/views/TopologyDetailView.jsx +++ /dev/null @@ -1,1039 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at -* - http://www.apache.org/licenses/LICENSE-2.0 -* - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -define([ - 'jsx!components/Table', - 'jsx!modules/Table/Pagination', - 'utils/Utils', - 'react', - 'react-dom', - 'collections/BaseCollection', - 'models/VTopology', - 'models/BaseModel', - 'jsx!containers/TopologyConfiguration', - 'jsx!containers/TopologyDetailGraph', - 'jsx!components/Breadcrumbs', - 'jsx!components/SearchLogs', - 'jsx!components/BarChart', - 'jsx!views/RebalanceView', - 'bootbox', - 'x-editable', - 'bootstrap', - 'bootstrap-switch' - ],function(Table, Pagination, Utils, React, ReactDOM, BaseCollection, VTopology, BaseModel, TopologyConfiguration, TopologyDetailGraph, Breadcrumbs, SearchLogs, BarChart, RebalanceView, bootbox, XEditable){ - 'use strict'; - - return React.createClass({ - displayName: 'TopologyDetailView', - propTypes: { - id: React.PropTypes.string.isRequired - }, - getInitialState: function(){ - this.model = new VTopology({'id': this.props.id}); - this.spoutCollection = new BaseCollection(); - this.boltCollection = new BaseCollection(); - this.lagCollection = new BaseCollection(); - this.systemFlag = false; - this.windowSize = ':all-time'; - return { - model: this.model, - graphData: {}, - logLevels: {}, - rebalanceModalOpen: false, - lagData: [], - hideKafkaLagBox: false, - workerHostPort: '' - }; - }, - componentWillMount: function(){ - $('.loader').show(); - this.initializeData(); - }, - componentDidMount: function(){ - $(".boot-switch.systemSum").bootstrapSwitch({ - size: 'small', - onSwitchChange: function(event, state){ - this.systemFlag = state; - this.initializeData(); - }.bind(this) - }); - $("#slideContent").hide(); - $(".boot-switch.debug").bootstrapSwitch({ - size: 'small', - onSwitchChange: function(event, state){ - this.debugAction(state); - }.bind(this) - }); - $("#lag-graph").hide(); - $("#kafkaSpout").bootstrapSwitch({ - onSwitchChange: function() { - $('#lag-graph, #lag-table').slideToggle(); - } - }); - $('[data-rel="tooltip"]').tooltip(); - $('.loader').hide(); - }, - componentWillUpdate: function(){ - $('#collapse-spout').off('hidden.bs.collapse'); - $('#collapse-spout').off('shown.bs.collapse'); - $('#collapse-bolt').off('hidden.bs.collapse'); - $('#collapse-bolt').off('shown.bs.collapse'); - $('#modal-rebalance').off('hidden.bs.modal'); -
[19/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/d3/js/d3.min.js -- diff --git a/contrib/views/storm/src/main/resources/libs/d3/js/d3.min.js b/contrib/views/storm/src/main/resources/libs/d3/js/d3.min.js deleted file mode 100644 index 2856dd2..000 --- a/contrib/views/storm/src/main/resources/libs/d3/js/d3.min.js +++ /dev/null @@ -1,5 +0,0 @@ -!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&||n.document&||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function a(n){return n.length}function o(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function s(n){return(n+="")===xa||n[0]===ba?ba+n:n}function f(n){return(n+="")[0]===ba?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._& this ._[n]}function p(){var n=[];for(var t in this._)n.push(f(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function m(){this._=Object.create(null)}function y(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=_a.length;r>e;++e){var u=_a[e]+t;if(u in n)return u}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,u=-1,i=r.length;++ue;e++)for(var u,i=n[e],a=0,o=i.length;o>a;a++)(u=i[a])&(u,a,e);return n}function Z(n){return
[01/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku) [Forced Update!]
Repository: ambari Updated Branches: refs/heads/feature-branch-AMBARI-21307 3deab6d18 -> 25fa701c3 (forced update) http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.ttf -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.ttf b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.ttf new file mode 100755 index 000..1413fc6 Binary files /dev/null and b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.ttf differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.woff -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.woff b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.woff new file mode 100755 index 000..9e61285 Binary files /dev/null and b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.woff differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.woff2 -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.woff2 b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.woff2 new file mode 100755 index 000..64539b5 Binary files /dev/null and b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.woff2 differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/img/icon-bolt.png -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/img/icon-bolt.png b/contrib/views/storm/src/main/resources/ui/app/styles/img/icon-bolt.png new file mode 100644 index 000..f3eb3db Binary files /dev/null and b/contrib/views/storm/src/main/resources/ui/app/styles/img/icon-bolt.png differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/img/icon-spout.png -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/img/icon-spout.png b/contrib/views/storm/src/main/resources/ui/app/styles/img/icon-spout.png new file mode 100644 index 000..9153d26 Binary files /dev/null and b/contrib/views/storm/src/main/resources/ui/app/styles/img/icon-spout.png differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/img/loader.gif -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/img/loader.gif b/contrib/views/storm/src/main/resources/ui/app/styles/img/loader.gif new file mode 100644 index 000..766329d Binary files /dev/null and b/contrib/views/storm/src/main/resources/ui/app/styles/img/loader.gif differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/config/webpack.config.base.js -- diff --git a/contrib/views/storm/src/main/resources/ui/config/webpack.config.base.js b/contrib/views/storm/src/main/resources/ui/config/webpack.config.base.js new file mode 100644 index 000..b3582ab --- /dev/null +++ b/contrib/views/storm/src/main/resources/ui/config/webpack.config.base.js @@ -0,0 +1,101 @@ +/** + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at +* + http://www.apache.org/licenses/LICENSE-2.0 +* + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +**/ + +const path = require('path'); +const webpack = require('webpack'); +const autoprefixer = require('autoprefixer'); + +module.exports = { + // target: 'node', + node: { +fs: "empty" + }, + output: { +
[03/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.ttf -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.ttf b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.ttf new file mode 100644 index 000..f221e50 Binary files /dev/null and b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.ttf differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.woff -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.woff b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.woff new file mode 100644 index 000..6e7483c Binary files /dev/null and b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.woff differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.woff2 -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.woff2 b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.woff2 new file mode 100644 index 000..7eb74fd Binary files /dev/null and b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.woff2 differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.eot -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.eot b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.eot new file mode 100755 index 000..b93a495 Binary files /dev/null and b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.eot differ
[42/71] [abbrv] ambari git commit: AMBARI-21545 Stack Advisor support for LDAP configuration (benyoka)
AMBARI-21545 Stack Advisor support for LDAP configuration (benyoka) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/976143ec Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/976143ec Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/976143ec Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 976143ece913d998bac1e30e52d4d095e473fdc3 Parents: c659b9e Author: Balazs Bence Sari <beny...@apache.org> Authored: Tue Aug 8 20:17:14 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:47 2017 +0200 -- .../services/AmbariConfigurationService.java| 4 +- .../stackadvisor/StackAdvisorRequest.java | 12 ++ .../commands/StackAdvisorCommand.java | 54 + .../commands/StackAdvisorCommandTest.java | 212 +++ .../StackAdvisorResourceProviderTest.java | 97 - 5 files changed, 324 insertions(+), 55 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/976143ec/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java index 0632361..927e518 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java @@ -56,9 +56,9 @@ import io.swagger.annotations.ApiResponses; *"data": [ *{ * "authentication.ldap.primaryUrl": "localhost:33389" - "authentication.ldap.secondaryUrl": "localhost:333" + * "authentication.ldap.secondaryUrl": "localhost:333" * "authentication.ldap.baseDn": "dc=ambari,dc=apache,dc=org" - * // .. + * // .. * ] * } * http://git-wip-us.apache.org/repos/asf/ambari/blob/976143ec/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRequest.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRequest.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRequest.java index 3a2b488..cd26c56 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRequest.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRequest.java @@ -31,6 +31,8 @@ import org.apache.ambari.server.api.services.stackadvisor.recommendations.Recomm import org.apache.ambari.server.state.ChangedConfigInfo; import org.apache.commons.lang.StringUtils; +import com.google.common.base.Preconditions; + /** * Stack advisor request. */ @@ -48,6 +50,7 @@ public class StackAdvisorRequest { private List changedConfigurations = new LinkedList<>(); private Set configGroups; private Map<String, String> userContext = new HashMap<>(); + private Map<String, Object> ldapConfig = new HashMap<>(); public String getStackName() { return stackName; @@ -93,6 +96,8 @@ public class StackAdvisorRequest { return configurations; } + public Map<String, Object> getLdapConfig() { return ldapConfig; } + public List getChangedConfigurations() { return changedConfigurations; } @@ -189,6 +194,13 @@ public class StackAdvisorRequest { return this; } +public StackAdvisorRequestBuilder withLdapConfig(Map<String, Object> ldapConfig) { + Preconditions.checkNotNull(ldapConfig); + this.instance.ldapConfig = ldapConfig; + return this; +} + + public StackAdvisorRequest build() { return this.instance; } http://git-wip-us.apache.org/repos/asf/ambari/blob/976143ec/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java index 356754d..2dc45de 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/servic
[17/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/jQuery/js/jquery-2.2.3.min.js -- diff --git a/contrib/views/storm/src/main/resources/libs/jQuery/js/jquery-2.2.3.min.js b/contrib/views/storm/src/main/resources/libs/jQuery/js/jquery-2.2.3.min.js deleted file mode 100644 index b8c4187..000 --- a/contrib/views/storm/src/main/resources/libs/jQuery/js/jquery-2.2.3.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v2.2.3 | (c) jQuery Foundation | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this ,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&(c)?c:[]):f=c&(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&===a.window},isNumeric:function(a){va r b=a&();return!n.isArray(a)&(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+""). replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&(e);else for(g in a)e=b(a[g],g,c),null!=e&(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[obj ect "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&>0& in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var
[59/71] [abbrv] ambari git commit: AMBARI-21307 Extracted config keys into an enum. Organized code (created domain package, moved classes)
AMBARI-21307 Extracted config keys into an enum. Organized code (created domain package, moved classes) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/02bb25c8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/02bb25c8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/02bb25c8 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 02bb25c8103e70bd5dd8da2629cc8ed7988266c4 Parents: 6dfa765 Author: lpuskas <lpus...@apache.org> Authored: Thu Sep 14 16:33:41 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:50 2017 +0200 -- .../services/ldap/LdapConfigurationService.java | 4 +- .../server/ldap/AmbariLdapConfiguration.java| 232 --- .../server/ldap/LdapConfigurationFactory.java | 34 --- .../apache/ambari/server/ldap/LdapModule.java | 2 + .../ldap/domain/AmbariLdapConfiguration.java| 180 ++ .../ldap/domain/LdapConfigurationFactory.java | 34 +++ .../ldap/service/AmbariLdapConfigKeys.java | 72 ++ .../AmbariLdapConfigurationProvider.java| 4 +- .../server/ldap/service/AmbariLdapFacade.java | 2 +- .../service/LdapAttributeDetectionService.java | 2 +- .../ldap/service/LdapConfigurationService.java | 2 +- .../ldap/service/LdapConnectionService.java | 2 +- .../ambari/server/ldap/service/LdapFacade.java | 2 +- .../DefaultLdapAttributeDetectionService.java | 15 +- .../ads/DefaultLdapConfigurationService.java| 2 +- .../ads/DefaultLdapConnectionService.java | 16 +- ...efaultLdapAttributeDetectionServiceTest.java | 21 +- .../DefaultLdapConfigurationServiceTest.java| 31 +-- 18 files changed, 334 insertions(+), 323 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/02bb25c8/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java index ae47a87..ff95066 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java @@ -46,8 +46,8 @@ import org.apache.ambari.server.api.services.ResultImpl; import org.apache.ambari.server.api.services.ResultStatus; import org.apache.ambari.server.controller.internal.ResourceImpl; import org.apache.ambari.server.controller.spi.Resource; -import org.apache.ambari.server.ldap.AmbariLdapConfiguration; -import org.apache.ambari.server.ldap.LdapConfigurationFactory; +import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration; +import org.apache.ambari.server.ldap.domain.LdapConfigurationFactory; import org.apache.ambari.server.ldap.service.LdapFacade; import org.apache.ambari.server.security.authorization.AuthorizationException; import org.apache.ambari.server.security.authorization.AuthorizationHelper; http://git-wip-us.apache.org/repos/asf/ambari/blob/02bb25c8/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java deleted file mode 100644 index 5bdda7a..000 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.ambari.server.ldap; - -import java.util.Map; - -import javax.inject.Inject; -import javax.inject.Singleton; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.inject.assistedinject.Assisted; - -/** - * This class is an immutable representation of all the LDAP related configurationMap entries. - */ -@Singleton -public class AmbariLdapConfiguration { - - private static final Logger L
[37/71] [abbrv] ambari git commit: AMBARI-22312 - Downgrade From HDP 2.6 to 2.5 Leaves 2.6 Hosts as CURRENT Instead of INSTALLED (jonathanhurley)
AMBARI-22312 - Downgrade From HDP 2.6 to 2.5 Leaves 2.6 Hosts as CURRENT Instead of INSTALLED (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/83e8b672 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/83e8b672 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/83e8b672 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 83e8b67223cc35134476adf7c79e365c74b808d4 Parents: d1d118d Author: Jonathan HurleyAuthored: Wed Oct 25 20:06:55 2017 -0400 Committer: Jonathan Hurley Committed: Wed Oct 25 20:06:55 2017 -0400 -- .../AmbariManagementControllerImpl.java | 13 +++-- .../upgrades/FinalizeUpgradeAction.java | 54 ++-- 2 files changed, 36 insertions(+), 31 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/83e8b672/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java index 1b1f524..380e1b4 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java @@ -909,9 +909,16 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle StackId stackId = null; if (null != service) { - Service svc = cluster.getService(service); - stackId = svc.getDesiredStackId(); -} else { + try { +Service svc = cluster.getService(service); +stackId = svc.getDesiredStackId(); + } catch (AmbariException ambariException) { +LOG.warn("Adding configurations for {} even though its parent service {} is not installed", +configType, service); + } +} + +if (null == stackId) { stackId = cluster.getDesiredStackVersion(); } http://git-wip-us.apache.org/repos/asf/ambari/blob/83e8b672/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java index 87ea1fc..755f28e 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java @@ -200,7 +200,7 @@ public class FinalizeUpgradeAction extends AbstractUpgradeServerAction { // move host versions from CURRENT to INSTALLED if their repos are no // longer used - finalizeHostRepositoryVersions(cluster); + finalizeHostVersionsNotDesired(cluster); if (upgradeContext.getOrchestrationType() == RepositoryType.STANDARD) { outSB.append(String.format("Finalizing the version for cluster %s.\n", cluster.getClusterName())); @@ -280,38 +280,36 @@ public class FinalizeUpgradeAction extends AbstractUpgradeServerAction { throw new AmbariException(messageBuff.toString()); } + finalizeHostVersionsNotDesired(cluster); - if (upgradeContext.isPatchRevert()) { -finalizeHostRepositoryVersions(cluster); - } else { -// for every repository being downgraded to, ensure the host versions are correct -Map targetVersionsByService = upgradeContext.getTargetVersions(); -Set targetRepositoryVersions = new HashSet<>(); -for (String service : targetVersionsByService.keySet()) { - targetRepositoryVersions.add(targetVersionsByService.get(service)); -} + // for every repository being downgraded to, ensure the host versions are correct + Map targetVersionsByService = upgradeContext.getTargetVersions(); + Set targetRepositoryVersions = new HashSet<>(); + for (String service : targetVersionsByService.keySet()) { +targetRepositoryVersions.add(targetVersionsByService.get(service)); + } -for (RepositoryVersionEntity targetRepositoryVersion : targetRepositoryVersions) { - // find host versions - List hostVersions = hostVersionDAO.findHostVersionByClusterAndRepository( - cluster.getClusterId(), targetRepositoryVersion); + // move
[26/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.eot -- diff --git a/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.eot b/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.eot deleted file mode 100644 index b93a495..000 Binary files a/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.eot and /dev/null differ
[38/71] [abbrv] ambari git commit: AMBARI-22305. Update Solr (Infra Solr + clients) version to 6.6.2 from 6.6.0 (oleewere)
AMBARI-22305. Update Solr (Infra Solr + clients) version to 6.6.2 from 6.6.0 (oleewere) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4d3abaff Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4d3abaff Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4d3abaff Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 4d3abafffc349cabcd048d4a2ad90acbc2f5b669 Parents: 83e8b67 Author: Oliver SzaboAuthored: Wed Oct 25 16:03:32 2017 +0200 Committer: Oliver Szabo Committed: Thu Oct 26 11:14:32 2017 +0200 -- ambari-infra/pom.xml | 2 +- ambari-logsearch/docker/Dockerfile | 2 +- ambari-logsearch/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/4d3abaff/ambari-infra/pom.xml -- diff --git a/ambari-infra/pom.xml b/ambari-infra/pom.xml index 908abb4..e4b6a76 100644 --- a/ambari-infra/pom.xml +++ b/ambari-infra/pom.xml @@ -31,7 +31,7 @@ 1.8 -6.6.0 +6.6.2 UTF-8 python = 2.6 python (= 2.6) http://git-wip-us.apache.org/repos/asf/ambari/blob/4d3abaff/ambari-logsearch/docker/Dockerfile -- diff --git a/ambari-logsearch/docker/Dockerfile b/ambari-logsearch/docker/Dockerfile index 1e4135e..5906a50 100644 --- a/ambari-logsearch/docker/Dockerfile +++ b/ambari-logsearch/docker/Dockerfile @@ -60,7 +60,7 @@ RUN npm install -g npm@2.1.11 RUN npm install -g brunch@1.7.20 # Install Solr -ENV SOLR_VERSION 6.6.0 +ENV SOLR_VERSION 6.6.2 RUN wget --no-check-certificate -O /root/solr-$SOLR_VERSION.tgz http://public-repo-1.hortonworks.com/ARTIFACTS/dist/lucene/solr/$SOLR_VERSION/solr-$SOLR_VERSION.tgz RUN cd /root && tar -zxvf /root/solr-$SOLR_VERSION.tgz ADD bin/start.sh /root/start.sh http://git-wip-us.apache.org/repos/asf/ambari/blob/4d3abaff/ambari-logsearch/pom.xml -- diff --git a/ambari-logsearch/pom.xml b/ambari-logsearch/pom.xml index 9434365..18ff45e 100644 --- a/ambari-logsearch/pom.xml +++ b/ambari-logsearch/pom.xml @@ -45,7 +45,7 @@ python (= 2.6) amd64 ${deb.python.ver} -6.6.0 +6.6.2 2.7.2 2.5
[32/71] [abbrv] ambari git commit: Updated team page. (yusaku)
Updated team page. (yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2ee64af5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2ee64af5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2ee64af5 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 2ee64af51b642262f494d523060fd7cfa8471f89 Parents: 467e344 Author: Yusaku SakoAuthored: Mon Oct 23 13:30:27 2017 -0700 Committer: Yusaku Sako Committed: Mon Oct 23 13:30:27 2017 -0700 -- docs/pom.xml | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2ee64af5/docs/pom.xml -- diff --git a/docs/pom.xml b/docs/pom.xml index 8af497e..f356226 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -1245,6 +1245,10 @@ + Sanket Shah + Hortonworks + + Newton Alex Pivotal @@ -1285,10 +1289,6 @@ Red Hat - Alexander Denissov - Pivotal - - Nick Dimiduk Hortonworks
[22/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Font-Awesome/css/font-awesome.min.css -- diff --git a/contrib/views/storm/src/main/resources/libs/Font-Awesome/css/font-awesome.min.css b/contrib/views/storm/src/main/resources/libs/Font-Awesome/css/font-awesome.min.css deleted file mode 100644 index d0603cb..000 --- a/contrib/views/storm/src/main/resources/libs/Font-Awesome/css/font-awesome.min.css +++ /dev/null @@ -1,4 +0,0 @@ -/*! - * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.5.0');src:url('../fonts/fontawesome-webfont.eot?#iefix=4.5.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.5.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.5.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.5.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.1 4285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-tr ansform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:abso lute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-d
[14/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/react/js/react-with-addons.js -- diff --git a/contrib/views/storm/src/main/resources/libs/react/js/react-with-addons.js b/contrib/views/storm/src/main/resources/libs/react/js/react-with-addons.js deleted file mode 100644 index 5b451eb..000 --- a/contrib/views/storm/src/main/resources/libs/react/js/react-with-addons.js +++ /dev/null @@ -1,20775 +0,0 @@ - /** - * React (with addons) v0.14.8 - */ -(function(f){if(typeof exports==="object"& module!=="undefined"){module.exports=f()}else if(typeof define==="function"&){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&if(!u&)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&for(var o=0;o
[52/71] [abbrv] ambari git commit: AMBARI-21307 Testing the attribute detection - fixing bugs, cleanup
AMBARI-21307 Testing the attribute detection - fixing bugs, cleanup Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/72b78ba9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/72b78ba9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/72b78ba9 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 72b78ba9991096171e85e15bfe4de9e519de00df Parents: 35b3cb4 Author: lpuskas <lpus...@apache.org> Authored: Tue Sep 12 18:58:44 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:49 2017 +0200 -- .../api/services/ldap/LdapConfigurationService.java | 11 +++ .../ambari/server/ldap/AmbariLdapConfiguration.java | 2 +- .../org/apache/ambari/server/ldap/LdapModule.java| 3 +++ .../ambari/server/ldap/service/AmbariLdapFacade.java | 6 ++ .../ads/DefaultAttributeDetectionService.java| 15 +++ .../service/ads/DefaultLdapConfigurationService.java | 3 --- .../ads/detectors/GroupMemberAttrDetector.java | 3 +++ .../service/ads/detectors/GroupNameAttrDetector.java | 3 +++ .../ads/detectors/GroupObjectClassDetector.java | 3 +++ .../ads/detectors/UserGroupMemberAttrDetector.java | 3 +++ .../service/ads/detectors/UserNameAttrDetector.java | 3 +++ .../ads/DefaultAttributeDetectionServiceTest.java| 3 +-- .../ads/DefaultLdapConfigurationServiceTest.java | 4 ++-- 13 files changed, 42 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/72b78ba9/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java index 66809c3..ae47a87 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java @@ -86,6 +86,7 @@ public class LdapConfigurationService extends AmbariConfigurationService { authorize(); Set groups = Sets.newHashSet(); +Object responseEntity = null; Result result = new ResultImpl(new ResultStatus(ResultStatus.STATUS.OK)); try { @@ -108,13 +109,14 @@ public class LdapConfigurationService extends AmbariConfigurationService { LOGGER.info("Testing LDAP attributes "); groups = ldapFacade.checkLdapAttributes(ldapConfigurationRequest.getRequestInfo().getParameters(), ambariLdapConfiguration); - setResult(groups, result); + responseEntity = groups; break; case DETECT_ATTRIBUTES: LOGGER.info("Detecting LDAP attributes ..."); - ldapFacade.detectAttributes(ambariLdapConfiguration); + ambariLdapConfiguration = ldapFacade.detectAttributes(ambariLdapConfiguration); + responseEntity = ambariLdapConfiguration; break; default: @@ -123,10 +125,11 @@ public class LdapConfigurationService extends AmbariConfigurationService { } } catch (Exception e) { - result.setResultStatus(new ResultStatus(ResultStatus.STATUS.BAD_REQUEST, e)); + result.setResultStatus(new ResultStatus(ResultStatus.STATUS.SERVER_ERROR, e)); + responseEntity = e.getMessage(); } -return Response.status(result.getStatus().getStatusCode()).entity(getResultSerializer().serialize(result)).build(); +return Response.status(result.getStatus().getStatusCode()).entity(responseEntity).build(); } private void setResult(Set groups, Result result) { http://git-wip-us.apache.org/repos/asf/ambari/blob/72b78ba9/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java index ebb567d..5bdda7a 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java @@ -62,7 +62,7 @@ public class AmbariLdapConfiguration { GROUP_OBJECT_CLASS("ambari.ldap.attributes.group.object_class"), GROUP_NAME_ATTRIBUTE("ambari.ldap.attributes.group.name_attr"), GROUP_MEMBER_ATTRIBUTE("ambari.ldap.attributes.group.member_attr"), -GROUP_SEARCH_BASE(&quo
[33/71] [abbrv] ambari git commit: AMBARI-22281. Avoid Log Feeder NPEs for logs of services not present on the node, but present on the cluster (mgergely)
AMBARI-22281. Avoid Log Feeder NPEs for logs of services not present on the node, but present on the cluster (mgergely) Change-Id: I43b565e521e9334523b5648a99cdfbad9f110b73 Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/baa1fe6e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/baa1fe6e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/baa1fe6e Branch: refs/heads/feature-branch-AMBARI-21307 Commit: baa1fe6e6cb2368627a4968ddc55106640df3aef Parents: 2ee64af Author: Miklos GergelyAuthored: Tue Oct 24 09:00:09 2017 +0200 Committer: Miklos Gergely Committed: Tue Oct 24 09:00:09 2017 +0200 -- .../main/java/org/apache/ambari/logfeeder/input/InputFile.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/baa1fe6e/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java -- diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java index e24a7aa..c35c831 100644 --- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java +++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java @@ -56,7 +56,9 @@ public class InputFile extends AbstractInputFile { private File[] getActualFiles(String searchPath) { File searchFile = new File(searchPath); -if (searchFile.isFile()) { +if (!searchFile.getParentFile().exists()) { + return new File[0]; +} else if (searchFile.isFile()) { return new File[]{searchFile}; } else { FileFilter fileFilter = new WildcardFileFilter(searchFile.getName());
[49/71] [abbrv] ambari git commit: AMBARI-21307 LDAP config rest service implementation extends the ambari config rest implementaiton
AMBARI-21307 LDAP config rest service implementation extends the ambari config rest implementaiton Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/17c4a46c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/17c4a46c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/17c4a46c Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 17c4a46ca27034e07d282c9197b9060081a202a2 Parents: 9d271df Author: lpuskas <lpus...@apache.org> Authored: Mon Aug 21 15:53:45 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:48 2017 +0200 -- .../services/ldap/LdapConfigurationService.java | 208 +++ .../api/services/ldap/LdapRestService.java | 149 - 2 files changed, 208 insertions(+), 149 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/17c4a46c/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java new file mode 100644 index 000..52244bc --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java @@ -0,0 +1,208 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.api.services.ldap; + +import java.util.Set; + +import javax.inject.Inject; +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import org.apache.ambari.annotations.ApiIgnore; +import org.apache.ambari.server.StaticallyInject; +import org.apache.ambari.server.api.services.AmbariConfigurationService; +import org.apache.ambari.server.api.services.Result; +import org.apache.ambari.server.api.services.ResultImpl; +import org.apache.ambari.server.api.services.ResultStatus; +import org.apache.ambari.server.controller.internal.ResourceImpl; +import org.apache.ambari.server.controller.spi.Resource; +import org.apache.ambari.server.ldap.AmbariLdapConfiguration; +import org.apache.ambari.server.ldap.LdapConfigurationFactory; +import org.apache.ambari.server.ldap.service.LdapFacade; +import org.apache.ambari.server.security.authorization.AuthorizationException; +import org.apache.ambari.server.security.authorization.AuthorizationHelper; +import org.apache.ambari.server.security.authorization.ResourceType; +import org.apache.ambari.server.security.authorization.RoleAuthorization; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.core.Authentication; + +import com.google.common.collect.Sets; + +/** + * Endpoint designated to LDAP specific operations. + */ +@StaticallyInject +@Path("/ldapconfigs/") +public class LdapConfigurationService extends AmbariConfigurationService { + + private static final Logger LOGGER = LoggerFactory.getLogger(LdapConfigurationService.class); + + @Inject + private static LdapFacade ldapFacade; + + @Inject + private static LdapConfigurationFactory ldapConfigurationFactory; + + /** + * Actions supported by this endpoint + */ + private enum LdapAction { +TEST_CONNECTION("test-connection"), +TEST_ATTRIBUTES("test-attributes"), +DETECT_ATTRIBUTES("detect-attributes"); + +private String actionStr; + +LdapAction(String actionStr) { +
[39/71] [abbrv] ambari git commit: AMBARI-21307 Added new resource related changes to the db creation ddl-s
AMBARI-21307 Added new resource related changes to the db creation ddl-s Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f5a671ea Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f5a671ea Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f5a671ea Branch: refs/heads/feature-branch-AMBARI-21307 Commit: f5a671eafd823bbc5a7b55f3fc4664f32e9354a6 Parents: f89b11e Author: lpuskas <lpus...@apache.org> Authored: Thu Jul 6 18:15:18 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:46 2017 +0200 -- .../AmbariConfigurationResourceProvider.java| 12 ++-- .../server/orm/dao/AmbariConfigurationDAO.java | 65 ++-- .../apache/ambari/server/orm/dao/DaoUtils.java | 13 +--- .../main/resources/Ambari-DDL-Derby-CREATE.sql | 21 +++ .../main/resources/Ambari-DDL-MySQL-CREATE.sql | 20 ++ .../main/resources/Ambari-DDL-Oracle-CREATE.sql | 20 ++ .../resources/Ambari-DDL-Postgres-CREATE.sql| 14 ++--- .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 20 ++ .../resources/Ambari-DDL-SQLServer-CREATE.sql | 20 ++ 9 files changed, 120 insertions(+), 85 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f5a671ea/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java index 5e5af9e..e8f186d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java @@ -97,14 +97,14 @@ public class AmbariConfigurationResourceProvider extends AbstractAuthorizedResou } } - private static Set properties = Sets.newHashSet( + private static Set PROPERTIES = Sets.newHashSet( ResourcePropertyId.ID.getPropertyId(), ResourcePropertyId.TYPE.getPropertyId(), ResourcePropertyId.VERSION.getPropertyId(), ResourcePropertyId.VERSION_TAG.getPropertyId(), ResourcePropertyId.DATA.getPropertyId()); - private static Map<Resource.Type, String> pkPropertyMap = Collections.unmodifiableMap( + private static Map<Resource.Type, String> PK_PROPERTY_MAP = Collections.unmodifiableMap( new HashMap<Resource.Type, String>() {{ put(Resource.Type.AmbariConfiguration, ResourcePropertyId.ID.getPropertyId()); }} @@ -117,7 +117,7 @@ public class AmbariConfigurationResourceProvider extends AbstractAuthorizedResou private Gson gson; protected AmbariConfigurationResourceProvider() { -super(properties, pkPropertyMap); +super(PROPERTIES, PK_PROPERTY_MAP); setRequiredCreateAuthorizations(EnumSet.of(RoleAuthorization.AMBARI_MANAGE_CONFIGURATION)); setRequiredDeleteAuthorizations(EnumSet.of(RoleAuthorization.AMBARI_MANAGE_CONFIGURATION)); @@ -126,7 +126,7 @@ public class AmbariConfigurationResourceProvider extends AbstractAuthorizedResou @Override protected Set getPKPropertyIds() { -return Sets.newHashSet("AmbariConfiguration/id"); +return Sets.newHashSet(ResourcePropertyId.ID.getPropertyId()); } @Override @@ -137,7 +137,7 @@ public class AmbariConfigurationResourceProvider extends AbstractAuthorizedResou AmbariConfigurationEntity ambariConfigurationEntity = getEntityFromRequest(request); LOGGER.info("Persisting new ambari configuration: {} ", ambariConfigurationEntity); -ambariConfigurationDAO.persist(ambariConfigurationEntity); +ambariConfigurationDAO.create(ambariConfigurationEntity); return getRequestStatus(null); } @@ -170,7 +170,7 @@ public class AmbariConfigurationResourceProvider extends AbstractAuthorizedResou } else { LOGGER.debug("Deleting amari configuration with id: {}", idFromRequest); try { -ambariConfigurationDAO.deleteById(idFromRequest); +ambariConfigurationDAO.removeByPK(idFromRequest); } catch (IllegalStateException e) { throw new NoSuchResourceException(e.getMessage()); } http://git-wip-us.apache.org/repos/asf/ambari/blob/f5a671ea/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAO.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AmbariConfigurationDAO.java b/ambari-server/src/main/java/org/apache/amb
[05/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/css/font-awesome.min.css -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/css/font-awesome.min.css b/contrib/views/storm/src/main/resources/ui/app/styles/css/font-awesome.min.css new file mode 100644 index 000..9b27f8e --- /dev/null +++ b/contrib/views/storm/src/main/resources/ui/app/styles/css/font-awesome.min.css @@ -0,0 +1,4 @@ +/*! + * Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.6.3');src:url('../fonts/fontawesome-webfont.eot?#iefix=4.6.3') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.6.3') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.6.3') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.1 4285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg); -ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack -1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-roa
[62/71] [abbrv] ambari git commit: AMBARI-21307 Fixed failing unit tests (in most cases the new guice module was needed)
AMBARI-21307 Fixed failing unit tests (in most cases the new guice module was needed) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cd807e11 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cd807e11 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cd807e11 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: cd807e118767f204a6e604cef4e3b9cc612d845f Parents: b95f0a1 Author: lpuskas <lpus...@apache.org> Authored: Thu Oct 12 19:25:24 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:51 2017 +0200 -- .../main/resources/Ambari-DDL-Derby-CREATE.sql | 2 +- .../main/resources/Ambari-DDL-MySQL-CREATE.sql | 2 +- .../main/resources/Ambari-DDL-Oracle-CREATE.sql | 2 +- .../resources/Ambari-DDL-Postgres-CREATE.sql| 2 +- .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 2 +- .../resources/Ambari-DDL-SQLServer-CREATE.sql | 2 +- .../api/services/ldap/LDAPServiceTest.java | 85 .../server/checks/UpgradeCheckOrderTest.java| 3 +- ...AmbariConfigurationResourceProviderTest.java | 24 +- .../server/ldap/LdapModuleFunctionalTest.java | 4 +- .../notifications/DispatchFactoryTest.java | 3 +- .../server/orm/InMemoryDefaultTestModule.java | 2 + .../ambari/server/orm/JdbcPropertyTest.java | 5 +- ...uthenticationProviderForDNWithSpaceTest.java | 35 .../AmbariLdapAuthenticationProviderTest.java | 3 +- .../AmbariLocalUserProviderTest.java| 3 +- .../authorization/LdapServerPropertiesTest.java | 5 +- 17 files changed, 65 insertions(+), 119 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/cd807e11/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql -- diff --git a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql index 8c44148..2b4d15c 100644 --- a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql +++ b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql @@ -98,7 +98,7 @@ CREATE TABLE configuration_base ( CREATE TABLE ambari_configuration ( id BIGINT NOT NULL, CONSTRAINT PK_ambari_configuration PRIMARY KEY (id), - CONSTRAINT FK_ambari_configuration_configuration_base FOREIGN KEY (id) REFERENCES configuration_base (id) + CONSTRAINT FK_ambari_conf_conf_base FOREIGN KEY (id) REFERENCES configuration_base (id) ); CREATE TABLE serviceconfig ( http://git-wip-us.apache.org/repos/asf/ambari/blob/cd807e11/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql -- diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql index c3ec543..b487205 100644 --- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql +++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql @@ -118,7 +118,7 @@ CREATE TABLE configuration_base ( CREATE TABLE ambari_configuration ( id BIGINT NOT NULL, CONSTRAINT PK_ambari_configuration PRIMARY KEY (id), - CONSTRAINT FK_ambari_configuration_configuration_base FOREIGN KEY (id) REFERENCES configuration_base (id) + CONSTRAINT FK_ambari_conf_conf_base FOREIGN KEY (id) REFERENCES configuration_base (id) ); CREATE TABLE serviceconfig ( http://git-wip-us.apache.org/repos/asf/ambari/blob/cd807e11/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql -- diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql index c570300..bb87618 100644 --- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql +++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql @@ -98,7 +98,7 @@ CREATE TABLE configuration_base ( CREATE TABLE ambari_configuration ( id NUMBER(19) NOT NULL, CONSTRAINT PK_ambari_configuration PRIMARY KEY (id), - CONSTRAINT FK_ambari_configuration_configuration_base FOREIGN KEY (id) REFERENCES configuration_base (id) + CONSTRAINT FK_ambari_conf_conf_base FOREIGN KEY (id) REFERENCES configuration_base (id) ); CREATE TABLE serviceconfig ( http://git-wip-us.apache.org/repos/asf/ambari/blob/cd807e11/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql -- diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql index a754360..7c0611d 100644 --- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql +++ b/ambar
[08/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/scripts/containers/ComponentDetailView.jsx -- diff --git a/contrib/views/storm/src/main/resources/ui/app/scripts/containers/ComponentDetailView.jsx b/contrib/views/storm/src/main/resources/ui/app/scripts/containers/ComponentDetailView.jsx new file mode 100644 index 000..2b3ed69 --- /dev/null +++ b/contrib/views/storm/src/main/resources/ui/app/scripts/containers/ComponentDetailView.jsx @@ -0,0 +1,714 @@ +/** + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at +* + http://www.apache.org/licenses/LICENSE-2.0 +* + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +**/ + +import React, {Component} from 'react'; +import BaseContainer from './BaseContainer'; +import SearchLogs from '../components/SearchLogs'; +import TopologyREST from '../rest/TopologyREST'; +import {Accordion, Panel,OverlayTrigger, Tooltip} from 'react-bootstrap'; +import TopologyGraph from '../components/TopologyGraph'; +import { + Table, + Thead, + Th, + Tr, + Td, + unsafe +} from 'reactable'; +import CommonPagination from '../components/CommonPagination'; +import {Link} from 'react-router'; +import {toastOpt,pageSize} from '../utils/Constants'; +import Utils from '../utils/Utils'; +import FSReactToastr from '../components/FSReactToastr'; +import CommonNotification from '../components/CommonNotification'; +import Breadcrumbs from '../components/Breadcrumbs'; +import CommonWindowPanel from '../components/CommonWindowPanel'; +import Modal from '../components/FSModel'; +import ProfilingView from '../components/ProfilingView'; +import CommonExpanded from '../components/CommonExpanded'; + +export default class ComponentDetailView extends Component { + constructor(props){ +super(props); +this.state = { + componentDetail: {}, + inputStatsActivePage: 1, + outputStatsActivePage: 1, + executorStatsActivePage: 1, + componentErrorsActivePage: 1, + selectedWindowKey : {label : 'All time' , value : ':all-time'}, + windowOptions : [], + systemFlag : false, + debugFlag : false, + outputStatsFilter : '', + executorStatsFilter : '', + componentErrorsFilter : '', + expandInputStats : true, + expandOutputStats : true, + expandExecutorStats : true, + expandComponentErrors : true +}; +this.fetchDetails(); + } + + fetchDetails(){ +const {selectedWindowKey,systemFlag} = this.state; +TopologyREST.getTopologyComponentDetail(this.props.params.id, this.props.params.name,selectedWindowKey.value,systemFlag).then((res) => { + let stateObj={}; + stateObj.componentDetail = res; + stateObj.spoutFlag = stateObj.componentDetail.componentType === 'spout' ? true: false; + stateObj.samplingPct = stateObj.componentDetail.samplingPct; + stateObj.windowOptions = Utils.populateWindowsOptions(stateObj.spoutFlag ? stateObj.componentDetail.spoutSummary : stateObj.componentDetail.boltStats); + if(stateObj.windowOptions.length === 0){ +stateObj.windowOptions = [{label : 'All time', value : ':all-time'}]; + } + stateObj.selectedWindowKey = {label : stateObj.componentDetail.windowHint || 'All time', value : stateObj.componentDetail.window || ':all-time'}; + stateObj.topologyStatus = stateObj.componentDetail.topologyStatus; + stateObj.debugFlag = stateObj.componentDetail.debug; + this.setState(stateObj); +}); + } + + getLinks(){ +const {componentDetail} = this.state; +var links = [ + {link: '#/', title: 'Dashboard'}, + {link: '#/topology', title: 'Topology Listing'}, + {link: '#/topology/'+componentDetail.topologyId, title: componentDetail.name || ""}, + {link: 'javascript:void(0);', title: componentDetail.id || ""} +]; +return links; + } + + renderStatsRow(){ +const {componentDetail,spoutFlag} = this.state; +const statsArr = componentDetail.spoutSummary || componentDetail.boltStats; +if(statsArr){ + return statsArr.map(function(stats, i){ +return ( + +{stats.windowPretty} +{stats.emitted} +{stats.transferred} +{spoutFlag ? {stats.completeLatency} : null} +{!spoutFlag ?
[67/71] [abbrv] ambari git commit: AMBARI-21307 Added unit test, minor fixes
AMBARI-21307 Added unit test, minor fixes Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/23aa377a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/23aa377a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/23aa377a Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 23aa377af2a50e3e3e4458266ef1346f5edae3db Parents: 71dd5a8 Author: lpuskas <lpus...@apache.org> Authored: Wed Oct 18 15:07:28 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:52 2017 +0200 -- .../DefaultLdapAttributeDetectionService.java | 2 +- .../ads/detectors/AttributeDetectorFactory.java | 21 +-- ...efaultLdapAttributeDetectionServiceTest.java | 188 +++ 3 files changed, 198 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/23aa377a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java index 25abce7..a9a9b53 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java @@ -118,7 +118,7 @@ public class DefaultLdapAttributeDetectionService implements LdapAttributeDetect try { LdapConnectionTemplate ldapConnectionTemplate = ldapConnectionTemplateFactory.create(ambariLdapConfiguration); - AttributeDetector groupAttributeDetector = attributeDetectorFactory.groupAttributDetector(); + AttributeDetector groupAttributeDetector = attributeDetectorFactory.groupAttributeDetector(); SearchRequest searchRequest = assembleGroupSearchRequest(ldapConnectionTemplate, ambariLdapConfiguration); http://git-wip-us.apache.org/repos/asf/ambari/blob/23aa377a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/AttributeDetectorFactory.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/AttributeDetectorFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/AttributeDetectorFactory.java index 8155461..eba0bd9 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/AttributeDetectorFactory.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/AttributeDetectorFactory.java @@ -33,21 +33,18 @@ public class AttributeDetectorFactory { private static final Logger LOG = LoggerFactory.getLogger(AttributeDetectorFactory.class); private static final String USER_ATTRIBUTES_DETECTORS = "UserAttributesDetectors"; private static final String GROUP_ATTRIBUTES_DETECTORS = "GroupAttributesDetectors"; - - - /** - * The set of user attribute detectors, configured by GUICE (check the relevant guice module implementation) - */ - @Inject - @Named(USER_ATTRIBUTES_DETECTORS) - private Set userAttributeDetectors; - /** * The set of group attribute detectors, configured by GUICE (check the relevant guice module implementation) */ @Inject @Named(GROUP_ATTRIBUTES_DETECTORS) Set groupAttributeDetectors; + /** + * The set of user attribute detectors, configured by GUICE (check the relevant guice module implementation) + */ + @Inject + @Named(USER_ATTRIBUTES_DETECTORS) + private Set userAttributeDetectors; @Inject public AttributeDetectorFactory() { @@ -59,7 +56,7 @@ public class AttributeDetectorFactory { * @return the constructed ChainedAttributeDetector instance */ public ChainedAttributeDetector userAttributDetector() { -LOG.info("Creating instance with user attribute detectors: [{}]", userAttributDetector()); +LOG.info("Creating instance with user attribute detectors: [{}]", userAttributeDetectors); return new ChainedAttributeDetector(userAttributeDetectors); } @@ -69,8 +66,8 @@ public class AttributeDetectorFactory { * @return the constructed ChainedAttributeDetector instance */ - public ChainedAttributeDetector groupAttributDetector() { -LOG.info("Creating instance with group attribute detectors: [{}]", groupAttributDetector()); + public ChainedAttributeDetector groupAttributeDetector() { +LOG.info("Creating instance with group attribute detectors: [{}]&qu
[61/71] [abbrv] ambari git commit: AMBARI-21307 Refactor - using the LdapConnectionTemplate for ldap operations
AMBARI-21307 Refactor - using the LdapConnectionTemplate for ldap operations Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c15cc0f3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c15cc0f3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c15cc0f3 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: c15cc0f3af60e0df58f8598ad1afb01e0bbca1c8 Parents: a292697 Author: lpuskas <lpus...@apache.org> Authored: Wed Oct 4 15:54:34 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:50 2017 +0200 -- .../services/ldap/LdapConfigurationService.java | 6 +- .../server/controller/ControllerModule.java | 2 +- .../apache/ambari/server/ldap/LdapModule.java | 12 +- .../domain/AmbariLdapConfigurationFactory.java | 34 + .../ldap/domain/LdapConfigurationFactory.java | 34 - .../AmbariLdapConfigurationProvider.java| 5 +- .../server/ldap/service/AmbariLdapFacade.java | 36 + .../server/ldap/service/AttributeDetector.java | 2 +- .../service/LdapAttributeDetectionService.java | 8 +- .../ldap/service/LdapConfigurationService.java | 22 +-- .../ldap/service/LdapConnectionService.java | 43 -- .../service/LdapConnectionTemplateProvider.java | 56 .../DefaultLdapAttributeDetectionService.java | 129 ++--- .../ads/DefaultLdapConfigurationService.java| 110 +++--- .../ads/DefaultLdapConnectionService.java | 86 --- .../ads/LdapConnectionTemplateFactory.java | 95 .../ads/detectors/GroupMemberAttrDetector.java | 4 +- .../ads/detectors/GroupNameAttrDetector.java| 4 +- .../ads/detectors/GroupObjectClassDetector.java | 4 +- .../OccurranceAndWeightBasedDetector.java | 103 - .../OccurrenceAndWeightBasedDetector.java | 103 + .../detectors/UserGroupMemberAttrDetector.java | 4 +- .../ads/detectors/UserNameAttrDetector.java | 4 +- .../ads/detectors/UserObjectClassDetector.java | 4 +- .../server/ldap/LdapModuleFunctionalTest.java | 143 +++ .../domain/AmbariLdapConfigurationTest.java | 19 --- ...estAmbariAmbariLdapConfigurationFactory.java | 29 .../TestAmbariLdapConfigurationFactory.java | 29 ...efaultLdapAttributeDetectionServiceTest.java | 112 --- .../DefaultLdapConfigurationServiceTest.java| 129 - 30 files changed, 601 insertions(+), 770 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c15cc0f3/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java index ff95066..13f8835 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java @@ -47,7 +47,7 @@ import org.apache.ambari.server.api.services.ResultStatus; import org.apache.ambari.server.controller.internal.ResourceImpl; import org.apache.ambari.server.controller.spi.Resource; import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration; -import org.apache.ambari.server.ldap.domain.LdapConfigurationFactory; +import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory; import org.apache.ambari.server.ldap.service.LdapFacade; import org.apache.ambari.server.security.authorization.AuthorizationException; import org.apache.ambari.server.security.authorization.AuthorizationHelper; @@ -72,7 +72,7 @@ public class LdapConfigurationService extends AmbariConfigurationService { private static LdapFacade ldapFacade; @Inject - private static LdapConfigurationFactory ldapConfigurationFactory; + private static AmbariLdapConfigurationFactory ambariLdapConfigurationFactory; @POST @@ -93,7 +93,7 @@ public class LdapConfigurationService extends AmbariConfigurationService { validateRequest(ldapConfigurationRequest); - AmbariLdapConfiguration ambariLdapConfiguration = ldapConfigurationFactory.createLdapConfiguration( + AmbariLdapConfiguration ambariLdapConfiguration = ambariLdapConfigurationFactory.createLdapConfiguration( ldapConfigurationRequest.getAmbariConfiguration().getData().iterator().next()); LdapConfigOperation action = LdapConfigOperation.fromAction(ldapConfigurationRequest.getRequestInfo().getAction()); http://git-wip-us.apache.org/repos/asf/ambari/blob/c15cc0f3/a
[70/71] [abbrv] ambari git commit: AMBARI-21307 Improved the attribute detection implementation (using detector chains, added logging, improved guice setup).
AMBARI-21307 Improved the attribute detection implementation (using detector chains, added logging, improved guice setup). Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6c06f5da Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6c06f5da Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6c06f5da Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 6c06f5da51800cb5e939ca97551cfc0aaa9bde27 Parents: 575102f Author: lpuskas <lpus...@apache.org> Authored: Mon Oct 16 18:24:32 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:52 2017 +0200 -- .../apache/ambari/server/ldap/LdapModule.java | 32 + .../ldap/domain/AmbariLdapConfigKeys.java | 11 +++ .../server/ldap/service/AttributeDetector.java | 6 +- .../DefaultLdapAttributeDetectionService.java | 70 +--- .../ads/detectors/AttributeDetectorFactory.java | 52 +++ .../ads/detectors/ChainedAttributeDetector.java | 59 + .../ads/detectors/GroupMemberAttrDetector.java | 6 ++ .../ads/detectors/GroupNameAttrDetector.java| 6 ++ .../ads/detectors/GroupObjectClassDetector.java | 6 ++ .../OccurrenceAndWeightBasedDetector.java | 10 ++- .../detectors/UserGroupMemberAttrDetector.java | 6 ++ .../ads/detectors/UserNameAttrDetector.java | 8 +++ .../ads/detectors/UserObjectClassDetector.java | 6 ++ .../server/ldap/LdapModuleFunctionalTest.java | 20 ++ 14 files changed, 255 insertions(+), 43 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/6c06f5da/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java index 67e84dc..089da1d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapModule.java @@ -19,6 +19,7 @@ import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration; import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory; import org.apache.ambari.server.ldap.service.AmbariLdapConfigurationProvider; import org.apache.ambari.server.ldap.service.AmbariLdapFacade; +import org.apache.ambari.server.ldap.service.AttributeDetector; import org.apache.ambari.server.ldap.service.LdapAttributeDetectionService; import org.apache.ambari.server.ldap.service.LdapConfigurationService; import org.apache.ambari.server.ldap.service.LdapConnectionConfigService; @@ -26,15 +27,27 @@ import org.apache.ambari.server.ldap.service.LdapFacade; import org.apache.ambari.server.ldap.service.ads.DefaultLdapAttributeDetectionService; import org.apache.ambari.server.ldap.service.ads.DefaultLdapConfigurationService; import org.apache.ambari.server.ldap.service.ads.DefaultLdapConnectionConfigService; +import org.apache.ambari.server.ldap.service.ads.detectors.AttributeDetectorFactory; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupMemberAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupNameAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupObjectClassDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserGroupMemberAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserNameAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserObjectClassDetector; import com.google.inject.AbstractModule; import com.google.inject.assistedinject.FactoryModuleBuilder; +import com.google.inject.multibindings.Multibinder; +import com.google.inject.name.Names; /** * GUICE configuration module for setting up LDAP related infrastructure. */ public class LdapModule extends AbstractModule { + public static final String USER_ATTRIBUTES_DETECTORS = "UserAttributesDetectors"; + public static final String GROUP_ATTRIBUTES_DETECTORS = "GroupAttributesDetectors"; + @Override protected void configure() { bind(LdapFacade.class).to(AmbariLdapFacade.class); @@ -45,6 +58,25 @@ public class LdapModule extends AbstractModule { // this binding requires the JPA module! bind(AmbariLdapConfiguration.class).toProvider(AmbariLdapConfigurationProvider.class); +bind(AttributeDetectorFactory.class); + install(new FactoryModuleBuilder().build(AmbariLdapConfigurationFactory.class)); + +// binding the set of user attributes detector +Multibinder userAttributeDetectorBinder = Multibinder.newSetBinder(binder(), AttributeDetector.class, + Names
[20/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.ttf -- diff --git a/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.ttf b/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.ttf deleted file mode 100644 index 26dea79..000 Binary files a/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.ttf and /dev/null differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.woff -- diff --git a/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.woff b/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.woff deleted file mode 100644 index dc35ce3..000 Binary files a/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.woff and /dev/null differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.woff2 -- diff --git a/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.woff2 b/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.woff2 deleted file mode 100644 index 500e517..000 Binary files a/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.woff2 and /dev/null differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Underscore/js/Underscore.js -- diff --git a/contrib/views/storm/src/main/resources/libs/Underscore/js/Underscore.js b/contrib/views/storm/src/main/resources/libs/Underscore/js/Underscore.js deleted file mode 100644 index dfd89b2..000 --- a/contrib/views/storm/src/main/resources/libs/Underscore/js/Underscore.js +++ /dev/null @@ -1,1548 +0,0 @@ -// Underscore.js 1.8.3 -// http://underscorejs.org -// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -- - - // Establish the root object, `window` in the browser, or `exports` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var -push = ArrayProto.push, -slice= ArrayProto.slice, -toString = ObjProto.toString, -hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var -nativeIsArray = Array.isArray, -nativeKeys = Object.keys, -nativeBind = FuncProto.bind, -nativeCreate = Object.create; - - // Naked function reference for surrogate-prototype-swapping. - var Ctor = function(){}; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { -if (obj instanceof _) return obj; -if (!(this instanceof _)) return new _(obj); -this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object. - if (typeof exports !== 'undefined') { -if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; -} -exports._ = _; - } else { -root._ = _; - } - - // Current version. - _.VERSION = '1.8.3'; - - // Internal function that returns an efficient (for current engines) version - // of the passed-in callback, to be repeatedly applied in other Underscore - // functions. - var optimizeCb = function(func, context, argCount) { -if (context === void 0) return func; -switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { -return func.call(context, value); - }; - case 2: return function(value, other) { -return func.call(context, value, other); - }; - case 3: return function(value, index, collection) { -return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { -return func.call(context, accumulator, value, index,
[11/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/scripts/views/ComponentDetailView.jsx -- diff --git a/contrib/views/storm/src/main/resources/scripts/views/ComponentDetailView.jsx b/contrib/views/storm/src/main/resources/scripts/views/ComponentDetailView.jsx deleted file mode 100644 index 5847ef9..000 --- a/contrib/views/storm/src/main/resources/scripts/views/ComponentDetailView.jsx +++ /dev/null @@ -1,534 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at -* - http://www.apache.org/licenses/LICENSE-2.0 -* - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -define([ - 'jsx!components/Table', - 'jsx!modules/Table/Pagination', - 'react', - 'react-dom', - 'collections/BaseCollection', - 'models/VTopology', - 'jsx!components/Breadcrumbs', - 'jsx!components/SearchLogs', - 'jsx!views/ProfilingView', - 'utils/Utils', - 'bootbox', - 'bootstrap', - 'bootstrap-switch' - ],function(Table, Pagination, React, ReactDOM, BaseCollection, VTopology, Breadcrumbs, SearchLogs, ProfilingView, Utils, bootbox){ - 'use strict'; - - return React.createClass({ - displayName: 'ComponentDetailView', - propTypes: { - id: React.PropTypes.string.isRequired, - name: React.PropTypes.string.isRequired - }, - getInitialState: function(){ - this.model = new VTopology({'id': this.props.id}); - this.systemFlag = (this.props.name.startsWith('__')) ? true : false; - this.windowSize = ':all-time'; - this.initializeData(); - return { - componentObj: {}, - profilingModalOpen: false - }; - }, - componentWillMount: function(){ - $('.loader').show(); - }, - componentWillUpdate: function(){ - $('.loader').show(); - $('#collapse-input').off('hidden.bs.collapse').off('shown.bs.collapse'); - $('#collapse-output').off('hidden.bs.collapse').off('shown.bs.collapse'); - $('#collapse-executor').off('hidden.bs.collapse').off('shown.bs.collapse'); - $('#collapse-error').off('hidden.bs.collapse').off('shown.bs.collapse'); - }, - componentDidMount: function(){ - $(".boot-switch.systemSum").bootstrapSwitch({ - size: 'small', - onSwitchChange: function(event, state){ - this.systemFlag = state; - this.initializeData(); - }.bind(this) - }); - - $(".boot-switch.debug").bootstrapSwitch({ - size: 'small', - onSwitchChange: function(event, state){ - this.debugAction(state); - }.bind(this) - }); - $('.loader').hide(); - }, - componentDidUpdate: function(){ - $('#collapse-input').on('hidden.bs.collapse', function () { - $("#input-box").toggleClass("fa-compress fa-expand"); - }).on('shown.bs.collapse', function() { - $("#input-box").toggleClass("fa-compress fa-expand"); - }); - - $('#collapse-output').on('hidden.bs.collapse', function () { - $("#output-box").toggleClass("fa-compress fa-expand"); - }).on('shown.bs.collapse', function() { - $("#output-box").toggleClass("fa-compress fa-expand"); - }); - - $('#collapse-executor').on('hidden.bs.collapse', function () { -
[36/71] [abbrv] ambari git commit: Updated team page. (yusaku)
Updated team page. (yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d1d118d0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d1d118d0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d1d118d0 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: d1d118d07b8be849e827a826a687e86f44736a59 Parents: 479cf86 Author: Yusaku SakoAuthored: Wed Oct 25 15:14:52 2017 -0700 Committer: Yusaku Sako Committed: Wed Oct 25 15:14:52 2017 -0700 -- docs/pom.xml | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/d1d118d0/docs/pom.xml -- diff --git a/docs/pom.xml b/docs/pom.xml index f356226..f3de652 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -538,7 +538,19 @@ - + + +ishanbha +Ishan Bhatt +ishan...@apache.org +-8 + +Committer + + +Hortonworks + + jagane Jagane Sundar
[69/71] [abbrv] ambari git commit: AMBARI-21307 Added unit tests, doumented the code
AMBARI-21307 Added unit tests, doumented the code Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/78007771 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/78007771 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/78007771 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 78007771ac13100673e68901a9cd44c693b78cf9 Parents: 23aa377 Author: lpuskas <lpus...@apache.org> Authored: Thu Oct 19 14:41:33 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:52 2017 +0200 -- .../ads/detectors/ChainedAttributeDetector.java | 9 +- .../ads/detectors/GroupMemberAttrDetector.java | 2 +- .../ads/detectors/UserObjectClassDetector.java | 1 - .../server/ldap/LdapModuleFunctionalTest.java | 106 ++ .../detectors/GroupMemberAttrDetectorTest.java | 107 +++ 5 files changed, 151 insertions(+), 74 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/78007771/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/ChainedAttributeDetector.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/ChainedAttributeDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/ChainedAttributeDetector.java index 1fb7a4c..094922b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/ChainedAttributeDetector.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/ChainedAttributeDetector.java @@ -39,7 +39,7 @@ public class ChainedAttributeDetector implements AttributeDetector { /** * The set of detectors this instance delegates to */ - private Set detectors; + private final Set detectors; @Inject public ChainedAttributeDetector(Set detectors) { @@ -63,4 +63,11 @@ public class ChainedAttributeDetector implements AttributeDetector { } return detectedAttributes; } + + @Override + public String toString() { +return "ChainedAttributeDetector{" + + "detectors=" + detectors + + '}'; + } } http://git-wip-us.apache.org/repos/asf/ambari/blob/78007771/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java index ffe4027..8c34ef8 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java @@ -21,7 +21,7 @@ import org.apache.directory.api.ldap.model.entry.Entry; public class GroupMemberAttrDetector extends OccurrenceAndWeightBasedDetector { - private enum GroupMemberAttr { + enum GroupMemberAttr { MEMBER("member", 1), MEMBER_UID("memberUid", 1), http://git-wip-us.apache.org/repos/asf/ambari/blob/78007771/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java index 53aad8b..bf2f5b8 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java @@ -53,7 +53,6 @@ public class UserObjectClassDetector extends OccurrenceAndWeightBasedDetector { occurrenceMap().put(ocVal.ocVal(), 0); weightsMap().put(ocVal.ocVal(), ocVal.weight()); } - } @Override http://git-wip-us.apache.org/repos/asf/ambari/blob/78007771/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java index 875ce97..c43e06c 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java +++ b/ambar
[48/71] [abbrv] ambari git commit: AMBARI-21307 renamed package, minor corrections. Changed endpoint name
AMBARI-21307 renamed package, minor corrections. Changed endpoint name Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9d271df0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9d271df0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9d271df0 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 9d271df0fca4bb2a1751bef4c8b12ff3a22a84ac Parents: 976143e Author: lpuskas <lpus...@apache.org> Authored: Mon Aug 14 13:21:07 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:48 2017 +0200 -- .../services/AmbariConfigurationService.java| 2 +- .../api/services/ldap/LdapRestService.java | 15 +- .../server/ldap/AmbariLdapConfiguration.java| 5 +- .../apache/ambari/server/ldap/LdapModule.java | 4 +- ...efaultLdapConfigurationValidatorService.java | 243 --- .../ad/DefaultLdapConnectionService.java| 63 - ...efaultLdapConfigurationValidatorService.java | 243 +++ .../ads/DefaultLdapConnectionService.java | 63 + ...ltLdapConfigurationValidatorServiceTest.java | 113 - ...ltLdapConfigurationValidatorServiceTest.java | 113 + 10 files changed, 435 insertions(+), 429 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9d271df0/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java index 927e518..492509f 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java @@ -63,7 +63,7 @@ import io.swagger.annotations.ApiResponses; * } * */ -@Path("/configurations/") +@Path("/ambariconfigs/") @Api(value = "Ambari Configurations", description = "Endpoint for Ambari configuration related operations") public class AmbariConfigurationService extends BaseService { http://git-wip-us.apache.org/repos/asf/ambari/blob/9d271df0/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRestService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRestService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRestService.java index 8578204..4e654dc 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRestService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRestService.java @@ -34,6 +34,7 @@ import javax.inject.Inject; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; +import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; @@ -70,8 +71,9 @@ public class LdapRestService extends BaseService { @POST @ApiIgnore // until documented - @Path("/action") // todo this needs to be moved under the resource + @Path("/validate") // todo this needs to be moved under the resource @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) public Response validateConfiguration(LdapCheckConfigurationRequest ldapCheckConfigurationRequest) { Set groups = Sets.newHashSet(); @@ -95,10 +97,7 @@ public class LdapRestService extends BaseService { LOGGER.info("Testing LDAP attributes "); groups = ldapFacade.checkLdapAttibutes(ldapCheckConfigurationRequest.getRequestInfo().getParameters(), ambariLdapConfiguration); - // todo factor out the resource creation, design better the structure in the response - Resource resource = new ResourceImpl(Resource.Type.AmbariConfiguration); - resource.setProperty("groups", groups); - result.getResultTree().addChild(resource, "payload"); + setResult(groups, result); break; case "detect-attributes": @@ -119,6 +118,12 @@ public class LdapRestService extends BaseService { return Response.status(result.getStatus().getStatusCode()).entity(getResultSerializer().serialize(result)).build(); } + private void setResult(Set groups, Result result) { +Resource resource = new ResourceImpl(Resource.Type.AmbariConfiguration); +resource.setProperty("groups", groups); +
[68/71] [abbrv] ambari git commit: AMBARI-21307 fixed test and implementation
AMBARI-21307 fixed test and implementation Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/25fa701c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/25fa701c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/25fa701c Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 25fa701c3818ea5021704d66f0e092823a1a07fb Parents: 7800777 Author: lpuskas <lpus...@apache.org> Authored: Tue Oct 24 15:29:32 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:52 2017 +0200 -- .../server/ldap/service/ads/DefaultLdapConfigurationService.java | 2 +- .../org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/25fa701c/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java index d80a636..3f6995c 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java @@ -65,7 +65,7 @@ public class DefaultLdapConfigurationService implements LdapConfigurationService Boolean isConnected = ldapConnectionTemplate.execute(new ConnectionCallback() { @Override public Boolean doWithConnection(LdapConnection connection) throws LdapException { -return connection.isConnected(); +return connection.isConnected() && connection.isAuthenticated(); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/25fa701c/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java index c43e06c..0e05ed3 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java @@ -19,7 +19,6 @@ import java.util.Map; import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys; import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration; import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory; -import org.apache.ambari.server.ldap.domain.TestAmbariLdapConfigurationFactory; import org.apache.ambari.server.ldap.service.ads.LdapConnectionTemplateFactory; import org.apache.ambari.server.ldap.service.ads.detectors.AttributeDetectorFactory; import org.apache.directory.api.ldap.model.constants.SchemaConstants; @@ -93,8 +92,6 @@ public class LdapModuleFunctionalTest { Boolean success = template.execute(new ConnectionCallback() { @Override public Boolean doWithConnection(LdapConnection connection) throws LdapException { -connection.unBind(); -connection.bind(ldapConfiguration.bindDn(), ldapConfiguration.bindPassword()); return connection.isConnected() && connection.isAuthenticated(); }
[57/71] [abbrv] ambari git commit: AMBARI-21307 added javadocs, organized and cleaned the code
AMBARI-21307 added javadocs, organized and cleaned the code Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6dfa765c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6dfa765c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6dfa765c Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 6dfa765cf471d145182d1b4259a11397a5571cab Parents: 72b78ba Author: lpuskas <lpus...@apache.org> Authored: Wed Sep 13 15:27:39 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:50 2017 +0200 -- .../server/ldap/LdapConfigurationFactory.java | 13 + .../server/ldap/LdapConfigurationService.java | 60 - .../apache/ambari/server/ldap/LdapModule.java | 6 +- .../server/ldap/service/AmbariLdapFacade.java | 9 +- .../server/ldap/service/AttributeDetector.java | 3 +- .../ldap/service/LdapConfigurationService.java | 60 + .../ambari/server/ldap/service/LdapFacade.java | 10 +- .../ads/DefaultAttributeDetectionService.java | 238 --- .../DefaultLdapAttributeDetectionService.java | 238 +++ .../ads/DefaultLdapConfigurationService.java| 17 +- .../detectors/UserGroupMemberAttrDetector.java | 1 - .../DefaultAttributeDetectionServiceTest.java | 108 - ...efaultLdapAttributeDetectionServiceTest.java | 108 + .../DefaultLdapConfigurationServiceTest.java| 2 +- 14 files changed, 453 insertions(+), 420 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/6dfa765c/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationFactory.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationFactory.java index 57cdf6e..67ac092 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationFactory.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationFactory.java @@ -16,6 +16,19 @@ package org.apache.ambari.server.ldap; import java.util.Map; +/** + * Factory interface for AmbariLdapConfiguration instances. + * It's registered as a factory in the GUICE context ( so no implementations required) + * + * To be extended with other factory methods upon needs. + */ public interface LdapConfigurationFactory { + + /** + * Creates an AmbariLdapConfiguration instance with the provided map of configuration settings. + * + * @param configuration a map where keys are the configuration properties and values are the configuration values + * @return an AmbariLdapConfiguration instance + */ AmbariLdapConfiguration createLdapConfiguration(Map<String, Object> configuration); } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/6dfa765c/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationService.java deleted file mode 100644 index 69a641f..000 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationService.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ambari.server.ldap; - -import java.util.Set; - -import org.apache.ambari.server.AmbariException; -import org.apache.ambari.server.ldap.service.AmbariLdapException; -import org.apache.directory.ldap.client.api.LdapConnection; - -/** - * Collection of operations for validating ldap configuration. - * It's intended to decouple implementations using different libraries. - */ -public interface LdapConfigurationService { - - /** - * Tests the connection based on the provided configuration. - * - * @param ldapConnection connection instance - * @param configuration the ambari ldap configuration instance - * @throws AmbariLdapException if the connection is not possible - */ - void checkCo
[45/71] [abbrv] ambari git commit: AMBARI-21307 Implemented PUT operation, added unit tests
AMBARI-21307 Implemented PUT operation, added unit tests Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/421391a5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/421391a5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/421391a5 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 421391a5b22537c5c02b93e20db8fafaa284c63f Parents: 981887d Author: lpuskas <lpus...@apache.org> Authored: Thu Jul 13 16:20:58 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:47 2017 +0200 -- .../services/AmbariConfigurationService.java| 89 --- .../server/controller/ControllerModule.java | 2 + .../controller/ResourceProviderFactory.java | 24 +- .../AbstractControllerResourceProvider.java | 2 + .../AmbariConfigurationResourceProvider.java| 88 +-- .../internal/DefaultProviderModule.java | 2 - .../server/orm/dao/AmbariConfigurationDAO.java | 4 + ...AmbariConfigurationResourceProviderTest.java | 231 +++ 8 files changed, 364 insertions(+), 78 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/421391a5/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java index 0c159b9..0632361 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java @@ -56,16 +56,10 @@ import io.swagger.annotations.ApiResponses; *"data": [ *{ * "authentication.ldap.primaryUrl": "localhost:33389" - *}, - *{ - *"authentication.ldap.secondaryUrl": "localhost:333" - * }, - * { + "authentication.ldap.secondaryUrl": "localhost:333" * "authentication.ldap.baseDn": "dc=ambari,dc=apache,dc=org" - * } - * // .. - * ] - * } + * // .. + * ] * } * */ @@ -74,7 +68,7 @@ import io.swagger.annotations.ApiResponses; public class AmbariConfigurationService extends BaseService { private static final String AMBARI_CONFIGURATION_REQUEST_TYPE = - "org.apache.ambari.server.api.services.AmbariConfigurationRequestSwagger"; +"org.apache.ambari.server.api.services.AmbariConfigurationRequestSwagger"; /** * Creates an ambari configuration resource. @@ -87,9 +81,9 @@ public class AmbariConfigurationService extends BaseService { @POST @Produces(MediaType.TEXT_PLAIN) @ApiOperation(value = "Creates an ambari configuration resource", - nickname = "AmbariConfigurationService#createAmbariConfiguration") +nickname = "AmbariConfigurationService#createAmbariConfiguration") @ApiImplicitParams({ - @ApiImplicitParam(dataType = AMBARI_CONFIGURATION_REQUEST_TYPE, paramType = PARAM_TYPE_BODY) +@ApiImplicitParam(dataType = AMBARI_CONFIGURATION_REQUEST_TYPE, paramType = PARAM_TYPE_BODY) }) @ApiResponses({ @ApiResponse(code = HttpStatus.SC_CREATED, message = MSG_SUCCESSFUL_OPERATION), @@ -108,24 +102,24 @@ public class AmbariConfigurationService extends BaseService { @GET @Produces(MediaType.TEXT_PLAIN) @ApiOperation(value = "Retrieve all ambari configuration resources", - nickname = "AmbariConfigurationService#getAmbariConfigurations", - notes = "Returns all Ambari configurations.", - response = AmbariConfigurationResponseSwagger.class, - responseContainer = RESPONSE_CONTAINER_LIST) +nickname = "AmbariConfigurationService#getAmbariConfigurations", +notes = "Returns all Ambari configurations.", +response = AmbariConfigurationResponseSwagger.class, +responseContainer = RESPONSE_CONTAINER_LIST) @ApiImplicitParams({ - @ApiImplicitParam(name = QUERY_FIELDS, value = QUERY_FILTER_DESCRIPTION, - defaultValue = "AmbariConfiguration/data, AmbariConfiguration/id, AmbariConfiguration/type", - dataType = DATA_TYPE_STRING, paramType = PARAM_TYPE_QUERY), - @ApiImplicitParam(name = QUERY_SORT, value = QUERY_SORT_DESCRIPTION, - defaultValue = "AmbariConfiguration/id", -
[21/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.svg -- diff --git a/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.svg b/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.svg deleted file mode 100644 index d05688e..000 --- a/contrib/views/storm/src/main/resources/libs/Font-Awesome/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,655 +0,0 @@ - -http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd; > -http://www.w3.org/2000/svg;> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[56/71] [abbrv] ambari git commit: AMBARI-21307 Implemented more detectors. Organized the code
 AMBARI-21307 Implemented more detectors. Organized the code Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a08a6817 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a08a6817 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a08a6817 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: a08a6817a649957b1217f1ad2f5eb95c77ea3b98 Parents: 1f94ba3 Author: lpuskas <lpus...@apache.org> Authored: Tue Sep 12 11:58:45 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:49 2017 +0200 -- .../server/ldap/AmbariLdapConfiguration.java| 1 + .../ads/DefaultAttributeDetectionService.java | 134 ++- .../ldap/service/ads/ObjectClassDetector.java | 81 --- .../ads/OccurranceAndWeightBasedDetector.java | 81 --- .../service/ads/UserNameAttributeDetector.java | 75 --- .../ads/detectors/GroupMemberAttrDetector.java | 56 .../ads/detectors/GroupNameAttrDetector.java| 61 + .../ads/detectors/GroupObjectClassDetector.java | 64 + .../OccurranceAndWeightBasedDetector.java | 103 ++ .../detectors/UserGroupMemberAttrDetector.java | 56 .../ads/detectors/UserNameAttrDetector.java | 60 + .../ads/detectors/UserObjectClassDetector.java | 64 + .../DefaultAttributeDetectionServiceTest.java | 10 +- 13 files changed, 571 insertions(+), 275 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a08a6817/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java index e28c6ed..ebb567d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java @@ -56,6 +56,7 @@ public class AmbariLdapConfiguration { USER_OBJECT_CLASS("ambari.ldap.attributes.user.object_class"), USER_NAME_ATTRIBUTE("ambari.ldap.attributes.user.name_attr"), + USER_GROUP_MEMBER_ATTRIBUTE("ambari.ldap.attributes.user.group_member_attr"), USER_SEARCH_BASE("ambari.ldap.attributes.user.search_base"), GROUP_OBJECT_CLASS("ambari.ldap.attributes.group.object_class"), http://git-wip-us.apache.org/repos/asf/ambari/blob/a08a6817/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultAttributeDetectionService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultAttributeDetectionService.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultAttributeDetectionService.java index 710adf1..b3a4fde 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultAttributeDetectionService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultAttributeDetectionService.java @@ -14,15 +14,18 @@ package org.apache.ambari.server.ldap.service.ads; -import java.util.Set; - import javax.inject.Inject; import javax.inject.Singleton; import org.apache.ambari.server.ldap.AmbariLdapConfiguration; import org.apache.ambari.server.ldap.service.AmbariLdapException; -import org.apache.ambari.server.ldap.service.AttributeDetector; import org.apache.ambari.server.ldap.service.LdapAttributeDetectionService; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupMemberAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupNameAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupObjectClassDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserGroupMemberAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserNameAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserObjectClassDetector; import org.apache.directory.api.ldap.model.cursor.SearchCursor; import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.api.ldap.model.message.Response; @@ -37,24 +40,29 @@ import org.apache.directory.ldap.client.api.search.FilterBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.collect.Sets; - @Singleton public class DefaultAttributeDetectionService implements LdapAttributeDetectionService { private static final Logger LOGGER = LoggerFactory.getLogger(Defaul
[09/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/scripts/components/CommonWindowPanel.jsx -- diff --git a/contrib/views/storm/src/main/resources/ui/app/scripts/components/CommonWindowPanel.jsx b/contrib/views/storm/src/main/resources/ui/app/scripts/components/CommonWindowPanel.jsx new file mode 100644 index 000..0f8130f --- /dev/null +++ b/contrib/views/storm/src/main/resources/ui/app/scripts/components/CommonWindowPanel.jsx @@ -0,0 +1,99 @@ +/** + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at +* + http://www.apache.org/licenses/LICENSE-2.0 +* + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +**/ + +import React, {Component} from 'react'; +import Select from 'react-select'; +import CommonSwitchComponent from './CommonSwitchComponent'; +import {OverlayTrigger, Tooltip} from 'react-bootstrap'; + +export default class CommonWindowPanel extends Component{ + constructor(props){ +super(props); + } + + windowChange = (obj) => { +this.props.handleWindowChange(obj); + } + + commonToggleChange = (params) => { +this.props.toggleSystem(params); + } + + commonTopologyActionHandler = (action) => { +this.props.handleTopologyAction(action); + } + + render(){ +const {selectedWindowKey,windowOptions,systemFlag,debugFlag,handleLogLevel,topologyStatus,KYC,handleProfiling} = this.props; +return( + +Window + + + +System Summary + + + +Debug + + + + + +{ + KYC === 'detailView' + ? [ Activate}> + + + + , +Deactivate}> + + + +, +Rebalance}> + + + +, +Kill}> + + + +, +Change Log Level}> + + + + + ] + : Profiling & Debugging}> + + + + + +} + + + +); + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/scripts/components/CustomToastContainer.jsx -- diff --git a/contrib/views/storm/src/main/resources/ui/app/scripts/components/CustomToastContainer.jsx b/contrib/views/storm/src/main/resources/ui/app/scripts/components/CustomToastContainer.jsx new file mode 100644 index 000..04456cb --- /dev/null +++ b/contrib/views/storm/src/main/resources/ui/app/scripts/components/CustomToastContainer.jsx @@ -0,0 +1,41 @@ +/** + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at +* + http://www.apache.org/licenses/LICENSE-2.0 +* + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +**/ + +import React, {Component}from 'react'; +import { render } from 'react-dom'; +import ReactToastr, {ToastMessage, ToastContainer} from "react-toastr"; + +class CustomToastContainer extends ToastContainer{ + success(msg, title, opts){ +super.success(msg.props.children, msg, opts); + } + + error(msg, title, opts){ +super.error(msg.props.children, msg, opts); + } + + info(msg, title, opts){ +super.info(msg.props.children, msg, opts); + } + + warning(msg, title, opts){ +
[53/71] [abbrv] ambari git commit: AMBARI-2130 ldap connections handled in thefacade. Code cleanup
AMBARI-2130 ldap connections handled in thefacade. Code cleanup Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/35b3cb42 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/35b3cb42 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/35b3cb42 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 35b3cb4288d21c1f505e14bd989e404d3d277a5f Parents: a08a681 Author: lpuskas <lpus...@apache.org> Authored: Tue Sep 12 15:38:25 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:49 2017 +0200 -- .../server/ldap/service/AmbariLdapFacade.java | 51 + .../ldap/service/LdapConnectionService.java | 12 ++- .../ambari/server/ldap/service/LdapFacade.java | 2 +- .../ads/DefaultLdapConfigurationService.java| 77 .../ads/DefaultLdapConnectionService.java | 41 ++- .../OccurranceAndWeightBasedDetector.java | 2 +- 6 files changed, 103 insertions(+), 82 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/35b3cb42/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java index f159418..d2bdef3 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java @@ -19,7 +19,6 @@ import java.util.Map; import java.util.Set; import javax.inject.Inject; -import javax.inject.Provider; import javax.inject.Singleton; import org.apache.ambari.server.ldap.AmbariLdapConfiguration; @@ -58,35 +57,59 @@ public class AmbariLdapFacade implements LdapFacade { @Inject private LdapAttributeDetectionService ldapAttributeDetectionService; - //todo remove this, added for testing purposes only - @Inject - private Provider ambariLdapConfigurationProvider; - @Inject public AmbariLdapFacade() { } @Override public void checkConnection(AmbariLdapConfiguration ambariLdapConfiguration) throws AmbariLdapException { +LdapConnection connection = null; try { + LOGGER.info("Validating LDAP connection related configuration based on: {}", ambariLdapConfiguration); - LdapConnection connection = ldapConnectionService.createLdapConnection(ambariLdapConfiguration); + connection = ldapConnectionService.getBoundLdapConnection(ambariLdapConfiguration); ldapConfigurationService.checkConnection(connection, ambariLdapConfiguration); -} catch (AmbariLdapException e) { + LOGGER.info("Validating LDAP connection related configuration: SUCCESS"); + +} catch (Exception e) { + LOGGER.error("Validating LDAP connection configuration failed", e); - throw e; + throw new AmbariLdapException(e); + +} finally { + try { +connection.unBind(); +connection.close(); + } catch (Exception e) { +throw new AmbariLdapException(e); + } } -LOGGER.info("Validating LDAP connection related configuration: SUCCESS"); + } @Override - public AmbariLdapConfiguration detectAttributes(AmbariLdapConfiguration ambariLdapConfiguration) { + public AmbariLdapConfiguration detectAttributes(AmbariLdapConfiguration ambariLdapConfiguration) throws AmbariLdapException { LOGGER.info("Detecting LDAP configuration attributes ..."); -LdapConnection connection = ldapConnectionService.createLdapConnection(ambariLdapConfiguration); -ambariLdapConfiguration = ldapAttributeDetectionService.detectLdapUserAttributes(connection, ambariLdapConfiguration); -return ambariLdapConfiguration; +LdapConnection connection = ldapConnectionService.getBoundLdapConnection(ambariLdapConfiguration); +try { + + ambariLdapConfiguration = ldapAttributeDetectionService.detectLdapUserAttributes(connection, ambariLdapConfiguration); + ambariLdapConfiguration = ldapAttributeDetectionService.detectLdapGroupAttributes(connection, ambariLdapConfiguration); + return ambariLdapConfiguration; + +} catch (Exception e) { + LOGGER.error("Error during LDAP attribute detection", e); + throw new AmbariLdapException(e); +} finally { + try { +connection.unBind(); +connection.close(); + } catch (Exception e) { +throw new AmbariLdapException(e); + } +} } @Override @@ -98,7 +121,7 @@ public class AmbariLdapFacade implements LdapFacade { throw new Illeg
[07/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/scripts/containers/TopologyDetailView.jsx -- diff --git a/contrib/views/storm/src/main/resources/ui/app/scripts/containers/TopologyDetailView.jsx b/contrib/views/storm/src/main/resources/ui/app/scripts/containers/TopologyDetailView.jsx new file mode 100644 index 000..847ae7d --- /dev/null +++ b/contrib/views/storm/src/main/resources/ui/app/scripts/containers/TopologyDetailView.jsx @@ -0,0 +1,862 @@ +/** + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at +* + http://www.apache.org/licenses/LICENSE-2.0 +* + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +**/ + +import React, {Component} from 'react'; +import ReactDOM from 'react-dom'; +import BaseContainer from './BaseContainer'; +import SearchLogs from '../components/SearchLogs'; +import TopologyREST from '../rest/TopologyREST'; +import {Accordion, Panel,OverlayTrigger, Tooltip} from 'react-bootstrap'; +import TopologyGraph from '../components/TopologyGraph'; +import { + Table, + Thead, + Th, + Tr, + Td, + unsafe +} from 'reactable'; +import CommonPagination from '../components/CommonPagination'; +import {Link} from 'react-router'; +import {toastOpt,pageSize} from '../utils/Constants'; +import Utils from '../utils/Utils'; +import FSReactToastr from '../components/FSReactToastr'; +import CommonNotification from '../components/CommonNotification'; +import Breadcrumbs from '../components/Breadcrumbs'; +import Modal from '../components/FSModel'; +import CommonWindowPanel from '../components/CommonWindowPanel'; +import RebalanceTopology from '../components/RebalanceTopology'; +import LogLevelComponent from '../components/LogLevelComponent'; +import CommonSwitchComponent from '../components/CommonSwitchComponent'; +import BarChart from '../components/BarChart'; +import CommonExpanded from '../components/CommonExpanded'; + +export default class TopologyDetailView extends Component { + constructor(props){ +super(props); +this.state = { + details: {}, + spotActivePage : 1, + boltsActivePage : 1, + topologyActivePage : 1, + spotFilterValue : '', + blotFilterValue : '', + topologyFilterValue : '', + selectedWindowKey : {label : 'All time' , value : ':all-time'}, + windowOptions : [], + systemFlag : false, + killWaitTime : 30, + showLogLevel : false, + topologyLagFlag : true, + topologyLagPage : 1, + toggleGraphAndTable: true, + expandGraph : true, + expandSpout : true, + expandBolt : true, + expandConfig : false, + topologyLag : [], + debugFlag : false +}; +this.fetchDetails(); + } + fetchDetails(){ +const {selectedWindowKey,systemFlag} = this.state; +let promiseArr=[ + TopologyREST.getTopologyDetails(this.props.params.id,selectedWindowKey.value,systemFlag), + TopologyREST.getTopologyGraphData(this.props.params.id,selectedWindowKey.value), + TopologyREST.getTopologyLag(this.props.params.id) +]; + +Promise.all(promiseArr).then((results) => { + _.map(results, (result) => { +if(result.errorMessage !== undefined){ + FSReactToastr.error( +, '', toastOpt); +} + }); + + let stateObj = {}; + stateObj.details = results[0]; + stateObj.windowOptions = Utils.populateWindowsOptions(stateObj.details.topologyStats); + if(stateObj.windowOptions.length === 0){ +stateObj.windowOptions = [{label : 'All time', value : ':all-time'}]; + } + stateObj.debugSimplePCT = stateObj.details.samplingPct; + stateObj.selectedWindowKey = {label : stateObj.details.windowHint || 'All time', value : stateObj.details.window || ':all-time'}; + stateObj.graphData = results[1]; + stateObj.topologyLag = _.isEmpty(results[2]) ? [] : this.generateTopologyLagData(results[2]); + stateObj.debugFlag = stateObj.details.debug; + this.setState(stateObj); +}); + } + + generateTopologyLagData = (lagObj) => { +const objKey = _.keys(lagObj); +let arr = []; +_.map(objKey, (o) => { + let data = lagObj[o]; + const topicKeys = _.keys(data.spoutLagResult); + _.map(topicKeys, (t) => { +const topicName = t; +
[46/71] [abbrv] ambari git commit: AMBARI-21307 Draft implementation of the group related attributes
AMBARI-21307 Draft implementation of the group related attributes Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7c2ceaa4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7c2ceaa4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7c2ceaa4 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 7c2ceaa4ac2d47a316fa2402549aeeaf039629eb Parents: 10b40ac Author: lpuskas <lpus...@apache.org> Authored: Tue Aug 8 13:54:29 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:47 2017 +0200 -- .../server/ldap/AmbariLdapConfiguration.java| 22 +- .../ldap/LdapConfigurationValidatorService.java | 34 +-- .../apache/ambari/server/ldap/LdapModule.java | 4 +- .../server/ldap/service/AmbariLdapFacade.java | 25 +- .../ldap/service/LdapConnectionService.java | 35 +++ .../ambari/server/ldap/service/LdapFacade.java | 9 +- .../ad/AdLdapConfigurationValidatorService.java | 177 -- ...efaultLdapConfigurationValidatorService.java | 232 +++ .../ad/DefaultLdapConnectionService.java| 63 + .../service/ad/LdapConfigurationConverter.java | 50 ...AdLdapConfigurationValidatorServiceTest.java | 129 --- ...ltLdapConfigurationValidatorServiceTest.java | 156 + 12 files changed, 552 insertions(+), 384 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7c2ceaa4/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java index 519f400..a6ff80b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java @@ -53,7 +53,7 @@ public class AmbariLdapConfiguration { GROUP_OBJECT_CLASS("ambari.ldap.group.object.class"), GROUP_NAME_ATTRIBUTE("ambari.ldap.group.name.attribute"), GROUP_MEMBER_ATTRIBUTE("ambari.ldap.group.member.attribute"), -GROUP_SEARCH_BASE("ambari.ldap.group.member.attribute"), +GROUP_SEARCH_BASE("ambari.ldap.group.search.base"), DN_ATTRIBUTE("authentication.ldap.dnAttribute"); private String propertyName; @@ -126,4 +126,24 @@ public class AmbariLdapConfiguration { return (String) configurationValue(LdapConfigProperty.USER_NAME_ATTRIBUTE); } + public String userSearchBase() { +return (String) configurationValue(LdapConfigProperty.USER_SEARCH_BASE); + } + + public String groupObjectClass() { +return (String) configurationValue(LdapConfigProperty.GROUP_OBJECT_CLASS); + } + + public String groupNameAttribute() { +return (String) configurationValue(LdapConfigProperty.GROUP_NAME_ATTRIBUTE); + } + + public String groupMemberAttribute() { +return (String) configurationValue(LdapConfigProperty.GROUP_MEMBER_ATTRIBUTE); + } + + public String groupSearchBase() { +return (String) configurationValue(LdapConfigProperty.GROUP_SEARCH_BASE); + } + } http://git-wip-us.apache.org/repos/asf/ambari/blob/7c2ceaa4/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationValidatorService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationValidatorService.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationValidatorService.java index 4667721..7efa3b7 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationValidatorService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/LdapConfigurationValidatorService.java @@ -14,8 +14,11 @@ package org.apache.ambari.server.ldap; +import java.util.Set; + import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.ldap.service.AmbariLdapException; +import org.apache.directory.ldap.client.api.LdapConnection; /** * Collection of operations for validating ldap configuration. @@ -26,27 +29,32 @@ public interface LdapConfigurationValidatorService { /** * Tests the connection based on the provided configuration. * - * @param configuration the ambari ldap configuration instance + * @param ldapConnection connection instance + * @param configuration the ambari ldap configuration instance * @throws AmbariLdapException if the connection is not possible */ - void checkConnection(AmbariLdapConfiguration configuration) throws Am
[04/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.svg -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.svg b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.svg new file mode 100644 index 000..26d438c --- /dev/null +++ b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/fontawesome-webfont.svg @@ -0,0 +1,685 @@ + +http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd; > +http://www.w3.org/2000/svg;> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[50/71] [abbrv] ambari git commit: AMBARI-21307 refactoring - renamed, moved classes, variables
AMBARI-21307 refactoring - renamed, moved classes, variables Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2de37954 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2de37954 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2de37954 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 2de37954d391777bcfc453bdfd95d5b4aca0a4b9 Parents: 17c4a46 Author: lpuskas <lpus...@apache.org> Authored: Tue Aug 22 10:03:24 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:48 2017 +0200 -- .../api/services/ldap/AmbariConfiguration.java | 87 +++ .../services/ldap/AmbariConfigurationDTO.java | 67 - .../ldap/LdapCheckConfigurationRequest.java | 47 .../api/services/ldap/LdapConfigOperation.java | 43 .../services/ldap/LdapConfigurationRequest.java | 49 .../services/ldap/LdapConfigurationService.java | 53 +--- .../api/services/ldap/LdapOperationRequest.java | 18 -- .../server/ldap/LdapConfigurationService.java | 60 + .../ldap/LdapConfigurationValidatorService.java | 60 - .../apache/ambari/server/ldap/LdapModule.java | 4 +- .../server/ldap/service/AmbariLdapFacade.java | 10 +- .../ads/DefaultLdapConfigurationService.java| 243 +++ ...efaultLdapConfigurationValidatorService.java | 243 --- .../api/services/ldap/LDAPServiceTest.java | 6 +- .../DefaultLdapConfigurationServiceTest.java| 113 + ...ltLdapConfigurationValidatorServiceTest.java | 113 - 16 files changed, 618 insertions(+), 598 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2de37954/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfiguration.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfiguration.java new file mode 100644 index 000..b5cc921 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfiguration.java @@ -0,0 +1,87 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.api.services.ldap; + +import java.util.Collections; +import java.util.Map; +import java.util.Set; + +/** + * Domain POJO representing generic ambari configuration data. + */ +public class AmbariConfiguration { + + /** + * The type of the configuration, eg.: ldap-configuration + */ + private String type; + + /** + * Version tag + */ + private String versionTag; + + /** + * Version number + */ + private Integer version; + + /** + * Created timestamp + */ + private long createdTs; + + private Set<Map<String, Object>> data = Collections.emptySet(); + + public String getType() { +return type; + } + + public void setType(String type) { +this.type = type; + } + + public Set<Map<String, Object>> getData() { +return data; + } + + public void setData(Set<Map<String, Object>> data) { +this.data = data; + } + + public String getVersionTag() { +return versionTag; + } + + public void setVersionTag(String versionTag) { +this.versionTag = versionTag; + } + + public Integer getVersion() { +return version; + } + + public void setVersion(Integer version) { +this.version = version; + } + + public long getCreatedTs() { +return createdTs; + } + + public void setCreatedTs(long createdTs) { +this.createdTs = createdTs; + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/2de37954/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfigurationDTO.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfigurationDTO.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfigurationDTO.java deleted file mode 100644 index 1b134fe..000 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/AmbariConfigurationDTO.j
[23/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Bootstrap/js/bootstrap-slider.min.js -- diff --git a/contrib/views/storm/src/main/resources/libs/Bootstrap/js/bootstrap-slider.min.js b/contrib/views/storm/src/main/resources/libs/Bootstrap/js/bootstrap-slider.min.js deleted file mode 100644 index e61cd83..000 --- a/contrib/views/storm/src/main/resources/libs/Bootstrap/js/bootstrap-slider.min.js +++ /dev/null @@ -1,29 +0,0 @@ -/*! === - VERSION 7.0.1 -= */ -"use strict";function _typeof(a){return a&&"undefined"!=typeof Symbol&===Symbol?"symbol":typeof a}/*! = - * bootstrap-slider.js - * - * Maintainers: - * Kyle Kemp - * - Twitter: @seiyria - * - Github: seiyria - * Rohit Kalkur - * - Twitter: @Rovolutionary - * - Github: rovolution - * - * = - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * = */ -!function(a){if("function"==typeof define&)define(["jquery"],a);else if("object"===("undefined"==typeof module?"undefined":_typeof(module))&){var b;try{b=require("jquery")}catch(c){b=null}module.exports=a(b)}else window&&(window.Slider=a(window.jQuery))}(function(a){var b;return function(a){function b(){}function c(a){function c(b){b.prototype.option||(b.prototype.option=function(b){a.isPlainObject(b)&&(this.options=a.extend(!0,this.options,b))})}function e(b,c){a.fn[b]=function(e){if("string"==typeof e){for(var g=d.call(arguments,1),h=0,i=this.length;i>h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l&!==k)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}return this}var m=this.map(function(){var d=a.data(this,b);return d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d)),a(this)} );return!m||m.length>1?m:m[0]}}if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}var d=Array.prototype.slice;c(a)}(a),function(a){function c(b,c){function d(a,b){var c="data-slider-"+b.replace(/_/g,"-"),d=a.getAttribute(c);try{return JSON.parse(d)}catch(e){return d}}this._state={value:null,enabled:null,offset:null,size:null,percentage:null,inDrag:!1,over:!1},"string"==typeof b?this.element=document.querySelector(b):b instanceof HTMLElement&&(this.element=b),c=c?c:{};for(var f=Object.keys(this.defaultOptions),g=0;g
[35/71] [abbrv] ambari git commit: AMBARI-22304 Add search box filter to Config History page. (atkach)
AMBARI-22304 Add search box filter to Config History page. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/479cf86a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/479cf86a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/479cf86a Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 479cf86ac3c17c8dcaba89280fb2dc5c9012523b Parents: 655e0a7 Author: Andrii TkachAuthored: Wed Oct 25 15:40:59 2017 +0300 Committer: Andrii Tkach Committed: Wed Oct 25 15:40:59 2017 +0300 -- ambari-web/app/assets/test/tests.js | 2 + .../main/dashboard/config_history_controller.js | 92 ++- ambari-web/app/routes/main.js | 2 - ambari-web/app/templates/main/alerts.hbs| 2 +- .../templates/main/dashboard/config_history.hbs | 23 +- ambari-web/app/templates/main/host.hbs | 2 +- ambari-web/app/utils/ajax/ajax.js | 4 + ambari-web/app/views.js | 2 + ambari-web/app/views/common/search_box_view.js | 165 + .../app/views/main/alerts/alert_search_box.js | 161 ++--- .../main/dashboard/config_history_search_box.js | 221 + .../views/main/dashboard/config_history_view.js | 101 .../app/views/main/host/combo_search_box.js | 44 +--- .../test/views/common/search_box_view_test.js | 240 +++ .../views/main/alerts/alert_search_box_test.js | 74 +- .../dashboard/config_history_search_box_test.js | 207 .../main/dashboard/config_history_view_test.js | 188 +-- .../views/main/host/combo_search_box_test.js| 66 + 18 files changed, 908 insertions(+), 688 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/479cf86a/ambari-web/app/assets/test/tests.js -- diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js index fe0dd17..de81764 100644 --- a/ambari-web/app/assets/test/tests.js +++ b/ambari-web/app/assets/test/tests.js @@ -295,6 +295,7 @@ var files = [ 'test/views/main/admin/service_auto_start/component_auto_start_test', 'test/views/main/admin/service_auto_start_test', 'test/views/main/dashboard/config_history_view_test', + 'test/views/main/dashboard/config_history_search_box_test', 'test/views/main/dashboard/widget_test', 'test/views/main/dashboard/widgets_test', 'test/views/main/dashboard/widgets/text_widget_test', @@ -382,6 +383,7 @@ var files = [ 'test/views/common/form/spinner_input_view_test', 'test/views/common/form/manage_kdc_credentials_form_test', 'test/views/common/log_file_search_view_test', + 'test/views/common/search_box_view_test', 'test/views/wizard/step3/hostLogPopupBody_view_test', 'test/views/wizard/step3/hostWarningPopupBody_view_test', 'test/views/wizard/step3/hostWarningPopupFooter_view_test', http://git-wip-us.apache.org/repos/asf/ambari/blob/479cf86a/ambari-web/app/controllers/main/dashboard/config_history_controller.js -- diff --git a/ambari-web/app/controllers/main/dashboard/config_history_controller.js b/ambari-web/app/controllers/main/dashboard/config_history_controller.js index 5197ad9..ae3057d 100644 --- a/ambari-web/app/controllers/main/dashboard/config_history_controller.js +++ b/ambari-web/app/controllers/main/dashboard/config_history_controller.js @@ -103,79 +103,6 @@ App.MainConfigHistoryController = Em.ArrayController.extend(App.TableServerMixin } ], - modifiedFilter: Em.Object.create({ -content: [ - { -value: 'Any', -label: Em.I18n.t('any') - }, - { -value: 'Past 1 hour', -label: 'Past 1 hour' - }, - { -value: 'Past 1 Day', -label: 'Past 1 Day' - }, - { -value: 'Past 2 Days', -label: 'Past 2 Days' - }, - { -value: 'Past 7 Days', -label: 'Past 7 Days' - }, - { -value: 'Past 14 Days', -label: 'Past 14 Days' - }, - { -value: 'Past 30 Days', -label: 'Past 30 Days' - } -], -optionValue: 'Any', -filterModified: function () { - var time = ""; - var curTime = new Date().getTime(); - - switch (this.get('optionValue.value')) { -case 'Past 1 hour': - time = curTime - 360; - break; -case 'Past 1 Day': - time = curTime - 8640; - break; -case 'Past 2 Days': - time = curTime - 17280; - break; -case 'Past 7 Days': - time = curTime - 60480; - break; -case 'Past 14
[12/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/scripts/components/TopologyGraph.jsx -- diff --git a/contrib/views/storm/src/main/resources/scripts/components/TopologyGraph.jsx b/contrib/views/storm/src/main/resources/scripts/components/TopologyGraph.jsx deleted file mode 100644 index 8679661..000 --- a/contrib/views/storm/src/main/resources/scripts/components/TopologyGraph.jsx +++ /dev/null @@ -1,199 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at -* - http://www.apache.org/licenses/LICENSE-2.0 -* - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -define(['react', 'react-dom', 'd3', 'dagreD3', 'd3.tip'], function(React, ReactDOM, d3, dagreD3) { - 'use strict'; - return React.createClass({ - displayName: 'TopologyGraph', -propTypes: { -data: React.PropTypes.object.isRequired, -width: React.PropTypes.string, -height: React.PropTypes.string -}, - getInitialState: function(){ - this.syncData(this.props.data); - return null; - }, - componentDidUpdate: function(){ - this.syncData(this.props.data); -this.updateGraph(); - }, - componentDidMount: function(){ -var that = this; -this.svg = d3.select(ReactDOM.findDOMNode(this)) -//Set up tooltip -this.tooltip = d3.tip() -.attr('class', function() { -return 'd3-tip testing'; -}) -.offset([-10, 0]) -.html(function(data) { -var d = that.g.node(data); -var tip = ""; -if (d[":capacity"] !== null) tip += "Capacity: " + d[":capacity"].toFixed(2) + ""; -if (d[":latency"] !== null) tip += "Latency: " + d[":latency"].toFixed(2) + ""; -if (d[":transferred"] !== null) tip += "Transferred: " + d[":transferred"].toFixed(2) + ""; -tip += ""; -return tip; -}); -//Set up zoom -this.zoom = d3.behavior.zoom() -.scaleExtent([0, 8]) -.on("zoom", this.zoomed); -}, -zoomed: function(){ -this.inner.attr("transform", -"translate(" + this.zoom.translate() + ")" + -"scale(" + this.zoom.scale() + ")" -); -}, - // update graph (called when needed) - updateGraph: function(){ -var that = this; -var g = ReactDOM.findDOMNode(this).children[0]; -if(g){ -g.remove(); -} -var inner = this.inner = this.svg.append("g"); -// Create the renderer -var render = new dagreD3.render(); - -render.arrows().arrowPoint = function normal(parent, id, edge, type) { -var marker = parent.append("marker") -.attr("id", id) -.attr("viewBox", "0 0 10 10") -.attr("refX", 5) -.attr("refY", 5) -.attr("markerUnits", "strokeWidth") -.attr("markerWidth", 6) -.attr("markerHeight", 6.5) -.attr("orient", "auto"); - -var path = marker.append("path") -.attr("d", "M 0 0 L 10 5 L 0 10 z") -.style("stroke-width", 1) -.style("stroke-dasharray", "1,0") -.style("fill", "grey") -.style("stroke", "grey"); -dagreD3.util.applyStyle(path, edge[type + "Style"]); -}; - -render.shapes().img = function circle(parent, bbox, node) { -var shapeSvg = parent.insert("image") -.attr("class", "nodeImage") -.attr("xlink:href", function(d) { -if (node) { -if(node.type === 'spout'){ -return "images/icon-spout.png"; -
[27/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Bootstrap/css/bootstrap.css -- diff --git a/contrib/views/storm/src/main/resources/libs/Bootstrap/css/bootstrap.css b/contrib/views/storm/src/main/resources/libs/Bootstrap/css/bootstrap.css deleted file mode 100644 index 5a77806..000 --- a/contrib/views/storm/src/main/resources/libs/Bootstrap/css/bootstrap.css +++ /dev/null @@ -1,5959 +0,0 @@ -/*! - * Bootstrap v3.3.5 (http://getbootstrap.com) - * Copyright 2011-2016 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ - -/*! - * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=24d1a0f0dd0d6c17e785e6d1a050685c) - * Config saved to config.json and https://gist.github.com/24d1a0f0dd0d6c17e785e6d1a050685c - */ -/*! - * Bootstrap v3.3.6 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ -html { - font-family: sans-serif; - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; -} -body { - margin: 0; -} -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -menu, -nav, -section, -summary { - display: block; -} -audio, -canvas, -progress, -video { - display: inline-block; - vertical-align: baseline; -} -audio:not([controls]) { - display: none; - height: 0; -} -[hidden], -template { - display: none; -} -a { - background-color: transparent; -} -a:active, -a:hover { - outline: 0; -} -abbr[title] { - border-bottom: 1px dotted; -} -b, -strong { - font-weight: bold; -} -dfn { - font-style: italic; -} -h1 { - font-size: 2em; - margin: 0.67em 0; -} -mark { - background: #ff0; - color: #000; -} -small { - font-size: 80%; -} -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} -sup { - top: -0.5em; -} -sub { - bottom: -0.25em; -} -img { - border: 0; -} -svg:not(:root) { - overflow: hidden; -} -figure { - margin: 1em 40px; -} -hr { - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0; -} -pre { - overflow: auto; -} -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; -} -button, -input, -optgroup, -select, -textarea { - color: inherit; - font: inherit; - margin: 0; -} -button { - overflow: visible; -} -button, -select { - text-transform: none; -} -button, -html input[type="button"], -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; - cursor: pointer; -} -button[disabled], -html input[disabled] { - cursor: default; -} -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; -} -input { - line-height: normal; -} -input[type="checkbox"], -input[type="radio"] { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - padding: 0; -} -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} -input[type="search"] { - -webkit-appearance: textfield; - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; -} -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} -legend { - border: 0; - padding: 0; -} -textarea { - overflow: auto; -} -optgroup { - font-weight: bold; -} -table { - border-collapse: collapse; - border-spacing: 0; -} -td, -th { - padding: 0; -} -/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ -@media print { - *, - *:before, - *:after { -background: transparent !important; -color: #000 !important; --webkit-box-shadow: none !important; -box-shadow: none !important; -text-shadow: none !important; - } - a, - a:visited { -text-decoration: underline; - } - a[href]:after { -content: " (" attr(href) ")"; - } - abbr[title]:after { -content: " (" attr(title) ")"; - } - a[href^="#"]:after, - a[href^="javascript:"]:after { -content: ""; - } - pre, - blockquote { -border: 1px solid #999; -page-break-inside: avoid; - } - thead { -display: table-header-group; - } - tr, - img { -page-break-inside: avoid; - } - img { -max-width: 100% !important; - } - p, - h2, - h3 { -orphans: 3; -widows: 3; - } - h2, - h3 { -page-break-after: avoid; - } - .navbar { -display: none; - } - .btn > .caret, - .dropup > .btn > .caret { -border-top-color: #000 !important; - } - .label { -border: 1px solid
[24/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.ttf -- diff --git a/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.ttf b/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.ttf deleted file mode 100644 index 1413fc6..000 Binary files a/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.ttf and /dev/null differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.woff -- diff --git a/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.woff b/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.woff deleted file mode 100644 index 9e61285..000 Binary files a/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.woff and /dev/null differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.woff2 -- diff --git a/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.woff2 b/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.woff2 deleted file mode 100644 index 64539b5..000 Binary files a/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.woff2 and /dev/null differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Bootstrap/images/clear.png -- diff --git a/contrib/views/storm/src/main/resources/libs/Bootstrap/images/clear.png b/contrib/views/storm/src/main/resources/libs/Bootstrap/images/clear.png deleted file mode 100755 index 580b52a..000 Binary files a/contrib/views/storm/src/main/resources/libs/Bootstrap/images/clear.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Bootstrap/images/loading.gif -- diff --git a/contrib/views/storm/src/main/resources/libs/Bootstrap/images/loading.gif b/contrib/views/storm/src/main/resources/libs/Bootstrap/images/loading.gif deleted file mode 100755 index 5b33f7e..000 Binary files a/contrib/views/storm/src/main/resources/libs/Bootstrap/images/loading.gif and /dev/null differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Bootstrap/js/bootstrap-editable.min.js -- diff --git a/contrib/views/storm/src/main/resources/libs/Bootstrap/js/bootstrap-editable.min.js b/contrib/views/storm/src/main/resources/libs/Bootstrap/js/bootstrap-editable.min.js deleted file mode 100644 index b786a84..000 --- a/contrib/views/storm/src/main/resources/libs/Bootstrap/js/bootstrap-editable.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! X-editable - v1.5.1 -* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery -* http://github.com/vitalets/x-editable -* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */ -!function(a){"use strict";var b=function(b,c){this.options=a.extend({},a.fn.editableform.defaults,c),this.$div=a(b),this.options.scope||(this.options.scope=this)};b.prototype={constructor:b,initInput:function(){this.input=this.options.input,this.value=this.input.str2value(this.options.value),this.input.prerender()},initTemplate:function(){this.$form=a(a.fn.editableform.template)},initButtons:function(){var b=this.$form.find(".editable-buttons");b.append(a.fn.editableform.buttons),"bottom"===this.options.showbuttons&("editable-buttons-bottom")},render:function(){this.$loading=a(a.fn.editableform.loading),this.$div.empty().append(this.$loading),this.initTemplate(),this.options.showbuttons?this.initButtons():this.$form.find(".editable-buttons").remove(),this.showLoading(),this.isSaving=!1,this.$div.triggerHandler("rendering"),this.initInput(),this.$form.find("div.editable-input").append(this.input.$tpl),this.$div.append(this.$form),a.when(this.input.render()).then(a.proxy(fu
[16/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/jsx/JSXTransformer.js -- diff --git a/contrib/views/storm/src/main/resources/libs/jsx/JSXTransformer.js b/contrib/views/storm/src/main/resources/libs/jsx/JSXTransformer.js deleted file mode 100644 index efc63ff..000 --- a/contrib/views/storm/src/main/resources/libs/jsx/JSXTransformer.js +++ /dev/null @@ -1,15201 +0,0 @@ -/** - * JSXTransformer v0.12.2 - */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.JSXTransformer=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&if(!u&)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&for(var o=0;oAMBARI-21307 Rest resource for supporting ambari configurations Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f89b11e8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f89b11e8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f89b11e8 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: f89b11e84d628b4669197e739ee1852fb8a1bbf1 Parents: 4d3abaf Author: lpuskas <lpus...@apache.org> Authored: Wed Jul 5 14:20:18 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:46 2017 +0200 -- .../resources/ResourceInstanceFactoryImpl.java | 4 + .../services/AmbariConfigurationService.java| 146 +++ .../internal/AbstractProviderModule.java| 2 +- .../AmbariConfigurationResourceProvider.java| 247 +++ .../internal/DefaultProviderModule.java | 26 +- .../ambari/server/controller/spi/Resource.java | 5 +- .../server/orm/dao/AmbariConfigurationDAO.java | 92 +++ .../orm/entities/AmbariConfigurationEntity.java | 70 ++ .../orm/entities/ConfigurationBaseEntity.java | 159 .../authorization/RoleAuthorization.java| 95 +++ .../resources/Ambari-DDL-Postgres-CREATE.sql| 25 +- .../src/main/resources/META-INF/persistence.xml | 2 + 12 files changed, 809 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f89b11e8/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java index d0d115d..f5fb6e9 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java @@ -471,6 +471,10 @@ public class ResourceInstanceFactoryImpl implements ResourceInstanceFactory { case RemoteCluster: resourceDefinition = new RemoteClusterResourceDefinition(); break; + case AmbariConfiguration: +resourceDefinition = new SimpleResourceDefinition(Resource.Type.AmbariConfiguration, "ambariconfiguration", "ambariconfigurations"); + +break; default: throw new IllegalArgumentException("Unsupported resource type: " + type); http://git-wip-us.apache.org/repos/asf/ambari/blob/f89b11e8/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java new file mode 100644 index 000..0fa6e44 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java @@ -0,0 +1,146 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.api.services; + +import java.util.Collections; + +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + +import org.apache.ambari.server.controller.spi.Resource; +import org.apache.http.HttpStatus; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; + +/** + * Rest endpoint for managing ambari configurations. Supports CRUD operations. + * Ambari configurations are resources that relate to the ambari server
[43/71] [abbrv] ambari git commit: AMBARI-21307 Groups for the test user returned to the caller
AMBARI-21307 Groups for the test user returned to the caller Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c659b9e0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c659b9e0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c659b9e0 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: c659b9e09fe656b6c9085a8634457f6e8a288c12 Parents: 7c2ceaa Author: lpuskas <lpus...@apache.org> Authored: Tue Aug 8 15:50:29 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:47 2017 +0200 -- .../api/services/ldap/LdapRestService.java | 16 +- .../server/ldap/AmbariLdapConfiguration.java| 2 +- .../apache/ambari/server/ldap/LdapModule.java | 3 + .../server/ldap/service/AmbariLdapFacade.java | 3 +- .../ambari/server/ldap/service/LdapFacade.java | 3 +- ...efaultLdapConfigurationValidatorService.java | 25 ++--- .../ad/DefaultLdapConnectionService.java| 2 +- ...ltLdapConfigurationValidatorServiceTest.java | 59 +++- 8 files changed, 49 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c659b9e0/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRestService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRestService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRestService.java index 33b10fa..8578204 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRestService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapRestService.java @@ -28,6 +28,8 @@ package org.apache.ambari.server.api.services.ldap; +import java.util.Set; + import javax.inject.Inject; import javax.ws.rs.Consumes; import javax.ws.rs.POST; @@ -41,12 +43,16 @@ import org.apache.ambari.server.api.services.BaseService; import org.apache.ambari.server.api.services.Result; import org.apache.ambari.server.api.services.ResultImpl; import org.apache.ambari.server.api.services.ResultStatus; +import org.apache.ambari.server.controller.internal.ResourceImpl; +import org.apache.ambari.server.controller.spi.Resource; import org.apache.ambari.server.ldap.AmbariLdapConfiguration; import org.apache.ambari.server.ldap.LdapConfigurationFactory; import org.apache.ambari.server.ldap.service.LdapFacade; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.common.collect.Sets; + /** * Endpoint designated to LDAP specific operations. */ @@ -68,6 +74,8 @@ public class LdapRestService extends BaseService { @Consumes(MediaType.APPLICATION_JSON) public Response validateConfiguration(LdapCheckConfigurationRequest ldapCheckConfigurationRequest) { +Set groups = Sets.newHashSet(); + Result result = new ResultImpl(new ResultStatus(ResultStatus.STATUS.OK)); try { @@ -86,7 +94,11 @@ public class LdapRestService extends BaseService { case "test-attributes": LOGGER.info("Testing LDAP attributes "); - ldapFacade.checkLdapAttibutes(ldapCheckConfigurationRequest.getRequestInfo().getParameters(), ambariLdapConfiguration); + groups = ldapFacade.checkLdapAttibutes(ldapCheckConfigurationRequest.getRequestInfo().getParameters(), ambariLdapConfiguration); + // todo factor out the resource creation, design better the structure in the response + Resource resource = new ResourceImpl(Resource.Type.AmbariConfiguration); + resource.setProperty("groups", groups); + result.getResultTree().addChild(resource, "payload"); break; case "detect-attributes": @@ -101,7 +113,7 @@ public class LdapRestService extends BaseService { } } catch (Exception e) { - result = new ResultImpl(new ResultStatus(ResultStatus.STATUS.BAD_REQUEST, e)); + result.setResultStatus(new ResultStatus(ResultStatus.STATUS.BAD_REQUEST, e)); } return Response.status(result.getStatus().getStatusCode()).entity(getResultSerializer().serialize(result)).build(); http://git-wip-us.apache.org/repos/asf/ambari/blob/c659b9e0/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java index a6ff80b..8ab587b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java ++
[51/71] [abbrv] ambari git commit: AMBARI-21307 AddedLDAP configuration provider for loading and maintaining the LDAP configuration in the application
AMBARI-21307 AddedLDAP configuration provider for loading and maintaining the LDAP configuration in the application Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8bbf83cd Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8bbf83cd Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8bbf83cd Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 8bbf83cd6df3ebc56efc90f1dd7a937af384b44c Parents: 2de3795 Author: lpuskas <lpus...@apache.org> Authored: Tue Aug 29 14:55:09 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:48 2017 +0200 -- .../services/ldap/LdapConfigurationService.java | 1 + .../AmbariConfigurationResourceProvider.java| 35 +- .../ambari/server/events/AmbariEvent.java | 11 +- .../events/AmbariLdapConfigChangedEvent.java| 37 ++ .../server/ldap/LdapConfigurationFactory.java | 2 +- .../apache/ambari/server/ldap/LdapModule.java | 3 + .../AmbariLdapConfigurationProvider.java| 114 +++ .../server/ldap/service/AmbariLdapFacade.java | 7 +- .../server/orm/dao/AmbariConfigurationDAO.java | 48 .../orm/entities/AmbariConfigurationEntity.java | 4 +- .../DefaultLdapConfigurationServiceTest.java| 10 +- 11 files changed, 260 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8bbf83cd/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java index fc6bd41..1b8427b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ldap/LdapConfigurationService.java @@ -82,6 +82,7 @@ public class LdapConfigurationService extends AmbariConfigurationService { @Produces(MediaType.APPLICATION_JSON) public Response validateConfiguration(LdapConfigurationRequest ldapConfigurationRequest) { +// check if the user is authorized to perform the operation authorize(); Set groups = Sets.newHashSet(); http://git-wip-us.apache.org/repos/asf/ambari/blob/8bbf83cd/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java index 2302d8b..4f4cc70 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProvider.java @@ -35,6 +35,9 @@ import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException; import org.apache.ambari.server.controller.spi.SystemException; import org.apache.ambari.server.controller.spi.UnsupportedPropertyException; import org.apache.ambari.server.controller.utilities.PredicateHelper; +import org.apache.ambari.server.events.AmbariEvent; +import org.apache.ambari.server.events.AmbariLdapConfigChangedEvent; +import org.apache.ambari.server.events.publishers.AmbariEventPublisher; import org.apache.ambari.server.orm.dao.AmbariConfigurationDAO; import org.apache.ambari.server.orm.entities.AmbariConfigurationEntity; import org.apache.ambari.server.orm.entities.ConfigurationBaseEntity; @@ -113,6 +116,10 @@ public class AmbariConfigurationResourceProvider extends AbstractAuthorizedResou @Inject private AmbariConfigurationDAO ambariConfigurationDAO; + @Inject + private AmbariEventPublisher publisher; + + private Gson gson; @AssistedInject @@ -142,7 +149,18 @@ public class AmbariConfigurationResourceProvider extends AbstractAuthorizedResou } LOGGER.info("Persisting new ambari configuration: {} ", ambariConfigurationEntity); -ambariConfigurationDAO.create(ambariConfigurationEntity); + +try { + ambariConfigurationDAO.create(ambariConfigurationEntity); +} catch (Exception e) { + LOGGER.error("Failed to create resource", e); + throw new ResourceAlreadyExistsException(e.getMessage()); +} + +// todo filter by configuration type +// notify subscribers about the configuration changes +publisher.publish(n
[58/71] [abbrv] ambari git commit: AMBARI-21307 organized code, fixed build failures
AMBARI-21307 organized code, fixed build failures Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a2926979 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a2926979 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a2926979 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: a29269795a6ba1b54a346d3ef1df6948226746f9 Parents: 02bb25c Author: lpuskas <lpus...@apache.org> Authored: Thu Sep 14 17:58:59 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:50 2017 +0200 -- .../ldap/domain/AmbariLdapConfigKeys.java | 72 .../ldap/domain/AmbariLdapConfiguration.java| 3 - .../ldap/domain/LdapConfigurationFactory.java | 2 +- .../ldap/service/AmbariLdapConfigKeys.java | 72 .../DefaultLdapAttributeDetectionService.java | 2 +- .../domain/AmbariLdapConfigurationTest.java | 19 ++ .../TestAmbariLdapConfigurationFactory.java | 29 ...efaultLdapAttributeDetectionServiceTest.java | 9 ++- .../DefaultLdapConfigurationServiceTest.java| 19 +- 9 files changed, 144 insertions(+), 83 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a2926979/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigKeys.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigKeys.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigKeys.java new file mode 100644 index 000..b7b41a3 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfigKeys.java @@ -0,0 +1,72 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.ldap.domain; + +/** + * Constants representing supported LDAP related property names + * // todo extend this with validation information, description, defaults maybe + */ +public enum AmbariLdapConfigKeys { + + LDAP_ENABLED("ambari.ldap.authentication.enabled"), + SERVER_HOST("ambari.ldap.connectivity.server.host"), + SERVER_PORT("ambari.ldap.connectivity.server.port"), + USE_SSL("ambari.ldap.connectivity.use_ssl"), + + TRUST_STORE("ambari.ldap.connectivity.trust_store"), + TRUST_STORE_TYPE("ambari.ldap.connectivity.trust_store.type"), + TRUST_STORE_PATH("ambari.ldap.connectivity.trust_store.path"), + TRUST_STORE_PASSWORD("ambari.ldap.connectivity.trust_store.password"), + ANONYMOUS_BIND("ambari.ldap.connectivity.anonymous_bind"), + + BIND_DN("ambari.ldap.connectivity.bind_dn"), + BIND_PASSWORD("ambari.ldap.connectivity.bind_password"), + + ATTR_DETECTION("ambari.ldap.attributes.detection"), // manual | auto + + DN_ATTRIBUTE("ambari.ldap.attributes.dn_attr"), + + USER_OBJECT_CLASS("ambari.ldap.attributes.user.object_class"), + USER_NAME_ATTRIBUTE("ambari.ldap.attributes.user.name_attr"), + USER_GROUP_MEMBER_ATTRIBUTE("ambari.ldap.attributes.user.group_member_attr"), + USER_SEARCH_BASE("ambari.ldap.attributes.user.search_base"), + + GROUP_OBJECT_CLASS("ambari.ldap.attributes.group.object_class"), + GROUP_NAME_ATTRIBUTE("ambari.ldap.attributes.group.name_attr"), + GROUP_MEMBER_ATTRIBUTE("ambari.ldap.attributes.group.member_attr"), + GROUP_SEARCH_BASE("ambari.ldap.attributes.group.search_base"), + + USER_SEARCH_FILTER("ambari.ldap.advanced.user_search_filter"), + USER_MEMBER_REPLACE_PATTERN("ambari.ldap.advanced.user_member_replace_pattern"), + USER_MEMBER_FILTER("ambari.ldap.advanced.user_member_filter"), + + GROUP_SEARCH_FILTER("ambari.ldap.advanced.group_search_filter"), + GROUP_MEMBER_REPLACE_PATTERN("ambari.ldap.advanced.group_member_replace_pattern"), + GROUP_MEMBER_FILTER("ambari.ldap.advanced.group_member_filter"), + + FORCE_LOWERCASE_USERNAMES("ambari.ldap.advanced.force_lowercase_usernames"), + REFERRAL_HANDLING("ambari.ldap.advanced.referrals&qu
[13/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/require-js/js/require.min.js -- diff --git a/contrib/views/storm/src/main/resources/libs/require-js/js/require.min.js b/contrib/views/storm/src/main/resources/libs/require-js/js/require.min.js deleted file mode 100644 index a6d55d5..000 --- a/contrib/views/storm/src/main/resources/libs/require-js/js/require.min.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - RequireJS 2.2.0 Copyright jQuery Foundation and other contributors. - Released under MIT license, http://github.com/requirejs/requirejs/LICENSE -*/ -var requirejs,require,define; -(function(ga){function ka(b,c,d,g){return g||""}function K(b){return"[object Function]"===Q.call(b)}function L(b){return"[object Array]"===Q.call(b)}function y(b,c){if(b){var d;for(d=0;d
[34/71] [abbrv] ambari git commit: AMBARI-22299. Storm View: Update Node version for PPC support. (yusaku)
AMBARI-22299. Storm View: Update Node version for PPC support. (yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/655e0a7c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/655e0a7c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/655e0a7c Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 655e0a7c38b45b64c210c7fa7eba1db72c5e0506 Parents: baa1fe6 Author: Yusaku SakoAuthored: Tue Oct 24 12:56:01 2017 -0700 Committer: Yusaku Sako Committed: Tue Oct 24 13:01:50 2017 -0700 -- contrib/views/storm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/655e0a7c/contrib/views/storm/pom.xml -- diff --git a/contrib/views/storm/pom.xml b/contrib/views/storm/pom.xml index c424f45..4a1ff68 100644 --- a/contrib/views/storm/pom.xml +++ b/contrib/views/storm/pom.xml @@ -97,7 +97,7 @@ install-node-and-npm - v5.6.0 + v5.7.0 3.6.0
[71/71] [abbrv] ambari git commit: AMBARI-21307 Added unit tests, fixed logging, typos and code issues
AMBARI-21307 Added unit tests, fixed logging, typos and code issues Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/71dd5a8e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/71dd5a8e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/71dd5a8e Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 71dd5a8e92e408518e8fe9c97dafe8dccd00fc77 Parents: 6c06f5d Author: lpuskas <lpus...@apache.org> Authored: Tue Oct 17 11:33:52 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:52 2017 +0200 -- .../DefaultLdapAttributeDetectionService.java | 58 +++- .../ads/DefaultLdapConnectionConfigService.java | 5 +- .../ads/detectors/AttributeDetectorFactory.java | 26 + .../ads/detectors/ChainedAttributeDetector.java | 7 +++ .../ads/detectors/GroupMemberAttrDetector.java | 6 +- .../ads/detectors/GroupNameAttrDetector.java| 4 +- .../ads/detectors/GroupObjectClassDetector.java | 4 +- .../OccurrenceAndWeightBasedDetector.java | 42 -- .../detectors/UserGroupMemberAttrDetector.java | 4 +- .../ads/detectors/UserNameAttrDetector.java | 6 +- .../ads/detectors/UserObjectClassDetector.java | 6 +- .../server/ldap/LdapModuleFunctionalTest.java | 10 +--- 12 files changed, 122 insertions(+), 56 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/71dd5a8e/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java index ea6e278..25abce7 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapAttributeDetectionService.java @@ -37,10 +37,18 @@ import org.apache.directory.ldap.client.template.LdapConnectionTemplate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * Service implementation that performs user and group attribute detection based on a sample set of entries returned by + * an ldap search operation. A accuracy of detected values may depend on the size of the sample result set + */ @Singleton public class DefaultLdapAttributeDetectionService implements LdapAttributeDetectionService { - private static final Logger LOGGER = LoggerFactory.getLogger(DefaultLdapAttributeDetectionService.class); + private static final Logger LOG = LoggerFactory.getLogger(DefaultLdapAttributeDetectionService.class); + + /** + * The maximum size of the entry set the detection is performed on + */ private static final int SAMPLE_RESULT_SIZE = 50; @Inject @@ -49,46 +57,46 @@ public class DefaultLdapAttributeDetectionService implements LdapAttributeDetect @Inject private LdapConnectionTemplateFactory ldapConnectionTemplateFactory; - @Inject public DefaultLdapAttributeDetectionService() { } @Override public AmbariLdapConfiguration detectLdapUserAttributes(AmbariLdapConfiguration ambariLdapConfiguration) throws AmbariLdapException { -LOGGER.info("Detecting LDAP user attributes ..."); -LdapConnectionTemplate ldapConnectionTemplate = ldapConnectionTemplateFactory.create(ambariLdapConfiguration); -AttributeDetector userAttributDetector = attributeDetectorFactory.userAttributDetector(); +LOG.info("Detecting LDAP user attributes ..."); // perform a search using the user search base if (Strings.isEmpty(ambariLdapConfiguration.userSearchBase())) { - LOGGER.warn("No user search base provided"); + LOG.warn("No user search base provided"); return ambariLdapConfiguration; } try { + LdapConnectionTemplate ldapConnectionTemplate = ldapConnectionTemplateFactory.create(ambariLdapConfiguration); + AttributeDetector userAttributeDetector = attributeDetectorFactory.userAttributDetector(); + SearchRequest searchRequest = assembleUserSearchRequest(ldapConnectionTemplate, ambariLdapConfiguration); // do the search List entries = ldapConnectionTemplate.search(searchRequest, getEntryMapper()); for (Entry entry : entries) { -LOGGER.info("Processing sample entry with dn: [{}]", entry.getDn()); -userAttributDetector.collect(entry); +LOG.info("Collecting user attribute information from the sample entry with dn: [{}]", entry.getDn()); +userAttrib
[64/71] [abbrv] ambari git commit: AMBARI-21307 Added unit test for the LdapFacade
AMBARI-21307 Added unit test for the LdapFacade Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b95f0a14 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b95f0a14 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b95f0a14 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: b95f0a14c3533d7b7c25334fdbec71c9f4d6a7a3 Parents: e981842 Author: lpuskas <lpus...@apache.org> Authored: Thu Oct 12 16:53:31 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:51 2017 +0200 -- .../services/AmbariConfigurationService.java| 2 +- .../ldap/domain/AmbariLdapConfiguration.java| 22 ++ .../server/ldap/service/AmbariLdapFacade.java | 10 +- .../ldap/service/AmbariLdapFacadeTest.java | 215 +++ 4 files changed, 245 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b95f0a14/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java index 492509f..38ae766 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java @@ -150,7 +150,7 @@ public class AmbariConfigurationService extends BaseService { @PUT @Path("{configurationId}") @Produces(MediaType.TEXT_PLAIN) - @ApiOperation(value = "Updates ambari configuration resources - Not implemented yet", + @ApiOperation(value = "Updates ambari configuration resources ", nickname = "AmbariConfigurationService#updateAmbariConfiguration") @ApiImplicitParams({ @ApiImplicitParam(dataType = AMBARI_CONFIGURATION_REQUEST_TYPE, paramType = PARAM_TYPE_BODY), http://git-wip-us.apache.org/repos/asf/ambari/blob/b95f0a14/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfiguration.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfiguration.java index d071ebe..8b26cd3 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfiguration.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/domain/AmbariLdapConfiguration.java @@ -19,6 +19,8 @@ import java.util.Map; import javax.inject.Inject; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -174,4 +176,24 @@ public class AmbariLdapConfiguration { public String toString() { return configurationMap.toString(); } + + @Override + public boolean equals(Object o) { +if (this == o) return true; + +if (o == null || getClass() != o.getClass()) return false; + +AmbariLdapConfiguration that = (AmbariLdapConfiguration) o; + +return new EqualsBuilder() + .append(configurationMap, that.configurationMap) + .isEquals(); + } + + @Override + public int hashCode() { +return new HashCodeBuilder(17, 37) + .append(configurationMap) + .toHashCode(); + } } http://git-wip-us.apache.org/repos/asf/ambari/blob/b95f0a14/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java index c75b0c4..bbfbc8e 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/AmbariLdapFacade.java @@ -33,7 +33,7 @@ public class AmbariLdapFacade implements LdapFacade { /** * Additional parameters expected to be provided along with the configuration */ - private enum Parameters { + protected enum Parameters { TEST_USER_NAME("ambari.ldap.test.user.name"), TEST_USER_PASSWORD("ambari.ldap.test.user.password"); @@ -43,7 +43,7 @@ public class AmbariLdapFacade implements LdapFacade { this.parameterKey = parameterKey; } -private String getParameterKey() { +public String getParameterKey
[29/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Backbone/js/Backbone.js -- diff --git a/contrib/views/storm/src/main/resources/libs/Backbone/js/Backbone.js b/contrib/views/storm/src/main/resources/libs/Backbone/js/Backbone.js deleted file mode 100644 index f246b10..000 --- a/contrib/views/storm/src/main/resources/libs/Backbone/js/Backbone.js +++ /dev/null @@ -1,1920 +0,0 @@ -// Backbone.js 1.3.3 - -// (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Backbone may be freely distributed under the MIT license. -// For all details and documentation: -// http://backbonejs.org - -(function(factory) { - - // Establish the root object, `window` (`self`) in the browser, or `global` on the server. - // We use `self` instead of `window` for `WebWorker` support. - var root = (typeof self == 'object' && self.self === self && self) || -(typeof global == 'object' && global.global === global && global); - - // Set up Backbone appropriately for the environment. Start with AMD. - if (typeof define === 'function' && define.amd) { -define(['underscore', 'jquery', 'exports'], function(_, $, exports) { - // Export global even in AMD case in case this script is loaded with - // others that may still expect a global Backbone. - root.Backbone = factory(root, exports, _, $); -}); - - // Next for Node.js or CommonJS. jQuery may not be needed as a module. - } else if (typeof exports !== 'undefined') { -var _ = require('underscore'), $; -try { $ = require('jquery'); } catch (e) {} -factory(root, exports, _, $); - - // Finally, as a browser global. - } else { -root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$)); - } - -})(function(root, Backbone, _, $) { - - // Initial Setup - // - - - // Save the previous value of the `Backbone` variable, so that it can be - // restored later on, if `noConflict` is used. - var previousBackbone = root.Backbone; - - // Create a local reference to a common array method we'll want to use later. - var slice = Array.prototype.slice; - - // Current version of the library. Keep in sync with `package.json`. - Backbone.VERSION = '1.3.3'; - - // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns - // the `$` variable. - Backbone.$ = $; - - // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable - // to its previous owner. Returns a reference to this Backbone object. - Backbone.noConflict = function() { -root.Backbone = previousBackbone; -return this; - }; - - // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option - // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and - // set a `X-Http-Method-Override` header. - Backbone.emulateHTTP = false; - - // Turn on `emulateJSON` to support legacy servers that can't deal with direct - // `application/json` requests ... this will encode the body as - // `application/x-www-form-urlencoded` instead and will send the model in a - // form param named `model`. - Backbone.emulateJSON = false; - - // Proxy Backbone class methods to Underscore functions, wrapping the model's - // `attributes` object or collection's `models` array behind the scenes. - // - // collection.filter(function(model) { return model.get('age') > 10 }); - // collection.each(this.addView); - // - // `Function#apply` can be slow so we use the method's arg count, if we know it. - var addMethod = function(length, method, attribute) { -switch (length) { - case 1: return function() { -return _[method](this[attribute]); - }; - case 2: return function(value) { -return _[method](this[attribute], value); - }; - case 3: return function(iteratee, context) { -return _[method](this[attribute], cb(iteratee, this), context); - }; - case 4: return function(iteratee, defaultVal, context) { -return _[method](this[attribute], cb(iteratee, this), defaultVal, context); - }; - default: return function() { -var args = slice.call(arguments); -args.unshift(this[attribute]); -return _[method].apply(_, args); - }; -} - }; - var addUnderscoreMethods = function(Class, methods, attribute) { -_.each(methods, function(length, method) { - if (_[method]) Class.prototype[method] = addMethod(length, method, attribute); -}); - }; - - // Support `collection.sortBy('attr')` and `collection.findWhere({id: 1})`. - var cb = function(iteratee, instance) { -if (_.isFunction(iteratee)) return iteratee; -if (_.isObject(iteratee) && !instance._isModel(iteratee)) return modelMatcher(iteratee); -if (_.isString(iteratee)) return function(model) { return
[02/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.svg -- diff --git a/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.svg b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.svg new file mode 100755 index 000..f155876 --- /dev/null +++ b/contrib/views/storm/src/main/resources/ui/app/styles/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + +http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd; > +http://www.w3.org/2000/svg;> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[25/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.svg -- diff --git a/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.svg b/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.svg deleted file mode 100644 index 94fb549..000 --- a/contrib/views/storm/src/main/resources/libs/Bootstrap/fonts/glyphicons-halflings-regular.svg +++ /dev/null @@ -1,288 +0,0 @@ - -http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd; > -http://www.w3.org/2000/svg;> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[15/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/jsx/jsx.js -- diff --git a/contrib/views/storm/src/main/resources/libs/jsx/jsx.js b/contrib/views/storm/src/main/resources/libs/jsx/jsx.js deleted file mode 100644 index 0a72088..000 --- a/contrib/views/storm/src/main/resources/libs/jsx/jsx.js +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @license The MIT License (MIT) - * - * Copyright (c) 2014 Felipe O. Carvalho - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -define(['JSXTransformer', 'text'], function (JSXTransformer, text) { - - 'use strict'; - - var buildMap = {}; - - var jsx = { -version: '0.5.2', - -load: function (name, req, onLoadNative, config) { - var jsxOptions = config.jsx || {}; - var fileExtension = jsxOptions.fileExtension || '.js'; - - var transformOptions = { -harmony: !!jsxOptions.harmony, -stripTypes: !!jsxOptions.stripTypes - }; - - var onLoad = function(content) { -try { - content = JSXTransformer.transform(content, transformOptions).code; -} catch (err) { - onLoadNative.error(err); -} - -if (config.isBuild) { - buildMap[name] = content; -} else if (typeof location !== 'undefined') { // Do not create sourcemap when loaded in Node - content += '\n//# sourceURL=' + location.protocol + '//' + location.hostname + -config.baseUrl + name + fileExtension; -} - -onLoadNative.fromText(content); - }; - - onLoad.error = function(err) { -onLoadNative.error(err); - }; - - text.load(name + fileExtension, req, onLoad, config); -}, - -write: function (pluginName, moduleName, write) { - if (buildMap.hasOwnProperty(moduleName)) { -var content = buildMap[moduleName]; -write.asModule(pluginName + '!' + moduleName, content); - } -} - }; - - return jsx; -}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/react/js/react-dom.js -- diff --git a/contrib/views/storm/src/main/resources/libs/react/js/react-dom.js b/contrib/views/storm/src/main/resources/libs/react/js/react-dom.js deleted file mode 100644 index e9faebd..000 --- a/contrib/views/storm/src/main/resources/libs/react/js/react-dom.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * ReactDOM v0.14.8 - * - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ -// Based off https://github.com/ForbesLindesay/umd/blob/master/template.js -;(function(f) { - // CommonJS - if (typeof exports === "object" && typeof module !== "undefined") { -module.exports = f(require('react')); - - // RequireJS - } else if (typeof define === "function" && define.amd) { -define(['react'], f); - - //
[54/71] [abbrv] ambari git commit: AMBARI-21307 Added the supported ldap properties to the code. Refactored existing code relying on these properties
AMBARI-21307 Added the supported ldap properties to the code. Refactored existing code relying on these properties Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/edabc94f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/edabc94f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/edabc94f Branch: refs/heads/feature-branch-AMBARI-21307 Commit: edabc94f49ffebd0a2cca87803dd549552ea85dc Parents: 90b6b13 Author: lpuskas <lpus...@apache.org> Authored: Fri Sep 8 13:57:25 2017 +0300 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:49 2017 +0200 -- .../server/ldap/AmbariLdapConfiguration.java| 189 --- .../AmbariLdapConfigurationProvider.java| 6 +- .../server/ldap/service/AmbariLdapFacade.java | 10 +- .../service/LdapAttributeDetectionService.java | 43 + .../ambari/server/ldap/service/LdapFacade.java | 2 +- .../ads/DefaultAttributeDetectionService.java | 47 + .../ads/DefaultLdapConfigurationService.java| 4 +- .../ads/DefaultLdapConnectionService.java | 4 +- .../DefaultAttributeDetectionServiceTest.java | 102 ++ .../DefaultLdapConfigurationServiceTest.java| 30 ++- 10 files changed, 348 insertions(+), 89 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/edabc94f/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java index e913e77..76faeed 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java @@ -34,63 +34,67 @@ public class AmbariLdapConfiguration { /** * Constants representing supported LDAP related property names */ - public enum LdapConfigProperty { -LDAP_CONFIGURED("ambari.ldap.configured"), -AUTOMATIC_ATTRIBUTE_DETECTION("ambari.ldap.automatic.attribute.detection"), -USE_SSL("ambari.ldap.usessl"), -LDAP_SERVER_HOST("ambari.ldap.server.host"), -LDAP_SERVER_PORT("ambari.ldap.server.port"), -LDAP_TRUSTSTORE("ambari.ldap.truststore"), -LDAP_TRUSTSTORE_TYPE("ambari.ldap.truststore.type"), -LDAP_TRUSTSTORE_PATH("ambari.ldap.truststore.path"), -LDAP_TRUSTSTORE_PASSWORD("ambari.ldap.truststore.password"), -BASE_DN("ambari.ldap.bind.dn"), -REFERRAL("ambari.ldap.referral"), -PAGINATION_ENABLED("ambari.ldap.pagination.enabled"), - -BIND_ANONIMOUSLY("ambari.ldap.bindanonymously"), -MANAGER_DN("ambari.ldap.managerdn"), -MANAGER_PASSWORD("ambari.ldap.managerpassword"), -USER_OBJECT_CLASS("ambari.ldap.user.object.class"), -USER_NAME_ATTRIBUTE("ambari.ldap.user.name.attribute"), -USER_NAME_FORCE_LOWERCASE("ambari.ldap.username.force.lowercase"), -USER_SEARCH_BASE("ambari.ldap.user.search.base"), - SYNC_USER_MEMBER_REPLACE_PATTERN("ambari.ldap.sync.user.member.replacepattern"), -SYNC_USER_MEMBER_FILTER("ambari.ldap.sync.user.member_filter"), - -ADMIN_GROUP_MAPPING_RULES ("ambari.ldap.admin.group.mappingrules"), -GROUP_OBJECT_CLASS("ambari.ldap.group.object.class"), -GROUP_NAME_ATTRIBUTE("ambari.ldap.group.name.attribute"), -GROUP_MEMBER_ATTRIBUTE("ambari.ldap.group.member.attribute"), -GROUP_SEARCH_BASE("ambari.ldap.group.search.base"), - SYNC_GROUP_MEMBER_REPLACE_PATTERN("ambari.ldap.sync.group.member.replacepattern"), -SYNC_GROUP_MEMBER_FILTER("ambari.ldap.sync.group.member_filter"), -DN_ATTRIBUTE("authentication.ldap.dnAttribute"), - -TEST_USER_NAME("ambari.ldap.test.user.name"), -TEST_USER_PASSWORD("ambari.ldap.test.user.password"); + public enum AmbariLdapConfig { + +LDAP_ENABLED("ambari.ldap.authentication.enabled"), +SERVER_HOST("ambari.ldap.connectivity.server.host"), +SERVER_PORT("ambari.ldap.connectivity.server.port"), +USE_SSL("ambari.ldap.connectivity.use_ssl"), + +TRUST_STORE("ambari.ldap.connectivity.trust_store"), +TRUST_STORE_TYPE("ambari.ldap.connectivity.trust_store.type"), +TRUST_STORE_PATH("ambari.ldap.connectivity.trust_store.path"), +TRUST_STORE_
[66/71] [abbrv] ambari git commit: AMBARI-21307 cleand apache ditectory related dependencies
AMBARI-21307 cleand apache ditectory related dependencies Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e981842b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e981842b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e981842b Branch: refs/heads/feature-branch-AMBARI-21307 Commit: e981842b0a7525b70b3a5b62c4541f18452b232a Parents: 8810151 Author: lpuskas <lpus...@apache.org> Authored: Wed Oct 11 17:54:57 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 26 11:28:51 2017 +0200 -- ambari-funtest/pom.xml | 67 ambari-project/pom.xml | 51 --- ambari-server/pom.xml | 84 - 3 files changed, 14 insertions(+), 188 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e981842b/ambari-funtest/pom.xml -- diff --git a/ambari-funtest/pom.xml b/ambari-funtest/pom.xml index bb2068d..6466af3 100644 --- a/ambari-funtest/pom.xml +++ b/ambari-funtest/pom.xml @@ -197,73 +197,6 @@ spring-ldap-core - org.apache.directory.server - apacheds-server-annotations - test - - - net.sf.ehcache - ehcache-core - - - - - org.apache.directory.server - apacheds-core-integ - test - - - net.sf.ehcache - ehcache-core - - - - - org.apache.directory.server - apacheds-server-integ - test - - - org.apache.directory.server - apacheds-jdbm - test - - - org.apache.directory.server - apacheds-kerberos-codec - - - net.sf.ehcache - ehcache-core - - - - - org.apache.directory.server - apacheds-core - test - - - net.sf.ehcache - ehcache-core - - - - - org.apache.directory.server - apacheds-protocol-ldap - test - - - org.apache.directory.server - kerberos-client - - - org.apache.directory.shared - shared-ldap - test - - org.slf4j slf4j-api 1.7.20 http://git-wip-us.apache.org/repos/asf/ambari/blob/e981842b/ambari-project/pom.xml -- diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml index e4d4423..f6e3bc7 100644 --- a/ambari-project/pom.xml +++ b/ambari-project/pom.xml @@ -162,57 +162,6 @@ 2.0.4.RELEASE -org.apache.directory.server -apacheds-server-annotations -2.0.0-M19 - - -org.apache.directory.server -apacheds-core-integ -2.0.0-M19 - - -org.apache.directory.server -apacheds-server-integ -2.0.0-M19 - - -org.apache.directory.server -apacheds-jdbm -2.0.0-M5 - - -org.apache.directory.server -apacheds-kerberos-codec -2.0.0-M19 - - -org.apache.directory.server -apacheds-core -2.0.0-M19 - - -org.apache.directory.server -kerberos-client -2.0.0-M19 - - -org.apache.directory.server -apacheds-protocol-ldap -2.0.0-M19 - - -org.apache.directory.jdbm -apacheds-jdbm1 - - - - -org.apache.directory.shared -shared-ldap -0.9.17 - - org.slf4j slf4j-api ${slf4j.version} http://git-wip-us.apache.org/repos/asf/ambari/blob/e981842b/ambari-server/pom.xml -- diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml index 8d52821..a86acf5 100644 --- a/ambari-server/pom.xml +++ b/ambari-server/pom.xml @@ -1225,73 +1225,6 @@ spring-ldap-core - org.apache.directory.server - apacheds-server-annotations - test - - - net.sf.ehcache - ehcache-core - - - - - org.apache.directory.server - apacheds-core-integ - test - - - net.sf.ehcache - ehcache-core - - - - - org.apache.directory.server - apacheds-server-integ - test - - - org.apache.directory.server - apacheds-jdbm - test - - - org.apache.directory.server - apacheds-kerberos-codec - - - net.sf.ehcache -
[18/71] [abbrv] ambari git commit: AMBARI-21955. Update React version to 15.6.2 to get MIT license. (Sanket Shah via yusaku)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdede50/contrib/views/storm/src/main/resources/libs/dagre-d3/dagre-d3.min.js -- diff --git a/contrib/views/storm/src/main/resources/libs/dagre-d3/dagre-d3.min.js b/contrib/views/storm/src/main/resources/libs/dagre-d3/dagre-d3.min.js deleted file mode 100644 index b4821d8..000 --- a/contrib/views/storm/src/main/resources/libs/dagre-d3/dagre-d3.min.js +++ /dev/null @@ -1,28 +0,0 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&)define([],t);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.dagreD3=t()}}(function(){var t;return function n(t,e,r){function i(a,u){if(!e[a]){if(!t[a]){var c="function"==typeof require&if(!u&)return c(a,!0);if(o)return o(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var f=e[a]={exports:{}};t[a][0].call(f.exports,function(n){var e=t[a][1][n];return i(e?e:n)},f,f.exports,n,t,e,r)}return e[a].exports}for(var o="function"==typeof require&,a=0;a
ambari git commit: AMBARI-21307 Added unit tests, doumented the code [Forced Update!]
Repository: ambari Updated Branches: refs/heads/feature-branch-AMBARI-21307 403973781 -> 3deab6d18 (forced update) AMBARI-21307 Added unit tests, doumented the code Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3deab6d1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3deab6d1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3deab6d1 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 3deab6d18e4388e0e83be7f6df49cb355fdbe448 Parents: 3f64c09 Author: lpuskas <lpus...@apache.org> Authored: Thu Oct 19 14:41:33 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 19 17:23:58 2017 +0200 -- .../ads/detectors/ChainedAttributeDetector.java | 9 +- .../ads/detectors/GroupMemberAttrDetector.java | 2 +- .../ads/detectors/UserObjectClassDetector.java | 1 - .../server/ldap/LdapModuleFunctionalTest.java | 106 ++ .../detectors/GroupMemberAttrDetectorTest.java | 107 +++ 5 files changed, 151 insertions(+), 74 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/3deab6d1/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/ChainedAttributeDetector.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/ChainedAttributeDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/ChainedAttributeDetector.java index 1fb7a4c..094922b 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/ChainedAttributeDetector.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/ChainedAttributeDetector.java @@ -39,7 +39,7 @@ public class ChainedAttributeDetector implements AttributeDetector { /** * The set of detectors this instance delegates to */ - private Set detectors; + private final Set detectors; @Inject public ChainedAttributeDetector(Set detectors) { @@ -63,4 +63,11 @@ public class ChainedAttributeDetector implements AttributeDetector { } return detectedAttributes; } + + @Override + public String toString() { +return "ChainedAttributeDetector{" + + "detectors=" + detectors + + '}'; + } } http://git-wip-us.apache.org/repos/asf/ambari/blob/3deab6d1/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java index ffe4027..8c34ef8 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/GroupMemberAttrDetector.java @@ -21,7 +21,7 @@ import org.apache.directory.api.ldap.model.entry.Entry; public class GroupMemberAttrDetector extends OccurrenceAndWeightBasedDetector { - private enum GroupMemberAttr { + enum GroupMemberAttr { MEMBER("member", 1), MEMBER_UID("memberUid", 1), http://git-wip-us.apache.org/repos/asf/ambari/blob/3deab6d1/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java index 53aad8b..bf2f5b8 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/detectors/UserObjectClassDetector.java @@ -53,7 +53,6 @@ public class UserObjectClassDetector extends OccurrenceAndWeightBasedDetector { occurrenceMap().put(ocVal.ocVal(), 0); weightsMap().put(ocVal.ocVal(), ocVal.weight()); } - } @Override http://git-wip-us.apache.org/repos/asf/ambari/blob/3deab6d1/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java index 875ce97
[08/46] ambari git commit: AMBARI-22265. Mahout service check failure after patch upgrade (ncole)
AMBARI-22265. Mahout service check failure after patch upgrade (ncole) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/29d11392 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/29d11392 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/29d11392 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 29d1139235ddfa9e21909aa188ef2dcb30014bfb Parents: 84342f6 Author: Nate ColeAuthored: Wed Oct 18 13:34:43 2017 -0400 Committer: Nate Cole Committed: Wed Oct 18 13:34:43 2017 -0400 -- .../resources/stacks/HDP/2.0.6/properties/stack_packages.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/29d11392/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json index b8655d7..20b12a9 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json @@ -1177,7 +1177,8 @@ }, "upgrade-dependencies" : { "YARN": ["TEZ"], - "TEZ": ["YARN"] + "TEZ": ["YARN"], + "MAHOUT": ["MAPREDUCE2"] } } }
[05/46] ambari git commit: Updated team page. (yusaku)
Updated team page. (yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/881e15d8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/881e15d8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/881e15d8 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 881e15d8d5c0ad3718e50e4427b8948c723ac255 Parents: b9f2670 Author: Yusaku SakoAuthored: Tue Oct 17 14:35:15 2017 -0700 Committer: Yusaku Sako Committed: Tue Oct 17 14:35:15 2017 -0700 -- docs/pom.xml | 49 - 1 file changed, 48 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/881e15d8/docs/pom.xml -- diff --git a/docs/pom.xml b/docs/pom.xml index e041002..a75e093 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -196,7 +196,19 @@ Hortonworks - + + +anitajebaraj +Anita Jebaraj +anitajeba...@apache.org + + +Committer + + +IBM + + atkach Andrii Tkach @@ -362,6 +374,17 @@ +dgergely +Daniel Gergely +dgergely ++1 + +Committer + + + + + dillidorai Dilli Dorai dillido...@apache.org @@ -852,6 +875,18 @@ +qin +Qin Liu +q...@apache.org + + +Committer + + +IBM + + + ramya Ramya Sunil ra...@apache.org @@ -1137,6 +1172,18 @@ +vishalsuvagia +Vishal Suvagia +vishalsuva...@apache.org + + +Committer + + +Hortonworks + + + vsairam Venkata Sairam Lanka vsai...@apache.org
[02/46] ambari git commit: AMBARI-22257. Metrics collector fails to stop after Datanode is stopped in distributed mode. (swagle)
AMBARI-22257. Metrics collector fails to stop after Datanode is stopped in distributed mode. (swagle) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/53f028e9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/53f028e9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/53f028e9 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 53f028e92a6a783a161b4540e48484c7ecfaaf44 Parents: 448d6a8 Author: Siddharth WagleAuthored: Tue Oct 17 10:47:43 2017 -0700 Committer: Siddharth Wagle Committed: Tue Oct 17 10:47:43 2017 -0700 -- .../src/main/resources/stacks/HDP/2.0.6/role_command_order.json| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/53f028e9/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json index 31f26e3..78a31f1 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json @@ -56,7 +56,7 @@ "NAMENODE-STOP": ["RESOURCEMANAGER-STOP", "NODEMANAGER-STOP", "HISTORYSERVER-STOP", "HBASE_MASTER-STOP", "METRICS_COLLECTOR-STOP"], "DATANODE-STOP": ["RESOURCEMANAGER-STOP", "NODEMANAGER-STOP", -"HISTORYSERVER-STOP", "HBASE_MASTER-STOP"], +"HISTORYSERVER-STOP", "HBASE_MASTER-STOP", "METRICS_COLLECTOR-STOP"], "METRICS_GRAFANA-START": ["METRICS_COLLECTOR-START"], "METRICS_COLLECTOR-STOP": ["METRICS_GRAFANA-STOP"] },
[32/46] ambari git commit: AMBARI-21307 Implemented more detectors. Organized the code
 AMBARI-21307 Implemented more detectors. Organized the code Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/92f2cc5b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/92f2cc5b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/92f2cc5b Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 92f2cc5b59fdb4efa8c71d4f55b7709d7ec95525 Parents: b05842b Author: lpuskas <lpus...@apache.org> Authored: Tue Sep 12 11:58:45 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 19 14:42:00 2017 +0200 -- .../server/ldap/AmbariLdapConfiguration.java| 1 + .../ads/DefaultAttributeDetectionService.java | 134 ++- .../ldap/service/ads/ObjectClassDetector.java | 81 --- .../ads/OccurranceAndWeightBasedDetector.java | 81 --- .../service/ads/UserNameAttributeDetector.java | 75 --- .../ads/detectors/GroupMemberAttrDetector.java | 56 .../ads/detectors/GroupNameAttrDetector.java| 61 + .../ads/detectors/GroupObjectClassDetector.java | 64 + .../OccurranceAndWeightBasedDetector.java | 103 ++ .../detectors/UserGroupMemberAttrDetector.java | 56 .../ads/detectors/UserNameAttrDetector.java | 60 + .../ads/detectors/UserObjectClassDetector.java | 64 + .../DefaultAttributeDetectionServiceTest.java | 10 +- 13 files changed, 571 insertions(+), 275 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/92f2cc5b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java index e28c6ed..ebb567d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/AmbariLdapConfiguration.java @@ -56,6 +56,7 @@ public class AmbariLdapConfiguration { USER_OBJECT_CLASS("ambari.ldap.attributes.user.object_class"), USER_NAME_ATTRIBUTE("ambari.ldap.attributes.user.name_attr"), + USER_GROUP_MEMBER_ATTRIBUTE("ambari.ldap.attributes.user.group_member_attr"), USER_SEARCH_BASE("ambari.ldap.attributes.user.search_base"), GROUP_OBJECT_CLASS("ambari.ldap.attributes.group.object_class"), http://git-wip-us.apache.org/repos/asf/ambari/blob/92f2cc5b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultAttributeDetectionService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultAttributeDetectionService.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultAttributeDetectionService.java index 710adf1..b3a4fde 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultAttributeDetectionService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultAttributeDetectionService.java @@ -14,15 +14,18 @@ package org.apache.ambari.server.ldap.service.ads; -import java.util.Set; - import javax.inject.Inject; import javax.inject.Singleton; import org.apache.ambari.server.ldap.AmbariLdapConfiguration; import org.apache.ambari.server.ldap.service.AmbariLdapException; -import org.apache.ambari.server.ldap.service.AttributeDetector; import org.apache.ambari.server.ldap.service.LdapAttributeDetectionService; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupMemberAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupNameAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.GroupObjectClassDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserGroupMemberAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserNameAttrDetector; +import org.apache.ambari.server.ldap.service.ads.detectors.UserObjectClassDetector; import org.apache.directory.api.ldap.model.cursor.SearchCursor; import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.api.ldap.model.message.Response; @@ -37,24 +40,29 @@ import org.apache.directory.ldap.client.api.search.FilterBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.collect.Sets; - @Singleton public class DefaultAttributeDetectionService implements LdapAttributeDetectionService { private static final Logger LOGGER = LoggerFactory.getLogger(Defaul
[17/46] ambari git commit: AMBARI-21307 Rest resource for supporting ambari configurations
AMBARI-21307 Rest resource for supporting ambari configurations Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b349538f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b349538f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b349538f Branch: refs/heads/feature-branch-AMBARI-21307 Commit: b349538f9f296750ab333fa308d7550eea85387a Parents: b4eddc9 Author: lpuskas <lpus...@apache.org> Authored: Wed Jul 5 14:20:18 2017 +0200 Committer: lpuskas <lpus...@apache.org> Committed: Thu Oct 19 14:41:56 2017 +0200 -- .../resources/ResourceInstanceFactoryImpl.java | 4 + .../services/AmbariConfigurationService.java| 146 +++ .../internal/AbstractProviderModule.java| 2 +- .../AmbariConfigurationResourceProvider.java| 247 +++ .../internal/DefaultProviderModule.java | 26 +- .../ambari/server/controller/spi/Resource.java | 5 +- .../server/orm/dao/AmbariConfigurationDAO.java | 92 +++ .../orm/entities/AmbariConfigurationEntity.java | 70 ++ .../orm/entities/ConfigurationBaseEntity.java | 159 .../authorization/RoleAuthorization.java| 95 +++ .../resources/Ambari-DDL-Postgres-CREATE.sql| 25 +- .../src/main/resources/META-INF/persistence.xml | 2 + 12 files changed, 809 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b349538f/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java index d0d115d..f5fb6e9 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java @@ -471,6 +471,10 @@ public class ResourceInstanceFactoryImpl implements ResourceInstanceFactory { case RemoteCluster: resourceDefinition = new RemoteClusterResourceDefinition(); break; + case AmbariConfiguration: +resourceDefinition = new SimpleResourceDefinition(Resource.Type.AmbariConfiguration, "ambariconfiguration", "ambariconfigurations"); + +break; default: throw new IllegalArgumentException("Unsupported resource type: " + type); http://git-wip-us.apache.org/repos/asf/ambari/blob/b349538f/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java new file mode 100644 index 000..0fa6e44 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java @@ -0,0 +1,146 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.api.services; + +import java.util.Collections; + +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + +import org.apache.ambari.server.controller.spi.Resource; +import org.apache.http.HttpStatus; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; + +/** + * Rest endpoint for managing ambari configurations. Supports CRUD operations. + * Ambari configurations are resources that relate to the ambari server
1 2 3 4 5 6 7 8 >