Expand TrustLab certificate failure scenarios
This commit is contained in:
1 parent
9830f444ac
commit
f1fcef9b85
7 files changed
+240
-16
No files matched your search
@@ -57,6 +57,29 @@ export function createVillageCommunityPlugin() {
|
||||
};
|
||||
}
|
||||
|
||||
export function createCommunityAdvicePlugin({
|
||||
id,
|
||||
name,
|
||||
trusted,
|
||||
message,
|
||||
}) {
|
||||
return {
|
||||
manifest: { id, name, role: "advisor" },
|
||||
collectEvidence() {
|
||||
return {
|
||||
entries: [
|
||||
{
|
||||
kind: "vote",
|
||||
code: trusted ? "community-votes-trusted" : "community-votes-not-trusted",
|
||||
message,
|
||||
data: { trusted },
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function createUserDecisionPlugin(decision) {
|
||||
if (decision !== true && decision !== false) return undefined;
|
||||
return {
|
||||
@@ -84,7 +107,8 @@ function explainValidationError(error) {
|
||||
expired: "At least one certificate in the validation path is outside its validity period.",
|
||||
"hostname-mismatch":
|
||||
"The leaf certificate does not identify the requested hostname.",
|
||||
"explicitly-distrusted-authority":
|
||||
"The chain reaches an authority rejected by an explicit local Browsec rule.",
|
||||
};
|
||||
return explanations[error] ?? `Firefox reported certificate error: ${error}.`;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user