PHP code example of codenamephp / platform.secretsmanager.googlesecretsmanager

1. Go to this page and download the library: Download codenamephp/platform.secretsmanager.googlesecretsmanager library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

codenamephp / platform.secretsmanager.googlesecretsmanager example snippets



use de\codenamephp\platform\secretsManager\googleSecretsManager\Client\Factory\WithGoogleSecretsManagerClient;

$client = (new WithGoogleSecretsManagerClient())->build();
$client = (new WithGoogleSecretsManagerClient())->build('/path/to/credentials.json');

// payload is fetched as string
$payload = $client->fetchPayload(new \de\codenamephp\platform\secretsManager\base\Secret\Sealed('mySecret', 'myProject')); //fetch the latest version
$payload = $client->fetchPayload(new \de\codenamephp\platform\secretsManager\base\Secret\Sealed('mySecret', 'myProject', '3')); //fetch a specific version