Git Product home page Git Product logo

bcgov / traction Goto Github PK

View Code? Open in Web Editor NEW
50.0 15.0 37.0 56.89 MB

Traction is designed with an API-first architecture layered on top of Hyperledger Aries Cloud Agent Python (ACA-Py) and streamlines the process of sending and receiving digital credentials for governments and organizations.

Home Page: https://digital.gov.bc.ca/digital-trust/tools/traction/

License: Apache License 2.0

Dockerfile 0.24% Python 12.68% Smarty 0.96% Shell 0.31% HTML 0.03% Vue 27.51% TypeScript 45.41% SCSS 12.41% JavaScript 0.46%
hyperledger-aries digital-trust verifiable-credentials digital-wallet empr dts

traction's Introduction

Traction

Traction Logo

License Lifecycle:Maturing Maintainability

Table of Contents

What is Traction?

Traction is a digital wallet solution comprised of plugins layered on top of Hyperledger Aries Cloud Agent Python (ACA-Py) and streamlines the process of sending and receiving digital credentials for governments and organizations.

Its open-source foundation makes it easy to integrate digital trust technology into existing lines of business applications, without having to stand up, maintain and manage an instance of ACA-Py themselves. Future functionality could include machine-readable governance and more.

Arch Diagram

Play in the Traction Sandbox

Establish your own Traction tenant in a B.C. Government sandbox to issue, hold, present, and verify digital credentials using these setup instructions.

Disclaimer: On the 1st and 15th of each month, the entire sandbox gets reset and all your work will be gone.

Start using Traction

Running Traction: to run a local instance of traction, see the documentation in scripts.

Deploying Traction: Helm charts for deploying Traction to Kubernetes: charts.

What are the benefits of using Traction?

Traction makes it easier to integrate digital trust technology into existing line of business applications.

  • API-first Architecture: Traction is designed with an API-first architecture, this RESTful API allows for integration into existing line-of-business applications already being used by organizations, the Tenant user interface is built on this API to enable adoption prior to integration and for low-use functions.
  • Enhanced Interoperability: Hyperledger Aries makes Traction more broadly compatible with existing technologies used by governments and organizations around the world.
  • Multi-tenancy: Rather than having multiple digital tools to integrate with organizations, one scalable instance of Traction can be used to participate in the digital trust ecosystem, control all connections, and more easily share data.
  • Higher Scalability: Traction is open-source technology, encouraging collaborative refinement, faster release, and higher scalability.

What is Traction comprised of?

Start contributing to Traction

Traction is an open-source technology project that welcomes collaboration.

If you would like to contribute to Traction, please review the following:

Developers: devcontainers

To aid in developers, there are 2 devcontainers: plugins and tenant-ui.

The devcontainers and associated vscode launch files are for convenience only, they are not mandatory for developing and debugging. Please feel free to develop anyway you choose.

  1. In VS code, open plugins.
  2. Follow all prompts to open the devcontainer.
  3. In a second VS Code window, open services/tenant-ui
  4. Follow all prompts to open the devcontainer.
  5. in plugins, start up the ACA-Py / Traction instance: Run and Debug view, "Run/Debug Plugin", start/F5
  6. in services/tenant-ui, start up the backend api: Run and Debug view, "backend - run dev", start/F5
  7. in services/tenant-ui, start up the frontend api: Run and Debug view, "frontend - run dev", start/F5
  8. in services/tenant-ui, load a Chrome browser for debugging frontend: Run and Debug view, "frontend - chrome", start/F5

If all starts up without a hitch, then you should be able to breakpoint the tenant-ui frontend (Vue/Chrome), tenant-ui backend api (Node.js) and traction plugins (Python) for local debugging.

Out of the box, the above will use the following ports:

  • ACA-Py/Traction Plugins: 3000, 3001 (admin)
  • Tenant Proxy: 8032
  • Traction DB: 5432
  • Tenant UI backend server: 8080
  • Tenant UI frontend server: 5173

Note that Tenant Proxy and Traction DB are started via docker compose when starting ACA-Py/Traction Plugins

Repository workflow

Currently authorized users can create a branch and run a pull request to merge in changes. Unauthorized can always create a fork.

Rebasing of a branch

git fetch --all
git pull

git rebase origin/main
git push --force

Who is maintaining Traction?

The Province of British Columbia is maintaining Traction as an open-source project.

Maintainer(s):

  • Jason Sherman
  • Jason Syrotuck
  • Lucas O'Neil
  • Jamie Popkin

How is Traction licensed?

Traction is licensed under Apache License 2.0 which can be reviewed here.

Engage with the community

Connect with others

traction's People

Contributors

amanji avatar dependabot[bot] avatar esune avatar gavinok avatar gurcharanjeetsingh avatar gurjmatharu avatar i5okie avatar ianco avatar jamshale avatar jsyro avatar kimmormh avatar krobinsonca avatar loneil avatar matthewhall78 avatar popkinj avatar rajpalc7 avatar repo-mountie[bot] avatar shaangill025 avatar swcurran avatar tkuhrt avatar usingtechnology avatar wadebarnes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

traction's Issues

Implement new About Tenant UI page

Implement

  • New UX design for the Tenant UI About page per Guru's mockups
  • New config fields for Traction and Acapy
  • Configuration so the "BC Gov" part is optional and can be set to other texts

Traction plugin - Cred Defs

To support work in tenant-ui, we want to quickly list all the cred defs our tenant has created:

  1. cred defs they create
  2. cred defs chemas are not stored locally, so all reads are from ledger - local cache will be preferable for speed.

Schema:

  • list, read and remove
  • cred defs added to storage via events, so existing api to post cred def to ledger will result in being added to storage.
  • no sync operation as data on ledger does not provide the same level of detail that the create has (ex. whether it is revocable)

Traction Documentation - Architecture

We need some traction architecture diagrams and supporting documentation.
There is nothing since we moved to plugins, the old one as a standalone API has been removed.

Traction Plugin - Schemas

To support work in tenant-ui, we want to quickly list all the schemas our tenant cares about:

  1. schemas they create
  2. schemas they import/reference

Import/reference is not supported in Aca-Py API, so will need to add, also schemas are not stored locally, so all reads are from ledger - local cache will be preferable for speed.

Schema:

  • schemas are added to storage via notification/events, so existing api to post schema to ledger will end up adding to storage.
  • list, read, remove operations
  • a sync operation that will check ledger for all known created and populate storage.

Tenant API - allow tenants to maintain web hooks

Port over PUT /multitenancy/wallet/{wallet_id} api to /tenant.

Possible to enhance this, but probably best left to the tenant UI if we want separate the fields for easier management.

i.e. allow them to set the image URL and label in discrete UX functions.

probably shouldn't allow them to set wallet dispatch type?

  "image_url": "https://aries.ca/images/sample.png",
  "label": "Alice",
  "wallet_dispatch_type": "default",
  "wallet_webhook_urls": [
    "http://localhost:8022/webhooks"
  ]

UI Design for "Reservation not Found"

Fourth and Final Status Indicator for the Reservation Workflow.

When the user requests access to Traction they have to enter personal information to receive a reservation. If they go back to check on the status of their application they have to enter an email and key. If there is no email found in the system we need to show the user that it was not found in the system. That way they can possibly correct spelling and check again.

As an ACA-Py Tenant Verifier, I want to use a machine-readable governance file to determine if the issuer is in the "trusted list" or not

"Machine Readable Governance"

As an ACA-Py Tenant Verifier, I want to use a machine-readable governance file to determine if the issuer is in the "trusted list" or not

AC:

  • Verifier would use a URL to load/cache a list of DIDs of Trusted Issuers of a particular credential (likely pointing to a file in another GH repo)
  • After receiving the presentation from the holder, check that the issuer of the presented information is in the list of DIDs

Reservation not found - Requester Feedback

Right now the Check Reservation Status handles all errors the same, handle a 404 differently so that the user knows they've entered the wrong res ID.

There are two parts to this ticket.

  1. The backend needs to respond with a "not found" code... which it currently does not.
  2. The UI needs to harvest this code and present a "not found" html message. Currently all errors are communicated as Toast notification errors.

AC

  1. When a 404 occurs, the error message in the red error toast says "Reservation not found" (or some other text if something else is better)

  2. Other non-404 errors just continue to propagate their respective error message forward. If it's not a 404, we don't display "not found".

Traction Documentation - Use Case videos

Videos of Traction (old version) have been removed.
Decide whether they need to be replaced and log more issues to have them created and posted (where?) if needed.

Switch to using BC Gov hosted endorser

Switch the deployed instances of Traction to use the BC Gov hosted endorser service, rather than having a self-hosted one.

Currently, BC Gov has endorser services deployed for the Candy networks (dev/test/prod). New deployments targeting BCovrin (dev/test/prod) will be required before the switch, unless switching to Candy is an option that should be considered.

UX: How to handle connection alias FROM mutl use invitation

Presently a connection that results from a mutli-use invitation gets no alias. Discuss with Lucas or Sherman for direction on this ticket.

AC:

  • There is a UX decision for how these connections
    -- Appear in the connections list
    -- Appear in connection dropdowns.

image.png

Lets use common phrasing

TL;DR ๐ŸŽ๏ธ

Teams are encouraged to favour modern inclusive phrasing both in their communication as well as in any source checked into their repositories. You'll find a table at the end of this text with preferred phrasing to socialize with your team.

Words Matter

We're aligning our development community to favour inclusive phrasing for common technical expressions. There is a table below that outlines the phrases that are being retired along with the preferred alternatives.

During your team scrum, technical meetings, documentation, the code you write, etc. use the inclusive phrasing from the table below. That's it - it really is that easy.

For the curious mind, the Public Service Agency (PSA) has published a guide describing how Words Matter in our daily communication. Its an insightful read and a good reminder to be curious and open minded.

What about the master branch?

The word "master" is not inherently bad or non-inclusive. For example people get a masters degree; become a master of their craft; or master a skill. It's generally when the word "master" is used along side the word "slave" that it becomes non-inclusive.

Some teams choose to use the word main for the default branch of a repo as opposed to the more commonly used master branch. While it's not required or recommended, your team is empowered to do what works for them. If you do rename the master branch consider using main so that we have consistency among the repos within our organization.

Preferred Phrasing

Non-Inclusive Inclusive
Whitelist => Allowlist
Blacklist => Denylist
Master / Slave => Leader / Follower; Primary / Standby; etc
Grandfathered => Legacy status
Sanity check => Quick check; Confidence check; etc
Dummy value => Placeholder value; Sample value; etc

Pro Tip ๐Ÿค“

This list is not comprehensive. If you're aware of other outdated nomenclature please create an issue (PR preferred) with your suggestion.

Remove reference to BPA from readme

Hey guys, would it be possible to remove or rewrite the following sentence in the main readme: "This project space will be a rewrite of the Business Partner Agent with multitenancy, cloud native architecture and Open APIs." The BPA reference causes a lot of confusion and people continuously ask me if the BPA is still being developed, or if it is now Traction, or if Traction is the multi tenancy portion of the BPA.

Traction Tenant Token with alternate key/password

Currently, we return the tenant gets their walet_key and uses that to prove who they are when they get a token. We are using managed wallets, but we should provide a separate key/password that can be used to fetch a token. Tenants (managed) do not need to know their wallet_key - this is stored (securely, encrypted) in the db and can be recovered by the admin.

Add new mechanisms to return an alternate key and use that for verification on token fetch/refresh.

A similar concept is in use for reservations...

Export function from ASKAR to extract the wallet

AC

  1. Use export function from ASKAR to extract the wallet
  2. Build a UI to control the downloading of files

Nice to have- Figure out if export is easy , if not look for better options/solution

Check with Andrew Whitehead

Add (optional) OIDC authentication to access tenant request page/view.

Acceptance Criteria:

  • OIDC authentication for tenant requests can be enabled/disabled in the Traction deployment settings.
  • When authentication is enabled, the user will be required to sign-in to be able to access the tenant request form.
    • The email and Full Name fields will be pre-populated with the information obtained by the Identity Provider, and locked from editing.

This pattern would be consistent with other BCGov self-provisioning services (e.g.: keycloak realm request).

image.png

Question: would the reservation check page need to be protected too, or is the reservation email and id good enough?

Relates to #420

Update documentation

The readme file and general documentation are out-of-date and require updating, with current instructions on how to stand-up the project and have it running locally in Docker.

Add project lifecycle badge

No Project Lifecycle Badge found in your readme!

Hello! I scanned your readme and could not find a project lifecycle badge. A project lifecycle badge will provide contributors to your project as well as other stakeholders (platform services, executive) insight into the lifecycle of your repository.

What is a Project Lifecycle Badge?

It is a simple image that neatly describes your project's stage in its lifecycle. More information can be found in the project lifecycle badges documentation.

What do I need to do?

I suggest you make a PR into your README.md and add a project lifecycle badge near the top where it is easy for your users to pick it up :). Once it is merged feel free to close this issue. I will not open up a new one :)

Make scripts compatible with Docker V2

Seems to be a lot of issues with using the scripts to build and stand up locally when using V2.
Docker v1 and v2 operate very differently...
There are n2 ways to configure your docker (moreso docker compose) so pretty much impossible to have it work on all machines for everyone. At least get it working for our immediate team.

  1. attempt to make the default commands operate the same in Docker v1 and v2
  2. document alternative approaches if developers run into issues (ie more build commands, clean up...)

Add missing topics

TL;DR

Topics greatly improve the discoverability of repos; please add the short code from the table below to the topics of your repo so that ministries can use GitHub's search to find out what repos belong to them and other visitors can find useful content (and reuse it!).

Why Topic

In short order we'll add our 800th repo. This large number clearly demonstrates the success of using GitHub and our Open Source initiative. This huge success means it's critical that we work to make our content as discoverable as possible. Through discoverability, we promote code reuse across a large decentralized organization like the Government of British Columbia as well as allow ministries to find the repos they own.

What to do

Below is a table of abbreviation a.k.a short codes for each ministry; they're the ones used in all @gov.bc.ca email addresses. Please add the short codes of the ministry or organization that "owns" this repo as a topic.

add a topic

That's it, you're done!!!

How to use

Once topics are added, you can use them in GitHub's search. For example, enter something like org:bcgov topic:citz to find all the repos that belong to Citizens' Services. You can refine this search by adding key words specific to a subject you're interested in. To learn more about searching through repos check out GitHub's doc on searching.

Pro Tip ๐Ÿค“

  • If your org is not in the list below, or the table contains errors, please create an issue here.

  • While you're doing this, add additional topics that would help someone searching for "something". These can be the language used javascript or R; something like opendata or data for data only repos; or any other key words that are useful.

  • Add a meaningful description to your repo. This is hugely valuable to people looking through our repositories.

  • If your application is live, add the production URL.

Ministry Short Codes

Short Code Organization Name
AEST Advanced Education, Skills & Training
AGRI Agriculture
ALC Agriculture Land Commission
AG Attorney General
MCF Children & Family Development
CITZ Citizens' Services
DBC Destination BC
EMBC Emergency Management BC
EAO Environmental Assessment Office
EDUC Education
EMPR Energy, Mines & Petroleum Resources
ENV Environment & Climate Change Strategy
FIN Finance
FLNR Forests, Lands, Natural Resource Operations & Rural Development
HLTH Health
IRR Indigenous Relations & Reconciliation
JEDC Jobs, Economic Development & Competitiveness
LBR Labour Policy & Legislation
LDB BC Liquor Distribution Branch
MMHA Mental Health & Addictions
MAH Municipal Affairs & Housing
BCPC Pension Corporation
PSA Public Service Agency
PSSG Public Safety and Solicitor General
SDPR Social Development & Poverty Reduction
TCA Tourism, Arts & Culture
TRAN Transportation & Infrastructure

NOTE See an error or omission? Please create an issue here to get it remedied.

Include OCA bundle when issuing a credential

As a Traction Tenant Issuer, I want to include an OCA bundle when I issue a credential, so the holder receiving the credential can use the OCA bundle to display/view the contents correctly

  • when Tenant defines a new cred def, they can "save" OCA JSON within their own data store (not written to ledger), so that when they offer a credential using the cred def, Traction will include the saved OCA bundle with the offer_credential payload

Typescript structure in Tenant UI code

AC:

  • There are defined types for all API requests and responses, regardless of if we use a generator to make them or not.
  • Types/Interfaces are organized in a good-practice structure

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.