{"id":28729215,"url":"https://github.com/benagricola/php-eks-auth","last_synced_at":"2026-04-24T12:31:06.632Z","repository":{"id":37589480,"uuid":"363255901","full_name":"benagricola/php-eks-auth","owner":"benagricola","description":"A PHP Library helper for AWS EKS Authentication with your chosen PHP Kubernetes client","archived":false,"fork":false,"pushed_at":"2023-04-19T21:18:42.000Z","size":61,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-23T08:33:16.819Z","etag":null,"topics":["amazon","amazon-eks","authentication","eks","kubernetes","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benagricola.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-30T20:50:30.000Z","updated_at":"2023-02-16T20:58:30.000Z","dependencies_parsed_at":"2022-09-11T22:00:35.828Z","dependency_job_id":null,"html_url":"https://github.com/benagricola/php-eks-auth","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/benagricola/php-eks-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benagricola%2Fphp-eks-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benagricola%2Fphp-eks-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benagricola%2Fphp-eks-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benagricola%2Fphp-eks-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benagricola","download_url":"https://codeload.github.com/benagricola/php-eks-auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benagricola%2Fphp-eks-auth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260006330,"owners_count":22944888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["amazon","amazon-eks","authentication","eks","kubernetes","php"],"created_at":"2025-06-15T16:14:45.920Z","updated_at":"2026-04-24T12:31:01.609Z","avatar_url":"https://github.com/benagricola.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP EKS Auth\n\nThis library uses the AWS V3 SDK to create an authenticated `GuzzleHttp\\Client` instance that can be passed to your compatible PHP Kubernetes client (only tested with `maclof/kubernetes-client`). \n\nAll you need to authenticate with an EKS cluster is valid AWS credentials in your environment. \n\nThis library will pull the EKS endpoint details from AWS based on `$clusterName` and `$region`, using the default credential provider from `aws-sdk-php`.\n\nThe `GuzzleHttp\\Client` instance will be preconfigured with a `DynamicCertificate` Middleware that writes the CA certificate of the cluster to a temporary file so it can be passed to the underlying HTTP Handler (usually Curl). \n\nThe temporary certificate file is created and deleted on every request so does not need to be cleaned up, and means connections are fully verified.\n\n## Usage\n\nRequire it:\n\n```bash\ncomposer require benagricola/eks-auth\n```\n\nThen use it in your project:\n```php\nuse EKSAuth\\Client\\Factory as ClientFactory;\n\n# Example using maclof/kubernetes-client\nuse Maclof\\Kubernetes\\Client;\n\n// Create a new ClientFactory.\n// EKS Cluster details are cached for the\n// lifetime of this Factory instance.\n$cf = new ClientFactory();\n\n// Get our client. A new Token will be generated every\n// time getClient() is called.\n\n// We pass our own function that instantiates a new \n// Maclof\\Kubernetes\\Client instance with the\n// pre-configured \\GuzzleHttp\\Client.\n$k8s = $cf-\u003egetClient($clusterName, $region, function($httpClient) {\n    return new Client([], $httpClient);\n});\n\n$namespaces = $k8s-\u003enamespaces()-\u003efind();\n...\n```\n\nNote: This library only catches and re-throws an error when the requested cluster does not exist. You should wrap the `ClientFactory-\u003egetClient()` call in a `try{} catch(Exception $e){}` block to avoid throwing all sorts of errors from the underlying libraries.\n\n## Contributing\nSubmit a pull request. I'm not a PHP dev so the codebase has no tests.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenagricola%2Fphp-eks-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenagricola%2Fphp-eks-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenagricola%2Fphp-eks-auth/lists"}