Package myproxy :: Package ws :: Package server :: Package wsgi :: Module middleware :: Class MyProxyGetTrustRootsMiddleware
[hide private]

Class MyProxyGetTrustRootsMiddleware

source code


HTTP client interface for MyProxy server Get Trust Roots method

It relies on a myproxy.server.wsgi.MyProxyClientMiddleware instance called upstream in the WSGI stack to set up a MyProxyClient instance and make it available in the environ to call its getTrustRoots method.

Instance Methods [hide private]
 
__init__(self, app)
Create attributes
source code
 
parseConfig(self, prefix=PARAM_PREFIX, **app_conf)
Parse dictionary of configuration items updating the relevant attributes of this instance
source code
basestring
_getPath(self)
Get URI path for get trust roots method
source code
 
_setPath(self, value)
Set URI path for get trust roots method
source code
list
__call__(self, environ, start_response)
Get MyProxyClient instance from environ and call MyProxy getTrustRoots method returning the response.
source code

Inherited from server.wsgi.middleware.MyProxyClientMiddlewareBase: app

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
myproxy.server.wsgi.middleware.MyProxyGetTrustRootsMiddleware
filter_app_factory(cls, app, global_conf, prefix=PARAM_PREFIX, **app_conf)
Function following Paste filter app factory signature
source code
basestring
_getTrustRoots(cls, myProxyClient)
Call getTrustRoots method on MyProxyClient instance retrieved from environ and format and return a HTTP response
source code
Static Methods [hide private]

Inherited from server.wsgi.middleware.MyProxyClientMiddlewareBase: getStatusMessage

Class Variables [hide private]
string PATH_OPTNAME = 'path'
ini file option to set the URI path for this service
string DEFAULT_PATH = '/myproxy/get-trustroots'
default URI path setting
string PARAM_PREFIX = 'myproxy.getTrustRoots.'
prefix for ini file option names
  path = property(fget= _getPath, fset= _setPath, doc= "environ ...

Inherited from server.wsgi.middleware.MyProxyClientMiddlewareBase: CLIENT_ENV_KEYNAME_OPTNAME, DEFAULT_CLIENT_ENV_KEYNAME, clientEnvironKeyName

Instance Variables [hide private]
basestring __path
URI path setting for this service
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, app)
(Constructor)

source code 

Create attributes

Parameters:
  • app (function) - WSGI callable for next application in stack
Overrides: object.__init__

filter_app_factory(cls, app, global_conf, prefix=PARAM_PREFIX, **app_conf)
Class Method

source code 

Function following Paste filter app factory signature

Parameters:
  • app (callable following WSGI interface) - next middleware/application in the chain
  • global_conf (dict) - PasteDeploy global configuration dictionary
  • prefix (basestring) - prefix for configuration items
  • app_conf (dict) - PasteDeploy application specific configuration dictionary
Returns: myproxy.server.wsgi.middleware.MyProxyGetTrustRootsMiddleware
an instance of this middleware

parseConfig(self, prefix=PARAM_PREFIX, **app_conf)

source code 

Parse dictionary of configuration items updating the relevant attributes of this instance

Parameters:
  • prefix (basestring) - prefix for configuration items
  • app_conf (dict) - PasteDeploy application specific configuration dictionary

_getPath(self)

source code 

Get URI path for get trust roots method

Returns: basestring
path for get trust roots method

_setPath(self, value)

source code 

Set URI path for get trust roots method

Parameters:
  • value (basestring) - path for get trust roots method

__call__(self, environ, start_response)
(Call operator)

source code 

Get MyProxyClient instance from environ and call MyProxy getTrustRoots method returning the response.

MyProxyClientMiddleware must be in place upstream in the WSGI stack

Parameters:
  • environ (dict) - WSGI environment variables dictionary
  • start_response (function) - standard WSGI start response function
Returns: list
get trust roots response

_getTrustRoots(cls, myProxyClient)
Class Method

source code 

Call getTrustRoots method on MyProxyClient instance retrieved from environ and format and return a HTTP response

Parameters:
  • myProxyClient (myproxy.client.MyProxyClient) - MyProxyClient instance on which to call getTrustRoots method
Returns: basestring
trust roots base64 encoded and concatenated together
Raises:

Class Variable Details [hide private]

path

Value:
property(fget= _getPath, fset= _setPath, doc= "environ SCRIPT_NAME pat\
h which invokes the " "getTrustRoots method on this middleware")