Skip to content

Commit f0595e0

Browse files
committed
fix: use bare secret key for botAppSecretRef, not ${secrets.} wrapper
The bridge expects a bare key (e.g. TEAMS_BOT_SECRET) that it resolves directly from the secret store. The ${secrets.} template pattern is for interpolation in deployment env vars, not for ref fields read by external services. Removes extractSecretName regex and SECRET_TEMPLATE_REGEX. Proto validation updated to accept bare UPPER_SNAKE_CASE keys.
1 parent 4376678 commit f0595e0

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

frontend/src/components/pages/agents/details/ai-agent-integrations-tab.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ import { formatToastErrorMessageGRPC } from 'utils/toast.utils';
3535

3636
const routeApi = getRouteApi('/agents/$id/');
3737

38-
const SECRET_TEMPLATE_REGEX = /^\$\{secrets\.([^}]+)\}$/;
39-
4038
const TEAMS_SECRET_TEXT = {
4139
dialogDescription: 'Create a new secret for your Microsoft Teams bot client secret.',
4240
secretNamePlaceholder: 'e.g., TEAMS_CLIENT_SECRET',
@@ -52,11 +50,6 @@ type TeamsBridgeState = {
5250
botAppSecretName: string;
5351
};
5452

55-
const extractSecretName = (ref: string): string => {
56-
const match = ref.match(SECRET_TEMPLATE_REGEX);
57-
return match ? match[1] : '';
58-
};
59-
6053
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Integrations tab with edit/view mode conditionals
6154
export const AIAgentIntegrationsTab = () => {
6255
const { id } = routeApi.useParams();
@@ -86,7 +79,7 @@ export const AIAgentIntegrationsTab = () => {
8679
enabled: agent.teamsBridge?.enabled ?? false,
8780
botAppId: agent.teamsBridge?.botAppId ?? '',
8881
botTenantId: agent.teamsBridge?.botTenantId ?? '',
89-
botAppSecretName: extractSecretName(agent.teamsBridge?.botAppSecretRef ?? ''),
82+
botAppSecretName: agent.teamsBridge?.botAppSecretRef ?? '',
9083
};
9184

9285
const updateField = (updates: Partial<TeamsBridgeState>) => {
@@ -98,7 +91,7 @@ export const AIAgentIntegrationsTab = () => {
9891
return;
9992
}
10093

101-
const secretRef = displayState.botAppSecretName ? `\${secrets.${displayState.botAppSecretName}}` : '';
94+
const secretRef = displayState.botAppSecretName || '';
10295

10396
try {
10497
await updateAIAgent(

proto/redpanda/api/dataplane/v1alpha3/ai_agent.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ message AIAgentTeamsBridge {
309309
string bot_tenant_id = 3;
310310
string bot_app_secret_ref = 4 [
311311
(buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE,
312-
(buf.validate.field).string.pattern = "^\\$\\{secrets\\.[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)?\\}$"
312+
(buf.validate.field).string.pattern = "^[A-Za-z_][A-Za-z0-9_]*$"
313313
];
314314
}
315315

0 commit comments

Comments
 (0)