Make Deny the highest priority #29

Merged
fyrchik merged 1 commit from dstepanov-yadro/policy-engine:feat/allow_to_process_in_order into master 2024-09-04 19:51:23 +00:00

Closes #21

After this PR need to change eACL -> APE converter: TrueCloudLab/frostfs-node#852

Closes #21 After this PR need to change eACL -> APE converter: https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/852
dstepanov-yadro added 1 commit 2023-12-08 09:39:11 +00:00
[#21] router: Make Deny the highest priority
All checks were successful
DCO action / DCO (pull_request) Successful in 1m5s
Tests and linters / Tests (1.21) (pull_request) Successful in 1m15s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m34s
Tests and linters / Tests with -race (pull_request) Successful in 1m31s
Tests and linters / Staticcheck (pull_request) Successful in 1m32s
Tests and linters / Lint (pull_request) Successful in 2m22s
1375e8f7fd
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
dstepanov-yadro changed title from WIP: Make Deny the highest priority to Make Deny the highest priority 2023-12-08 11:11:12 +00:00
dstepanov-yadro requested review from storage-core-committers 2023-12-08 11:11:17 +00:00
dstepanov-yadro requested review from storage-core-developers 2023-12-08 11:11:17 +00:00
dstepanov-yadro force-pushed feat/allow_to_process_in_order from 89ecc7b36e to 780bf5cb0f 2023-12-08 11:19:34 +00:00 Compare
aarifullin approved these changes 2023-12-08 15:08:56 +00:00
aarifullin approved these changes 2023-12-08 15:09:00 +00:00
dstepanov-yadro force-pushed feat/allow_to_process_in_order from 780bf5cb0f to 9604e580f7 2023-12-11 07:09:49 +00:00 Compare
dstepanov-yadro reviewed 2023-12-11 07:13:32 +00:00
@ -15,0 +17,4 @@
const (
// MatchTypeDenyPriority rejects the request if any `Deny` is specified.
MatchTypeDenyPriority MatchType = 0
Author
Member

I don't like iota.

I don't like `iota`.
fyrchik requested review from alexvanin 2023-12-11 07:33:18 +00:00
fyrchik requested review from dkirillov 2023-12-11 07:33:18 +00:00
dkirillov approved these changes 2023-12-11 07:52:40 +00:00
dkirillov left a comment
Member

Can we change test in iam package to

diff --git a/iam/policy_test.go b/iam/policy_test.go
index 046035d..c397f33 100644
--- a/iam/policy_test.go
+++ b/iam/policy_test.go
@@ -478,6 +478,7 @@ func TestProcessDenyFirst(t *testing.T) {
 
        identityNativePolicy, err := ConvertToNativeChain(identityPolicy, mockResolver)
        require.NoError(t, err)
+       identityNativePolicy.MatchType = chain.MatchTypeFirstMatch
 
        resourceNativePolicy, err := ConvertToNativeChain(resourcePolicy, mockResolver)
        require.NoError(t, err)

?

Can we change test in `iam` package to ```diff diff --git a/iam/policy_test.go b/iam/policy_test.go index 046035d..c397f33 100644 --- a/iam/policy_test.go +++ b/iam/policy_test.go @@ -478,6 +478,7 @@ func TestProcessDenyFirst(t *testing.T) { identityNativePolicy, err := ConvertToNativeChain(identityPolicy, mockResolver) require.NoError(t, err) + identityNativePolicy.MatchType = chain.MatchTypeFirstMatch resourceNativePolicy, err := ConvertToNativeChain(resourcePolicy, mockResolver) require.NoError(t, err) ``` ?
dstepanov-yadro force-pushed feat/allow_to_process_in_order from 9604e580f7 to 8c673ee4f4 2023-12-11 08:03:13 +00:00 Compare
Author
Member

Can we change test in iam package to

diff --git a/iam/policy_test.go b/iam/policy_test.go
index 046035d..c397f33 100644
--- a/iam/policy_test.go
+++ b/iam/policy_test.go
@@ -478,6 +478,7 @@ func TestProcessDenyFirst(t *testing.T) {
 
        identityNativePolicy, err := ConvertToNativeChain(identityPolicy, mockResolver)
        require.NoError(t, err)
+       identityNativePolicy.MatchType = chain.MatchTypeFirstMatch
 
        resourceNativePolicy, err := ConvertToNativeChain(resourcePolicy, mockResolver)
        require.NoError(t, err)

?

Done

> Can we change test in `iam` package to > ```diff > diff --git a/iam/policy_test.go b/iam/policy_test.go > index 046035d..c397f33 100644 > --- a/iam/policy_test.go > +++ b/iam/policy_test.go > @@ -478,6 +478,7 @@ func TestProcessDenyFirst(t *testing.T) { > > identityNativePolicy, err := ConvertToNativeChain(identityPolicy, mockResolver) > require.NoError(t, err) > + identityNativePolicy.MatchType = chain.MatchTypeFirstMatch > > resourceNativePolicy, err := ConvertToNativeChain(resourcePolicy, mockResolver) > require.NoError(t, err) > > ``` > ? Done
dkirillov approved these changes 2023-12-11 08:08:21 +00:00
fyrchik merged commit 8c673ee4f4 into master 2023-12-11 12:36:20 +00:00
Sign in to join this conversation.
No description provided.