aboutsummaryrefslogtreecommitdiffstats
path: root/container-disc/src/main/java/com/yahoo/container/jdisc/athenz/impl/InstanceIdentity.java
blob: ccb9b12c61ad1e506d0c1959e8089fb86165c04c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.jdisc.athenz.impl;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Map;

/**
 * Used for deserializing response from ZTS
 *
 * @author mortent
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class InstanceIdentity {
    @JsonProperty("attributes") private final Map<String, String> attributes;
    @JsonProperty("provider") private final String provider;
    @JsonProperty("name") private final String name;
    @JsonProperty("instanceId") private final String instanceId;
    @JsonProperty("x509Certificate") private final String x509Certificate;
    @JsonProperty("x509CertificateSigner") private final String x509CertificateSigner;
    @JsonProperty("sshCertificate") private final String sshCertificate;
    @JsonProperty("sshCertificateSigner") private final String sshCertificateSigner;
    @JsonProperty("serviceToken") private final String serviceToken;

    public InstanceIdentity(
            @JsonProperty("attributes") Map<String, String> attributes,
            @JsonProperty("provider") String provider,
            @JsonProperty("name") String name,
            @JsonProperty("instanceId") String instanceId,
            @JsonProperty("x509Certificate") String x509Certificate,
            @JsonProperty("x509CertificateSigner") String x509CertificateSigner,
            @JsonProperty("sshCertificate") String sshCertificate,
            @JsonProperty("sshCertificateSigner") String sshCertificateSigner,
            @JsonProperty("serviceToken") String serviceToken) {
        this.attributes = attributes;
        this.provider = provider;
        this.name = name;
        this.instanceId = instanceId;
        this.x509Certificate = x509Certificate;
        this.x509CertificateSigner = x509CertificateSigner;
        this.sshCertificate = sshCertificate;
        this.sshCertificateSigner = sshCertificateSigner;
        this.serviceToken = serviceToken;
    }

    public String getX509Certificate() {
        return x509Certificate;
    }

    public String getServiceToken() {
        return serviceToken;
    }
}