Skip to content

Commit

Permalink
fix policy key is not GC when a policy expiration time comes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgao001 committed Oct 27, 2023
1 parent 0dcdb44 commit 20b4573
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions e2e/tests/permission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1942,19 +1942,20 @@ func (s *StorageTestSuite) TestExpiredPolicyGCAndRePut() {

// wait for policy expired
time.Sleep(5 * time.Second)
// Query the policy which is enforced on bucket and object

// query the policy, which is already GC, should get err.
queryPolicyForAccountResp, err = s.Client.QueryPolicyForAccount(ctx, &storagetypes.QueryPolicyForAccountRequest{

Check failure on line 1947 in e2e/tests/permission_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint (1.20.x, ubuntu-latest)

SA4006: this value of `queryPolicyForAccountResp` is never used (staticcheck)
Resource: grn1.String(),
PrincipalAddress: user1.GetAddr().String(),
})
s.Require().Error(err)

// the user should be able to re-put policy for the resource.
// the user should be able to re-put policy for the bucket.
msgPutBucketPolicy = storagetypes.NewMsgPutPolicy(owner.GetAddr(), types2.NewBucketGRN(bucketName).String(),
principal, []*types.Statement{bucketStatement}, nil)
s.SendTxBlock(owner, msgPutBucketPolicy)

// Query the policy which is enforced on bucket
// Query the policy which is enforced on bucket.
queryPolicyForAccountResp, err = s.Client.QueryPolicyForAccount(ctx, &storagetypes.QueryPolicyForAccountRequest{
Resource: grn1.String(),
PrincipalAddress: user1.GetAddr().String(),
Expand Down

0 comments on commit 20b4573

Please sign in to comment.