The AI trust layer between agents: identity, agreements, safeguards, and outcome intelligence for A2A.
Commit 578449aa
578449aaa53eMerged
aryaamin <[email protected]> · 2 months ago · 31 files · +7 added · ~24 modified
Description
feat: add provider-first agent connections
Details
- Commit
- 578449aaa53e
- Parent
- 8941e5beacdd
api/index.tsmodifiedView file
@@ -25,6 +25,14 @@
2525
2626
const unsafeMethods = new Set(['POST', 'PUT', 'PATCH', 'DELETE']);2727
28+
function isPublicConnectorClaimRoute(method: string, requestUrl: string) {29+
const path = new URL(requestUrl, 'https://openclasp.local').pathname;30+
if (method === 'POST' && path === '/v0.1/provider-connections/botpress/complete') return true;31+
if (method === 'POST' && path === '/v0.1/connector-claims') return true;32+
if (method === 'GET' && /^\/v0\.1\/connector-claims\/[0-9a-f-]+$/.test(path)) return true;33+
return method === 'POST' && /^\/v0\.1\/connector-claims\/[0-9a-f-]+\/poll$/.test(path);34+
}35+
2836
function reject(response: ServerResponse, statusCode: number, error: string) {2937
response.statusCode = statusCode;3038
response.setHeader('content-type', 'application/json');@@ -41,6 +49,12 @@
4149
const target = incoming.searchParams.get('path');4250
if (target) request.url = target;4351
if ((request.url ?? '').startsWith('/v0.1/')) {52+
if (isPublicConnectorClaimRoute(request.method ?? 'GET', request.url ?? '/')) {53+
request.headers['x-openclasp-internal-auth'] = internalAuthSecret;54+
await ready;55+
app.server.emit('request', request, response);56+
return;57+
}4458
const authorization = request.headers.authorization;4559
const bearerToken = authorization?.startsWith('Bearer ') ? authorization.slice(7) : undefined;4660
const dashboardToken = bearerTokenapps/api/src/app.tsmodifiedView file
Loading diff…
apps/dashboard/src/components/first-run-guide.tsxmodifiedView file
Loading diff…
apps/dashboard/src/main.tsxmodifiedView file
Loading diff…
apps/dashboard/src/preview.tsmodifiedView file
Loading diff…
apps/dashboard/src/styles.cssmodifiedView file
Loading diff…
apps/runtime-sidecar/src/index.tsmodifiedView file
Loading diff…
connectors/botpress/hub.mdmodifiedView file
Loading diff…
connectors/botpress/icon.svgmodifiedView file
Loading diff…
connectors/botpress/integration.definition.tsmodifiedView file
Loading diff…
connectors/botpress/package.jsonmodifiedView file
Loading diff…
connectors/botpress/src/index.tsmodifiedView file
Loading diff…
connectors/botpress/src/profile.tsaddedView file
Loading diff…
docs/CONNECTORS.mdmodifiedView file
Loading diff…
docs/RUNTIME_CONNECTOR.mdmodifiedView file
Loading diff…
docs/SOCIAL_LOGIN_SETUP.mdmodifiedView file
Loading diff…
packages/persistence/src/connector-claim.tsaddedView file
Loading diff…
packages/persistence/src/hosted-migrations.tsmodifiedView file
Loading diff…
packages/persistence/src/hosted.tsmodifiedView file
Loading diff…
packages/persistence/src/index.tsmodifiedView file
Loading diff…
packages/persistence/src/onboarding.tsmodifiedView file
Loading diff…
packages/persistence/src/provider-connection.tsaddedView file
Loading diff…
packages/protocol/src/index.tsmodifiedView file
Loading diff…
packages/sdk/src/index.tsmodifiedView file
Loading diff…
tests/agent-card-onboarding.test.tsmodifiedView file
Loading diff…
tests/api.test.tsmodifiedView file
Loading diff…
tests/botpress-profile.test.tsaddedView file
Loading diff…
tests/connector-claim.test.tsaddedView file
Loading diff…
tests/provider-connection-api.test.tsaddedView file
Loading diff…
tests/provider-connection.test.tsaddedView file
Loading diff…
tests/source-record.test.tsmodifiedView file
Loading diff…