Giter Club home page Giter Club logo

passport's Introduction

Gitcoin Passport

What is Passport?

Many social organizations, online particularly, have difficulty ensuring that every participant is a unique human and does not have multiple participating accounts. Most existing digital identity solutions are either centralized (e.g., national identity cards) or individualistic (e.g., most β€œself-sovereign” identity models). However, identity is naturally intersectional and social; everybody shares different data and relationships with a unique set of others. The Gitcoin Passport aims to provide a more collaborative and secure infrastructure for digital identity by capturing the richness of our diversely shared lives.

The Gitcoin Passport is an identity verification application. We have written software enabling people to grow personal collections of verifiable credentials about themselves and organizations to assess their identities to coordinate rights and responsibilities. The institutions define, verify, and utilize identity as functions of the networked records of the individuals. While we build the Passport agnostic to specific applications, we are actively exploring its benefits for personhood proofs and plurality in organizational designs.

Documentation

Check out our documentation at https://docs.passport.gitcoin.co

Contributing to Passport

We welcome everyone to contribute to the Passport project.

You can join our Discord and specifically the passport-builders channel (just be sure to select the builder role when you join the discord) to get help and discuss the project with the rest of the community.

You can also familiarize yourself with our near term project roadmap in the passport project backlog

Reviewing Changes

Once a pull request is sent, the Passport team will review your changes. We outline our process below to clarify the roles of everyone involved.

All pull requests must be approved by two committers before being merged into the repository. If any changes are necessary, the team will leave appropriate comments requesting changes to the code. Unfortunately, we cannot guarantee a pull request will be merged, even when modifications are requested, as the Passport team will re-evaluate the contribution as it changes.

Committers may also push style changes directly to your branch. If you would rather manage all changes yourself, you can disable the "Allow edits from maintainers" feature when submitting your pull request.

The Passport team may optionally assign someone to review a pull request. If someone is assigned, they must explicitly approve the code before another team member can merge it.

When the review finishes, your pull request will be squashed and merged into the repository. If you have carefully organized your commits and believe they should be merged without squashing, please mention it in a comment.

Quick Start

Prerequisites: Node (v16 LTS) plus Yarn and Git

  1. Install Gitcoin Passport (this will install all packages within the passport monorepo):
git clone https://github.com/gitcoinco/passport.git
cd passport
npm install --global lerna
lerna init
lerna bootstrap
  1. Create environment files, and replace environment variables with your own values
cp ./app/.env-example.env ./app/.env
cp ./iam/.env-example.env ./iam/.env
cp ./schemas/.env-example.env ./schemas/.env
  1. Start iam, app, and ceramic services concurrently:
# remember to create .env files first
yarn start
  1. Run the Passport Scorer API locally. Set up instructions are here

Passport Data

A passport has two sources of data. The primary source is a postgres database that is hosted by gitcoin. To run the passport application locally you will need spin up the Scorer API. All relevant instructions to run the scorer api can be found here. The sample environment variables in the .env-example.env files are configured to make requests to the scorer api running locally. Once the scorer api is running locally, you should have a reliable data source for development.

The second source of data is the ceramic network. No steps are needed to run the ceramic network locally. The sample environment variables in the .env-example.env files are configured to make requests to a test version of the ceramic network.

Background Knowledge

  • Know what a wallet is, how to create one, etc.
  • Know what a Verifiable Credential is
  • Know basics of Ceramic Network - interacting with DIDDatastore, Self.ID

Packages

app

The web app allowing users to interact with their Gitcoin Passport. README

database-client

Contains database connection implementations. Currently supports Ceramic Network. README

iam

The server handling incoming requests to issue credentials and process verifications. README

identity

This is a helper package to compile Spruce DIDKit and export functions for use in iam and app packages.

infra

Holds the Pulumi deployment configuration for this repository. README

schemas

Ceramic schemas and model definitions, and scripts for creating and publishing these to the Ceramic Network. README

types

Shared type definitions. README

passport's People

Contributors

aminah-io avatar chibie avatar dankelleher avatar david-focused avatar didierkrux avatar digitalmnt avatar erichfi avatar farque65 avatar flipscholtz avatar gdixon avatar kammerdiener avatar kevin-olsen-opensc avatar kevinrolsen avatar kweiss avatar larisa17 avatar lebraat avatar lucianhymer avatar luke-focusedlabs avatar michaelgreen06 avatar mzkrasner avatar nutrina avatar oed avatar omahs avatar peebeejay avatar shavinac avatar soptq avatar zachferland 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  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  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

passport's Issues

[CHORE] set up initial github actions to run linting & tests

set up initial github actions scripts

  • on pull request: run lint check, tests
  • on commits to main: run tests

when we start setting up ci/cd pipeline, we can then extend these scripts to deploy code to somewhere, push to named branches, etc

we can start thinking about deploying the iam server and app separately

🎫 [STAMPS] As a passport holder, I can add a Facebook stamp to my passport

GIVEN that I am logged into my passport
WHEN I click the call to action on the Facebook stamp
THEN I see a message that tells me to verify my FB account
AND WHEN my FB account is verified
THEN I can see that my FB stamp is verified

Planning Notes

  • Need a dev account on FB - need to go thru an approval process before integration is production ready (mostly automated checks by FB) -- log in with these credentials or in company password vault
  • FB OAuth flow (we think its needed for production)
  • How do we save info for credentials?
  • https://github.com/mattrglobal/node-bbs-signatures

Story Points
2

As an existing user, I can sign into my passport, so that I can add stamps

GIVEN that I already have a passport AND my wallet is connected
WHEN I visit the Gitcoin passport page (AND I click a call-to-action that says "View My Passport")
THEN I am redirected to a page where I can view stamps (for now, it's a blank page that says "stamps will go here")

Questions

  • Should users click a CTA (call to action) to access their passport?
  • How long should sessions stay open?
  • What happens when a ceramic session expires?
  • How do we know that a user already has a passport?

Notes

  • Ideal Case: user is automatically dropped into their passport

Mocks

Story Points
2

πŸ“– [READER] As a passport holder, I can submit my passport for review, so that my passport can be assigned a score

For pages/dapps that want to use a score (i.e. grants checkout) we should have a "drop in" way to allow simple dpopp integration. For now, let's assume we have a test page and extract a library/FE-component later

For now, scoring is going to be the following:
any stamps is a score of πŸ‘
no stamps is a score of πŸ‘Ž

GIVEN that I am a passport holder on a page that is requesting my passport
WHEN I add my passport DID to a field
THEN I can click the button "generate a score"
I should see my score calculated from my current passport stamps

🎫 [STAMPS] As a Passport Holder, I can add a BrightID stamp to my passport

GIVEN that I have signed into my passport with a wallet address
WHEN I click the BrightID stamp
THEN I see a modal that tells me how to connect to BrightID
AND WHEN I have successfully connected my verified BrightID account
THEN my BrightID stamp shows that I am verified

Notes

  • We need to be setup as a sponsor for BrightID to get a link/QR code to put into this modal

Questions

  • How do you verify ownership of a verified BrightID account? What connects dPopp and BrightID?
  • How is Gitcoin cPopp handle BrightID?

πŸš— [GRANTS] As a Gitcoin user, I want to connect my wallet, so that I can access my passport for GR14

GIVEN that I am a Gitcoin user with a Gitcoin account
WHEN I visit the Trust Bonus page
THEN I see a button to connect with my passport
AND WHEN I click that button
THEN I am prompted to connect my wallet
AND WHEN I have a passport
THEN I am connected

AND WHEN I don’t have a passport
THEN I am prompted to create a passport
AND WHEN I click "Create Passport"
THEN I am taken to the passport creation flow in a new tab
AND WHEN I complete that process AND I come back to Gitcoin
THEN I see that my passport is connected

Mocks

πŸ“– [READER] As a passport holder, I can connect my wallet, so that the reader can calculate my score

Following on the from the last story, let's calculate the did, and the score from the wallet connection
If not already done let's capture the page events to kick off the async calculation process and keep the UI updated accordingly.

GIVEN I am on a page requesting my passport
AND I have a passport created
WHEN request my passport
THEN I get an object containing all of my stamps and passport details

Prompt users to create a passport when prompted to calculate score and no passport present

Failure case - calculate the did, and the score from the wallet connection

GIVEN I am on a page requesting my passport
AND I DO NOT have a passport created
WHEN I connect my wallet
AND I sign the transaction to calculate my did from my wallet
THEN I should see the page update to "calculating score"
AND I should receive a "no passport found" message
AND I should have a prompt to create a passport
AND I should see additional information if the wallet was not found for other reasons

Help text:

Your passport could not be found
If you have already created a passport, please check you are using the same wallet you initially used to create your passport.
If you are still having trouble, connect with us in our dpopp support discord channel: https://discord.com/channels/XXX

As a new passport holder, I can create a passport so that I can collect stamps

GIVEN that I am creating a new passport
WHEN I click the call-to-action button
THEN I see a MetaMask message
AND WHEN I sign the MetaMask message
THEN a passport is created AND I am signed into Passport AND I am redirected to a blank page that says "stamps will be here"

Notes

  • Only build the first page with the passport call to action
  • Use the mid-fidelity mock
  • Local storage for this first story

Mocks

Story Points
2

🎫 [STAMPS] As a Passport Holder, I can add an Idena stamp to my passport

GIVEN that I am a passport holder
WHEN I click the Idena stamp
THEN I am taken to Idena
AND WHEN I create and/or sign into an Idena account
AND I complete whatever Idena asks me to do to be verified
THEN my Idena stamp shows verified

Notes

Questions

  • Given that Idena accounts expire, has Gitcoin cPopp accounted for that? How should we handle it with dPopp?
  • What does Idena look for to determine verification?

Engineering task: set up CI/CD pipeline

Questions:

  • What are we using to deploy front end? Where are we hosting it (to start)?
  • What are we using to deploy servers / backend? Where are we hosting it?
  • What environments do we want? Dev / Prod of course, do we want staging/qa/test etc? dev = testnet, prod = mainnet?
  • Running a local node vs connecting to a remote Ceramic node for tests? Should we use Docker for running a local node?

Notes:

  • Need to run a Ceramic node and IPFS node to pin our data
  • Fleek tracks Git branches for deployment - so we would set up main (dev), staging(?), prod branches. can deploy to IPFS, IC. can start with free tier but will need to pay for >250 build minutes
  • Can use Github Actions with manual triggers (eg buttons) if we want a manual promotion / deployment gate
  • Need to set up a step to publish any model changes to Ceramic
  • https://github.com/nektos/act - running Github Actions locally

Gitcoin contacts:

  • TimS
  • Gerald

Switch over from local storage implementation to Ceramic for VC storage

GIVEN I have verified a stamp in one browser
AND I have not completed that stamp in a second browser
WHEN I visit my passport page in a new browser
THEN I still see my verified stamp

Notes

  • adding ceramic to CI/CD (can be its own story/card)
  • Implementing/replacing ceramic as a storage implementation (this card)

Question

  • what does testing look like?

Story Points
2

As a passport holder, I can choose a way to store my passport

Notes:

  • Should this be implemented? Product and design should assess feasibility. User desire for this option should be explored
  • Local Storage is used as a data storage option in the initial issues.
  • Local storage should be restricted to a developer mode option once ceramic is implemented
  • How will the different storage options be available to the user?

🎫 [STAMPS] As a Passport Holder, I can add a Proof of Humanity stamp to my passport

GIVEN that I have signed into my passport with a wallet address
AND I have an NFT associated with Proof of Humanity to my wallet address
WHEN I click the PoH stamp
THEN I see a message that confirms if my address is registered with proof of humanity
AND WHEN I click "verify"
THEN my Proof of Humanity stamp shows that I am verified

Notes

  • this stamp checks for an NFT in the same way that ENS would
  • Check for if the user has NFT, and if they don't lets ditch having a "waiting" status.

Questions

Story Points
2

Create and expose a 404 page to handle unrecognised paths

Fleek will attempt to load documents from IPFS using a directory structure, if the user navigates to a page other than the index they will be met with an ugly 404 page.

As a fallback, fleek will attempt to serve /ipfs-404.html when it can't otherwise find the desired document.

We should create and store a custom /ipfs-404.html document in the nextjs out directory at build time.


More information can be found here: https://docs.fleek.co/hosting/troubleshooting/#adding-404-errors

🎫 [STAMPS] As a passport holder, I can add an ENS stamp to my passport

GIVEN that I have signed into my passport with a wallet address
AND I have an ENS registered to my wallet address
WHEN I click the ENS stamp
THEN I see a message that checks my address and confirms an ENS associated with it
AND WHEN I click "verify"
THEN my ENS stamp shows that I am verified

Questions

  • If I have an ENS associated with an account, but do not have it set to resolve to said address - will it still verify an ENS? (can only 1 ENS resolve to a specific address)
  • Do we need a mainnet RPC up to resolve the ENS addresses?
  • How does Trust Bonus Scoring currently use RPC's to resolve?

Notes

  • Need to look a bit more into OnboardJS library if it has ENS lookup out of the box

Story Point
3

[CHORE]: Add in better error handling in IAM server

  • Right now all errors are reported as 400 but there is room for nuance
  • Check line 71 of iam/src/index.tsx'
  • Ensure errors/exceptions do not reveal sensitive information (app secrets, secret key, etc) if uncaught/unhandled

set up promote-to-staging pipeline

tasks:

  • create a dpopp > staging pulumi stack, tied to gitcoin staging AWS account on deploy
  • create a staging-app branch and a new fleek site that tracks that branch
  • add *-staging github secrets for applicable values
  • implement promote-staging github workflow (see .github/workflows/promote-staging.yml). actual app-deploy / server-deploy processes should be similar to the review workflows (cd-server, cd-app-review), but would be triggered manually (thru workflow_dispatch) rather than on push

[TECH DEBT] Ceramic CLI dependency causing issues with NextJS export process

Currently if running next export to build the web app code, it errors with

info  - Loaded env from /Users/shavinachau/workspace/gitcoinco/dPopp/app/.env
Failed to compile.

../node_modules/@tendermint/belt/src/base64.ts:48:43
Type error: Type 'Uint8Array' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.

  46 |  */
  47 | export function bytesToBase64 (bytes: Bytes): Base64String {
> 48 |     const binary = String.fromCharCode(...bytes);
     |                                           ^
  49 |     return btoa(binary);
  50 | }
  51 |
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This issue is caused by the @tendermint family of libraries, which is a dependency of @ceramicnetwork/cli, which is brought into the NextJS export process because NextJS is pulling in the root-level node modules from lerna bootstrap, which includes dependencies from multiple packages including those that require @ceramicnetwork/cli

for now, we hacked the Fleek build command to remove the @tendermint package npm install --g lerna && lerna bootstrap && rm -rf ../node_modules/@tendermint && npm run export -- this is super hacky and we should figure out a better way to deal with this

set up promote-to-prod pipeline

prerequisites:

  • gitcoin "prod account" AWS access
  • prod domain

todo:

  • discuss additional processes we want - announcing a new release, any manual approvals (stakeholder sign-offs?), etc

[CHORE]: add code and commit linting configs

Code linting:

Notable linting/formatting rules put in place:

  • Double quotes, not single quotes
  • Use semicolons
  • Trailing commas always
  • 2-space tab width
  • 80-char recommended line length
  • no unused variables
  • (warning-level) should explicitly annotate function return types, even if the return type can be inferred.

--

Commit message formatting:

Question:

[CHORE] Setup Ceramic Node

See #47 (comment) - currently a Ceramic image is being deployed in a container alongside our IAM server container, however currently it is not exposed to external traffic.

  • configure (a new?) listener to direct certain incoming requests to the ceramic container
  • expose appropriate ports on the ceramic container
  • possibly modify ceramic image to "pre-load" our desired Passport and VC schemas to the ceramic node that runs
  • configure AWS EFS to persist stored ceramic data across container recycles

additional / future thoughts:

  • when making read/write requests to our ceramic node -- should our webapp use some kind of authentication scheme to make sure our ceramic node is only storing/pinning dpopp-related data? otherwise it would be open for /anyone/ to use for writing arbitrary new data streams... or potential DDOS attack on our ceramic node

[CHORE] Setup Fleek to deploy frontend

The following branches were created for the CI/CD pipeline.

  • Review: Product will use this branch to review and accept changes
  • Prod: Production branch

All dev code will be first pushed to the main branch.

The codebase from the three branches mentioned above were deployed to fleek. Fleek will trigger a new deployment after a successful code push. The urls for each of the fleek deployment are listed below.

🎫 [STAMPS] As a passport holder, I can add a Twitter stamp to my passport

GIVEN that I am logged into my passport
WHEN I click the call to action on the Twitter stamp
THEN I see a message that ask me to sign in through OAuth
AND WHEN I have successfully sign in through OAuth
THEN my Twitter stamp shows that I am verified

Notes

  • For later - should requirement to have a minimum number of followers on Twitter?
  • For later - Just collect follower information for scoring?
  • For later - What other information can we collect to verify a Twitter account? Past # of tweets? Recent tweets? Following? Followers?

Story Points
2

As a passport holder who is signed in, I can add a stamp to my passport

GIVEN that I am signed into my passport
WHEN I want to make changes to attestations
THEN I need to connect to the dpopp identity authentication manager (IAM) server
AND THEN I receive a verifiable credential

Notes

  • This includes the connection to server
  • Store date and time of last certification

Story Points
2

use hash-based NextJS routing to allow accessing sub-pages directly

issue: when starting on the app index page (https://billowing-resonance-5481.on.fleek.co), page routing works as expected. however, when attempting to load a sub-page directly (like https://billowing-resonance-5481.on.fleek.co/Dashboard), it will not load correctly due to IPFS.

see https://blog.fleek.co/posts/fleek-create-react-app#additional-considerations-concerning-routing

One problem that will occur is that the routes will work properly when accessing the site through the main domain, but will not work when accessing it through an IPFS gateway with the hash in the path such ashttps://ipfs.io/ipfs/HASH.

This is due to fact that the gateway is formatted with the hash in a path in the URL which causes the gateway to think the user is looking for a file while in reality the user is trying to access the app from a particular route. The problem is explained in more details here.

The solution we recommend is to use hash routing instead. Urls will then render in the following format: https://ifps.io/ipfs/HASH/#/YOUR_ROUTE and the problem will be fixed.

we should implement hash-routing (or whatever the NextJS equivalent is)

🎫 [STAMPS] As a passport holder, I can add a POAP stamp to my passport

GIVEN that I have signed into my passport with a wallet address
WHEN I click the POAP stamp
THEN I sign a message in my wallet to sign (checks my address for POAP's w/ +15 days)

Success:
THEN I see a modal that includes my address that my POAP were checked against with a check mark, and info on how we verify them (at least 15 days)
AND WHEN I click "verify"
THEN Metamask sends me a verify POAP's message to sign
AND WHEN I sign the message on Metamask
THEN my POAP stamp shows that I am verified

Failed:
THEN I see a modal that includes my address that my POAP were checked against with an x mark, and info on how we verify them (at least 15 days)
AND WHEN I click "Go Back"
THEN It returns to my passport page

Notes

  • Would like to combine the two modal messages that the Trust Bonus Score modal uses into one message - just a success or failed modal
  • Trust Bonus Score messages in the modal: 1. explains what POAP's are, how we verify them (at least 15 days) and 2. shows address the user is signed in to that we'll check and prompts user to check.

Questions

  • Why does it send a message for Metamask to sign on POAP, but not on ENS when verifying?

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.