Skip to content

DocLocator validation for all fetching documents from provider #644

@Mr-Leshiy

Description

@Mr-Leshiy

Summary

Properly apply DocLocator check while fetching a referenced document from the CatalystSignedDocumentProvider during the validation process.

Description

  • Update referenced_doc_id_and_ver_check renaming it to referenced_doc_ref_check and add additional validation
fn referenced_doc_ref_check(
    ref_doc: &CatalystSignedDocument,
    original_doc_ref: &DocumentRef,
    field_name: &str,
    report: &ProblemReport,
) -> bool {
    let Ok(doc_ref) = ref_doc.doc_ref() else {
        report.functional_validation(
            ...
        );
        return false;
    };

    if &doc_ref != original_doc_ref {
        report.invalid_value(
            ...
        );
        return false;
    }

    true

}
  • Add test case scenario with corrupting DocLocator part in the DocumentRef
  • Update ChainRule::check with using doc_refs_check, instead of manually calling provider.try_get_doc

Metadata

Metadata

Assignees

No one assigned

    Labels

    squad: gatekeepersCatalyst App Backend, System Development & Integration Team

    Type

    Projects

    Status

    🔖 Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions