feat: Initial ArgoCD PHP Client Structure and Core Services #1150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces the initial structure and core functionality for a new PHP client for the ArgoCD API, refactored from the KnpLabs GitHub API client.
Key changes and accomplishments so far:
Project Setup:
argocd-php-client/src/ArgoCD/
.composer.json
with PSR-4 autoloading and base dependencies.Core Client (
ArgoCD/Client.php
):authenticate()
method implemented to either:/api/v1/session
using username/password viaSessionService
.api()
factory method for accessing service classes.HTTP Layer:
HttpClient/Builder.php
adapted for constructing the HTTP client.HttpClient/Plugin/Authentication.php
implemented for bearer token injection.HttpClient/Plugin/ArgoCdExceptionThrower.php
for basic error handling.Api/AbstractApi.php
provides base HTTP request methods.HttpClient/Message/ResponseMediator.php
for processing JSON responses.Exception Handling:
ArgoCD/Exception/
.ArgoCdExceptionThrower
parses JSON error responses from ArgoCD.Models (
ArgoCD/Model/
):AccountAccount
,SessionSessionResponse
,V1Time
).API Services (
ArgoCD/Api/
):SessionService.php
implemented withcreate
(login),delete
(logout), andgetUserInfo
methods.AccountService.php
implemented with methods for account listing, password updates, and token management.ApplicationService.php
.This work lays the foundation for a comprehensive ArgoCD PHP client. Further development will involve implementing remaining API services and models, writing unit tests, and updating documentation.