Adhoc Mapping

Present

3-min readUpdated May 06, 2026

Copied Raw Markdown!

This repository is exploring how Apigee policy bundles can be moved into MuleSoft Flex Gateway. Apigee is the source system: it stores gateway behavior as XML policies and, for some behaviors, JavaScript files. Flex Gateway is the target system: the current target artifacts are YAML policy definitions under Adhoc/flex-gateway-policies. This page explains how the Adhoc reference material lines up so a reader can see both the product-level policy mapping and the lower-level source files that feed each target policy.

The important shape is not one file to one file. In Apigee, one business policy can be split across several files: one file may run JavaScript, another may define the failure response, and another may read configuration. In Flex Gateway, the same business policy is represented as one YAML policy definition. That is why this page has two graphs: first the policy-to-policy story, then the detailed source-file-to-policy trace.

Read it both ways:

  • Source to target: many Apigee files feed one Flex Gateway YAML.
  • Target to source: one Flex Gateway YAML can be traced back to all Apigee files in that policy group.

How To Read This PageURL copied

Start with Policy To Policy. That graph answers the business question: "Which Apigee policy concept becomes which Flex Gateway policy?" For example, Apigee IP Allowlist maps to Flex ip-allowlist.

Then read Source Files To Policy. That graph answers the implementation question: "Which files make up the Apigee side of that policy?" For IP allowlist, the Apigee side has JavaScript logic, a JavaScript policy wrapper, and a forbidden-response policy. Those three source files feed one Flex YAML target.

The arrows are expressed with Vyasa depends edges. A target node depends on source nodes. Read that as "this target was produced from these source inputs."

Latest ValidationURL copied

make test output is saved at build/make-test-results.txt.

ApiGeeToMuleSoft/build/make-test-results.txt
/Applications/Xcode.app/Contents/Developer/usr/bin/make validate-adhoc-flex
python -m src.cli Adhoc/apigee-policies --target flex-gateway-yaml --output build/flex-gateway-policies --expected Adhoc/flex-gateway-policies --no-review
18:07:04.568 | INFO    | ingest: scanning source path Adhoc/apigee-policies
18:07:04.576 | INFO    | ingest: found 55 Apigee XML file(s) in 7.4 ms
18:07:04.576 | INFO    | ingest: policy names: AM-Inject-Inbound-Headers, AM-Inject-Outbound-Headers, AM-Remove-Inbound-Headers, AM-Remove-Outbound-Headers, JP-JSON-Threat-Protection, XP-XML-Threat-Protection, JS-Decode-BasicAuth-LDAP, KV-Get-LDAP-Config, SP-Call-LDAP-Validator, AM-Extract-BasicAuth-Credentials, JS-Validate-BasicAuth, KV-Get-BasicAuth-Config, default, RF-BasicAuth-Unauthorized, AM-Inject-App-Info, AM-Remove-Client-Credentials, RF-ClientID-Unauthorized, VA-Verify-API-Key, JS-IP-Allowlist, RF-IP-Forbidden, JS-IP-Blocklist, RF-IP-Blocked, AM-Forward-JWT-Claims, JS-Validate-JWT-Scope, RF-JWT-Forbidden, RF-JWT-Unauthorized, VJ-Verify-JWT, EV-Parse-Introspect-Response, JS-Extract-Bearer-Token, KV-Get-OAuth2-Config, LC-OAuth2-Token-Cache, PC-OAuth2-Token-Cache, default, RF-OAuth2-Unauthorized, SP-OAuth2-Introspect, AM-RateLimit-Response-Headers, QU-Daily-Quota, RF-RateLimit-Exceeded, SA-Rate-Limit, AM-SLA-Quota-Headers, QU-SLA-Quota, JS-Retry-With-Backoff, RF-MaxRetries-Exceeded, RF-SpikeArrest-Exceeded, SA-Spike-Control, AM-Set-503-Response, AM-Set-504-Response, default, AM-CORS-Preflight, AM-CORS-Response, JS-Validate-CORS-Origin, default, RF-Return-204-Preflight, ML-Log-Request, SC-Statistics-Collector
18:07:04.576 | INFO    | lookup: finding target policy for 55 Apigee XML file(s)
18:07:04.576 | INFO    | lookup: detected 18 policy group(s): basic-auth-ldap, basic-auth-simple, client-id-enforcement, cors, header-injection, header-removal, ip-allowlist, ip-blocklist, json-threat-protection, jwt-validation, message-logging, oauth2-introspection, rate-limiting, rate-limiting-sla, retry, spike-control, timeout, xml-threat-protection
18:07:04.576 | INFO    | lookup: produced 55 candidate mapping(s) in 0.0 ms
18:07:04.576 | INFO    | mapping: scoring 55 source-to-target candidate(s)
18:07:04.576 | INFO    | mapping: 1 high-confidence, 54 need review in 0.1 ms
18:07:04.576 | INFO    | execute: target=flex-gateway-yaml, output=build/flex-gateway-policies
18:07:04.579 | INFO    | execute: copying 18 Flex YAML template(s) from Adhoc/flex-gateway-policies
18:07:04.580 | INFO    | execute: governance / header-injection -> build/flex-gateway-policies/governance/header-injection/header-injection.yaml
18:07:04.580 | INFO    | execute: governance / header-removal -> build/flex-gateway-policies/governance/header-removal/header-removal.yaml
18:07:04.580 | INFO    | execute: governance / json-threat-protection -> build/flex-gateway-policies/governance/json-threat-protection/json-threat-protection.yaml
18:07:04.580 | INFO    | execute: governance / xml-threat-protection -> build/flex-gateway-policies/governance/xml-threat-protection/xml-threat-protection.yaml
18:07:04.581 | INFO    | execute: security / basic-auth-ldap -> build/flex-gateway-policies/security/basic-auth-ldap/basic-auth-ldap.yaml
18:07:04.581 | INFO    | execute: security / basic-auth-simple -> build/flex-gateway-policies/security/basic-auth-simple/basic-auth-simple.yaml
18:07:04.581 | INFO    | execute: security / client-id-enforcement -> build/flex-gateway-policies/security/client-id-enforcement/client-id-enforcement.yaml
18:07:04.582 | INFO    | execute: security / ip-allowlist -> build/flex-gateway-policies/security/ip-allowlist/ip-allowlist.yaml
18:07:04.582 | INFO    | execute: security / ip-blocklist -> build/flex-gateway-policies/security/ip-blocklist/ip-blocklist.yaml
18:07:04.583 | INFO    | execute: security / jwt-validation -> build/flex-gateway-policies/security/jwt-validation/jwt-validation.yaml
18:07:04.583 | INFO    | execute: security / oauth2-introspection -> build/flex-gateway-policies/security/oauth2-introspection/oauth2-introspection.yaml
18:07:04.583 | INFO    | execute: traffic / rate-limiting -> build/flex-gateway-policies/traffic/rate-limiting/rate-limiting.yaml
18:07:04.583 | INFO    | execute: traffic / rate-limiting-sla -> build/flex-gateway-policies/traffic/rate-limiting-sla/rate-limiting-sla.yaml
18:07:04.584 | INFO    | execute: traffic / retry -> build/flex-gateway-policies/traffic/retry/retry.yaml
18:07:04.584 | INFO    | execute: traffic / spike-control -> build/flex-gateway-policies/traffic/spike-control/spike-control.yaml
18:07:04.584 | INFO    | execute: traffic / timeout -> build/flex-gateway-policies/traffic/timeout/timeout.yaml
18:07:04.584 | INFO    | execute: transform / cors -> build/flex-gateway-policies/transform/cors/cors.yaml
18:07:04.584 | INFO    | execute: transform / message-logging -> build/flex-gateway-policies/transform/message-logging/message-logging.yaml
18:07:04.584 | INFO    | execute: completed in 8.2 ms
18:07:04.588 | INFO    | validate: comparing generated output with expected output
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/governance/header-injection/header-injection.yaml == Adhoc/flex-gateway-policies/governance/header-injection/header-injection.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/governance/header-removal/header-removal.yaml == Adhoc/flex-gateway-policies/governance/header-removal/header-removal.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/governance/json-threat-protection/json-threat-protection.yaml == Adhoc/flex-gateway-policies/governance/json-threat-protection/json-threat-protection.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/governance/xml-threat-protection/xml-threat-protection.yaml == Adhoc/flex-gateway-policies/governance/xml-threat-protection/xml-threat-protection.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/security/basic-auth-ldap/basic-auth-ldap.yaml == Adhoc/flex-gateway-policies/security/basic-auth-ldap/basic-auth-ldap.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/security/basic-auth-simple/basic-auth-simple.yaml == Adhoc/flex-gateway-policies/security/basic-auth-simple/basic-auth-simple.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/security/client-id-enforcement/client-id-enforcement.yaml == Adhoc/flex-gateway-policies/security/client-id-enforcement/client-id-enforcement.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/security/ip-allowlist/ip-allowlist.yaml == Adhoc/flex-gateway-policies/security/ip-allowlist/ip-allowlist.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/security/ip-blocklist/ip-blocklist.yaml == Adhoc/flex-gateway-policies/security/ip-blocklist/ip-blocklist.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/security/jwt-validation/jwt-validation.yaml == Adhoc/flex-gateway-policies/security/jwt-validation/jwt-validation.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/security/oauth2-introspection/oauth2-introspection.yaml == Adhoc/flex-gateway-policies/security/oauth2-introspection/oauth2-introspection.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/traffic/rate-limiting/rate-limiting.yaml == Adhoc/flex-gateway-policies/traffic/rate-limiting/rate-limiting.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/traffic/rate-limiting-sla/rate-limiting-sla.yaml == Adhoc/flex-gateway-policies/traffic/rate-limiting-sla/rate-limiting-sla.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/traffic/retry/retry.yaml == Adhoc/flex-gateway-policies/traffic/retry/retry.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/traffic/spike-control/spike-control.yaml == Adhoc/flex-gateway-policies/traffic/spike-control/spike-control.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/traffic/timeout/timeout.yaml == Adhoc/flex-gateway-policies/traffic/timeout/timeout.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/transform/cors/cors.yaml == Adhoc/flex-gateway-policies/transform/cors/cors.yaml
18:07:04.588 | INFO    | validate: MATCH build/flex-gateway-policies/transform/message-logging/message-logging.yaml == Adhoc/flex-gateway-policies/transform/message-logging/message-logging.yaml
18:07:04.588 | SUCCESS | validate: 18 file(s) matched
18:07:04.588 | INFO    | validate: completed in 3.5 ms
18:07:04.588 | SUCCESS | done: pipeline completed in 19.6 ms
✓ Validation passed.

What The Test ProvesURL copied

The test proves the current converter can scan the Adhoc Apigee source tree, detect 18 policy groups, copy the matching 18 Flex Gateway YAML targets into build/flex-gateway-policies, and compare generated output against the expected Adhoc Flex YAML files. A match means the generated file bytes are identical to the expected file bytes.

Current limit

This is not yet proof of smart semantic conversion. The current Flex YAML path is template-based: it uses the policy group to select an existing YAML target. The useful guarantee today is that the mapping inventory, output routing, and validation loop are wired and visible.

Why Two GraphsURL copied

View Why it exists
Policy To Policy Shows the migration intent without file noise. This is the view to use when explaining the work to someone who only needs to know what Apigee capability maps to what Flex capability.
Source Files To Policy Shows the implementation evidence. This is the view to use when debugging why a target YAML exists, or when checking whether all Apigee files in a policy group are accounted for.

Still To ResolveURL copied

  1. Semantic extraction - The code still needs real per-policy parsing that reads values from Apigee XML and JavaScript instead of selecting static Flex YAML templates.
  2. Confidence scoring - The current mapping score is still mostly stubbed, so the code can validate output files while still reporting many low-confidence source XML mappings.
  3. Generated target ownership - The repo needs a decision on whether Flex YAMLs under Adhoc/flex-gateway-policies are permanent golden files, temporary references, or seed templates for generated output.

Policy To PolicyURL copied

Apigee Policies To Flex Gateway Policies
4 groups, 36 items, 18 edges

Source Files To PolicyURL copied

Adhoc Source Files To Flex Gateway Targets
22 groups, 79 items, 61 edges