Skip to content

spydx/capability-poc

Repository files navigation

Capability PoC - Instructions

PS: remember to clone with --recurse-submodules

git clone --recurse-submodules https://github.com/spydx/capability-poc.git
cd capability-poc
git submodule update --remote --recursive

Running the example

The recommended way to start this example is to use docker-compose. The build process will depend on your internet connection take anything from 15 min to 20+ min to build all the components.

Docker-compose

After installing Docker:

Bring everything up

> docker-compise build # approx 15+ min
> docker-compose up 

Launch a browser and access http://localhost:3000/

The process to be done is:

    1. GnapRequest
    1. Login at the AS
    1. Continuation Request (Authorization)
  • One or more of the desired actions.

Users

Username  Password
kenneth password
alice password
bob password

Manually

You will need:

  • Rust/Cargo : install
  • SQLx-cli : cargo install sqlx-cli install
  • sqlx needs SQLite support, so either specify or leave for default.
  • npm for nextjs.
  • Add host.docker.internal pointing to 127.0.0.1 to in the local hosts file.

Ubuntu / Linux

You will need:

sudo apt install build-essential
sudo apt install libssl-dev
sudo apt install pkg-config
rustup toolchain install nightly # do this if cargo doesn't do it automatically
cargo check # after all above, this should work from the project root.

Building order

  1. GNAP
> cd gnap
> docker-compose up -d # bring up REDIS and MongoDB.
> cd gnap_as
> cargo run 
  1. simple-api
> cd simple-api
> cargo run
  1. cap-client
> cd cap-client
> npm install
> npm run dev
> open http://localhost:3000/

Database errors

Sometimes the Mongo database stops working correctly. If it does, then removing the data in the folder ./gnap/data/mongodb will cause a rebuild of the database to the clean working state with docker-compose up.

BibTex

@software{Fossen_Exploring_Capability-based_security_2022,
    author = {Fossen, Kenneth},
    month = {6},
    title = {{Exploring Capability-based security in software design with Rust}},
    url = {https://github.com/spydx/capability-poc},
    version = {1.0.0},
    year = {2022}
}

Releases

No releases published

Packages

No packages published

Languages