glance/glance/tests/functional/v1
Abhishek Kekane 0656386e99 Restrict users from downloading protected image
Added new rule in policy.json and applied that rule to
'download_image' policy.

For example,
"restricted": "not ('test_key':(test_key)s and role:_member_)"
"download_image": "role:admin or rule:restricted"

So if 'download_image' policy is enforced then in above case only admin or
user who satisfies rule 'restricted' will able to download image. Other users
will not be able to download the image and will get 403 Forbidden response.

In addition, delete property access should be restricted for other users
so that they will not be able to delete the property of the image.

[test_key]
create = admin,member
read = admin,member,_member_
update = admin,member
delete = admin,member

Added new method to create dictionary-like mashup of image core and custom
properties.
Modified v1 and v2 api to add download restriction.
Modified logic of caching to restrict download for v1 and v2 api.

DocImpact:
Need to add new rule in policy.json
"restricted": "not ('test_key':%(test_key)s and role:_member_)"

blueprint: restrict-downloading-images-protected-properties

Change-Id: I05bad0441952150bd15b831ac1b1a0bb9ae79c74
2014-08-28 13:58:32 +00:00
..
__init__.py Adding versioned namespaces in test dir 2012-03-25 13:28:45 -07:00
test_api.py Restrict users from downloading protected image 2014-08-28 13:58:32 +00:00
test_copy_to_file.py Enable hacking H301 and disable H304, H302 2014-02-18 16:05:18 +04:00
test_misc.py Enable hacking H301 and disable H304, H302 2014-02-18 16:05:18 +04:00
test_multiprocessing.py Changed psutil dep. to match global requirements 2014-06-19 10:02:54 -04:00
test_ssl.py Prevent creation of http images with invalid URIs 2014-05-05 10:01:38 +02:00