Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class ZeroTrustIdentityService
{
static final ServiceIdentifier ZTIS_IDENTIFIER = ServiceIdentifier.of("zero-trust-identity");
private static final String DEFAULT_SOCKET_PATH = "unix:///tmp/spire-agent/public/api.sock";
private static final String SOCKET_ENVIRONMENT_VARIABLE = "SPIFFE_ENDPOINT_SOCKET";
private static final Duration DEFAULT_SOCKET_TIMEOUT = Duration.ofSeconds(10);
@Getter
private static final ZeroTrustIdentityService instance = new ZeroTrustIdentityService();
Expand Down Expand Up @@ -105,17 +106,16 @@ X509Source initX509Source()
return new FileSystemX509Source();
}

final String socketPath = Option.of(System.getenv(SOCKET_ENVIRONMENT_VARIABLE)).getOrElse(DEFAULT_SOCKET_PATH);
log.info("Using socket path {} for ZTIS agent.", socketPath);

final X509SourceOptions x509SourceOptions =
X509SourceOptions
.builder()
.spiffeSocketPath(DEFAULT_SOCKET_PATH)
.initTimeout(DEFAULT_SOCKET_TIMEOUT)
.build();
X509SourceOptions.builder().spiffeSocketPath(socketPath).initTimeout(DEFAULT_SOCKET_TIMEOUT).build();
try {
return DefaultX509Source.newSource(x509SourceOptions);
}
catch( final Exception e ) {
throw new CloudPlatformException("Failed to load the certificate from the default unix socket.", e);
throw new CloudPlatformException("Failed to load the certificate from the unix socket: " + socketPath, e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

### ✨ New Functionality

-
- 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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL


### 📈 Improvements

Expand Down