2017 © Pedro Peláez
 

library secret-server

This is a server that store some secret, and it publish those at an unique URL

image

sinkab/secret-server

This is a server that store some secret, and it publish those at an unique URL

  • Monday, July 17, 2017
  • by sinkabalazs
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

, (*1)

secret-server example task

Installation

$ 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)

Basic Usage

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&AMP;expireAfterViews=10&AMP;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)

Test page

testpage , (*12)

The Versions

17/07 2017

dev-master

9999999-dev https://github.com/sinkabalazs/secret-server

This is a server that store some secret, and it publish those at an unique URL

  Sources   Download

MIT

The Requires

 

by Balázs Sinka