summaryrefslogtreecommitdiffstats
path: root/vespa-athenz
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorn.christian@seime.no>2018-08-16 09:43:32 +0200
committerGitHub <noreply@github.com>2018-08-16 09:43:32 +0200
commit424de689dab76cf6f1e0420ae314780e02faf10e (patch)
tree84eb5cdba7f77fe6ab8b43512ab5f29176275a32 /vespa-athenz
parentaf7675d360bb4f1e8552b27cc665540200db59c3 (diff)
parentae4603027438033dd55037e15fc7634122002958 (diff)
Merge pull request #6542 from vespa-engine/bjorncs/remove-wrapped-identity-document
Bjorncs/remove wrapped identity document
Diffstat (limited to 'vespa-athenz')
-rw-r--r--vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/EntityBindingsMapper.java62
-rw-r--r--vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/IdentityDocument.java52
-rw-r--r--vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/SignedIdentityDocument.java29
-rw-r--r--vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/bindings/IdentityDocumentEntity.java73
-rw-r--r--vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/bindings/SignedIdentityDocumentEntity.java46
-rw-r--r--vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/bindings/VespaUniqueInstanceIdEntity.java97
-rw-r--r--vespa-athenz/src/test/java/com/yahoo/vespa/athenz/identityprovider/client/IdentityDocumentSignerTest.java5
7 files changed, 15 insertions, 349 deletions
diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/EntityBindingsMapper.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/EntityBindingsMapper.java
index 641c3001795..956092d7f9b 100644
--- a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/EntityBindingsMapper.java
+++ b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/EntityBindingsMapper.java
@@ -5,9 +5,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.yahoo.vespa.athenz.api.AthenzService;
-import com.yahoo.vespa.athenz.identityprovider.api.bindings.IdentityDocumentEntity;
import com.yahoo.vespa.athenz.identityprovider.api.bindings.SignedIdentityDocumentEntity;
-import com.yahoo.vespa.athenz.identityprovider.api.bindings.VespaUniqueInstanceIdEntity;
import java.io.IOException;
import java.io.UncheckedIOException;
@@ -15,7 +13,6 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
-import java.util.Base64;
import static com.yahoo.vespa.athenz.identityprovider.api.VespaUniqueInstanceId.fromDottedString;
@@ -38,29 +35,12 @@ public class EntityBindingsMapper {
}
}
- public static VespaUniqueInstanceId toVespaUniqueInstanceId(VespaUniqueInstanceIdEntity entity) {
- return new VespaUniqueInstanceId(
- entity.clusterIndex, entity.clusterId, entity.instance, entity.application, entity.tenant, entity.region, entity.environment, entity.type != null ? IdentityType.fromId(entity.type) : null); // TODO Remove support for legacy representation without type
- }
-
- public static IdentityDocument toIdentityDocument(IdentityDocumentEntity entity) {
- return new IdentityDocument(
- toVespaUniqueInstanceId(entity.providerUniqueId),
- entity.configServerHostname,
- entity.instanceHostname,
- entity.createdAt,
- entity.ipAddresses);
- }
-
public static SignedIdentityDocument toSignedIdentityDocument(SignedIdentityDocumentEntity entity) {
return new SignedIdentityDocument(
- entity.identityDocument != null ? toIdentityDocument(entity.identityDocument) : null,
entity.signature,
entity.signingKeyVersion,
fromDottedString(entity.providerUniqueId),
- entity.dnsSuffix,
new AthenzService(entity.providerService),
- entity.ztsEndpoint,
entity.documentVersion,
entity.configServerHostname,
entity.instanceHostname,
@@ -69,42 +49,18 @@ public class EntityBindingsMapper {
entity.identityType != null ? IdentityType.fromId(entity.identityType) : null); // TODO Remove support for legacy representation without type
}
- public static VespaUniqueInstanceIdEntity toVespaUniqueInstanceIdEntity(VespaUniqueInstanceId model) {
- return new VespaUniqueInstanceIdEntity(
- model.tenant(), model.application(), model.environment(), model.region(),
- model.instance(), model.clusterId(), model.clusterIndex(), model.type() != null ? model.type().id() : null); // TODO Remove support for legacy representation without type
- }
-
- public static IdentityDocumentEntity toIdentityDocumentEntity(IdentityDocument model) {
- return new IdentityDocumentEntity(
- toVespaUniqueInstanceIdEntity(model.providerUniqueId()),
+ public static SignedIdentityDocumentEntity toSignedIdentityDocumentEntity(SignedIdentityDocument model) {
+ return new SignedIdentityDocumentEntity(
+ model.signature(),
+ model.signingKeyVersion(),
+ model.providerUniqueId().asDottedString(),
+ model.providerService().getFullName(),
+ model.documentVersion(),
model.configServerHostname(),
model.instanceHostname(),
model.createdAt(),
- model.ipAddresses());
- }
-
- public static SignedIdentityDocumentEntity toSignedIdentityDocumentEntity(SignedIdentityDocument model) {
- try {
- IdentityDocumentEntity identityDocumentEntity = model.identityDocument() != null ? toIdentityDocumentEntity(model.identityDocument()) : null;
- String rawDocument = Base64.getEncoder().encodeToString(mapper.writeValueAsString(identityDocumentEntity).getBytes());
- return new SignedIdentityDocumentEntity(
- rawDocument,
- model.signature(),
- model.signingKeyVersion(),
- model.providerUniqueId().asDottedString(),
- model.dnsSuffix(),
- model.providerService().getFullName(),
- model.ztsEndpoint(),
- model.documentVersion(),
- model.configServerHostname(),
- model.instanceHostname(),
- model.createdAt(),
- model.ipAddresses(),
- model.identityType() != null ? model.identityType().id() : null); // TODO Remove support for legacy representation without type
- } catch (JsonProcessingException e) {
- throw new RuntimeException(e);
- }
+ model.ipAddresses(),
+ model.identityType() != null ? model.identityType().id() : null); // TODO Remove support for legacy representation without type
}
public static SignedIdentityDocument readSignedIdentityDocumentFromFile(Path file) {
diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/IdentityDocument.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/IdentityDocument.java
deleted file mode 100644
index 82d0a3d622c..00000000000
--- a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/IdentityDocument.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.athenz.identityprovider.api;
-
-import java.time.Instant;
-import java.util.Set;
-
-/**
- * The identity document that contains the instance specific information
- *
- * @author bjorncs
- * @deprecated Will soon be inlined into {@link SignedIdentityDocument}
- */
-@Deprecated
-public class IdentityDocument {
- private final VespaUniqueInstanceId providerUniqueId;
- private final String configServerHostname;
- private final String instanceHostname;
- private final Instant createdAt;
- private final Set<String> ipAddresses;
-
- public IdentityDocument(VespaUniqueInstanceId providerUniqueId,
- String configServerHostname,
- String instanceHostname,
- Instant createdAt,
- Set<String> ipAddresses) {
- this.providerUniqueId = providerUniqueId;
- this.configServerHostname = configServerHostname;
- this.instanceHostname = instanceHostname;
- this.createdAt = createdAt;
- this.ipAddresses = ipAddresses;
- }
-
- public VespaUniqueInstanceId providerUniqueId() {
- return providerUniqueId;
- }
-
- public String configServerHostname() {
- return configServerHostname;
- }
-
- public String instanceHostname() {
- return instanceHostname;
- }
-
- public Instant createdAt() {
- return createdAt;
- }
-
- public Set<String> ipAddresses() {
- return ipAddresses;
- }
-}
diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/SignedIdentityDocument.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/SignedIdentityDocument.java
index aa1dbd4dac3..dc5dae9d516 100644
--- a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/SignedIdentityDocument.java
+++ b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/SignedIdentityDocument.java
@@ -3,12 +3,11 @@ package com.yahoo.vespa.athenz.identityprovider.api;
import com.yahoo.vespa.athenz.api.AthenzService;
-import java.net.URI;
import java.time.Instant;
import java.util.Set;
/**
- * A signed identity document which contains a {@link IdentityDocument}
+ * A signed identity document
*
* @author bjorncs
*/
@@ -16,13 +15,10 @@ public class SignedIdentityDocument {
public static final int DEFAULT_KEY_VERSION = 0;
public static final int DEFAULT_DOCUMENT_VERSION = 1;
- private final IdentityDocument identityDocument;
private final String signature;
private final int signingKeyVersion;
private final VespaUniqueInstanceId providerUniqueId;
- private final String dnsSuffix;
private final AthenzService providerService;
- private final URI ztsEndpoint;
private final int documentVersion;
private final String configServerHostname;
private final String instanceHostname;
@@ -30,26 +26,20 @@ public class SignedIdentityDocument {
private final Set<String> ipAddresses;
private final IdentityType identityType;
- public SignedIdentityDocument(IdentityDocument identityDocument,
- String signature,
+ public SignedIdentityDocument(String signature,
int signingKeyVersion,
VespaUniqueInstanceId providerUniqueId,
- String dnsSuffix,
AthenzService providerService,
- URI ztsEndpoint,
int documentVersion,
String configServerHostname,
String instanceHostname,
Instant createdAt,
Set<String> ipAddresses,
IdentityType identityType) {
- this.identityDocument = identityDocument;
this.signature = signature;
this.signingKeyVersion = signingKeyVersion;
this.providerUniqueId = providerUniqueId;
- this.dnsSuffix = dnsSuffix;
this.providerService = providerService;
- this.ztsEndpoint = ztsEndpoint;
this.documentVersion = documentVersion;
this.configServerHostname = configServerHostname;
this.instanceHostname = instanceHostname;
@@ -58,11 +48,6 @@ public class SignedIdentityDocument {
this.identityType = identityType;
}
- @Deprecated
- public IdentityDocument identityDocument() {
- return identityDocument;
- }
-
public String signature() {
return signature;
}
@@ -75,20 +60,10 @@ public class SignedIdentityDocument {
return providerUniqueId;
}
- @Deprecated
- public String dnsSuffix() {
- return dnsSuffix;
- }
-
public AthenzService providerService() {
return providerService;
}
- @Deprecated
- public URI ztsEndpoint() {
- return ztsEndpoint;
- }
-
public int documentVersion() {
return documentVersion;
}
diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/bindings/IdentityDocumentEntity.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/bindings/IdentityDocumentEntity.java
deleted file mode 100644
index b4b2e82ab0e..00000000000
--- a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/bindings/IdentityDocumentEntity.java
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.athenz.identityprovider.api.bindings;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-import java.time.Instant;
-import java.util.Objects;
-import java.util.Set;
-
-/**
- * @author bjorncs
- * @deprecated Will soon be inlined into {@link SignedIdentityDocumentEntity}
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-@Deprecated
-public class IdentityDocumentEntity {
-
- @JsonProperty("provider-unique-id")
- public final VespaUniqueInstanceIdEntity providerUniqueId;
- @JsonProperty("configserver-hostname")
- public final String configServerHostname;
- @JsonProperty("instance-hostname")
- public final String instanceHostname;
- @JsonProperty("created-at")
- public final Instant createdAt;
- @JsonProperty("ip-addresses")
- public final Set<String> ipAddresses;
-
- public IdentityDocumentEntity(
- @JsonProperty("provider-unique-id") VespaUniqueInstanceIdEntity providerUniqueId,
- @JsonProperty("configserver-hostname") String configServerHostname,
- @JsonProperty("instance-hostname") String instanceHostname,
- @JsonProperty("created-at") Instant createdAt,
- @JsonProperty("ip-addresses") Set<String> ipAddresses) {
- this.providerUniqueId = providerUniqueId;
- this.configServerHostname = configServerHostname;
- this.instanceHostname = instanceHostname;
- this.createdAt = createdAt;
- this.ipAddresses = ipAddresses;
- }
-
-
- @Override
- public String toString() {
- return "IdentityDocumentEntity{" +
- "providerUniqueId=" + providerUniqueId +
- ", configServerHostname='" + configServerHostname + '\'' +
- ", instanceHostname='" + instanceHostname + '\'' +
- ", createdAt=" + createdAt +
- ", ipAddresses=" + ipAddresses +
- '}';
- }
-
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- IdentityDocumentEntity that = (IdentityDocumentEntity) o;
- return Objects.equals(providerUniqueId, that.providerUniqueId) &&
- Objects.equals(configServerHostname, that.configServerHostname) &&
- Objects.equals(instanceHostname, that.instanceHostname) &&
- Objects.equals(createdAt, that.createdAt) &&
- Objects.equals(ipAddresses, that.ipAddresses);
- }
-
- @Override
- public int hashCode() {
-
- return Objects.hash(providerUniqueId, configServerHostname, instanceHostname, createdAt, ipAddresses);
- }
-}
diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/bindings/SignedIdentityDocumentEntity.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/bindings/SignedIdentityDocumentEntity.java
index 6f773d51df3..52d33f79c1d 100644
--- a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/bindings/SignedIdentityDocumentEntity.java
+++ b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/bindings/SignedIdentityDocumentEntity.java
@@ -2,17 +2,10 @@
package com.yahoo.vespa.athenz.identityprovider.api.bindings;
import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
-import java.io.IOException;
-import java.io.UncheckedIOException;
-import java.net.URI;
import java.time.Instant;
-import java.util.Base64;
import java.util.Objects;
import java.util.Set;
@@ -22,16 +15,10 @@ import java.util.Set;
@JsonIgnoreProperties(ignoreUnknown = true)
public class SignedIdentityDocumentEntity {
- private static final ObjectMapper mapper = createObjectMapper();
-
- @JsonProperty("identity-document")public final String rawIdentityDocument;
- @JsonIgnore @Deprecated public final IdentityDocumentEntity identityDocument;
@JsonProperty("signature") public final String signature;
@JsonProperty("signing-key-version") public final int signingKeyVersion;
@JsonProperty("provider-unique-id") public final String providerUniqueId; // String representation
- @JsonProperty("dns-suffix") public final String dnsSuffix;
@JsonProperty("provider-service") public final String providerService;
- @JsonProperty("zts-endpoint") public final URI ztsEndpoint;
@JsonProperty("document-version") public final int documentVersion;
@JsonProperty("configserver-hostname") public final String configServerHostname;
@JsonProperty("instance-hostname") public final String instanceHostname;
@@ -40,27 +27,20 @@ public class SignedIdentityDocumentEntity {
@JsonProperty("identity-type") public final String identityType;
@JsonCreator
- public SignedIdentityDocumentEntity(@JsonProperty("identity-document") String rawIdentityDocument,
- @JsonProperty("signature") String signature,
+ public SignedIdentityDocumentEntity(@JsonProperty("signature") String signature,
@JsonProperty("signing-key-version") int signingKeyVersion,
@JsonProperty("provider-unique-id") String providerUniqueId,
- @JsonProperty("dns-suffix") String dnsSuffix,
@JsonProperty("provider-service") String providerService,
- @JsonProperty("zts-endpoint") URI ztsEndpoint,
@JsonProperty("document-version") int documentVersion,
@JsonProperty("configserver-hostname") String configServerHostname,
@JsonProperty("instance-hostname") String instanceHostname,
@JsonProperty("created-at") Instant createdAt,
@JsonProperty("ip-addresses") Set<String> ipAddresses,
@JsonProperty("identity-type") String identityType) {
- this.rawIdentityDocument = rawIdentityDocument;
- this.identityDocument = rawIdentityDocument != null ? parseIdentityDocument(rawIdentityDocument) : null;
this.signature = signature;
this.signingKeyVersion = signingKeyVersion;
this.providerUniqueId = providerUniqueId;
- this.dnsSuffix = dnsSuffix;
this.providerService = providerService;
- this.ztsEndpoint = ztsEndpoint;
this.documentVersion = documentVersion;
this.configServerHostname = configServerHostname;
this.instanceHostname = instanceHostname;
@@ -69,31 +49,13 @@ public class SignedIdentityDocumentEntity {
this.identityType = identityType;
}
- private static IdentityDocumentEntity parseIdentityDocument(String rawIdentityDocument) {
- try {
- return mapper.readValue(Base64.getDecoder().decode(rawIdentityDocument), IdentityDocumentEntity.class);
- } catch (IOException e) {
- throw new UncheckedIOException(e);
- }
- }
-
- private static ObjectMapper createObjectMapper() {
- ObjectMapper mapper = new ObjectMapper();
- mapper.registerModule(new JavaTimeModule());
- return mapper;
- }
-
@Override
public String toString() {
return "SignedIdentityDocumentEntity{" +
- "rawIdentityDocument='" + rawIdentityDocument + '\'' +
- ", identityDocument=" + identityDocument +
", signature='" + signature + '\'' +
", signingKeyVersion=" + signingKeyVersion +
", providerUniqueId='" + providerUniqueId + '\'' +
- ", dnsSuffix='" + dnsSuffix + '\'' +
", providerService='" + providerService + '\'' +
- ", ztsEndpoint=" + ztsEndpoint +
", documentVersion=" + documentVersion +
", configServerHostname='" + configServerHostname + '\'' +
", instanceHostname='" + instanceHostname + '\'' +
@@ -110,13 +72,9 @@ public class SignedIdentityDocumentEntity {
SignedIdentityDocumentEntity that = (SignedIdentityDocumentEntity) o;
return signingKeyVersion == that.signingKeyVersion &&
documentVersion == that.documentVersion &&
- Objects.equals(rawIdentityDocument, that.rawIdentityDocument) &&
- Objects.equals(identityDocument, that.identityDocument) &&
Objects.equals(signature, that.signature) &&
Objects.equals(providerUniqueId, that.providerUniqueId) &&
- Objects.equals(dnsSuffix, that.dnsSuffix) &&
Objects.equals(providerService, that.providerService) &&
- Objects.equals(ztsEndpoint, that.ztsEndpoint) &&
Objects.equals(configServerHostname, that.configServerHostname) &&
Objects.equals(instanceHostname, that.instanceHostname) &&
Objects.equals(createdAt, that.createdAt) &&
@@ -126,6 +84,6 @@ public class SignedIdentityDocumentEntity {
@Override
public int hashCode() {
- return Objects.hash(rawIdentityDocument, identityDocument, signature, signingKeyVersion, providerUniqueId, dnsSuffix, providerService, ztsEndpoint, documentVersion, configServerHostname, instanceHostname, createdAt, ipAddresses, identityType);
+ return Objects.hash(signature, signingKeyVersion, providerUniqueId, providerService, documentVersion, configServerHostname, instanceHostname, createdAt, ipAddresses, identityType);
}
}
diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/bindings/VespaUniqueInstanceIdEntity.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/bindings/VespaUniqueInstanceIdEntity.java
deleted file mode 100644
index 3fdbb49b28e..00000000000
--- a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identityprovider/api/bindings/VespaUniqueInstanceIdEntity.java
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.athenz.identityprovider.api.bindings;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-import java.util.Objects;
-
-/**
- * @author bjorncs
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class VespaUniqueInstanceIdEntity {
-
- @JsonProperty("tenant")
- public final String tenant;
- @JsonProperty("application")
- public final String application;
- @JsonProperty("environment")
- public final String environment;
- @JsonProperty("region")
- public final String region;
- @JsonProperty("instance")
- public final String instance;
- @JsonProperty("cluster-id")
- public final String clusterId;
- @JsonProperty("cluster-index")
- public final int clusterIndex;
- @JsonProperty("type")
- public final String type;
-
- @JsonCreator
- public VespaUniqueInstanceIdEntity(@JsonProperty("tenant") String tenant,
- @JsonProperty("application") String application,
- @JsonProperty("environment") String environment,
- @JsonProperty("region") String region,
- @JsonProperty("instance") String instance,
- @JsonProperty("cluster-id") String clusterId,
- @JsonProperty("cluster-index") int clusterIndex,
- @JsonProperty("type") String type) {
- this.tenant = tenant;
- this.application = application;
- this.environment = environment;
- this.region = region;
- this.instance = instance;
- this.clusterId = clusterId;
- this.clusterIndex = clusterIndex;
- this.type = type;
- }
-
- @Deprecated
- public VespaUniqueInstanceIdEntity(String tenant,
- String application,
- String environment,
- String region,
- String instance,
- String clusterId,
- int clusterIndex) {
- this(tenant, application, environment, region, instance, clusterId, clusterIndex, null);
- }
-
-
- @Override
- public String toString() {
- return "VespaUniqueInstanceIdEntity{" +
- "tenant='" + tenant + '\'' +
- ", application='" + application + '\'' +
- ", environment='" + environment + '\'' +
- ", region='" + region + '\'' +
- ", instance='" + instance + '\'' +
- ", clusterId='" + clusterId + '\'' +
- ", clusterIndex=" + clusterIndex +
- ", type='" + type + '\'' +
- '}';
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- VespaUniqueInstanceIdEntity that = (VespaUniqueInstanceIdEntity) o;
- return clusterIndex == that.clusterIndex &&
- Objects.equals(tenant, that.tenant) &&
- Objects.equals(application, that.application) &&
- Objects.equals(environment, that.environment) &&
- Objects.equals(region, that.region) &&
- Objects.equals(instance, that.instance) &&
- Objects.equals(clusterId, that.clusterId) &&
- Objects.equals(type, that.type);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(tenant, application, environment, region, instance, clusterId, clusterIndex, type);
- }
-}
diff --git a/vespa-athenz/src/test/java/com/yahoo/vespa/athenz/identityprovider/client/IdentityDocumentSignerTest.java b/vespa-athenz/src/test/java/com/yahoo/vespa/athenz/identityprovider/client/IdentityDocumentSignerTest.java
index 9cc500ee241..38483bdbaee 100644
--- a/vespa-athenz/src/test/java/com/yahoo/vespa/athenz/identityprovider/client/IdentityDocumentSignerTest.java
+++ b/vespa-athenz/src/test/java/com/yahoo/vespa/athenz/identityprovider/client/IdentityDocumentSignerTest.java
@@ -9,7 +9,6 @@ import com.yahoo.vespa.athenz.tls.KeyAlgorithm;
import com.yahoo.vespa.athenz.tls.KeyUtils;
import org.junit.Test;
-import java.net.URI;
import java.security.KeyPair;
import java.time.Instant;
import java.util.Arrays;
@@ -18,7 +17,7 @@ import java.util.HashSet;
import static com.yahoo.vespa.athenz.identityprovider.api.IdentityType.TENANT;
import static com.yahoo.vespa.athenz.identityprovider.api.SignedIdentityDocument.DEFAULT_DOCUMENT_VERSION;
import static com.yahoo.vespa.athenz.identityprovider.api.SignedIdentityDocument.DEFAULT_KEY_VERSION;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
/**
* @author bjorncs
@@ -41,7 +40,7 @@ public class IdentityDocumentSignerTest {
signer.generateSignature(id, providerService, configserverHostname, instanceHostname, createdAt, ipAddresses, identityType, keyPair.getPrivate());
SignedIdentityDocument signedIdentityDocument = new SignedIdentityDocument(
- null, signature, DEFAULT_KEY_VERSION, id, "dns-suffix", providerService, URI.create("https://zts"),
+ signature, DEFAULT_KEY_VERSION, id, providerService,
DEFAULT_DOCUMENT_VERSION, configserverHostname, instanceHostname, createdAt, ipAddresses, identityType);
assertTrue(signer.hasValidSignature(signedIdentityDocument, keyPair.getPublic()));