Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CedarJava/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ dependencies {
implementation 'com.fasterxml.jackson.core:jackson-databind:2.16.1'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.16.1'
implementation 'org.slf4j:slf4j-api:2.0.12'
implementation 'com.google.guava:guava:33.0.0-jre'
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.8.3'
testImplementation 'org.slf4j:slf4j-simple:2.0.12'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
Expand Down
4 changes: 2 additions & 2 deletions CedarJava/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ "$(uname)" == "Darwin" ]; then
else
ffi_lib_str=" environment 'CEDAR_JAVA_FFI_LIB', '"$parent_dir"/CedarJavaFFI/target/debug/libcedar_java_ffi.so'"
fi
sed "85s;.*;$ffi_lib_str;" "build.gradle" > new_build.gradle
sed "83s;.*;$ffi_lib_str;" "build.gradle" > new_build.gradle
mv new_build.gradle build.gradle

# In CI, we need to pull the latest cedar-policy to match the latest cedar-integration-tests
Expand All @@ -23,7 +23,7 @@ mv new_build.gradle build.gradle
# If you call this script with `run_int_tests`, we assume you have `cedar` checkout out in the `cedar-java` dir
if [ "$#" -ne 0 ] && [ "$1" == "run_int_tests" ]; then
integration_tests_str=" environment 'CEDAR_INTEGRATION_TESTS_ROOT', '"$parent_dir"/cedar/cedar-integration-tests'"
sed "84s;.*;$integration_tests_str;" "build.gradle" > new_build.gradle
sed "82s;.*;$integration_tests_str;" "build.gradle" > new_build.gradle
mv new_build.gradle build.gradle

export MUST_RUN_CEDAR_INTEGRATION_TESTS=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;

/**
* The result of processing an AuthorizationRequest. The answer to the request is contained in the
Expand Down Expand Up @@ -53,10 +54,10 @@ public static class Diagnostics {
* Set of policyID's that caused the decision. For example, when a policy evaluates to Deny,
* all deny policies that evaluated to True will appear in Reasons.
*/
private Set<String> reason;
private ImmutableSet<String> reason;

/** Set of errors and warnings returned by Cedar. */
private List<String> errors;
private ImmutableList<String> errors;

/**
* Read the reasons and errors from a JSON object.
Expand All @@ -68,8 +69,8 @@ public static class Diagnostics {
public Diagnostics(
@JsonProperty("reason") Set<String> reason,
@JsonProperty("errors") List<String> errors) {
this.errors = Collections.unmodifiableList(errors);
this.reason = Collections.unmodifiableSet(reason);
this.errors = ImmutableList.copyOf(errors);
this.reason = ImmutableSet.copyOf(reason);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Collections;
import java.util.List;
import com.google.common.collect.ImmutableList;

/** Template instantiation. */
public class TemplateInstantiation {
Expand All @@ -46,7 +46,7 @@ public TemplateInstantiation(
@JsonProperty("instantiations") List<Instantiation> instantiations) {
this.templateId = templateId;
this.resultPolicyId = resultPolicyId;
this.instantiations = Collections.unmodifiableList(instantiations);
this.instantiations = ImmutableList.copyOf(instantiations);
}

/** Get the template ID. */
Expand Down