ethereum-oasis-op / baseline

The Baseline Protocol is an open source initiative that combines advances in cryptography, messaging, and distributed ledger technology to enable confidential and complex coordination between enterprises while keeping data in systems of record. This repo serves as the main repo for the Baseline Protocol, containing core packages, examples, and reference implementations.
https://docs.baseline-protocol.org
Other
576 stars 236 forks source link

BPI Interop - Create user agent script in NodeJs #695

Open fleischr opened 1 year ago

fleischr commented 1 year ago

Overview

Create a user agent script the processes outputs of BRI-1/BRI-3 and maps inputs to inputs BRI-3/BRI-1 according per the Interop demonstration requirements

Reference

Latest build of provide-js https://github.com/provideplatform/provide-js

BRI-1 Workstep/Workflow Instance API docs https://docs.provide.services/api/rest-api-v1/axiom/worksteps/workstep-instances

Questions

N/A

Assumptions

Node.js dependencies within the scripts directory shall not introduce any breaking changes elsewhere in the Baseline repo Refresh/access tokens to be maintained by env file Shall use the provide-js library to integrate to BRI-1. BRI-3 integration to be supported by the BRI-3 project team. Executable in batch mode/from CLI terminal. No UI needed.

Acceptance

Tasks

fleischr commented 1 year ago

Hi @Therecanbeonlyone1969 I want to get some additional details on the test cases for the scenario onboarding with did-jwt

I have some assumed test cases for consideration. Let me know if these look ok and I can make additional dev/test plans accordingly.

  1. Add an existing DID user to BRI-1. Use did-jwt library to create DID. In lieu of of an email/password combination - the user record to BRI-1 Ident is created when a valid signature by the DID user is provided.
  2. Login the user. DID user generates a digital signature for login. Upon signature verification success, the session access token for BRI-1 is given to interact with BRI-1 APIs accordingly
Therecanbeonlyone1969 commented 1 year ago

@fleischr ... so the did-jwt package is here. DID JWT is used for authentication and authorization purposes. Alternatively, the core repo from DIF is here

DID JWT assumes you have a DID for a given DID method.

  1. So creating an account presents the DID-JWT as the authentication token and the DID is added to the new user account. The DID-JWT library is used to create the DID-JWT based on a given DID and then used to verify the DID-JWT
  2. Login the user works exactly the same way. Except now the check is for an existing account for a given DID and subsequent verification of the DID JWT that would allow access to BRI-1 functionality

Hop that makes sense.