mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-12 02:25:43 +00:00
add jaas config
This commit is contained in:
parent
9d43dc9738
commit
f73635d51b
@ -38,12 +38,4 @@ public class DataTypesViewDao extends BaseViewDao {
|
||||
throw new UnsupportedOperationException("Operation not implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get docs for all field format types
|
||||
*/
|
||||
public Map<String, String> getDocsForAllFieldFormats() throws Exception {
|
||||
throw new UnsupportedOperationException("Operation not implemented");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -144,16 +144,6 @@ public class Dataset extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public static Promise<Result> getFieldFormatDocs() {
|
||||
try {
|
||||
return Promise.promise(() -> ok(
|
||||
Json.newObject().set("fieldFormatDocs", Json.toJson(DATA_TYPES_DAO.getDocsForAllFieldFormats()))));
|
||||
} catch (Exception e) {
|
||||
Logger.error("Fail to get docs of field formats", e);
|
||||
return Promise.promise(() -> notFound(errorResponse(e)));
|
||||
}
|
||||
}
|
||||
|
||||
public static Promise<Result> getDataPlatforms() {
|
||||
try {
|
||||
return Promise.promise(
|
||||
|
||||
@ -33,7 +33,7 @@ public class AuthenticationManager {
|
||||
LoginContext lc = null;
|
||||
// authenticate using the jaas config
|
||||
try {
|
||||
lc = new LoginContext("WH-Authentication", new WHCallbackHandler(userName, password));
|
||||
lc = new LoginContext("WHZ-Authentication", new WHZCallbackHandler(userName, password));
|
||||
} catch (LoginException le) {
|
||||
throw new AuthenticationException(le.toString());
|
||||
} catch (SecurityException se) {
|
||||
@ -47,10 +47,10 @@ public class AuthenticationManager {
|
||||
}
|
||||
}
|
||||
|
||||
private static class WHCallbackHandler implements CallbackHandler {
|
||||
private static class WHZCallbackHandler implements CallbackHandler {
|
||||
private String password = null;
|
||||
private String username = null;
|
||||
private WHCallbackHandler(String username, String password) {
|
||||
private WHZCallbackHandler(String username, String password) {
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
}
|
||||
@ -71,5 +71,6 @@ public class AuthenticationManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -17,11 +17,6 @@ WHZ_ES_DATASET_URL="http://localhost:9200/wherehows/dataset/_search"
|
||||
WHZ_ES_METRIC_URL="http://localhost:9200/wherehows/metric/_search"
|
||||
WHZ_ES_FLOW_URL="http://localhost:9200/wherehows/flow_jobs/_search"
|
||||
|
||||
# LDAP
|
||||
WHZ_LDAP_URL=your_ldap_url
|
||||
WHZ_LDAP_PRINCIPAL_DOMAIN=your_ldap_principal_domain
|
||||
WHZ_LDAP_SEARCH_BASE=your_ldap_search_base
|
||||
|
||||
# Piwik tracking configuration
|
||||
PIWIK_SITE_ID="0000" # change_to_your_piwik_id
|
||||
PIWIK_URL="change_to_your_piwik_url"
|
||||
@ -80,11 +80,6 @@ elasticsearch.dataset.url = ${WHZ_ES_DATASET_URL}
|
||||
elasticsearch.metric.url = ${WHZ_ES_METRIC_URL}
|
||||
elasticsearch.flow.url = ${WHZ_ES_FLOW_URL}
|
||||
|
||||
authentication.ldap.context_factory_class = "com.sun.jndi.ldap.LdapCtxFactory"
|
||||
authentication.ldap.url = ${WHZ_LDAP_URL}
|
||||
authentication.principal.domain = ${WHZ_LDAP_PRINCIPAL_DOMAIN}
|
||||
authentication.ldap.search.base = ${WHZ_LDAP_SEARCH_BASE}
|
||||
|
||||
dataset.hdfs_browser.link = "https://localhost:8888/filebrowser/#"
|
||||
dataset.hdfs_browser.link = ${?YOUR_HDFS_BROWSER_LINK}
|
||||
|
||||
|
||||
9
wherehows-frontend/conf/jaas.conf
Normal file
9
wherehows-frontend/conf/jaas.conf
Normal file
@ -0,0 +1,9 @@
|
||||
WHZ-Authentication {
|
||||
com.sun.security.auth.module.LdapLoginModule sufficient
|
||||
userProvider="<WHZ_LDAP_URL>"
|
||||
authIdentity="{USERNAME}"
|
||||
userFilter="<USER_FILTER>"
|
||||
java.naming.security.authentication="simple"
|
||||
debug="false"
|
||||
useSSL="true";
|
||||
};
|
||||
@ -270,8 +270,6 @@ GET /api/v2/list/platforms
|
||||
|
||||
GET /api/v2/list/compliance-data-types controllers.api.v2.Dataset.getComplianceDataTypes
|
||||
|
||||
GET /api/v2/list/field-format-docs controllers.api.v2.Dataset.getFieldFormatDocs
|
||||
|
||||
GET /api/v2/platforms/:platform/prefix/:prefix controllers.api.v2.Dataset.listSegments(platform: String, prefix: String)
|
||||
|
||||
GET /api/v2/platforms/:platform controllers.api.v2.Dataset.listSegments(platform: String, prefix = "")
|
||||
|
||||
@ -3,6 +3,6 @@ set -a
|
||||
source ./application.env
|
||||
set +a
|
||||
|
||||
export JAVA_OPTS="-Xms512m -Xmx2048m -Dhttp.port=9000"
|
||||
export JAVA_OPTS="-Xms512m -Xmx2048m -Dhttp.port=9000 -Djava.security.auth.login.config=conf/jaas.conf"
|
||||
|
||||
build/stage/wherehows-frontend/bin/playBinary
|
||||
Loading…
x
Reference in New Issue
Block a user