Skip to content

feat(server): add lusca #1166

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

Merged
merged 1 commit into from
Aug 31, 2015
Merged

feat(server): add lusca #1166

merged 1 commit into from
Aug 31, 2015

Conversation

Awk34
Copy link
Member

@Awk34 Awk34 commented Aug 13, 2015

No description provided.

@kingcody
Copy link
Member

Are there any notes that should be included for the users? Or is the more a drop-in/set-it-forget-it kind of feature?

@Awk34
Copy link
Member Author

Awk34 commented Aug 14, 2015

As is, it's kind of a drop-in, but there are more features that can be enabled, etc. I'll add a comment in the code about Lusca.

@kingcody
Copy link
Member

This needs to be rebased on canary.

var session = require('express-session');<% if (filters.mongoose) { %>
var mongoStore = require('connect-mongo')(session);
var mongoose = require('mongoose-bird')();<% } %><% } %>
var mongoose = require('mongoose-bird')();<% } %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requiring mongoose directly

@Awk34
Copy link
Member Author

Awk34 commented Aug 15, 2015

rebased

var config = require('./environment');<% if (filters.auth) { %>
var passport = require('passport');<% } %><% if (filters.twitterAuth) { %>
var passport = require('passport');<% } %>
var session = require('express-session');<% if (filters.mongoose) { %>
var mongoStore = require('connect-mongo')(session);
var mongoose = require('mongoose');<% } %><% } %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're removing <% if (filters.twitterAuth) { %> then you also need to remove the closing tag <% } %> here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh damnit, yeah, that's from the rebase

@kingcody
Copy link
Member

I think the tests are failing because they're making a POST with out sending the CSRF token.

@Awk34 Awk34 force-pushed the lusca branch 3 times, most recently from df57930 to cbd0798 Compare August 16, 2015 05:45
@kingcody
Copy link
Member

I rebased this on canary, but I'm going to guess you already figured that out.

@Awk34
Copy link
Member Author

Awk34 commented Aug 16, 2015

I think the tests are failing because they're making a POST with out sending the CSRF token.

Oh yeah, nice catch!

@kingcody
Copy link
Member

I'm going to hold off on merging this for now; I want to try to get supertest working with the CSRF tokens. I'll work on it tonight, unless someone beats me to it.

@Awk34
Copy link
Member Author

Awk34 commented Aug 16, 2015

I'm going to hold off on merging this for now; I want to try to get supertest working with the CSRF tokens. I'll work on it tonight, unless someone beats me to it.

What's the point?

@kingcody
Copy link
Member

If we disable the csrf strategy for the tests then we're not really testing the same code that would run in production. Also it would be good to know if a future change breaks the implementation.

@Awk34
Copy link
Member Author

Awk34 commented Aug 17, 2015

I don't see there really being a difference if you were to get supertest to work with the CSRF tokens. It wouldn't affect the tests still. The tests aren't meant to test the Lusca stuff.

@kingcody
Copy link
Member

They are integration(e2e) tests, which are supposed to test an app as a whole. IMO that includes security implementation.

I'm not trying to test if lusca is using and decoding tokens properly, I'm going to assume it is. What I'd like to test is that our implementation is correct.

@Awk34 Awk34 added this to the 3.0.0 milestone Aug 19, 2015
@Awk34
Copy link
Member Author

Awk34 commented Aug 24, 2015

If we can get it working with tests, that would be better; but if not, I don't thing it's a huge deal.

@kingcody
Copy link
Member

I agree, I wouldn't want tests to put too much of a hold on implementing a security feature. I'll debug it more this weekend and see if I can get things straight between Travis and SauceLabs. Oddly enough the tests pass when I use sauce_connect locally but for some reason Travis is a different situation.

Either way I'm setting Monday as my deadline.

@kingcody
Copy link
Member

Well there is still something fishy about the way the e2e test fail when using lusca + travis + sauce_connect but I was not able to get to the bottom of it. I do wonder if we have some race conditions buried down deep, however I wasn't able to expose them in my tests.

kingcody added a commit that referenced this pull request Aug 31, 2015
@kingcody kingcody merged commit 6f60e58 into canary Aug 31, 2015
@kingcody kingcody deleted the lusca branch September 1, 2015 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants