mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
Fix to Bedrock ARN validation (#2538)
Fixes Bedrock ARN validation Updates the Bedrock ARN regex to allow alphanumeric characters, dots, hyphens, and colons in the resource ID. This prevents validation errors when using ARNs containing those characters.
This commit is contained in:
parent
e9980bcfa9
commit
294b52ef6a
2 changed files with 2 additions and 2 deletions
|
|
@ -515,7 +515,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
|
|||
* match[4] - The resource ID (e.g., "anthropic.claude-3-sonnet-20240229-v1:0")
|
||||
*/
|
||||
|
||||
const arnRegex = /^arn:aws:bedrock:([^:]+):([^:]*):(?:([^\/]+)\/(.+)|([^\/]+))$/
|
||||
const arnRegex = /^arn:aws:bedrock:([^:]+):([^:]*):(?:([^\/]+)\/([\w\.\-:]+)|([^\/]+))$/
|
||||
let match = arn.match(arnRegex)
|
||||
|
||||
if (match && match[1] && match[3] && match[4]) {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ export function validateApiConfiguration(apiConfiguration?: ApiConfiguration): s
|
|||
*/
|
||||
export function validateBedrockArn(arn: string, region?: string) {
|
||||
// Validate ARN format
|
||||
const arnRegex = /^arn:aws:bedrock:([^:]+):(\d+):(foundation-model|provisioned-model|default-prompt-router)\/(.+)$/
|
||||
const arnRegex = /^arn:aws:bedrock:([^:]+):([^:]*):(?:([^/]+)\/([\w.\-:]+)|([^/]+))$/
|
||||
const match = arn.match(arnRegex)
|
||||
|
||||
if (!match) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue