()
| 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) { |
no test coverage detected