blob: f04e2291ee891e2bf67dd52cdaf7c6081c86dce7 (
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.jdisc;
import com.yahoo.container.di.componentgraph.Provider;
import com.yahoo.container.jdisc.athenz.AthenzIdentityProvider;
import javax.net.ssl.SSLContext;
import java.nio.file.Path;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import java.util.List;
/**
* @author mortent
*/
public class AthenzIdentityProviderProvider implements Provider<AthenzIdentityProvider> {
private static final ThrowingAthenzIdentityProvider instance = new ThrowingAthenzIdentityProvider();
@Override
public AthenzIdentityProvider get() {
return instance;
}
@Override
public void deconstruct() {
}
private static final class ThrowingAthenzIdentityProvider implements AthenzIdentityProvider {
private static final String message = "AthenzIdentityProvider not available";
@Override
public String domain() {
throw new UnsupportedOperationException(message);
}
@Override
public String service() {
throw new UnsupportedOperationException(message);
}
@Override
public SSLContext getIdentitySslContext() {
throw new UnsupportedOperationException(message);
}
@Override
public SSLContext getRoleSslContext(String domain, String role) {
throw new UnsupportedOperationException(message);
}
@Override
public String getRoleToken(String domain) {
throw new UnsupportedOperationException(message);
}
@Override
public String getRoleToken(String domain, String role) {
throw new UnsupportedOperationException(message);
}
@Override
public String getAccessToken(String domain) {
throw new UnsupportedOperationException(message);
}
@Override
public String getAccessToken(String domain, List<String> roles) {
throw new UnsupportedOperationException(message);
}
@Override
public List<X509Certificate> getIdentityCertificate() {
throw new UnsupportedOperationException(message);
}
@Override
public X509Certificate getRoleCertificate(String domain, String role) {
throw new UnsupportedOperationException(message);
}
@Override
public PrivateKey getPrivateKey() {
throw new UnsupportedOperationException(message);
}
@Override
public Path trustStorePath() {
throw new UnsupportedOperationException(message);
}
}
}
|