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
13 changes: 7 additions & 6 deletions CedarJava/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,19 @@ repositories {
mavenCentral()
}

configurations {
testCompileOnly.extendsFrom compileOnly
}

dependencies {
// Do not upgrade to Jackson 3.x without addressing stack overflow issues in ValueCedarDeserializer
// The upgrade should be reviewed by AppSec
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.0'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.15.0'
implementation 'org.slf4j:slf4j-api:2.0.7'
implementation 'org.apache.commons:commons-text:1.10.0'
implementation 'com.google.code.findbugs:findbugs:3.0.1'
implementation 'org.apache.logging.log4j:log4j-core:2.20.0'
implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.20.0'
implementation 'com.google.guava:guava:31.0.1-jre'

compileOnly 'com.google.code.findbugs:findbugs:3.0.1'
testImplementation 'org.apache.logging.log4j:log4j-core:2.20.0'
testImplementation 'org.apache.logging.log4j:log4j-to-slf4j:2.20.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.3'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
testImplementation 'org.mockito:mockito-inline:5.2.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
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 @@ -54,10 +53,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 ImmutableSet<String> reason;
private Set<String> reason;

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

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

Expand Down Expand Up @@ -137,7 +136,7 @@ public Set<String> getReasons() {
*
* @return list with errors that happened for a given Request
*/
public java.util.List<String> getErrors() {
public List<String> getErrors() {
return diagnostics.errors;
}

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 = ImmutableList.copyOf(instantiations);
this.instantiations = Collections.unmodifiableList(instantiations);
}

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