Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
ōEYc@sÊdZddlZddlZddlZddlmZddlmZddlZddl	Z	ddl
mZddl
mZddl
mZddl
mZdd	l
mZejeƒZejZejZejZejZejZejZd
efd„ƒYZdefd
„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd„Z de!fd„ƒYZ"de#fd„ƒYZ$de#fd„ƒYZ%de%fd„ƒYZ&dS(s”
Common Policy Engine Implementation

Policies are expressed as a target and an associated rule::

    "<target>": <rule>

The `target` is specific to the service that is conducting policy
enforcement.  Typically, the target refers to an API call.

For the `<rule>` part, see `Policy Rule Expressions`.

Policy Rule Expressions
~~~~~~~~~~~~~~~~~~~~~~~

Policy rules can be expressed in one of two forms: a string written in the new
policy language or a list of lists. The string format is preferred since it's
easier for most people to understand.

In the policy language, each check is specified as a simple "a:b" pair that is
matched to the correct class to perform that check:

 +--------------------------------+------------------------------------------+
 |            TYPE                |                SYNTAX                    |
 +================================+==========================================+
 |User's Role                     |              role:admin                  |
 +--------------------------------+------------------------------------------+
 |Rules already defined on policy |          rule:admin_required             |
 +--------------------------------+------------------------------------------+
 |Against URLs¹                   |         http://my-url.org/check          |
 +--------------------------------+------------------------------------------+
 |User attributes²                |    project_id:%(target.project.id)s      |
 +--------------------------------+------------------------------------------+
 |Strings                         |        - <variable>:'xpto2035abc'        |
 |                                |        - 'myproject':<variable>          |
 +--------------------------------+------------------------------------------+
 |                                |         - project_id:xpto2035abc         |
 |Literals                        |         - domain_id:20                   |
 |                                |         - True:%(user.enabled)s          |
 +--------------------------------+------------------------------------------+

¹URL checking must return ``True`` to be valid

²User attributes (obtained through the token): user_id, domain_id or project_id

Conjunction operators ``and`` and ``or`` are available, allowing for more
expressiveness in crafting policies. For example::

    "role:admin or (project_id:%(project_id)s and role:projectadmin)"

The policy language also has the ``not`` operator, allowing a richer
policy rule::

    "project_id:%(project_id)s and not role:dunce"

Operator precedence is below:

 +------------+-------------+-------------+
 | PRECEDENCE |     TYPE    | EXPRESSION  |
 +============+=============+=============+
 |      4     |  Grouping   |    (...)    |
 +------------+-------------+-------------+
 |      3     | Logical NOT |   not ...   |
 +------------+-------------+-------------+
 |      2     | Logical AND | ... and ... |
 +------------+-------------+-------------+
 |      1     | Logical OR  | ... or ...  |
 +------------+-------------+-------------+

Operator with larger precedence number precedes others with smaller numbers.

In the list-of-lists representation, each check inside the innermost
list is combined as with an "and" conjunction -- for that check to pass,
all the specified checks must pass.  These innermost lists are then
combined as with an "or" conjunction. As an example, take the following
rule, expressed in the list-of-lists representation::

    [["role:admin"], ["project_id:%(project_id)s", "role:projectadmin"]]

Finally, two special policy checks should be mentioned; the policy
check "@" will always accept an access, and the policy check "!" will
always reject an access.  (Note that if a rule is either the empty
list (``[]``) or the empty string (``""``), this is equivalent to the "@"
policy check.)  Of these, the "!" policy check is probably the most useful,
as it allows particular rules to be explicitly disabled.

Generic Checks
~~~~~~~~~~~~~~

A `generic` check is used to perform matching against attributes that are sent
along with the API calls.  These attributes can be used by the policy engine
(on the right side of the expression), by using the following syntax::

    <some_attribute>:%(user.id)s

The value on the right-hand side is either a string or resolves to a
string using regular Python string substitution.  The available attributes
and values are dependent on the program that is using the common policy
engine.

All of these attributes (related to users, API calls, and context) can be
checked against each other or against constants.  It is important to note
that these attributes are specific to the service that is conducting
policy enforcement.

Generic checks can be used to perform policy checks on the following user
attributes obtained through a token:

    - user_id
    - domain_id or project_id (depending on the token scope)
    - list of roles held for the given token scope

.. note::
   Some resources which are exposed by the API do not support policy
   enforcement by user_id, and only support policy enforcement by project_id.
   Some global resources do not support policy enforcement by combination of
   user_id and project_id.

For example, a check on the user_id would be defined as::

    user_id:<some_value>

Together with the previously shown example, a complete generic check
would be::

    user_id:%(user.id)s

It is also possible to perform checks against other attributes that
represent the credentials.  This is done by adding additional values to
the ``creds`` dict that is passed to the
:meth:`~oslo_policy.policy.Enforcer.enforce` method.

Special Checks
~~~~~~~~~~~~~~

Special checks allow for more flexibility than is possible using generic
checks.  The built-in special check types are ``role``, ``rule``, and ``http``
checks.

Role Check
^^^^^^^^^^

A ``role`` check is used to check if a specific role is present in the supplied
credentials.  A role check is expressed as::

    "role:<role_name>"

Rule Check
^^^^^^^^^^

A :class:`rule check <oslo_policy.policy.RuleCheck>` is used to
reference another defined rule by its name.  This allows for common
checks to be defined once as a reusable rule, which is then referenced
within other rules.  It also allows one to define a set of checks as a
more descriptive name to aid in readability of policy.  A rule check is
expressed as::

    "rule:<rule_name>"

The following example shows a role check that is defined as a rule,
which is then used via a rule check::

    "admin_required": "role:admin"
    "<target>": "rule:admin_required"

HTTP Check
^^^^^^^^^^

An ``http`` check is used to make an HTTP request to a remote server to
determine the results of the check.  The target and credentials are passed to
the remote server for evaluation.  The action is authorized if the remote
server returns a response of ``True``. An http check is expressed as::

    "http:<target URI>"

It is expected that the target URI contains a string formatting keyword,
where the keyword is a key from the target dictionary.  An example of an
http check where the `name` key from the target is used to construct the
URL is would be defined as::

    "http://server.test/%(name)s"

Registering New Special Checks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

It is also possible for additional special check types to be registered
using the :func:`~oslo_policy.policy.register` function.

The following classes can be used as parents for custom special check types:

* :class:`~oslo_policy.policy.AndCheck`
* :class:`~oslo_policy.policy.NotCheck`
* :class:`~oslo_policy.policy.OrCheck`
* :class:`~oslo_policy.policy.RuleCheck`

Default Rule
~~~~~~~~~~~~

A default rule can be defined, which will be enforced when a rule does
not exist for the target that is being checked.  By default, the rule
associated with the rule name of ``default`` will be used as the default
rule.  It is possible to use a different rule name as the default rule
by setting the ``policy_default_rule`` configuration setting to the
desired rule name.
iÿÿÿÿN(tcfg(t	jsonutils(t_cache_handler(t_checks(t_(t_parser(toptstPolicyNotAuthorizedcBseZdZd„ZRS(s8Default exception raised for policy enforcement failure.cCs1tdƒi|d6}tt|ƒj|ƒdS(Ns %(rule)s is disallowed by policytrule(RtsuperRt__init__(tselfRttargettcredstmsg((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR
*s(t__name__t
__module__t__doc__R
(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR'stDuplicatePolicyErrorcBseZd„ZRS(cCs1tdƒi|d6}tt|ƒj|ƒdS(Ns%Policy %(name)s is already registeredtname(RR	RR
(RRR((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR
0s(RRR
(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR/stPolicyNotRegisteredcBseZd„ZRS(cCs1tdƒi|d6}tt|ƒj|ƒdS(Ns'Policy %(name)s has not been registeredR(RR	RR
(RRR((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR
6s(RRR
(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR5stInvalidDefinitionErrorcBseZd„ZRS(cCs1tdƒi|d6}tt|ƒj|ƒdS(NsEPolicies %(names)s are not well defined. Check logs for more details.tnames(RR	RR
(RRR((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR
<s	(RRR
(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR;stInvalidRuleDefaultcBseZd„ZRS(cCs1tdƒi|d6}tt|ƒj|ƒdS(Ns'Invalid policy rule default: %(error)s.terror(RR	RR
(RRR((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR
Cs	(RRR
(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyRBscCslytj|ƒ}WnRtk
rgytj|ƒ}Wqhtjk
rc}ttj|ƒƒ‚qhXnX|S(soParse the raw contents of a policy file.

    Parses the contents of a policy file which currently can be in either
    yaml or json format. Both can be parsed as yaml.

    :param data: A string containing the contents of a policy file.
    :returns: A dict of the form {'policy_name1': 'policy1',
                                  'policy_name2': 'policy2,...}
    (Rtloadst
ValueErrortyamlt	safe_loadt	YAMLErrortsixt	text_type(tdatatparsedte((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pytparse_file_contentsIs

tRulescBseeZdZedd„ƒZedd„ƒZedd„ƒZddd„Zd„Z	d„Z
RS(s=A store for rules. Handles the default_rule setting directly.cCs/t|ƒ}d„|jƒDƒ}|||ƒS(sPAllow loading of YAML/JSON rule data.

        .. versionadded:: 1.5.0

        cSs(i|]\}}tj|ƒ|“qS((Rt
parse_rule(t.0tktv((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pys
<dictcomp>qs	(R#titems(tclsR tdefault_ruletparsed_filetrules((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pytloadgscCs tjdtƒ|j||ƒS(sÏAllow loading of YAML/JSON rule data.

        .. warning::
            This method is deprecated as of the 1.5.0 release in favor of
            :meth:`load` and may be removed in the 2.0 release.

        svThe load_json() method is deprecated as of the 1.5.0 release in favor of load() and may be removed in the 2.0 release.(twarningstwarntDeprecationWarningR.(R*R R+((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyt	load_jsonus	cCs#d„|jƒDƒ}|||ƒS(s-Allow loading of rule data from a dictionary.cSs(i|]\}}tj|ƒ|“qS((RR%(R&R'R(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pys
<dictcomp>‰s	(R)(R*t
rules_dictR+R-((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyt	from_dict„scCs)tt|ƒj|piƒ||_dS(sInitialize the Rules store.N(R	R$R
R+(RR-R+((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR
scCs—t|jtƒr!t|ƒ‚n|js9t|ƒ‚nt|jtjƒrU|jS|j|krst|ƒ‚n t|jtjƒr“||jSdS(s%Implements the default rule handling.N(t
isinstanceR+tdicttKeyErrorRt	BaseCheckRtstring_types(Rtkey((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyt__missing__“s	cCsei}xI|jƒD];\}}t|tjƒr>d||<qt|ƒ||<qWtj|ddƒS(s+Dumps a string representation of the rules.ttindenti(R)R5Rt	TrueChecktstrRtdumps(Rt	out_rulesR:tvalue((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyt__str__¨s
N(RRRtclassmethodtNoneR.R2R4R
R;RC(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR$ds
	tEnforcercBsÚeZdZdddeed„Zeed„Zd„Zed„Z	ed„Z
d„Zdd„Ze
d„ƒZe
d	„ƒZed
„Zed„Zd„Zedd
„Zd„Zd„Zedd„ZRS(s~Responsible for loading and enforcing rules.

    :param conf: A configuration object.
    :param policy_file: Custom policy file to use, if none is
                        specified, ``conf.oslo_policy.policy_file`` will be
                        used.
    :param rules: Default dictionary / Rules to use. It will be
                  considered just in the first instantiation. If
                  :meth:`load_rules` with ``force_reload=True``,
                  :meth:`clear` or :meth:`set_rules` with ``overwrite=True``
                  is called this will be overwritten.
    :param default_rule: Default rule to use, conf.default_rule will
                         be used if none is specified.
    :param use_conf: Whether to load rules from cache or config file.
    :param overwrite: Whether to overwrite existing rules when reload rules
                      from config file.
    cCs°||_tj|ƒ|p(|jjj|_t||jƒ|_i|_i|_	d|_|pp|jjj|_||_
||_g|_i|_i|_t|_dS(N(tconfRt	_registertoslo_policytpolicy_default_ruleR+R$R-tregistered_rulest
file_rulesREtpolicy_pathtpolicy_filetuse_conft	overwritet
_loaded_filest_policy_dir_mtimest_file_cachetFalset_informed_no_policy_file(RRGRNR-R+RORP((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR
Ës	
								cCsit|tƒs.ttdƒt|ƒƒ‚n||_|rUt||jƒ|_n|jj	|ƒdS(s=Create a new :class:`Rules` based on the provided dict of rules.

        :param dict rules: New rules to use.
        :param overwrite: Whether to overwrite current rules or update them
                          with the new rules.
        :param use_conf: Whether to reload rules from cache or config file.
        s:Rules must be an instance of dict or Rules, got %s insteadN(
R5R6t	TypeErrorRttypeROR$R+R-tupdate(RR-RPRO((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyt	set_rulesàs		cCs]|jiƒd|_d|_g|_i|_|jjƒi|_i|_	t
|_dS(sClears :class:`Enforcer` contents.

        This will clear this instances rules, policy's cache, file cache
        and policy's path.
        N(RYRER+RMRQRRRStclearRKRLRTRU(R((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyRZòs
				
		cCsx|r||_n|jrt|jsy|j|jƒ|_Wqtjk
r{|js|tjd|jƒt	|_q|qXn|jr§|j
|j|d|jƒnx{|jj
jD]j}y|j|ƒ}Wntjk
réq·nX|s|j|j|ƒr·|j||j
|tƒq·q·Wx?|jjƒD].}|j|jkr5|j|j|j<q5q5W|jƒndS(s¬Loads policy_path's rules.

        Policy file is cached and will be reloaded if modified.

        :param force_reload: Whether to reload rules from config file.
        s&The policy file %s could not be found.RPN(RORMt_get_policy_pathRNRtConfigFilesNotFoundErrorRUtLOGtdebugtTruet_load_policy_fileRPRGRItpolicy_dirst_is_directory_updatedRRt_walk_through_policy_directoryRTRKtvaluesRR-tchecktcheck_rules(Rtforce_reloadtpathtdefault((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyt
load_ruless8				
	
	cCsàg}g}t}xg|jjƒD]V\}}|j|ƒrS|j|ƒt}n|j|ƒr"|j|ƒt}q"q"W|rœtjdi|d6ƒn|r¼tjdi|d6ƒn|rÛ|rÛt	||ƒ‚n|S(s7Look for rule definitions that are obviously incorrect.s8Policies %(names)s reference a rule that is not defined.Rs4Policies %(names)s are part of a cyclical reference.(
RTR-R)t_undefined_checktappendR_t_cycle_checkR]twarningR(Rtraise_on_violationtundefined_checkst
cyclic_checkst	violationRRe((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyRf,s&
	

		cCskt|tƒr(|j|jkr(tSnt|ddƒ}|rgx$|D]}|j|ƒrGtSqGWntS(s2Check if a RuleCheck references an undefined rule.R-N(	R5t	RuleChecktmatchR-R_tgetattrRERkRT(RReR-R((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyRkEs
cCsÎ|dkrtƒ}nt|tƒr‚|j|kr:tS|j|jƒ|j|jkr‚|j|j|j|ƒrtSq‚nt	|ddƒ}|rÊx-|D]"}|j||j
ƒƒr¡tSq¡WntS(s|Check if RuleChecks cycle.

        Looking for something like:
        "foo": "rule:bar"
        "bar": "rule:foo"
        R-N(REtsetR5RsRtR_taddR-RmRutcopyRT(RRetseenR-R((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyRmUs

cCs³d}tjj|ƒrw|ggtj|ƒD]}tjj||ƒ^q.}tjjt|dtjjƒƒ}n|j|iƒ}||jddƒkr¯||d<t	St
S(NiR:tmtime(tosRhtexiststlistdirtjointgetmtimetmaxt
setdefaulttgetR_RT(tcacheRhRztfiletfilest
cache_info((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyRbus	/'
cGs›tjj|ƒs%td|ƒ‚nttj|ƒƒd}|jƒxLg|D]}|jdƒsR|^qRD]"}|tjj||ƒ|ŒqqWdS(Ns%s is not a directoryit.(	R{RhtisdirRtnexttwalktsortt
startswithR~(Rhtfunctargstpolicy_filestpRN((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyRc‡s
/cCsU|ri|_nt|ƒ}x0|jƒD]"\}}t||ƒ|j|<q+WdS(s~Store a copy of rules loaded from a file.

        It is useful to be able to distinguish between rules loaded from a file
        and those registered by a consuming service. In order to do so we keep
        a record of rules loaded from a file.

        :param data: The raw contents of a policy file.
        :param overwrite: If True clear out previously loaded rules.
        N(RLR#R)tRuleDefault(RR RPR,Rt	check_str((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyt_record_file_rules‘s

cCstj|j|d|ƒ\}}|s1|jr™tj||jƒ}|j|d|dtƒ|j	||ƒ|j
j|ƒtj
di|d6ƒndS(NRgRPROsReloaded policy file: %(path)sRh(Rtread_cached_fileRSR-R$R.R+RYR_R“RQRlR]R^(RRhRgRPtreloadedR R-((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR`¡scCs2|jj|ƒ}|r|Stj|fƒ‚dS(sëLocate the policy YAML/JSON data file/path.

        :param path: It's value can be a full path or related path. When
                     full path specified, this function just returns the full
                     path. When related path specified, this function will
                     search configuration directories to find one that exists.

        :returns: The policy path

        :raises: ConfigFilesNotFoundError if the file/path couldn't
                 be located.
        N(RGt	find_fileRR\(RRhRM((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR[«s
c	OsÈ|jƒt|tjƒr1||||ƒ}nY|jsCt}nGy|j||||ƒ}Wn'tk
r‰tjd|ƒt}nX|rÄ|rÄ|r¯|||Ž‚nt	|||ƒ‚n|S(sªChecks authorization of a rule against the target and credentials.

        :param rule: The rule to evaluate.
        :type rule: string or :class:`BaseCheck`
        :param dict target: As much information about the object being operated
                            on as possible.
        :param dict creds: As much information about the user performing the
                           action as possible.
        :param do_raise: Whether to raise an exception or not if check
                        fails.
        :param exc: Class of the exception to raise if the check fails.
                    Any remaining arguments passed to :meth:`enforce` (both
                    positional and keyword arguments) will be passed to
                    the exception class. If not specified,
                    :class:`PolicyNotAuthorized` will be used.

        :return: ``False`` if the policy does not allow the action and `exc` is
                 not provided; otherwise, returns a value that evaluates to
                 ``True``.  Note: for rules using the "case" expression, this
                 ``True`` value will be the specified string from the
                 expression.
        sRule [%s] does not exist(
RjR5RR8R-RTR7R]R^R(	RRRR
tdo_raisetexcRŽtkwargstresult((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pytenforce¿s
		


cCs8|j|jkr$t|jƒ‚n||j|j<dS(sæRegisters a RuleDefault.

        Adds a RuleDefault to the list of registered rules. Rules must be
        registered before using the Enforcer.authorize method.

        :param default: A RuleDefault object to register.
        N(RRKR(RRi((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pytregister_defaultòscCs"x|D]}|j|ƒqWdS(sûRegisters a list of RuleDefaults.

        Adds each RuleDefault to the list of registered rules. Rules must be
        registered before using the Enforcer.authorize method.

        :param default: A list of RuleDefault objects to register.
        N(Rœ(RtdefaultsRi((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pytregister_defaultsÿs
cOs=||jkrt|ƒ‚n|j|||||||ŽS(s¾A wrapper around 'enforce' that checks for policy registration.

        To ensure that a policy being checked has been registered this method
        should be used rather than enforce. By doing so a project can be sure
        that all of it's used policies are registered and therefore available
        for sample file generation.

        The parameters match the enforce method and a description of them can
        be found there.
        (RKRR›(RRRR
R—R˜RŽR™((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyt	authorize
sN(RRRRER_R
RTRYRZRjRfRkRmtstaticmethodRbRcR“R`R[R›RœRžRŸ(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyRF¸s(	*	 

	2	
	R‘cBs,eZdZdd„Zd„Zd„ZRS(s¯A class for holding policy definitions.

    It is required to supply a name and value at creation time. It is
    encouraged to also supply a description to assist operators.

    :param name: The name of the policy. This is used when referencing it
                 from another rule or during policy enforcement.
    :param check_str: The policy. This is a string  defining a policy that
                      conforms to the policy language outlined at the top of
                      the file.
    :param description: A plain text description of the policy. This will be
                        used to comment sample policy files for use by
                        deployers.
    cCs1||_||_tj|ƒ|_||_dS(N(RR’RR%Retdescription(RRR’R¡((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR
+s		cCsdi|jd6|jd6S(Ns"%(name)s": "%(check_str)s"RR’(RR’(R((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyRC1scCs\|j|jkrXt|jƒt|jƒkrXt||jƒsTt||jƒrXtStS(s¾Equality operator.

        All check objects have a stable string representation. It is used for
        comparison rather than check_str because multiple check_str's may parse
        to the same check object. For instance '' and '@' are equivalent and
        the parsed rule string representation for both is '@'.

        The description does not play a role in the meaning of the check so it
        is not considered for equality.
        (RR?ReR5t	__class__R_RT(Rtother((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyt__eq__5s
N(RRRRER
RCR¤(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR‘s	tDocumentedRuleDefaultcBsYeZdZd„Zed„ƒZejd„ƒZed„ƒZejd„ƒZRS(sŸA class for holding policy-in-code policy objects definitions

    This class provides the same functionality as the RuleDefault class, but it
    also requires additional data about the policy rule being registered. This
    is necessary so that proper documentation can be rendered based on the
    attributes of this class. Eventually, all usage of RuleDefault should be
    converted to use DocumentedRuleDefault.

    :param operations: List of dicts containing each api url and
        corresponding http request method.

        Example::

            operations=[{'path': '/foo', 'method': 'GET'},
                        {'path': '/some', 'method': 'POST'}]
    cCs)tt|ƒj|||ƒ||_dS(N(R	R¥R
t
operations(RRR’R¡R¦((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR
[s
cCs|jS(N(t_description(R((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR¡`scCs"|stdƒ‚n||_dS(NsDescription is required(RR§(RRB((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR¡dscCs|jS(N(t_operations(R((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR¦kscCs®t|tƒstdƒ‚n|s3tdƒ‚nxk|D]c}d|kr[tdƒ‚nd|krvtdƒ‚nt|jƒƒdkr:tdƒ‚q:q:W||_dS(	NsOperations must be a lists!Operations list must not be emptyRhsOperation must contain a pathtmethodsOperation must contain a methodisOperation contains > 2 keys(R5tlistRtlentkeysR¨(Rtopstop((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR¦os
(RRRR
tpropertyR¡tsetterR¦(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyR¥Js	('RtloggingR{R/toslo_configRtoslo_serializationRRRRIRRtoslo_policy._i18nRRRt	getLoggerRR]tregistertChecktAndChecktNotChecktOrCheckRst	ExceptionRRRRRR#R6R$tobjectRFR‘R¥(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/policy.pyt<module>Þs<							
		Tÿe.