findy-common-go

module
v0.2.35 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: Apache-2.0

README

findy-common-go

test codecov

Getting Started

Findy Agency is a collection of services (Core, Auth, Vault 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

Main purpose of this package is to provide helpers and utility functionality for connecting to findy-agent core through findy-agent-api GRPC interface.

Main features

  • Code generated from API IDL.
  • Helpers for opening secure GRPC connection to core agency.
  • Helpers for API protocol starters and event listeners.
  • Test TLS certificates for local development setup.

Example

import (
 "context"
 "os"

 "github.com/findy-network/findy-common-go/agency/client"
 agency "github.com/findy-network/findy-common-go/grpc/agency/v1"
 "github.com/google/uuid"
 "google.golang.org/grpc"
)

// Generates new Aries invitation for agent and prints out the invitation JSON string.
// JWT token should be acquired using authentication service before executing this call.
// Note: this function panics on incorrect configuration.
func TryCreateInvitation(ctx context.Context, jwtToken, label string) {
 conf := client.BuildClientConnBase(
  "/path/to/findy-common-go/cert",
  "localhost",
  50051,
  []grpc.DialOption{},
 )
 conn := client.TryAuthOpen(jwtToken, conf)

 sc := agency.NewAgentServiceClient(conn)
 id := uuid.New().String()

 if invitation, err := sc.CreateInvitation(
  ctx,
  &agency.InvitationBase{Label: label, ID: id},
 ); err == nil {
  fmt.Printf("Created invitation\n %s\n", invitation.JSON)
 }
}

Reference implementations

  • findy-agent-cli: GRPC client, agent CLI tool providing most API functionality through a handy command-line-interface.

  • findy-agent: GRPC server (agency internal). Implements core agency services.

  • findy-agent-vault: GRPC client (agency internal). Provides agency data storage service.

  • findy-agent-auth: GRPC client (agency internal). Provides agency authentication service

Development

Unit testing: make test

Linting: Install golangci-lint and run make lint.

See more

Directories

Path Synopsis
agency
client
Package client implements helpers for gRPC client connection to Agency
Package client implements helpers for gRPC client connection to Agency
client/chat
Package chat implments state-machine based chat bots
Package chat implments state-machine based chat bots
fsm
Package backup implements dedicated helpers for the current backup system.
Package backup implements dedicated helpers for the current backup system.
db
package db implements Bolt based database which can be encrypted on the fly and which supports automatic backups.
package db implements Bolt based database which can be encrypted on the fly and which supports automatic backups.
Package dto is for data transfer objects.
Package dto is for data transfer objects.
grpc
infra
aws Module
jwt
mw
std
tools
x

Jump to

Keyboard shortcuts

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