Skip to content

Workspace to handle the development of Authentication features in a separate environment that automatically connects to acdc

License

Notifications You must be signed in to change notification settings

asaccool/acdc-auth-feature-workspace

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACDC Authentication Feature Workspace

ACDC means Anti-Counterfeiting Data Collaboration - Use-Case 4 of PharmaLedger

Aims to set up a separate environment, connected to Acdc for Authentication providers to develop and deploy their own authentication features in their own domain

Installation

In order to use the workspace, we need to follow a list of steps presented below.

Step 1: Clone the workspace

$ git clone https://github.com/PharmaLedger-IMI/acdc-auth-feature-workspace.git

After the repository was cloned, you must install all the dependencies.

$ cd acdc-auth-feature-workspace
#Important: If you plan to contribute to the project and/or dependecies please set DEV:true
#in the file env.json before you run the installation!
$ npm install

Note: this command might take quite some time depending on your internet connection and you machine processing power.

Step 2: Launch the "server"

While in the acdc-auth-feature-workspace folder run: (optional)

    npm run integrate-acdc

this will run the following octopus script:

    "configure-acdc-integration": [
        {
            "name": "configure server integration",
            "src": "",
            "actions": [
                {
                    "type": "execute",
                    "cmd": "npm run set-up-acdc-integration -- --port=8080 --domainName=epi-auth-template --epi=http://192.168.1.89:8080 --env=dev"
                },
                {
                    "type": "execute",
                    "cmd": "npm run patch-server"
                },
                {
                    "type": "execute",
                    "cmd": "npx rimraf ./apihub-root/external-volume/config/domains/epi.json"
                }
            ]
        }
    ],

notice the use of npm run set-up-acdc-integration with arguments to configure the domain

the possible arguments are:

  • --port : the port where to run the ApiHub (defaults to 8080);
  • --domainName: the name for the domain (defaults to 'template');
  • --epi: the url to the epi (acdc for the time being) apihub: acdc-dev.pharmaledger.pdmfc.com:80 or acdc.pharmaledger.pdmfc.com:80 for the dev and tst environments. local address for tests. (no outgoing communication is required so far for this repo, so this parameter is mute);
  • --env: (not supported currently);

Each user should tailor this to fit his needs.

$ npm run server

At the end of this command you get something similar to:

alt text

Step 3: Build all things needed for the application to run.

Open a new console inside acdc-auth-feature-workspace folder and run:

# Note: Run this in a new console inside "epi-workspace" folder
$ npm run build-all

To Test Locally:

To properly test the deployment locally, the best way is to deploy this workspace to a docker file ./docker/build.sh and then run it ./docker/run.sh. this latest script will map the 8080 port of the container to 8081 so it can run simultaneous to acdc.

then, in acdc, when all the workspace is set up stop the server and run npm run onboard-domain -- --domainName=$DOMAIN_NAME --anchoring=http://localhost:8081 --bricking=http://localhost:8081 --notifications=http://localhost:8081

restart the server npm run server

and now the KeySSI generated in this workspace can be used in the acdc workspace (easy test via Dossier Explorer or by using it in the EPI app)

Contributions

If you think you can contribute, please check with the team, if it is ok to submit a pull-request.

  1. Thou Shalt not reformat
  2. Thou shalt absolutely not fix whitespace
  3. Thou Shalt not refactor
  4. Thou Shalt not rename
  5. Thou shalt document
  6. Thou shalt not implement more than one thing in a single commit
  7. Thou shalt ask the vendor / community first
  8. Thou shalt not demand
  9. Thou shalt accept the license terms

About

Workspace to handle the development of Authentication features in a separate environment that automatically connects to acdc

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 45.3%
  • TypeScript 19.6%
  • CSS 16.7%
  • HTML 14.0%
  • Shell 3.4%
  • Dockerfile 1.0%