Skip to content

Latest commit

 

History

History
48 lines (38 loc) · 1.48 KB

Rust.md

File metadata and controls

48 lines (38 loc) · 1.48 KB

Anatomy of a DinoPark Rust service

All DinoPark Rust services use actix as their web framework. In general the endpoints are separated into small apps:

src
├── endpoint1
│   ├── app.rs
│   ├── mod.rs
│   └── …
├── endpoint2
│   ├── app.rs
│   ├── mod.rs
│   └── …
├── healthz.rs # basic health check endpoint for k8s
├── main.rs
└── settings.rs

Scopes

Permissions are and authentication happens via DinoPark Gate. It decodes and verifies the id_token and translates it into user_id, scope, groups_scope and AAL. Routes may be guarded to on a minimal requirement on either of those claims by DinoPark Guard via a simple annotation like: #[guard(Staff, Creator, Medium)] which would only allow access to this route if the logged in user is a staff member, is an allowed access group creator and is logged in via a MFA'd login method.

CIS Integration

All services use a common CIS client to interact with the CIS APIs. Signing fields is also supported given the correct signing keys.

Code Style and Rules

All Rust code must pass at least:

cargo fmt --all -- --check
cargo clippy -- -D warnings
cargo test --all