-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
437 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:8 | ||
FROM node:8-alpine | ||
RUN mkdir /root/src | ||
COPY . /root/src | ||
WORKDIR /root/src | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Auth Service for Elevate | ||
|
||
|
||
Uses bindaas endpoint to determine users and their permissions. | ||
|
||
Set SECRET to the jwt secret, or use /keys/certificate with a certificate, or /keys/jwk.json with a jwk. | ||
|
||
Use EXPIRY to set a token expiration other than the default one hour. | ||
|
||
This tool needs key and key.pub mounted to /keys to sign JWTs to elevate. In this distribution, run jwt_keys/make_keys.sh to do so. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# QUIP Auth Without PathDB | ||
|
||
## About this Method and Guide | ||
|
||
PathDB is used as both authentication and authorization. In instances where PathDB is not desired, we use a combination of an external identity provider and an internal authorization service. The authorization service consumes Json Web Tokens (JWTs) from the identity provider, and then will issue JWTs which convey both authentication and authorization, which are consumed by the application. | ||
|
||
This guide aims to explain how to make a deployment use this method. | ||
|
||
## Getting an Identity Provider and Setting up Login | ||
|
||
There are many identity providers, but for testing and examples, we have been using auth0. | ||
|
||
When selecting, an identity provider, note that we expect it to provide a JWT, and to have a certificate/public key/secret which can be used to verify such JWTs. | ||
|
||
The example given in the Distro within config/login.html is set up for auth0; simply change the corresponding variables for your auth0 application if auth0 is used. If using another identity provider, then login.html, or equivalent, needs to, at least, set the JWT to a cookie called "token", and call the auth service's 'check' route, and save a successful result as the token. Follow the guide which your identity provider uses for further guidance. | ||
|
||
## Keys/Certificates | ||
|
||
Add the following files; by default, they are mounted: | ||
|
||
- --./jwt\_keys/certificate or ./jwt\_keys/jwk.json is the certificate/public key/secret or jwk (respectively) from the **identity provider**. (If both are included, the jwk takes precedence). | ||
- --./jwt\_keys/key and ./jwt\_keys/key.pub are used as the signing and check keys for the **auth service** | ||
- --These can (and should) be generated with ./kwt\_keys/make\_keys.sh | ||
|
||
## Deployment Configuration | ||
|
||
Turn off disable security under the elevate service to block routes. | ||
|
||
## Adding Users to Database | ||
|
||
Add users as in ./config/add\_mongo\_users.js. Attributes can be added to deny access to routes (e.g. allow only some users to post and delete) | ||
|
||
The name field is the email field (or failing that, sub field) in that priority from the identity provider. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
let defaultTemplate = { | ||
"_id": "0", | ||
"type": "object", | ||
"id": "annotation-form", | ||
"name": "AnnotSchema", | ||
"description": "", | ||
"links": [], | ||
"additionalProperties": false, | ||
"properties": { | ||
"name": { | ||
"id": "a0", | ||
"title": "Identity Name", | ||
"type": "string", | ||
"required": true, | ||
"description": "note name" | ||
},"notes": { | ||
"id": "a1", | ||
"title": "Notes: ", | ||
"type": "string", | ||
"format":"textarea", | ||
"maxLength": 128 | ||
} | ||
} | ||
} | ||
|
||
db.template.insert(defaultTemplate) |
Oops, something went wrong.