dev-master
9999999-dev https://github.com/sinkabalazs/secret-serverThis is a server that store some secret, and it publish those at an unique URL
MIT
The Requires
- slim/slim ^3.0
- php ^5.5 || ^7.0
- ext-mysqli *
by Balázs Sinka
This is a server that store some secret, and it publish those at an unique URL
, (*1)
$ composer require sinkab/secret-server "dev-master"
, (*2)
Create an index.php file into your web folder, (*3)
Copy this code and actualize that, (*4)
<?php require __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, (*5)
This API contain two feathure, (*6)
1. add a secret: yourdomain/v1/xml | json/secret use POST method, (*7)
Params:, (*8)
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. , (*9)
secret=big%20%secret&expireAfterViews=10&expireAfter=10
2. get a secret: yourdomain/v1/xml | json/secret/secret_hash_code use GET method, (*10)
The type of answer is depending of the URL's part xml | json, (*11)
testpage , (*12)
This is a server that store some secret, and it publish those at an unique URL
MIT