Skip to content

Commit 7f1327f

Browse files
author
Chao Wang
committed
remove unused function
1 parent 27fca55 commit 7f1327f

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

pkg/credentialprovider/azure/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ go_library(
2020
"//vendor/github.com/Azure/go-autorest/autorest:go_default_library",
2121
"//vendor/github.com/Azure/go-autorest/autorest/adal:go_default_library",
2222
"//vendor/github.com/Azure/go-autorest/autorest/azure:go_default_library",
23-
"//vendor/github.com/dgrijalva/jwt-go:go_default_library",
2423
"//vendor/github.com/spf13/pflag:go_default_library",
2524
"//vendor/k8s.io/klog:go_default_library",
2625
"//vendor/sigs.k8s.io/yaml:go_default_library",

pkg/credentialprovider/azure/azure_acr_helper.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ import (
5454
"strconv"
5555
"strings"
5656
"unicode"
57-
58-
jwt "github.com/dgrijalva/jwt-go"
5957
)
6058

6159
type authDirective struct {
@@ -142,23 +140,6 @@ func receiveChallengeFromLoginServer(serverAddress string) (*authDirective, erro
142140
}, nil
143141
}
144142

145-
func parseAcrToken(identityToken string) (token *acrTokenPayload, err error) {
146-
tokenSegments := strings.Split(identityToken, ".")
147-
if len(tokenSegments) < 2 {
148-
return nil, fmt.Errorf("Invalid existing refresh token length: %d", len(tokenSegments))
149-
}
150-
payloadSegmentEncoded := tokenSegments[1]
151-
var payloadBytes []byte
152-
if payloadBytes, err = jwt.DecodeSegment(payloadSegmentEncoded); err != nil {
153-
return nil, fmt.Errorf("Error decoding payload segment from refresh token, error: %s", err)
154-
}
155-
var payload acrTokenPayload
156-
if err = json.Unmarshal(payloadBytes, &payload); err != nil {
157-
return nil, fmt.Errorf("Error unmarshalling acr payload, error: %s", err)
158-
}
159-
return &payload, nil
160-
}
161-
162143
func performTokenExchange(
163144
serverAddress string,
164145
directive *authDirective,

0 commit comments

Comments
 (0)