Skip to content

Conversation

@cmickeyb
Copy link
Contributor

  • Refined error responses in guardian service and process capability apps
  • Added support for request uniqueness checks in guardian operations
  • Introduced request_identifier field to ensure unique operation requests
  • Implemented a method to retrieve token identity in exchange token object
  • Extended create_operation_package to include request_identifier handling

This is a very simple implementation of at-most-once semantics for guardian capability processing. To use the feature, add a property to the guardian capability handler class: "unique_request = True". This implementation uses an in memory set on a per-token basis. The implemmentation uses the token identity property that is part of the token-guardian protocol. Added a method to expose the token identity value from the base token_object method class.

@cmickeyb cmickeyb requested a review from Copilot June 30, 2025 16:59
@cmickeyb cmickeyb self-assigned this Jun 30, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds at-most-once processing support to the guardian capability by introducing a new request identifier mechanism along with refined error handling. Key changes include extending the token_object schema and API to support a new request_identifier field, implementing an overloaded create_operation_package and a get_token_identity method, and adding duplicate request detection within the ProcessCapabilityApp.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
exchange-contract/exchange/token_object.h Extended the token schema and declared new functions for handling request identifiers
exchange-contract/exchange/contracts/token_object.cpp Implemented get_token_identity and overloaded create_operation_package with auto-generation of identifiers
common-contract/pdo/contracts/guardian/wsgi/process_capability.py Added duplicate request detection and refined error responses in the request processing logic
common-contract/pdo/contracts/guardian/scripts/guardianCLI.py Removed the redundant ErrorResponse function
common-contract/pdo/contracts/guardian/common/guardian_service.py Updated error handling to use more informative error messages and logging
Comments suppressed due to low confidence (1)

common-contract/pdo/contracts/guardian/wsgi/process_capability.py:57

  • For unique operations, consider adding 'request_identifier' to the 'required' array of the schema to enforce its presence and prevent potential runtime errors when processing unique requests.
            "request_identifier" : { "type" : "string" },

cmickeyb and others added 2 commits June 30, 2025 11:11
…uests

- Refined error responses in guardian service and process capability apps
- Added support for request uniqueness checks in guardian operations
- Introduced `request_identifier` field to ensure unique operation requests
- Implemented a method to retrieve token identity in exchange token object
- Extended `create_operation_package` to include `request_identifier` handling

This is a very simple implementation of at-most-once semantics for
guardian capability processing. To use the feature, add a property to
the guardian capability handler class: "unique_request = True".  This
implementation uses an in memory set on a per-token basis. The
implemmentation uses the token identity property that is part of the
token-guardian protocol. Added a method to expose the token identity
value from the base token_object method class.

Signed-off-by: Mic Bowman <mic.bowman@intel.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Mic Bowman <mic.bowman@intel.com>
@cmickeyb cmickeyb force-pushed the mic.jun30.unique_requests branch from ff7657b to 78b4988 Compare June 30, 2025 17:11
@cmickeyb cmickeyb merged commit 8c7c330 into hyperledger-labs:main Jun 30, 2025
4 checks passed
@cmickeyb cmickeyb deleted the mic.jun30.unique_requests branch June 30, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant