Cloned from launchpad blueprint https://blueprints.launchpad.net/oslo/+spec/policy-compare-kind-with-match.
As of now if you want to do the comparison of 'kind' and 'match',
you need to pass this data in the 'credential' and then match it.
'credential' is a dictionary which consist of information about users, tenants
and roles. So if the comparison need to be done on the basis of image or
instance properties, you need to pass these properties explicitly through the
'credential' dictionary, otherwise 'KeyError' will be raised as this
information is not present in the 'credential' dictionary and the particular
policy rule will not work as per expectation.
The feature proposed in this blueprint is, in GenericCheck class, we will add a
simple check to compare 'kind' with 'match'. If this comparison is matched
then it will return True or else it will compare using 'credential' dictionary.
if self.kind == match:
Specification URL (additional information):