-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0884ca3
Showing
68 changed files
with
6,625 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,18 @@ | ||
# 概要 | ||
<!-- 当プルリクエストの概要を記載してください。 --> | ||
Issue: {IssueURL or Issue ID} | ||
|
||
# 実装内容 | ||
<!-- 当プルリクエストの実装内容を記載してください。 --> | ||
- [ ] 例: Provider.php のバリデーション処理追加 | ||
|
||
# スクリーンショット | ||
<!-- 当プルリクエストでスクリーンショットが必要な場合記述してください。必須ではありません。 --> | ||
|
||
# QA | ||
- [ ] 例: xxx 機能のテスト追加 | ||
- [ ] 例: xxx 機能の疎通確認 | ||
|
||
# セキュリティチェック | ||
- [ ] 機密情報静的解析ツールの実施 | ||
- [ ] 脆弱性ツールの実施 |
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,24 @@ | ||
name: ci | ||
on: [push] | ||
jobs: | ||
phpunit: | ||
name: PHPUnit / PHP ${{ matrix.php-versions }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-versions: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
|
||
- name: Download dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Test | ||
run: 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,26 @@ | ||
name: static | ||
on: [push] | ||
jobs: | ||
static: | ||
name: PHP Static Analyse | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
|
||
- name: Download dependencies | ||
run: composer update --no-interaction --no-progress | ||
|
||
- name: Download bin dependencies | ||
run: composer bin all update --no-interaction --no-progress | ||
|
||
- name: Lint | ||
run: composer lint | ||
|
||
- name: Stan | ||
run: composer stan |
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 @@ | ||
# OS | ||
.DS_Store | ||
|
||
# IDE | ||
.idea | ||
.vscode | ||
|
||
# Cache | ||
.dccache | ||
*.cache | ||
|
||
# Composer | ||
vendor/ | ||
composer.phar | ||
composer.lock | ||
|
||
# PHP | ||
/phpstan.nexon | ||
/phpunit.xml | ||
build/ | ||
artifacts/ |
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 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__ . '/src') | ||
->in(__DIR__ . '/examples') | ||
->in(__DIR__ . '/tests'); | ||
|
||
$config = new PhpCsFixer\Config(); | ||
return $config | ||
->setRules([ | ||
'@PSR2' => true, | ||
'blank_line_after_opening_tag' => false, | ||
'linebreak_after_opening_tag' => false, | ||
'no_superfluous_phpdoc_tags' => false, | ||
'array_syntax' => [ | ||
'syntax' => 'short', | ||
], | ||
'binary_operator_spaces' => [ | ||
'operators' => [ | ||
'=>' => 'align', | ||
'=' => 'single_space', | ||
], | ||
], | ||
'simplified_null_return' => true, | ||
'blank_line_after_namespace' => true, | ||
'function_typehint_space' => true, | ||
'multiline_comment_opening_closing' => true, | ||
'no_unused_imports' => true, | ||
'single_line_after_imports' => true, | ||
'fully_qualified_strict_types' => true, | ||
]) | ||
->setUsingCache(false) | ||
->setFinder($finder); |
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 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 GameWith | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,59 @@ | ||
<p align="center"> | ||
<img src=".github/logo.png"> | ||
</p> | ||
|
||
# GameWith OIDC SDK For PHP | ||
[![ci](https://github.com/GameWith/gamewith-oidc-sdk-for-php/actions/workflows/ci.yml/badge.svg)](https://github.com/GameWith/gamewith-oidc-sdk-for-php/actions/workflows/ci.yml) | ||
|
||
GameWith アカウント連携の PHP SDK です。[OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html) に基づいて実装しています。 | ||
|
||
現在は **Authorization Code Flow** のみ対応しています。 | ||
|
||
## インストール | ||
|
||
事前に Composer をインストールしていただく必要が御座います。 | ||
以下のリンクからダウンロードおよびインストールのセットアップをしてください。 | ||
|
||
[Download Composer](https://getcomposer.org/download) | ||
|
||
composer.json ファイルに以下の内容を定義してください。 | ||
|
||
```json | ||
{ | ||
"require": { | ||
"gamewith/gamewith-oidc-sdk": "^1.0" | ||
}, | ||
"repositories": [ | ||
{ | ||
"type": "vcs", | ||
"url": "https://github.com/gamewith/gamewith-oidc-sdk-for-php" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
最後に以下のコマンドを実行すると GameWith OIDC SDK のインストールが完了いたします。 | ||
|
||
```console | ||
$ composer install | ||
``` | ||
|
||
## 利用方法 | ||
|
||
実装サンプルがありますので、[こちらのリンク](./examples)からご参照ください。 | ||
|
||
## PHP サポートバージョン | ||
|
||
| PHP バージョン | | ||
| --- | | ||
| 7.0 | | ||
| 7.1 | | ||
| 7.2 | | ||
| 7.3 | | ||
| 7.4 | | ||
| 8.0 | | ||
| 8.1 | | ||
|
||
## ライセンス | ||
|
||
GameWith OIDC SDK For PHP は MIT ライセンスになります。詳細は [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,22 @@ | ||
# セキュリティポリシー | ||
|
||
## サポートバージョン | ||
|
||
GameWith OIDC SDK のセキュリティサポートバージョン一覧です。 | ||
|
||
| Version | Supported | | ||
| ------- | ------------------ | | ||
| 1.x | :white_check_mark: | | ||
|
||
:white_check_mark: になっているバージョンはセキュリティサポート対象です。 | ||
|
||
:x: になっているバージョンはセキュリティサポート対象外です。セキュリティサポート対象のバージョンにアップデート推奨いたします。 | ||
|
||
## 脆弱性のご報告について | ||
当リポジトリで脆弱性を発見された方は、こちらの[お問い合わせ(その他)](https://gamewith.jp/inform/feedback)からご報告いただけると幸いです。 | ||
|
||
**Issues など公開されている場でのご報告は、お控え願います。** | ||
|
||
## その他 | ||
GameWith OIDC SDK で利用している外部パッケージに関しましては、比較的広域でバージョンを指定しています。 | ||
そのため、各外部パッケージのバージョンアップデートは各自行っていただきますよう願います。 |
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,45 @@ | ||
{ | ||
"name": "gamewith/gamewith-oidc-sdk", | ||
"version": "1.0.0", | ||
"authors": [ | ||
{ | ||
"name": "GameWith", | ||
"email": "service-dev@gamewith.co.jp" | ||
} | ||
], | ||
"scripts": { | ||
"test": "phpunit", | ||
"lint": "php-cs-fixer fix --dry-run --diff", | ||
"lintfix": "php-cs-fixer fix --diff --config .php-cs-fixer.php", | ||
"stan": "phpstan analyse -c phpstan.neon.dist" | ||
}, | ||
"require": { | ||
"php": ">=7.0", | ||
"ext-json": "*", | ||
"ext-curl": "*", | ||
"ext-openssl": "*", | ||
"guzzlehttp/guzzle": "^6|^7", | ||
"phpseclib/phpseclib": "^3.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"GameWith\\Oidc\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"GameWith\\Oidc\\Tests\\": "tests/" | ||
} | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^6|^7|^8|^9", | ||
"mockery/mockery": "^1", | ||
"yoast/phpunit-polyfills": "^1", | ||
"bamarni/composer-bin-plugin": "^1" | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"bamarni/composer-bin-plugin": true | ||
} | ||
} | ||
} |
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,50 @@ | ||
# 実装サンプル | ||
|
||
GameWith アカウント連携の PHP SDK を利用した実装サンプルです。 | ||
|
||
## ディレクトリ構成 | ||
|
||
``` | ||
├── public # ローカルサーバの起動対象ディレクトリです。 | ||
│ ├── index.php # 各機能のルーティングおよび機能実装をしています。 | ||
│ └── style.css | ||
├── settings.php # クライアント情報・接続情報などの設定をします。 | ||
└── views # 各機能の view を定義しています。 | ||
├── error.php | ||
├── index.php | ||
├── token.php | ||
└── userinfo.php | ||
``` | ||
|
||
## セットアップ | ||
|
||
**settings.php** ファイルの設定項目を変更してください。 | ||
|
||
```php | ||
return [ | ||
'client' => [ | ||
'client_id' => '[提供された client_id を入力してください]', | ||
'client_secret' => '[提供された client_secret を入力してください]', | ||
'redirect_uri' => '[ご登録された redirect_uri を入力してください]' | ||
], | ||
'provider' => [ | ||
// トークン発行者 | ||
'issuer' => '[提供された issuer を入力してください]', | ||
// 認証リクエストのエンドポイント | ||
'authorization_endpoint' => '[提供された authorization_endpoint を入力してください]', | ||
// トークンリクエストのエンドポイント | ||
'token_endpoint' => '[提供された token_endpoint を入力してください]', | ||
// ユーザー情報リクエストのエンドポイント | ||
'userinfo_endpoint' => '[提供された userinfo_endpoint を入力してください]', | ||
// Jwks 取得のエンドポイント | ||
'jwks_endpoint' => '[提供された jwks_endpoint を入力してください]', | ||
] | ||
]; | ||
``` | ||
|
||
## 起動方法 | ||
|
||
```console | ||
$ cd ./public | ||
$ php -S localhost:8863 | ||
``` |
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,2 @@ | ||
RewriteEngine on | ||
RewriteRule ^(.*)$ index.php [L] |
Oops, something went wrong.