The secrets a deployment needs, read from a file in the project that git never sees.
class MMO\admin\helpers\Credentials
Namespace
MMO\admin\helpers
This exists because of a specific, real failure: the previous pipeline kept the production ssh password in
`scripts/bootstrap.php`, a tracked file, which put it on 31 branches and in the history of every clone ever
made. `.gitignore` discipline alone would not have stopped it -- it is a convention, and conventions get
skipped -- so the rule here is structural rather than procedural: this file is REFUSED if git would commit
it ([`assertIgnored`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/helpers/Credentials.md#credentials-assertignored)). [`Server`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/entities/Server.md#server) declares only an auth *method*; the value behind it
is resolved, at use time, from here.
The file is per-project and per-machine, at [`FILENAME`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/helpers/Credentials.md#credentials-filename) beside `deploy.json`:
```json
{"servers": {
"ovh1": {"password": "..."},
"ovh2": {"privateKey": "~/.ssh/id_ed25519", "publicKey": "~/.ssh/id_ed25519.pub", "passphrase": "..."}
}}
```
Nobody else may read it (mode 0600), and git must ignore it. Either one failing is refused outright rather
than warned about, because a warning on a fleet tool is a warning nobody reads.
$credentials = new Credentials(Credentials::DefaultFilename('/var/www/my.oviepro'));
$credentials->get('ovh1', 'password');
protected function assertIgnored(string $filename): voidThe file lives in the project, so all that stands between it and the history of every clone is an ignore
rule -- and an ignore rule is exactly what is missing the day it matters: a `.gitignore` older than the
file, a pattern someone tidied away, a `git add -f`. So git is asked, every time the file is read. A
TRACKED file is refused even when a rule matches it, since ignoring never untracks anything, and with a
different remedy: what it holds may already be in a commit, and only changing the secrets undoes that.
Outside a repository, or on a machine without git, there is nothing to commit it to.
resolved through filename. A missing file is NOT an error: a project whose servers all authenticate through the ssh agent needs no credentials file at all.
throws
if the file exists but git would commit it, someone else can read it, or it is not JSON.