Skip to content

Commit

Permalink
Merge pull request #132 from DataONEorg/feature-124-verifyobject-update
Browse files Browse the repository at this point in the history
Feature-124: `verify_object` Update
  • Loading branch information
doulikecookiedough authored Sep 12, 2024
2 parents 74d446f + 791c17e commit 15e3949
Show file tree
Hide file tree
Showing 6 changed files with 767 additions and 672 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ store and tag an object simultaneously if the relevant data is available. In the
identifier (ex. persistent identifier (pid)), `store_object` can be called to solely store an
object. The client is then expected to call `verify_object` when the relevant metadata is available
to confirm that the object has been stored as expected. The client is then expected to call
`delete_if_invalid_object` when the relevant metadata is available to confirm that the object is
`delete_invalid_object` when the relevant metadata is available to confirm that the object is
what is expected. And to finalize the process (to make the object discoverable), the client
calls `tagObject``. In summary, there are two expected paths to store an object:

Expand All @@ -177,11 +177,11 @@ hashstore_factory = HashStoreFactory()

# Create a properties dictionary with the required fields
properties = {
"store_path": "/path/to/your/store",
"store_depth": 3,
"store_width": 2,
"store_algorithm": "SHA-256",
"store_metadata_namespace": "https://ns.dataone.org/service/types/v2.0#SystemMetadata",
"store_path": "/path/to/your/store",
"store_depth": 3,
"store_width": 2,
"store_algorithm": "SHA-256",
"store_metadata_namespace": "https://ns.dataone.org/service/types/v2.0#SystemMetadata",
}

# Get HashStore from factory
Expand All @@ -203,8 +203,8 @@ obj_info_allinone = hashstore.store_object(input_stream, pid, additional_algo, c
# Manual Process
# Store object
obj_info_manual = hashstore.store_object(input_stream)
# Validate object, throws exceptions if there is a mismatch and deletes the associated file
hashstore.verify_object(obj_info_manual, checksum, checksum_algo, obj_size)
# Validate object with expected values when available
hashstore.delete_invalid_object(obj_info_manual, checksum, checksum_algo, obj_size)
# Tag object, makes the object discoverable (find, retrieve, delete)
hashstore.tag_object(pid, obj_info_manual.cid)
```
Expand Down
Loading

0 comments on commit 15e3949

Please sign in to comment.