ape: Provide request actor as an additional target #1089

Merged
fyrchik merged 1 commit from fyrchik/frostfs-node:update-policy-engine into support/v0.38 2024-09-04 19:51:07 +00:00
5 changed files with 18 additions and 0 deletions

View file

@ -19,6 +19,10 @@ func apeTarget(chainTarget *control.ChainTarget) (engine.Target, error) {
return engine.ContainerTarget(chainTarget.GetName()), nil return engine.ContainerTarget(chainTarget.GetName()), nil
case control.ChainTarget_NAMESPACE: case control.ChainTarget_NAMESPACE:
return engine.NamespaceTarget(chainTarget.GetName()), nil return engine.NamespaceTarget(chainTarget.GetName()), nil
case control.ChainTarget_USER:
return engine.UserTarget(chainTarget.GetName()), nil
case control.ChainTarget_GROUP:
return engine.GroupTarget(chainTarget.GetName()), nil
default: default:
} }
return engine.Target{}, status.Error(codes.InvalidArgument, return engine.Target{}, status.Error(codes.InvalidArgument,
@ -42,6 +46,16 @@ func controlTarget(chainTarget *engine.Target) (control.ChainTarget, error) {
Name: nm, Name: nm,
Type: control.ChainTarget_NAMESPACE, Type: control.ChainTarget_NAMESPACE,
}, nil }, nil
case engine.User:
return control.ChainTarget{
Name: chainTarget.Name,
Type: control.ChainTarget_USER,
}, nil
case engine.Group:
return control.ChainTarget{
Name: chainTarget.Name,
Type: control.ChainTarget_GROUP,
}, nil
default: default:
} }
return control.ChainTarget{}, status.Error(codes.InvalidArgument, return control.ChainTarget{}, status.Error(codes.InvalidArgument,

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -179,6 +179,10 @@ message ChainTarget {
NAMESPACE = 1; NAMESPACE = 1;
CONTAINER = 2; CONTAINER = 2;
USER = 3;
GROUP = 4;
} }
TargetType type = 1; TargetType type = 1;