@@ -263,7 +263,7 @@ const (
263263 fileTypeJSON = "json"
264264)
265265
266- // Format contains information needed to retireve a subject token for URL or File sourced credentials.
266+ // Format contains information needed to retrieve a subject token for URL or File sourced credentials.
267267type Format struct {
268268 // Type should be either "text" or "json". This determines whether the file or URL sourced credentials
269269 // expect a simple text subject token or if the subject token will be contained in a JSON object.
@@ -278,20 +278,52 @@ type Format struct {
278278type CredentialSource struct {
279279 // File is the location for file sourced credentials.
280280 // One field amongst File, URL, Executable, or EnvironmentID should be provided, depending on the kind of credential in question.
281+ //
282+ // Important: If you accept a credential configuration (credential
283+ // JSON/File/Stream) from an external source for authentication to Google
284+ // Cloud Platform, you must validate it before providing it to any Google
285+ // API or library. Providing an unvalidated credential configuration to
286+ // Google APIs can compromise the security of your systems and data. For
287+ // more information, refer to [Validate credential configurations from
288+ // external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
281289 File string `json:"file"`
282290
283291 // Url is the URL to call for URL sourced credentials.
284292 // One field amongst File, URL, Executable, or EnvironmentID should be provided, depending on the kind of credential in question.
293+ //
294+ // Important: If you accept a credential configuration (credential
295+ // JSON/File/Stream) from an external source for authentication to Google
296+ // Cloud Platform, you must validate it before providing it to any Google
297+ // API or library. Providing an unvalidated credential configuration to
298+ // Google APIs can compromise the security of your systems and data. For
299+ // more information, refer to [Validate credential configurations from
300+ // external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
285301 URL string `json:"url"`
286302 // Headers are the headers to attach to the request for URL sourced credentials.
287303 Headers map [string ]string `json:"headers"`
288304
289305 // Executable is the configuration object for executable sourced credentials.
290306 // One field amongst File, URL, Executable, or EnvironmentID should be provided, depending on the kind of credential in question.
307+ //
308+ // Important: If you accept a credential configuration (credential
309+ // JSON/File/Stream) from an external source for authentication to Google
310+ // Cloud Platform, you must validate it before providing it to any Google
311+ // API or library. Providing an unvalidated credential configuration to
312+ // Google APIs can compromise the security of your systems and data. For
313+ // more information, refer to [Validate credential configurations from
314+ // external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
291315 Executable * ExecutableConfig `json:"executable"`
292316
293317 // EnvironmentID is the EnvironmentID used for AWS sourced credentials. This should start with "AWS".
294318 // One field amongst File, URL, Executable, or EnvironmentID should be provided, depending on the kind of credential in question.
319+ //
320+ // Important: If you accept a credential configuration (credential
321+ // JSON/File/Stream) from an external source for authentication to Google
322+ // Cloud Platform, you must validate it before providing it to any Google
323+ // API or library. Providing an unvalidated credential configuration to
324+ // Google APIs can compromise the security of your systems and data. For
325+ // more information, refer to [Validate credential configurations from
326+ // external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
295327 EnvironmentID string `json:"environment_id"`
296328 // RegionURL is the metadata URL to retrieve the region from for EC2 AWS credentials.
297329 RegionURL string `json:"region_url"`
@@ -329,7 +361,7 @@ type SubjectTokenSupplier interface {
329361type AwsSecurityCredentialsSupplier interface {
330362 // AwsRegion should return the AWS region or an error.
331363 AwsRegion (ctx context.Context , options SupplierOptions ) (string , error )
332- // GetAwsSecurityCredentials should return a valid set of AwsSecurityCredentials or an error.
364+ // AwsSecurityCredentials should return a valid set of AwsSecurityCredentials or an error.
333365 // The external account token source does not cache the returned security credentials, so caching
334366 // logic should be implemented in the supplier to prevent multiple requests for the same security credentials.
335367 AwsSecurityCredentials (ctx context.Context , options SupplierOptions ) (* AwsSecurityCredentials , error )
0 commit comments