summaryrefslogtreecommitdiffstats
path: root/athenz-identity-provider-service
diff options
context:
space:
mode:
authorMorten Tokle <morten.tokle@gmail.com>2018-04-30 10:02:22 +0200
committerGitHub <noreply@github.com>2018-04-30 10:02:22 +0200
commit0e176ef33b0e3fb4278c31d8b0d24b934df5180f (patch)
treee5d70c9b0f3fd7ac8b8aab8197359c13372308fc /athenz-identity-provider-service
parentff2a9d5e6a7ebc24720ddcc0ef5241255669c3c8 (diff)
Revert "Skip sending ipaddresses in CSR"
Diffstat (limited to 'athenz-identity-provider-service')
-rw-r--r--athenz-identity-provider-service/src/main/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/identitydocument/IdentityDocumentGenerator.java2
-rw-r--r--athenz-identity-provider-service/src/test/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/identitydocument/IdentityDocumentGeneratorTest.java25
2 files changed, 1 insertions, 26 deletions
diff --git a/athenz-identity-provider-service/src/main/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/identitydocument/IdentityDocumentGenerator.java b/athenz-identity-provider-service/src/main/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/identitydocument/IdentityDocumentGenerator.java
index 54719aca1aa..a5f143fe50a 100644
--- a/athenz-identity-provider-service/src/main/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/identitydocument/IdentityDocumentGenerator.java
+++ b/athenz-identity-provider-service/src/main/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/identitydocument/IdentityDocumentGenerator.java
@@ -88,7 +88,7 @@ public class IdentityDocumentGenerator {
HostName.getLocalhost(),
node.hostname(),
Instant.now(),
- null);
+ node.ipAddresses());
}
private static String toZoneDnsSuffix(Zone zone, String dnsSuffix) {
diff --git a/athenz-identity-provider-service/src/test/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/identitydocument/IdentityDocumentGeneratorTest.java b/athenz-identity-provider-service/src/test/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/identitydocument/IdentityDocumentGeneratorTest.java
index 74dbc591fc6..4e84fefbe53 100644
--- a/athenz-identity-provider-service/src/test/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/identitydocument/IdentityDocumentGeneratorTest.java
+++ b/athenz-identity-provider-service/src/test/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/identitydocument/IdentityDocumentGeneratorTest.java
@@ -2,9 +2,6 @@
package com.yahoo.vespa.hosted.athenz.instanceproviderservice.identitydocument;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.google.common.collect.ImmutableSet;
import com.yahoo.component.Version;
import com.yahoo.config.provision.ApplicationId;
@@ -17,8 +14,6 @@ import com.yahoo.config.provision.RegionName;
import com.yahoo.config.provision.SystemName;
import com.yahoo.config.provision.TenantName;
import com.yahoo.config.provision.Zone;
-import com.yahoo.vespa.athenz.identityprovider.api.VespaUniqueInstanceId;
-import com.yahoo.vespa.athenz.identityprovider.api.bindings.IdentityDocument;
import com.yahoo.vespa.athenz.identityprovider.api.bindings.ProviderUniqueId;
import com.yahoo.vespa.athenz.identityprovider.api.bindings.SignedIdentityDocument;
import com.yahoo.vespa.hosted.athenz.instanceproviderservice.AutoGeneratedKeyProvider;
@@ -29,17 +24,13 @@ import com.yahoo.vespa.hosted.provision.NodeRepository;
import com.yahoo.vespa.hosted.provision.node.Allocation;
import com.yahoo.vespa.hosted.provision.node.Generation;
import com.yahoo.vespa.hosted.provision.testutils.MockNodeFlavors;
-import org.hamcrest.CoreMatchers;
import org.junit.Test;
-import java.time.Instant;
import java.util.HashSet;
import java.util.Optional;
import static com.yahoo.vespa.hosted.athenz.instanceproviderservice.TestUtils.getAthenzProviderConfig;
-import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
@@ -97,20 +88,4 @@ public class IdentityDocumentGeneratorTest {
signedIdentityDocument.rawIdentityDocument,
signedIdentityDocument.signature));
}
-
- @Test
- public void does_not_include_ipaddresses_field() throws JsonProcessingException {
- IdentityDocument identityDocument = new IdentityDocument(
- ProviderUniqueId.fromVespaUniqueInstanceId(VespaUniqueInstanceId.fromDottedString("1.cluster.instance.application.tenant.region.environment")),
- "cfg",
- "tenanthost",
- Instant.now(),
- null);
-
- ObjectMapper mapper = new ObjectMapper();
- mapper.registerModule(new JavaTimeModule());
- String value = mapper.writeValueAsString(identityDocument);
- System.out.println("value = " + value);
- assertThat(value, not(CoreMatchers.containsString("ip-addresses")));
- }
}