-
Notifications
You must be signed in to change notification settings - Fork 736
Ahoyapps 97 rc delivery process #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
charliesantos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. But since this is now a public url, someone can easily grab our token and use it, which is something we and security wouldn't want. Since we don't have SSO, let's implement Basic Authentication at minimum. Please add the snippet below in your server file. Let's talk about the credentials in slack.
app.use((req, res, next) => {
// REMOVE THIS! Must be read from environment variable
const USER_NAME = "myuser";
const PASSWORD = "password";
// Get creds from headers
const b64auth = (req.headers.authorization || '').split(' ')[1] || '';
const [ login, password ] = new Buffer(b64auth, 'base64').toString().split(':');
// If authenticated
if (login && password && login === USER_NAME && password === PASSWORD) {
return next();
}
// Not authenticated, ask for creds
res.set('WWW-Authenticate', 'Basic realm="Restricted"');
res.status(401).send('Authentication required.');
});
|
Good call. For convenience, do you think we should set a cookie too? Otherwise we would have to enter login information every time. I may also add logic so that this is disabled when run locally. |
|
We should not set a different secret to your cookies. A better way is to grab the base64 authorization header and save it to your cookies if it matches the credentials. Then you can check for the base64 auth string in either headers or cookies |
* Add app.yaml file for google app engine deployment * Add .gcloudignore * Update config.yaml to add deployment step * Change server port to 8080 * Fix circleci config * Change circleci config * Use CIRCLE_TAG variable * Add basic auth to token server * Import cookieParser * Remove cookies from server
Feature/design refresh cleanup
Enable app to be deployed in Google's app engine. Update circle-ci config to deploy automatically.
Contributing to Twilio
Pull Request Details
JIRA link(s):
Description
This PR adds files needed for deployment to Google's app engine. The CircleCI config has been updated to automatically deploy new tags.
Burndown
Before review
npm testBefore merge