preparations: removed useless endpoint and added security for docker endpoints
This commit is contained in:
parent
3e2ebac614
commit
a8703ca940
@ -1,6 +1,8 @@
|
|||||||
package fr.la_banquise.backend.rest;
|
package fr.la_banquise.backend.rest;
|
||||||
|
|
||||||
import fr.la_banquise.backend.services.DockerService;
|
import fr.la_banquise.backend.services.DockerService;
|
||||||
|
import io.quarkus.security.jpa.Roles;
|
||||||
|
import jakarta.annotation.security.RolesAllowed;
|
||||||
import jakarta.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
import jakarta.ws.rs.*;
|
import jakarta.ws.rs.*;
|
||||||
import jakarta.ws.rs.core.MediaType;
|
import jakarta.ws.rs.core.MediaType;
|
||||||
@ -14,7 +16,7 @@ public class DockerResource {
|
|||||||
|
|
||||||
@Inject DockerService dockerService;
|
@Inject DockerService dockerService;
|
||||||
|
|
||||||
@POST
|
/*@POST
|
||||||
@Path("/nginx")
|
@Path("/nginx")
|
||||||
public Response launchNginx() {
|
public Response launchNginx() {
|
||||||
try {
|
try {
|
||||||
@ -40,9 +42,10 @@ public class DockerResource {
|
|||||||
.entity(Map.of("error", e.getMessage()))
|
.entity(Map.of("error", e.getMessage()))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
|
@RolesAllowed("ROOT")
|
||||||
@Path("/all")
|
@Path("/all")
|
||||||
public Response listContainers() {
|
public Response listContainers() {
|
||||||
try {
|
try {
|
||||||
@ -55,6 +58,7 @@ public class DockerResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
|
@RolesAllowed("ROOT")
|
||||||
@Path("/start")
|
@Path("/start")
|
||||||
public Response start(@QueryParam("id") String id) {
|
public Response start(@QueryParam("id") String id) {
|
||||||
try {
|
try {
|
||||||
@ -69,6 +73,7 @@ public class DockerResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
|
@RolesAllowed("ROOT")
|
||||||
@Path("/stop")
|
@Path("/stop")
|
||||||
public Response stop(@QueryParam("id") String id) {
|
public Response stop(@QueryParam("id") String id) {
|
||||||
try {
|
try {
|
||||||
@ -82,6 +87,7 @@ public class DockerResource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@DELETE
|
@DELETE
|
||||||
|
@RolesAllowed("ROOT")
|
||||||
@Path("/remove")
|
@Path("/remove")
|
||||||
public Response remove(@QueryParam("id") String id) {
|
public Response remove(@QueryParam("id") String id) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user