Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Vendored files
noble-hashes.js
noble-ed25519.js
hpke-core.js

# Built
dist/
build/
out/
*.min.js
*.min.css
*.bundle.js
coverage/
.next/
.cache/
node_modules/

18 changes: 18 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true,
"jest": true
},
"extends": ["eslint:recommended"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"no-console": "warn"
}
}

19 changes: 19 additions & 0 deletions .github/actions/build-check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Git check"
description: "Git sanity checks"

runs:
using: "composite"

steps:
- name: Is Git clean?
run: |
if [ -z "$( git status --porcelain )" ]; then
echo "Git is clean!"
exit 0
else
echo "Git is dirty!"
git add -A
git --no-pager diff HEAD
exit 1
fi
shell: bash
97 changes: 96 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version: 18
node-version: 20

- name: Install Dependencies for ${{ matrix.directory }}
working-directory: ./${{ matrix.directory }}
Expand All @@ -42,3 +42,98 @@ jobs:
- name: Run Tests for ${{ matrix.directory }}
working-directory: ./${{ matrix.directory }}
run: npm test

format:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
directory:
[
'auth',
'export',
'import',
'export-and-sign',
'oauth-origin',
'oauth-redirect',
]

steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2

- name: Install Node.js
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version: 20

- name: Install Dependencies for ${{ matrix.directory }}
working-directory: ./${{ matrix.directory }}
run: npm install

- name: Run Prettier Check for ${{ matrix.directory }}
working-directory: ./${{ matrix.directory }}
run: npm run prettier:check

lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
directory:
[
'auth',
'export',
'import',
'export-and-sign',
'oauth-origin',
'oauth-redirect',
]

steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2

- name: Install Node.js
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version: 20

- name: Install Dependencies for ${{ matrix.directory }}
working-directory: ./${{ matrix.directory }}
run: npm install

- name: Run ESLint for ${{ matrix.directory }}
working-directory: ./${{ matrix.directory }}
run: npm run lint

build-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
directory:
[
'import',
'export-and-sign',
]

steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2

- name: Install Node.js
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version: 20

- name: Install Dependencies for ${{ matrix.directory }}
working-directory: ./${{ matrix.directory }}
run: npm install

- name: Build ${{ matrix.directory }}
working-directory: ./${{ matrix.directory }}
run: npm run build

- name: Check dist folder matches committed version
uses: ./.github/actions/build-check
8 changes: 5 additions & 3 deletions auth/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1213,14 +1213,16 @@ <h2>Message log</h2>
}

var embeddedKeyJwk = await TKHQ.getEmbeddedKey();

// If the embedded key is not initialized or not available, reset it
if (!(window.isInitEmbeddedKeyRunByDomContentLoaded && embeddedKeyJwk)) {
if (
!(window.isInitEmbeddedKeyRunByDomContentLoaded && embeddedKeyJwk)
) {
await TKHQ.resetEmbeddedKey();
document.getElementById("embedded-key").value = "";
await TKHQ.initEmbeddedKey(iframeKeyTtl);
}

// Re-fetch embedded key
embeddedKeyJwk = await TKHQ.getEmbeddedKey();
var targetPubBuf = await TKHQ.p256JWKPrivateToPublic(
Expand Down
Loading
Loading