use of oasis.names.tc.xacml._3_0.core.schema.wd_17.Status in project core by authzforce.
the class BaseXacmlJsonResultPostprocessor method processClientError.
@Override
public JSONObject processClientError(final IndeterminateEvaluationException error) {
assert maxDepthOfErrorCauseIncludedInResult == 0;
final Status finalStatus = error.getTopLevelStatus();
// FIXME: maxDepthOfErrorCauseIncludedInResult > 0 not supported so far
final JSONObject result = new JSONObject(HashCollections.newImmutableMap("Decision", DecisionType.INDETERMINATE.value(), "Status", toJson(finalStatus)));
return new JSONObject(HashCollections.newImmutableMap("Response", new JSONArray(Collections.singleton(result))));
}
use of oasis.names.tc.xacml._3_0.core.schema.wd_17.Status in project core by authzforce.
the class BaseXacmlJsonResultPostprocessor method toJson.
private static JSONObject toJson(final Status status) {
/*
* Weirdness: StatusCode is optional in XACML/JSON Status although mandatory in XACML/XML Status
*/
final Map<String, Object> statusJsonObject = HashCollections.newUpdatableMap(3);
statusJsonObject.put("StatusCode", toJson(status.getStatusCode()));
final String statusMsg = status.getStatusMessage();
if (statusMsg != null) {
statusJsonObject.put("StatusMessage", statusMsg);
}
final StatusDetail statusDetail = status.getStatusDetail();
assert statusDetail == null;
return new JSONObject(statusJsonObject);
}
use of oasis.names.tc.xacml._3_0.core.schema.wd_17.Status in project yakc by manusa.
the class ServiceLegacyIT method deleteNamespacedService.
@Test
@DisplayName("deleteNamespacedService, should delete existing Service")
void deleteNamespacedService() throws IOException {
// When
// Apparently they have corrected this in the API, it will have different results depending on the target cluster
final Status result = KC.create(CoreV1Api.class).deleteNamespacedService(serviceName, NAMESPACE).get(Status.class);
// Then
assertThat(result).isNotNull().extracting(Status::getStatus).isEqualTo("Success");
}
use of oasis.names.tc.xacml._3_0.core.schema.wd_17.Status in project yakc by manusa.
the class DeploymentIT method deleteNamespacedDeployment.
@Test
@DisplayName("deleteNamespacedDeployment, should delete existing Pod")
void deleteNamespacedDeployment() throws IOException {
// When
final Status result = KC.create(AppsV1Api.class).deleteNamespacedDeployment(deploymentName, NAMESPACE).get();
// Then
assertThat(result).isNotNull().hasFieldOrPropertyWithValue("status", "Success");
}
use of oasis.names.tc.xacml._3_0.core.schema.wd_17.Status in project yakc by manusa.
the class NetworkPolicyIT method deleteNamespacedNetworkPolicy.
@Test
@DisplayName("deleteNamespacedNetworkPolicy, should delete existing NetworkPolicy")
void deleteNamespacedNetworkPolicy() throws IOException {
// When
final Status result = KC.create(NetworkingV1Api.class).deleteNamespacedNetworkPolicy(networkPolicyName, NAMESPACE, DeleteOptions.builder().gracePeriodSeconds(1).build()).get();
// Then
assertThat(result).isNotNull().extracting(Status::getStatus).isEqualTo("Success");
}
Aggregations