@opengovsg/mockpass 4.3.2 → 4.3.3
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/.github/workflows/publish.yml +46 -0
- package/README.md +1 -1
- package/eslint.config.mjs +24 -0
- package/lib/express/myinfo/consent.js +1 -7
- package/package.json +5 -2
- package/.github/workflows/npmpublish.yml +0 -24
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [created]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish-npm:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- uses: actions/setup-node@v3
|
|
13
|
+
with:
|
|
14
|
+
node-version: 'lts/*'
|
|
15
|
+
cache: 'npm'
|
|
16
|
+
cache-dependency-path: '**/package-lock.json'
|
|
17
|
+
registry-url: https://registry.npmjs.org/
|
|
18
|
+
- run: npm ci
|
|
19
|
+
- run: npm publish --access public
|
|
20
|
+
env:
|
|
21
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
22
|
+
publish-docker:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
- uses: actions/setup-node@v3
|
|
27
|
+
with:
|
|
28
|
+
node-version: 'lts/*'
|
|
29
|
+
cache: 'npm'
|
|
30
|
+
cache-dependency-path: '**/package-lock.json'
|
|
31
|
+
registry-url: https://registry.npmjs.org/
|
|
32
|
+
- name: Set up Docker Buildx
|
|
33
|
+
uses: docker/setup-buildx-action@v3
|
|
34
|
+
- name: Login to Docker Hub
|
|
35
|
+
uses: docker/login-action@v3
|
|
36
|
+
with:
|
|
37
|
+
username: ${{ secrets.DOCKER_USER }}
|
|
38
|
+
password: ${{ secrets.DOCKER_PASS }}
|
|
39
|
+
- run: echo TAGNAME=`echo ${{ github.ref_name }} | sed 's/v//'` >> ${GITHUB_ENV}
|
|
40
|
+
- name: Build and push
|
|
41
|
+
uses: docker/build-push-action@v6
|
|
42
|
+
with:
|
|
43
|
+
push: true
|
|
44
|
+
tags: |
|
|
45
|
+
opengovsg/mockpass:latest
|
|
46
|
+
opengovsg/mockpass:${{ env.TAGNAME }}
|
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ succeed, using other NRICs will result in an error. See the list of personas in
|
|
|
90
90
|
|
|
91
91
|
| Configuration item | Explanation |
|
|
92
92
|
|---|---|
|
|
93
|
-
| Client certificate | **Overview:** When client makes any request, what certificate is used to verify the request signature, and what certificate is used to encrypt the data payload. <br> **Default:** static certificate/key `static/certs/(server.crt
|
|
93
|
+
| Client certificate | **Overview:** When client makes any request, what certificate is used to verify the request signature, and what certificate is used to encrypt the data payload. <br> **Default:** static certificate/key `static/certs/(server.crt\|key.pub)` are used. <br> **How to configure:** Set the env var `SERVICE_PROVIDER_PUB_KEY` to the path to a public key PEM file, and `SERVICE_PROVIDER_CERT_PATH` to the path to a certificate PEM file. (A certificate PEM file can also be provided to `SERVICE_PROVIDER_PUB_KEY`, despite the env var name.) |
|
|
94
94
|
| Client secret | **Overview:** When client makes a Token request, whether MockPass verifies the request signature. <br> **Default:** Disabled. <br> **How to configure:** Enable for all requests by setting the env var `SERVICE_PROVIDER_MYINFO_SECRET` to some non-blank string. Provide this value to your application as well. |
|
|
95
95
|
| Payload encryption | **Overview:** When client makes a Person or Person-Basic request, whether MockPass encrypts the data payload. When client makes a Person request, whether MockPass verifies the request signature. <br> **Default:** Disabled. <br> **How to configure:** Enable for all requests by setting the env var `ENCRYPT_MYINFO` to `true`. |
|
|
96
96
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import globals from "globals";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import js from "@eslint/js";
|
|
5
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
const compat = new FlatCompat({
|
|
10
|
+
baseDirectory: __dirname,
|
|
11
|
+
recommendedConfig: js.configs.recommended,
|
|
12
|
+
allConfig: js.configs.all
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default [...compat.extends("eslint:recommended", "plugin:prettier/recommended"), {
|
|
16
|
+
languageOptions: {
|
|
17
|
+
globals: {
|
|
18
|
+
...globals.node,
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
ecmaVersion: 2020,
|
|
22
|
+
sourceType: "commonjs",
|
|
23
|
+
},
|
|
24
|
+
}];
|
|
@@ -20,13 +20,7 @@ const CONSENT_TEMPLATE = fs.readFileSync(
|
|
|
20
20
|
const authorizations = {}
|
|
21
21
|
|
|
22
22
|
const authorize = (redirectTo) => (req, res) => {
|
|
23
|
-
const {
|
|
24
|
-
client_id, // eslint-disable-line camelcase
|
|
25
|
-
redirect_uri, // eslint-disable-line camelcase
|
|
26
|
-
attributes,
|
|
27
|
-
purpose,
|
|
28
|
-
state,
|
|
29
|
-
} = req.query
|
|
23
|
+
const { client_id, redirect_uri, attributes, purpose, state } = req.query
|
|
30
24
|
const relayStateParams = qs.stringify({
|
|
31
25
|
client_id,
|
|
32
26
|
redirect_uri,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengovsg/mockpass",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.3",
|
|
4
4
|
"description": "A mock SingPass/CorpPass server for dev purposes",
|
|
5
5
|
"main": "app.js",
|
|
6
6
|
"bin": {
|
|
@@ -53,11 +53,14 @@
|
|
|
53
53
|
"@commitlint/cli": "^19.1.0",
|
|
54
54
|
"@commitlint/config-conventional": "^19.0.3",
|
|
55
55
|
"@commitlint/travis-cli": "^19.0.3",
|
|
56
|
+
"@eslint/eslintrc": "^3.1.0",
|
|
57
|
+
"@eslint/js": "^9.8.0",
|
|
56
58
|
"commitizen": "^4.2.4",
|
|
57
59
|
"cz-conventional-changelog": "^3.2.0",
|
|
58
|
-
"eslint": "^8.0
|
|
60
|
+
"eslint": "^9.8.0",
|
|
59
61
|
"eslint-config-prettier": "^9.1.0",
|
|
60
62
|
"eslint-plugin-prettier": "^4.0.0",
|
|
63
|
+
"globals": "^15.9.0",
|
|
61
64
|
"husky": "^9.0.11",
|
|
62
65
|
"lint-staged": "^15.2.2",
|
|
63
66
|
"nodemon": "^3.0.1",
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Node.js Package
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
release:
|
|
8
|
-
types: [created]
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
publish-npm:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v4
|
|
15
|
-
- uses: actions/setup-node@v3
|
|
16
|
-
with:
|
|
17
|
-
node-version: 'lts/*'
|
|
18
|
-
cache: 'npm'
|
|
19
|
-
cache-dependency-path: '**/package-lock.json'
|
|
20
|
-
registry-url: https://registry.npmjs.org/
|
|
21
|
-
- run: npm ci
|
|
22
|
-
- run: npm publish --access public
|
|
23
|
-
env:
|
|
24
|
-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|