Skip to content

Commit b17cd3b

Browse files
committed
Remove debugging code
1 parent d01cf43 commit b17cd3b

File tree

4 files changed

+6
-77
lines changed

4 files changed

+6
-77
lines changed

config/manager/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
55
images:
66
- name: controller
7-
newName: command-issuer
8-
newTag: latest
7+
newName: keyfactor/command-cert-manager-issuer
8+
newTag: 2.1.0-rc.0

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ spec:
7171
args:
7272
- --leader-elect
7373
image: controller:latest
74-
imagePullPolicy: Never
74+
imagePullPolicy: IfNotPresent
7575
name: manager
7676
securityContext:
7777
allowPrivilegeEscalation: false

internal/command/client.go

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func (g *gcp) GetAccessToken(ctx context.Context) (string, error) {
144144
return "", fmt.Errorf("%w: failed to find GCP ADC: %w", errTokenFetchFailure, err)
145145
}
146146

147-
log.Info(fmt.Sprintf("Generating a Google OIDC ID Token"))
147+
log.Info(fmt.Sprintf("generating a Google OIDC ID token..."))
148148

149149
// Use credentials to generate a JWT (requires a service account)
150150
tokenSource, err := idtoken.NewTokenSource(ctx, g.audience, idtoken.WithCredentialsJSON(credentials.JSON))
@@ -157,14 +157,13 @@ func (g *gcp) GetAccessToken(ctx context.Context) (string, error) {
157157
return "", fmt.Errorf("%w: failed to generate GCP JWT Token from token source: %w", errTokenFetchFailure, err)
158158
}
159159

160-
// TODO: Remove the below log statements
161-
log.Info(fmt.Sprintf("token value from GCP: %s", token.AccessToken))
160+
log.Info(fmt.Sprintf("Google OIDC ID token successfully generated."))
162161

163162
payload, _ := idtoken.ParsePayload(token.AccessToken)
164163

165164
prettyPayload, _ := json.MarshalIndent(payload, "", " ")
166165

167-
log.Info(fmt.Sprintf("JWT payload: %s", prettyPayload))
166+
log.Info(fmt.Sprintf("Google OIDC ID token payload: %s", prettyPayload))
168167

169168
g.tokenSource = tokenSource
170169
}
@@ -191,20 +190,3 @@ func newGCPDefaultCredentialSource(ctx context.Context, audience string, scopes
191190
tokenCredentialSource = source
192191
return source, nil
193192
}
194-
195-
// TODO: Remove this before merging
196-
func NewGCPDefaultCredentialSource(ctx context.Context, audience string, scopes []string) (*gcp, error) {
197-
return newGCPDefaultCredentialSource(ctx, audience, scopes)
198-
}
199-
200-
// TODO: Remove this before merging
201-
func ValidateToken(ctx context.Context, idToken string, expectedAudience string) bool {
202-
_, err := idtoken.Validate(ctx, idToken, expectedAudience)
203-
if err != nil {
204-
return false
205-
}
206-
207-
log.FromContext(ctx).Info("Token is valid")
208-
209-
return true
210-
}

sample/main.go

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)