fix: bound source retries and distinguish explicit key revocation

This commit is contained in:
2026-10-14 18:22:16 +08:00
parent 00858ac409
commit 6945095222
15 changed files with 1258 additions and 81 deletions
+1
View File
@@ -38,6 +38,7 @@ export function createHandler(release, {fetchImpl = globalThis.fetch} = {}) {
headers.set('X-Conf-Sshd-Key-Source', snapshot.source.type);
} catch (error) {
if (error.code !== 'KEY_SOURCES_UNAVAILABLE') throw error;
headers.set('X-Conf-Sshd-Source-Failure', error.failureKind);
if (url.pathname !== '/') return respond('No valid public key source is currently available. Existing server keys must be preserved.\n', 'text/plain; charset=utf-8', 503);
snapshot = {...release,keys:[],keyCount:0,sha256:null,source:{type:'unavailable'}};
}