Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional parties and party/signer/role validation overhaul #1453

Merged
merged 138 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from 137 commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
ea68ec7
[1438]: Move some stuff out of the keeper.go file into a new authz.go…
SpicyLemon Mar 23, 2023
30e15a2
[1438]: Update the authz tests to be in their own suite. Also update …
SpicyLemon Mar 23, 2023
7fb8c02
[1438]: Expand on the TestGetMsgTypeURLs test to include more test ca…
SpicyLemon Mar 23, 2023
6cae06d
[1438]: Remove comment that was accidentally left when moving things.
SpicyLemon Mar 23, 2023
6ab52c9
[1438]: Rename GetMessageTypeURLs to GetAuthzMessageTypeURLs.
SpicyLemon Mar 23, 2023
7170096
[1438]: Create the MetadataAddressable and MetadataSpecAddressable in…
SpicyLemon Mar 24, 2023
a67694a
Merge branch 'main' into dwedul/1438-optional-parties
SpicyLemon Mar 24, 2023
0b237d4
[1438]: Make checkAuthzForMissing take in an sdk.Msg instead of just …
SpicyLemon Mar 24, 2023
509dcf3
[1438]: Remove all the signers function paramters and just get that i…
SpicyLemon Mar 24, 2023
5754e8c
[1438]: Move ValidateScopeOwners into authz.go (from scope.go) since …
SpicyLemon Mar 24, 2023
8d11921
[1438]: Rename the keeper validate funcs to match the endpoints that …
SpicyLemon Mar 24, 2023
fe3f1a5
[1438]: Tweak TestPrintMessageTypeStrings to not actually check anyth…
SpicyLemon Mar 24, 2023
d8f26ef
[1438]: Switch to the sdk's MustAccAddressFromBech32 instead of our o…
SpicyLemon Mar 24, 2023
5f0efc2
[1438]: Remove all the MsgTypeURL() functions since they're not requi…
SpicyLemon Mar 24, 2023
4fac278
[1438]: Switch to using auto-generated String() funcs for the metadat…
SpicyLemon Mar 24, 2023
ddd5213
[1438]: Provide GetSignersStr to NewEventTxCompleted because GetSigne…
SpicyLemon Mar 24, 2023
6b8c881
[1438]: Add HasAccess to the MarkerAccountI. It's the same as Address…
SpicyLemon Mar 24, 2023
04eba93
[1438]: Update ValidateWriteScope to take in a pointer for the existi…
SpicyLemon Mar 24, 2023
074522d
[1438]: Tweak IsMarkerAndHasAuthority to not convert the signers to a…
SpicyLemon Mar 24, 2023
543259e
[1438]: Move IsMarkerAndHasAuthority into authz.go (from signatures.g…
SpicyLemon Mar 24, 2023
f7868b0
[1438]: Remove the CreateRawSignature and ValidateRawSignature funcs …
SpicyLemon Mar 24, 2023
c38cbd3
[1438]: Remove the remnants of past migration tests..
SpicyLemon Mar 24, 2023
31601fc
[1438]: Simplify a few more of the validator functions.
SpicyLemon Mar 25, 2023
09c31f4
[1438]: Fix a test that failed due to the changed .String functions o…
SpicyLemon Mar 25, 2023
6d1281e
[1438]: Fix all the unit tests that used functions that I've been upd…
SpicyLemon Mar 25, 2023
38e1696
[1438]: Add an optional field to the Party message.
SpicyLemon Mar 25, 2023
5b43448
[1438]: Write the replacement singer/party checking function.
SpicyLemon Mar 27, 2023
1cd6cfc
[1438]: Start replacing the old checks with the new.
SpicyLemon Mar 27, 2023
9ce023e
[1438]: Update some proto comments and deprecate tehe MsgWriteRecordR…
SpicyLemon Mar 27, 2023
82930fe
[1438]: lint fixes.
SpicyLemon Mar 27, 2023
72a40f8
[1438]: Finish swapping out use of old methods and start work on unit…
SpicyLemon Mar 28, 2023
226359f
[1438]: Start addressing broken unit tests. Found a bit of a problem,…
SpicyLemon Mar 30, 2023
4ffe52a
[1438]: A couple super-simple unit tests.
SpicyLemon Mar 30, 2023
feb3269
[1438]: Add flag to the scope to enable new signer logic.
SpicyLemon Mar 30, 2023
74bf0c3
[1438]: Tweak the big comment and fix a few typos elsewhere.
SpicyLemon Mar 30, 2023
dee1583
[1438]: Add some TODO comments on a bit of rework to do.
SpicyLemon Mar 30, 2023
2df85de
[1438]: Allow a contract spec that doesn't exist to be deleted from a…
SpicyLemon Mar 30, 2023
7536aab
[1438]: In ValidateWriteScopeSpecification, only check the existence …
SpicyLemon Mar 30, 2023
8ec6748
[1438]: Remove ValidateBasic calls from the Write Spec funcs.
SpicyLemon Mar 30, 2023
a25b0e6
[1438]: Remove a TODO that isn't needed anymore.
SpicyLemon Mar 30, 2023
26125e4
[1438]: Add a couple things to the long comment.
SpicyLemon Mar 30, 2023
04f7c28
[1438]: Fix the ValidateWriteSession function. Should be done there now.
SpicyLemon Mar 30, 2023
74cdbef
[1438]: Update ValidateWriteRecord.
SpicyLemon Mar 30, 2023
c524c64
[1438]: Fix up ValidateDeleteRecord.
SpicyLemon Mar 31, 2023
4b47eb9
[1438]: Update some planning documents.
SpicyLemon Mar 31, 2023
a971f25
[1438]: Tweak some of the long comment.
SpicyLemon Mar 31, 2023
c44178a
[1438]: Tweak the ValidateDeleteRecord to handle rollup when there is…
SpicyLemon Mar 31, 2023
719e953
[1438]: Update ValidateSignersWithoutParties to return party details …
SpicyLemon Mar 31, 2023
c56718a
[1438]: Add the RequirePartyRollup field to the scope.Equals method.
SpicyLemon Mar 31, 2023
93de535
[1438]: update ValidateWriteScope.
SpicyLemon Mar 31, 2023
2ada7ac
[1438]: Update unit tests on ValidateSignersWithoutParties to check t…
SpicyLemon Mar 31, 2023
0a09904
[1438]: Switch to field accessor RequirePartyRollup (from poorly name…
SpicyLemon Mar 31, 2023
3d44745
[1438]: Fix up ValidateDeleteScope.
SpicyLemon Mar 31, 2023
3625cb5
[1438]: ValidateAddScopeDataAccess.
SpicyLemon Mar 31, 2023
c41e189
[1438]: Update ValidateDeleteScopeDataAccess.
SpicyLemon Mar 31, 2023
d47bd44
[1438]: Tweak the long comment. Specify when required scope owners ar…
SpicyLemon Mar 31, 2023
95741c4
[1438]: Speed up make proto-format by ignoring the vendor and protoBi…
SpicyLemon Mar 31, 2023
746ce1d
[1438]: update ValidateUpdateScopeOwners.
SpicyLemon Mar 31, 2023
3ebcba7
[1438]: Comment update and lint fix.
SpicyLemon Mar 31, 2023
f982810
[1438]: Address some G601: Implicit memory aliasing lint errors.
SpicyLemon Mar 31, 2023
eb6b6c8
[1438]: Fix imports (linter).
SpicyLemon Mar 31, 2023
48227db
[1438]: Some prep for writing unit tests.
SpicyLemon Mar 31, 2023
5a9cd38
[1438]: only get parties once from availableParties in BuildPartyDeta…
SpicyLemon Mar 31, 2023
e35d64a
[1438]: don't append when it's not needed.
SpicyLemon Mar 31, 2023
01e3da0
[1438]: Unit tests on the PartyDetails and SignersWrapper.
SpicyLemon Mar 31, 2023
e95460a
[1438]: Fix GetAllPartyTypes since there's no entry for 9, so it wasn…
SpicyLemon Apr 1, 2023
3b5ce7a
[1438]: Unit tests on ValidateRolesPresent and ValidatePartiesArePres…
SpicyLemon Apr 1, 2023
7c209c6
[1438]: Unit tests on MissingRolesString. Also, get rid of the GetAll…
SpicyLemon Apr 3, 2023
206266f
[1438]: Unit tests for AssociateRequiredRole and FindUnsignedRequired.
SpicyLemon Apr 3, 2023
60dbbb0
[1438]: In associateSigners, if the SignersWrapper is nil, just skip …
SpicyLemon Apr 4, 2023
eec8bbd
[1438]: Unit tests on AssociateSigners and fix MissingRolesString uni…
SpicyLemon Apr 4, 2023
7881d20
[1438]: Add a couple TODOs to delete stuff.
SpicyLemon Apr 5, 2023
fe89b42
[1438]: Delete the unused CreateAccountForKey func (left over from p8…
SpicyLemon Apr 5, 2023
d75dfef
[1438]: Add some unit-test only keeper setters for the auth and authz…
SpicyLemon Apr 5, 2023
fabcdff
[1438]: Unit tests on FindAuthzGrantee.
SpicyLemon Apr 5, 2023
9bfff08
[1438]: Unit tests on ValidateScopeValueOwnerUpdate.
SpicyLemon Apr 5, 2023
77f2c99
[1438]: Limit smart contracts to only BaseAccount types.
SpicyLemon Apr 5, 2023
f3895ca
[1438]: Unit tests on ValidateProvenanceRole.
SpicyLemon Apr 5, 2023
4cbb36e
[1438]: quit findAuthzGrantee early if there's no granter or no signers.
SpicyLemon Apr 5, 2023
23460e9
[1438]: Unit tests on AssociateAuthorizations and AssociateAuthorizat…
SpicyLemon Apr 5, 2023
387cfc2
[1438]: Correct the capitalization of private functions in unit test …
SpicyLemon Apr 5, 2023
b48003d
[1438]: Unit tests on ValidateSignersWithParties.
SpicyLemon Apr 5, 2023
6efe28c
[1438]: Replicate the CountAuthorizations test with the new function …
SpicyLemon Apr 5, 2023
872505c
[1438]: Delete the two functions that I had kept around just for the …
SpicyLemon Apr 5, 2023
8961af3
[1438]: Create an AuthzCache and add any of the contexts as unwrapped…
SpicyLemon Apr 6, 2023
e32df61
[1438]: Unit tests on the new AuthzCache stuff.
SpicyLemon Apr 6, 2023
972bd20
[1438]: Use the new cache and update tests. Add one for it too.
SpicyLemon Apr 6, 2023
bed1b6c
[1438]: Fix unit test panics. Still have lots of tests to actually fi…
SpicyLemon Apr 6, 2023
6eba640
[1438]: Tweak the long comment and update it in all the places. Also …
SpicyLemon Apr 6, 2023
82c9707
[1438]: Fix onlyChangeIsValueOwner value. In old way, only require si…
SpicyLemon Apr 6, 2023
f1e6121
[1438]: Fix some of the ValidateWrite unit tests.
SpicyLemon Apr 6, 2023
010bbc1
[1438]: Fix the specification keeper tests that now failed because I …
SpicyLemon Apr 6, 2023
ec9cb94
[1438]: Fix a couple delete cspec unit tests that failed because I ch…
SpicyLemon Apr 6, 2023
005a265
[1438]: Set the yaml key on the require_party_rollup field since we h…
SpicyLemon Apr 6, 2023
da08356
[1438]: Fix some unit tests that failed because of the added require_…
SpicyLemon Apr 6, 2023
212be66
[1438]: Add to scope ValidateBasic that optional parties are only all…
SpicyLemon Apr 6, 2023
77fe49d
[1438]: When validating a WriteSession, only allow optional parties w…
SpicyLemon Apr 6, 2023
08b1995
[1438]: return an error if there's a problem parsing a string ot a pa…
SpicyLemon Apr 6, 2023
bf9069a
[1438]: Return an error on invalid party strings for the sessions.
SpicyLemon Apr 6, 2023
8751098
[1438]: Fix bad logic.
SpicyLemon Apr 6, 2023
96adb28
Merge branch 'main' into dwedul/1438-optional-parties
SpicyLemon Apr 6, 2023
d696f1c
[1438]: Undo the MetadataAddressable and MetadataSpecAddressable addi…
SpicyLemon Apr 7, 2023
ce41102
[1438]: Split the authz.go file into signers.go and signers_utils.go …
SpicyLemon Apr 7, 2023
f58798d
[1438]: Overhaul the cli text parsing things and add unit tests for t…
SpicyLemon Apr 8, 2023
1543f75
[1438]: Update the write-scope command to parse the owners as parties…
SpicyLemon Apr 8, 2023
7ee2b23
[1438]: Add requirePartyRollup to NewScope.
SpicyLemon Apr 8, 2023
790eee3
[1438]: Fix unit tests that changed due to cli output changes.
SpicyLemon Apr 8, 2023
f9f9646
[1438]: Add unit test on the require-party-rollup flag.
SpicyLemon Apr 8, 2023
6ba3c92
[1438]: Remove the big-nasty comment with a plan to put it in the spe…
SpicyLemon Apr 8, 2023
b6582b7
[1438]: proto-gen to remove the comment elsewhere too.
SpicyLemon Apr 8, 2023
812cb97
[1438]: Update the comment on the session message to match the others.
SpicyLemon Apr 10, 2023
42f7e26
[1438]: Add a Signing Requirements section to the concepts spec docs.
SpicyLemon Apr 10, 2023
1778a48
[1438]: Fix a few things in the metadata authz spec docs.
SpicyLemon Apr 10, 2023
dd84938
[1438]: Update the state spec doc with new changes. Also fix the tabl…
SpicyLemon Apr 10, 2023
883cc0f
[1438]: Update the message spec doc with new updates. Also add a few …
SpicyLemon Apr 10, 2023
1cc46df
[1438]: make proto-all to get the session comment update and update s…
SpicyLemon Apr 10, 2023
87292c1
[1438]: Tweak the usage stings of the write-scope command.
SpicyLemon Apr 10, 2023
6d4b664
[1438]: Add some changelog entries.
SpicyLemon Apr 10, 2023
9044df0
[1438]: Only allow optional parties in sessions where the scope allow…
SpicyLemon Apr 10, 2023
4af9e29
[1438]: Add a couple unit tests.
SpicyLemon Apr 10, 2023
20bd06f
[1438]: Fix a couple unit tests that broke when I changed the session…
SpicyLemon Apr 10, 2023
f2aa0ba
[1438]: Add a deprecated entry and state machine breaking entry to th…
SpicyLemon Apr 10, 2023
a1172bf
[1438]: Lint fixes.
SpicyLemon Apr 10, 2023
30d67af
[1438]: Add client-breaking note about the write-scope command change.
SpicyLemon Apr 10, 2023
c1b0027
[1438]: Change the FlagRequirePartyRollup flag help text.
SpicyLemon Apr 10, 2023
cba85f7
[1438]: remove duplicated optional party check when writing sessions.
SpicyLemon Apr 10, 2023
3da703f
[1438]: Fix a couple small things in the spec docs.
SpicyLemon Apr 10, 2023
e879282
[1438]: Fix GetPartyAddresses to ignore the optional flag as I had or…
SpicyLemon Apr 10, 2023
d95d842
[1438]: When testing the CLI helpers that parse enums, make the tests…
SpicyLemon Apr 10, 2023
f7d0983
[1438]: A couple small tweaks to CLI helpers unit tests.
SpicyLemon Apr 10, 2023
eb33022
[1438]: Update TestParty_Equals and TestParty_IsSameAs to test altern…
SpicyLemon Apr 10, 2023
c0dd0ea
[1438]: A couple grammar and comment format fixes.
SpicyLemon Apr 10, 2023
a440941
[1438]: Fix a unit test I broke by chaning an error message.
SpicyLemon Apr 10, 2023
82f4f09
Merge branch 'main' into dwedul/1438-optional-parties
SpicyLemon Apr 10, 2023
b0a0374
Merge branch 'main' into dwedul/1438-optional-parties
SpicyLemon Apr 11, 2023
2097ce2
[1438]: Fix some typos and comments. Create a scope#hasOwnerAddress f…
SpicyLemon Apr 11, 2023
31b8266
[1438]: Fix some problems introduced with the last changes and add so…
SpicyLemon Apr 12, 2023
a5563ba
[1438]: Unit tests on the party rollup signer validation in the Valid…
SpicyLemon Apr 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Publish Provenance Protobuf API as a NPM module [#1449](https://github.com/provenance-io/provenance/issues/1449).
* Add support for account addresses by attribute name lookup [#1447](https://github.com/provenance-io/provenance/issues/1447).
* Add allow forced transfers support to creating markers from smart contracts [#1458](https://github.com/provenance-io/provenance/issues/1458).
* Metadata party rollup and optional parties [#1438](https://github.com/provenance-io/provenance/issues/1438).
* Repeated roles in a spec require multiple different parties [#1437](https://github.com/provenance-io/provenance/issues/1437).
* The `PROVENANCE` role can only be used by smart contract addresses, and vice versa [#1381](https://github.com/provenance-io/provenance/issues/1381).

### Improvements

Expand All @@ -55,6 +58,9 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Add attribute cli command to query account addresses by attribute name [#1451](https://github.com/provenance-io/provenance/issues/1451).
* Add removal of attributes from accounts on name deletion [#1410](https://github.com/provenance-io/provenance/issues/1410).

### Deprecated

* The `MsgWriteRecordRequest.parties` field has been deprecated and is ignored. The parties in question are identified by the session [PR 1453](https://github.com/provenance-io/provenance/pull/1453).

### Bug Fixes

Expand All @@ -68,11 +74,17 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Removed the `WriteP8eContractSpec` and `P8eMemorializeContract` endpoints [#1402](https://github.com/provenance-io/provenance/issues/1402).
* Removed the `github.com/provenance-io/provenance/x/metadata/types/p8e` proto package [#1402](https://github.com/provenance-io/provenance/issues/1402).
Users that generate code from the Provenance protos might need to delete their `p8e/` directory.
* The `write-scope` CLI command now takes in `[owners]` as semicolon-delimited parties (instead of comma-delimited `[owner-addresses]`) [PR 1453](https://github.com/provenance-io/provenance/pull/1453).

### API Breaking

* Removed the `WriteP8eContractSpec` and `P8eMemorializeContract` endpoints [#1402](https://github.com/provenance-io/provenance/issues/1402).

### State Machine Breaking

* The `AddScopeOwner` endpoint now adds a new owner party even if an owner already exists in the scope with that address [PR 1453](https://github.com/provenance-io/provenance/pull/1453).
I.e. it no longer updates the role of an existing owner with the same address.

---

## [v1.14.1](https://github.com/provenance-io/provenance/releases/tag/v1.14.1) - 2023-02-28
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,12 @@ proto-format:
docker start -a $(containerProtoFmt); \
else \
docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \
find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \; ; \
find . \
-not -path './third_party/*' \
-not -path './vendor/*' \
-not -path './protoBindings/*' \
-name '*.proto' \
-exec clang-format -i {} \; ; \
fi

proto-lint:
Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

547 changes: 430 additions & 117 deletions client/docs/swagger-ui/swagger.yaml

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions docs/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3053,6 +3053,7 @@ A Party is an address with/in a given role associated with a contract
| ----- | ---- | ----- | ----------- |
| `address` | [string](#string) | | address of the account (on chain) |
| `role` | [PartyType](#provenance.metadata.v1.PartyType) | | a role for this account within the context of the processes used |
| `optional` | [bool](#bool) | | whether this party's signature is optional |



Expand Down Expand Up @@ -3143,8 +3144,9 @@ Scope defines a root reference for a collection of records owned by one or more
| `scope_id` | [bytes](#bytes) | | Unique ID for this scope. Implements sdk.Address interface for use where addresses are required in Cosmos |
| `specification_id` | [bytes](#bytes) | | the scope specification that contains the specifications for data elements allowed within this scope |
| `owners` | [Party](#provenance.metadata.v1.Party) | repeated | These parties represent top level owners of the records within. These parties must sign any requests that modify the data within the scope. These addresses are in union with parties listed on the sessions. |
| `data_access` | [string](#string) | repeated | Addessses in this list are authorized to recieve off-chain data associated with this scope. |
| `data_access` | [string](#string) | repeated | Addresses in this list are authorized to receive off-chain data associated with this scope. |
| `value_owner_address` | [string](#string) | | An address that controls the value associated with this scope. Standard blockchain accounts and marker accounts are supported for this value. This attribute may only be changed by the entity indicated once it is set. |
| `require_party_rollup` | [bool](#bool) | | Whether all parties in this scope and its sessions must be present in this scope's owners field. This also enables use of optional=true scope owners and session parties. |



Expand All @@ -3154,11 +3156,10 @@ Scope defines a root reference for a collection of records owned by one or more
<a name="provenance.metadata.v1.Session"></a>

### Session
A Session is created for an execution context against a specific specification instance
Session defines an execution context against a specific specification instance.
The context will have a specification and set of parties involved.

The context will have a specification and set of parties involved. The Session may be updated several
times so long as the parties listed are signers on the transaction. NOTE: When there are no Records within a Scope
that reference a Session it is removed.
NOTE: When there are no more Records within a Scope that reference a Session, the Session is removed.


| Field | Type | Label | Description |
Expand Down Expand Up @@ -3198,7 +3199,7 @@ ResultStatus indicates the various states of execution of a record
| Name | Number | Description |
| ---- | ------ | ----------- |
| RESULT_STATUS_UNSPECIFIED | 0 | RESULT_STATUS_UNSPECIFIED indicates an unset condition |
| RESULT_STATUS_PASS | 1 | RESULT_STATUS_PASS indicates the execution was successfult |
| RESULT_STATUS_PASS | 1 | RESULT_STATUS_PASS indicates the execution was successful |
| RESULT_STATUS_SKIP | 2 | RESULT_STATUS_SKIP indicates condition/consideration was skipped due to missing inputs or delayed execution |
| RESULT_STATUS_FAIL | 3 | RESULT_STATUS_FAIL indicates the execution of the condition/consideration failed. |

Expand Down Expand Up @@ -4233,7 +4234,7 @@ MsgAddScopeOwnerRequest is the request to add owner AccAddress to scope
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `scope_id` | [bytes](#bytes) | | scope MetadataAddress for updating data access |
| `owners` | [Party](#provenance.metadata.v1.Party) | repeated | AccAddress owner addresses to be added to scope |
| `owners` | [Party](#provenance.metadata.v1.Party) | repeated | owner parties to add to the scope |
| `signers` | [string](#string) | repeated | signers is the list of address of those signing this request. |


Expand Down Expand Up @@ -4597,7 +4598,7 @@ MsgWriteRecordRequest is the request type for the Msg/WriteRecord RPC method.
| `signers` | [string](#string) | repeated | signers is the list of address of those signing this request. |
| `session_id_components` | [SessionIdComponents](#provenance.metadata.v1.SessionIdComponents) | | SessionIDComponents is an optional (alternate) way of defining what the session_id should be in the provided record. If provided, it must have both a scope and session_uuid. Those components will be used to create the MetadataAddress for the session which will override the session_id in the provided record. If not provided (or all empty), nothing special happens. If there is a value in record.session_id that is different from the one created from these components, an error is returned. |
| `contract_spec_uuid` | [string](#string) | | contract_spec_uuid is an optional contract specification uuid string, e.g. "def6bc0a-c9dd-4874-948f-5206e6060a84" If provided, it will be combined with the record name to generate the MetadataAddress for the record specification which will override the specification_id in the provided record. If not provided (or it is an empty string), nothing special happens. If there is a value in record.specification_id that is different from the one created from this uuid and record.name, an error is returned. |
| `parties` | [Party](#provenance.metadata.v1.Party) | repeated | parties is the list of parties involved with this record. |
| `parties` | [Party](#provenance.metadata.v1.Party) | repeated | parties is the list of parties involved with this record. Deprecated: This field is ignored. The parties are identified in the session and as signers. |



Expand Down Expand Up @@ -4783,8 +4784,8 @@ Msg defines the Metadata Msg service.
| `DeleteScope` | [MsgDeleteScopeRequest](#provenance.metadata.v1.MsgDeleteScopeRequest) | [MsgDeleteScopeResponse](#provenance.metadata.v1.MsgDeleteScopeResponse) | DeleteScope deletes a scope and all associated Records, Sessions. | |
| `AddScopeDataAccess` | [MsgAddScopeDataAccessRequest](#provenance.metadata.v1.MsgAddScopeDataAccessRequest) | [MsgAddScopeDataAccessResponse](#provenance.metadata.v1.MsgAddScopeDataAccessResponse) | AddScopeDataAccess adds data access AccAddress to scope | |
| `DeleteScopeDataAccess` | [MsgDeleteScopeDataAccessRequest](#provenance.metadata.v1.MsgDeleteScopeDataAccessRequest) | [MsgDeleteScopeDataAccessResponse](#provenance.metadata.v1.MsgDeleteScopeDataAccessResponse) | DeleteScopeDataAccess removes data access AccAddress from scope | |
| `AddScopeOwner` | [MsgAddScopeOwnerRequest](#provenance.metadata.v1.MsgAddScopeOwnerRequest) | [MsgAddScopeOwnerResponse](#provenance.metadata.v1.MsgAddScopeOwnerResponse) | AddScopeOwner adds new owner AccAddress to scope | |
| `DeleteScopeOwner` | [MsgDeleteScopeOwnerRequest](#provenance.metadata.v1.MsgDeleteScopeOwnerRequest) | [MsgDeleteScopeOwnerResponse](#provenance.metadata.v1.MsgDeleteScopeOwnerResponse) | DeleteScopeOwner removes data access AccAddress from scope | |
| `AddScopeOwner` | [MsgAddScopeOwnerRequest](#provenance.metadata.v1.MsgAddScopeOwnerRequest) | [MsgAddScopeOwnerResponse](#provenance.metadata.v1.MsgAddScopeOwnerResponse) | AddScopeOwner adds new owner parties to a scope | |
| `DeleteScopeOwner` | [MsgDeleteScopeOwnerRequest](#provenance.metadata.v1.MsgDeleteScopeOwnerRequest) | [MsgDeleteScopeOwnerResponse](#provenance.metadata.v1.MsgDeleteScopeOwnerResponse) | DeleteScopeOwner removes owner parties (by addresses) from a scope | |
| `WriteSession` | [MsgWriteSessionRequest](#provenance.metadata.v1.MsgWriteSessionRequest) | [MsgWriteSessionResponse](#provenance.metadata.v1.MsgWriteSessionResponse) | WriteSession adds or updates a session context. | |
| `WriteRecord` | [MsgWriteRecordRequest](#provenance.metadata.v1.MsgWriteRecordRequest) | [MsgWriteRecordResponse](#provenance.metadata.v1.MsgWriteRecordResponse) | WriteRecord adds or updates a record. | |
| `DeleteRecord` | [MsgDeleteRecordRequest](#provenance.metadata.v1.MsgDeleteRecordRequest) | [MsgDeleteRecordResponse](#provenance.metadata.v1.MsgDeleteRecordResponse) | DeleteRecord deletes a record. | |
Expand Down
20 changes: 11 additions & 9 deletions proto/provenance/metadata/v1/scope.proto
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,20 @@ message Scope {
// These parties represent top level owners of the records within. These parties must sign any requests that modify
// the data within the scope. These addresses are in union with parties listed on the sessions.
repeated Party owners = 3 [(gogoproto.nullable) = false];
// Addessses in this list are authorized to recieve off-chain data associated with this scope.
// Addresses in this list are authorized to receive off-chain data associated with this scope.
repeated string data_access = 4 [(gogoproto.moretags) = "yaml:\"data_access\""];
// An address that controls the value associated with this scope. Standard blockchain accounts and marker accounts
// are supported for this value. This attribute may only be changed by the entity indicated once it is set.
string value_owner_address = 5 [(gogoproto.moretags) = "yaml:\"value_owner_address\""];
// Whether all parties in this scope and its sessions must be present in this scope's owners field.
// This also enables use of optional=true scope owners and session parties.
bool require_party_rollup = 6 [(gogoproto.moretags) = "yaml:\"require_party_rollup\""];
}

/*
A Session is created for an execution context against a specific specification instance

The context will have a specification and set of parties involved. The Session may be updated several
times so long as the parties listed are signers on the transaction. NOTE: When there are no Records within a Scope
that reference a Session it is removed.
*/
// Session defines an execution context against a specific specification instance.
iramiller marked this conversation as resolved.
Show resolved Hide resolved
// The context will have a specification and set of parties involved.
//
// NOTE: When there are no more Records within a Scope that reference a Session, the Session is removed.
message Session {
option (gogoproto.goproto_stringer) = false;

Expand Down Expand Up @@ -207,7 +207,7 @@ message RecordOutput {
enum ResultStatus {
// RESULT_STATUS_UNSPECIFIED indicates an unset condition
RESULT_STATUS_UNSPECIFIED = 0;
// RESULT_STATUS_PASS indicates the execution was successfult
// RESULT_STATUS_PASS indicates the execution was successful
RESULT_STATUS_PASS = 1;
// RESULT_STATUS_SKIP indicates condition/consideration was skipped due to missing inputs or delayed execution
RESULT_STATUS_SKIP = 2;
Expand All @@ -223,6 +223,8 @@ message Party {
string address = 1;
// a role for this account within the context of the processes used
PartyType role = 2;
// whether this party's signature is optional
bool optional = 3;
}

// AuditFields capture information about the last account to make modifications and when they were made
Expand Down
Loading