Skip to content

Commit

Permalink
Merge pull request #1 from aprchen/master
Browse files Browse the repository at this point in the history
Basic auth , Bearer Token(JWT), Acl
  • Loading branch information
huangzhhui authored Jun 11, 2018
2 parents 4220566 + 0796d94 commit 5761422
Show file tree
Hide file tree
Showing 41 changed files with 2,361 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.buildpath
.settings/
.project
*.patch
.idea/
.git/
runtime/
vendor/
temp/
*.lock
.phpintel/
.DS_Store
39 changes: 39 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

$header = <<<'EOF'
This file is part of Swoft.
@link https://swoft.org
@document https://doc.swoft.org
@contact [email protected]
@license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
EOF;

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'header_comment' => [
'commentType' => 'PHPDoc',
'header' => $header,
'separate' => 'none'
],
'array_syntax' => [
'syntax' => 'short'
],
'single_quote' => true,
'class_attributes_separation' => true,
'no_unused_imports' => true,
'standardize_not_equals' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('public')
->exclude('resources')
->exclude('config')
->exclude('runtime')
->exclude('vendor')
->in(__DIR__)
)
->setUsingCache(false);

21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: php

php:
- 7.0
- 7.1

services:
- mysql

before_install:
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'

install:
- wget https://github.com/redis/hiredis/archive/v0.13.3.tar.gz -O hiredis.tar.gz && mkdir -p hiredis && tar -xf hiredis.tar.gz -C hiredis --strip-components=1 && cd hiredis && sudo make -j$(nproc) && sudo make install && sudo ldconfig && cd ..
- pecl install -f swoole-2.0.12

before_script:
- composer update

script: composer test

33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Swoft Auth

Swoft Auth Component

## Install

- composer command

```bash
composer require swoft/auth
```

## Document [wiki](https://github.com/aprchen/swoft-auth/wiki)

now
- BasicAuth
- BearerToken (JWT)
- Acl

feature
- oauth 2.0



## Unit testing

```bash
phpunit
```

## LICENSE

The Component is open-sourced software licensed under the [Apache license](LICENSE).
41 changes: 41 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "swoft/auth",
"type": "library",
"keywords": [
"php",
"swoole",
"swoft"
],
"description": "microservice framework base on swoole",
"license": "Apache-2.0",
"require": {
"swoft/http-server": "^1.0",
"firebase/php-jwt": "^5.0",
"psr/simple-cache": "^1.0",
"swoft/framework": "^1.0"
},
"autoload": {
"psr-4": {
"Swoft\\Auth\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"SwoftTest\\Auth\\": "test/Cases"
}
},
"repositories": [
{
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
],
"require-dev": {
"eaglewu/swoole-ide-helper": "dev-master",
"phpunit/phpunit": "^5.7",
"friendsofphp/php-cs-fixer": "^2.11"
},
"scripts": {
"test": "./vendor/bin/phpunit -c phpunit.xml"
}
}
22 changes: 22 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="./test/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Tests">
<directory suffix="Test.php">./test/Cases</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
</whitelist>
</filter>
</phpunit>

Loading

0 comments on commit 5761422

Please sign in to comment.