@@ -387,6 +387,7 @@ func (a *Authorizer) evaluateMultiInTx(
|
||||
// On failure, ErrAssumptionRequired is recorded only against items that
|
||||
// did not opt out.
|
||||
var assumptionErr error
|
||||
|
||||
if requiresAssumptionCheck {
|
||||
err := a.checkAssumption(
|
||||
ctx,
|
||||
@@ -431,6 +432,7 @@ func (a *Authorizer) evaluateMultiInTx(
|
||||
|
||||
decisions := make([]error, len(params.Items))
|
||||
itemAttrs := make([]policy.Attributes, len(params.Items))
|
||||
|
||||
for i, item := range params.Items {
|
||||
resAttrs := resourceAttrsByResourceID[item.Resource]
|
||||
if len(item.ResourceAttributes) > 0 {
|
||||
@@ -438,6 +440,7 @@ func (a *Authorizer) evaluateMultiInTx(
|
||||
maps.Copy(merged, item.ResourceAttributes)
|
||||
resAttrs = merged
|
||||
}
|
||||
|
||||
itemAttrs[i] = resAttrs
|
||||
|
||||
if assumptionErr != nil && !item.SkipAssumptionCheck {
|
||||
|
||||
@@ -986,6 +986,7 @@ func insertBatchTestChildSession(
|
||||
expiredAt := now.Add(30 * time.Minute)
|
||||
|
||||
var expireReason *coredata.ExpireReason
|
||||
|
||||
if expired {
|
||||
reason := coredata.ExpireReasonRevoked
|
||||
expireReason = &reason
|
||||
@@ -1039,6 +1040,7 @@ func countAuditLogsForAction(t *testing.T, ctx context.Context, client *pg.Clien
|
||||
t.Helper()
|
||||
|
||||
var count int
|
||||
|
||||
require.NoError(t, client.WithTx(ctx, func(ctx context.Context, tx pg.Tx) error {
|
||||
if err := tx.QueryRow(
|
||||
ctx,
|
||||
|
||||
@@ -83,7 +83,6 @@ func TestAuthorizer_ValidateInputs(t *testing.T) {
|
||||
_, ok := errors.AsType[*ErrEmptyResourceBatch](err)
|
||||
require.True(t, ok)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
func TestAuthorizer_InternalErrorPaths(t *testing.T) {
|
||||
|
||||
@@ -106,6 +106,7 @@ func TestAuthorizeRelatedErrors_Error(t *testing.T) {
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
if tt.err.Error() != tt.want {
|
||||
t.Errorf("Error() = %q, want %q", tt.err.Error(), tt.want)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user