Import verified AzerothAI snapshot from GitHub
Core tests / core (push) Successful in 9m57s
Full verification / application (push) Failing after 5m16s
Full verification / local-brain (push) Failing after 6m15s
Realm simulation / simulated-live-world (push) Failing after 5m32s
WoW integration lab / real-worldserver (push) Canceled after 17m23s
Core tests / core (push) Successful in 9m57s
Full verification / application (push) Failing after 5m16s
Full verification / local-brain (push) Failing after 6m15s
Realm simulation / simulated-live-world (push) Failing after 5m32s
WoW integration lab / real-worldserver (push) Canceled after 17m23s
Source branch: feature/ai-brain-router Source commit: c2a09e0460465201a58aaab56c71424e9a96405e
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import type { RuntimeConfig } from './types';
|
||||
|
||||
export function bearer(request:Request){
|
||||
const value=request.headers.get('authorization')??'';
|
||||
return value.startsWith('Bearer ')?value.slice(7):'';
|
||||
}
|
||||
|
||||
export function requireAleBridge(request:Request,config:RuntimeConfig){
|
||||
const expected=config.ALE_BRIDGE_TOKEN;
|
||||
if(!expected||bearer(request)!==expected)throw new Error('Unauthorized ALE bridge');
|
||||
}
|
||||
|
||||
export function requireAleOperator(request:Request,config:RuntimeConfig){
|
||||
const expected=config.ALE_OPERATOR_TOKEN;
|
||||
if(!expected||bearer(request)!==expected)throw new Error('Unauthorized ALE operator');
|
||||
}
|
||||
|
||||
export function rawAleEnabled(config:RuntimeConfig){
|
||||
return String(config.ALE_RAW_EXEC_ENABLED??'').toLowerCase()==='true';
|
||||
}
|
||||
Reference in New Issue
Block a user