Skip to content

Commit

Permalink
Merge pull request #89 from gdbranco/fix/ocm-13910
Browse files Browse the repository at this point in the history
OCM-13910 | fix: support ctx in fetch thumbprint
  • Loading branch information
davidleerh authored Feb 7, 2025
2 parents 955caba + ef8ec52 commit 278b338
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/rosa/oidcconfigs/oidcconfigs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package oidcconfigs

import (
"context"
"crypto"
"crypto/rand"
"crypto/rsa"
Expand Down Expand Up @@ -219,12 +220,17 @@ func keyIDFromPublicKey(publicKey interface{}) (string, error) {
return keyID, nil
}

func FetchThumbprint(oidcEndpointURL string) (string, error) {
func FetchThumbprint(ctx context.Context, oidcEndpointURL string) (string, error) {
connect, err := url.ParseRequestURI(oidcEndpointURL)
if err != nil {
return "", err
}
response, err := http.Get(fmt.Sprintf("https://%s:443", connect.Host))
request, err := http.NewRequestWithContext(ctx, http.MethodGet,
fmt.Sprintf("https://%s:443", connect.Host), nil)
if err != nil {
return "", err
}
response, err := http.DefaultClient.Do(request)
if err != nil {
return "", err
}
Expand Down

0 comments on commit 278b338

Please sign in to comment.