mirror of
https://github.com/stackblitz/bolt.new
synced 2025-06-26 18:17:50 +00:00
🔑 [refactor] Improve API key and AWS credentials management
- Translate comments to English for consistency - Add explanatory comment for AWS credentials function - Refactor default region assignment with inline comment
This commit is contained in:
parent
d86eaa420e
commit
2470806696
@ -16,16 +16,17 @@ export function getAPIKey(cloudflareEnv: Env, provider: string) {
|
||||
return env.GROQ_API_KEY || cloudflareEnv.GROQ_API_KEY;
|
||||
case 'OpenRouter':
|
||||
return env.OPEN_ROUTER_API_KEY || cloudflareEnv.OPEN_ROUTER_API_KEY;
|
||||
// Bedrock用のAWSクレデンシャルは別途取得
|
||||
// AWS credentials for Bedrock are obtained separately
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// This function retrieves AWS credentials from environment variables
|
||||
export function getAWSCredentials(cloudflareEnv: Env) {
|
||||
return {
|
||||
accessKeyId: env.AWS_ACCESS_KEY_ID || cloudflareEnv.AWS_ACCESS_KEY_ID,
|
||||
secretAccessKey: env.AWS_SECRET_ACCESS_KEY || cloudflareEnv.AWS_SECRET_ACCESS_KEY,
|
||||
region: env.AWS_REGION || cloudflareEnv.AWS_REGION || 'us-east-1', // デフォルトリージョン
|
||||
region: env.AWS_REGION || cloudflareEnv.AWS_REGION || 'us-east-1', // Default region
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user