EUREKA-899: POC - Application-scoped sidecars bootstrap#367
Open
OleksiiKuzminov wants to merge 18 commits into
Open
EUREKA-899: POC - Application-scoped sidecars bootstrap#367OleksiiKuzminov wants to merge 18 commits into
OleksiiKuzminov wants to merge 18 commits into
Conversation
…back (EUREKA-899)
…n tenant-scoped (EUREKA-899)
…Test (EUREKA-899)
…table (EUREKA-899)
…gress (EUREKA-899)
yauhen-vavilkin
approved these changes
Jun 18, 2026
dmtkachenko
reviewed
Jun 18, 2026
dmtkachenko
approved these changes
Jun 18, 2026
|
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.



Purpose
In multi-version environments, multiple versions of the same application can be entitled to different tenants. The sidecar bootstraps egress (module → required-module) routing by module id only, so an egress call can resolve to the wrong provider version for a given tenant. This change makes egress routing tenant-aware so each tenant reaches the provider version from its own entitled applications.
US: EUREKA-899
Approach
Summary: Behind a new feature flag (
routing.tenant-scoped.enabled, default off — behavior is unchanged when disabled), ingress is loaded once at startup from the newGET /modules/{id}/bootstrap, while egress becomes a per-tenant route table. Each enabled tenant's egress table is built from its entitled application ids (GET /entitlements→POST /modules/{id}/bootstrap {applicationIds}), driven by the existing tenant-entitlement flow, and selected per request by theX-Okapi-Tenantheader. Scope is limited tofolio-module-sidecar; themgr-applicationsbootstrap endpoints it consumes already exist.Implementation details:
routing.tenant-scoped.enabled(SIDECAR_TENANT_SCOPED_ROUTING_ENABLED, defaultfalse) and coupledrouting.forward-to-gateway.enabledto defaulttruewhen tenant-scoped routing is on, so unresolved egress falls through to the gateway instead of 404.ApplicationManagerClient.getIngressBootstrap(GET /modules/{id}/bootstrap) andgetEgressBootstrap(POST /modules/{id}/bootstrapwith body{"applicationIds":[…]}), both parsed into the existingModuleBootstrapDTO (no new response type).ApplicationManagerService.getIngressBootstrap()andgetEgressBootstrap(List<String>)wrappers over the existing retry/token helper.EgressRoutingLookup: when tenant-scoped,lookupRouteresolves routes byX-Okapi-Tenant; when off, the existing global table is used unchanged.EgressBootstrapService, which builds and refreshes each tenant's egress table from its entitled applications, reconciles tenants on theEntitlementsEvent, and drops revoked tenants; a build failure leaves the previously built table intact.RoutingServiceto load ingress-only at startup and refresh all tenants' egress on required-module discovery when tenant-scoped; the flag-off init and discovery paths are unchanged.TenantEntitlementConsumerto refresh a tenant's egress on a KafkaUPGRADEevent when tenant-scoped (entitle/revoke are already covered by the reconcile).Pre-Review Checklist