Skip to content

Commit

Permalink
Merge pull request #312 from OHDSI/release-1.13.0
Browse files Browse the repository at this point in the history
1.13.0 release
  • Loading branch information
konstjar authored Aug 31, 2022
2 parents 7e2f273 + 8ecc640 commit 911c55b
Show file tree
Hide file tree
Showing 28 changed files with 78 additions and 149 deletions.
67 changes: 21 additions & 46 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.odysseusinc.athena</groupId>
<artifactId>athena</artifactId>
<version>1.12.2</version>
<version>1.13.0</version>
<packaging>jar</packaging>


Expand All @@ -21,19 +21,20 @@
<java.version>1.8</java.version>
<jjwt.version>0.9.1</jjwt.version>
<opensaml.version>2.6.6-patched</opensaml.version>
<solr.version>7.7.1</solr.version>
<spring-security-pac4j.version>3.1.0</spring-security-pac4j.version>
<pac4j.version>2.3.1</pac4j.version>
<solr.version>8.11.2</solr.version>
<spring-security-pac4j.version>4.1.0</spring-security-pac4j.version>
<pac4j.version>3.3.0</pac4j.version>
<opencsv.version>3.9</opencsv.version>
<javax.mail.version>1.4</javax.mail.version>
<jakarta.mail.version>1.6.7</jakarta.mail.version>
<dockerImagePrefix>hub.odysseusinc.com</dockerImagePrefix>
<arachne.version>1.16.2</arachne.version>
<arachne.version>1.19.0</arachne.version>
<disruptor.version>3.4.2</disruptor.version>
<commons-lang3.version>3.11</commons-lang3.version>
<build.number>${BUILD_NUMBER}</build.number>
<build.id>${BUILD_TIMESTAMP}</build.id>
<guava.verson>30.1-jre</guava.verson>
<lombok.version>1.18.18</lombok.version>
<postgresql.version>42.2.26</postgresql.version>
</properties>

<profiles>
Expand Down Expand Up @@ -132,6 +133,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jtds</groupId>
Expand Down Expand Up @@ -187,9 +189,9 @@
</dependency>

<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>${javax.mail.version}</version>
<groupId>com.sun.mail</groupId>
<artifactId>jakarta.mail</artifactId>
<version>${jakarta.mail.version}</version>
</dependency>

<dependency>
Expand All @@ -216,6 +218,11 @@
<artifactId>pac4j-jwt</artifactId>
<version>${pac4j.version}</version>
</dependency>
<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-core</artifactId>
<version>${pac4j.version}</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
Expand Down Expand Up @@ -259,6 +266,11 @@
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.4</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -327,43 +339,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<imageName>${dockerImagePrefix}/${project.artifactId}</imageName>
<imageTags>
<imageTag>${project.version}</imageTag>
<imageTag>latest</imageTag>
</imageTags>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<!--<targetPath>/</targetPath>-->
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.${project.packaging}</include>
</resource>
</resources>
<serverId>arachne-hub</serverId>
<registryUrl>https://hub.odysseusinc.com/v2/</registryUrl>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>deploy</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion properties/dev/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ saved.files.storage.days=7
cpt4.dir.v4=/opt/athena/addons/cpt4_4_5
cpt4.dir.v5=/opt/athena/addons/cpt4_5

vocabularies.download.control.files.url=https://github.com/OHDSI/CommonDataModel
vocabularies.download.control.files.url=https://github.com/OHDSI/CommonDataModel/tree/v5.3.1
vocabularies.download.forum.url=http://forums.ohdsi.org/c/implementers
vocabularies.download.umls.url=https://uts.nlm.nih.gov/uts/login

Expand Down
2 changes: 1 addition & 1 deletion properties/prod/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ saved.files.storage.days=7
cpt4.dir.v4=/opt/athena/addons/cpt4_4_5
cpt4.dir.v5=/opt/athena/addons/cpt4_5

vocabularies.download.control.files.url=https://github.com/OHDSI/CommonDataModel
vocabularies.download.control.files.url=https://github.com/OHDSI/CommonDataModel/tree/v5.3.1
vocabularies.download.forum.url=http://forums.ohdsi.org/c/implementers
vocabularies.download.umls.url=https://uts.nlm.nih.gov/uts/login

Expand Down
2 changes: 1 addition & 1 deletion properties/qa/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ saved.files.storage.days=7
cpt4.dir.v4=/opt/athena/addons/cpt4_4_5
cpt4.dir.v5=/opt/athena/addons/cpt4_5

vocabularies.download.control.files.url=https://github.com/OHDSI/CommonDataModel
vocabularies.download.control.files.url=https://github.com/OHDSI/CommonDataModel/tree/v5.3.1
vocabularies.download.forum.url=http://forums.ohdsi.org/c/implementers
vocabularies.download.umls.url=https://uts.nlm.nih.gov/uts/login

Expand Down
4 changes: 2 additions & 2 deletions properties/test/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ spring.mail.properties.mail.smtp.starttls.required=true

athena.url=https://athenatest.odysseusinc.com
athena.mail.notifier=Athena
athena.mail.admin=[email protected],[email protected],gregory.klebanov@odysseusinc.com
athena.mail.admin=admin@admin.com

csv.separator=\t
csv.file.name.searched.concepts=Athena search.csv
Expand All @@ -78,7 +78,7 @@ saved.files.storage.days=7
cpt4.dir.v4=/opt/athena/addons/cpt4_4_5
cpt4.dir.v5=/opt/athena/addons/cpt4_5

vocabularies.download.control.files.url=https://github.com/OHDSI/CommonDataModel
vocabularies.download.control.files.url=https://github.com/OHDSI/CommonDataModel/tree/v5.3.1
vocabularies.download.forum.url=http://forums.ohdsi.org/c/implementers
vocabularies.download.umls.url=https://uts.nlm.nih.gov/uts/login

Expand Down
17 changes: 0 additions & 17 deletions src/main/docker/Dockerfile

This file was deleted.

Binary file removed src/main/docker/cpt4.jar
Binary file not shown.
3 changes: 0 additions & 3 deletions src/main/docker/cpt4_4_5/cpt.bat

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/docker/cpt4_4_5/cpt.sh

This file was deleted.

14 changes: 0 additions & 14 deletions src/main/docker/cpt4_4_5/readme.txt

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/docker/cpt4_5/cpt.bat

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/docker/cpt4_5/cpt.sh

This file was deleted.

14 changes: 0 additions & 14 deletions src/main/docker/cpt4_5/readme.txt

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/docker/run.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private void putIntoJsonFacet(JSONObject jsonFacet, String facetField) {
jsonFacet.put(getFacetLabel(facetField), new JSONObject()
.put("type", "terms")
.put("field", facetField)
.put("limit", 100)
.put("limit", -1)
.put("missing", true)
.put("mincount", 0)
.put("domain",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import com.odysseusinc.athena.model.security.AthenaProfile;
import com.odysseusinc.athena.service.security.RevokedTokenStore;
import com.odysseusinc.athena.util.UserProfileUtil;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
Expand All @@ -39,7 +38,7 @@
import org.pac4j.core.context.session.SessionStore;
import org.pac4j.core.engine.DefaultLogoutLogic;
import org.pac4j.core.exception.HttpAction;
import org.pac4j.core.http.HttpActionAdapter;
import org.pac4j.core.http.adapter.HttpActionAdapter;
import org.pac4j.core.profile.CommonProfile;
import org.pac4j.core.profile.ProfileManager;
import org.pac4j.core.redirect.RedirectAction;
Expand Down Expand Up @@ -88,7 +87,7 @@ public R perform(C context, Config config,
centralLogout = inputCentralLogout;
}

Object sessionAttribute = context.getSessionAttribute(Pac4jConstants.USER_PROFILES);
Object sessionAttribute = context.getSessionStore().get(context, Pac4jConstants.USER_PROFILES);
if (sessionAttribute instanceof Map) {
Map<String, CommonProfile> profileMap = (Map<String, CommonProfile>) sessionAttribute;
profileMap.forEach((k, v) -> {
Expand All @@ -115,9 +114,9 @@ public R perform(C context, Config config,
}
HttpAction action;
if (redirectUrl != null) {
action = HttpAction.redirect("redirect", context, redirectUrl);
action = HttpAction.redirect(context, redirectUrl);
} else {
action = HttpAction.ok("ok", context);
action = HttpAction.ok(context, "ok");
}

// local logout if requested or multiple profiles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,48 +22,51 @@

package com.odysseusinc.athena.config;

import lombok.extern.slf4j.Slf4j;
import org.pac4j.core.client.Client;
import org.pac4j.core.client.Clients;
import org.pac4j.core.config.Config;
import org.pac4j.core.context.WebContext;
import org.pac4j.core.credentials.Credentials;
import org.pac4j.core.engine.CallbackLogic;
import org.pac4j.core.exception.HttpAction;
import org.pac4j.core.http.HttpActionAdapter;
import org.pac4j.core.http.adapter.HttpActionAdapter;
import org.pac4j.core.profile.CommonProfile;
import org.pac4j.core.profile.UserProfile;
import org.pac4j.jwt.profile.JwtGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.pac4j.saml.client.SAML2Client;
import org.springframework.beans.factory.annotation.Value;

@Slf4j
public class CustomPac4jCallbackLogic<R, C extends WebContext> implements CallbackLogic<R, C> {
protected Logger logger = LoggerFactory.getLogger(this.getClass());

@Value("${salt}")
private String salt;

@Value("${athena.async-auth-redirect}")
private String redirectPath;

private JwtGenerator<CommonProfile> jwtGenerator;
private final JwtGenerator<CommonProfile> jwtGenerator;

public CustomPac4jCallbackLogic(JwtGenerator<CommonProfile> jwtGenerator) {
this.jwtGenerator = jwtGenerator;
}

@Override
public R perform(
C context,
Config config,
HttpActionAdapter<R, C> httpActionAdapter,
String inputDefaultUrl,
Boolean inputMultiProfile,
Boolean inputRenewSession) {
Boolean inputRenewSession,
Boolean renewSession,
String clientName
) {

this.logger.debug("=== CALLBACK ===");
log.debug("=== CALLBACK ===");

Clients clients = config.getClients();
Client client = clients.findClient(context);
Client client = clients.findClient(SAML2Client.class);

HttpAction action;
try {
Expand All @@ -72,16 +75,15 @@ public R perform(

String token = jwtGenerator.generate(profile);

logger.debug("jwt: " + token);
log.debug("jwt: " + token);

action = HttpAction.redirect(
"redirect",
context,
redirectPath + "?token=" + token
);
} catch (HttpAction var15) {
this.logger.debug("extra HTTP action required in callback: {}", Integer.valueOf(var15.getCode()));
action = var15;
} catch (HttpAction ex) {
log.debug("extra HTTP action required in callback: {}", Integer.valueOf(ex.getCode()));
action = ex;
}

return httpActionAdapter.adapt(action.getCode(), context);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.odysseusinc.athena.service.impl;

import static org.apache.commons.collections.CollectionUtils.isEmpty;
import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
import static org.apache.commons.collections4.CollectionUtils.isEmpty;
import static org.apache.commons.collections4.CollectionUtils.isNotEmpty;
import static org.apache.commons.lang3.StringUtils.EMPTY;
import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.apache.commons.lang3.StringUtils.remove;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ public static QueryResponse debug(String baseDir, String conceptQueryDir, SolrQu
File fileWithQuery = new File(String.format("%s%s", dir, "query"));
FileUtils.writeStringToFile(fileWithQuery, QueryDebugUtils.getQuery(query.getQuery()), Charset.defaultCharset());

for (Map.Entry<String, String> stringStringEntry : response.getExplainMap().entrySet()) {
for (Map.Entry<String, Object> stringStringEntry : response.getExplainMap().entrySet()) {
String k = stringStringEntry.getKey();
String v = stringStringEntry.getValue();
String v = stringStringEntry.getValue().toString();
File file = new File(dir + org.apache.commons.lang3.StringUtils.substringBetween(v, "\n", "=") + "_" + k);
FileUtils.writeStringToFile(file, v, Charset.defaultCharset());
}
Expand Down
Loading

0 comments on commit 911c55b

Please sign in to comment.