From 2a2820905e981f84e9303589d7c4b6d3cab23f0a Mon Sep 17 00:00:00 2001 From: Pranav Ramachandra Date: Mon, 12 Aug 2024 11:37:34 +0100 Subject: [PATCH] Fixed OPA baseUri path --- .../proxy/server/security/opa/OpaS3SecurityFacadeProvider.java | 2 +- .../test/java/io/trino/aws/proxy/server/TestOpaSecurity.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/trino-aws-proxy/src/main/java/io/trino/aws/proxy/server/security/opa/OpaS3SecurityFacadeProvider.java b/trino-aws-proxy/src/main/java/io/trino/aws/proxy/server/security/opa/OpaS3SecurityFacadeProvider.java index 532aab4f..bfa879cf 100644 --- a/trino-aws-proxy/src/main/java/io/trino/aws/proxy/server/security/opa/OpaS3SecurityFacadeProvider.java +++ b/trino-aws-proxy/src/main/java/io/trino/aws/proxy/server/security/opa/OpaS3SecurityFacadeProvider.java @@ -52,7 +52,7 @@ public OpaS3SecurityFacadeProvider(@ForOpa HttpClient httpClient, OpaS3SecurityM { this.httpClient = requireNonNull(httpClient, "httpClient is null"); this.opaS3SecurityMapper = requireNonNull(opaS3SecurityMapper, "opaS3SecurityMapper is null"); - opaServerUri = UriBuilder.fromUri(config.getOpaServerBaseUri()).path("/v1/data").build(); + opaServerUri = UriBuilder.fromUri(config.getOpaServerBaseUri()).build(); } @Override diff --git a/trino-aws-proxy/src/test/java/io/trino/aws/proxy/server/TestOpaSecurity.java b/trino-aws-proxy/src/test/java/io/trino/aws/proxy/server/TestOpaSecurity.java index 076985ab..85b1592b 100644 --- a/trino-aws-proxy/src/test/java/io/trino/aws/proxy/server/TestOpaSecurity.java +++ b/trino-aws-proxy/src/test/java/io/trino/aws/proxy/server/TestOpaSecurity.java @@ -61,7 +61,7 @@ public static class Filter public TestingTrinoAwsProxyServer.Builder filter(TestingTrinoAwsProxyServer.Builder builder) { return builder.withProperty("s3-security.type", OPA_S3_SECURITY_IDENTIFIER) - .withProperty("opa-s3-security.server-base-uri", "http://localhost") + .withProperty("opa-s3-security.server-base-uri", "http://localhost:%s/v1/data") .addModule(binder -> binder.bind(OpaS3SecurityMapper.class).to(OpaMapper.class).in(Scopes.SINGLETON)) .withS3Container() .withOpaContainer();