security integration tests

Untested, not ready for merge.
this is also inconsistent, parens should align. Same thing in the rest of the pull request.