findy-agent-vault

command module
v0.1.121 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

findy-agent-vault

test codecov

Getting Started

Findy Agency is a collection of services (Core, Auth, this service and Web Wallet) that provide full SSI agency along with a web wallet for individuals. To start experimenting with Findy Agency we recommend you to start with the documentation and set up the agency to your localhost environment.

Project

Vault provides both

  1. Data storage service for findy-agency clients
  2. Abstraction/Convenience layer for agency protocol APIs which can be used through GraphQL interface.

Vault provides currently only a GraphQL API but intends to support also GRPC in the future. As a findy-agency client you can use also the findy-agent GRPC APIs directly, but will have to implement possible data storing and indexing capabilities yourself.

Architecture

Setup development environment

Basic setup
  1. Install golang

  2. Run app

    go run . version
    

    You shoud see something similar to this:

    I0526 14:43:44.750568   50912 config.go:68] Configuration file was not found, using environment/default variables only
    Vault version dev
    
Service configuration

Vault cannot function without a working installation of core agency. Either setup core agency to your local machine or use agency installation in the cloud.

  1. Vault can be configured using configuration file or environment variables. Following settings are required when running vault locally (note "<>" indicates example value, and should be replaced):

    # core agency address
    export FAV_AGENCY_HOST="<agency.example.com>"
    # core agency port
    export FAV_AGENCY_PORT="<50051>"
    # path to agency grpc cert files
    export FAV_AGENCY_CERT_PATH="<scripts/test-cert>"
    # true if this vault is the primary vault for the agency installation
    export FAV_AGENCY_MAIN_SUBSCRIBER=false
    # common agency JWT secret
    export FAV_JWT_KEY="<jwt-secret-common-with-core>"
    # vault database password (any password)
    export FAV_DB_PASSWORD="<password-for-postgres>"
    # vault server port
    export FAV_SERVER_PORT=8085
    # true if graphQL playground should be served in service root
    export FAV_USE_PLAYGROUND=true
    
  2. Vault uses postgres to store its data. You can start postgres in a docker container:

    make db
    
  3. Start vault by running the app with no arguments

    go run .
    

Unit testing

Unit tests assume postgres is running on port 5433.

Launch default postgres container by declaring password for postgres user:

export FAV_DB_PASSWORD="mysecretpassword"

and running

make init-test

You can run all unit tests with command

go test ./...

For linting, you need to install golangci-lint

make check builds, tests and lints the code.

Other documentation

Check docs-folder

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL