-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from MAIF/product_templates
Product templates
- Loading branch information
Showing
187 changed files
with
3,849 additions
and
84 deletions.
There are no files selected for viewing
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
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+1.35 KB
cli/templates/otoroshi/languages/go/otoroshi_wasm_request_transformer.zip
Binary file not shown.
Binary file added
BIN
+1.36 KB
cli/templates/otoroshi/languages/go/otoroshi_wasm_response_transformer.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
cli/templates/otoroshi/languages/js/otoroshi_wasm_access_control/esbuild.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const esbuild = require('esbuild') | ||
|
||
esbuild | ||
.build({ | ||
entryPoints: ['index.js'], | ||
outdir: 'dist', | ||
bundle: true, | ||
sourcemap: true, | ||
minify: false, // might want to use true for production build | ||
format: 'cjs', // needs to be CJS for now | ||
target: ['es2020'] // don't go over es2020 because quickjs doesn't support it | ||
}) |
21 changes: 21 additions & 0 deletions
21
cli/templates/otoroshi/languages/js/otoroshi_wasm_access_control/index.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export function execute() { | ||
let context = JSON.parse(Host.inputString()) | ||
|
||
if (context.request.headers["foo"] === "bar") { | ||
const out = { | ||
result: true | ||
} | ||
Host.outputString(JSON.stringify(out)) | ||
} else { | ||
const error = { | ||
result: false, | ||
error: { | ||
message: "you're not authorized", | ||
status: 401 | ||
} | ||
} | ||
Host.outputString(JSON.stringify(error)) | ||
} | ||
|
||
return 0 | ||
} |
7 changes: 7 additions & 0 deletions
7
cli/templates/otoroshi/languages/js/otoroshi_wasm_access_control/package.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "@@PLUGIN_NAME@@", | ||
"version": "@@PLUGIN_VERSION@@", | ||
"devDependencies": { | ||
"esbuild": "^0.17.9" | ||
} | ||
} |
Oops, something went wrong.