Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .config/.remarkrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": [
"remark-preset-lint-recommended",
["remark-lint-list-item-indent", "space"]
]
}
14 changes: 14 additions & 0 deletions .config/.yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
extends: default

ignore: |
vendor/

rules:
brackets:
max-spaces-inside: 1
document-start: disable
line-length:
level: warning
max: 120
truthy: {allowed-values: ["true", "false", "on"]}
46 changes: 46 additions & 0 deletions .github/workflows/json.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: JSON Quality Assistance

on:
# This event occurs when there is activity on a pull request. The workflow
# will be run against the commits, after merge to the target branch (main).
pull_request:
branches: [ main ]
paths:
- '**.json'
- '.github/workflows/json.yml'
types: [ opened, reopened, synchronize ]
# This event occurs when there is a push to the repository.
push:
paths:
- '**.json'
- '.github/workflows/json.yml'
# Allow manually triggering the workflow.
workflow_dispatch:

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
# Needed to allow the "concurrency" section to cancel a workflow run.
actions: write

jobs:
# 01.preflight.json.lint-syntax.yml
lint-json-syntax:
name: JSON Syntax Linting
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: docker://pipelinecomponents/jsonlint
with:
args: >-
find .
-not -path '*/.git/*'
-not -path '*/node_modules/*'
-not -path '*/vendor/*'
-name '*.json'
-type f
-exec jsonlint --quiet {} ;
42 changes: 42 additions & 0 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Markdown Quality Assistance

on:
# This event occurs when there is activity on a pull request. The workflow
# will be run against the commits, after merge to the target branch (main).
pull_request:
branches: [ main ]
paths:
- '**.md'
- '.github/workflows/markdown.yml'
types: [ opened, reopened, synchronize ]
# This event occurs when there is a push to the repository.
push:
paths:
- '**.md'
- '.github/workflows/markdown.yml'
# Allow manually triggering the workflow.
workflow_dispatch:

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
# Needed to allow the "concurrency" section to cancel a workflow run.
actions: write

jobs:
# 01.quality.markdown.lint-syntax.yml
lint-markdown-syntax:
name: Markdown Linting
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: docker://pipelinecomponents/remark-lint
with:
args: >-
remark
--rc-path=.config/.remarkrc
--ignore-pattern='*/vendor/*'
134 changes: 134 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
name: PHP Quality Assistance

on:
# This event occurs when there is activity on a pull request. The workflow
# will be run against the commits, after merge to the target branch (main).
pull_request:
paths:
- '**.php'
- '.config/phpcs.xml.dist'
- 'tests/phpunit/phpunit.xml'
- '.github/workflows/php.yml'
- 'composer.json'
- 'composer.lock'
branches: [ main, feature/php-ci ]
types: [ opened, reopened, synchronize ]
# This event occurs when there is a push to the repository.
push:
paths:
- '**.php'
- '.config/phpcs.xml.dist'
- 'tests/phpunit/phpunit.xml'
- '.github/workflows/php.yml'
- 'composer.json'
- 'composer.lock'
# Allow manually triggering the workflow.
workflow_dispatch:


# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
# Needed to allow the "concurrency" section to cancel a workflow run.
actions: write

jobs:
# 01.preflight.php.lint-syntax.yml
lint-php-syntax:
name: PHP Syntax Linting
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: docker://pipelinecomponents/php-linter
with:
args: >-
parallel-lint
--exclude .git
--exclude vendor
--no-progress
.
# # 01.quality.php.validate.dependencies-file.yml
validate-dependencies-file:
name: Validate dependencies file
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >-
composer validate
--check-lock
--no-plugins
--no-scripts
--strict
# 02.test.php.test-unit.yml
php-unittest:
name: PHP Unit Tests
needs:
- lint-php-syntax
- validate-dependencies-file
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
php:
- '8.1' # from 2021-11 to 2023-11 (2025-12)
- '8.2' # from 2022-12 to 2024-12 (2026-12)
- '8.3' # from 2023-11 to 2025-12 (2027-12)
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
coverage: xdebug
ini-values: error_reporting=E_ALL, display_errors=On
php-version: ${{ matrix.php }}
- name: Install and Cache Composer dependencies
uses: "ramsey/composer-install@v2"
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
- run: vendor/bin/phpunit --configuration tests/phpunit/phpunit.xml
# 03.quality.php.scan.dependencies-vulnerabilities.yml
scan-dependencies-vulnerabilities:
name: Scan Dependencies Vulnerabilities
needs:
- validate-dependencies-file
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install and Cache Composer dependencies
uses: "ramsey/composer-install@v2"
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
- run: >-
composer audit
--abandoned=report
--no-dev
--no-plugins
--no-scripts
# 03.quality.php.lint-version-compatibility.yml
php-check-version-compatibility:
name: PHP Version Compatibility
needs:
- lint-php-syntax
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
php:
- '8.1' # from 2021-11 to 2023-11 (2025-12)
- '8.2' # from 2022-12 to 2024-12 (2026-12)
- '8.3' # from 2023-11 to 2025-12 (2027-12)
steps:
- uses: actions/checkout@v4
- uses: docker://pipelinecomponents/php-codesniffer
with:
args: >-
phpcs
-s
--extensions=php
--ignore='*vendor/*'
--runtime-set testVersion ${{ matrix.php }}
--standard=PHPCompatibility
.
42 changes: 42 additions & 0 deletions .github/workflows/yaml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: YAML Quality Assistance

on:
# This event occurs when there is activity on a pull request. The workflow
# will be run against the commits, after merge to the target branch (main).
pull_request:
branches: [ main ]
paths:
- '**.yml'
- '**.yaml'
types: [ opened, reopened, synchronize ]
# This event occurs when there is a push to the repository.
push:
paths:
- '**.yml'
- '**.yaml'
# Allow manually triggering the workflow.
workflow_dispatch:

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
# Needed to allow the "concurrency" section to cancel a workflow run.
actions: write

jobs:
# 01.preflight.yaml.lint.yml
lint-yaml:
name: YAML Linting
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: docker://pipelinecomponents/yamllint
with:
args: >-
yamllint
--config-file=.config/.yamllint
.
19 changes: 18 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,21 @@
- [v] webid
- [v] wac
- [v] solid-crud
- [v] CI integration
- [v] CI integration

------ Unit tests -----
- [v] ClientRegistration
- [v] JtiStore
- [v] IpAttempts
- [v] Util
- [v] PasswordValidator
- [ ] Mailer
- [ ] MailTemplateGenerator
- [ ] MailTemplates
- [ ] Server
- [ ] SolidNotifications
- [ ] SolidPubSub
- [ ] StorageServer
- [ ] User
- [-] Middleware
- [-] Db
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "pdsinterop/php-solid",
"description": "Multi-user Solid Server for PHP",
"type": "project",
"license": "MIT",
"autoload": {
Expand All @@ -17,12 +18,12 @@
"pdsinterop/solid-auth": "v0.13.0",
"pdsinterop/solid-crud": "v0.8.1",
"phpmailer/phpmailer": "^6.10",
"sweetrdf/easyrdf": "v1.15",
"sweetrdf/easyrdf": "~1.15.0",
"phpseclib/bcmath_compat": "^2.0",
"phrity/websocket": "^3.5"
},
"require-dev": {
"phpunit/phpunit": "^12.2",
"phpunit/phpunit": "^9 || ^10 || ^11 || ^12",
"phpstan/phpstan": "^2.1"
}
}
4 changes: 2 additions & 2 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function initDatabase() {
)',
'CREATE TABLE IF NOT EXISTS jti (
jti VARCHAR(255) NOT NULL PRIMARY KEY,
expires TEXT
expires TEXT NOT NULL
)',
'CREATE TABLE IF NOT EXISTS users (
user_id VARCHAR(255) NOT NULL PRIMARY KEY,
Expand All @@ -43,7 +43,7 @@ function initDatabase() {
'CREATE TABLE IF NOT EXISTS ipAttempts (
ip VARCHAR(255) NOT NULL,
type VARCHAR(255) NOT NULL,
expires NOT NULL
expires TEXT NOT NULL
)',
];

Expand Down
Loading