Keep a secret setting's raw value out of the boot error that rejects it #201
+3
-4
@@ -6,11 +6,10 @@ at boot. Entries start at 0.3.0.
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
### A plugin setting marked `secret` keeps its value out of the boot error that rejects it
|
### A secret plugin setting's bad value stays out of the boot error
|
||||||
|
|
||||||
A `secret` setting of type `boolean`, `enum`, `number` or `url` that fails validation names its
|
When a `secret` setting's value fails validation, the boot error no longer prints it, so a malformed
|
||||||
variable and what it accepts, and no longer prints the value, so a DSN with a password doesn't reach
|
DSN doesn't put its password in the log.
|
||||||
the log. A setting that isn't secret still prints the value it got.
|
|
||||||
|
|
||||||
### The admin's recovery-code notice links to the recovery flow the code belongs to
|
### The admin's recovery-code notice links to the recovery flow the code belongs to
|
||||||
|
|
||||||
|
|||||||
@@ -231,8 +231,7 @@ function summarize(decl: SettingDecl, name: string, source: SettingSummary["sour
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// A coerced value, or the boot error naming the variable and what it accepts. A secret's value
|
// A coerced value, or the boot error naming the variable and what it accepts.
|
||||||
// stays out of it: the error reaches the log.
|
|
||||||
function coerce(decl: SettingDecl, raw: string, name: string): { value: SettingValue } | string {
|
function coerce(decl: SettingDecl, raw: string, name: string): { value: SettingValue } | string {
|
||||||
const got = decl.secret === true ? "" : `, got "${raw}"`;
|
const got = decl.secret === true ? "" : `, got "${raw}"`;
|
||||||
switch (decl.type) {
|
switch (decl.type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user