keboola/git-service-api-client

Keboola Git Service API client

Maintainers

Package info

github.com/keboola/git-service-php-api-client

pkg:composer/keboola/git-service-api-client

Statistics

Installs: 198

Dependents: 0

Suggesters: 0

Stars: 0

3.0.0 2026-05-27 06:10 UTC

README

Installation

composer require keboola/git-service-api-client

Usage

use Keboola\GitServiceApiClient\ApiClientConfiguration;
use Keboola\GitServiceApiClient\Auth\KeboolaServiceAccountAuth;
use Keboola\GitServiceApiClient\Auth\ManageApiTokenAuth;
use Keboola\GitServiceApiClient\GitServiceApiClient;

// Default: projected Kubernetes ServiceAccount token from
// /var/run/secrets/connection.keboola.com/serviceaccount/token, re-read on
// every request so kubelet-rotated tokens are picked up automatically.
$client = new GitServiceApiClient('https://git-service.example.com');

// Manage API token (legacy)
$client = new GitServiceApiClient(
    'https://git-service.example.com',
    new ApiClientConfiguration(auth: new ManageApiTokenAuth($manageApiToken)),
);

// SA token from a non-default mount path
$client = new GitServiceApiClient(
    'https://git-service.example.com',
    new ApiClientConfiguration(
        auth: new KeboolaServiceAccountAuth('/var/run/secrets/tokens/connection-token'),
    ),
);

KeboolaServiceAccountAuth sends the bearer token in X-Kubernetes-Authorization; ManageApiTokenAuth sends the legacy X-KBC-ManageApiToken header.

License

MIT licensed, see LICENSE file.