aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/support/access/SupportAccessGrant.java
blob: ee57f14c71bd8329eddffad63f6e764a037301d0 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.support.access;

import java.security.cert.X509Certificate;
import java.util.Objects;

public class SupportAccessGrant {
    private final String requestor;
    private final X509Certificate certificate;

    public SupportAccessGrant(String requestor, X509Certificate certificate) {
        this.requestor = Objects.requireNonNull(requestor);
        this.certificate = Objects.requireNonNull(certificate);
    }

    public String requestor() {
        return requestor;
    }

    public X509Certificate certificate() {
        return certificate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SupportAccessGrant that = (SupportAccessGrant) o;
        return requestor.equals(that.requestor) && certificate.equals(that.certificate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(requestor, certificate);
    }
}