Skip to content

Commit 0884ca3

Browse files
🎉 Initial commit
0 parents  commit 0884ca3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+6625
-0
lines changed

.github/logo.png

9.28 KB
Loading

.github/pull_request_template.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# 概要
2+
<!-- 当プルリクエストの概要を記載してください。 -->
3+
Issue: {IssueURL or Issue ID}
4+
5+
# 実装内容
6+
<!-- 当プルリクエストの実装内容を記載してください。 -->
7+
- [ ] 例: Provider.php のバリデーション処理追加
8+
9+
# スクリーンショット
10+
<!-- 当プルリクエストでスクリーンショットが必要な場合記述してください。必須ではありません。 -->
11+
12+
# QA
13+
- [ ] 例: xxx 機能のテスト追加
14+
- [ ] 例: xxx 機能の疎通確認
15+
16+
# セキュリティチェック
17+
- [ ] 機密情報静的解析ツールの実施
18+
- [ ] 脆弱性ツールの実施

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: ci
2+
on: [push]
3+
jobs:
4+
phpunit:
5+
name: PHPUnit / PHP ${{ matrix.php-versions }}
6+
runs-on: ubuntu-latest
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
php-versions: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ]
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Setup
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: ${{ matrix.php-versions }}
19+
20+
- name: Download dependencies
21+
run: composer install --no-progress --prefer-dist --optimize-autoloader
22+
23+
- name: Test
24+
run: composer test

.github/workflows/static.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: static
2+
on: [push]
3+
jobs:
4+
static:
5+
name: PHP Static Analyse
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v2
10+
11+
- name: Setup
12+
uses: shivammathur/setup-php@v2
13+
with:
14+
php-version: '7.4'
15+
16+
- name: Download dependencies
17+
run: composer update --no-interaction --no-progress
18+
19+
- name: Download bin dependencies
20+
run: composer bin all update --no-interaction --no-progress
21+
22+
- name: Lint
23+
run: composer lint
24+
25+
- name: Stan
26+
run: composer stan

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# OS
2+
.DS_Store
3+
4+
# IDE
5+
.idea
6+
.vscode
7+
8+
# Cache
9+
.dccache
10+
*.cache
11+
12+
# Composer
13+
vendor/
14+
composer.phar
15+
composer.lock
16+
17+
# PHP
18+
/phpstan.nexon
19+
/phpunit.xml
20+
build/
21+
artifacts/

.php-cs-fixer.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__ . '/src')
5+
->in(__DIR__ . '/examples')
6+
->in(__DIR__ . '/tests');
7+
8+
$config = new PhpCsFixer\Config();
9+
return $config
10+
->setRules([
11+
'@PSR2' => true,
12+
'blank_line_after_opening_tag' => false,
13+
'linebreak_after_opening_tag' => false,
14+
'no_superfluous_phpdoc_tags' => false,
15+
'array_syntax' => [
16+
'syntax' => 'short',
17+
],
18+
'binary_operator_spaces' => [
19+
'operators' => [
20+
'=>' => 'align',
21+
'=' => 'single_space',
22+
],
23+
],
24+
'simplified_null_return' => true,
25+
'blank_line_after_namespace' => true,
26+
'function_typehint_space' => true,
27+
'multiline_comment_opening_closing' => true,
28+
'no_unused_imports' => true,
29+
'single_line_after_imports' => true,
30+
'fully_qualified_strict_types' => true,
31+
])
32+
->setUsingCache(false)
33+
->setFinder($finder);

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 GameWith
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<p align="center">
2+
<img src=".github/logo.png">
3+
</p>
4+
5+
# GameWith OIDC SDK For PHP
6+
[![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)
7+
8+
GameWith アカウント連携の PHP SDK です。[OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html) に基づいて実装しています。
9+
10+
現在は **Authorization Code Flow** のみ対応しています。
11+
12+
## インストール
13+
14+
事前に Composer をインストールしていただく必要が御座います。
15+
以下のリンクからダウンロードおよびインストールのセットアップをしてください。
16+
17+
[Download Composer](https://getcomposer.org/download)
18+
19+
composer.json ファイルに以下の内容を定義してください。
20+
21+
```json
22+
{
23+
"require": {
24+
"gamewith/gamewith-oidc-sdk": "^1.0"
25+
},
26+
"repositories": [
27+
{
28+
"type": "vcs",
29+
"url": "https://github.com/gamewith/gamewith-oidc-sdk-for-php"
30+
}
31+
]
32+
}
33+
```
34+
35+
最後に以下のコマンドを実行すると GameWith OIDC SDK のインストールが完了いたします。
36+
37+
```console
38+
$ composer install
39+
```
40+
41+
## 利用方法
42+
43+
実装サンプルがありますので、[こちらのリンク](./examples)からご参照ください。
44+
45+
## PHP サポートバージョン
46+
47+
| PHP バージョン |
48+
| --- |
49+
| 7.0 |
50+
| 7.1 |
51+
| 7.2 |
52+
| 7.3 |
53+
| 7.4 |
54+
| 8.0 |
55+
| 8.1 |
56+
57+
## ライセンス
58+
59+
GameWith OIDC SDK For PHP は MIT ライセンスになります。詳細は [LICENSE](./LICENSE) をご参照ください。

SECURITY.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# セキュリティポリシー
2+
3+
## サポートバージョン
4+
5+
GameWith OIDC SDK のセキュリティサポートバージョン一覧です。
6+
7+
| Version | Supported |
8+
| ------- | ------------------ |
9+
| 1.x | :white_check_mark: |
10+
11+
:white_check_mark: になっているバージョンはセキュリティサポート対象です。
12+
13+
:x: になっているバージョンはセキュリティサポート対象外です。セキュリティサポート対象のバージョンにアップデート推奨いたします。
14+
15+
## 脆弱性のご報告について
16+
当リポジトリで脆弱性を発見された方は、こちらの[お問い合わせ(その他)](https://gamewith.jp/inform/feedback)からご報告いただけると幸いです。
17+
18+
**Issues など公開されている場でのご報告は、お控え願います。**
19+
20+
## その他
21+
GameWith OIDC SDK で利用している外部パッケージに関しましては、比較的広域でバージョンを指定しています。
22+
そのため、各外部パッケージのバージョンアップデートは各自行っていただきますよう願います。

composer.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "gamewith/gamewith-oidc-sdk",
3+
"version": "1.0.0",
4+
"authors": [
5+
{
6+
"name": "GameWith",
7+
"email": "service-dev@gamewith.co.jp"
8+
}
9+
],
10+
"scripts": {
11+
"test": "phpunit",
12+
"lint": "php-cs-fixer fix --dry-run --diff",
13+
"lintfix": "php-cs-fixer fix --diff --config .php-cs-fixer.php",
14+
"stan": "phpstan analyse -c phpstan.neon.dist"
15+
},
16+
"require": {
17+
"php": ">=7.0",
18+
"ext-json": "*",
19+
"ext-curl": "*",
20+
"ext-openssl": "*",
21+
"guzzlehttp/guzzle": "^6|^7",
22+
"phpseclib/phpseclib": "^3.0"
23+
},
24+
"autoload": {
25+
"psr-4": {
26+
"GameWith\\Oidc\\": "src/"
27+
}
28+
},
29+
"autoload-dev": {
30+
"psr-4": {
31+
"GameWith\\Oidc\\Tests\\": "tests/"
32+
}
33+
},
34+
"require-dev": {
35+
"phpunit/phpunit": "^6|^7|^8|^9",
36+
"mockery/mockery": "^1",
37+
"yoast/phpunit-polyfills": "^1",
38+
"bamarni/composer-bin-plugin": "^1"
39+
},
40+
"config": {
41+
"allow-plugins": {
42+
"bamarni/composer-bin-plugin": true
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)