Skip to content

Commit 251f863

Browse files
Merge pull-request #111
2 parents 80a784b + 4d4ddbf commit 251f863

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+8000
-4636
lines changed

.eslintignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Vendored files
2+
noble-hashes.js
3+
noble-ed25519.js
4+
hpke-core.js
5+
6+
# Built
7+
dist/
8+
build/
9+
out/
10+
*.min.js
11+
*.min.css
12+
*.bundle.js
13+
coverage/
14+
.next/
15+
.cache/
16+
node_modules/
17+

.eslintrc.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true,
6+
"jest": true
7+
},
8+
"extends": ["eslint:recommended"],
9+
"parserOptions": {
10+
"ecmaVersion": "latest",
11+
"sourceType": "module"
12+
},
13+
"rules": {
14+
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
15+
"no-console": "warn"
16+
}
17+
}
18+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: "Git check"
2+
description: "Git sanity checks"
3+
4+
runs:
5+
using: "composite"
6+
7+
steps:
8+
- name: Is Git clean?
9+
run: |
10+
if [ -z "$( git status --porcelain )" ]; then
11+
echo "Git is clean!"
12+
exit 0
13+
else
14+
echo "Git is dirty!"
15+
git add -A
16+
git --no-pager diff HEAD
17+
exit 1
18+
fi
19+
shell: bash

.github/workflows/ci.yml

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Install Node.js
3030
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
3131
with:
32-
node-version: 18
32+
node-version: 20
3333

3434
- name: Install Dependencies for ${{ matrix.directory }}
3535
working-directory: ./${{ matrix.directory }}
@@ -42,3 +42,98 @@ jobs:
4242
- name: Run Tests for ${{ matrix.directory }}
4343
working-directory: ./${{ matrix.directory }}
4444
run: npm test
45+
46+
format:
47+
runs-on: ubuntu-latest
48+
strategy:
49+
fail-fast: false
50+
matrix:
51+
directory:
52+
[
53+
'auth',
54+
'export',
55+
'import',
56+
'export-and-sign',
57+
'oauth-origin',
58+
'oauth-redirect',
59+
]
60+
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
64+
65+
- name: Install Node.js
66+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
67+
with:
68+
node-version: 20
69+
70+
- name: Install Dependencies for ${{ matrix.directory }}
71+
working-directory: ./${{ matrix.directory }}
72+
run: npm install
73+
74+
- name: Run Prettier Check for ${{ matrix.directory }}
75+
working-directory: ./${{ matrix.directory }}
76+
run: npm run prettier:check
77+
78+
lint:
79+
runs-on: ubuntu-latest
80+
strategy:
81+
fail-fast: false
82+
matrix:
83+
directory:
84+
[
85+
'auth',
86+
'export',
87+
'import',
88+
'export-and-sign',
89+
'oauth-origin',
90+
'oauth-redirect',
91+
]
92+
93+
steps:
94+
- name: Checkout
95+
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
96+
97+
- name: Install Node.js
98+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
99+
with:
100+
node-version: 20
101+
102+
- name: Install Dependencies for ${{ matrix.directory }}
103+
working-directory: ./${{ matrix.directory }}
104+
run: npm install
105+
106+
- name: Run ESLint for ${{ matrix.directory }}
107+
working-directory: ./${{ matrix.directory }}
108+
run: npm run lint
109+
110+
build-check:
111+
runs-on: ubuntu-latest
112+
strategy:
113+
fail-fast: false
114+
matrix:
115+
directory:
116+
[
117+
'import',
118+
'export-and-sign',
119+
]
120+
121+
steps:
122+
- name: Checkout
123+
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
124+
125+
- name: Install Node.js
126+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
127+
with:
128+
node-version: 20
129+
130+
- name: Install Dependencies for ${{ matrix.directory }}
131+
working-directory: ./${{ matrix.directory }}
132+
run: npm install
133+
134+
- name: Build ${{ matrix.directory }}
135+
working-directory: ./${{ matrix.directory }}
136+
run: npm run build
137+
138+
- name: Check dist folder matches committed version
139+
uses: ./.github/actions/build-check

auth/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,14 +1213,16 @@ <h2>Message log</h2>
12131213
}
12141214

12151215
var embeddedKeyJwk = await TKHQ.getEmbeddedKey();
1216-
1216+
12171217
// If the embedded key is not initialized or not available, reset it
1218-
if (!(window.isInitEmbeddedKeyRunByDomContentLoaded && embeddedKeyJwk)) {
1218+
if (
1219+
!(window.isInitEmbeddedKeyRunByDomContentLoaded && embeddedKeyJwk)
1220+
) {
12191221
await TKHQ.resetEmbeddedKey();
12201222
document.getElementById("embedded-key").value = "";
12211223
await TKHQ.initEmbeddedKey(iframeKeyTtl);
12221224
}
1223-
1225+
12241226
// Re-fetch embedded key
12251227
embeddedKeyJwk = await TKHQ.getEmbeddedKey();
12261228
var targetPubBuf = await TKHQ.p256JWKPrivateToPublic(

0 commit comments

Comments
 (0)