Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add warning against accepting untrusted credentials #598

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ Application Default Credentials provides a simple way to get authorization
credentials for use in calling Google APIs, and is
the recommended approach to authorize calls to Cloud APIs.

**Important**: If you accept a credential configuration (credential JSON/File/Stream) from an
external source for authentication to Google Cloud Platform, you must validate it before providing
it to any Google API or library. Providing an unvalidated credential configuration to Google APIs
can compromise the security of your systems and data. For more information, refer to
[Validate credential configurations from external sources][externally-sourced-credentials].

[externally-sourced-credentials]: https://cloud.google.com/docs/authentication/external/externally-sourced-credentials

### Set up ADC

To use ADC, you must set it up by providing credentials.
Expand Down Expand Up @@ -302,7 +310,7 @@ $middleware = ApplicationDefaultCredentials::getCredentials($scope, cache: $memo

### FileSystemCacheItemPool Cache
The `FileSystemCacheItemPool` class is a `PSR-6` compliant cache that stores its
serialized objects on disk, caching data between processes and making it possible
serialized objects on disk, caching data between processes and making it possible
to use data between different requests.

```php
Expand Down
6 changes: 6 additions & 0 deletions src/ApplicationDefaultCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
*
* $res = $client->get('myproject/taskqueues/myqueue');
* ```
*
* **Important**: If you accept a credential configuration (credential JSON/File/Stream) from an
* external source for authentication to Google Cloud Platform, you must validate it before
* providing it to any Google API or library. Providing an unvalidated credential configuration to
* Google APIs can compromise the security of your systems and data. For more information
* {@see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials}
bshaffer marked this conversation as resolved.
Show resolved Hide resolved
bshaffer marked this conversation as resolved.
Show resolved Hide resolved
*/
class ApplicationDefaultCredentials
{
Expand Down
Loading