FCC Diagnostics Proxy
Overview
ft-fcc-service is an internal, docker-network-only service with no authentication of its own and no port published outside the docker network. The Angular portals (Support Center / Management Console) never talk to it directly — they only ever talk to ui-backend, which exposes a transparent proxy under /iot-webservice/iotw/FCC/** and forwards every request to ${ft.fcc.service.url}/FCC/**.
ACS and ft-fcc-service communicate with each other independently, over Hazelcast queues, for the diagnostics collection pipeline itself. That exchange is outside the scope of this page, which documents the browser-facing HTTP proxy only.
`ui-backend’s role in this feature is strictly limited to the proxy. It explicitly does not:
-
store any FCC configuration;
-
resolve devices for FCC in any way;
-
publish to, or read from, any FCC-related Hazelcast queue;
-
take any part in the legacy FCC ETL.
Everything FCC-specific that ui-backend does is: authenticate the caller (existing JWT filter chain), resolve the caller’s identity and domain scope, and forward the HTTP request/response verbatim.
There is one exception. For the Group Update device list of an FCC test, ui-backend makes one extra call of its own to read the domain of the test. See The test domain lookup.
Identity and domain-scope headers
FccIdentityService.identityHeaders() builds the outgoing header set from scratch for every proxied call; it never copies headers from the incoming request.
| Header | Present when | Meaning |
|---|---|---|
|
Always |
The authenticated caller’s user id ( |
|
Always |
The authenticated caller’s client type ( |
|
Always |
|
|
Only when scope is |
The caller’s own domain id. |
|
Only when scope is |
Comma-separated list of every domain id visible to the caller (own domain id included). |
|
Only when scope is |
The same id list, split into fixed-size chunks (see Domain-ids chunking). |
The two scopes
-
ALL— the super domain.CommonUtils.isSuperDomain(domainId)is true for a domain id ofnull,0, or-1. In this case neitherX-FT-Domain-Idnor anyX-FT-Domain-Ids*header is sent —ft-fcc-servicetreats the presence ofX-FT-Domain-Scope: ALLalone as "no domain restriction". -
LIST— every other user. The header set carries the caller’s own domain id plus every domain id the caller may see (DomainService.getDomainIds(user)), withnull,0, and-1sentinel values stripped before the list is sent. If the resolved id list is empty after stripping, the scope is considered unresolvable and the call is rejected before it ever reachesft-fcc-service(see Troubleshooting,9209).
|
Every client-supplied header starting with Symmetrically, |
Domain-ids chunking
Tomcat caps the entire request header block at 8 KB. A user visible in more than ft.fcc.proxy.domain-ids-per-header domains (default 200) would risk overflowing that limit in a single X-FT-Domain-Ids header, so FccIdentityService.addDomainIds splits the list into X-FT-Domain-Ids-1, X-FT-Domain-Ids-2, … instead of emitting one oversized header. Consumers on the ft-fcc-service side must read all numbered chunks, not just X-FT-Domain-Ids, when the scope is LIST.
What the proxy passes through unchanged
FccProxyService is a contract-agnostic proxy: it does not parse or understand the FCC payloads it forwards.
Request → upstream:
-
HTTP method
-
remaining path (the part of the URL after
/iot-webservice/iotw/FCC, kept URL-encoded exactly as received) -
query string
-
body (buffered for ordinary requests; rebuilt from the parsed parts for
multipart/form-data, since theDispatcherServlethas already drained the original multipart input stream) -
Content-Type(for non-multipart requests only — for multipart requests WebClient writes its ownmultipart/form-dataheader with its own boundary) -
Accept
Upstream → response:
-
status code, including 4xx/5xx, returned verbatim (the controller uses
exchangeToMonorather thanretrieve()specifically so an upstream error status and body are not rewritten into a generic proxy error) -
response headers, except the hop-by-hop set that must not be copied back to the client:
Connection,Keep-Alive,Proxy-Authenticate,Proxy-Authorization,TE,Trailer,Transfer-Encoding,Upgrade, andContent-Length(the servlet container recomputesContent-Lengthfor the response it actually writes) -
response body, byte-for-byte
Two path-level guards run before any of the above: a suffix containing .. is rejected (9212), and any path under /FCC/internal/** is rejected with a 404 before it reaches ft-fcc-service — that segment is reserved for internal callers and is deliberately unreachable from the browser.
The test domain lookup
The Group Update device list is shared with the FCC edit screen. When the screen sends ownerType=FCC and ownerId greater than 0, ui-backend must know the domain in which the FCC test was created. Only ft-fcc-service stores that domain. FccTestDomainClient.fetchTestDomainId reads it with one backend call. It is not a proxied browser request.
For ownerType=FCC, ownerId is the id of the FCC test. It is not the id of the diagnostics configuration.
|
The backend call
| Item | Value |
|---|---|
Request |
|
Body |
|
Headers |
The |
Success |
Status 2xx with an integer |
Timeout |
|
The call uses the identity of the caller. ft-fcc-service answers 404 for a test that the caller cannot see. ui-backend shows this as "not found", never as "forbidden".
The endpoint is internal. It is not in the OpenAPI file of ft-fcc-service. A browser cannot reach it, see The internal path block.
Fail-closed behaviour
Every outcome other than a successful answer stops the request. The device list never falls back to the whole scope of the caller.
Answer of ft-fcc-service |
Error | HTTP status |
|---|---|---|
2xx with an integer |
none, the value is used |
- |
|
|
404 |
Any other |
|
502 |
Any other status |
|
502 |
2xx with a missing, |
|
502 |
Connect error, read timeout, lookup timeout, or a connection closed without a response |
|
502 |
The errors use 404 and 502 on purpose. The portal treats 401 and 403 as a lost session.
After a saved test is found, the list is also checked against the scope of the caller. If a restricted caller shares no domain with the subtree of the test, the request fails with 9213. If the test belongs to the super domain, the caller scope is used.
|
This feature must ship in the same release as the portal change that sends the test id as
|
Each lookup adds one round trip to ft-fcc-service for every POST /GroupUpdate/devices call with ownerType=FCC.
The internal path block
The path /FCC/internal/** belongs to internal callers. The browser cannot reach it through /iot-webservice/iotw/FCC/**. Two controls apply.
| Control | What it rejects | Result |
|---|---|---|
|
The path |
|
Spring Security |
A path with |
The firewall rejects the request before the proxy runs. |
The firewall control holds only while no code of the application configures a firewall. FccHttpFirewallDefaultGuardTest scans the main sources of the services, commons, acs and iot-web-app-build modules. It fails if a source defines or configures an HttpFirewall, calls setFirewall, or calls a setAllow* method on a firewall.
The test reads the source roots of these four modules in the reactor only. It does not scan the com.friendly dependency jars, so a firewall configured in a jar is not detected.
|
Declared gap: no automated test sends a |
Report export
POST /iot-webservice/iotw/FCC/reports/export (upstream POST /FCC/reports/export) is handled by a separate code path because a report export can be a multi-million-row payload:
-
it uses its own
WebClient(fccExportWebClient) with a longer response timeout (ft.fcc.timeouts.export-response, default5m) than the ordinary buffered client (ft.fcc.timeouts.response, default30s), and with no codecmaxInMemorySizelimit since nothing is buffered into memory; -
the response is streamed straight from the upstream
Flux<DataBuffer>to the servlet output stream viaStreamingResponseBody— the report is never buffered in memory nor spooled to a temporary file; -
it sets its own per-request MVC async timeout (
ft.fcc.timeouts.export-async, default11m) on theAsyncWebRequestbefore returning, so this one endpoint can run longer than the application’s globalspring.mvc.async.request-timeout(190s) without raising that global default for every other endpoint.
Configuration reference
All properties live under the ft.fcc prefix (FccProxyProperties, bound in iot-web-app-build/src/main/resources/application.yaml). Every field has a code-level default, so the application still starts if the ft.fcc block is absent from configuration.
| Property | Environment variable | Default | Controls |
|---|---|---|---|
|
|
Base URL of the internal |
|
|
|
|
TCP connect timeout, shared by both the buffered and the export |
|
|
|
Upstream response timeout of the buffered (non-export) client. |
|
|
|
Upstream response timeout of the streaming export client. |
|
|
|
Per-request MVC async timeout applied to the export endpoint only; must stay above |
|
|
|
Bound of the whole test domain lookup, from the start of the call to the end of the answer. A lookup that exceeds it fails with |
|
|
|
TTL of the per-user domain-scope entry in the Hazelcast |
|
|
|
WebClient codec limit for buffered (non-export) responses; the Spring default of 256 KB is too small for FCC list and report payloads. |
|
|
|
Maximum number of domain ids carried by a single |
Portal menu item and the FCCId setting
The FCC Diagnostics menu node is static: it is declared in the Management Portal’s own app-permissions-config.json and gated by the UserGroupTemplate permissions described below — no interface item creates or positions it. FCCId is a Settings item: the Superset dashboard id that the System Reports fcc route resolves by id to show the FCC Diagnostics report (an empty value disables the report).
How interface items are registered
Interface items are not seeded through Liquibase INSERT`s. At application start, `SettingInitializer (services module, around lines 151-166) reads iot-web-app-build/conf/interfaceItems.json and filters out every id that already exists in table iotw_interface_item — only genuinely new ids get inserted.
|
Editing |
A JSON interface item carries only id, isRequired, defaultValue, valueType, groupId, and interfaceDescriptions — there is no url and no order field. groupId decides only which section of Settings › Interface shows the item; it has no effect on the portal menu.
FCCId: back in system reports
FCCId holds the Superset dashboard id of the FCC Diagnostics report, so it lives in the system reports group next to the other report dashboard ids, with the EN description "Superset dashboard ID for the FCC Diagnostics report. Leave empty to disable the report." An earlier changeset had moved it to diagnostics; a later one moves it back:
| Change | Where | Applies to |
|---|---|---|
|
|
New installations only (see note above) |
|
|
Existing installations, applied automatically on upgrade |
Existing groups, for reference: others, reports, system reports, diagnostics, pass policy, ai chatbot, network score, grafana, auth, timeouts, isp.
Because both paths are covered, no manual step is required after upgrading an existing installation: FCCId appears under System reports in the Management Portal settings as soon as the Liquibase changeset has run.
Portal and permission scope
InterfaceService (around lines 445-458) hides the reports and grafana groups from the Support Portal (sc client type), and additionally hides FCCId explicitly by id. The group FCCId belongs to does not change this: FCC Diagnostics remains a Management Portal (mc) feature only in this version, and that explicit by-id filter is intentionally left in place.
ui-backend does not check per-screen permissions for any screen. The FCC Diagnostics node, with VIEW/EXECUTE, lives in the portal’s JSON user-group permission template (UserGroupTemplate), uploaded by the portal itself via PUT Setting/userGroup/permissions with the X-Internal-Keyword header — that template, and the screen-level permission model it encodes, is owned by the Angular side, not by ui-backend.
Caching
FccIdentityService caches the derived FccDomainScope — not the raw UserResponse — per user id, in a Hazelcast IMap named FccDomainScopeCache, with an explicit TTL taken from ft.fcc.cache.user-ttl (default 30s).
Why this cache exists:
-
UserService.getUser(userId, zoneId)goes straight touserRepository.findById— it has no cache of its own. -
The JWT filter already performs a session lookup plus a user lookup on every request. Without this cache, every proxied FCC call would add a third database round-trip.
Why the derived scope is cached rather than the UserResponse:
-
UserResponsecarries the password field and must not be replicated around the Hazelcast cluster. -
FccDomainScopeis a small,Serializablerecord (scope,domainId,domainIds) with no sensitive fields.
A failed resolution (the 9209 outcome) is never cached — every request from a user whose domain scope cannot be resolved re-attempts resolution.
Operational consequence: because the scope is cached for up to user-ttl, a domain reassignment for a user takes up to that TTL to take effect on FCC calls specifically (other parts of the application that read the domain directly, without this cache, are unaffected).
Troubleshooting
| Code | HTTP status | Name | Likely cause / fix |
|---|---|---|---|
|
403 Forbidden |
|
The caller’s domain scope could not be resolved — |
|
404 Not Found |
|
A request under |
|
502 Bad Gateway |
|
|
|
400 Bad Request |
|
The remaining path did not start with the expected prefix, contained a |
|
404 Not Found |
|
The FCC test named by |
The proxy emits two greppable log lines useful for diagnosing the above:
-
fcc identity resolved userId=… scope=… domainId=… domainIdsCount=…— logged (atDEBUG) on every cache miss inFccIdentityService, once the scope has been freshly resolved. -
fcc test domain lookup failed closed ownerType=FCC ownerId=… outcome=… status=…— logged (atWARN) byFccTestDomainClientwhenever the test domain lookup fails closed. A successful lookup logsfcc test domain resolved ownerType=FCC ownerId=… domainId=…atDEBUG. -
fcc upstream call failed userId=… method=… path=… url=…— logged (atERROR, with the underlying exception) byFccProxyService.executewhenever a call toft-fcc-servicefails with a connection/timeout error, immediately before it is translated into9211.
Limitations / not in this version
-
Multipart import/export forwarding is implemented (
FccProxyService.multipartBody) but has not yet been exercised end-to-end against a realft-fcc-servicemultipart endpoint. -
There is no FCC-specific role model in
ui-backend. Screen-level access (VIEW/EXECUTEon theFCC Diagnosticsnode) is defined entirely in the portal’sUserGroupTemplateJSON — see Portal menu item — plus the domain scope described above; there is no separate FCC permission/role check inui-backenditself. -
The runtime rejection of the paths
;,%3Band//has no automated test. See The internal path block. -
/FCC/internal/platform-event, an ACS webhook relay, is reserved and unused: the/FCC/internal/**prefix is already blocked from the browser-facing proxy (9210), but no route for this path exists inui-backendtoday — the ACS-to-ft-fcc-serviceexchange is expected to continue over Hazelcast queues, not through this proxy.
Related pages
-
Group Update: domain scope of the File source — how the device list, the count and the save use the domain scope.
-
System Components Overview — where
ft-fcc-serviceand Hazelcast fit among the other system components.