Code Monkey home page Code Monkey logo

attester's Introduction

Attester Service

The Attester Service is responsible for generating various credentials for users, with an authentication mechanism that distinguishes between regular users and employees. Users can request different types of credentials, which can then be approved by employees. The service implements the KILT Credential API, allowing users to store their credentials in their identity wallet. Authentication is facilitated by fetching a JWT token from OpenDID. Users can log in with a DID, while employees require additional credentials.

A demonstration deployment for Peregrine can be accessed here, and a Spiritnet deployment is available here.

Usage

All environment variables must be configured in a config.yaml file. An example config.yaml file is provided here, with explanations of the variables included.

Local Debugging Frontend

The frontend utilizes Vite as a bundler. To develop, simply run yarn dev. To build the frontend, execute yarn build.

Local Debugging Backend VsCode

Create a .vscode/launch.json file and paste the following content:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "lldb",
      "request": "launch",
      "name": "Debug executable 'attester-backend'",
      "cargo": {
        "args": ["build", "--bins"],
        "filter": {
          "name": "attester_peregrine",
          "kind": "bin"
        }
      },
      "args": [],
      "cwd": "${workspaceFolder}",
      "env": {
        "CONFIG": "./config.yaml"
      }
    },
    {
      "type": "lldb",
      "request": "launch",
      "name": "Debug unit tests in executable 'attester-backend'",
      "cargo": {
        "args": [
          "test",
          "--no-run",
          "--bin=attester-backend",
          "--package=attester-backend"
        ],
        "filter": {
          "name": "attester-backend",
          "kind": "bin"
        }
      },
      "args": [],
      "cwd": "${workspaceFolder}"
    }
  ]
}

Please note that the above configuration is tailored for Peregrine. If debugging on Spiritnet, adjust the filter accordingly.

Docker

A docker-compose file is provided. To start the containers, run docker-compose up.

Database

The Rust backend utilizes sqlx for database interactions. If a query is modified, update the metadata to support offline compile-time verification using the command cargo sqlx prepare. New migrations can be added with cargo sqlx migrate add, and existing migrations can be executed via CLI with cargo sqlx migrate run. The source code manages migrations automatically.

attester's People

Contributors

ad96el avatar dudleyneedham avatar ggera avatar trusch avatar

Watchers

 avatar  avatar  avatar

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.