Skip to content

CORE-6844: BETA feature for custom envoy sidecar #337

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@
"<node_internals>/**"
],
"type": "pwa-node"
}
},
{
"type": "node",
"request": "attach",
"port": 9220,
"name": "Attach debugger",
"restart": true,
"skipFiles": [
"${workspaceFolder}/node_modules/**/*",
"<node_internals>/**/*"
],
"timeout": 1000
},
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ $ export JWT_RS256_PRIVATE_KEY=`cat ./test/support/sample-jwt-private-key.pem`
3. Run the entire test suite:

```
npm run tests
npm test
```

OR, run an individual test manually:
Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ const alamo = {
recommendations: require('./lib/recommendations.js'),
};

const PORT = process.env.PORT || 5000;

const db_url = new url.URL(config.database_url);
const db_conf = {
user: db_url.username ? db_url.username : '',
Expand Down Expand Up @@ -855,10 +857,8 @@ const server = http.createServer((req, res) => {
const path = parsedURL.pathname + parsedURL.search;

routes.process(method, path, req, res).catch((e) => { console.error('Uncaught error:', e); });
}).listen(process.env.PORT || 5000, () => {
if (!process.env.TEST_MODE) {
console.log(`Server started and listening on port ${process.env.PORT || 5000}`);
}
}).listen(PORT, () => {
console.log('Server started and listening on port:', PORT);
});

server.keepAliveTimeout = 1000 * (60 * 6); // 6 minutes
Expand Down
1 change: 1 addition & 0 deletions lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ async function check_deployment_features(pg_pool, app_uuid, dyno_type) {
'csp-unsafe': await feature_enabled(pg_pool, app_uuid, 'csp-unsafe'),
'csp-embedded': await feature_enabled(pg_pool, app_uuid, 'csp-embedded'),
'container-ports': await feature_enabled(pg_pool, app_uuid, 'container-ports'),
'custom-envoy-sidecar': await feature_enabled(pg_pool, app_uuid, 'custom-envoy-sidecar'),
};
}
return {
Expand Down
10 changes: 10 additions & 0 deletions lib/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ const available_features = [
feedback_email: process.env.SUPPORT_EMAIL,
enabled: false, /* Must always be false! */
},
{
description: '(BETA) Enables a custom envoy sidecar that intercepts requests & handles the request appropriately based on configured authorization',
doc_url: '/features/custom-envoy-sidecar',
id: '92122c9a-4936-48cf-b210-9cc5a74dceea',
state: 'beta',
name: 'custom-envoy-sidecar',
display_name: 'Custom Envoy Sidecar',
feedback_email: process.env.SUPPORT_EMAIL,
enabled: false, /* Must always be false! */
},
];

function to_response(frecord) {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"description": "Central API for controlling apps in akkeris",
"main": "index.js",
"scripts": {
"start": "node index.js",
"dev": "nodemon index.js",
"start": "node index",
"dev": "nodemon",
"debug": "nodemon --inspect=0.0.0.0:9220",
"test": "./node_modules/.bin/nyc --reporter=text --reporter=lcov mocha --colors --reporter mocha-multi-reporters --reporter-options configFile=./test/mocha_config.json --exit",
"cover": "bash -c './node_modules/.bin/nyc --reporter=text --reporter=lcov mocha --colors --reporter mocha-multi-reporters --reporter-options configFile=./test/mocha_config.json --exit && bash <(curl -Ls https://coverage.codacy.com/get.sh) report --coverage-reports ./coverage/lcov.info -t $CODACY_PROJECT_TOKEN'"
},
Expand Down