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öddlZddlZddlZddlZddlZddlmZddlZddlmZddl	m
Zddl	mZddl	m
Z
ddl	mZddl	mZejeƒZejejƒd	ejfd
„ƒYƒZdS(iÿÿÿÿN(t
positional(turllib(t_utils(taccess(tdiscover(t
exceptions(tplugintBaseIdentityPlugincBsÎeZdZded„Zejd„ƒZd„Z	d„Z
d„Zd„Zdddddied„Z
d„Zd	„Zd
„Zd„Zeƒdd„ƒZd
„Zd„Zd„Zd„ZRS(ixcCsJtt|ƒjƒ||_d|_||_i|_tj	ƒ|_
dS(N(tsuperRt__init__tauth_urltNonetauth_reftreauthenticatet_endpoint_cachet	threadingtLockt_lock(tselfR
R
((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pyR	's				cKsdS(sêObtain a token from an OpenStack Identity Service.

        This method is overridden by the various token version plugins.

        This function should not be called independently and is expected to be
        invoked via the do_authenticate function.

        This function will be invoked if the AcessInfo object cached by the
        plugin is not valid. Thus plugins should always fetch a new AccessInfo
        when invoked. If you are looking to just retrieve the current auth
        data then you should use get_access.

        :param session: A session object that can be used for communication.
        :type session: keystoneauth1.session.Session

        :raises keystoneauth1.exceptions.response.InvalidResponse:
            The response returned wasn't appropriate.
        :raises keystoneauth1.exceptions.http.HttpError:
            An error from an invalid HTTP response.

        :returns: Token access information.
        :rtype: :class:`keystoneauth1.access.AccessInfo`
        N((Rtsessiontkwargs((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pytget_auth_ref2scKs|j|ƒjS(sÂReturn a valid auth token.

        If a valid token is not present then a new one will be fetched.

        :param session: A session object that can be used for communication.
        :type session: keystoneauth1.session.Session

        :raises keystoneauth1.exceptions.http.HttpError: An error from an
                                                         invalid HTTP response.

        :return: A valid token.
        :rtype: string
        (t
get_accesst
auth_token(RRR((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pyt	get_tokenLscCs7|js
tS|jstS|jj|jƒr3tStS(sÕReturn if the existing token needs to be re-authenticated.

        The token should be refreshed if it is about to expire.

        :returns: True if the plugin should fetch a new token. False otherwise.
        (RtTrueR
tFalsetwill_expire_soontMIN_TOKEN_LIFE_SECONDS(R((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pyt_needs_reauthenticate\s		cKs8|j&|jƒr+|j|ƒ|_nWdQX|jS(sFetch or return a current AccessInfo object.

        If a valid AccessInfo is present then it is returned otherwise a new
        one will be fetched.

        :param session: A session object that can be used for communication.
        :type session: keystoneauth1.session.Session

        :raises keystoneauth1.exceptions.http.HttpError: An error from an
                                                         invalid HTTP response.

        :returns: Valid AccessInfo
        :rtype: :class:`keystoneauth1.access.AccessInfo`
        N(RRRR(RRR((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pyRrs
cCs|jrd|_tStS(sInvalidate the current authentication data.

        This should result in fetching a new token on next call.

        A plugin may be invalidated if an Unauthorized HTTP response is
        returned to indicate that the token may have been revoked or is
        otherwise now invalid.

        :returns: True if there was something that the plugin did to
                  invalidate. This means that it makes sense to try again. If
                  nothing happens returns False to indicate give up.
        :rtype: bool
        N(RRRR(R((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pyt
invalidateŒs		c		KsN|tjkr'|j}
|p!d}n\|s>tjdƒdS|sMd}n|j|ƒj}|jd|d|d|d|ƒ}
|s|
S|r¨t	j
||
ƒ}n|
}y|j||dtƒ}
Wn@t
jt
jt
jfk
r|rtjd	|
ƒqJdSn>X|
j||}
|
rJtjj|jd
ƒd
|
ƒ}
n|
S(s-Return a valid endpoint for a service.

        If a valid token is not present then a new one will be fetched using
        the session and kwargs.

        :param session: A session object that can be used for communication.
        :type session: keystoneauth1.session.Session
        :param string service_type: The type of service to lookup the endpoint
                                    for. This plugin will return None (failure)
                                    if service_type is not provided.
        :param string interface: The exposure of the endpoint. Should be
                                 `public`, `internal`, `admin`, or `auth`.
                                 `auth` is special here to use the `auth_url`
                                 rather than a URL extracted from the service
                                 catalog. Defaults to `public`.
        :param string region_name: The region the endpoint should exist in.
                                   (optional)
        :param string service_name: The name of the service in the catalog.
                                   (optional)
        :param tuple version: The minimum version number required for this
                              endpoint. (optional)
        :param dict allow: Extra filters to pass when discovering API
                           versions. (optional)
        :param bool allow_version_hack: Allow keystoneauth to hack up catalog
                                        URLS to support older schemes.
                                        (optional, default True)

        :raises keystoneauth1.exceptions.http.HttpError: An error from an
                                                         invalid HTTP response.

        :return: A valid endpoint URL or None if not available.
        :rtype: string or None
        tidentitys€Plugin cannot return an endpoint without knowing the service type that is required. Add service_type to endpoint filtering data.tpublictservice_typet	interfacetregion_nametservice_namet
authenticatedsdFailed to contact the endpoint at %s for discovery. Fallback to using that endpoint as the base url.t/N(RtAUTH_INTERFACER
tLOGtwarningRRtservice_catalogturl_forRt_get_catalog_discover_hackt
get_discoveryRRtDiscoveryFailuret	HttpErrortConnectionErrorRtparseturljointrstrip(RRR!R"R#R$tversiontallowtallow_version_hackRturlR*tvers_urltdisc((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pytget_endpoint s>)	
			
	%cKs|j|ƒjS(N(Rtuser_id(RRR((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pytget_user_idscKs|j|ƒjS(N(Rt
project_id(RRR((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pytget_project_idscKs9y|j|ƒjj|ƒSWntjk
r4dSXdS(N(Rtservice_providerstget_auth_urlRtServiceProviderNotFoundR(RRtsp_idR((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pytget_sp_auth_urls
cKs9y|j|ƒjj|ƒSWntjk
r4dSXdS(N(RR?t
get_sp_urlRRAR(RRRBR((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pyRD#s
cCs”y
|j}Wntk
r-i}|_nXx_|j|fD]}|j|ƒ}|r>Pq>q>Wtj||d|ƒ}||j|<|||<|S(s5Return the discovery object for a URL.

        Check the session and the plugin cache to see if we have already
        performed discovery on the URL and if so return it, otherwise create
        a new discovery object, cache it and return it.

        This function is expected to be used by subclasses and should not
        be needed by users.

        :param session: A session object to discover with.
        :type session: keystoneauth1.session.Session
        :param str url: The url to lookup.
        :param bool authenticated: Include a token in the discovery call.
                                   (optional) Defaults to None (use a token
                                   if a plugin is installed).

        :raises keystoneauth1.exceptions.discovery.DiscoveryFailure:
            if for some reason the lookup fails.
        :raises keystoneauth1.exceptions.http.HttpError: An error from an
                                                         invalid HTTP response.

        :returns: A discovery object with the results of looking up that URL.
        R%(t_identity_endpoint_cachetAttributeErrorRtgetRtDiscover(RRR7R%tsession_endpoint_cachetcacheR9((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pyR-*s

	

cCs
tƒ‚dS(s@Get the elements for this auth plugin that make it unique.

        As part of the get_cache_id requirement we need to determine what
        aspects of this plugin and its values that make up the unique elements.

        This should be overridden by plugins that wish to allow caching.

        :returns: The unique attributes and values of this plugin.
        :rtype: A flat dict with a str key and str or None value. This is
                required as we feed these values into a hash. Pairs where the
                value is None are ignored in the hashed id.
        N(tNotImplementedError(R((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pytget_cache_id_elements[s
cCsáy|jƒ}Wntk
r$dSXtjƒ}x‘t|jƒƒD]}\}}|dk	rDt|tj	ƒr€|j
dƒ}nt|tj	ƒr¤|j
dƒ}n|j|ƒ|j|ƒqDqDWtj
|jƒƒjdƒS(søFetch an identifier that uniquely identifies the auth options.

        The returned identifier need not be decomposable or otherwise provide
        any way to recreate the plugin.

        This string MUST change if any of the parameters that are used to
        uniquely identity this plugin change. It should not change upon a
        reauthentication of the plugin.

        :returns: A unique string for the set of options
        :rtype: str or None if this is unsupported or unavailable.
        sutf-8N(RLRKRthashlibtsha256tsortedtitemst
isinstancetsixtstring_typestencodetupdatetbase64t	b64encodetdigesttdecode(Rtelementsthashertktv((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pytget_cache_idjs


cCs:|jr6i|jjd6|jjd6}tj|ƒSdS(sßRetrieve the current authentication state for the plugin.

        Retrieve any internal state that represents the authenticated plugin.

        This should not fetch any new data if it is not present.

        :returns: a string that can be stored or None if there is no auth state
                  present in the plugin. This string can be reloaded with
                  set_auth_state to set the same authentication.
        :rtype: str or None if no auth present.
        RtbodyN(RRt_datatjsontdumps(Rtdata((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pytget_auth_state‹s	cCsH|r;tj|ƒ}tjd|dd|dƒ|_n	d|_dS(s½Install existing authentication state for a plugin.

        Take the output of get_auth_state and install that authentication state
        into the current authentication plugin.
        R_RN(RatloadsRtcreateRR(RRct	auth_data((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pytset_auth_states
N(t__name__t
__module__RRRR	tabctabstractmethodRRRRRR:R<R>RCRDRR-RLR^RdRh(((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pyR s(					t				0		!	(RkRVRMRaRRRRt	six.movesRt
keystoneauth1RtutilsRRRRt
get_loggerRiR(t
add_metaclasstABCMetatBaseAuthPluginR(((sP/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/identity/base.pyt<module>
s