Download the PHP package keboola/php-api-client-base without Composer
On this page you can find all versions of the php package keboola/php-api-client-base. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download keboola/php-api-client-base
More information about keboola/php-api-client-base
Files in keboola/php-api-client-base
Package php-api-client-base
Short Description Shared base for Keboola service API clients (transport, auth, retry)
License MIT
Informations about the package php-api-client-base
Keboola PHP API Client Base
Shared base for building PHP clients for Keboola services (Storage, Manage, Vault, Git Service, Sandboxes, Sync Actions, Job Queue, …). It is not a general-purpose HTTP client — it encodes Keboola platform conventions: the Keboola authentication headers, retry behavior, JSON handling, and error normalization that every Keboola service client needs.
Used by keboola/vault-api-client, keboola/sandboxes-service-api-client,
keboola/git-service-api-client, keboola/sync-actions-client,
keboola/azure-api-client, and new Keboola service clients.
Installation
What it provides
ApiClient— Guzzle wrapper with per-request auth, retry, logging, and response-to-model mapping. Constructed asnew ApiClient($baseUrl, $authenticator, $options, errorMessageResolver: ..., retryableStatusCodes: [...]). The authenticator is required; passnew NoAuthAuthenticator()for unauthenticated clients.errorMessageResolveraccepts a?ErrorMessageResolverInterfaceinstance; whennull, the shippedDefaultErrorMessageResolver(which extractserrorormessagefrom JSON bodies) is used automatically.retryableStatusCodesareApiClientconstructor arguments supplied by the service facade (they describe the service's API contract, not caller preferences).ApiClientOptions— retries, timeouts, logger (no auth, no error resolver — the authenticator is a first-classApiClientconstructor argument; the error resolver and retryable codes are alsoApiClientconstructor arguments).Auth\RequestAuthenticatorInterface+ ready authenticators for the Keboola auth schemes:StorageApiTokenAuthenticator(X-StorageApi-Token),ManageApiTokenAuthenticator(X-KBC-ManageApiToken),KeboolaServiceAccountAuthenticator(projected SA token →X-Kubernetes-Authorization),NoAuthAuthenticator(explicit no-op for unauthenticated calls).ErrorMessageResolverInterface,DefaultErrorMessageResolver,RetryDecider,Json,ResponseModelInterface,Exception\ClientException.
Building a Keboola service client
Compose an ApiClient inside your service facade and map responses to models:
Authentication
Pick the authenticator matching the service's scheme, or implement
RequestAuthenticatorInterface for a service-specific scheme (e.g. azure's
OAuth).
KeboolaServiceAccountAuthenticator re-reads the projected SA token on every
request, so kubelet-rotated tokens are picked up automatically. The read is
hardened against the rotation race (read-first, clear PHP's stat cache and
re-check on failure, then retry empty/failed reads with bounded exponential
backoff — ~1.24 s over 5 retries by default, tunable via the maxReadAttempts
and retryBaseDelayMicroseconds constructor arguments).
License
MIT
All versions of php-api-client-base with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^7.8
psr/http-message Version ^1.0|^2.0
psr/log Version ^1.0|^2.0|^3.0
webmozart/assert Version ^1.11