Skip to content
This repository was archived by the owner on May 12, 2020. It is now read-only.
Open
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
3 changes: 2 additions & 1 deletion .electron-vue/webpack.main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ let mainConfig = {
main: path.join(__dirname, '../src/main/index.js')
},
externals: [
...Object.keys(dependencies || {})
...Object.keys(dependencies || {}),
{'electron-debug': 'electron-debug'}
],
module: {
rules: [
Expand Down
33 changes: 25 additions & 8 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

<!-- webpack builds are automatically injected -->
</body>
</html>
</html>
4 changes: 2 additions & 2 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ function createWindow () {
* Initial window options
*/
mainWindow = new BrowserWindow({
height: 563,
height: 600,
useContentSize: true,
width: 300//900
width: 350//900
});

mainWindow.loadURL(winURL);
Expand Down
7 changes: 7 additions & 0 deletions src/renderer/components/AgentBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ export default {
this.connection.send_message(msg);
},
async processInbound(msg){
// RFC 0348 Step 1: modify prefix (if present) to old standard
let OLD = "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/";
let NEW = "https://didcomm.org/";
if(msg['@type'].startsWith(NEW)){
msg['@type'] = msg['@type'].replace(NEW, OLD);
}
// END RFC 0348 Step 1
this.$message_bus.$emit('message-received', msg);
this.$message_bus.$emit(msg['@type'], msg);
},
Expand Down
74 changes: 35 additions & 39 deletions src/renderer/components/AgentList.vue
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
<template>
<div id="wrapper" class="container-fluid">

<el-row>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Agent Toolbox</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">New Connection</a>
</li>
</ul>
</div>
<a class="navbar-brand" href="#">Aries Toolbox</a>
</nav>

<div class="card" style="" v-for="a in agent_list">
<div class="card-body">
<h5 class="card-title">{{a.label}}</h5>
<a href="#" class="card-link" v-on:click="openConnection(a)">Connect</a>
<a href="#" class="card-link">Edit</a>
<a href="#" class="card-link" v-on:click="deleteConnection(a)">Delete</a>
<el-card shadow="never" class="agent-card" v-for="a in agent_list">
<span slot="header"><strong>{{a.label}}</strong></span>
<div>
<el-button type="text" @click="openConnection(a)">Open</el-button>
<el-button type="text" @click="deleteConnection(a)">Delete</el-button>
</div>
</div>
</el-card>

<div class="card">
<div class="card-header">
New Agent Connection
<el-card shadow="never" id="new_agent_connection">
<span slot="header">New Agent Connection</span>
<div>
<el-form :inline="true">
<el-input v-model="new_agent_invitation" placeholder="Paste agent invitation"></el-input>
<el-button type="primary" @click="new_agent_invitation_process">Connect</el-button>
</el-form>
</div>
<div class="card-body">
<input type="text" class="form-control" placeholder="Paste Agent Invite" v-model="new_agent_invitation"/>
<input type="button" class="btn btn-secondary" v-on:click="new_agent_invitation_process()" value="Add"/>
</div>
</div>

</div>
</el-card>
</el-row>
</template>

<style>
.agent-card:first-of-type {
margin-top: .5em;
}
.agent-card, #new_agent_connection {
margin: .5em 1em;
border: 1px solid rgba(0, 0, 0, 0.125);
}
.agent-card .el-card__header,
#new_agent_connection .el-card__header {
padding: .75rem 1.25rem;
background-color: rgba(0, 0, 0, 0.03);
border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}
.agent-card .el-card__body {
padding: 0 1em;
}
</style>

<script>
const electron = require('electron');
Expand Down Expand Up @@ -200,12 +205,6 @@ export default {
toolbox_did.privateKey_b58 = bs58.encode(Buffer.from(toolbox_did.privateKey));
console.log("new pair", toolbox_did);

//const bob = await didcomm.generateKeyPair()
//const message = 'I AM A PRIVATE MESSAGE'
//const packedMsg = await didcomm.pack_auth_msg_for_recipients(message, [bob.publicKey], alice, true)
//const unpackedMsg = await didcomm.unpackMessage(packedMsg, bob)
//create connection request

var req = {
"@id": (uuidv4().toString()),
"~transport": {
Expand Down Expand Up @@ -284,6 +283,3 @@ export default {
}
}
</script>

<style>
</style>
2 changes: 1 addition & 1 deletion src/renderer/components/MyCredentials/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default {
let query_msg = {
"@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/admin-holder/0.1/send-credential-proposal",
"connection_id": form.connection_id,
"cred_def_id": form.cred_def_id,
"credential_definition_id": form.cred_def_id,
"comment": form.comment, //optional
"credential_proposal": {
"@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/credential-preview",
Expand Down
25 changes: 15 additions & 10 deletions src/renderer/components/Verifications/Verification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<el-collapse-item
v-if="presentations.length"
v-for="presentation in presentations"
v-bind:title="presentation.connection_their_label + ' ' + presentation.presentation_exchange_id"
v-bind:title="presentation_title(presentation)"
:name="presentation.presentation_exchange_id"
:key="presentation.presentation_exchange_id">
<el-row>
Expand Down Expand Up @@ -208,6 +208,7 @@

<script>
import VueJsonPretty from 'vue-json-pretty';
import share from '@/share.js';

export default {
name: 'verification',
Expand All @@ -219,6 +220,7 @@ export default {
'cred_defs',
'trusted_issuers'
],
mixins: [share({use: ['id_to_connection']})],
components: {
VueJsonPretty,
},
Expand Down Expand Up @@ -285,23 +287,26 @@ export default {
return map;
},
presentations: function() {
let joinedPresentationsConnections = this.list.map((item) => {
var index = this.connections.map(function(x) {return x.connection_id; }).indexOf(item.connection_id);
var objectFound = this.connections[index];
if (index >= 0) {
item.connection_their_label = this.connections[index].their_label
}else{
return this.list.map((item) => {
if (item.connection_id in this.id_to_connection) {
item.connection_their_label = this.id_to_connection[item.connection_id].their_label;
} else {
item.connection_their_label = "deleted connetion"
}
return item;
},{})
return joinedPresentationsConnections;
if ('presentation' in item && 'proof' in item.presentation) {
delete item.presentation.proof;
}
return item;
});
},
completed_verifications: function() {
return this.list.filter(pres_exch => pres_exch.state === 'verified');
}
},
methods: {
presentation_title: function(presentation) {
return presentation.presentation_request.name + ' requested from ' + presentation.connection_their_label;
},
collapse_expanded: function(creddef) {
this.expanded_items = this.expanded_items.filter(
item => item != creddef.presentation_exchange_id
Expand Down
6 changes: 6 additions & 0 deletions src/renderer/components/Verifications/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ export default {
if (attribute.restrictions.trusted_issuer) {
transmuted_attr.restrictions[0].issuer_did = attribute.restrictions.trusted_issuer;
}
if (transmuted_attr.restrictions.length < 1) {
delete transmuted_attr.restrictions;
}
acc[attribute.name] = transmuted_attr;
return acc;
}, {}),
Expand All @@ -115,6 +118,9 @@ export default {
if (predicate.restrictions.trusted_issuer) {
transmuted_pred.restrictions[0].issuer_did = predicate.restrictions.trusted_issuer;
}
if (transmuted_pred.restrictions.length < 1) {
delete transmuted_pred.restrictions;
}
acc[predicate.name] = transmuted_pred;
return acc;
}, {}),
Expand Down