Skip to content

Commit 397ac71

Browse files
committed
Fix formatting issues and add DCO sign-off
Signed-off-by: parth5805 <parthpatel17591759@gmail.com> Signed-off-by: Parth Patel <parthpatel17591759@gmail.com>
1 parent df911c2 commit 397ac71

File tree

134 files changed

+11912
-1954
lines changed

Some content is hidden

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

134 files changed

+11912
-1954
lines changed

AliceFaberAcmeDemo/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ Please see the [Controller](./controllers/README.md) documentation for instructi
9696
If you have made it this far, congratulations! 🎉 You are well on your way to becoming an Aries expert 💪.
9797

9898
You should have the controllers open in three different tabs of your browser:
99+
99100
- Faber at http://localhost:9021 (running with docker) or http://localhost:5001 (running locally)
100101
- Alice at http://localhost:9031 (running with docker) or http://localhost:4200 (running locally)
101102
- Acme at http://localhost:9041 (running with docker) or http://localhost:3000 (running locally)
@@ -109,6 +110,7 @@ Alice 👩 is a former student of Faber College ("Knowledge is Good") 🎓and wa
109110
This part will take you through the specific steps of the Faber-Alice-Acme workflow. Faber, Alice and Acme are each tailored to perform specific functions, as you will see. Throughout every interaction keep in mind that the agents are doing all the work behind the scenes. The controllers are interacting through an API with the agents.
110111

111112
#### 1. Alice graduates from Faber College
113+
112114
_What an auspicious day! The many sleepless nights are over. Alice made it through her program of study and is on her way to a successful career. Faber offers all of their alumni to stay connected by extending an invitation code to all graduating students._
113115

114116
In the Faber browser tab, the home screen should display 4 options to choose from. The `Connections` page is where Faber can view, issue invitations and accept connections.
@@ -129,7 +131,7 @@ Open the Alice browser tab, and on the home screen you will see 3 options to cho
129131

130132
Navigate to the `Accept` tab where you will see the option to either paste the invitation object or the invitation URL (depending on which one you copied). If you are successful the `Accept Invitation` button will activate. Press it.
131133

132-
Navigate over to the `Active` tab to see a connection to Faber. Similarly, Faber's `Active` connections tab will show a connection to Alice.
134+
Navigate over to the `Active` tab to see a connection to Faber. Similarly, Faber's `Active` connections tab will show a connection to Alice.
133135

134136
#### 3. Faber issues a Degree credential to Alice
135137

@@ -146,25 +148,29 @@ When you are ready to issue the credential to Alice press the `Send Credential`
146148
Open the Alice browser tab. In the home screen you will see a `Credentials` option. If Alice successfully received the degree credential from Faber, you will see it here. Notice the different attributes displayed in the credential.
147149

148150
#### 4. Alice applies for a job at Acme
151+
149152
_Alice is super excited to apply for her job. She sends an invitation request to Acme._
150153

151154
See if you can follow the same approach above to connect Faber to Alice. In this case Alice will create a new invitation.
152155

153156
#### 5. Acme agrees to interview Alice
157+
154158
_Acme agrees to connect with Alice._
155159

156160
See if you can follow the same approach above to connect Faber to Alice. In this case, Acme will accept the invitation. Acme has all of the same options in its `Connection` page as Faber and Alice.
157161

158162
If you are successful Alice and Acme will have active connections with each other.
159163

160164
#### 6. Acme requests a proof of education from Alice
165+
161166
_Acme was floored by Alice's resume and interview. They just need her to show a proof of her education (for HR purposes) and they will offer her a job._
162167

163168
Open the Acme browser tab. In the home screen you will see a `Proof Requests` option. Navigate to the `Request Proof` tab. Acme can request a proof from any of their connections. Select the Alice connection. For the Credential Definition ID, you will need to open the Faber browser tab and navigate to the `Credential Definitions` page. Select the credential definition from the list you are interested in receiving a proof for. You will need to copy the `id` which will look something along the lines of
164169

165170
```
166171
vDdXBfpoDSCwTHqwH83AZ:3:CL:138:default
167172
```
173+
168174
_Note: yours will have different numbers and letters but should be structured the same._
169175

170176
Now navigate back to Acme's `Request Proof` page and paste the ID in the `Credential Definition ID` input. Press the `Request Proof` button.

AliceFaberAcmeDemo/controllers/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ There are 3 flavours of controllers each with their own instructions on setup. P
88

99
### Demo Walkthrough
1010

11-
Instructions for the Faber-Alice-Acme demo walkthrough can be viewed [here](../README.md#demo-walkthrough).
11+
Instructions for the Faber-Alice-Acme demo walkthrough can be viewed [here](../README.md#demo-walkthrough).
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
33
{
4-
"name": "Node.js & TypeScript",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm"
4+
"name": "Node.js & TypeScript",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm"
77

8-
// Features to add to the dev container. More info: https://containers.dev/features.
9-
// "features": {},
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
// "features": {},
1010

11-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12-
// "forwardPorts": [],
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
// "forwardPorts": [],
1313

14-
// Use 'postCreateCommand' to run commands after the container is created.
15-
// "postCreateCommand": "yarn install",
14+
// Use 'postCreateCommand' to run commands after the container is created.
15+
// "postCreateCommand": "yarn install",
1616

17-
// Configure tool-specific properties.
18-
// "customizations": {},
17+
// Configure tool-specific properties.
18+
// "customizations": {},
1919

20-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
21-
// "remoteUser": "root"
20+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
21+
// "remoteUser": "root"
2222
}

AliceFaberAcmeDemo/controllers/acme-controller/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Acme Controller
2+
23
Web controller for a Hyperledger Aries Acme CloudAgent
34

45
## Table of Contents
56

67
- [Running Locally](#running-locally)
7-
- [Prerequisites](#prerequisites)
8-
- [Starting the Application](#starting-the-application)
8+
- [Prerequisites](#prerequisites)
9+
- [Starting the Application](#starting-the-application)
910
- [Notes](#notes)
1011

1112
### Prerequisites
@@ -31,4 +32,4 @@ You can now open your browser tab to `localhost:3000` to see the application.
3132

3233
### Notes
3334

34-
_Note: Acme Controller has already been configured to connect to it's agent on localhost:8041. If the controller is not connected to it's agent you will see a red status indicator on the top right-hand side of the navbar. If the agent is successfully connected, you will see a green status indicator._
35+
_Note: Acme Controller has already been configured to connect to it's agent on localhost:8041. If the controller is not connected to it's agent you will see a red status indicator on the top right-hand side of the navbar. If the agent is successfully connected, you will see a green status indicator._
Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,60 @@
1-
var createError = require('http-errors');
2-
const express = require('express');
3-
const path = require('path');
4-
const cookieParser = require('cookie-parser');
5-
const logger = require('morgan');
6-
const { engine } = require('express-handlebars');
7-
const helpers = require('handlebars-helpers');
1+
var createError = require("http-errors");
2+
const express = require("express");
3+
const path = require("path");
4+
const cookieParser = require("cookie-parser");
5+
const logger = require("morgan");
6+
const { engine } = require("express-handlebars");
7+
const helpers = require("handlebars-helpers");
88

9-
const indexRouter = require('./routes/index');
10-
const connectionRouter = require('./routes/connection');
11-
const proofRouter = require('./routes/proof');
9+
const indexRouter = require("./routes/index");
10+
const connectionRouter = require("./routes/connection");
11+
const proofRouter = require("./routes/proof");
1212

1313
const app = express();
1414

1515
// view engine setup
16-
app.set('views', path.join(__dirname, 'views'));
17-
app.set('view engine', 'hbs');
18-
app.engine('hbs', engine({
19-
extname: 'hbs',
20-
defaultView: 'default',
21-
layoutsDir: path.join(__dirname, '/views/layouts/'),
22-
partialsDir: [
23-
path.join(__dirname, '/views/partials'),
24-
path.join(__dirname, '/views/partials/connection'),
25-
path.join(__dirname, '/views/partials/home'),
26-
path.join(__dirname, '/views/partials/proof'),
27-
],
28-
helpers: helpers(['array', 'comparison'])
29-
}));
16+
app.set("views", path.join(__dirname, "views"));
17+
app.set("view engine", "hbs");
18+
app.engine(
19+
"hbs",
20+
engine({
21+
extname: "hbs",
22+
defaultView: "default",
23+
layoutsDir: path.join(__dirname, "/views/layouts/"),
24+
partialsDir: [
25+
path.join(__dirname, "/views/partials"),
26+
path.join(__dirname, "/views/partials/connection"),
27+
path.join(__dirname, "/views/partials/home"),
28+
path.join(__dirname, "/views/partials/proof"),
29+
],
30+
helpers: helpers(["array", "comparison"]),
31+
}),
32+
);
3033

31-
app.use(logger('dev'));
34+
app.use(logger("dev"));
3235
app.use(express.json());
3336
app.use(express.urlencoded({ extended: false }));
3437
app.use(cookieParser());
35-
app.use(express.static(path.join(__dirname, 'public')));
38+
app.use(express.static(path.join(__dirname, "public")));
3639

37-
app.use('/', indexRouter);
38-
app.use('/connections', connectionRouter);
39-
app.use('/proofs', proofRouter);
40+
app.use("/", indexRouter);
41+
app.use("/connections", connectionRouter);
42+
app.use("/proofs", proofRouter);
4043

4144
// catch 404 and forward to error handler
42-
app.use(function(req, res, next) {
45+
app.use(function (req, res, next) {
4346
next(createError(404));
4447
});
4548

4649
// error handler
47-
app.use(function(err, req, res, next) {
50+
app.use(function (err, req, res, next) {
4851
// set locals, only providing error in development
4952
res.locals.message = err.message;
50-
res.locals.error = req.app.get('env') === 'development' ? err : {};
53+
res.locals.error = req.app.get("env") === "development" ? err : {};
5154

5255
// render the error page
5356
res.status(err.status || 500);
54-
res.render('error');
57+
res.render("error");
5558
});
5659

5760
// Start the server
@@ -60,5 +63,4 @@ app.listen(PORT, () => {
6063
console.log(`Server is running on port ${PORT}`);
6164
});
6265

63-
6466
module.exports = app;

AliceFaberAcmeDemo/controllers/acme-controller/bin/www

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
* Module dependencies.
55
*/
66

7-
var app = require('../app');
8-
var debug = require('debug')('acme-controller:server');
9-
var http = require('http');
7+
var app = require("../app");
8+
var debug = require("debug")("acme-controller:server");
9+
var http = require("http");
1010

1111
/**
1212
* Get port from environment and store in Express.
1313
*/
1414

15-
var port = normalizePort(process.env.PORT || '3000');
16-
app.set('port', port);
15+
var port = normalizePort(process.env.PORT || "3000");
16+
app.set("port", port);
1717

1818
/**
1919
* Create HTTP server.
@@ -26,8 +26,8 @@ var server = http.createServer(app);
2626
*/
2727

2828
server.listen(port);
29-
server.on('error', onError);
30-
server.on('listening', onListening);
29+
server.on("error", onError);
30+
server.on("listening", onListening);
3131

3232
/**
3333
* Normalize a port into a number, string, or false.
@@ -54,22 +54,20 @@ function normalizePort(val) {
5454
*/
5555

5656
function onError(error) {
57-
if (error.syscall !== 'listen') {
57+
if (error.syscall !== "listen") {
5858
throw error;
5959
}
6060

61-
var bind = typeof port === 'string'
62-
? 'Pipe ' + port
63-
: 'Port ' + port;
61+
var bind = typeof port === "string" ? "Pipe " + port : "Port " + port;
6462

6563
// handle specific listen errors with friendly messages
6664
switch (error.code) {
67-
case 'EACCES':
68-
console.error(bind + ' requires elevated privileges');
65+
case "EACCES":
66+
console.error(bind + " requires elevated privileges");
6967
process.exit(1);
7068
break;
71-
case 'EADDRINUSE':
72-
console.error(bind + ' is already in use');
69+
case "EADDRINUSE":
70+
console.error(bind + " is already in use");
7371
process.exit(1);
7472
break;
7573
default:
@@ -83,8 +81,6 @@ function onError(error) {
8381

8482
function onListening() {
8583
var addr = server.address();
86-
var bind = typeof addr === 'string'
87-
? 'pipe ' + addr
88-
: 'port ' + addr.port;
89-
debug('Listening on ' + bind);
84+
var bind = typeof addr === "string" ? "pipe " + addr : "port " + addr.port;
85+
debug("Listening on " + bind);
9086
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[
2-
{
3-
"label": "Connections",
4-
"url": "/connections"
5-
},
6-
{
7-
"label": "Proof Requests",
8-
"url": "/proofs"
9-
}
10-
]
2+
{
3+
"label": "Connections",
4+
"url": "/connections"
5+
},
6+
{
7+
"label": "Proof Requests",
8+
"url": "/proofs"
9+
}
10+
]
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
version: '3'
1+
version: "3"
22
services:
33
acme-controller:
44
build: .
55
ports:
6-
- "8140:80" # Expose a different port for the controller
6+
- "8140:80" # Expose a different port for the controller
77
environment:
88
- AGENT_HOST=host.docker.internal
99
- AGENT_PORT=8040
1010
networks:
1111
- aca
1212
networks:
13-
aca:
13+
aca:

AliceFaberAcmeDemo/controllers/acme-controller/public/css/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ a {
99

1010
.content {
1111
padding: 1rem;
12-
}
12+
}

0 commit comments

Comments
 (0)