feat: compose stream authorization #849
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Need this PR to be done first: #848
Description
This pull request includes several changes to enhance stream composition permissions and improve the handling of nested stream permissions. The most important changes include adding new actions for checking composition permissions, updating tests to cover these new permissions, and modifying existing procedures to incorporate these checks.
Enhancements to composition permissions:
internal/migrations/002-authorization.sql
: Addedis_allowed_to_compose
andis_allowed_to_compose_all
actions to check if a wallet can compose a stream and all its substreams, respectively. [1] [2]internal/migrations/006-composed-query.sql
: Added a check for composition permissions in the composed query logic.Updates to tests:
tests/streams/auth/auth_test.go
: Re-enabled and updatedTestAUTH04_ComposePermissions
to test composition permissions, and addedTestAUTH04_NestedComposePermissions
to test nested composition permissions.tests/streams/auth/auth_test.go
: UpdatedtestNestedReadPermissionControl
to usenil
forStartTime
when setting taxonomy for composed streams. [1] [2]Procedural modifications:
tests/streams/utils/procedure/metadata.go
: AddedCheckComposeAllPermissions
function to check if a wallet is allowed to compose from all substreams of a stream.Index optimization:
internal/migrations/000-initial-data.sql
: Modified thetax_latest_version_idx
index to removeDESC
ordering forstart_time
andversion
.Related Problem
resolves: #826
How Has This Been Tested?