diff --git a/CedarJava/src/main/java/com/cedarpolicy/model/AuthorizationSuccessResponse.java b/CedarJava/src/main/java/com/cedarpolicy/model/AuthorizationSuccessResponse.java index 0a8f26d3..ee1792a9 100644 --- a/CedarJava/src/main/java/com/cedarpolicy/model/AuthorizationSuccessResponse.java +++ b/CedarJava/src/main/java/com/cedarpolicy/model/AuthorizationSuccessResponse.java @@ -116,6 +116,19 @@ public AuthorizationError( this.policyId = policyId; this.error = error; } + + public String getPolicyId() { + return this.policyId; + } + + public DetailedError getError() { + return this.error; + } + + @Override + public String toString() { + return String.format("AuthorizationError{policyId=%s, error=%s}", policyId, error); + } } /** Result of request evaluation. */ diff --git a/CedarJava/src/main/java/com/cedarpolicy/model/DetailedError.java b/CedarJava/src/main/java/com/cedarpolicy/model/DetailedError.java index 195c86ca..19a0d5fb 100644 --- a/CedarJava/src/main/java/com/cedarpolicy/model/DetailedError.java +++ b/CedarJava/src/main/java/com/cedarpolicy/model/DetailedError.java @@ -105,5 +105,18 @@ public SourceLabel( this.start = start; this.end = end; } + + @Override + public String toString() { + return String.format("SourceLabel{label=\"%s\", start=%s, end=%s}", label.orElse(""), start, end); + } + } + + @Override + public String toString() { + return String.format( + "DetailedError{message=\"%s\", help=\"%s\", code=\"%s\", url=\"%s\", severity=%s, sourcelocations=%s, related=%s}", + message, help.orElse(""), code.orElse(""), url.orElse(""), severity.map(Severity::toString).orElse(""), + sourceLocations, related); } }