Proxy-Keystone
A proxy for OpenStack Keystone service catalog endpoints built on top of http-proxy.
Installation
npm install proxy-keystone
Example
Check out the live demo, source code here, to see an express app configured for authentication with the Rackspace Cloud Identity Service and Passport-Keystone.
Documentation
var express = ;var app = ;var ProxyKeystone = ;var proxyKeystone = ; // proxy-keystone requires you to bring your own authentication middleware// it should set req.user with a token and service catalogapp; appall'/proxy/*' proxyKeystonemiddleware; var server = app;
Custom Usage
Sometimes the req
object is organized differently. The options.token
and options.catalog
values are used to read keys off the request object. In the following example the user identity is located at req.current_user
and a custom user agent is supplied.
// example middleware to set user on req objectapp; var ProxyKeystone = ;var proxyKeystone = token: 'current_user.key' // req.current_user.key catalog: 'current_user.catalog' // req.current_user.catalog userAgent: 'Custom Openstack Dashboard' // forwarded in proxy headers; appall'/proxy/*' proxyKeystonemiddleware;
Listening for proxy events
proxyStart
- This event is emitted when the proxy starts.proxyEnd
- This event is emitted if the request to the target completed.proxyError
- The error event is emitted if the request to the target fail.
proxyKeystone; proxyKeystone; proxyKeystone;