You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2017/12/08 10:57:34 UTC
[1/5] kylin git commit: KYLIN-2875 Cube e-mail notification Validation
Repository: kylin
Updated Branches:
refs/heads/master d0c015b82 -> 7e6aa3471
KYLIN-2875 Cube e-mail notification Validation
Signed-off-by: shaofengshi <sh...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/7e6aa347
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/7e6aa347
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/7e6aa347
Branch: refs/heads/master
Commit: 7e6aa347186560ff35b2ac2e2f75860a9ac70cc7
Parents: b8f2292
Author: sanjulian <ju...@hotmail.com>
Authored: Thu Dec 7 18:28:47 2017 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Fri Dec 8 18:57:29 2017 +0800
----------------------------------------------------------------------
core-cube/pom.xml | 4 ++++
.../java/org/apache/kylin/cube/CubeDescManager.java | 1 +
.../java/org/apache/kylin/cube/model/CubeDesc.java | 13 +++++++++++++
.../java/org/apache/kylin/cube/CubeDescTest.java | 15 +++++++++++++++
pom.xml | 6 ++++++
.../apache/kylin/rest/service/CacheServiceTest.java | 2 +-
webapp/app/js/controllers/cube.js | 6 +++++-
7 files changed, 45 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/7e6aa347/core-cube/pom.xml
----------------------------------------------------------------------
diff --git a/core-cube/pom.xml b/core-cube/pom.xml
index 3712f88..2bd1ecd 100644
--- a/core-cube/pom.xml
+++ b/core-cube/pom.xml
@@ -70,6 +70,10 @@
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo-shaded</artifactId>
</dependency>
+ <dependency>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ </dependency>
<!-- Env & Test -->
<dependency>
http://git-wip-us.apache.org/repos/asf/kylin/blob/7e6aa347/core-cube/src/main/java/org/apache/kylin/cube/CubeDescManager.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeDescManager.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeDescManager.java
index b72332c..d522263 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/CubeDescManager.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeDescManager.java
@@ -351,6 +351,7 @@ public class CubeDescManager {
throw new IllegalArgumentException("CubeDesc '" + name + "' does not exist.");
if (desc.isDraft())
throw new IllegalArgumentException("CubeDesc '" + desc.getName() + "' must not be a draft");
+ desc.validateNotifyList();
try {
desc.init(config);
http://git-wip-us.apache.org/repos/asf/kylin/blob/7e6aa347/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
index 87a75da..5ff52c1 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
@@ -44,6 +44,7 @@ import org.apache.commons.codec.binary.Base64;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
+import org.apache.commons.validator.routines.EmailValidator;
import org.apache.kylin.common.KylinConfig;
import org.apache.kylin.common.KylinConfigExt;
import org.apache.kylin.common.KylinVersion;
@@ -817,6 +818,18 @@ public class CubeDesc extends RootPersistentEntity implements IEngineAware {
}
}
+ public void validateNotifyList() {
+ List<String> notifyList = getNotifyList();
+ if (notifyList != null && !notifyList.isEmpty()) {
+ EmailValidator emailValidator = EmailValidator.getInstance();
+ for (String email: notifyList) {
+ if (!emailValidator.isValid(email)) {
+ throw new IllegalArgumentException("Email [" + email + "] is not validation.");
+ }
+ }
+ }
+ }
+
private void getDims(Set<String> dims, String[] stringSet) {
if (stringSet != null) {
for (String str : stringSet) {
http://git-wip-us.apache.org/repos/asf/kylin/blob/7e6aa347/core-cube/src/test/java/org/apache/kylin/cube/CubeDescTest.java
----------------------------------------------------------------------
diff --git a/core-cube/src/test/java/org/apache/kylin/cube/CubeDescTest.java b/core-cube/src/test/java/org/apache/kylin/cube/CubeDescTest.java
index 9f0ae12..9986909 100644
--- a/core-cube/src/test/java/org/apache/kylin/cube/CubeDescTest.java
+++ b/core-cube/src/test/java/org/apache/kylin/cube/CubeDescTest.java
@@ -34,6 +34,7 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeSet;
+import com.google.common.collect.Lists;
import org.apache.kylin.common.util.Array;
import org.apache.kylin.common.util.JsonUtil;
import org.apache.kylin.common.util.LocalFileMetadataTestCase;
@@ -397,6 +398,19 @@ public class CubeDescTest extends LocalFileMetadataTestCase {
}
@Test
+ public void testValidateNotifyList() throws Exception{
+ thrown.expect(IllegalArgumentException.class);
+ thrown.expectMessage("Email [test] is not validation.");
+
+ CubeDesc cubeDesc = CubeDescManager.getInstance(getTestConfig()).getCubeDesc(CUBE_WITH_SLR_DESC);
+ List<String> notify = Lists.newArrayList();
+ notify.add("test");
+ cubeDesc.setNotifyList(notify);
+ cubeDesc.validateNotifyList();
+ cubeDesc.init(getTestConfig());
+ }
+
+ @Test
public void testSerialize() throws Exception {
CubeDesc desc = CubeDescManager.getInstance(getTestConfig()).getCubeDesc(CUBE_WITH_SLR_DESC);
String str = JsonUtil.writeValueAsIndentString(desc);
@@ -493,4 +507,5 @@ public class CubeDescTest extends LocalFileMetadataTestCase {
Assert.assertNotNull(lc);
Assert.assertTrue(lc.getAllCuboids().size() > 0);
}
+
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/7e6aa347/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7a40076..eba302a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -100,6 +100,7 @@
<!-- Commons -->
<commons-lang3.version>3.4</commons-lang3.version>
<commons-email.version>1.5</commons-email.version>
+ <commons-validator.version>1.4.0</commons-validator.version>
<!-- Utility -->
<log4j.version>1.2.17</log4j.version>
@@ -640,6 +641,11 @@
<artifactId>commons-email</artifactId>
<version>${commons-email.version}</version>
</dependency>
+ <dependency>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ <version>${commons-validator.version}</version>
+ </dependency>
<!-- Logging -->
<dependency>
http://git-wip-us.apache.org/repos/asf/kylin/blob/7e6aa347/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java
----------------------------------------------------------------------
diff --git a/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java b/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java
index d56cf6c..ff9e23d 100644
--- a/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java
+++ b/server/src/test/java/org/apache/kylin/rest/service/CacheServiceTest.java
@@ -274,7 +274,7 @@ public class CacheServiceTest extends LocalFileMetadataTestCase {
assertNotNull(cubeDescManager.getCubeDesc(cubeDescName));
assertNotNull(cubeDescManagerB.getCubeDesc(cubeDescName));
- cubeDesc.setNotifyList(Arrays.asList("test@email", "test@email", "test@email"));
+ cubeDesc.setNotifyList(Arrays.asList("test@email.com", "test@email.com", "test@email.com"));
cubeDescManager.updateCubeDesc(cubeDesc);
assertEquals(1, broadcaster.getCounterAndClear());
waitForCounterAndClear(1);
http://git-wip-us.apache.org/repos/asf/kylin/blob/7e6aa347/webapp/app/js/controllers/cube.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cube.js b/webapp/app/js/controllers/cube.js
index 26dddea..c0e5efb 100755
--- a/webapp/app/js/controllers/cube.js
+++ b/webapp/app/js/controllers/cube.js
@@ -69,7 +69,11 @@ KylinApp.controller('CubeCtrl', function ($scope, AccessService, MessageService,
};
$scope.updateNotifyList = function (cube) {
- cube.detail.notify_list = cube.notifyListString.split(",");
+ if (cube.notifyListString.length === 0) {
+ cube.detail.notify_list = [];
+ } else {
+ cube.detail.notify_list = cube.notifyListString.split(",");
+ }
CubeService.updateNotifyList({cubeId: cube.name}, cube.detail.notify_list, function () {
SweetAlert.swal('Success!', 'Notify List updated successfully!', 'success');
},function(e){
[3/5] kylin git commit: KYLIN-2941 Configuration setting for SSO
Posted by sh...@apache.org.
KYLIN-2941 Configuration setting for SSO
Signed-off-by: shaofengshi <sh...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/6b393978
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/6b393978
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/6b393978
Branch: refs/heads/master
Commit: 6b39397859494492a9e9cfe1cc5b2ea83369fbde
Parents: d0c015b
Author: liapan <li...@ebay.com>
Authored: Fri Dec 8 16:17:34 2017 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Fri Dec 8 18:57:29 2017 +0800
----------------------------------------------------------------------
.../src/main/resources/kylin-backward-compatibility.properties | 1 +
core-common/src/main/resources/kylin-defaults.properties | 1 +
examples/test_case_data/localmeta/kylin.properties | 1 +
server/src/main/resources/kylinSecurity.xml | 4 ++--
4 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/6b393978/core-common/src/main/resources/kylin-backward-compatibility.properties
----------------------------------------------------------------------
diff --git a/core-common/src/main/resources/kylin-backward-compatibility.properties b/core-common/src/main/resources/kylin-backward-compatibility.properties
index 66e6e87..687c6a0 100644
--- a/core-common/src/main/resources/kylin-backward-compatibility.properties
+++ b/core-common/src/main/resources/kylin-backward-compatibility.properties
@@ -208,6 +208,7 @@ ldap.service.searchPattern=kylin.security.ldap.service-search-pattern
ldap.service.groupSearchBase=kylin.security.ldap.service-group-search-base
saml.metadata.file=kylin.security.saml.metadata-file
saml.metadata.entityBaseURL=kylin.security.saml.metadata-entity-base-url
+saml.keystore.file=kylin.security.saml.keystore-file
saml.context.scheme=kylin.security.saml.context-scheme
saml.context.serverName=kylin.security.saml.context-server-name
saml.context.serverPort=kylin.security.saml.context-server-port
http://git-wip-us.apache.org/repos/asf/kylin/blob/6b393978/core-common/src/main/resources/kylin-defaults.properties
----------------------------------------------------------------------
diff --git a/core-common/src/main/resources/kylin-defaults.properties b/core-common/src/main/resources/kylin-defaults.properties
index 475deb3..0b2a7a3 100644
--- a/core-common/src/main/resources/kylin-defaults.properties
+++ b/core-common/src/main/resources/kylin-defaults.properties
@@ -234,6 +234,7 @@ kylin.security.ldap.service-group-search-base=
# SAML IDP metadata file location
kylin.security.saml.metadata-file=classpath:sso_metadata.xml
kylin.security.saml.metadata-entity-base-url=https://hostname/kylin
+kylin.security.saml.keystore-file=classpath:samlKeystore.jks
kylin.security.saml.context-scheme=https
kylin.security.saml.context-server-name=hostname
kylin.security.saml.context-server-port=443
http://git-wip-us.apache.org/repos/asf/kylin/blob/6b393978/examples/test_case_data/localmeta/kylin.properties
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/kylin.properties b/examples/test_case_data/localmeta/kylin.properties
index c7dda3f..81c49d4 100644
--- a/examples/test_case_data/localmeta/kylin.properties
+++ b/examples/test_case_data/localmeta/kylin.properties
@@ -115,6 +115,7 @@ kylin.security.ldap.service-group-search-base=
# SAML IDP metadata file location
kylin.security.saml.metadata-file=classpath:sso_metadata.xml
kylin.security.saml.metadata-entity-base-url=https://hostname/kylin
+kylin.security.saml.keystore-file=classpath:samlKeystore.jks
kylin.security.saml.context-scheme=https
kylin.security.saml.context-server-name=hostname
kylin.security.saml.context-server-port=443
http://git-wip-us.apache.org/repos/asf/kylin/blob/6b393978/server/src/main/resources/kylinSecurity.xml
----------------------------------------------------------------------
diff --git a/server/src/main/resources/kylinSecurity.xml b/server/src/main/resources/kylinSecurity.xml
index ca49255..364c487 100644
--- a/server/src/main/resources/kylinSecurity.xml
+++ b/server/src/main/resources/kylinSecurity.xml
@@ -318,7 +318,7 @@
<!-- Central storage of cryptographic keys -->
<bean id="keyManager" class="org.springframework.security.saml.key.JKSKeyManager">
- <constructor-arg value="classpath:samlKeystore.jks"/>
+ <constructor-arg value="${kylin.security.saml.keystore-file}"/>
<constructor-arg type="java.lang.String" value="changeit"/>
<constructor-arg>
<map>
@@ -403,7 +403,7 @@
<constructor-arg>
<bean class="org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider">
<constructor-arg>
- <value type="java.io.File">classpath:sso_metadata.xml</value>
+ <value type="java.io.File">${kylin.security.saml.metadata-file}</value>
</constructor-arg>
<property name="parserPool" ref="parserPool"/>
</bean>
[2/5] kylin git commit: KYLIN-2959 SAML logout issue
Posted by sh...@apache.org.
KYLIN-2959 SAML logout issue
Signed-off-by: shaofengshi <sh...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/e0d8dda5
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/e0d8dda5
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/e0d8dda5
Branch: refs/heads/master
Commit: e0d8dda58819786076d028d4ba0a571dddb8afe9
Parents: 24f7e62
Author: liapan <li...@ebay.com>
Authored: Fri Dec 8 11:36:35 2017 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Fri Dec 8 18:57:29 2017 +0800
----------------------------------------------------------------------
server/src/main/resources/kylinSecurity.xml | 1 -
webapp/app/js/controllers/page.js | 8 +++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/e0d8dda5/server/src/main/resources/kylinSecurity.xml
----------------------------------------------------------------------
diff --git a/server/src/main/resources/kylinSecurity.xml b/server/src/main/resources/kylinSecurity.xml
index 364c487..5887b47 100644
--- a/server/src/main/resources/kylinSecurity.xml
+++ b/server/src/main/resources/kylinSecurity.xml
@@ -358,7 +358,6 @@
<!-- Handler for successful logout -->
<bean id="successLogoutHandler"
class="org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler">
- <property name="defaultTargetUrl" value="/login"/>
</bean>
<!-- Logger for SAML messages and events -->
http://git-wip-us.apache.org/repos/asf/kylin/blob/e0d8dda5/webapp/app/js/controllers/page.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/page.js b/webapp/app/js/controllers/page.js
index 575f455..0b5ded7 100644
--- a/webapp/app/js/controllers/page.js
+++ b/webapp/app/js/controllers/page.js
@@ -50,8 +50,14 @@ KylinApp.controller('PageCtrl', function ($scope, $q, AccessService, $modal, $lo
$scope.logout = function () {
ProjectModel.clear();
$rootScope.userAction.islogout = true;
+ var logoutURL = Config.service.base;
+ if(kylinConfig.getProperty('kylin.security.profile') === 'saml') {
+ logoutURL += 'saml/logout';
+ } else {
+ logoutURL += 'j_spring_security_logout';
+ }
$scope.$emit('event:logoutRequest');
- $http.get(Config.service.base + 'j_spring_security_logout').success(function () {
+ $http.get(logoutURL).success(function () {
UserService.setCurUser({});
$scope.username = $scope.password = null;
$location.path('/login');
[4/5] kylin git commit: KYLIN-2940 List job restful throw NPE when
time filter not set
Posted by sh...@apache.org.
KYLIN-2940 List job restful throw NPE when time filter not set
Signed-off-by: shaofengshi <sh...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/b8f22926
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/b8f22926
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/b8f22926
Branch: refs/heads/master
Commit: b8f2292641ae6d00b207196f6294de36e2a17bd6
Parents: e0d8dda
Author: sanjulian <ju...@hotmail.com>
Authored: Thu Dec 7 14:48:02 2017 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Fri Dec 8 18:57:29 2017 +0800
----------------------------------------------------------------------
.../java/org/apache/kylin/rest/controller/JobController.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/b8f22926/server-base/src/main/java/org/apache/kylin/rest/controller/JobController.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller/JobController.java b/server-base/src/main/java/org/apache/kylin/rest/controller/JobController.java
index 749c872..ca3be99 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/controller/JobController.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/controller/JobController.java
@@ -69,7 +69,10 @@ public class JobController extends BasicController {
}
}
- JobTimeFilterEnum timeFilter = JobTimeFilterEnum.getByCode(jobRequest.getTimeFilter());
+ JobTimeFilterEnum timeFilter = JobTimeFilterEnum.LAST_ONE_WEEK;
+ if (null != jobRequest.getTimeFilter()) {
+ timeFilter = JobTimeFilterEnum.getByCode(jobRequest.getTimeFilter());
+ }
try {
jobInstanceList = jobService.searchJobs(jobRequest.getCubeName(), jobRequest.getProjectName(), statusList,
[5/5] kylin git commit: KYLIN-2953 List readable project not correct
if add limit and offset
Posted by sh...@apache.org.
KYLIN-2953 List readable project not correct if add limit and offset
Signed-off-by: shaofengshi <sh...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/24f7e626
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/24f7e626
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/24f7e626
Branch: refs/heads/master
Commit: 24f7e626e39a93d14aaf6a9783853176790a9f84
Parents: 6b39397
Author: liapan <li...@ebay.com>
Authored: Fri Dec 8 10:48:32 2017 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Fri Dec 8 18:57:29 2017 +0800
----------------------------------------------------------------------
.../kylin/rest/controller/ProjectController.java | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/24f7e626/server-base/src/main/java/org/apache/kylin/rest/controller/ProjectController.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller/ProjectController.java b/server-base/src/main/java/org/apache/kylin/rest/controller/ProjectController.java
index 4bb8e82..21cd9cd 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/controller/ProjectController.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/controller/ProjectController.java
@@ -20,6 +20,7 @@ package org.apache.kylin.rest.controller;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.apache.commons.lang.StringUtils;
@@ -88,7 +89,7 @@ public class ProjectController extends BasicController {
List<ProjectInstance> readableProjects = new ArrayList<ProjectInstance>();
//list all projects first
- List<ProjectInstance> projectInstances = projectService.listAllProjects(limit, offset);
+ List<ProjectInstance> projectInstances = projectService.listAllProjects(null, null);
for (ProjectInstance projectInstance : projectInstances) {
@@ -108,7 +109,18 @@ public class ProjectController extends BasicController {
}
}
- return readableProjects;
+ int projectLimit = (null == limit) ? Integer.MAX_VALUE : limit;
+ int projectOffset = (null == offset) ? 0 : offset;
+
+ if (readableProjects.size() <= projectOffset) {
+ return Collections.emptyList();
+ }
+
+ if ((readableProjects.size() - projectOffset) < projectLimit) {
+ return readableProjects.subList(projectOffset, readableProjects.size());
+ }
+
+ return readableProjects.subList(projectOffset, projectOffset + projectLimit);
}
@RequestMapping(value = "", method = { RequestMethod.POST }, produces = { "application/json" })