Skip to content

Commit 501da50

Browse files
authored
Merge pull request #430 from MatrixAI/feature-secrets-env-egress-schema
Implementing `secrets env` egress schema
2 parents b72e05b + e0b9eed commit 501da50

File tree

9 files changed

+796
-42
lines changed

9 files changed

+796
-42
lines changed

npmDepsHash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sha256-/SFcicpWX1SFllzmz0acUYxtIV0LuBw1PU32Uk5hLzw=
1+
sha256-q99IFZwwPBR/p2m18c5DOApks12rB779c8rUW160k3g=

package-lock.json

Lines changed: 143 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
"sodium-native": "*"
137137
},
138138
"devDependencies": {
139+
"@apidevtools/json-schema-ref-parser": "^11.9.3",
139140
"@fast-check/jest": "^2.1.1",
140141
"@matrixai/errors": "^2.1.3",
141142
"@matrixai/exec": "^1.0.3",
@@ -149,6 +150,8 @@
149150
"@typescript-eslint/eslint-plugin": "^5.61.0",
150151
"@typescript-eslint/parser": "^5.61.0",
151152
"@yao-pkg/pkg": "^6.4.0",
153+
"ajv": "^8.17.1",
154+
"ajv-formats": "^3.0.1",
152155
"commander": "^8.3.0",
153156
"cross-env": "^7.0.3",
154157
"esbuild": "0.19.4",
@@ -162,7 +165,7 @@
162165
"nexpect": "^0.6.0",
163166
"node-gyp-build": "^4.8.4",
164167
"open": "^10.1.2",
165-
"polykey": "^2.5.0",
168+
"polykey": "^2.6.0",
166169
"shelljs": "^0.8.5",
167170
"shx": "^0.3.4",
168171
"tsx": "^3.12.7",

src/errors.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ class ErrorPolykeyCLIDuplicateEnvName<T> extends ErrorPolykeyCLI<T> {
166166
exitCode = sysexits.USAGE;
167167
}
168168

169+
class ErrorPolykeyCLIMissingRequiredEnvName<T> extends ErrorPolykeyCLI<T> {
170+
static description = 'A required environment variable is not present';
171+
exitCode = sysexits.USAGE;
172+
}
173+
169174
class ErrorPolykeyCLIMakeDirectory<T> extends ErrorPolykeyCLI<T> {
170175
static description = 'Failed to create one or more directories';
171176
exitCode = 1;
@@ -197,10 +202,15 @@ class ErrorPolykeyCLITouchSecret<T> extends ErrorPolykeyCLI<T> {
197202
}
198203

199204
class ErrorPolykeyCLIInvalidJWT<T> extends ErrorPolykeyCLI<T> {
200-
static description: 'JWT is not valid';
205+
static description = 'JWT is not valid';
201206
exitCode = sysexits.USAGE;
202207
}
203208

209+
class ErrorPolykeyCLISchemaInvalid<T> extends ErrorPolykeyCLI<T> {
210+
static description = 'The provided JSON schema is invalid';
211+
exitCode = sysexits.CONFIG;
212+
}
213+
204214
export {
205215
ErrorPolykeyCLI,
206216
ErrorPolykeyCLIUncaughtException,
@@ -223,11 +233,13 @@ export {
223233
ErrorPolykeyCLINodePingFailed,
224234
ErrorPolykeyCLIInvalidEnvName,
225235
ErrorPolykeyCLIDuplicateEnvName,
236+
ErrorPolykeyCLIMissingRequiredEnvName,
226237
ErrorPolykeyCLIMakeDirectory,
227238
ErrorPolykeyCLIRenameSecret,
228239
ErrorPolykeyCLIRemoveSecret,
229240
ErrorPolykeyCLICatSecret,
230241
ErrorPolykeyCLIEditSecret,
231242
ErrorPolykeyCLITouchSecret,
232243
ErrorPolykeyCLIInvalidJWT,
244+
ErrorPolykeyCLISchemaInvalid,
233245
};

0 commit comments

Comments
 (0)