feat: add agw impl [EXPERIMENTAL] - #42
Draft
Schmarvinius wants to merge 3 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Add SAP Agent Gateway Adapter with IAS JWT-Bearer Token Exchange
This PR introduces a new
n8n-to-gatewayadapter that routes n8n workflow invocations through the SAP Agent Gateway, implementing the first authentication gate: IAS JWT-bearer token exchange via mTLS.🆕 New Files
lib/auth/agent-gateway-credentials.jsResolves Agent Gateway credentials from
cds.requires.n8n.credentials.agentGateway. Supports flexible configuration via:certificateFile,privateKeyFile) for local developmentcrdFileJSON (consumed resource definition)Validates required fields (
clientid,iasUrl,certificate,key) and normalizes the IAS URL to its origin for@sap/xssecdiscovery.lib/auth/token-exchange.jsPerforms the IAS JWT-bearer assertion ("Exchange Access Token") using
@sap/xssec'sIdentityService. Exchanges the authenticated user's JWT for a token scoped to the Agent Gateway viaurn:sap:identity:application:provider:name:agent-gateway. Includes a lazily-initialized, keyed cache for theIdentityServiceinstance and exposes test hooks (_resetCache,_setIdentityServiceFactory).srv/n8n-to-gateway.js+srv/n8n-to-gateway.cdsThe new gateway adapter extending
N8nRestService. Implements Gate 1 (IAS assertion) fully. Gate 2+ (actual Agent Gateway invocation via MCP endpoint) is stubbed with aTODOand a warning log.🔧 Modified Files
lib/handlers/triggerHandler.jsn8n.trigger(...)ton8n.send({ event: 'trigger', ... })to support outbox-persisted headers.x-agw-user-assertionheader for async delivery.package.json@sap/xssec: ^4as a runtime dependency.n8n-to-gatewaykind in the CDS plugin configuration.Change Type
🆕 New Feature
Have you...
Added relevant entry to the change log?
🔄 Regenerate and Update Summary
PR Bot Information
Version:
1.29.54anthropic--claude-4.6-sonnetpull_request.opened86eace40-a24e-11f1-9471-a4df519a42e0