Skip to content

Commit

Permalink
Merge pull request #149 from aion-dk/oset-integration
Browse files Browse the repository at this point in the history
Oset integration
  • Loading branch information
av-mads authored Mar 16, 2022
2 parents 04d6380 + c51d766 commit 6a35d0e
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 113 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# AV Client Library Changelog

## 1.0.1
* Remove jsonwebtoken package
* Verifier UX improvements

## 1.0.0
* Support new DBB structure

## 0.1.14
* Auth token replaces registration token and session token.

Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ RUN apk add curl

COPY package*.json ./

COPY ./dist/bundle.js ./public/

RUN npm install

COPY . .
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ services:
js-client:
image: "js-client:latest"
command: "npm run server"
volumes:
- ".:/usr/src/app"
ports:
- "3005:3005"
4 changes: 2 additions & 2 deletions lib/av_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as NistConverter from './util/nist_converter';
import { constructBallotCryptograms } from './av_client/actions/construct_ballot_cryptograms';
import { KeyPair, CastVoteRecord, Affidavit, VerifierItem, CommitmentOpening, SpoilRequestItem } from './av_client/types';
import { randomKeyPair } from './av_client/generate_key_pair';
import * as jwt from 'jsonwebtoken';
import * as jwt from 'jose';


import {
Expand Down Expand Up @@ -211,7 +211,7 @@ export class AVClient implements IAVClient {

const { authToken } = authorizationResponse.data;

const decoded = jwt.decode(authToken); // TODO: Verify against dbb pubkey: this.getElectionConfig().services.voterAuthorizer.public_key);
const decoded = jwt.decodeJwt(authToken); // TODO: Verify against dbb pubkey: this.getElectionConfig().services.voterAuthorizer.public_key);

if(decoded === null)
throw new InvalidTokenError('Auth token could not be decoded');
Expand Down
115 changes: 12 additions & 103 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aion-dk/js-client",
"version": "0.1.14",
"version": "1.0.1",
"license": "MIT",
"description": "Assembly Voting JS client",
"main": "dist/lib/av_client.js",
Expand All @@ -25,9 +25,8 @@
"node": ">=14.17.0"
},
"dependencies": {
"@types/jsonwebtoken": "^8.5.8",
"axios": "^0.25.0",
"jsonwebtoken": "^8.5.1",
"jose": "^4.6.0",
"xml-js": "^1.6.11"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h2>Step-by-Step Instructions</h1>
<div class="text-center mb-4">
<h2 class="h3 mb-3 font-weight-normal">Ballot found!</h2>
</div>

<p id="verification-code"></p>
<div class="form-label-group">
<p>Does the passkey displayed above match the passkey displayed in the Mark.It app? Tap <b>Yes</b> or <b>No</b> in the Mark.It app.</p>
<p>Your unsealed ballot will then display below.</p>
Expand All @@ -81,7 +81,7 @@ <h2 class="h3 mb-3 font-weight-normal">Ballot</h2>

<script src="./files/jquery-3.6.0.min.js"></script>
<script src="./files/bootstrap.min.js"></script>
<script src="../dist/bundle.js"></script>
<script src="./bundle.js"></script>
<script src="./files/app.js"></script>
</body>
</html>
4 changes: 3 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const path = require('path');
module.exports = {
entry: './dist/lib/av_verifier.js',
resolve: {
fallback: {"crypto": false}
fallback: {
"crypto": false
}
},
optimization: {
minimize: false,
Expand Down

0 comments on commit 6a35d0e

Please sign in to comment.