From 5ceb3deefdafd77ce2dba976a5124faa8b7f75f1 Mon Sep 17 00:00:00 2001 From: Ola Aunrønning Date: Fri, 23 Oct 2020 14:09:07 +0200 Subject: Id, not assertionId --- .../com/yahoo/vespa/athenz/client/zms/DefaultZmsClient.java | 2 +- .../vespa/athenz/client/zms/bindings/AssertionEntity.java | 12 +++++++----- .../yahoo/vespa/athenz/client/zms/bindings/PolicyEntity.java | 2 ++ 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'vespa-athenz') diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/DefaultZmsClient.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/DefaultZmsClient.java index 31c9e7839b6..33cb6d7d5d4 100644 --- a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/DefaultZmsClient.java +++ b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/DefaultZmsClient.java @@ -177,7 +177,7 @@ public class DefaultZmsClient extends ClientBase implements ZmsClient { .filter(assertionEntity -> assertionEntity.getAction().equals(action) && assertionEntity.getResource().equals(resourceName.toResourceNameString()) && assertionEntity.getRole().equals(athenzRole.toResourceNameString())) - .mapToInt(AssertionEntity::getAssertionId).findFirst(); + .mapToInt(AssertionEntity::getId).findFirst(); if (assertionId.isEmpty()) { return false; diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/bindings/AssertionEntity.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/bindings/AssertionEntity.java index b181bc7a8c7..824aa3b4606 100644 --- a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/bindings/AssertionEntity.java +++ b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/bindings/AssertionEntity.java @@ -2,6 +2,7 @@ package com.yahoo.vespa.athenz.client.zms.bindings; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -9,12 +10,13 @@ import com.fasterxml.jackson.annotation.JsonProperty; * @author olaa */ @JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) public class AssertionEntity { private final String role; private final String resource; private final String action; - private final Integer assertionId; + private final Integer id; public AssertionEntity(String role, String resource, String action) { @@ -24,11 +26,11 @@ public class AssertionEntity { public AssertionEntity(@JsonProperty("role") String role, @JsonProperty("resource") String resource, @JsonProperty("action") String action, - @JsonProperty("assertionId") Integer assertionId) { + @JsonProperty("id") Integer id) { this.role = role; this.resource = resource; this.action = action; - this.assertionId = assertionId; + this.id = id; } public String getRole() { @@ -44,7 +46,7 @@ public class AssertionEntity { } @JsonIgnore - public int getAssertionId() { - return assertionId; + public int getId() { + return id; } } diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/bindings/PolicyEntity.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/bindings/PolicyEntity.java index 442f9d12c71..ebc0997cb09 100644 --- a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/bindings/PolicyEntity.java +++ b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/bindings/PolicyEntity.java @@ -1,6 +1,7 @@ // Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.athenz.client.zms.bindings; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -9,6 +10,7 @@ import java.util.List; /** * @author olaa */ +@JsonIgnoreProperties(ignoreUnknown = true) public class PolicyEntity { @JsonInclude(JsonInclude.Include.NON_EMPTY) -- cgit v1.2.3