-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ALS-4957] Update createLabelsForBins() to properly display single ca…
…tegory [ALS-5228] Update BDC to conditionally obfuscate
- Loading branch information
Showing
6 changed files
with
133 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...ta-sharing-resource/src/main/java/edu/harvard/hms/dbmi/avillach/service/HeaderFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package edu.harvard.hms.dbmi.avillach.service; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import javax.annotation.Priority; | ||
import javax.inject.Inject; | ||
import javax.ws.rs.container.ContainerRequestContext; | ||
import javax.ws.rs.container.ContainerRequestFilter; | ||
import javax.ws.rs.core.MultivaluedMap; | ||
import javax.ws.rs.ext.Provider; | ||
|
||
@Provider | ||
@Priority(1) | ||
public class HeaderFilter implements ContainerRequestFilter { | ||
|
||
@Inject | ||
private RequestScopedHeader headers; | ||
|
||
private final Logger logger = LoggerFactory.getLogger(HeaderFilter.class); | ||
|
||
@Override | ||
public void filter(ContainerRequestContext containerRequestContext) { | ||
if (containerRequestContext.getUriInfo().getPath().startsWith("/aggregate-data-sharing")) { | ||
logger.info("HeaderFilter called for path: /aggregate-data-sharing with headers: " + containerRequestContext.getHeaders().toString()); | ||
MultivaluedMap<String, String> httpHeaders = containerRequestContext.getHeaders(); | ||
headers.setHeaders(httpHeaders); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...ing-resource/src/main/java/edu/harvard/hms/dbmi/avillach/service/RequestScopedHeader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package edu.harvard.hms.dbmi.avillach.service; | ||
|
||
import javax.enterprise.context.RequestScoped; | ||
import javax.ws.rs.core.MultivaluedMap; | ||
|
||
@RequestScoped | ||
public class RequestScopedHeader { | ||
|
||
private MultivaluedMap<String, String> headers; | ||
|
||
public void setHeaders(MultivaluedMap<String, String> headers) { | ||
this.headers = headers; | ||
} | ||
|
||
public MultivaluedMap<String, String> getHeaders() { | ||
return headers; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters