This repository was archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpackage.json
84 lines (84 loc) · 8.29 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
"name": "auth-proxy",
"author": {
"name": "Howard Tyson"
},
"version": "0.1.5",
"description": "An authetnicating proxy server protecting operations services.",
"main": "server.js",
"bin": {
"auth-proxy": "./bin/auth-proxy"
},
"dependencies": {
"async": "~0.2.9",
"blanket": "~1.1.6",
"connect-flash": "0.1.x",
"connect-redis": "~1.4.5",
"coveralls": "~2.7.1",
"ejs": ">= 0.8.4",
"ejs-locals": ">= 1.0.2",
"express": "3.9.0",
"http-proxy": "~1.11",
"passport": ">= 0.0.0",
"passport-drupal": "^0.3.2",
"passport-google-oauth": "~0.1.5",
"passport-local": ">= 0.0.0",
"portfinder": "~0.2.1",
"redis": "~0.9.0",
"request": "~2.12.0",
"should": "~2.1.0",
"winston": "^0.9.0",
"yaml-config-loader": "^1.2.2",
"yargs": "^3.6.0"
},
"scripts": {
"test": "./node_modules/mocha/bin/mocha",
"start": "bin/auth-proxy",
"watch": "./node_modules/mocha/bin/mocha -w",
"coverage": "istanbul cover ./node_modules/.bin/_mocha"
},
"repository": {
"type": "git",
"url": "https://github.com/tizzo/authenticating-proxy.git"
},
"license": "GPL",
"config": {
"blanket": {
"pattern": "//lib/(server.js|ConfigLoader.js)/"
}
},
"devDependencies": {
"mocha": "~1.14.0",
"assert": "~0.4.9",
"should": "~2.1.0",
"coveralls": "^2.7.1",
"istanbul": "^0.3.2"
},
"gitHead": "8ea2fe0ac520271f0c41b1090dfdd61d5ce5d0f7",
"bugs": {
"url": "https://github.com/tizzo/authenticating-proxy/issues"
},
"homepage": "https://github.com/tizzo/authenticating-proxy",
"_id": "[email protected]",
"_shasum": "67fefaf24c4e097581159a4b798fa9a79fcb07af",
"_from": "auth-proxy@*",
"_npmVersion": "1.4.21",
"_npmUser": {
"name": "tizzo",
"email": "[email protected]"
},
"maintainers": [
{
"name": "tizzo",
"email": "[email protected]"
}
],
"dist": {
"shasum": "6eb5c470f54ef21d00b63d45e42b295e9f5a158a",
"tarball": "http://registry.npmjs.org/auth-proxy/-/auth-proxy-0.1.2.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/auth-proxy/-/auth-proxy-0.1.2.tgz",
"readme": "# Authenitcating Proxy\n\n[](https://travis-ci.org/tizzo/auth-proxy)\n[](https://coveralls.io/r/tizzo/auth-proxy)\n\n**STATUS - This project is under active development and while it is currently functional it is not yet stable or properly documented, I'll keep the README up to date as this project takes shape.**\n\nThis module is a little bit of glue wrapping [express](http://expressjs.com/), [passport](http://passportjs.org/), and [HTTP Proxy](https://github.com/nodejitsu/node-http-proxy). It allows you to setup a simple reverse proxy server to provide authentication for otherwise unsecured services in your infrastructure. It currently ships with authentication using either [Google apps oauth2](http://npmjs.org/package/passport-google-oauth). You must add apps domains and allowed users to a whitelist before anyone can authenticate, you'll also need to define your proxy routes before auth-proxy does anything useful for you.\n\nPull requests adding support for other authentication strategies are most welcome.\n\n## Installation\n\n1. Clone the repo\n2. `cd` into the directory and run `npm install`\n3. Create a config.yaml in the root of the repository, any configuration added to this yaml file will override the defaults (set in `default.config.yaml`)\n4. Setup your authentication strategies in the config.yaml file. See `examples/config` for more.\n5. Setup your routes in config.yaml (see the documentation and examples below).\n6. Verify that you have your configuration correct by starting the server with `npm start`.\n7. Copy and edit the appropriate init script from the init directory to your system daemon.\n\n### Configuring\n\nThe `default.config.yaml` file holds the default configuration used by the proxy. If a `config.yaml` file is created in the root of the repository then any keys set will override defaults set in the default configuration file. Environment variables will override anything set in the configuration files. Environment variables can be set for any configuration key but are converted (all capital letters with underscores rather than camel case).\n\n### Defining Routes\n\nThe routes configuration key is an array of route objects. This list of routes is searched (in the order they are defined) when any incomming request is received in the proxy. A path and/or a hostname are checked (if configured - both optional) and the first matching route is used. For a small performance gain the most commonly used routes should probably be at the beginning of the list.\n\n#### Required configuration keys\n\n- `host` The host to proxy matching requests to.\n- `port` The port at `host` to route the requests to.\n\n#### Optional configuration keys\n\n- `name` A name for the route; used on the index page to list this service.\n- `description` A description for the route; used on the index page.\n- `link` Used on the index page to link to this resource. This can be relative if paths are used to match or absolute for hosts.\n- `pathPattern` A regex of the path to match, usually this should start with a `^/` (to match only instances at the beginning of the path and end with `/?` to optionally allow a trailing slash.\n- `hostPattern` A regex to search for host to match for incomming routes. This allows you to route to different applications based on host name.\n- `pathRewritePattern` This rewrites the request path sent to the backend used for this route. This may use regex matches from the `pathPattern` setting in normal javascript `replace()` syntax.\n- `hostRewritePattern` This rewrite the request host sent in the headers to the backend for this route. Like `pathRewritePattern` this may use tokens from the `hostPattern` regex as per the normal javascript `replace()` syntax.\n- `basicAuth` An object with attributes of `name` and `password`. This will be added as http basic auth for all requests proxied through this route.\n\n#### Configuration example\n\n```yaml\nroutes:\n - name: \"Jenkins\"\n description: \"An extendable open source continuous integration server.\"\n host: localhost\n port: 8080\n pathPattern: \"^/jenkins/?\"\n link: /jenkins\n - name: \"Jenkins Git Calback\"\n description: A brutal task master\n pathRewritePattern: /\n host: localhost\n port: 8080\n pathPattern: \"^/jenkins/?\"\n - name: test route\n pathPattern: \"/test/?\"\n description: debug info\n pathRewritePattern: \"/\"\n host: localhost\n hostPattern: 127.0.0.1\n link: test\n hostRewritePattern: fooozbazzzz\n port: 8989\n```\n\n## Authentication Strategy Plugins\n\nAuth-proxy uses a plugin system for authentication strategies which are pluggable. It ships with a couple of strategies but if a strategy is specified\nin configuration that is not found when requiring `lib/plugins/index.js` than a global require will be attempted.\n\n### Built in strategies\n\n 1. Google OAuth 2\n 2. Mock Strategy\n\n### Writing a Passport Authentication Strategy Plugin \n\nAn auth-proxy strategy plugin is a simple wrapper around the passport strategy responsible for receiving it's configuration,\ninstantiating the underlying passport plugin, registering any necessary express routes, and rendering whatever widget needs to\nappear on the login page.\n\n#### Required methods:\n\n##### 1. attach()\n\n``` javasctipt\nattach = function(passport, app, config, pluginConfig, logger) {}\n```\n\n**Parameters:**\n\n - `passport`: The instantiated and configured passport object.\n - `app`: The express app object, use this to register new routes needed for authentication.\n - `config`: The current configuration for the server as a whole.\n - `pluginConfig`: The configuration for this specific plugin.\n - `logger`: The instantiated and configured [winston](https://www.npmjs.org/package/winston) logger object.\n\n##### 2. renderLogin()\n\nRender login is responsible for rendering the necessary logn widget for the login page. It receives no parameters and if the module needs to use configurationfor this portion it should be retained from the `attach()` call which will always run first.\n",
"readmeFilename": "README.md"
}