pub struct OsGatewayAttributeGenerator { /* private fields */ }
Expand description
Creates and tracks all attributes needed to properly interact with Object Store Gateway.
Includes instantiation functions that ensure that all provided values are present before including them in an event.
Note: Repeatedly calling fluent functions will replace the previous value submitted via that function.
Implementations§
Source§impl OsGatewayAttributeGenerator
impl OsGatewayAttributeGenerator
Sourcepub fn access_grant<S1: Into<String>, S2: Into<String>>(
scope_address: S1,
target_account_address: S2,
) -> Self
pub fn access_grant<S1: Into<String>, S2: Into<String>>( scope_address: S1, target_account_address: S2, ) -> Self
Generates the required values in the Cosmwasm Response struct in order to denote to Object Store Gateway that access needs to be granted to an account.
This event will be disregarded by the gateway unless the following criteria is met:
- The Provenance Blockchain Account that signs the wasm payload must be the value owner of the Provenance Blockchain Scope.
- A Provenance Blockchain Account that is registered to an object store gateway instance must have been used as an additional public key audience when the scope’s records were stored in Object Store.
§Parameters
scope_address
The bech32 address of the Provenance Blockchain Scope to which this access grant refers.target_account_address
The bech32 address of the Provenance Blockchain Account to which this access grant refers. The account will be able to retrieve all record data for the referred scope upon successful processing of this event.
Sourcepub fn access_revoke<S1: Into<String>, S2: Into<String>>(
scope_address: S1,
target_account_address: S2,
) -> Self
pub fn access_revoke<S1: Into<String>, S2: Into<String>>( scope_address: S1, target_account_address: S2, ) -> Self
Generates the required values in the Cosmwasm Response struct in order to denote to Object Store Gateway that access needs to be revoked from an account.
This event will be disregarded by the gateway unless the following criteria is met:
- The Provenance Blockchain Account that signs the wasm payload must be the value owner of the Provenance Blockchain Scope OR the signer must be the same account as is used for target_account_address.
§Parameters
scope_address
The bech32 address of the Provenance Blockchain Scope to which this access revoke refers.target_account_address
The bech32 address of the Provenance Blockchain Account to which this access revoke refers. The account will no longer be able to retrieve records for the given scope upon successful processing of this event.
Sourcepub fn with_access_grant_id<S: Into<String>>(self, access_grant_id: S) -> Self
pub fn with_access_grant_id<S: Into<String>>(self, access_grant_id: S) -> Self
Includes a custom access grant unique identifier in an access request event structure.
This value behaves differently based on the type of event in which it is included:
- Access Grants: This value will be used to establish a unique identifier in any Object Store Gateway which processes the event. This allows the revocation process to directly target a record.
- Access Revokes: This value will be used to target a specific access grant to revoke. If this value is omitted, the default behavior is to remove all grants specified for a Provenance Blockchain Scope address and grantee Provenance Blockchain Account address combination at once.
Trait Implementations§
Source§impl Clone for OsGatewayAttributeGenerator
impl Clone for OsGatewayAttributeGenerator
Source§fn clone(&self) -> OsGatewayAttributeGenerator
fn clone(&self) -> OsGatewayAttributeGenerator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more