Page MenuHomePhabricator

D12226.id40745.diff
No OneTemporary

D12226.id40745.diff

diff --git a/keyserver/package.json b/keyserver/package.json
--- a/keyserver/package.json
+++ b/keyserver/package.json
@@ -15,7 +15,7 @@
"profile-prod": "KEYSERVER=true KEYSERVER_CPU_PROFILING_ENABLED=true 0x --output-dir cpu_profiling_logs/{pid}.0x -o -- node --trace-warnings --loader=./loader.mjs dist/keyserver",
"clear-profile-logs": "rm -rf cpu_profiling_logs/",
"dev-rsync": "yarn --silent chokidar --initial --silent -s 'src/**/*.json' 'src/**/*.cjs' -c 'yarn rsync > /dev/null 2>&1'",
- "dev": ". bash/source-nvm.sh && yarn concurrently --names=\"BABEL,RSYNC,NODEM\" -c \"bgBlue.bold,bgMagenta.bold,bgGreen.bold\" \"yarn babel-build --source-maps --watch\" \"yarn dev-rsync\" \". bash/source-nvm.sh && KEYSERVER=true NODE_ENV=development nodemon -e js,json,cjs --watch dist --no-warnings=ExperimentalWarning --loader=./loader.mjs dist/keyserver\"",
+ "dev": ". bash/source-nvm.sh && yarn concurrently --names=\"BABEL,RSYNC,NODEM\" -c \"bgBlue.bold,bgMagenta.bold,bgGreen.bold\" \"yarn babel-build --source-maps --watch\" \"yarn dev-rsync\" \". bash/source-nvm.sh && KEYSERVER=true AUTHORITATIVE_KEYSERVER=true NODE_ENV=development nodemon -e js,json,cjs --watch dist --no-warnings=ExperimentalWarning --loader=./loader.mjs dist/keyserver\"",
"dev-log-metrics": "KEYSERVER_ENDPOINT_METRICS_ENABLED=true yarn dev",
"script": ". bash/source-nvm.sh && NODE_ENV=development node --loader=./loader.mjs",
"test": "jest"
diff --git a/keyserver/src/user/identity.js b/keyserver/src/user/identity.js
--- a/keyserver/src/user/identity.js
+++ b/keyserver/src/user/identity.js
@@ -75,6 +75,19 @@
return cachedKeyserverID;
}
+async function isAuthoritativeKeyserver(): Promise<boolean> {
+ if (process.env.AUTHORITATIVE_KEYSERVER) {
+ return true;
+ }
+
+ const id = await thisKeyserverID();
+ if (id === ashoat.id) {
+ return true;
+ }
+
+ return false;
+}
+
export type AdminData = {
+username: string,
+id: string,
@@ -125,4 +138,5 @@
thisKeyserverID,
thisKeyserverAdmin,
saveIdentityInfo,
+ isAuthoritativeKeyserver,
};

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 1, 3:13 PM (21 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2604975
Default Alt Text
D12226.id40745.diff (2 KB)

Event Timeline