From 16389caf12181937f2c4d66f2f62f565e0c5ff12 Mon Sep 17 00:00:00 2001 From: Morten Tokle Date: Tue, 29 Oct 2019 09:37:50 +0100 Subject: Validate register and refresh --- .../api/SignedIdentityDocument.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'vespa-athenz') 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 dc5dae9d516..e5225f2569b 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 @@ -4,6 +4,7 @@ package com.yahoo.vespa.athenz.identityprovider.api; import com.yahoo.vespa.athenz.api.AthenzService; import java.time.Instant; +import java.util.Objects; import java.util.Set; /** @@ -87,4 +88,26 @@ public class SignedIdentityDocument { public IdentityType identityType() { return identityType; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SignedIdentityDocument that = (SignedIdentityDocument) o; + return signingKeyVersion == that.signingKeyVersion && + documentVersion == that.documentVersion && + Objects.equals(signature, that.signature) && + Objects.equals(providerUniqueId, that.providerUniqueId) && + Objects.equals(providerService, that.providerService) && + Objects.equals(configServerHostname, that.configServerHostname) && + Objects.equals(instanceHostname, that.instanceHostname) && + Objects.equals(createdAt, that.createdAt) && + Objects.equals(ipAddresses, that.ipAddresses) && + identityType == that.identityType; + } + + @Override + public int hashCode() { + return Objects.hash(signature, signingKeyVersion, providerUniqueId, providerService, documentVersion, configServerHostname, instanceHostname, createdAt, ipAddresses, identityType); + } } -- cgit v1.2.3