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¢ddlZddlZddlZddlZddlmZddlZddlZiZej	ej
ƒdefd„ƒYƒZdefd„ƒYZ
defd„ƒYZd	efd
„ƒYZdefd„ƒYZd
efd„ƒYZdefd„ƒYZdd„Zedƒdefd„ƒYƒZedƒdefd„ƒYƒZedƒdefd„ƒYƒZedƒdefd„ƒYƒZdS(iÿÿÿÿN(t	jsonutilst	BaseCheckcBs2eZdZejd„ƒZejd„ƒZRS(s&Abstract base class for Check classes.cCsdS(s<String representation of the Check tree rooted at this node.N((tself((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyt__str__#scCsdS(s¸Triggers if instance of the class is called.

        Performs the check. Returns False to reject the access or a
        true value (not necessary True) to accept the access.
        N((Rttargettcredtenforcer((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyt__call__)s(t__name__t
__module__t__doc__tabctabstractmethodRR(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRst
FalseCheckcBs eZdZd„Zd„ZRS(s8A policy check that always returns ``False`` (disallow).cCsdS(s-Return a string representation of this check.t!((R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR7scCstS(sCheck the policy.(tFalse(RRRR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR<s(RR	R
RR(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR
4s	t	TrueCheckcBs eZdZd„Zd„ZRS(s4A policy check that always returns ``True`` (allow).cCsdS(s-Return a string representation of this check.t@((R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyREscCstS(sCheck the policy.(tTrue(RRRR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRJs(RR	R
RR(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRBs	tCheckcBseZd„Zd„ZRS(cCs||_||_dS(N(tkindtmatch(RRR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyt__init__Qs	cCsd|j|jfS(s-Return a string representation of this check.s%s:%s(RR(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRUs(RR	RR(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRPs	tNotCheckcBs#eZd„Zd„Zd„ZRS(cCs
||_dS(N(trule(RR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR\scCsd|jS(s-Return a string representation of this check.snot %s(R(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR_scCs|j|||ƒS(sUCheck the policy.

        Returns the logical inverse of the wrapped check.
        (R(RRRR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRds(RR	RRR(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR[s		tAndCheckcBs,eZd„Zd„Zd„Zd„ZRS(cCs
||_dS(N(trules(RR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRnscCsddjd„|jDƒƒS(s-Return a string representation of this check.s(%s)s and css|]}t|ƒVqdS(N(tstr(t.0tr((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pys	<genexpr>ts(tjoinR(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRqscCs.x'|jD]}||||ƒs
tSq
WtS(s[Check the policy.

        Requires that all rules accept in order to return True.
        (RRR(RRRRR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRvscCs|jj|ƒ|S(s¶Adds rule to be tested.

        Allows addition of another rule to the list of rules that will
        be tested.

        :returns: self
        :rtype: :class:`.AndCheck`
        (Rtappend(RR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyt	add_check‚s
(RR	RRRR (((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRms			tOrCheckcBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCs
||_dS(N(R(RR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR‘scCsddjd„|jDƒƒS(s-Return a string representation of this check.s(%s)s or css|]}t|ƒVqdS(N(R(RR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pys	<genexpr>—s(RR(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR”scCs.x'|jD]}||||ƒr
tSq
WtS(scCheck the policy.

        Requires that at least one rule accept in order to return True.
        (RRR(RRRRR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR™scCs|jj|ƒ|S(s¨Adds rule to be tested.

        Allows addition of another rule to the list of rules that will
        be tested.  Returns the OrCheck object for convenience.
        (RR(RR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR ¤scCs|jjƒ}||fS(s—Pops the last check from the list and returns them

        :returns: self, the popped check
        :rtype: :class:`.OrCheck`, class:`.Check`
        (Rtpop(Rtcheck((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyt	pop_check®s(RR	RRRR R$(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR!s
				
cs#‡fd†}|r||ƒS|S(Ncs|tˆ<|S(N(tregistered_checks(tfunc(tname(sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyt	decorator½s
((R'R&R(((R'sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pytregister¹s
Rt	RuleCheckcBseZd„ZRS(cCs7y|j|j|||ƒSWntk
r2tSXdS(N(RRtKeyErrorR(RRtcredsR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRÊs
(RR	R(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR*Èstrolet	RoleCheckcBseZdZd„ZRS(s:Check that there is a matching role in the ``creds`` dict.cCscy|j|}Wntk
r%tSXd|kr_|jƒg|dD]}|jƒ^qFkStS(Ntroles(RR+Rtlower(RRR,RRtx((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRÖs
-(RR	R
R(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR.Òsthttpt	HttpCheckcBseZdZd„ZRS(s•Check ``http:`` rules by calling to a remote server.

    This example implementation simply verifies that the response
    is exactly ``True``.
    c
CsÃd|j|}tj|ƒ}xB|jƒD]4}|j|ƒ}t|ƒtkr-i||<q-q-Witj|ƒd6tj|ƒd6}t	j
tj|d|ƒƒ}	|	j
dkSWdQXdS(Nshttp:RtcredentialstdataR(RtcopytdeepcopytkeystgetttypetobjectRtdumpst
contextlibtclosingtrequeststpostttext(
RRR,Rturlttemp_targettkeytelementR5R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRês!(RR	R
R(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR3âstGenericCheckcBs eZdZd„Zd„ZRS(sµCheck an individual match.

    Matches look like:

        - tenant:%(tenant_id)s
        - role:compute:admin
        - True:%(user.enabled)s
        - 'Member':%(role.name)s
    cCs±t|ƒdkr%|tj|ƒkS|d|d}}y||}Wntk
r\tSXt|tƒršx'|D]}|j|||ƒrstSqsWtS|j|||ƒSdS(sKSearches for a match in the dictionary.

        test_value is a reference inside the dictionary. Since the process is
        recursive, each call to _find_in_dict will be one level deeper.

        path_segments is the segments of the path to search.  The recursion
        ends when there are no more segments of path.

        When specifying a value inside a list, each element of the list is
        checked for a match. If the value is found within any of the sub lists
        the check succeeds; The check only fails if the entry is not in any of
        the sublists.

        iiN(	tlentsixt	text_typeR+Rt
isinstancetlistt
_find_in_dictR(Rt
test_valuet
path_segmentsRRDtval((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRLs

cCsˆy|j|}Wntk
r%tSXy)tj|jƒ}|tj|ƒkSWntk
rbnX|jj	dƒ}|j
|||ƒS(Nt.(RR+Rtasttliteral_evalRRHRIt
ValueErrortsplitRL(RRR,RRRMRN((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyR&s

(RR	R
RLR(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyRFûs
	(RRQR=R6toslo_serializationRR?RHR%t
add_metaclasstABCMetaR;RR
RRRRR!tNoneR)R*R.R3RF(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_policy/_checks.pyt<module>s0#)