sinkab / secret-server
This is a server that store some secret, and it publish those at an unique URL
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/sinkab/secret-server
Requires
- php: ^5.5 || ^7.0
- ext-mysqli: *
- slim/slim: ^3.0
This package is not auto-updated.
Last update: 2025-12-27 02:20:23 UTC
README
secret-server example task
Installation
$ composer require sinkab/secret-server "dev-master"
Create an index.php file into your web folder
Copy this code and actualize that
<?phprequire __DIR__.'/vendor/autoload.php'; //setting up your database parameters $config['db'] = [ 'host' => 'localhost', 'user' => 'dbuser', 'password' => 'dbuserpassword', 'database_name' => 'secret_server' ]; $secret = new \Sinkab\SecretServer($config);
Copy .htaccess file into your web folder
Basic Usage
This API contain two feathure
1. add a secret: yourdomain/v1/xml | json/secret use POST method
Params:
secret - This is the secret text (string /required)
expireAfterViews - How many times the secret can be viewed (integer, > 0, require)
expireAfter - The secret cannot be reached after this time (integer, 0 - it does not expire, expire time in mintues, require)
The params send in the "application/x-www-form-urlencoded" format, e.g.
secret=big%20%secret&expireAfterViews=10&expireAfter=10
2. get a secret: yourdomain/v1/xml | json/secret/secret_hash_code use GET method
The type of answer is depending of the URL's part xml | json