Skip to main content

Crate dmvs

Crate dmvs 

Source
Expand description

§dmvs

A high-level asynchronous Rust client for a focused set of consumer-facing ČÚZK DMVS SOAP services.

The crate uses explicit integration/production environments, fixed HTTPS endpoints, mutual TLS with a PEM certificate chain and private key, an explicit requester subject, namespace-aware SOAP 1.1 decoding, correlated request UUIDs, typed service errors, bounded responses, and raw-preserving protocol values. Production is never the default.

The public geometry API uses geo-types; consumers can interoperate with the broader geo crate through its re-exported geometry types. Coordinates and CRS are preserved without implicit axis swaps or reprojection.

§Installation

cargo add dmvs

The crate is pre-1.0, so API changes may occur between minor releases. Rust 1.89 or newer is supported. The reqwest/rustls backend may require a supported C/CMake toolchain for its bundled native components.

§Supported services and operations

The supported surface is exactly 5 services and 18 official operations. Each official operation below has one public Client method; explicitly named convenience helpers are listed separately. Partial services contain only the operations shown, not every operation in their WSDL.

The client does not infer registration, role, or legal eligibility; ČÚZK remains authoritative. R19 submissions and R49 inquiries can create server-side jobs. Non-public R19 is available to eligible downstream consumers, but supplying a requester status or evidence never establishes eligibility.

ServiceEligibility and deployment notesOfficial operation → public method
R18a — affected infrastructure respondents (1)Any registered subject.ctiVyjadrovatele → list_infrastructure_respondents
R18b — subject lookup (4)Any registered subject for these general-reader calls; excludes territory/scope searches requiring special roles.ctiSubjekt → read_subject
ctiSubjektDleIco → read_subject_by_organization_number
ctiSubjektyDleIdentifikace → search_subjects
ctiSubjektyDleCasti → list_infrastructure_part_subjects
R19 — custom-area DTM datasets (4)Public submission/result operations are included. Non-public operations require the applicable documented registration/eligibility, requester status, and evidence where required; the server decides eligibility.vyhotovVerejnouDatovouSadu → submit_public_custom_area_dataset
ctiVysledekVyhotovVerejnouDatovouSadu → read_public_custom_area_dataset_result
vyhotovNeverejnouDatovouSadu → submit_non_public_custom_area_dataset
ctiVysledekVyhotovNeverejnouDatovouSadu → read_non_public_custom_area_dataset_result
R24a — central code lists/configuration (5)Any registered subject.vylistujCiselniky → list_code_lists
ctiCiselnik → read_code_list
vylistujVerzeJvf → list_jvf_versions
ctiVerziJvf → read_jvf_version
vylistujCertifikatyIsDmvs → list_is_dmvs_certificates
R49 — infrastructure managers in a territory (4)Any registered subject for the selected central workflow. Documentation conflicts about Design/Produkce are recorded in SCHEMAS.md.zjistiUzemiSpravcuDti → submit_infrastructure_manager_inquiry
ctiVysledekZjistiUzemiSpravcuDti → read_infrastructure_manager_inquiry_result
ctiVysledekZjistiUzemiSpravcuDtiSeznamCastiDti → list_infrastructure_manager_inquiry_parts
ctiVysledekZjistiUzemiSpravcuDtiReport → read_infrastructure_manager_inquiry_report

For non-public R19, NonPublicRequesterStatus::ApplicantByApplication (ZadatelDleZadosti) requires genuine supporting evidence. Other genuine qualifying requester statuses use the same two non-public operations; they are not separate endpoints.

Convenience methods do not add protocol operations. The only convenience waits are wait_for_public_custom_area_dataset, wait_for_non_public_custom_area_dataset, and wait_for_infrastructure_manager_inquiry, which poll the corresponding existing R19 or R49 result operation. No other convenience pagination or polling helpers are provided.

§Environments

  • Environment::Integration selects https://dmvs-i.cuzk.gov.cz:8443/api/ws/v1; INTEG accepts the documented PostSignum test or production certificate.
  • Environment::Production selects https://dmvs.cuzk.gov.cz:8443/api/ws/v1; production requires an accepted registered client certificate. It must be selected explicitly and is never a default.
  • Endpoint construction is not a claim of continuing deployment or authorization. See SCHEMAS.md for protocol provenance and documentation discrepancies.

§Quick start

Construction performs no network request. Both the TLS identity and requester subject are required; .build() fails if either is missing. This example lists JVF versions through R24a vylistujVerzeJvf:

use dmvs::{Client, Environment, SubjectId, TlsIdentity};

async fn example() -> Result<(), Box<dyn std::error::Error>> {
    let certificate_chain = std::fs::read_to_string("certificate-chain.pem")?;
    let private_key = std::fs::read_to_string("private-key.pem")?;
    let subject_id = SubjectId::new(std::env::var("DMVS_SUBJECT")?)?;
    let client = Client::builder(Environment::Integration)
        .identity(TlsIdentity::from_pem(certificate_chain, private_key))
        .subject_id(subject_id)
        .build()?;

    let versions = client.list_jvf_versions().await?;
    for version in versions.value {
        println!("{}: {}", version.version, version.description);
    }
    Ok(())
}

Client::subject_id() returns the configured &SubjectId. Use your operating system’s secret store rather than embedding private keys in source, and do not log real subject identifiers. TlsIdentity supports an unencrypted RSA PKCS#8 PEM key and certificate chain; other rustls-compatible key encodings are accepted only when covered by tests.

§Requester-subject semantics

The configured subject is an explicit authenticated/requester identity for business payloads. It is not inferred from the certificate and is not sent in HTTP or SOAP headers. Mutual TLS still authenticates the transport independently.

  • R19 public/non-public submissions and R49 inquiries automatically serialize the client subject into their requester/subject elements.
  • R18a and R24a do not serialize the client subject.
  • R18b lookup arguments remain per-call targets. In particular, read_subject’s SubjectId argument identifies the subject to look up; it is not replaced by the client’s subject.

§Request constructors

  • InfrastructureManagerInquiryRequest::new(selector, identification) creates an R49 inquiry; .with_notification_email(...) is optional.
  • PublicCustomAreaDatasetRequest::new(valid_on, contents, area, format) creates a public R19 request; .with_notification_email(...) and .with_regions(...) are optional.
  • NonPublicCustomAreaDatasetRequest::new(status, evidence, contents, valid_on, area, format) creates a non-public R19 request; .with_notification_email(...) and .with_regions(...) are optional. ZadatelDleZadosti requires evidence.

§Datasets, limits, and asynchronous recovery

§Content and request limits

  • Public R19 uses PublicCustomAreaDatasetContent::{Di, Zps}. Ti is not representable in the public request type. Non-public R19 uses NonPublicDatasetContent::{Di, Ti}.
  • Non-public requester status, purpose, optional legal reference, and conditionally required evidence are typed. ZadatelDleZadosti requires genuine evidence; supplying it never establishes eligibility, and other qualifying statuses are available through the same operation.
  • R19 public/non-public custom areas and R49 area selectors have a 200 ha (2,000,000 m²) maximum, checked as planar S-JTSK area where possible. Server-side validation still applies.
  • R49 selects either one S-JTSK area or 1–400 RÚIAN parcel IDs, never both.
  • PageRequest is zero-based offset pagination with a limit of 1–250 and optional total count. R18a, R18b subject search, and R49 part-list calls retrieve only their requested page; no method auto-paginates. R49 prose is ambiguous between “250” and “fewer than 250”: the shared model permits 250, but use at most 249 when following the stricter wording.
  • DMVS general and service-specific call quotas are server-enforced. The client’s concurrency/byte limits are local resource controls, not a reliable distributed quota mechanism.
  • ClientBuilder::max_request_bytes bounds the complete encoded SOAP/MTOM request during serialization, including MIME headers and attachments. The default is 64 MiB, and zero is rejected.

§Polling and recovery

  • R19 and R49 submissions are attempted exactly once. There are no automatic retries. An uncertain dispatch may already have created a server-side job; do not blindly resubmit after SubmissionUncertain.
  • Persist the returned opaque RequestId securely. If a valid decoded response has an unexpected state but already contains an ID, SubmissionUncertainWithRecovery and Error::recovery() retain the complete response as redacted SubmissionRecovery, allowing recovery without another submission. Every submission also has a submit_*_with_correlation_id variant for explicit SOAP correlation; that UUID does not replace the server-issued request ID.
  • Submission, one-shot result reads, waiting, R49 part/report reads, and downloads are independent; recovery by a persisted ID does not submit again.
  • WaitOptions bounds the initial delay, total deadline, and fixed/backoff pacing. The default and minimum polling interval are 60 seconds; shorter intervals are rejected. Waiting spawns no background task, does not outlive its deadline, never resubmits, and never downloads datasets or retrieves R49 part pages or the PDF implicitly.
  • Every regional R19 state/rejection and every requested R49 result remains visible. Read each required page and result explicitly rather than assuming the first region or overall status represents all outcomes.
  • R19 dataset results expose preparation and expiry metadata. Use available_until (DostupneDo) for each returned dataset; documented regional URLs normally expire after ten days, but the metadata—not a hard-coded lifetime—is authoritative.

§Files, MTOM, and downloads

Applicable R18a supporting files, R24a JVF files, and R49 PDF reports are decoded from inline base64 or MTOM/XOP responses with independent XML, MIME, decoded-file, and aggregate limits. Non-public R19 evidence uses bounded request-side MTOM with safe file names and either a caller-supplied raw checksum declaration or computed SHA-256 metadata. The evidence bytes are carried in a separate application/octet-stream MIME part, not inside the SOAP root XML.

Returned R19 URLs are never fetched implicitly. The separate DatasetDownloader performs only explicitly initiated HTTPS downloads, with redirects/retries disabled, configurable time/byte limits, buffered or caller-sink streaming, and optional size/checksum checks. It uses a separate credential-free HTTP client with ambient system proxies disabled and never inherits or forwards the SOAP client’s mTLS identity, headers, cookies, proxy credentials, or other credentials.

A checksum is not a digital signature. Algorithms are verified only when explicitly declared and supported, or when the caller explicitly selects SHA-256; R49’s bare 64-hex example is not assumed to be SHA-256. The crate does not provide an R29/R35 callback server, JVF/DGN/SHP/GPKG/PDF-internal parsing, GIS processing, archive extraction, or cryptographic signature verification/parsing.

§Examples

All examples compile offline. Running them may contact DMVS, submit a job, or download a URL. Read each file’s header and use only authorized, non-sensitive inputs. Network examples use examples/common/mod.rs, which accepts PEM contents from DMVS_CERTIFICATE_CHAIN and DMVS_PRIVATE_KEY or PEM paths from DMVS_CERTIFICATE_CHAIN_PEM and DMVS_PRIVATE_KEY_PEM; DMVS_SUBJECT supplies the required subject. DMVS_ENVIRONMENT defaults to integration, and only exact production selects production.

ExamplePurpose
subject_lookupOne R18b subject read without printing personal details.
jvf_versionsR24a JVF-version discovery.
public_custom_areaOne public R19 DI submission and durable-ID handoff.
non_public_custom_areaNon-public R19 DI/TI requester/evidence model.
dataset_recoveryR19 result recovery by persisted ID and explicit downloads.
dataset_download_toBounded, credential-free streaming to a temporary sink.
infrastructure_manager_inquiryR49 submission, bounded wait, and separately opted-in report read.

§Optional features

  • serde: validated string serialization/deserialization for identifiers and correlation UUIDs.
  • tracing: privacy-safe operation, environment, HTTP-status, and byte-count instrumentation. The application configures its own subscriber. Keys, XML, personal data, identifiers, polygons, URLs, and payloads are excluded.

§Safety and compatibility

  • No redirects, automatic HTTP retries, arbitrary production endpoints, or disabled TLS verification.
  • Every SOAP response is correlated to its request UUID and decoded with XML node/depth and byte limits.
  • Server message text remains explicitly available in models but is redacted from normal error/debug output.
  • Unknown states, severities, codes, and other protocol values are preserved rather than discarded.
  • Normal tests and CI are offline and credential-free. Live tests are ignored by default and never part of routine checks.

§Live tests

The single separately authorized, read-only R24a smoke target is in tests/live.rs. It performs no submissions, polling, or downloads. Select the environment explicitly with DMVS_ENVIRONMENT=integration or DMVS_ENVIRONMENT=production; there is no default. INTEG loads the gitignored .env.integ, while production loads the gitignored .env. The selector and DMVS_RUN_LIVE_TESTS=1 opt-in must be process environment variables. Credential values may come from the selected file or process environment:

  • DMVS_SUBJECT: authorized test subject identifier required by client construction;
  • DMVS_PRIVATE_KEY: unencrypted RSA PKCS#8 private-key PEM contents, not a path;
  • DMVS_CERTIFICATE_CHAIN: client certificate-chain PEM contents, not a path.

Never commit .env, .env.integ, credentials, real subject identifiers, private records, or live response content. Normal test runs leave the live target ignored.

After explicit INTEG authorization, run:

DMVS_RUN_LIVE_TESTS=1 DMVS_ENVIRONMENT=integration cargo test --test live -- --ignored --test-threads=1

Run production only after a separate, explicit production-test request; INTEG authorization is not production authorization. Then run:

DMVS_RUN_LIVE_TESTS=1 DMVS_ENVIRONMENT=production cargo test --test live -- --ignored --test-threads=1

§Development

See CONTRIBUTING.md for the verification matrix and live-test safety, SCHEMAS.md for official protocol provenance and known documentation discrepancies, and CHANGELOG.md for changes.

The final public repository is github.com/interaso/dmvs. Development may use another remote before the first release; package metadata always refers to the final GitHub location.

§Official references

§License

Licensed under the MIT License (LICENSE or https://opensource.org/licenses/MIT).

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate is licensed under the MIT License, without additional terms or conditions.

Structs§

Area
A validated polygon or multipolygon with an explicit coordinate reference system.
Checksum
A checksum value exactly as declared by DMVS.
Client
A concurrent, asynchronous DMVS client.
ClientBuilder
Builder for an asynchronous DMVS client.
CodeList
A selected code-list version returned by R24a ctiCiselnik.
CodeListAttribute
Metadata for one attribute of a DMVS code list.
CodeListAttributeReference
A reference from one code-list attribute to an attribute of another code list.
CodeListInfo
Code-list discovery metadata returned by R24a vylistujCiselniky.
CodeListItem
One item in a selected code-list version.
CodeListItemAttribute
One attribute value in a code-list item.
CodeListVersionInfo
Version metadata for a DMVS code list.
CorrelationId
A UUID used to correlate one SOAP request and response.
CustomAreaDataset
One custom-area dataset returned by R19.
CustomAreaDatasetRegionResult
One R19 regional result, including mixed outcome and optional dataset metadata.
CustomAreaDatasetResult
Data returned by either R19 custom-area result operation.
DatasetDownloader
Separate HTTPS downloader for URLs returned by DMVS.
DatasetDownloaderBuilder
Builder for DatasetDownloader.
DatasetEvidence
Purpose, optional legal reference, and required file for a non-public request.
DatasetSubmissionId
The IdPodani value returned with dataset results.
DownloadExpectation
Optional integrity expectations for an explicitly requested dataset download.
DownloadSummary
Summary returned after streaming a dataset to a caller-provided sink.
DownloadedDataset
A bounded, buffered dataset download.
FileMetadata
File metadata returned by DMVS, independent of its payload bytes.
FilePayload
A bounded output file with original bytes and all protocol metadata.
FreeAddress
A free-form postal address.
InfrastructureElementGroup
An infrastructure element-group reference.
InfrastructureInquiryPart
One infrastructure part returned by R49 ctiVysledekZjistiUzemiSpravcuDtiSeznamCastiDti.
InfrastructureManagerInquiryRequest
Validated input for R49 zjistiUzemiSpravcuDti.
InfrastructurePartId
An opaque infrastructure-part identifier.
InfrastructurePartInfo
Shared infrastructure-part identity, element group, and responsible roles used by R49.
InfrastructureRespondentPart
One infrastructure part and its respondent returned by R18a ctiVyjadrovatele.
InputFile
Metadata for a caller-supplied supporting document.
InquiryCadastralArea
A RÚIAN cadastral area reference in an R49 overall result.
InquiryContactDetails
Contact details supplied for obtaining a statement about one infrastructure part.
InquiryMunicipality
A RÚIAN municipality reference in an R49 overall result.
InquiryParcel
One RÚIAN parcel returned in an R49 overall result.
InquiryParcelGroup
All parcels associated with one cadastral area in an R49 overall result.
InquirySubmissionId
The opaque IdPodani returned in an R49 overall result.
InquiryValidationResult
Validation outcome attached to one infrastructure part in an R49 page.
IsDmvsCertificate
An IS DMVS authentication certificate returned by R24a vylistujCertifikatyIsDmvs.
JvfVersion
One complete JVF version returned by R24a ctiVerziJvf.
JvfVersionInfo
Metadata for one documented JVF version.
LegalPerson
A legal person or organization in the IS DMVS subject registry.
NonPublicCustomAreaDatasetRequest
Validated input for R19 vyhotovNeverejnouDatovouSadu.
OverallResult
Overall data returned by R49 ctiVysledekZjistiUzemiSpravcuDti.
Page
One DMVS offset page without hidden auto-pagination.
PageRequest
Exact DMVS offset-page input.
PhysicalPerson
A physical person in the IS DMVS subject registry.
PublicCustomAreaDatasetRequest
Validated input for R19 vyhotovVerejnouDatovouSadu.
RegionCode
An IS DTMK region code, retained as a string.
RequestId
An opaque server-issued asynchronous request identifier.
Response
A successful DMVS value together with common response metadata.
ResponseMetadata
Common response correlation, state, and messages.
RuianAddress
A structured RÚIAN postal address.
ServiceError
An application-level DMVS error containing the complete server message list.
ServiceMessage
One informational, warning, error, or unknown DMVS service message.
Subject
A full registry subject, including optional direct contact details.
SubjectId
An opaque IS DMVS subject identifier.
SubjectInfo
Subject identity and person information without direct contact details.
SubmissionRecovery
A decoded asynchronous submission response that can be resumed by its durable request ID.
TlsIdentity
PEM certificate chain and private key used for DMVS mutual TLS.
WaitOptions
Bounds and pacing for application-asynchronous DMVS result polling.
XmlDate
An XML calendar date retaining its validated lexical representation.
XmlDateTime
An XML date-time retaining its original lexical representation.

Enums§

Address
The address choice used by a registered person or organization.
AreaGeometry
Public geometry variants accepted by DMVS area operations.
ChecksumAlgorithm
A checksum algorithm explicitly declared by a protocol value.
CodeListAttributeKind
The value representation of a code-list attribute.
CodeListDataType
A data type supported by a plain DMVS code-list attribute.
CoordinateReferenceSystem
Coordinate reference system attached to a DMVS area.
DatasetEvidencePurpose
The required purpose choice in non-public supporting evidence.
DatasetFormat
A dataset format, retaining values unknown to this crate version.
DatasetOutcome
Per-region issuance outcome, with raw preservation.
DatasetRegionState
Processing state of one IS DTMK region, with raw preservation.
Environment
DMVS deployment to which a client sends requests.
Error
Errors produced while configuring or calling the DMVS client.
InfrastructureManagerInquirySelector
The explicit territorial choice for an R49 infrastructure-manager inquiry.
InfrastructureSubjectRole
A subject role accepted by the approved R18b searches.
IntegrityStatus
Result of a requested integrity check.
MessageCode
A common DMVS message code with raw preservation for future values.
MessageLevel
Severity of a DMVS service message.
NonPublicDatasetContent
Content accepted by non-public R19 custom-area dataset requests.
NonPublicRequesterStatus
Requester statuses supported by the selected non-public workflow.
Person
The physical/legal-person choice in an IS DMVS subject.
ProcessingState
Common processing state returned in every DMVS response header.
PublicCustomAreaDatasetContent
Content accepted by public R19 custom-area dataset requests.
WaitBackoff
Backoff strategy for bounded asynchronous-result waiting.

Type Aliases§

Result
Result alias used by the DMVS crate.