Include spiffe uri
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.athenz.client.zts.utils;
+import com.yahoo.security.SubjectAlternativeName;
import com.yahoo.vespa.athenz.api.AthenzIdentity;
import com.yahoo.vespa.athenz.api.AthenzService;
import com.yahoo.vespa.athenz.client.zts.ZtsClient;
@@ -32,6 +33,9 @@ public class IdentityCsrGenerator {
identity.getName(),
identity.getDomainName().replace(".", "-"),
dnsSuffix))
+ .addSubjectAlternativeName(
+ SubjectAlternativeName.Type.URI,
+ "spiffe://%s/sa/%s".formatted(identity.getDomainName(), identity.getName()))
.build();
}
