Skip to content

Update verifyObject #65

Description

@doulikecookiedough

Currently, verifyObject returns a boolean - true when the ObjectMetadata given matches the argument values, and false if not. However, if an algorithm is not found in the ObjectMetadata hexDigests list, it could potentially return false incorrectly.

To Do (after Metacat integration discussion with @taojing2002):

  • Change return type to void and throw custom exceptions when a value does not match
    • voNonMatchingSize ~ when the given size does not match
    • voNonMatchingChecksum ~ when the given checksum does not match what is calculated
    • voUnsupportedAlgorithm ~ when the given algorithm is not supported (part of MessageDigest's supported algorithms)
  • If the algorithm supplied is supported, but not found in the hexDigests list, calculate it and compare to the checksum value given (and throw an exception if it doesn't match)
    • Reminder: Ensure that a hexDigests.get(checksumAlgorithm) null value is accounted for/handled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions