nyilvantarto_scraper
Two services, one repo
Despite the name, this repo bundles two Hungarian government ID-verification services:
- KKSZB — a structured REST/SOAP client to the Hungarian government interop gateway (
gw.kkszb.gov.hu) that retrieves official document/person data + portrait images by 4T personal data or document number. This is the service that the deployablenode serveractually starts.- Nyilvantarto Scraper — a Puppeteer-based browser scraper of the public
www.nyilvantarto.huID-validity web form, behind an internal proxy, with captcha decoding delegated to the CV service. Its code is present and wired (NyilvantartoScraperRPCServer), but it is NOT registered in the currentserver.jsboot path (see Gotchas).
Source of truth for purpose: README.md:1-3 (“KKSZB & nyilvantarto.hu RabbitMQ service”), README.md:5-6 (KKSZB), README.md:498-501 (Scraper). package.json:2 name nyilvantarto_scraper, version 2.0.4.
Repo: github.com/TechTeamer/nyilvantarto_scraper (package.json:20-23). Base branch main, HEAD 6e52f0e “chore: [fkqa-327] maintenance/main (#37)” by Balázs Horváth, 2026-05-11.
1. Purpose & role in FaceKom
This is a back-end RabbitMQ RPC microservice — there is no HTTP server of its own; it exposes its functionality only over an AMQP RPC queue (@techteamer/mq). It is the FaceKom component responsible for Hungarian official-identity document verification and data/image retrieval, producing tamper-evidence ZIP bundles of every request/response/OCSP exchange.
- KKSZB RPC contract (
README.md:147-206): two endpoints,getDocumentDataBy4TandgetDocumentDataByIdNumber, returningQueryResponse | ErrorResponseplus image + evidence attachments. - Document types handled (
server/kkszb/kkszb.d.ts:18):szig(Személyazonosító igazolvány),rszig(régi személyi),utl(Útlevél/passport),ven(Vezetői engedély/driving licence). Descriptions:README.md:210-218. - The scraper half checks live ID validity against the public portal and zips the proof of interaction (
README.md:498-549,server/service/NyilvantartoScraperService.js).
Naming
“nyilvantarto” = Hungarian for “register/registry”; nyilvantarto.hu is the Hungarian government records portal. “KKSZB” is the Hungarian central government service-bus / interop gateway.
2. Tech stack & runtime
| Aspect | Value | Source |
|---|---|---|
| Language | JavaScript (CommonJS, require), with // @ts-check + JSDoc typing and hand-written .d.ts | .eslintrc.json:20 (commonjs: true), server/kkszb/kkszb.d.ts, // @ts-check headers |
| Runtime | Node.js >= 20.15.0 | package.json:17-19 (engines.node) |
| CI Node | Node 20 on Ubuntu Jammy | .travis.yml:6-7 |
| Package manager | Yarn 1.x (Classic; yarn.lock present, 124.7 KB; CI pins 1.22.22) | yarn.lock, .travis.yml:25, test/scripts/travis.sh:6 |
| Messaging | @techteamer/mq ^7.2.0 (RabbitMQ RPC) | package.json:26 |
| HTTP client | node-fetch ^2.7.0 (CV calls) + native node:http/node:https (KKSZB calls) | package.json:34, server/util/request.js, server/service/CVService.js:1 |
| XML/SOAP | fast-xml-parser ^4.5.0 | package.json:29, server/kkszb/UtlIdQueryProcessor.js:3 |
| Zip/evidence | archiver ^7.0.1 | package.json:27, server/util/store.js:5 |
| Multipart | formdata-node ^6.0.3 + form-data-encoder ^4.0.2 (CV captcha upload) | package.json:30-31, server/service/CVService.js:3-5 |
| CLI | commander ^12.1.0 | package.json:28, bin/kkszbquery:6 |
| Config | getconfig ^4.5.0 | package.json:32, config.js:6 |
| Logging | log4js ^6.9.1 | package.json:33, logger.js:2 |
| Browser scraping | @techteamer/scraper (Puppeteer wrapper) | server/service/NyilvantartoScraperService.js:3 |
@techteamer/scraper/ Puppeteer is NOT a declared dependency
server/service/NyilvantartoScraperService.js:3doesrequire('@techteamer/scraper'), but@techteamer/scraperdoes not appear inpackage.jsondependencies (lines 25-35). The scraper path would fail to resolve at runtime in this base clone unless that dep is added by a customization/build overlay. This is consistent with the scraper service being unwired inserver.js.
Hand-rolled type system
No
tsconfig.json. Types are enforced via// @ts-checkpragmas + JSDoc@typedefreferencingserver/kkszb/kkszb.d.ts(the central type file:Data4T,DocumentType,KkszbConfig, processor interfaces,EvidenceConfig). There is no compile step —npm run buildisecho OK(package.json:10).
LFS / binaries: no .gitattributes, no Git-LFS pointer files, no Dockerfile, no model weights in this repo. test/bin/fakekkszb is a plain Node script (verified file = “node script text executable”, not a binary).
3. Build & run
Entry points
- Service (deployable):
node server→ resolvesserver.js(package.jsonhas nomain; supervisor usescommand=node server). Boot sequence inserver.js:1-45:process-settings(TZ=UTC, optional self-signed TLS) —server.js:1,server/bootstrap/process-settings.js.process-listeners(true)(uncaughtException/unhandledRejection/SIGTERM-SIGINT graceful exit) —server.js:2,server/bootstrap/process-listeners.js.- Build RabbitMQ
ConnectionPoolnamed'nyilvantarto'—server.js:39,server/bootstrap/connection/rabbitmq.js. - Instantiate
KkszbServicewithconfig.clone('kkszb')—server.js:13-16. - Register RPC server
kkszb-rpc(classKkszbRPCServer) on connectionnyilvantarto, thenconnectionPool.connect()—server.js:25-30.
- CLI:
bin/kkszbquery(#!/usr/bin/env node) — manual test calls to KKSZB. See §5. - Integration runner CLI:
bin/qtspintegrity(#!/usr/bin/env -S node --test) — runs as a Node test file against the real QTSP KKSZB TEST server. See §5.
package.json scripts (verbatim, package.json:7-16)
| Script | Command | What it does |
|---|---|---|
lint | eslint . ./bin/**/* ./bin/* && echo 'npm run lint: OK' | ESLint over the tree + bin scripts; prints OK on success. |
lint:fix | eslint . ./bin/**/* ./bin/* --fix | Same, auto-fixing. |
build | echo OK | No-op build (no transpile step). |
test | c8 --src server --reporter=lcov --reporter=html --report-dir=test/coverage --exclude="node_modules/**" --exclude="test/**" node --test ./test/**/**/*.test.js | Runs all *.test.js (unit + integration) under coverage via c8 + native node --test; lcov+html into test/coverage. |
test:silent | same as test but > /dev/null 2>&1 | Quiet run (used by CI). |
test:unit | node --test test/unit | Unit tests only, no coverage. |
test:integration | node --test test/integration | Integration tests only, no coverage. |
test:coverage:all | c8 --all --src server ... node --test ./test/**/**/*.test.js | Like test but --all so uncovered server files are counted too. |
Start commands (verified)
- Production/dev process manager: supervisord,
command=node server,directory=/workspace/nyilvantarto, restart on exit codes0,2,stopsignal=TERM,stopwaitsecs=5. Two confs differ only byRUNTIME_ENV:supervisor_nyilvantarto_scraper_dev.conf:6-7→RUNTIME_ENV="dev".supervisor_nyilvantarto_scraper_docker.conf:6-7→RUNTIME_ENV="docker".
- No Dockerfile in repo (verified). Image build is presumably external (e.g. via vuer_docker); not evidenced here.
Config selection is by
RUNTIME_ENV(getconfig)
getconfigpicksconfig/<RUNTIME_ENV>.json. The repo shipsconfig/dev.jsonandconfig/docker.json.RUNTIME_ENV=travisciis synthesized in CI by copying dev → travisci (.travis.yml:27).
4. Top-level structure
| Path | Role | Verified |
|---|---|---|
server.js | Service entrypoint; boots settings, RabbitMQ, KkszbService, kkszb-rpc server | read |
config.js | getconfig wrapper adding .get/.has/.clone; CV-host derivation for dev; travisci queue override; JSON syntax-error pretty printer | read |
logger.js | log4js colored stdout logger, category nyilvantarto-scraper | read |
config/ | dev.json, docker.json — full service config (queue, kkszb, scraper, hosts) | read both |
server/bootstrap/ | process-settings.js, process-listeners.js, connection/rabbitmq.js | read all |
server/service/ | KkszbService.js (active), NyilvantartoScraperService.js, CVService.js | read all |
server/kkszb/ | KKSZB core: KkszbApi, Context, DocumentRequestProcessorFactory, 12 per-doc-type processors, 2 image processors, base processor.js, 4 error classes, kkszb.d.ts | read key files; rest mapped |
server/queue/rpc_server/ | KkszbRPCServer.js (registered), NyilvantartoScraperRPCServer.js (not registered in server.js) | read both |
server/queue/rpc_client/ | KkszbRPCClient.js, NyilvantartoScraperRPCClient.js — client helpers for other services | read both |
server/util/ | request.js (http/https send), certificate.js (OCSP via openssl), store.js (zip/unzip), stream.js (ConcatStream), xml.js (fxp SOAP→JSON), error.js (errorResult) | read all |
server/validator/ | Validator.js — regex/required field validator for scraper input | read |
server/service_container.js | Singleton DI container + ServiceBus EventEmitter (hooks/overrides) | read |
bin/ | kkszbquery, qtspintegrity — first-party CLIs (see §5) | read both |
test/ | unit + integration tests, mocks, fake KKSZB server, travis script | sampled |
maintenance/ | 2026-04-07.md, 2026-05-04.md — yarn outdated audit logs / pending dep upgrades | read latest |
security/ | 2026-04-07.md, 2026-05-04.md — yarn audit logs (fast-xml-parser + uuid advisories) | read latest |
changelog.md | Version history 1.0.0 → 2.0.4 | read |
.travis.yml | CI: yarn install, yarn audit (fail on CRITICAL ≥16), tests, SonarCloud scan | read |
sonar-project.properties | SonarCloud config (TechTeamer_nyilvantarto_scraper) | read |
build.ignore | Files excluded from production runtime build (dev.json, test/, *.md, eslint, _dev.conf …) | read |
.eslintrc.json / .eslintignore | ESLint standard + plugin:n ruleset | read |
.editorconfig | 2-space, LF, utf-8, max 240 cols | read |
5. First-party bin scripts
Scope
Only two first-party bin scripts exist. (CI’s
travis.sh:21references./customization/bin/and./test/customization/travis/paths — a customization-overlay convention — but no such dirs exist in this base clone; see customization-architecture.)
bin/kkszbquery (#!/usr/bin/env node)
A commander CLI to make ad-hoc test calls to the live KKSZB service. Builds a real KkszbService from config.clone('kkszb') (forcing https:true, port:443). Two subcommands:
personal-data <documentType> [options](bin/kkszbquery:43-98): 4T lookup →service.getDocumentDataBy4T. Required-bD/--birthDate; optional birthPlace, gender, birth/legal surname/forenames, mother’s name,--identityMatchLevel,-i/--image,-v/--verbose(full base64),-f/--file(write evidence ZIP).document-number <documentType> [options](bin/kkszbquery:100-146): ID lookup →service.getDocumentDataByIdNumber. Required-d/--documentNumber; same image/verbose/file flags.<documentType>is constrained to['szig','rszig','utl','ven'](bin/kkszbquery:29,47,104). By default it truncates returned image base64 to 32 chars (TRUNCATED_IMAGE_LENGTH,:19-26) unless--verbose.
bin/qtspintegrity (#!/usr/bin/env -S node --test)
A live integration smoke-test harness executed as a Node test file (shebang runs node --test). Builds the same real KkszbService (https:true, port:443 + config.clone('kkszb')) and asserts known fixtures against the QTSP KKSZB TEST server (bin/qtspintegrity:32):
rszigid query forAF519034(expects “VARGA KATALIN”,:50-82).szigid query for112891TT(:101-147).utl4T + id queries for SAMPLE/TÓDOR /BH0003919(:149-217).rszig/szig4T cases are present but{ todo:true, skip:true }(:34,85).- Helper
removeImageIdentifiersnulls portrait/signature IDs before deep-equal (:23-30).
bin/qtspintegrityhits the real government TEST endpointRunning it requires valid
kkszbconfig + tokens and network access to the KKSZB test gateway; it is not a hermetic unit test.
6. Key modules / entities
KKSZB service path (active)
server/service/KkszbService.js— the registered service. Public API:getDocumentDataBy4T(documentType, includeImage, data4T)andgetDocumentDataByIdNumber(documentType, includeImage, documentId)(:74,105). Both create aContext(evidence collector), callKkszbApi, optionally fetch images, zip evidence, strip raw image fields fromadatListabefore returning{ error:false, adatLista, imageList, evidence }or anerrorResult._createConfig(:156-183) hard-validates the kkszb config viaKkszbConfigError(missing baseUrl/port/https/apis/token throw)._createAgentConfig(:190-202) builds anhttps.AgentwithmaxCachedSessions:0(fresh cert every request) only ifcaCheck.enabled— this is what gates OCSP.server/kkszb/KkszbApi.js— the engine (:29). Constructor wires aDocumentRequestProcessorFactorywith per-document-type processors (:45-62):- 4T (JSON):
szig,rszigplain;utl,vengetendpointId(SOAP). - ID:
szig/rszigJSON;utl/venSOAP viaUtlIdQueryProcessor/VenIdQueryProcessor. - Image:
szig/rszig→ImageJsonRequestProcessor(separatekepLekeresREST call byarckepmasAzonosito);utl/ven→ImageSoapRequestProcessorwrapping the ID processor (image arrives inline asarckep). - Picks
request.sendHttpsvssendHttpbyconfig.https(:37). Each request gets acrypto.randomUUID()request-id and records 5 evidence files (request header [sensitivex-kk-authenticationstripped], payload, response header, response data, OCSP) into theContext(:97-101,152-156,203-207).getImageListruns per-document image fetches withPromise.allSettled(:124).
- 4T (JSON):
server/kkszb/Context.js— evidence accumulator honoring the fine-grainedEvidenceConfig(boolean | per-document/image| per-evidence-type), skipping empty values, producing a ZIP viastore.createZip(:28-62).- Processors (
server/kkszb/*Processor.js, baseprocessor.js): each implementspath()/payload()/header()/json().processor.jsprovidesjsonHeader(setsx-kk-authenticationtoken +x-request-id),json4T(maps EnglishData4T→ Hungarian SOAP/JSON field names,nemKodfemale→‘N’ else ‘F’,lekerdezesCelja:'Ügyfél azonosítás'),parseData, andsoapHeader(idomsoft mediator namespaces).Szig4TQueryProcessor(server/kkszb/Szig4TQueryProcessor.js, classData4TJsonRequestProcessor) is the JSON 4T template;UtlIdQueryProcessorbuilds asoap:Envelopewithfast-xml-parserXMLBuilderand parses the SOAP response (or a SOAPFault→KkszbDataError) back to JSON (server/kkszb/UtlIdQueryProcessor.js:57-126). - Error classes (
server/kkszb/):KkszbApiError(technical),KkszbDataError(carriesissue+Response, messageResponse status: N),KkszbConfigError(field +MISSING|TYPE_ERROR|FORMAT_ERROR),KkszbMissingResourceError(missingarckepmasAzonosito/okmanyAzonosito).server/util/error.js#errorResultmaps thrown errors →{error:true,name,message,issue?};Kkszb*-prefixed names are “data errors”, others (OcspError,Error,UnkownError) are “technical” (README.md:434-470).
RPC surface
server/queue/rpc_server/KkszbRPCServer.js(registered askkszb-rpc) — extendsmq.RPCServer, forcestimeoutMs:300000&prefetchCount:undefined(:12). Registers actionsgetDocumentDataBy4TandgetDocumentDataByIdNumber(:14-15) delegating toserviceContainer.service.kkszb._response(:57-81) converts each image to a Buffer RPC attachment keyed{i}_portrait_image, returns{error:false,imageType,attachmentKey}per image, and attaches theevidenceZIP.server/queue/rpc_server/NyilvantartoScraperRPCServer.js(NOT registered inserver.js) — validates the incoming msg viaValidator, runs aNyilvantartoScraper, attacheszipContent, returns the validity result.server/queue/rpc_client/*— caller-side helpers other FaceKom services wouldextends RPCClient:KkszbRPCClient(getDocumentDataBy4T/ByIdNumber, default 30 s) andNyilvantartoScraperRPCClient(verifyID(...)mapping the 7 Hungarian fields).
KkszbRPCClient payload shape diverges from the server
KkszbRPCClient.getDocumentDataBy4Tsends{ documentType, customerSignature, customerPortrait, birthName, birthDate, birthPlace, mothersBirthName }(server/queue/rpc_client/KkszbRPCClient.js:4-5), butKkszbService.getDocumentDataBy4T/processor.json4Tconsume{ legalSurname, legalForenames, birthSurname, birthForenames, mothersSurname, mothersForenames, birthPlace, birthDate, gender, identityMatchLevel }(server/kkszb/processor.js:26-39,server/kkszb/kkszb.d.ts:5-16). The client helper appears stale relative to the v2 server contract — verify field mapping before relying on it.
Scraper service path (present, unwired)
server/service/NyilvantartoScraperService.js—class NyilvantartoScraper extends Scraper(@techteamer/scraper). Drives a Puppeteer page againstconfig.scraper.path(/ugyseged/OkmanyErvenyessegLekerdezes.xhtml), waits for the form, delegates captcha image toCVService.decodeCaptcha(:77-85), fills the JSF form (okmanyTipus,okmanyAzonosito, names, captcha;anyjaNeveonly for SZIG/REGI_SZIG), submits, screenshots open + filled form into a ZIP archive, and parses the Hungarian result message to setisSuccess(:209-216).getZipBuffer()finalizes the archive.server/service/CVService.js— HTTP client to the CV service (vuer_cv).decodeCaptchauploads the captcha JPEG toPOST {cvHost}/api/v1/image-upload, thenPOST /api/v1/kaptcha-decoderto OCR it (:96-138);pinghits/api/v1/ping(:68-88). Picks a random CV host fromconfig.hosts.cvs(mutual-TLS agent if cert/key/ca present).server/validator/Validator.js— rule engine (regexpattern/type/required/options) for scraper input fields:utoNev,csaladiNev,okmanyAzonosito(regex^\d{6}[A-Za-z]{2}$|^[A-Za-z]{2}\d{6,7}$),okmanyTipus∈ {SZEMELYI_IGAZOLVANY, REGI_SZEMELYI_IGAZOLVANY, VEZETOI_ENGEDELY, UTLEVEL},szuletesiHely,szuletesiIdo,anyjaNeve(required only for the two SZIG types).
Cross-cutting
server/service_container.js— exported singleton{ emitter: ServiceBus }.ServiceBus extends EventEmitteradds a hook system (addHook/callHooks/callOnlyHook) and an override registry (registerOverride/callOverride) — the extension seam customizations use (server.js:29callsemitter.callHooks('queue', connectionPool)).server/util/certificate.js— OCSP revocation check by shelling out toopenssl ocsp(:63), throwingOcspErroron revoked/expired/missing.server/util/store.js—createZip(archiver) and a hand-writtenextractZipthat parses ZIP local-file headers + zlib-inflates entries (:49-73).
7. Configuration
Config is loaded by getconfig (env RUNTIME_ENV → config/<env>.json), wrapped by config.js to add .get(path, default), .has(path), .clone(path, default) and to:
- derive
config.hosts.cvfrom/etc/hostname(orDEV_DOMAIN) whenRUNTIME_ENVisdev/travisci(config.js:39-50), - override
config.queue.url='amqp://localhost:5672'undertravisci(config.js:52-55), - fan
hosts.cv→hosts.cvs:[{host}](config.js:57-61), - pretty-print +
process.exit(2)on a JSON syntax error in the config file (config.js:7-37).
Config keys (from config/dev.json / config/docker.json)
| Path | Purpose | dev vs docker |
|---|---|---|
settings.listenProcessWarning | log Node process 'warning' events | both true |
settings.allowSelfSignedCerts | (consumed in process-settings.js:6) sets NODE_TLS_REJECT_UNAUTHORIZED=0 | not present in shipped configs (default off) |
server.queueName | "nyilvantarto-scraper" | docker only (config/docker.json:5-7) — note server.js does not read this |
queue.url | amqps://rabbitmq:5671 | both |
queue.options | mTLS: rejectUnauthorized:false + client cert/key + CA from /workspace/vuer_mq_cert/... | both |
queue.rpcTimeoutMs / queue.rpcQueueMaxSize | 10000 / 100 | both |
kkszb.https | false (dev) / true (docker) | differs |
kkszb.baseUrl | gw.int-kkszb.gov.hu (dev) / gw.kkszb.gov.hu (docker) | differs |
kkszb.endpointId | 127.0.0.1 (SOAP vegpontAzonosito) | both |
kkszb.port | 443 | both |
kkszb.evidence | true (collect all evidence) | both |
kkszb.caCheck.{enabled,caCertFile} | enabled:true, caCertFile:"" — gates OCSP + mTLS agent | both |
kkszb.token.{szig,rszig,utl,ven}.{adat4T,okmanyszam} + kkszb.token.kepLekeres | per-doc API tokens via $$ENV substitution | both |
kkszb.apis.* | KKSZB interop paths (/interop/<doc>/lek/{4T,okmany}/v1, image /interop/szig/lek/kep/v1) | both |
hosts.cv | CV host (empty; derived at runtime in dev) | both |
scraper.port 8080, scraper.path /ugyseged/OkmanyErvenyessegLekerdezes.xhtml | scraper target | both |
scraper.captchaTimeout 5000 | captcha decode timeout (ms) | both |
scraper.proxy.target | https://www.nyilvantarto.hu:443 + 5 s proxy/timeout | both |
scraper.ipFilter 195.228.130.13, scraper.browser.puppeteer (headless, --no-sandbox, --shm-size=8gb …), scraper.ocsp.agent, scraper.save | scraper/browser | both |
Env vars (verified)
| Var | Use | Source |
|---|---|---|
RUNTIME_ENV | selects getconfig file; dev/travisci trigger CV-host + queue overrides | config.js:39,52, supervisor confs |
DEV_DOMAIN | overrides /etc/hostname for CV-host derivation (dev) | config.js:40-42 |
NODE_ENV | set to travisci in CI | .travis.yml:13 |
DOCKER_USER | supervisor user=%(ENV_DOCKER_USER)s | supervisor confs :8 |
$$USZIG_4T_TOKEN, $$USZIG_OKMANYSZAM_TOKEN, $$RSZIG_4T_TOKEN, $$RSZIG_OKMANYSZAM_TOKEN, $$UTLEVEL_4T_TOKEN, $$UTLEVEL_OKMANYSZAM_TOKEN, $$VEZETOI_4T_TOKEN, $$VEZETOI_OKMANYSZAM_TOKEN, $$KEP_TOKEN | KKSZB API tokens substituted into config | config/*.json:26-44, README.md:107-129 |
process.env.TZ | forced to Etc/UTC at boot | server/bootstrap/process-settings.js:4 |
Config validation is code, not AJV
There is no AJV schema. Config correctness for KKSZB is enforced imperatively in
KkszbService._createConfig/_assertKkszbConfig/_assertString, throwingKkszbConfigErroron missing/wrong-typed fields (server/service/KkszbService.js:156-251). Local secrets live inconfig/local.json(git-ignored,.gitignore:7).
8. Tests
- Framework: native
node --test+node:assert/strict; coverage viac8. No Jest (despiteeslint-plugin-jestbeing installed).package.json:11-15. - Location:
test/unit/kkszb/*.test.js(11 processor/Context unit tests),test/integration/kkszb/*.test.js(8{Rszig,Szig,Utl,Ven}{4T,Id}Querytests),test/mock/(FakeServiceContainer, per-doc-type handlers,FakeServer.jsHTTP fake KKSZB),test/bin/fakekkszb(manual harness to drivekkszbqueryagainst the fake server),test/scripts/travis.sh(CI driver). - Unit tests (e.g.
test/unit/kkszb/Szig4TQueryProcessor.test.js) assertpath/payload/header/jsonand error mapping (KkszbDataErrorissue extraction,KkszbApiErroron non-JSON) with no network. - Integration tests run against the in-repo
FakeServer(test/mock/kkszb/FakeServer.js) which routes URLs like/rszig/4T/ok/no-imageto canned handlers. - How to run:
yarn test(all, with coverage),yarn test:unit,yarn test:integration. Coverage reports →test/coverage/(lcov + html). - CI (
test/scripts/travis.sh):yarn install --frozen-lockfile→yarn audit(fail only on CRITICAL, exit ≥16) →yarn test:silent→git diff --exit-code(no uncommitted changes) → assert no stray executables outside whitelisted dirs (:21-27), then SonarCloud scan (.travis.yml:29-33, needs JDK 17).
test/coverage/.gitkeeponlyThe coverage dir is committed empty; reports are generated, not stored (
.gitignore:14-16).
9. Dependencies on other FaceKom services
| Dependency | Direction | Evidence |
|---|---|---|
RabbitMQ (amqps://rabbitmq:5671, mTLS) | This service is an RPC server on connection nyilvantarto, RPC name kkszb-rpc, actions getDocumentDataBy4T/getDocumentDataByIdNumber | server.js:25-30, config/*.json:8-15, server/queue/rpc_server/KkszbRPCServer.js:14-15 |
| RabbitMQ client certs | Reads /workspace/vuer_mq_cert/client/{cert,key}.pem + ca/cacert.pem | config/*.json:9-11 — see vuer_docker for cert provisioning |
| CV service (vuer_cv) | This service is an HTTP client → GET /api/v1/ping, POST /api/v1/image-upload, POST /api/v1/kaptcha-decoder (captcha OCR) | server/service/CVService.js:72,105,119; host from config.hosts.cvs, dev host cv<sep><devDomain> (config.js:47-49) |
| KKSZB gov gateway (external, not FaceKom) | HTTP/SOAP client → gw[.int]-kkszb.gov.hu:443/interop/... | config/*.json:16-66, server/kkszb/KkszbApi.js:85-92 |
| nyilvantarto.hu portal (external) | Puppeteer-via-proxy scrape (scraper path only) | config/*.json:71-83, server/service/NyilvantartoScraperService.js |
| OpenSSL binary | Shelled out for OCSP (openssl ocsp ...) | server/util/certificate.js:63 |
No DB and no Redis are referenced anywhere in first-party code (verified — no pg/mysql/mongo/redis/ioredis imports; sonar-project.properties:7 mentions a server/db/ exclusion glob but no server/db/ directory exists in this clone).
10. Verified gotchas
The scraper RPC server is dead code in
server.jsOnly
kkszb-rpc(KkszbRPCServer) is registered (server.js:25-30).NyilvantartoScraperRPCServeris never wired into the boot path of this base clone, and its dependency@techteamer/scraperis not inpackage.json. The README documents the scraper RPC contract (README.md:498-549) butnode serverwill not serve it as-is. (Likely activated via a customization overlay — see customization-architecture / customization-branch-catalog.)
Any RabbitMQ connection close kills the process
server/bootstrap/connection/rabbitmq.js:14-18registersconnection.on('close')→process.exit(2)for every pool connection. Supervisor treats exit2as a clean restart code (exitcodes=0,2). Expect hard restarts on broker blips.
OCSP / mTLS only run when
caCheck.enabledAND a realcaCertFile
KkszbService._createAgentConfigreturnsundefined(no agent, no OCSP) unlesscaCheck.enabledis true (server/service/KkszbService.js:191). Shipped configs setenabled:truebutcaCertFile:"", sofs.readFileSync("")would throw at startup — a real CA path must be injected at deploy._verifyOcspis a no-op when there’s no agent (server/kkszb/KkszbApi.js:217-223).
OCSP shells out via an unescaped command string
server/util/certificate.js:63builds anopenssl ocsp ... <(echo "${pem}") ... -url ${ocspUri}string andexecs it (bash process substitution). The OCSP URI comes from the server certificate’sinfoAccess. Requires abash-capable shell withopensslon PATH.
fast-xml-parserhas a known moderate advisory (unpatched here)
security/2026-05-04.mdrecords advisory 1116957 (XMLBuilder comment/CDATA injection), patched in ≥5.7.0; repo pins ^4.5.0. Theuuidadvisory is mitigated viaresolutions["@techteamer/mq/uuid"]: ^14.0.0(package.json:47-49). CI only fails on CRITICAL (≥16), so this moderate passes (test/scripts/travis.sh:14).
English ⇄ Hungarian field mapping is everywhere
The RPC/CLI accept English-ish field names (
legalSurname,birthDate,mothersSurname) whichprocessor.json4Tmaps to Hungarian KKSZB fields (viseltVezeteknev,szuletesiDatum,anyjaVezetekneve); responses keep Hungarian keys (okmanyAzonosito,adatLista). Budget time for the glossary inREADME.md:227-256when integrating.
Misspellings are load-bearing in the contract
Error name
'UnkownError'(sic) andKkszbDataErrorissue typos are part of the wire contract (server/util/error.js:31,48,README.md:182). Don’t “fix” them without coordinating callers.
KkszbRPCClientis likely stale (see §6 warning) — prefer the documented{documentType, ...4T}shape fromREADME.md:240-256.
Unverified / gaps
- Surveyed structurally, not line-by-line: the 12 per-document processors are represented by reading
Szig4TQueryProcessor.js(JSON 4T),UtlIdQueryProcessor.js(SOAP id),ImageJsonRequestProcessor.js, andImageSoapRequestProcessor.js. The siblingsRszig4TQueryProcessor.js,RszigIdQueryProcessor.js,SzigIdQueryProcessor.js,Utl4TQueryProcessor.js,Ven4TQueryProcessor.js,Ven4TQueryProcessor.js/VenIdQueryProcessor.jsand error classesKkszbApiError.js/KkszbMissingResourceError.jswere not read in full (names/roles inferred fromKkszbApi.jswiring + the read baseprocessor.js). - Test mocks not all read: of
test/, onlySzig4TQueryProcessor.test.js,FakeServer.js,test/bin/fakekkszb, andtravis.shwere read; the 8 integration tests, the other 10 unit tests, and per-doc mock handlers (RszigHandler/SzigHandler/UtlHandler/VenHandler/KepLekeresHandler,FakeConfig.js,FakeServiceContainer.js) were listed but not opened line-by-line. maintenance/2026-04-07.mdandsecurity/2026-04-07.mdwere not read (only the 2026-05-04 successors were).@techteamer/mqand@techteamer/scraperinternals are third-party and intentionally not documented; RPC server/timeout semantics (timeoutMs:300000, prefetch) are taken from the subclass call only.- No runtime executed (read-only task). Claims about behavior derive from source reading, not from running
node server/tests. - Whether/how the scraper RPC server and
server.queueNameget activated (and@techteamer/scraperadded) is out of scope — expected to live in a customization branch (see customization-branch-catalog), not verified here.
Sources
Files actually read in /Users/levander/coding/facekom-v2-clones/nyilvantarto_scraper:
- Root:
package.json,README.md,server.js,config.js,logger.js,changelog.md,.eslintrc.json,.eslintignore,.editorconfig,.gitignore,.travis.yml,build.ignore,sonar-project.properties,supervisor_nyilvantarto_scraper_dev.conf,supervisor_nyilvantarto_scraper_docker.conf config/dev.json,config/docker.jsonserver/service_container.jsserver/bootstrap/process-settings.js,server/bootstrap/process-listeners.js,server/bootstrap/connection/rabbitmq.jsserver/service/KkszbService.js,server/service/NyilvantartoScraperService.js,server/service/CVService.jsserver/kkszb/KkszbApi.js,server/kkszb/Context.js,server/kkszb/DocumentRequestProcessorFactory.js,server/kkszb/processor.js,server/kkszb/Szig4TQueryProcessor.js,server/kkszb/UtlIdQueryProcessor.js,server/kkszb/ImageJsonRequestProcessor.js,server/kkszb/ImageSoapRequestProcessor.js,server/kkszb/KkszbDataError.js,server/kkszb/KkszbConfigError.js,server/kkszb/kkszb.d.tsserver/queue/rpc_server/KkszbRPCServer.js,server/queue/rpc_server/NyilvantartoScraperRPCServer.js,server/queue/rpc_client/KkszbRPCClient.js,server/queue/rpc_client/NyilvantartoScraperRPCClient.jsserver/util/request.js,server/util/certificate.js,server/util/store.js,server/util/stream.js,server/util/xml.js,server/util/error.jsserver/validator/Validator.jsbin/kkszbquery,bin/qtspintegritytest/scripts/travis.sh,test/unit/kkszb/Szig4TQueryProcessor.test.js,test/mock/kkszb/FakeServer.js,test/bin/fakekkszbmaintenance/2026-05-04.md,security/2026-05-04.md- Directory listings (verified via
find/ls -R):server/**,bin/,config/,test/**,maintenance/,security/ - Git metadata:
git -C ... branch -a,git -C ... log -1(HEAD6e52f0e)