Skip to content

Commit

Permalink
fix toUni()
Browse files Browse the repository at this point in the history
  • Loading branch information
adutra committed May 30, 2024
1 parent e9228c1 commit 6e8930d
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,16 @@ public Uni<Response> s3sign(
ContentKey key = ContentKey.fromPathString(identifier);
String requestedS3Uri = S3Utils.asS3Location(request.uri());

return collectBasePrefixes(decodedPrefix, key)
return collectLocations(decodedPrefix, key)
.filter(requestedS3Uri::startsWith)
.map(ignored -> doRequestSign(request))
.toUni()
.onItem()
.ifNotNull()
.transform(ignored -> doRequestSign(request))
.replaceIfNullWith(() -> signingRequestDenied(request));
}

private Multi<String> collectBasePrefixes(DecodedPrefix decodedPrefix, ContentKey key)
private Multi<String> collectLocations(DecodedPrefix decodedPrefix, ContentKey key)
throws NessieNotFoundException {

WarehouseConfig warehouse = catalogConfig.getWarehouse(decodedPrefix.warehouse());
Expand Down

0 comments on commit 6e8930d

Please sign in to comment.