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
# Taken from http://blog.lesc.se/2011/11/how-to-change-file-premissions-in-git.html on January 12, 2018 | |
>git ls-tree HEAD | |
100644 blob 55c0287d4ef21f15b97eb1f107451b88b479bffe script.sh | |
>git update-index --chmod=+x script.sh | |
>git status | |
# On branch master | |
# Changes to be committed: | |
# (use "git reset HEAD <file>..." to unstage) | |
# |
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
$ git grep --break -p authCodeScope | |
src/lib/utility.js=module.exports = { | |
src/lib/utility.js: authCodeScope: process.env.DEFAULT_AUTH_CODE_SCOPE, | |
src/lib/views.js=var index = function(req, cookie, error) { | |
src/lib/views.js: authCodeScope: cookie.authCodeScope, | |
src/server.js=app.post('/auth', function(req, res) { | |
src/server.js: cookie.authCodeScope = req.body.scope; |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "DenyObjectDeleteWithWhitelist", | |
"Effect": "Deny", | |
"NotPrincipal": { | |
"AWS": [ | |
"arn:aws:iam::123456789012:role/SuperRoleOne", | |
"arn:aws:iam::123456789012:role/SuperRoleTwo" |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "DenyObjectDeleteWithWhitelist", | |
"Effect": "Deny", | |
"NotPrincipal": { | |
"AWS": [ | |
"arn:aws:iam::123456789012:role/my-lambda-role" | |
] |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "DenyObjectDeleteWithWhitelist", | |
"Effect": "Deny", | |
"NotPrincipal": { | |
"AWS": [ | |
"arn:aws:iam::123456789012:role/my-lambda-role", | |
"arn:aws:sts::123456789012:assumed-role/my-lambda-role/my-lambda-function" |
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
// Example for mocha; translate as needed for your favourite test framework | |
afterEach(function() { | |
... | |
if(!nock.isDone()) { | |
this.test.error(new Error('Not all nock interceptors were used!')); | |
nock.cleanAll(); | |
} | |
... | |
}); |
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
'use strict'; | |
const request = require('superagent'); | |
const express = require('express'); | |
const app = express(); | |
app.get('/', function(req, res) { | |
request | |
.get('https://www.example.com') | |
.then(response => res.send(response.text)); |
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
'use strict'; | |
const assert = require('chai').assert; | |
const nock = require('nock'); | |
const request = require('supertest'); | |
const uniqueValue = 'da64daaf-182b-4af6-a4af-09727bf8d5aa'; | |
const app = require('../../src/server'); | |
describe('server', function() { | |
it('GET / once', function() { |
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
'use strict'; | |
const assert = require('chai').assert; | |
const nock = require('nock'); | |
const request = require('supertest'); | |
const uniqueValue = 'da64daaf-182b-4af6-a4af-09727bf8d5aa'; | |
const app = require('../../src/server'); | |
describe('server', function() { | |
it('GET / once', function() { |
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
'use strict'; | |
const request = require('superagent'); | |
const express = require('express'); | |
const app = express(); | |
app.get('/', function(req, res) { | |
request | |
.get('https://www.example.com') | |
.then(response => res.send(response.text)) |