Skip to content
Merged
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
2 changes: 1 addition & 1 deletion snd/api-src/org/labkey/api/snd/SNDService.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public interface SNDService
@Nullable
static SNDService get()
{
return ServiceRegistry.get(SNDService.class);
return ServiceRegistry.get().getService(SNDService.class);
}

void savePackage(Container c, User u, Package pkg);
Expand Down
8 changes: 8 additions & 0 deletions snprc_ehr/src/org/labkey/snprc_ehr/SNPRC_EHRModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@
import org.labkey.api.query.DetailsURL;
import org.labkey.api.query.QuerySchema;
import org.labkey.api.resource.Resource;
import org.labkey.api.security.SecurityManager;
import org.labkey.api.security.User;
import org.labkey.api.security.permissions.AdminPermission;
import org.labkey.api.security.permissions.UpdatePermission;
import org.labkey.api.security.roles.RoleManager;
import org.labkey.api.settings.OptionalFeatureService;
import org.labkey.api.snd.SNDService;
import org.labkey.api.view.ActionURL;
import org.labkey.api.view.BaseWebPartFactory;
Expand Down Expand Up @@ -147,6 +150,11 @@ protected void init()
@Override
protected void doStartupAfterSpringConfig(ModuleContext moduleContext)
{
// SSRS reports authenticate via the apikey URL parameter. TODO: Remove this once SNPRC has upgraded to 26.11 or later.
OptionalFeatureService ofs = OptionalFeatureService.get();
if (!ofs.isFeatureEnabled(SecurityManager.FEATURE_FLAG_ALLOW_APIKEY_PARAMETER))
ofs.setFeatureEnabled(SecurityManager.FEATURE_FLAG_ALLOW_APIKEY_PARAMETER, true, User.getAdminServiceUser());

EHRService.get().registerModule(this);

// Register the Biocontainment Observations audit log, populated by BiocontainmentObservationsAuditLogTask
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,16 @@
import org.labkey.api.util.DateUtil;
import org.labkey.api.util.FileUtil;
import org.labkey.api.util.MailHelper;
import org.labkey.api.util.PageFlowUtil;
import org.labkey.api.util.UnexpectedException;
import org.labkey.snprc_ehr.SNPRC_EHRModule;

import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
* Created by: jeckels
* Date: 6/29/16
*/
public abstract class AbstractSSRSNotification implements Notification
{
private final String _subject;
Expand Down Expand Up @@ -148,16 +145,16 @@ public MimeMessage createMessage(Container c, User u)
// However, if SSRS is handling the request asynchronously we might need to block, sleep, etc. so it's not
// terminated too early
TransformSession session = SecurityManager.createTransformSession(u);
String ssrsSessionURL = ssrsReportURL + "&" + SecurityManager.TRANSFORM_SESSION_ID + "=" + session.getApiKey();
String ssrsSessionURL = ssrsReportURL + "&" + SecurityManager.API_KEY + "=" + PageFlowUtil.encodeURIComponent(session.getApiKey());

try
{
URI uri = new URI(ssrsSessionURL);
HttpGet request = new HttpGet (uri);
HttpGet request = new HttpGet(uri);

String auth = user + ":" + password;
byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(Charset.forName("ISO-8859-1")));
String authHeader = "Basic " + new String(encodedAuth, "ISO-8859-1");
byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.ISO_8859_1));
String authHeader = "Basic " + new String(encodedAuth, StandardCharsets.ISO_8859_1);
request.setHeader(HttpHeaders.AUTHORIZATION, authHeader);

try (CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse resp = client.execute(request))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface SNPRC_schedulerService
@Nullable
static SNPRC_schedulerService get()
{
return ServiceRegistry.get(SNPRC_schedulerService.class);
return ServiceRegistry.get().getService(SNPRC_schedulerService.class);
}

List<JSONObject> getActiveTimelines(Container c, User u, String ProjectObjectId, BatchValidationException errors);
Expand Down
Loading