Repository navigation
Releases: keboola/oauth-v2-php-client
Releases · keboola/oauth-v2-php-client
Release list
6.1.1
Fixed
OAuthErrorMessageResolverreads the reason from theerrorfield when the response has nomessage. oauth-service returns errors as{"error": "...", "code": ..., "status": "error"}, so callers got the raw HTTP client text (internal URL and a cut-off body) instead of the reason.messagestill takes precedence when both are set.
Only the exception message changes, for error responses without message. Exception class, getCode() and getStatusCode() are unchanged.
Full Changelog: 6.1.0...6.1.1
6.1.0
New
Manager::mintOrganizationToken(string $organizationId, string $projectId, string $componentId, string $repository): arraycalls oauth-servicePOST /organization-credentials/tokenand returns['#token' => ..., 'expiresAt' => ...]. The#tokenis a GitHub App installation token for one repository, encrypted for the project and component.- It authenticates like the rest of
Manager: with the application token when one is given, otherwise with the projected Kubernetes ServiceAccount token. The caller needs theoauth:mintscope. - HTTP errors throw
ClientExceptionwith the original status code; 400/404/412/422 mean the request can't succeed as is (unknown project or host, no connection for the organization, repository not covered by the installation).
No breaking changes.
Full Changelog: 6.0.0...6.1.0
6.0.0
Rebuilt on the shared keboola/php-api-client-base (transport, auth, retry, error handling). The public API still returns raw decoded arrays — the breaking change is how the clients are constructed.
Breaking changes
- Constructor signature.
CredentialsandManagernow take the API base URL and token as explicit arguments, followed by named transport options, replacing the old(token, config[])shape:new Credentials($baseUrl, $storageToken, backoffMaxTries: 10, ...); new Manager($baseUrl, $applicationToken, ...);
config['url']→$baseUrl,config['handler']→requestHandler,config['backoffMaxTries']→backoffMaxTries. - Minimum PHP is now 8.2.
Keboola\OAuthV2Api\Exception\ClientExceptionnow extendsKeboola\ApiClientBase\Exception\ClientException(still anException; gainsgetStatusCode()/getResponseBody()).Credentials::add()now requires the#datakey (encrypted payload) instead ofdata.
New
Manager's application token is now optional — when omitted (ornull), the client authenticates via the projected Kubernetes ServiceAccount token instead ofX-KBC-ManageApiToken.
Preserved behavior
- Retries (10 attempts) on 5xx and transport errors, 120s connect/request timeouts, and
Accept: application/jsonon every request — matching the previous client.
Internals
- Removed the hand-rolled
Commontransport; retry, timeouts, auth, and error normalization now come fromkeboola/php-api-client-base ^1.1.1.
5.0.2
What's Changed
- feat(ST-3451): add timeout settings to prevent stuck connections by @ondrejhlavacek in #15