oyale / pwpush-php
A PHP wrapper to easily push passwords to pwpush.com
Requires
- guzzlehttp/guzzle: ^7.4
- justinrainbow/json-schema: ^5.2
Requires (Dev)
- filp/whoops: ^2.14
- phpunit/phpunit: ^9
- symfony/var-dumper: ^5.4
This package is auto-updated.
Last update: 2024-11-30 21:09:31 UTC
README
PwPush-PHP
A PHP library wrapper to easily push passwords to any PasswordPusher instance
Install
composer require oyale/pwpush-php
Usage
// Push a secret (returns the URL) PwPush::push(string $secret, ?array $options[] = null, ?string $urlBase = 'https://pwpush.com', ?bool $validate = false); // Retrieve a secret PwOps::get(string $token, ?string $urlBase="https://pwpush.com"); # Delete a secret PwOps::delete(string $token, ?string $urlBase="https://pwpush.com");
PwPush::push
Parameters
$secret
Required.
The secret to be pushed
Type: string
$options
Type: array
Default value: server configuration
$urlBase
URL of PwPush instance
Type: string
Default value: https://pwpush.com
$validate
Validate JSON against schema prior to push secret
Type: bool
Default value: false
Options
$options
is a key-value array. Valid options are:
expire_after_days
Number of days until the password is deleted.
Type: integer
Default value: server configuration
expire_after_views
Number of visualizations until the password is deleted.
Type: integer
Default value: server configuration
retrieval_step
Helps to avoid chat systems and URL scanners from eating up views.
Type: bool
Default value: server configuration
deletable_by_viewer
Allow users to delete passwords once retrieved.
Type: bool
Default value: server configuration
PwOps
Parameters
token
Required.
Token for the secret
Type: string
$urlBase
URL of PwPush instance
Type: string
Default value: https://pwpush.com
Examples
You can see a complete workflow example in examples/workflow.php