Skip to content

Commit ff0aa13

Browse files
committed
Initial Commit
0 parents  commit ff0aa13

9 files changed

+190
-0
lines changed

Diff for: .babelrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
'presets': [
3+
'es2015',
4+
'stage-0',
5+
'stage-1',
6+
'stage-2',
7+
'stage-3'
8+
],
9+
'plugins': ['transform-runtime', 'transform-decorators-legacy']
10+
}

Diff for: .gitignore

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
# Created by .ignore support plugin (hsz.mobi)
3+
### JetBrains template
4+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
5+
6+
*.iml
7+
8+
## Directory-based project format:
9+
.idea/
10+
.vscode/
11+
12+
13+
## File-based project format:
14+
*.ipr
15+
*.iws
16+
17+
## Plugin-specific files:
18+
19+
# IntelliJ
20+
/out/
21+
22+
# mpeltonen/sbt-idea plugin
23+
.idea_modules/
24+
25+
# JIRA plugin
26+
atlassian-ide-plugin.xml
27+
28+
# Crashlytics plugin (for Android Studio and IntelliJ)
29+
com_crashlytics_export_strings.xml
30+
crashlytics.properties
31+
crashlytics-build.properties
32+
33+
# Build
34+
build/
35+
node_modules/

Diff for: .nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v5.6.0

Diff for: LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 Brian Retterer.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

Diff for: Makefile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
identifier=com.bretterer.paw.GithubActionsSecretDynamicValue
2+
extensions_dir=$(HOME)/Library/Containers/com.luckymarmot.Paw/Data/Library/Application Support/com.luckymarmot.Paw/Extensions/
3+
4+
build:
5+
npm run build
6+
cp README.md LICENSE ./build/$(identifier)/
7+
8+
clean:
9+
rm -Rf ./build/
10+
11+
install: clean build
12+
mkdir -p "$(extensions_dir)$(identifier)/"
13+
cp -R ./build/$(identifier)/* "$(extensions_dir)$(identifier)/"
14+
15+
test:
16+
npm test
17+
18+
archive: build
19+
cd ./build/; zip -r GithubActionsSecretDynamicValue.zip "$(identifier)/"

Diff for: README.md

Whitespace-only changes.

Diff for: package.json

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "@bretterer/pawGithubActionsSecretDynamicValue",
3+
"version": "1.0.0-alpha.1",
4+
"description": "Github Actions Secret Encryption Dynamic Value Plugin for Paw.cloud",
5+
"main": "src/GithubActionsSecretDynamicValue.js",
6+
"author": "Brian Retterer",
7+
"license": "MIT",
8+
"dependencies": {
9+
"babel-plugin-transform-flow-strip-types": "6.3.15",
10+
"babel-polyfill": "6.3.14",
11+
"babel-runtime": "6.3.19",
12+
"randombytes": "^2.1.0",
13+
"tweetsodium": "^0.0.5"
14+
},
15+
"devDependencies": {
16+
"babel-core": "6.4.0",
17+
"babel-loader": "6.2.0",
18+
"babel-plugin-rewire": "1.0.0-beta-3",
19+
"babel-plugin-transform-decorators": "6.3.13",
20+
"babel-plugin-transform-decorators-legacy": "1.3.2",
21+
"babel-plugin-transform-runtime": "6.3.13",
22+
"babel-preset-es2015": "6.3.13",
23+
"babel-preset-stage-0": "6.3.13",
24+
"babel-preset-stage-1": "6.3.13",
25+
"babel-preset-stage-2": "6.3.13",
26+
"babel-preset-stage-3": "6.3.13",
27+
"babel-register": "6.3.13",
28+
"chai": "3.4.1",
29+
"mocha": "2.3.4",
30+
"path": "0.12.7",
31+
"webpack": "1.12.9"
32+
},
33+
"scripts": {
34+
"build": "rm -rf dist/ && BUILD_ENV=build ./node_modules/.bin/webpack --bail --display-error-details"
35+
},
36+
"options": {
37+
"mocha": "./node_modules/.bin/mocha --require mocha --compilers js:babel-register --reporter spec"
38+
},
39+
"repository": {
40+
"type": "git",
41+
"url": "[email protected]:bretterer/Paw-LibSodiumDynamicValue.git"
42+
}
43+
}

Diff for: src/GithubActionsSecretDynamicValue.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const sodium = require('tweetsodium');
2+
const randomBytes = require('randombytes');
3+
const nacl = require('tweetnacl');
4+
5+
@registerDynamicValueClass
6+
class GithubActionsSecretDynamicValue {
7+
static identifier = 'com.bretterer.paw.GithubActionsSecretDynamicValue'
8+
static title = 'Github Actions Secret'
9+
static help = 'https://github.com/bretterer/paw-GithubActionsSecretDynamicValue'
10+
static inputs = [
11+
InputField("publicKey", "Public Key", "String", {persisted: true}),
12+
InputField("secret", "Secret", "String"),
13+
]
14+
15+
evaluate(context) {
16+
nacl.setPRNG(function(x, n) {
17+
x = randomBytes(n);
18+
return x;
19+
});
20+
const messageBytes = Buffer.from(this.secret);
21+
const keyBytes = Buffer.from(this.publicKey, 'base64');
22+
23+
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
24+
return Buffer.from(encryptedBytes).toString('base64');
25+
26+
}
27+
}
28+

Diff for: webpack.config.babel.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import webpack from 'webpack'
2+
import path from 'path'
3+
4+
const name = 'GithubActionsSecretDynamicValue'
5+
6+
const production = process.env.NODE_ENV === 'production'
7+
8+
const config = {
9+
target: 'web',
10+
entry: [
11+
'./src/GithubActionsSecretDynamicValue.js'
12+
],
13+
output:{
14+
path: path.join(__dirname,
15+
'./build/com.bretterer.paw.GithubActionsSecretDynamicValue'),
16+
pathInfo: true,
17+
publicPath: '/build/',
18+
filename: name+'.js'
19+
},
20+
module: {
21+
loaders: [
22+
{
23+
loader: 'babel-loader',
24+
include: [
25+
path.resolve(__dirname, 'src'),
26+
],
27+
test: /\.jsx?$/,
28+
}
29+
]
30+
}
31+
}
32+
module.exports = config

0 commit comments

Comments
 (0)