Skip to content

Commit

Permalink
Add missing fields (#295)
Browse files Browse the repository at this point in the history
* add missing manager field in response

Signed-off-by: Mike Mason <[email protected]>

* validate that action and type names are configured

Signed-off-by: Mike Mason <[email protected]>

---------

Signed-off-by: Mike Mason <[email protected]>
  • Loading branch information
mikemrm authored Oct 24, 2024
1 parent 5ea2cd5 commit 169ee48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/iapl/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,14 @@ func (v *policy) validateActionBindings() error {
bindingMap := make(map[bindingMapKey]struct{}, len(v.p.ActionBindings))

for i, binding := range v.bn {
if binding.ActionName == "" {
return fmt.Errorf("%d (%s:%s): %w", i, binding.TypeName, binding.ActionName, ErrorUnknownAction)
}

if binding.TypeName == "" {
return fmt.Errorf("%d (%s:%s): %w", i, binding.TypeName, binding.ActionName, ErrorUnknownType)
}

key := bindingMapKey{
actionName: binding.ActionName,
typeName: binding.TypeName,
Expand Down
1 change: 1 addition & 0 deletions internal/query/roles_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func (e *engine) CreateRoleV2(ctx context.Context, actor, owner types.Resource,
return types.Role{}, err
}

role.Manager = dbRole.Manager
role.CreatedBy = dbRole.CreatedBy
role.UpdatedBy = dbRole.UpdatedBy
role.ResourceID = dbRole.ResourceID
Expand Down

0 comments on commit 169ee48

Please sign in to comment.