agentics-shield 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +44 -0
- package/bin/cli.js +278 -0
- package/dist/bundle.js +1 -0
- package/dist/crypto.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader.js +1 -0
- package/dist/middleware.js +1 -0
- package/dist/rateLimit.js +1 -0
- package/dist/session.js +1 -0
- package/dist/shield.js +1 -0
- package/examples/express.js +25 -0
- package/examples/multiPage.js +29 -0
- package/examples/setup.sh +8 -0
- package/examples/withApi.js +34 -0
- package/package.json +42 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const shield = require('agentics-shield');
|
|
4
|
+
|
|
5
|
+
const app = express();
|
|
6
|
+
|
|
7
|
+
const shieldInstance = shield.create({
|
|
8
|
+
apiKey: process.env.AGENTICS_API_KEY,
|
|
9
|
+
keysPath: path.resolve(__dirname, 'shield', 'shield.keys'),
|
|
10
|
+
wasmPath: path.resolve(__dirname, 'shield', 'shield.wasm'),
|
|
11
|
+
domains: ['localhost', 'yourdomain.com'],
|
|
12
|
+
protectedFiles: {
|
|
13
|
+
'index.html': path.resolve(__dirname, 'public', 'index.html'),
|
|
14
|
+
'app.js': path.resolve(__dirname, 'public', 'app.js'),
|
|
15
|
+
'style.css': path.resolve(__dirname, 'public', 'style.css'),
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
app.use(shieldInstance.router());
|
|
20
|
+
|
|
21
|
+
app.use(express.static(path.join(__dirname, 'public')));
|
|
22
|
+
|
|
23
|
+
app.listen(4821, () => {
|
|
24
|
+
console.log('Shield-protected server running on http://localhost:4821');
|
|
25
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const shield = require('agentics-shield');
|
|
4
|
+
|
|
5
|
+
const app = express();
|
|
6
|
+
|
|
7
|
+
const shieldInstance = shield.create({
|
|
8
|
+
apiKey: process.env.AGENTICS_API_KEY,
|
|
9
|
+
keysPath: path.resolve(__dirname, 'shield', 'shield.keys'),
|
|
10
|
+
wasmPath: path.resolve(__dirname, 'shield', 'shield.wasm'),
|
|
11
|
+
domains: ['localhost', 'yourdomain.com'],
|
|
12
|
+
prefix: '/shield',
|
|
13
|
+
protectedFiles: {
|
|
14
|
+
'index.html': path.resolve(__dirname, 'public', 'index.html'),
|
|
15
|
+
'about.html': path.resolve(__dirname, 'public', 'about.html'),
|
|
16
|
+
'dashboard.html': path.resolve(__dirname, 'public', 'dashboard.html'),
|
|
17
|
+
'app.js': path.resolve(__dirname, 'public', 'app.js'),
|
|
18
|
+
'components/nav.js': path.resolve(__dirname, 'public', 'components', 'nav.js'),
|
|
19
|
+
'style.css': path.resolve(__dirname, 'public', 'style.css'),
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
app.use(shieldInstance.router());
|
|
24
|
+
|
|
25
|
+
app.use(express.static(path.join(__dirname, 'public')));
|
|
26
|
+
|
|
27
|
+
app.listen(4822, () => {
|
|
28
|
+
console.log('Multi-page Shield server on http://localhost:4822');
|
|
29
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const shield = require('agentics-shield');
|
|
4
|
+
|
|
5
|
+
const app = express();
|
|
6
|
+
app.use(express.json());
|
|
7
|
+
|
|
8
|
+
const shieldInstance = shield.create({
|
|
9
|
+
apiKey: process.env.AGENTICS_API_KEY,
|
|
10
|
+
keysPath: path.resolve(__dirname, 'shield', 'shield.keys'),
|
|
11
|
+
wasmPath: path.resolve(__dirname, 'shield', 'shield.wasm'),
|
|
12
|
+
domains: ['localhost', 'yourdomain.com'],
|
|
13
|
+
protectedFiles: {
|
|
14
|
+
'index.html': path.resolve(__dirname, 'public', 'index.html'),
|
|
15
|
+
'app.js': path.resolve(__dirname, 'public', 'app.js'),
|
|
16
|
+
'style.css': path.resolve(__dirname, 'public', 'style.css'),
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
app.use(shieldInstance.router());
|
|
21
|
+
|
|
22
|
+
app.get('/api/data', (req, res) => {
|
|
23
|
+
res.json({ items: [{ id: 1, name: 'Item One' }, { id: 2, name: 'Item Two' }] });
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
app.post('/api/submit', (req, res) => {
|
|
27
|
+
res.json({ success: true, received: req.body });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
app.use(express.static(path.join(__dirname, 'public')));
|
|
31
|
+
|
|
32
|
+
app.listen(4823, () => {
|
|
33
|
+
console.log('Shield + API server on http://localhost:4823');
|
|
34
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agentics-shield",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Zero-trust frontend content protection. Encrypt, authenticate, and deliver proprietary code via WebAssembly.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agentics-shield": "bin/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"init": "node bin/cli.js init",
|
|
11
|
+
"build": "node build.js",
|
|
12
|
+
"prepublishOnly": "node build.js"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"shield",
|
|
16
|
+
"wasm",
|
|
17
|
+
"encryption",
|
|
18
|
+
"content-protection",
|
|
19
|
+
"middleware",
|
|
20
|
+
"agentics",
|
|
21
|
+
"webassembly",
|
|
22
|
+
"aes-gcm",
|
|
23
|
+
"x25519",
|
|
24
|
+
"zero-trust"
|
|
25
|
+
],
|
|
26
|
+
"author": "Connor Etherington <connor@agentics.co.za>",
|
|
27
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/agentics/shield"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://agentics.co.za/shield",
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18.0.0"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist/",
|
|
38
|
+
"bin/",
|
|
39
|
+
"examples/",
|
|
40
|
+
"LICENSE"
|
|
41
|
+
]
|
|
42
|
+
}
|