MCPcopy
hub / github.com/coder/mux / getActivePolicySource

Method getActivePolicySource

src/node/services/policyService.ts:328–343  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

326 }
327
328 private getActivePolicySource(): ActivePolicySource {
329 const filePath = process.env.MUX_POLICY_FILE?.trim();
330 if (filePath) {
331 return { kind: "env", value: filePath };
332 }
333
334 const config = this.config.loadConfigOrDefault();
335 const governorOrigin = config.muxGovernorUrl?.trim();
336 const governorToken = config.muxGovernorToken?.trim();
337
338 if (governorOrigin && governorToken) {
339 return { kind: "governor", origin: governorOrigin, token: governorToken };
340 }
341
342 return { kind: "none" };
343 }
344
345 private async refreshPolicy(options: { isStartup: boolean }): Promise<Result<void, string>> {
346 if (this.refreshInFlight) {

Callers 1

refreshPolicyOnceMethod · 0.95

Calls 1

loadConfigOrDefaultMethod · 0.80

Tested by

no test coverage detected