@Test(expected = AccessDeniedException.class) public void testUserNotInLEA() throws Exception { injector.setEducatorContext(); Mockito.when(mockValidator.validate(eq(EntityNames.EDUCATION_ORGANIZATION), Mockito.any(Set.class))) .thenReturn(Collections.EMPTY_SET); bulkExtract.getEdOrgExtract(CONTEXT, req, "BLEEP"); }
@GET @Path("extract/{edOrgId}") @RightsAllowed({ Right.BULK_EXTRACT }) public Response getEdOrgExtract(@Context HttpContext context, @Context HttpServletRequest request, @PathParam("edOrgId") String edOrgId) { logSecurityEvent("Received request to stream Edorg data"); if (edOrgId == null || edOrgId.isEmpty()) { logSecurityEvent("Failed request to stream edOrg data, missing edOrgId"); throw new IllegalArgumentException("edOrgId cannot be missing"); } validateRequestCertificate(request); validateCanAccessEdOrgExtract(edOrgId); return getEdOrgExtractResponse(context.getRequest(), edOrgId, null); }
BulkExtract { @GET @Path("extract/{edOrgId}") @RightsAllowed({ Right.BULK_EXTRACT }) public Response getEdOrgExtract(@Context HttpContext context, @Context HttpServletRequest request, @PathParam("edOrgId") String edOrgId) { logSecurityEvent("Received request to stream Edorg data"); if (edOrgId == null || edOrgId.isEmpty()) { logSecurityEvent("Failed request to stream edOrg data, missing edOrgId"); throw new IllegalArgumentException("edOrgId cannot be missing"); } validateRequestCertificate(request); validateCanAccessEdOrgExtract(edOrgId); return getEdOrgExtractResponse(context.getRequest(), edOrgId, null); } }
BulkExtract { @GET @Path("extract/{edOrgId}") @RightsAllowed({ Right.BULK_EXTRACT }) public Response getEdOrgExtract(@Context HttpContext context, @Context HttpServletRequest request, @PathParam("edOrgId") String edOrgId) { logSecurityEvent("Received request to stream Edorg data"); if (edOrgId == null || edOrgId.isEmpty()) { logSecurityEvent("Failed request to stream edOrg data, missing edOrgId"); throw new IllegalArgumentException("edOrgId cannot be missing"); } validateRequestCertificate(request); validateCanAccessEdOrgExtract(edOrgId); return getEdOrgExtractResponse(context.getRequest(), edOrgId, null); }  }
BulkExtract { @GET @Path("extract/{edOrgId}") @RightsAllowed({ Right.BULK_EXTRACT }) public Response getEdOrgExtract(@Context HttpContext context, @Context HttpServletRequest request, @PathParam("edOrgId") String edOrgId) { logSecurityEvent("Received request to stream Edorg data"); if (edOrgId == null || edOrgId.isEmpty()) { logSecurityEvent("Failed request to stream edOrg data, missing edOrgId"); throw new IllegalArgumentException("edOrgId cannot be missing"); } validateRequestCertificate(request); validateCanAccessEdOrgExtract(edOrgId); return getEdOrgExtractResponse(context.getRequest(), edOrgId, null); }  @GET @Path("extract") @RightsAllowed({ Right.BULK_EXTRACT }) Response get(@Context HttpServletRequest request); @GET @Path("extract/{edOrgId}") @RightsAllowed({ Right.BULK_EXTRACT }) Response getEdOrgExtract(@Context HttpContext context, @Context HttpServletRequest request, @PathParam("edOrgId") String edOrgId); @GET @Path("extract/public") @RightsAllowed({ Right.BULK_EXTRACT }) Response getPublicExtract(@Context HttpContext context, @Context HttpServletRequest request); @GET @Path("extract/list") @RightsAllowed({ Right.BULK_EXTRACT }) Response getBulkExtractList(@Context HttpServletRequest request, @Context HttpContext context); @GET @Path("extract/{edOrgId}/delta/{date}") @RightsAllowed({ Right.BULK_EXTRACT }) Response getDelta(@Context HttpServletRequest request, @Context HttpContext context,
                             @PathParam("edOrgId") String edOrgId, @PathParam("date") String date); @GET @Path("extract/public/delta/{date}") @RightsAllowed({ Right.BULK_EXTRACT }) Response getPublicDelta(@Context HttpServletRequest request, @Context HttpContext context,
                              @PathParam("date") String date); Repository<Entity> getMongoEntityRepository(); void setMongoEntityRepository(Repository<Entity> mongoEntityRepository); void setEdorgValidator(GenericToEdOrgValidator validator); void setFileResource(FileResource fileResource); }
BulkExtract { @GET @Path("extract/{edOrgId}") @RightsAllowed({ Right.BULK_EXTRACT }) public Response getEdOrgExtract(@Context HttpContext context, @Context HttpServletRequest request, @PathParam("edOrgId") String edOrgId) { logSecurityEvent("Received request to stream Edorg data"); if (edOrgId == null || edOrgId.isEmpty()) { logSecurityEvent("Failed request to stream edOrg data, missing edOrgId"); throw new IllegalArgumentException("edOrgId cannot be missing"); } validateRequestCertificate(request); validateCanAccessEdOrgExtract(edOrgId); return getEdOrgExtractResponse(context.getRequest(), edOrgId, null); }  @GET @Path("extract") @RightsAllowed({ Right.BULK_EXTRACT }) Response get(@Context HttpServletRequest request); @GET @Path("extract/{edOrgId}") @RightsAllowed({ Right.BULK_EXTRACT }) Response getEdOrgExtract(@Context HttpContext context, @Context HttpServletRequest request, @PathParam("edOrgId") String edOrgId); @GET @Path("extract/public") @RightsAllowed({ Right.BULK_EXTRACT }) Response getPublicExtract(@Context HttpContext context, @Context HttpServletRequest request); @GET @Path("extract/list") @RightsAllowed({ Right.BULK_EXTRACT }) Response getBulkExtractList(@Context HttpServletRequest request, @Context HttpContext context); @GET @Path("extract/{edOrgId}/delta/{date}") @RightsAllowed({ Right.BULK_EXTRACT }) Response getDelta(@Context HttpServletRequest request, @Context HttpContext context,
                             @PathParam("edOrgId") String edOrgId, @PathParam("date") String date); @GET @Path("extract/public/delta/{date}") @RightsAllowed({ Right.BULK_EXTRACT }) Response getPublicDelta(@Context HttpServletRequest request, @Context HttpContext context,
                              @PathParam("date") String date); Repository<Entity> getMongoEntityRepository(); void setMongoEntityRepository(Repository<Entity> mongoEntityRepository); void setEdorgValidator(GenericToEdOrgValidator validator); void setFileResource(FileResource fileResource); static final String BULK_EXTRACT_FILES; static final String BULK_EXTRACT_FILE_PATH; static final String BULK_EXTRACT_DATE; static final DateTimeFormatter DATE_TIME_FORMATTER; }