{"id":29874580,"url":"https://github.com/phpexpertsinc/gcloud-auth","last_synced_at":"2026-03-04T21:02:07.735Z","repository":{"id":287120113,"uuid":"963586828","full_name":"PHPExpertsInc/gcloud-auth","owner":"PHPExpertsInc","description":"A drop-dead simple way to authenticate APIs with Google Cloud without needing the gcloud binary.","archived":false,"fork":false,"pushed_at":"2025-05-20T20:02:03.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2025-07-26T22:27:31.752Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PHPExpertsInc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.mit.actual.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-09T22:56:10.000Z","updated_at":"2025-05-20T20:02:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf2bd3ab-5d87-4064-8607-73e0999bfb59","html_url":"https://github.com/PHPExpertsInc/gcloud-auth","commit_stats":null,"previous_names":["phpexpertsinc/gcloud-auth"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/PHPExpertsInc/gcloud-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPExpertsInc%2Fgcloud-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPExpertsInc%2Fgcloud-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPExpertsInc%2Fgcloud-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPExpertsInc%2Fgcloud-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PHPExpertsInc","download_url":"https://codeload.github.com/PHPExpertsInc/gcloud-auth/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPExpertsInc%2Fgcloud-auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30092867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T20:42:30.420Z","status":"ssl_error","status_checked_at":"2026-03-04T20:42:30.057Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-31T00:42:40.426Z","updated_at":"2026-03-04T21:02:07.715Z","avatar_url":"https://github.com/PHPExpertsInc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Cloud Auth\n\n[![TravisCI]()]()\n[![Maintainability]()]()\n[![Test Coverage]()]()\n\nGCloud Auth is a PHP Experts, Inc., Project for authenticating with Google Cloud API without \nneeding the huge gcloud binary.\n\nAs of April 2025, the `google-cloud-cli` weighs in at around 150 MB, not counting dependencies,\nand over 550 MB counting dependencies, on modern Linux systems.\n\nUsing the `google/apiclient` composer package itself weighs in at 141 MB.\n\nThis project, by comparison, weighs in around 10 KB (or 15,000x smaller).\n\nIt provides everything you need to retrieve an OAuth2 token for authenticating with Google Cloud\nAPI services. It autogenerates the JWT token necessary for this, using ext-openssl.\n\nIt includes a drop-in `phpexperts/rest-speaker` `GoogleAuth` driver, but it can\nalso be used standalone by any PHP project.\n\n## Installation\n\nVia Composer\n\n```bash\ncomposer require phpexperts/gcloud-auth\n```\n\n## Usage\n\nFor use with `phpexperts/rest-speaker`:\n\n```php\nuse PHPExperts\\GoogleCloudAuth\\GoogleCloudAuth;\nuse PHPExperts\\RESTSpeaker\\RESTSpeaker;\n\n$api = new RESTSpeaker(new GoogleCloudAuth('relative/path/to/services.json'));\n```\n\nFor use with any other PHP project:\n\n```php\nuse PHPExperts\\GoogleCloudAuth\\GoogleCloudAuth;\n$gcloudAuth = new GoogleCloudAuth('relative/path/to/services.json');\n\n// Returns the raw Oauth2Token as a string.\n$gcloudOauth2Token = $gcloudAuth-\u003eobtainGCloudOauthToken();\n\n$url = \"https://storage.googleapis.com/storage/v1/b?project=$projectId\";\n$http = new \\GuzzleHttp\\Client([\n    'headers' =\u003e [\n        'Content-Type'  =\u003e 'application/json',\n        'Authorization' =\u003e \"Bearer $gcloudOauth2Token\",\n    ]\n]);\n$response = $http-\u003eget($url);\n```\n\n## Use cases\n\n✔ Can authenticate with GCloud\n✔ Handles invalid service account path\n✔ Handles invalid service account data\n✔ Handles error responses from Google Cloud\n✔ Can override time for testing\n✔ Will cache the OAuth2 Token until expiration\n✔ Can synthesize speech using the GCloud API\n\n## Testing\n\n```bash\nphpunit --testdox\n```\n\n## Contributors\n\n[Theodore R. Smith](https://www.phpexperts.pro/]) \u003ctheodore@phpexperts.pro\u003e  \nGPG Fingerprint: 4BF8 2613 1C34 87AC D28F  2AD8 EB24 A91D D612 5690  \nCEO: PHP Experts, Inc.\n\n## License\n\nMIT license. Please see the [license file](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpexpertsinc%2Fgcloud-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpexpertsinc%2Fgcloud-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpexpertsinc%2Fgcloud-auth/lists"}