Skip to content

Commit

Permalink
fix(archives): cannot delete archived recording (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores authored Nov 22, 2023
1 parent 82f8802 commit 1036a16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/main/java/io/cryostat/recordings/RecordingHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.Response.ResponseBuilder;
import jdk.jfr.RecordingState;
import org.apache.commons.codec.binary.Base32;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
Expand Down Expand Up @@ -123,8 +122,6 @@ public class RecordingHelper {
@Inject Clock clock;
@Inject S3Presigner presigner;

@Inject Base32 base32;

@Inject
@Named(Producers.BASE64_URL)
Base64 base64Url;
Expand Down Expand Up @@ -570,10 +567,6 @@ private Optional<Metadata> getArchivedRecordingMetadata(String storageKey) {
}
}

String decodeBase32(String encoded) {
return new String(base32.decode(encoded), StandardCharsets.UTF_8);
}

String decodeBase64(String encoded) {
return new String(base64Url.decode(encoded), StandardCharsets.UTF_8);
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/io/cryostat/recordings/Recordings.java
Original file line number Diff line number Diff line change
Expand Up @@ -721,11 +721,10 @@ public void deleteRecording(@RestPath long targetId, @RestPath long remoteId) th

@DELETE
@Blocking
@Path("/api/beta/fs/recordings/{encodedJvmId}/{filename}")
@Path("/api/beta/fs/recordings/{jvmId}/{filename}")
@RolesAllowed("write")
public void deleteArchivedRecording(@RestPath String encodedJvmId, @RestPath String filename)
public void deleteArchivedRecording(@RestPath String jvmId, @RestPath String filename)
throws Exception {
var jvmId = recordingHelper.decodeBase32(encodedJvmId);
logger.infov("Handling archived recording deletion: {0} / {1}", jvmId, filename);
var metadata =
recordingHelper
Expand Down

0 comments on commit 1036a16

Please sign in to comment.