Merge "Implement secure RBAC for Floating IP API"
This commit is contained in:
commit
252dbc1338
|
@ -18,35 +18,49 @@ from neutron.conf.policies import base
|
||||||
COLLECTION_PATH = '/floatingips'
|
COLLECTION_PATH = '/floatingips'
|
||||||
RESOURCE_PATH = '/floatingips/{id}'
|
RESOURCE_PATH = '/floatingips/{id}'
|
||||||
|
|
||||||
|
DEPRECATION_REASON = (
|
||||||
|
"The Floating IP API now supports system scope and default roles.")
|
||||||
|
|
||||||
rules = [
|
rules = [
|
||||||
policy.DocumentedRuleDefault(
|
policy.DocumentedRuleDefault(
|
||||||
'create_floatingip',
|
name='create_floatingip',
|
||||||
base.RULE_ANY,
|
check_str=base.PROJECT_MEMBER,
|
||||||
'Create a floating IP',
|
description='Create a floating IP',
|
||||||
[
|
operations=[
|
||||||
{
|
{
|
||||||
'method': 'POST',
|
'method': 'POST',
|
||||||
'path': COLLECTION_PATH,
|
'path': COLLECTION_PATH,
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
|
scope_types=['project'],
|
||||||
|
deprecated_rule=policy.DeprecatedRule(
|
||||||
|
name='create_floatingip',
|
||||||
|
check_str=base.RULE_ANY),
|
||||||
|
deprecated_reason=DEPRECATION_REASON,
|
||||||
|
deprecated_since='Wallaby'
|
||||||
),
|
),
|
||||||
policy.DocumentedRuleDefault(
|
policy.DocumentedRuleDefault(
|
||||||
'create_floatingip:floating_ip_address',
|
name='create_floatingip:floating_ip_address',
|
||||||
base.RULE_ADMIN_ONLY,
|
check_str=base.SYSTEM_ADMIN,
|
||||||
'Create a floating IP with a specific IP address',
|
description='Create a floating IP with a specific IP address',
|
||||||
[
|
operations=[
|
||||||
{
|
{
|
||||||
'method': 'POST',
|
'method': 'POST',
|
||||||
'path': COLLECTION_PATH,
|
'path': COLLECTION_PATH,
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
|
scope_types=['system', 'project'],
|
||||||
|
deprecated_rule=policy.DeprecatedRule(
|
||||||
|
name='create_floatingip:floating_ip_address',
|
||||||
|
check_str=base.RULE_ADMIN_ONLY),
|
||||||
|
deprecated_reason=DEPRECATION_REASON,
|
||||||
|
deprecated_since='Wallaby'
|
||||||
),
|
),
|
||||||
policy.DocumentedRuleDefault(
|
policy.DocumentedRuleDefault(
|
||||||
'get_floatingip',
|
name='get_floatingip',
|
||||||
base.RULE_ADMIN_OR_OWNER,
|
check_str=base.SYSTEM_OR_PROJECT_READER,
|
||||||
'Get a floating IP',
|
description='Get a floating IP',
|
||||||
[
|
operations=[
|
||||||
{
|
{
|
||||||
'method': 'GET',
|
'method': 'GET',
|
||||||
'path': COLLECTION_PATH,
|
'path': COLLECTION_PATH,
|
||||||
|
@ -55,29 +69,47 @@ rules = [
|
||||||
'method': 'GET',
|
'method': 'GET',
|
||||||
'path': RESOURCE_PATH,
|
'path': RESOURCE_PATH,
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
|
scope_types=['system', 'project'],
|
||||||
|
deprecated_rule=policy.DeprecatedRule(
|
||||||
|
name='get_floatingip',
|
||||||
|
check_str=base.RULE_ADMIN_OR_OWNER),
|
||||||
|
deprecated_reason=DEPRECATION_REASON,
|
||||||
|
deprecated_since='Wallaby'
|
||||||
),
|
),
|
||||||
policy.DocumentedRuleDefault(
|
policy.DocumentedRuleDefault(
|
||||||
'update_floatingip',
|
name='update_floatingip',
|
||||||
base.RULE_ADMIN_OR_OWNER,
|
check_str=base.SYSTEM_ADMIN_OR_PROJECT_MEMBER,
|
||||||
'Update a floating IP',
|
description='Update a floating IP',
|
||||||
[
|
operations=[
|
||||||
{
|
{
|
||||||
'method': 'PUT',
|
'method': 'PUT',
|
||||||
'path': RESOURCE_PATH,
|
'path': RESOURCE_PATH,
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
|
scope_types=['system', 'project'],
|
||||||
|
deprecated_rule=policy.DeprecatedRule(
|
||||||
|
name='create_floatingip',
|
||||||
|
check_str=base.RULE_ADMIN_OR_OWNER),
|
||||||
|
deprecated_reason=DEPRECATION_REASON,
|
||||||
|
deprecated_since='Wallaby'
|
||||||
),
|
),
|
||||||
policy.DocumentedRuleDefault(
|
policy.DocumentedRuleDefault(
|
||||||
'delete_floatingip',
|
name='delete_floatingip',
|
||||||
base.RULE_ADMIN_OR_OWNER,
|
check_str=base.SYSTEM_ADMIN_OR_PROJECT_MEMBER,
|
||||||
'Delete a floating IP',
|
description='Delete a floating IP',
|
||||||
[
|
operations=[
|
||||||
{
|
{
|
||||||
'method': 'DELETE',
|
'method': 'DELETE',
|
||||||
'path': RESOURCE_PATH,
|
'path': RESOURCE_PATH,
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
|
scope_types=['system', 'project'],
|
||||||
|
deprecated_rule=policy.DeprecatedRule(
|
||||||
|
name='create_floatingip',
|
||||||
|
check_str=base.RULE_ADMIN_OR_OWNER),
|
||||||
|
deprecated_reason=DEPRECATION_REASON,
|
||||||
|
deprecated_since='Wallaby'
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue