set default keys for copilot, agents

This commit is contained in:
ramnique 2025-01-29 10:08:19 +05:30
parent ad4ea23d79
commit 3d13471723
4 changed files with 4 additions and 4 deletions

View file

@ -27,7 +27,7 @@ def require_api_key(f):
return jsonify({'error': 'Missing or invalid authorization header'}), 401
token = auth_header.split('Bearer ')[1]
if token != os.environ.get('API_KEY'):
if token != os.environ.get('API_KEY', 'test'):
return jsonify({'error': 'Invalid API key'}), 403
return f(*args, **kwargs)

View file

@ -34,7 +34,7 @@ def require_api_key(f):
return jsonify({'error': 'Missing or invalid authorization header'}), 401
token = auth_header.split('Bearer ')[1]
if token != os.environ.get('API_KEY'):
if token != os.environ.get('API_KEY', 'test'):
return jsonify({'error': 'Invalid API key'}), 403
return f(*args, **kwargs)

View file

@ -504,7 +504,7 @@ export async function getCopilotResponse(
body: JSON.stringify(request),
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.COPILOT_API_KEY}`,
'Authorization': `Bearer ${process.env.COPILOT_API_KEY || 'test'}`,
},
});
if (!response.ok) {

View file

@ -167,7 +167,7 @@ export async function getAgenticApiResponse(
body: JSON.stringify(request),
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.AGENTS_API_KEY}`,
'Authorization': `Bearer ${process.env.AGENTS_API_KEY || 'test'}`,
},
});
if (!response.ok) {