PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::ihe::xds::document_consumer Class Reference

ITI-43 Document Consumer actor. More...

#include <document_consumer.h>

Collaboration diagram for kcenon::pacs::ihe::xds::document_consumer:
Collaboration graph

Classes

class  impl
 

Public Member Functions

 document_consumer (http_options opts, signing_material signing)
 Construct an ITI-43 Document Consumer bound to a repository endpoint and a signing credential.
 
 document_consumer (document_consumer &&) noexcept
 
document_consumer & operator= (document_consumer &&) noexcept
 
 document_consumer (const document_consumer &)=delete
 
document_consumer & operator= (const document_consumer &)=delete
 
 ~document_consumer ()
 
kcenon::common::Result< document_response > retrieve (const std::string &document_unique_id, const std::string &repository_unique_id)
 Retrieve one document by its (documentUniqueId, repositoryUniqueId) pair.
 
void set_audit_sink (std::shared_ptr< kcenon::pacs::security::xds_audit_sink > sink)
 Install an ATNA audit sink.
 

Private Attributes

std::unique_ptr< impl > impl_
 

Detailed Description

ITI-43 Document Consumer actor.

Binds one repository endpoint and one signing credential. To query different repositories or sign with different certificates, instantiate multiple document_consumer objects.

The signing_material is reused from the Document Source type so a single deployment can share its WS-Security credential between the push (ITI-41) and pull (ITI-43) actors without re-declaring the struct.

Thread-safety: retrieve() is NOT reentrant per instance - callers must serialize retrieve calls per instance, or create one instance per worker thread. The underlying libcurl handle is owned by the impl and may not be shared between threads.

Definition at line 68 of file document_consumer.h.

Constructor & Destructor Documentation

◆ document_consumer() [1/3]

kcenon::pacs::ihe::xds::document_consumer::document_consumer ( http_options opts,
signing_material signing )

Construct an ITI-43 Document Consumer bound to a repository endpoint and a signing credential.

The endpoint in opts must be the Retrieve Document Set-b service URL on the Document Repository. The default http_options.soap_action ("urn:ihe:iti:2007:RegisterDocumentSet-b") is ITI-41-specific and is overwritten internally by the ITI-43 action URI before the POST. Callers need not clear it themselves.

Signing material is copied into the instance; the caller may then zeroize the original buffer. The constructor never throws - any material validation failure is deferred to retrieve() and surfaces as a typed error_code.

Definition at line 155 of file document_consumer.cpp.

157 : impl_(std::make_unique<impl>(std::move(opts), std::move(signing))) {}

◆ document_consumer() [2/3]

kcenon::pacs::ihe::xds::document_consumer::document_consumer ( document_consumer && )
defaultnoexcept

◆ document_consumer() [3/3]

kcenon::pacs::ihe::xds::document_consumer::document_consumer ( const document_consumer & )
delete

◆ ~document_consumer()

kcenon::pacs::ihe::xds::document_consumer::~document_consumer ( )
default

Member Function Documentation

◆ operator=() [1/2]

document_consumer & kcenon::pacs::ihe::xds::document_consumer::operator= ( const document_consumer & )
delete

◆ operator=() [2/2]

document_consumer & kcenon::pacs::ihe::xds::document_consumer::operator= ( document_consumer && )
defaultnoexcept

◆ retrieve()

kcenon::common::Result< document_response > kcenon::pacs::ihe::xds::document_consumer::retrieve ( const std::string & document_unique_id,
const std::string & repository_unique_id )

Retrieve one document by its (documentUniqueId, repositoryUniqueId) pair.

Sequence: validate identifiers -> build xdsb:RetrieveDocumentSetRequest SOAP envelope -> WS-Security sign Timestamp+Body -> POST plain SOAP (no outbound MTOM parts) over HTTPS -> receive multipart/related MTOM response -> parse root envelope and attachment parts -> verify_envelope_integrity on the response -> locate the DocumentResponse matching the requested uid and resolve its xop:Include to the attachment bytes.

TRUST CAVEAT: the response signature check is integrity-only - it binds the payload to the cert embedded in the response's BST, but does NOT validate that cert against a trust anchor. An on-path attacker who can serve any valid X.509 cert will pass this check. Full trust-chain validation is deferred to the Gazelle conformance integration (#1131). Callers relying on retrieve() for authenticity must not treat a successful Result as signer-authenticated.

All failure modes surface as typed error_code values; the function never throws across the API boundary. A Registry-reported Failure status or an absent DocumentResponse maps to consumer_response_document_not_found.

Definition at line 165 of file document_consumer.cpp.

167 {
168 return impl_->retrieve(document_unique_id, repository_unique_id);
169}
kcenon::common::Result< document_response > retrieve(const std::string &document_unique_id, const std::string &repository_unique_id)

References retrieve().

Referenced by retrieve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_audit_sink()

void kcenon::pacs::ihe::xds::document_consumer::set_audit_sink ( std::shared_ptr< kcenon::pacs::security::xds_audit_sink > sink)

Install an ATNA audit sink.

When set, retrieve() emits exactly one audit event per invocation

  • success or failure - carrying the requested document uid, repository uid, source endpoint, and the outcome code.
See also
kcenon::pacs::security::xds_audit_sink
Issue #1131

Definition at line 171 of file document_consumer.cpp.

172 {
173 impl_->set_audit_sink(std::move(sink));
174}
void set_audit_sink(std::shared_ptr< kcenon::pacs::security::xds_audit_sink > sink)

References impl_, and kcenon::pacs::ihe::xds::document_consumer::impl::set_audit_sink().

Here is the call graph for this function:

Member Data Documentation

◆ impl_

std::unique_ptr<impl> kcenon::pacs::ihe::xds::document_consumer::impl_
private

Definition at line 139 of file document_consumer.h.

Referenced by set_audit_sink().


The documentation for this class was generated from the following files: