neutron/neutron/tests/unit/db
Rodolfo Alonso Hernandez 093b861bb4 Filter by owner SGs when retrieving the SG rules
Retrieving the SG rules now is used the admin context. This allows to
get all possible rules, independently of the user calling. The filters
passed and the RBAC policies filter those results, returning only:
- The SG rules belonging to the user.
- The SG rules belonging to a SG owned by the user.

However, if the SG list is too long, the query can take a lot of time.
Instead of this, the filtering is done in the DB query. If no filters
are passed to "get_security_group_rules" and the context is not the
admin context, only the rules specified in the first paragraph will
be retrieved.

Because overwriting the method "get_objects" is too complex, an
intermediate query is done to retrieve the SG rule IDs. Those IDs
will be used as a filter in the "get_objects" call.

Conflicts:
      neutron/objects/securitygroup.py
      neutron/tests/unit/db/test_securitygroups_db.py
      neutron/tests/unit/objects/test_securitygroup.py

Closes-Bug: #1863201

Change-Id: I25d3da929f8d0b6ee15d7b90ec59b9d58a4ae6a5
(cherry picked from commit d874c46bff)
(cherry picked from commit d3905264b7)
(cherry picked from commit 61dc621c1b)
2020-04-17 11:05:53 +00:00
..
metering use metering api def from neutron-lib 2017-11-03 14:03:20 -06:00
quota Update neutron files for new over-indentation hacking rule (E117) 2019-02-02 10:48:26 +00:00
__init__.py Empty files should not contain copyright or license 2014-10-20 00:50:32 +00:00
test_agents_db.py Use Agent OVO in agents_db and test_agents_db 2017-11-03 16:46:09 +07:00
test_agentschedulers_db.py Improve port dhcp Provisioning 2019-04-10 16:17:29 +00:00
test_allowedaddresspairs_db.py use addr pairs api def from lib 2017-11-13 11:56:32 -07:00
test_api.py Add DBError to _is_nested_instance 2017-02-05 17:42:08 -08:00
test_common_db_mixin.py Spin off context module 2017-03-06 16:25:29 +00:00
test_db_base_plugin_common.py Replace to_dict() calls with a function decorator 2015-08-03 11:42:25 +03:00
test_db_base_plugin_v2.py Turn CIDR in query filter into proper subnet 2019-06-26 10:25:10 +02:00
test_dvr_mac_db.py use dvr api def from neutron-lib 2017-11-13 10:27:16 -07:00
test_extraroute_db.py use service type constants from neutron_lib plugins 2017-06-27 15:16:05 -06:00
test_ipam_backend_mixin.py Switch to use _get_subnet_object() in ipam_backend_mixin module 2017-12-18 14:59:17 +01:00
test_ipam_pluggable_backend.py fixed_configured=True when Add/Remove port IPs 2019-10-09 09:37:11 +00:00
test_l3_db.py Handle ports assigned to routers without routerports 2020-04-07 20:22:50 +00:00
test_l3_dvr_db.py [DVR] Don't populate unbound ports in router's ARP cache 2020-04-06 13:12:00 +02:00
test_l3_hamode_db.py Update neutron files for new over-indentation hacking rule (E117) 2019-02-02 10:48:26 +00:00
test_migration.py Refactoring db config options 2017-10-04 15:42:50 -04:00
test_portsecurity_db.py use service type constants from neutron_lib plugins 2017-06-27 15:16:05 -06:00
test_portsecurity_db_common.py use neutron-lib port security api-def 2017-05-01 11:45:42 -06:00
test_provisioning_blocks.py test_provisioning_blocks: Network model to OVO 2017-12-29 14:58:35 +07:00
test_rbac_db_mixin.py tests: port test_port_presence_prevents_network_rbac_policy_deletion 2018-06-01 09:47:39 +00:00
test_securitygroups_db.py Filter by owner SGs when retrieving the SG rules 2020-04-17 11:05:53 +00:00
test_segments_db.py Change passing session to context in segments db functions 2016-12-23 16:47:41 +04:00
test_sqlalchemytypes.py Use oslo_db.sqlalchemy.test_fixtures 2018-07-24 10:19:16 +02:00
test_standard_attr.py Tag mechanism supports resources with standard attribute 2017-07-25 08:14:04 +09:00