Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/00f100/fcphp-shttp
Package to security http requests
https://github.com/00f100/fcphp-shttp
fcphp php7 shttp
Last synced: about 2 months ago
JSON representation
Package to security http requests
- Host: GitHub
- URL: https://github.com/00f100/fcphp-shttp
- Owner: 00F100
- License: mit
- Created: 2018-06-30T03:38:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-04T19:33:03.000Z (over 6 years ago)
- Last Synced: 2024-05-13T00:41:03.277Z (8 months ago)
- Topics: fcphp, php7, shttp
- Language: PHP
- Size: 20.5 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FcPhp Security HTTP
Library to manipulate auth of user into HTTP env
[![Build Status](https://travis-ci.org/00F100/fcphp-shttp.svg?branch=master)](https://travis-ci.org/00F100/fcphp-shttp) [![codecov](https://codecov.io/gh/00F100/fcphp-shttp/branch/master/graph/badge.svg)](https://codecov.io/gh/00F100/fcphp-shttp) [![Total Downloads](https://poser.pugx.org/00F100/fcphp-shttp/downloads)](https://packagist.org/packages/00F100/fcphp-shttp)
## How to install
Composer:
```sh
$ composer require 00f100/fcphp-shttp
```or add in composer.json
```json
{
"require": {
"00f100/fcphp-shttp": "*"
}
}
```## How to use
```php
callback('authHeaderCallback', function(ISEntity $entity, $authHeader) {
$entity->setName('Header Auth');
return $entity;
});$instance->callback('authSessionCallback', function(ISEntity $entity, $authSession) {
$entity->setName('Session Auth');
return $entity;
});$instance->callback('authUserPassCallback', function(ISEntity $entity, $authUserPass) {
$entity->setName('User Pass Auth');
return $entity;
});$entity = $instance->get();
// PRINT:
// IF HEADER AUTH: Header Auth
// IF SESSION AUTH: Session Auth
// IF POST AUTH: User Pass Auth
echo $entity->getName();
```