Skip to content

Commit

Permalink
fix-comments: change opa url
Browse files Browse the repository at this point in the history
  • Loading branch information
gideonsmila committed Dec 22, 2024
1 parent 794d30b commit 2c315f3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ repositories {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
// languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(8)
}
// sources are required by maven central in order to accept the package
withSourcesJar()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/permit/sdk/PermitConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public static class Builder {
// main config vars
private String token;
private String pdp = "http://localhost:7766";
private String opa = "http://localhost:8181/v1/data/permit";
private String opa = "http://localhost:8181";
private String apiUrl = "https://api.permit.io";
private Boolean debugMode = false;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/permit/sdk/enforcement/Enforcer.java
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,8 @@ public UserPermissions getUserPermissionsWithOPA(GetUserPermissionsQuery input)
String requestBody = gson.toJson(outerMap);

RequestBody body = RequestBody.create(requestBody, MediaType.parse("application/json"));

String url = String.format("%s/user_permissions/permissions", this.config.getOpaAddress());
String PERMISSIONS_PATH = "permit/user_permissions/permissions";
String url = String.format("%s/v1/data/%s", this.config.getOpaAddress(), PERMISSIONS_PATH);
Request request = new Request.Builder()
.url(url)
.post(body)
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/permit/sdk/PermitE2ETestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public abstract class PermitE2ETestBase {
public PermitE2ETestBase() {
final String token = System.getenv().getOrDefault("PDP_API_KEY", "");
final String pdpAddress = System.getenv().getOrDefault("PDP_URL", "http://localhost:7766");
final String opaAddress = System.getenv().getOrDefault("OPA_URL", "http://localhost:8181/v1/data/permit");
final String opaAddress = System.getenv().getOrDefault("OPA_URL", "http://localhost:8181");
final String pdpControlPlane = System.getenv().getOrDefault("PDP_CONTROL_PLANE", "https://api.permit.io");

this.config = new PermitConfig.Builder(token)
Expand Down

0 comments on commit 2c315f3

Please sign in to comment.