Skip to content

Commit

Permalink
Merge pull request #152 from mountaindude/33
Browse files Browse the repository at this point in the history
33
  • Loading branch information
mountaindude authored Jun 4, 2024
2 parents 0d5d537 + 873e5fa commit 3edd63f
Show file tree
Hide file tree
Showing 7 changed files with 251 additions and 231 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Show github.ref
run: echo "$GITHUB_REF"

- uses: google-github-actions/release-please-action@v4
- uses: googleapis/release-please-action@v4
id: release
if: |
github.repository_owner == 'ptarmiganlabs'
Expand Down
9 changes: 8 additions & 1 deletion lib/create-qscloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,14 @@ const jwtCreateQscloud = async (options) => {
signingOptions
);
logger.info(`Created JWT:`);
logger.info(token);

// Should normal or minimal output be used?
if (options?.minimalOutput === true) {
// eslint-disable-next-line no-console
console.log(token);
} else {
logger.info(token);
}

return true;
} catch (err) {
Expand Down
9 changes: 8 additions & 1 deletion lib/create-qseow.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,14 @@ const jwtCreateQseow = async (options) => {
signingOptions
);
logger.info(`Created JWT:`);
logger.info(token);

// Should normal or minimal output be used?
if (options?.minimalOutput === true) {
// eslint-disable-next-line no-console
console.log(token);
} else {
logger.info(token);
}

return true;
} catch (err) {
Expand Down
438 changes: 219 additions & 219 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"homepage": "https://github.com/ptarmiganlabs/qs-jwt#readme",
"dependencies": {
"commander": "^12.0.0",
"commander": "^12.1.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -37,12 +37,12 @@
"jsonwebtoken": "^9.0.2",
"node-forge": "^1.3.1",
"uid-safe": "^2.1.5",
"winston": "^3.12.0",
"winston": "^3.13.0",
"yargs": "^17.7.2"
},
"devDependencies": {
"prettier": "^3.2.5",
"esbuild": "^0.20.0",
"snyk": "^1.1280.0"
"esbuild": "^0.21.4",
"prettier": "^3.3.0",
"snyk": "^1.1291.1"
}
}
12 changes: 10 additions & 2 deletions qs-jwt.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const program = new Command();
})
.addOption(
new Option('--loglevel <level>', 'Logging level')
.choices(['error', 'warning', 'info', 'verbose', 'debug'])
.choices(['error', 'warn', 'info', 'verbose', 'debug'])
.default('info')
)
.requiredOption(
Expand Down Expand Up @@ -87,6 +87,10 @@ const program = new Command();
'--cert-create-expires-days <days>',
'Number of days the new certificate should be valid for'
).argParser(parseInt)
)
.option(
'--minimal-output',
'Output only the JWT token, without any additional info. Useful with log level warn or error'
);

// -----------------------------
Expand All @@ -107,7 +111,7 @@ const program = new Command();
})
.addOption(
new Option('--loglevel <level>', 'Logging level')
.choices(['error', 'warning', 'info', 'verbose', 'debug'])
.choices(['error', 'warn', 'info', 'verbose', 'debug'])
.default('info')
)
.requiredOption('--useremail <email>', 'Email address that will be embedded in the JWT')
Expand Down Expand Up @@ -152,6 +156,10 @@ const program = new Command();
'--cert-create-expires-days <days>',
'Number of days the new certificate should be valid for'
).argParser(parseInt)
)
.option(
'--minimal-output',
'Output only the JWT token, without any additional info. Useful with log level warn or error'
);

// Parse command line params
Expand Down
2 changes: 0 additions & 2 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"last-release-sha": "7828bb09902df27b1133987a96f746d795055212",
"release-as": "1.11.6",
"release-type": "node",
"draft": true,
"release-search-depth": 10,
Expand Down

0 comments on commit 3edd63f

Please sign in to comment.