-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from aprchen/master
Basic auth , Bearer Token(JWT), Acl
- Loading branch information
Showing
41 changed files
with
2,361 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
Oops, something went wrong.