diff options
author | Gordon Chung <chungg@ca.ibm.com> | 2014-01-21 11:47:52 -0500 |
---|---|---|
committer | Gordon Chung <chungg@ca.ibm.com> | 2014-02-03 10:51:32 -0500 |
commit | a6423817b6ca7d1746ae792e7b02889bd1f4814c (patch) | |
tree | 0701508285d0b04369d27cbb3cae48381bc5a512 /pycadf/cadftaxonomy.py | |
parent | eb9a747e3fae746393085215e7098a3b2104e3de (diff) | |
download | pycadf-a6423817b6ca7d1746ae792e7b02889bd1f4814c.tar.gz |
adjust typeURI to capture target better
update to fix nova audits.
- change typeURI to record greater depth of api request.
- add custom_actions to allow special case actions based on api
path
Change-Id: I2b33cf8cff796bdb135dd832c23f0e2ffdf90780
blueprint: audit-all-apis
Diffstat (limited to 'pycadf/cadftaxonomy.py')
-rw-r--r-- | pycadf/cadftaxonomy.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pycadf/cadftaxonomy.py b/pycadf/cadftaxonomy.py index 52770aa..d21d54a 100644 --- a/pycadf/cadftaxonomy.py +++ b/pycadf/cadftaxonomy.py @@ -64,7 +64,10 @@ ACTION_TAXONOMY = frozenset([ # TODO(mrutkows): validate absolute URIs as well def is_valid_action(value): - return value in ACTION_TAXONOMY + for type in ACTION_TAXONOMY: + if value.startswith(type): + return True + return False TYPE_URI_OUTCOME = cadftype.CADF_VERSION_1_0_0 + 'outcome' @@ -176,4 +179,7 @@ RESOURCE_TAXONOMY = frozenset([ # TODO(mrutkows): validate absolute URIs as well def is_valid_resource(value): - return value in RESOURCE_TAXONOMY + for type in RESOURCE_TAXONOMY: + if value.startswith(type): + return True + return False |