Skip to content

Commit 3d45d3e

Browse files
authored
fix cert.URIs (#1144)
Signed-off-by: cpanato <[email protected]>
1 parent 13dcf39 commit 3d45d3e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/identity/gitlabcom/principal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (p jobPrincipal) Embed(_ context.Context, cert *x509.Certificate) error {
179179
}
180180

181181
// Set workflow ref URL to SubjectAlternativeName on certificate
182-
cert.URIs = []*url.URL{baseURL.JoinPath(p.repository, "@", p.ref)}
182+
cert.URIs = []*url.URL{baseURL.JoinPath(fmt.Sprintf("%s@%s", p.repository, p.ref))}
183183

184184
// Embed additional information into custom extensions
185185
cert.ExtraExtensions, err = certificate.Extensions{

pkg/server/grpc_server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ func TestAPIWithGitLab(t *testing.T) {
10511051
t.Fatalf("unexpected length of leaf certificate URIs, expected 1, got %d", len(leafCert.URIs))
10521052
}
10531053

1054-
gitLabURL := fmt.Sprintf("https://gitlab.com/%s/@/refs/heads/%s", claims.ProjectPath, claims.Ref)
1054+
gitLabURL := fmt.Sprintf("https://gitlab.com/%s@refs/heads/%s", claims.ProjectPath, claims.Ref)
10551055
gitLabURI, err := url.Parse(gitLabURL)
10561056
if err != nil {
10571057
t.Fatalf("failed to parse expected url")

0 commit comments

Comments
 (0)