提交 e341435e 编写于 作者: D Daniel P. Berrange

Add ACL annotations to all RPC messages

Introduce annotations to all RPC messages to declare what
access control checks are required. There are two new
annotations defined:

 @acl: <object>:<permission>
 @acl: <object>:<permission>:<flagname>

  Declare the access control requirements for the API. May be repeated
  multiple times, if multiple rules are required.

    <object> is one of 'connect', 'domain', 'network', 'storagepool',
             'interface', 'nodedev', 'secret'.
    <permission> is one of the permissions in access/viraccessperm.h
    <flagname> indicates the rule only applies if the named flag
    is set in the API call

 @aclfilter: <object>:<permission>

  Declare an access control filter that will be applied to a list
  of objects being returned by an API. This allows the returned
  list to be filtered to only show those the user has permissions
  against
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 b904bba7
...@@ -105,41 +105,49 @@ enum virLockSpaceProtocolProcedure { ...@@ -105,41 +105,49 @@ enum virLockSpaceProtocolProcedure {
/** /**
* @generate: none * @generate: none
* @acl: none
*/ */
VIR_LOCK_SPACE_PROTOCOL_PROC_REGISTER = 1, VIR_LOCK_SPACE_PROTOCOL_PROC_REGISTER = 1,
/** /**
* @generate: none * @generate: none
* @acl: none
*/ */
VIR_LOCK_SPACE_PROTOCOL_PROC_RESTRICT = 2, VIR_LOCK_SPACE_PROTOCOL_PROC_RESTRICT = 2,
/** /**
* @generate: none * @generate: none
* @acl: none
*/ */
VIR_LOCK_SPACE_PROTOCOL_PROC_NEW = 3, VIR_LOCK_SPACE_PROTOCOL_PROC_NEW = 3,
/** /**
* @generate: none * @generate: none
* @acl: none
*/ */
VIR_LOCK_SPACE_PROTOCOL_PROC_CREATE_RESOURCE = 4, VIR_LOCK_SPACE_PROTOCOL_PROC_CREATE_RESOURCE = 4,
/** /**
* @generate: none * @generate: none
* @acl: none
*/ */
VIR_LOCK_SPACE_PROTOCOL_PROC_DELETE_RESOURCE = 5, VIR_LOCK_SPACE_PROTOCOL_PROC_DELETE_RESOURCE = 5,
/** /**
* @generate: none * @generate: none
* @acl: none
*/ */
VIR_LOCK_SPACE_PROTOCOL_PROC_ACQUIRE_RESOURCE = 6, VIR_LOCK_SPACE_PROTOCOL_PROC_ACQUIRE_RESOURCE = 6,
/** /**
* @generate: none * @generate: none
* @acl: none
*/ */
VIR_LOCK_SPACE_PROTOCOL_PROC_RELEASE_RESOURCE = 7, VIR_LOCK_SPACE_PROTOCOL_PROC_RELEASE_RESOURCE = 7,
/** /**
* @generate: none * @generate: none
* @acl: none
*/ */
VIR_LOCK_SPACE_PROTOCOL_PROC_CREATE_LOCKSPACE = 8 VIR_LOCK_SPACE_PROTOCOL_PROC_CREATE_LOCKSPACE = 8
}; };
...@@ -65,6 +65,7 @@ enum lxc_procedure { ...@@ -65,6 +65,7 @@ enum lxc_procedure {
/** /**
* @generate: none * @generate: none
* @priority: low * @priority: low
* @acl: domain:open_namespace
*/ */
LXC_PROC_DOMAIN_OPEN_NAMESPACE = 1 LXC_PROC_DOMAIN_OPEN_NAMESPACE = 1
}; };
...@@ -91,18 +91,22 @@ enum qemu_procedure { ...@@ -91,18 +91,22 @@ enum qemu_procedure {
/** /**
* @generate: none * @generate: none
* @priority: low * @priority: low
* @acl: domain:write
*/ */
QEMU_PROC_DOMAIN_MONITOR_COMMAND = 1, QEMU_PROC_DOMAIN_MONITOR_COMMAND = 1,
/** /**
* @generate: both * @generate: both
* @priority: low * @priority: low
* @acl: domain:start
* @acl: domain:write
*/ */
QEMU_PROC_DOMAIN_ATTACH = 2, QEMU_PROC_DOMAIN_ATTACH = 2,
/** /**
* @generate: both * @generate: both
* @priority: low * @priority: low
* @acl: domain:write
*/ */
QEMU_PROC_DOMAIN_AGENT_COMMAND = 3 QEMU_PROC_DOMAIN_AGENT_COMMAND = 3
}; };
此差异已折叠。
...@@ -123,7 +123,7 @@ while (<PROTOCOL>) { ...@@ -123,7 +123,7 @@ while (<PROTOCOL>) {
push(@{$calls{$name}->{ret_members}}, $1); push(@{$calls{$name}->{ret_members}}, $1);
} }
} elsif ($collect_opts) { } elsif ($collect_opts) {
if (m,^\s*\*\s*\@(\w+)\s*:\s*(\w+)\s*$,) { if (m,^\s*\*\s*\@(\w+)\s*:\s*((?:\w|:|\!|\|)+)\s*$,) {
$opts{$1} = $2; $opts{$1} = $2;
} elsif (m,^\s*\*/\s*$,) { } elsif (m,^\s*\*/\s*$,) {
$collect_opts = 0; $collect_opts = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册