@@ -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- }
0 commit comments