Skip to content

Commit 9323423

Browse files
authored
ZTIS Support for Kyma (#985)
1 parent 56d111b commit 9323423

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cloudplatform/connectivity-ztis/src/main/java/com/sap/cloud/sdk/cloudplatform/connectivity/ZeroTrustIdentityService.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public class ZeroTrustIdentityService
4747
{
4848
static final ServiceIdentifier ZTIS_IDENTIFIER = ServiceIdentifier.of("zero-trust-identity");
4949
private static final String DEFAULT_SOCKET_PATH = "unix:///tmp/spire-agent/public/api.sock";
50+
private static final String SOCKET_ENVIRONMENT_VARIABLE = "SPIFFE_ENDPOINT_SOCKET";
5051
private static final Duration DEFAULT_SOCKET_TIMEOUT = Duration.ofSeconds(10);
5152
@Getter
5253
private static final ZeroTrustIdentityService instance = new ZeroTrustIdentityService();
@@ -105,17 +106,16 @@ X509Source initX509Source()
105106
return new FileSystemX509Source();
106107
}
107108

109+
final String socketPath = Option.of(System.getenv(SOCKET_ENVIRONMENT_VARIABLE)).getOrElse(DEFAULT_SOCKET_PATH);
110+
log.info("Using socket path {} for ZTIS agent.", socketPath);
111+
108112
final X509SourceOptions x509SourceOptions =
109-
X509SourceOptions
110-
.builder()
111-
.spiffeSocketPath(DEFAULT_SOCKET_PATH)
112-
.initTimeout(DEFAULT_SOCKET_TIMEOUT)
113-
.build();
113+
X509SourceOptions.builder().spiffeSocketPath(socketPath).initTimeout(DEFAULT_SOCKET_TIMEOUT).build();
114114
try {
115115
return DefaultX509Source.newSource(x509SourceOptions);
116116
}
117117
catch( final Exception e ) {
118-
throw new CloudPlatformException("Failed to load the certificate from the default unix socket.", e);
118+
throw new CloudPlatformException("Failed to load the certificate from the unix socket: " + socketPath, e);
119119
}
120120
}
121121

release_notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
### ✨ New Functionality
1414

15-
-
15+
- Add support for using the Zero Trust Identity Service (ZTIS) on Kyma by detecting the [well-known environment variable `SPIFFE_ENDPOINT_SOCKET`](https://github.com/spiffe/spiffe/blob/main/standards/SPIFFE_Workload_Endpoint.md#4-locating-the-endpoint).
1616

1717
### 📈 Improvements
1818

0 commit comments

Comments
 (0)