@inkeep/agents-run-api 0.0.0-dev-20250910232631 → 0.0.0-dev-20250910233133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"api-key-auth.d.ts","sourceRoot":"","sources":["../../src/middleware/api-key-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAmC,MAAM,qBAAqB,CAAC;AAQ7F;;;;GAIG;AACH,eAAO,MAAM,UAAU;eAER;QACT,gBAAgB,EAAE,gBAAgB,CAAC;KACpC;cAoHD,CAAC;AAEL,eAAO,MAAM,wBAAwB,GAAU,QAAQ,MAAM,8BAgB5D,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,YAAY;eAEV;QACT,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;KACrC;cAYD,CAAC"}
1
+ {"version":3,"file":"api-key-auth.d.ts","sourceRoot":"","sources":["../../src/middleware/api-key-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAmC,MAAM,qBAAqB,CAAC;AAQ7F;;;;GAIG;AACH,eAAO,MAAM,UAAU;eAER;QACT,gBAAgB,EAAE,gBAAgB,CAAC;KACpC;cAgJD,CAAC;AAEL,eAAO,MAAM,wBAAwB,GAAU,QAAQ,MAAM,8BAgB5D,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,YAAY;eAEV;QACT,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;KACrC;cAYD,CAAC"}
@@ -19,17 +19,40 @@ export const apiKeyAuth = () => createMiddleware(async (c, next) => {
19
19
  const baseUrl = new URL(c.req.url).origin;
20
20
  // Bypass authentication only for integration tests with specific header
21
21
  if (process.env.ENVIRONMENT === 'development' || process.env.ENVIRONMENT === 'test') {
22
- const executionContext = createExecutionContext({
23
- apiKey: 'development',
24
- tenantId: tenantId || 'test-tenant',
25
- projectId: projectId || 'test-project',
26
- graphId: graphId || 'test-graph',
27
- apiKeyId: 'test-key',
28
- baseUrl: baseUrl,
29
- agentId: agentId,
30
- });
22
+ let executionContext;
23
+ if (authHeader?.startsWith('Bearer ')) {
24
+ try {
25
+ executionContext = await extractContextFromApiKey(authHeader.substring(7));
26
+ logger.info({}, 'Development/test environment - API key authenticated successfully');
27
+ }
28
+ catch {
29
+ // If API key extraction fails, fallback to default context
30
+ executionContext = createExecutionContext({
31
+ apiKey: 'development',
32
+ tenantId: tenantId || 'test-tenant',
33
+ projectId: projectId || 'test-project',
34
+ graphId: graphId || 'test-graph',
35
+ apiKeyId: 'test-key',
36
+ baseUrl: baseUrl,
37
+ agentId: agentId,
38
+ });
39
+ logger.info({}, 'Development/test environment - fallback to default context due to invalid API key');
40
+ }
41
+ }
42
+ else {
43
+ // No API key provided, use default context
44
+ executionContext = createExecutionContext({
45
+ apiKey: 'development',
46
+ tenantId: tenantId || 'test-tenant',
47
+ projectId: projectId || 'test-project',
48
+ graphId: graphId || 'test-graph',
49
+ apiKeyId: 'test-key',
50
+ baseUrl: baseUrl,
51
+ agentId: agentId,
52
+ });
53
+ logger.info({}, 'Development/test environment - no API key provided, using default context');
54
+ }
31
55
  c.set('executionContext', executionContext);
32
- logger.info({}, 'Test environment bypass authenticated successfully');
33
56
  await next();
34
57
  return;
35
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-run-api",
3
- "version": "0.0.0-dev-20250910232631",
3
+ "version": "0.0.0-dev-20250910233133",
4
4
  "description": "Execution API for Inkeep Agent Framework - handles chat, agent execution, and streaming",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -45,7 +45,7 @@
45
45
  "traverse": "^0.6.11",
46
46
  "ts-pattern": "^5.7.1",
47
47
  "zod": "^4.1.5",
48
- "@inkeep/agents-core": "^0.0.0-dev-20250910232631"
48
+ "@inkeep/agents-core": "^0.0.0-dev-20250910233133"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@biomejs/biome": "2.1.4",