Skip to content

oyale/PwPush-PHP

Repository files navigation

PHPUnit Test Coverage Semantic Versions

PwPush-PHP

A PHP library wrapper to easily push passwords to any PasswordPusher instance

image

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

License

LGPL-3.0