Skip to content

Commit

Permalink
intermedite commit
Browse files Browse the repository at this point in the history
Signed-off-by: F-Node-Karlsruhe <christian.fries@eecc.de>
  • Loading branch information
F-Node-Karlsruhe committed Nov 2, 2023
1 parent ee48e67 commit 453e7c0
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/src/services/documentLoader/context/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { statusList2021Context } from "./status-list-2021";
import { statusList2021Context } from "./status-list-2021.js";

export const contexts = new Map([
['https://w3id.org/vc/status-list/2021/v1', statusList2021Context]
Expand Down
18 changes: 16 additions & 2 deletions frontend/package-lock.json

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

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"bootstrap": "^5.2.3",
"bootstrap-icons": "^1.9.1",
"export-from-json": "^1.7.0",
"jose": "^4.15.4",
"jshashes": "^1.0.8",
"jsonld": "^8.1.0",
"pdfmake": "^0.2.7",
Expand Down Expand Up @@ -61,4 +62,4 @@
"sass": "^1.32.7",
"sass-loader": "^12.0.0"
}
}
}
14 changes: 14 additions & 0 deletions frontend/src/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import jsonld from 'jsonld';
import { demoAuthPresentation } from './store/demoAuth';
import { decodeProtectedHeader } from "jose";

export const VerifiableType = {
CREDENTIAL: 'VerifiableCredential',
Expand Down Expand Up @@ -43,6 +44,19 @@ export function getHolder(presentation) {
return proof.verificationMethod.split('#')[0];
}

export function SDJWTtoVP(jwt) {
console.log(jwt)
const decodedHeader = decodeProtectedHeader(jwt)
//const decodedJWT = decodeJwt(jwt)
console.log(decodedHeader)
//console.log(decodedJWT)
return {
jwt,
type: [VerifiableType.PRESENTATION],
holder: decodedHeader.kid.split('#')[0]
}
}

export async function fetchIPFS(IPFSUrl) {

var document;
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/views/Entry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<script>
import { Tooltip } from "bootstrap";
import { useToast } from "vue-toastification";
import { SDJWTtoVP } from "../utils.js"
import AuthModal from "@/components/AuthModal.vue";
import ScanModal from "@/components/ScanModal.vue"
Expand Down Expand Up @@ -117,7 +118,7 @@ export default {
})
else new Response(file).text().then(text => {
this.$store.dispatch("addVerifiables", [{ jwt: text }]);
this.$store.dispatch("addVerifiables", [SDJWTtoVP(text)]);
})
})
Expand Down
1 change: 1 addition & 0 deletions frontend/src/views/Verify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ export default {
return
} catch (error) {
console.log(error)
this.toast.error(error.response ? error.response.data : `Something went wrong verifying the credentials!\n${error}`);
}
Expand Down

0 comments on commit 453e7c0

Please sign in to comment.