|
| 1 | +# Contributing to SimpleSAMLphp Module OIDC |
| 2 | + |
| 3 | +Thank you for your interest in contributing to `simplesamlphp-module-oidc`! |
| 4 | + |
| 5 | +## Target Branch |
| 6 | + |
| 7 | +Open pull requests against the `master` branch, which tracks the currently released version. |
| 8 | + |
| 9 | +## Development & Quality Checks |
| 10 | + |
| 11 | +Before submitting a Pull Request, please make sure your changes adhere to the project's coding standards and pass all automated checks: |
| 12 | + |
| 13 | +1. **Line Endings:** Use Unix-style LF (`\n`) line endings across all files. |
| 14 | +2. **Quality & Test Suite:** Run the pre-commit suite defined in `composer.json`: |
| 15 | + |
| 16 | + ```bash |
| 17 | + composer pre-commit |
| 18 | + ``` |
| 19 | + |
| 20 | + This executes: |
| 21 | + * **PHP_CodeSniffer** (`vendor/bin/phpcbf` and `vendor/bin/phpcs`) |
| 22 | + * **Psalm** (`vendor/bin/psalm`) |
| 23 | + * **PHPUnit** (`vendor/bin/phpunit`) |
| 24 | + |
| 25 | + `phpcbf` fixes coding-standard violations in place. If it changes any files, review the changes and run the command again until it passes. |
| 26 | + |
| 27 | +3. **Targeted Tests:** You can also run unit and integration suites separately: |
| 28 | + |
| 29 | + ```bash |
| 30 | + composer unit-tests |
| 31 | + composer integration-tests |
| 32 | + ``` |
| 33 | + |
| 34 | + The integration tests start their dependencies in containers (Testcontainers), so they need a running Docker daemon. |
| 35 | + |
| 36 | +## Reporting Security Vulnerabilities |
| 37 | + |
| 38 | +Please do not report security vulnerabilities in public issues or pull requests. Report them privately through [GitHub's private vulnerability reporting](https://github.com/simplesamlphp/simplesamlphp-module-oidc/security/advisories/new) for this repository instead. |
| 39 | + |
| 40 | +## AI-Assisted Contributions Policy |
| 41 | + |
| 42 | +We welcome the responsible use of Large Language Models (LLMs) and AI coding assistants, provided that **human accountability** and **transparency** are maintained. |
| 43 | + |
| 44 | +### 1. Human Accountability |
| 45 | + |
| 46 | +* **You are the author:** The human contributor bears 100% responsibility for the correctness, licensing compliance, and security of the submitted code. |
| 47 | +* **Understand what you submit:** Because this module implements security-critical authentication and authorization protocols (OAuth 2.0 / OpenID Connect), you must personally review, test, and understand every line of code in your contribution. Unverified or unreviewed AI-generated pull requests will be closed. |
| 48 | + |
| 49 | +### 2. Mandatory Disclosure |
| 50 | + |
| 51 | +If AI tools materially assisted with your contribution (for example: drafting code, writing unit/integration tests, refactoring, or automated code reviews whose findings you acted on—beyond basic single-line IDE autocomplete), you must disclose their use. |
| 52 | + |
| 53 | +#### In Commit Messages (Preferred) |
| 54 | + |
| 55 | +Include one or more `Assisted-by:` trailers at the bottom of your commit message specifying the tool, the model (its exact identifier, as the tool reports it), and optionally the scope of assistance: |
| 56 | + |
| 57 | +```text |
| 58 | +Assisted-by: <Tool Name> (<Model ID>, <optional scope>) |
| 59 | +``` |
| 60 | + |
| 61 | +Examples: |
| 62 | + |
| 63 | +```text |
| 64 | +Assisted-by: Claude Code (claude-opus-5-5, implementation & unit tests) |
| 65 | +Assisted-by: OpenAI Codex (gpt-6.1-sol, xhigh review) |
| 66 | +Assisted-by: Google Antigravity (gemini-3.8-flash-high, review) |
| 67 | +``` |
| 68 | + |
| 69 | +#### In Pull Requests |
| 70 | + |
| 71 | +Fill out the **AI Usage Disclosure** section in the Pull Request template when opening a PR (especially if you did not include `Assisted-by:` trailers in individual commits). |
| 72 | + |
| 73 | +### 3. Avoid `Co-Authored-By:` for AI Tools |
| 74 | + |
| 75 | +Please **do not** use `Co-Authored-By:` (e.g., `Co-Authored-By: ... <noreply@...>`) or `Reviewed-by:` trailers for AI models. In Git history, authorship and formal review sign-off are reserved for human contributors; use `Assisted-by:` instead to record AI tool provenance. |
0 commit comments