Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ dependencies {

implementation "com.google.guava:guava:30.+"
//implementation "com.googlecode.objectify:objectify:5.1.+"
//implementation 'javax.servlet:javax.servlet-api:3.1.0'
implementation 'javax.servlet:javax.servlet-api:3.1.0'
//implementation "com.google.appengine:appengine-api-1.0-sdk:1.9.+"
implementation "org.scribe:scribe:1.3.+"
//implementation "com.google.code.findbugs:jsr305:3.+"
implementation "com.typesafe.play:play-java_2.11:2.4.8"
implementation "com.typesafe.play:play-cache_2.11:2.4.8"
implementation "com.typesafe.play:play-java_2.11:2.6.10"
implementation "com.typesafe.play:play-cache_2.11:2.6.10"
}

publishing {
Expand All @@ -52,7 +52,7 @@ publishing {
maven(MavenPublication) {
groupId 'com.bardsoftware'
artifactId 'vaxter'
version '2021.06.29'
version 'prj-17'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the version to 2021.08.23 ?


from components.java
}
Expand Down
12 changes: 9 additions & 3 deletions src/com/bardsoftware/server/auth/awsplay/HttpApiImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.google.common.base.Joiner;
import com.google.common.base.MoreObjects;
import com.google.common.collect.Maps;
import play.cache.Cache;
import play.cache.SyncCacheApi;
import play.mvc.Http;
import play.mvc.Http.Request;
import play.mvc.Http.Response;
Expand All @@ -21,6 +21,7 @@
public class HttpApiImpl implements HttpApi {
private static final Logger LOGGER = Logger.getLogger("HttpApiImpl");
private static final String SESSION_ID_KEY = "JSESSIONID";
private static SyncCacheApi ourCache;

private final Request myRequest;
private final Response myResponse;
Expand All @@ -33,6 +34,11 @@ public HttpApiImpl(Http.Request req, Http.Response resp, Http.Session session) {
myResponse = resp;
mySession = session;
}

public static void setup(SyncCacheApi cacheApi) {
ourCache = cacheApi;
}

@Override
public String getRequestUrl() {
String scheme = MoreObjects.firstNonNull(myRequest.getHeader("X-Scheme"), "http");
Expand Down Expand Up @@ -86,7 +92,7 @@ public Object getSessionAttribute(String name) {
return null;
}
String attrKey = sessionId + "." + name;
Object attrVal = Cache.get(attrKey);
Object attrVal = ourCache.get(attrKey);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(String.format("getting attribute: got key=%s value=%s", attrKey, attrVal));
}
Expand All @@ -104,7 +110,7 @@ public void setSessionAttribute(String name, Object object) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(String.format("setting attribute: key=%s value=%s", attrKey, object));
}
Cache.set(attrKey, object);
ourCache.set(attrKey, object);
}

@Override
Expand Down