/usr/lib/python2.6/site-packages/openstackclient/api
Edit: /usr/lib/python2.6/site-packages/openstackclient/api/auth_plugin.pyc (3867B)
Ñò
;vVc @ s— d Z d d k Z d d k l Z d d k l Z d d k l Z d d k
l Z e i e
ƒ Z d e i f d „ ƒ YZ d e i f d
„ ƒ YZ d S( s Authentication Plugin LibraryiÿÿÿÿN( t cfg( t parse( t password( t token_endpointt
TokenEndpointc B s/ e Z d Z d „ Z d „ Z e d „ ƒ Z RS( sÇ Auth plugin to handle traditional token/endpoint usage
Implements the methods required to handle token authentication
with a user-specified token and service endpoint; no Identity calls
are made for re-scoping, service catalog lookups or the like.
The purpose of this plugin is to get rid of the special-case paths
in the code to handle this authentication format. Its primary use
is for bootstrapping the Keystone database.
c K s# t t | ƒ i d | d | ƒ d S( s› A plugin for static authentication with an existing token
:param string url: Service endpoint
:param string token: Existing token
t endpointt tokenN( t superR t __init__( t selft urlR t kwargs( ( sO /tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/auth_plugin.pyR ' s c K s d S( N( t None( R t sessionR ( ( sO /tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/auth_plugin.pyt get_auth_ref0 s c C sP t t | ƒ i ƒ } | i t i d d d ƒt i d d t d d ƒg ƒ | S( NR
t helps Specific service endpoint to useR t secrets Authentication token to use( R R t get_optionst extendR t StrOptt True( R t options( ( sO /tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/auth_plugin.pyR 4 s
( t __name__t
__module__t __doc__R R t classmethodR ( ( ( sO /tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/auth_plugin.pyR s
t OSCGenericPasswordc B s e Z d Z d d „ Z RS( sZ Auth plugin hack to work around broken Keystone configurations
The default Keystone configuration uses http://localhost:xxxx in
admin_endpoint and public_endpoint and are returned in the links.href
attribute by the version routes. Deployments that do not set these
are unusable with newer keystoneclient version discovery.
c C s§ t i | ƒ } | i i d ƒ oZ t i | i ƒ } t i | i | i | i | i | i | i f ƒ } t
i d | ƒ n t t
| ƒ i d | d | d | d | ƒ S( sÊ Handle default Keystone endpoint configuration
Build the actual API endpoint from the scheme, host and port of the
original auth URL and the rest from the returned version URL.
t localhosts Version URL updated: %sR
t versionR
t
raw_status( t urlparset netloct
startswitht auth_urlt
urlunparset schemet patht paramst queryt fragmentt LOGt debugR R t
create_plugin( R R
R R
R t ver_ut auth_u( ( sO /tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/auth_plugin.pyR* N s N( R R R R R* ( ( ( sO /tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/auth_plugin.pyR D s ( R t loggingt oslo_configR t six.moves.urllibR R t$ keystoneclient.auth.identity.genericR t ksc_passwordt keystoneclient.authR t getLoggerR R( t TokenR t PasswordR ( ( ( sO /tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/auth_plugin.pyt
s )