|
|
@ -138,34 +138,38 @@ public class RenderResource { |
|
|
|
@GET |
|
|
|
@GET |
|
|
|
@Path("/signature/{signature}") |
|
|
|
@Path("/signature/{signature}") |
|
|
|
@SecurityRequirement(name = "apiKey") |
|
|
|
@SecurityRequirement(name = "apiKey") |
|
|
|
public HttpServletResponse getIndexBySignature(@PathParam("signature") String signature) { |
|
|
|
public HttpServletResponse getIndexBySignature(@PathParam("signature") String signature, |
|
|
|
|
|
|
|
@QueryParam("theme") String theme) { |
|
|
|
Security.requirePriorAuthorization(request, signature, Service.WEBSITE, null); |
|
|
|
Security.requirePriorAuthorization(request, signature, Service.WEBSITE, null); |
|
|
|
return this.get(signature, ResourceIdType.SIGNATURE, null, "/", null, "/render/signature", true, true); |
|
|
|
return this.get(signature, ResourceIdType.SIGNATURE, null, "/", null, "/render/signature", true, true, theme); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GET |
|
|
|
@GET |
|
|
|
@Path("/signature/{signature}/{path:.*}") |
|
|
|
@Path("/signature/{signature}/{path:.*}") |
|
|
|
@SecurityRequirement(name = "apiKey") |
|
|
|
@SecurityRequirement(name = "apiKey") |
|
|
|
public HttpServletResponse getPathBySignature(@PathParam("signature") String signature, @PathParam("path") String inPath) { |
|
|
|
public HttpServletResponse getPathBySignature(@PathParam("signature") String signature, @PathParam("path") String inPath, |
|
|
|
|
|
|
|
@QueryParam("theme") String theme) { |
|
|
|
Security.requirePriorAuthorization(request, signature, Service.WEBSITE, null); |
|
|
|
Security.requirePriorAuthorization(request, signature, Service.WEBSITE, null); |
|
|
|
return this.get(signature, ResourceIdType.SIGNATURE, null, inPath,null, "/render/signature", true, true); |
|
|
|
return this.get(signature, ResourceIdType.SIGNATURE, null, inPath,null, "/render/signature", true, true, theme); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GET |
|
|
|
@GET |
|
|
|
@Path("/hash/{hash}") |
|
|
|
@Path("/hash/{hash}") |
|
|
|
@SecurityRequirement(name = "apiKey") |
|
|
|
@SecurityRequirement(name = "apiKey") |
|
|
|
public HttpServletResponse getIndexByHash(@PathParam("hash") String hash58, @QueryParam("secret") String secret58) { |
|
|
|
public HttpServletResponse getIndexByHash(@PathParam("hash") String hash58, @QueryParam("secret") String secret58, |
|
|
|
|
|
|
|
@QueryParam("theme") String theme) { |
|
|
|
Security.requirePriorAuthorization(request, hash58, Service.WEBSITE, null); |
|
|
|
Security.requirePriorAuthorization(request, hash58, Service.WEBSITE, null); |
|
|
|
return this.get(hash58, ResourceIdType.FILE_HASH, Service.WEBSITE, "/", secret58, "/render/hash", true, false); |
|
|
|
return this.get(hash58, ResourceIdType.FILE_HASH, Service.WEBSITE, "/", secret58, "/render/hash", true, false, theme); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GET |
|
|
|
@GET |
|
|
|
@Path("/hash/{hash}/{path:.*}") |
|
|
|
@Path("/hash/{hash}/{path:.*}") |
|
|
|
@SecurityRequirement(name = "apiKey") |
|
|
|
@SecurityRequirement(name = "apiKey") |
|
|
|
public HttpServletResponse getPathByHash(@PathParam("hash") String hash58, @PathParam("path") String inPath, |
|
|
|
public HttpServletResponse getPathByHash(@PathParam("hash") String hash58, @PathParam("path") String inPath, |
|
|
|
@QueryParam("secret") String secret58) { |
|
|
|
@QueryParam("secret") String secret58, |
|
|
|
|
|
|
|
@QueryParam("theme") String theme) { |
|
|
|
Security.requirePriorAuthorization(request, hash58, Service.WEBSITE, null); |
|
|
|
Security.requirePriorAuthorization(request, hash58, Service.WEBSITE, null); |
|
|
|
return this.get(hash58, ResourceIdType.FILE_HASH, Service.WEBSITE, inPath, secret58, "/render/hash", true, false); |
|
|
|
return this.get(hash58, ResourceIdType.FILE_HASH, Service.WEBSITE, inPath, secret58, "/render/hash", true, false, theme); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GET |
|
|
|
@GET |
|
|
@ -173,29 +177,35 @@ public class RenderResource { |
|
|
|
@SecurityRequirement(name = "apiKey") |
|
|
|
@SecurityRequirement(name = "apiKey") |
|
|
|
public HttpServletResponse getPathByName(@PathParam("service") Service service, |
|
|
|
public HttpServletResponse getPathByName(@PathParam("service") Service service, |
|
|
|
@PathParam("name") String name, |
|
|
|
@PathParam("name") String name, |
|
|
|
@PathParam("path") String inPath) { |
|
|
|
@PathParam("path") String inPath, |
|
|
|
|
|
|
|
@QueryParam("theme") String theme) { |
|
|
|
Security.requirePriorAuthorization(request, name, service, null); |
|
|
|
Security.requirePriorAuthorization(request, name, service, null); |
|
|
|
String prefix = String.format("/render/%s", service); |
|
|
|
String prefix = String.format("/render/%s", service); |
|
|
|
return this.get(name, ResourceIdType.NAME, service, inPath, null, prefix, true, true); |
|
|
|
return this.get(name, ResourceIdType.NAME, service, inPath, null, prefix, true, true, theme); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GET |
|
|
|
@GET |
|
|
|
@Path("{service}/{name}") |
|
|
|
@Path("{service}/{name}") |
|
|
|
@SecurityRequirement(name = "apiKey") |
|
|
|
@SecurityRequirement(name = "apiKey") |
|
|
|
public HttpServletResponse getIndexByName(@PathParam("service") Service service, |
|
|
|
public HttpServletResponse getIndexByName(@PathParam("service") Service service, |
|
|
|
@PathParam("name") String name) { |
|
|
|
@PathParam("name") String name, |
|
|
|
|
|
|
|
@QueryParam("theme") String theme) { |
|
|
|
Security.requirePriorAuthorization(request, name, service, null); |
|
|
|
Security.requirePriorAuthorization(request, name, service, null); |
|
|
|
String prefix = String.format("/render/%s", service); |
|
|
|
String prefix = String.format("/render/%s", service); |
|
|
|
return this.get(name, ResourceIdType.NAME, service, "/", null, prefix, true, true); |
|
|
|
return this.get(name, ResourceIdType.NAME, service, "/", null, prefix, true, true, theme); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private HttpServletResponse get(String resourceId, ResourceIdType resourceIdType, Service service, String inPath, |
|
|
|
private HttpServletResponse get(String resourceId, ResourceIdType resourceIdType, Service service, String inPath, |
|
|
|
String secret58, String prefix, boolean usePrefix, boolean async) { |
|
|
|
String secret58, String prefix, boolean usePrefix, boolean async, String theme) { |
|
|
|
|
|
|
|
|
|
|
|
ArbitraryDataRenderer renderer = new ArbitraryDataRenderer(resourceId, resourceIdType, service, inPath, |
|
|
|
ArbitraryDataRenderer renderer = new ArbitraryDataRenderer(resourceId, resourceIdType, service, inPath, |
|
|
|
secret58, prefix, usePrefix, async, request, response, context); |
|
|
|
secret58, prefix, usePrefix, async, request, response, context); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (theme != null) { |
|
|
|
|
|
|
|
renderer.setTheme(theme); |
|
|
|
|
|
|
|
} |
|
|
|
return renderer.render(); |
|
|
|
return renderer.render(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|