Download the PHP package pantheon-systems/customer-secrets-php-sdk without Composer
On this page you can find all versions of the php package pantheon-systems/customer-secrets-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pantheon-systems/customer-secrets-php-sdk
More information about pantheon-systems/customer-secrets-php-sdk
Files in pantheon-systems/customer-secrets-php-sdk
Package customer-secrets-php-sdk
Short Description Supporting libraries for customer secrets project
License MIT
Informations about the package customer-secrets-php-sdk
customer-secrets-php-sdk
This library should be used to access Pantheon Sites Secrets (currently in EA).
Early Access
The Secrets feature is available for Early Access participants. Features for Secrets are in active development. Pantheon's development team is rolling out new functionality often while this product is in Early Access. Visit the Pantheon Slack channel (or sign up for the channel if you don't already have an account) to learn how you can enroll in our Early Access program. Please review Pantheon's Software Evaluation Licensing Terms for more information about access to our software.
Installation
Use composer to install it:
Usage
In your PHP code, do the following:
See the included classes and internal documentation for more examples and use cases.
Note: Only get has been implemented so far. You should handle your secrets through terminus using Terminus Secrets Manager.
See our detailed WordPress examples for more detailed end to end examples.
Local Environment Usage
The SDK includes a CustomerSecretsFakeClient implementation that is used when the SDK runs outside of Pantheon infrastructure. This client uses a secrets json file to build the secrets information emulating what happens on the platform using the Secrets service.
To get this file, you should use the plugin secret:site:local-generate command and then set an environment variable into your local environment (or docker container if you are running a dockerized environment) with name CUSTOMER_SECRETS_FAKE_FILE and use the absolute path to the file as the value.
Lando example
To setup this using lando, you should modify your .lando.yml like this:
Then, generate the secrets file like this:
And rebuild lando application:
Then, you will be able to use your secrets through the SDK.
Restrictions
This SDK will only read secrets with scope web. Secrets get cached in the server for 15 minutes so you should wait (at most) that time if you modified your site secrets.
All versions of customer-secrets-php-sdk with dependencies
ext-json Version *