SINE Foundation's demo implementation of the HTTP REST API specified in the PACT Data Exchange Protocol and the iLEAP Technical Specifications.
Warning
The demo-api
is currently WIP. Significant refactoring will take place in the near future.
The demo API is available at https://api.ileap.sine.dev
Four user credentials are available:
client_id | client_secret | Data |
---|---|---|
hello |
pathfinder |
Global access to all sample data |
transport_service_user |
ileap |
User is a (demo) shipper. Access to ShipmentFootprints and TAD |
transport_service_organizer |
ileap |
User is (demo) LSP. Access to TOCs, HOCs, and TAD |
random_data |
random_data |
Access to randomly generated iLEAP data |
The following endpoints are available:
- PACT endpoints (with iLEAP demo data when applicable)
/2/auth/token
implementingAuthenticate
action/2/.well-known/openid-configuration
: OpenId provider configuration document/2/jwks
: the JSON Web Key Set used to encode and sign the authentication token/2/footprints
implementing theListFootprints
action/2/footprints/<footprint-id>
implementing theGetFootprint
action/2/events
implementing theEvents
action
- iLEAP endpoint
/2/ileap/tad
- Additional endpoints are:
/openapi.json
: OpenAPI description file which is automatically generated from the types defined inapi_types.rs
and endpoints defined inmain.rs
- Swagger UI:
/swagger-ui/
if you fancy a visualization
No further endpoints are supported by this implementation and all return {"message":"Bad Request","code":"BadRequest"
.
You need a working and up-to-date Rust toolchain installed. See https://rustup.rs/ for details.
After having installed rustup
, ensure you have the stable toolchain
installed like this:
rustup update
rustup toolchain install stable
Once Rust is installed via rustup, just perform
cargo build
You first need to create a private key:
scripts/keygen.sh
Which will create the file keypair.pem
for you.
Then, you can run the server like this:
PRIV_KEY=`cat keypair.pem` cargo run
To run it at a different port, e.g. 3333:
ROCKET_PORT=3333 PRIV_KEY=`cat keypair.pem` cargo run
## building
cargo build --release
## running
export ROCKET_SECRET_KEY=$(openssl rand -base64 32)
export PRIV_KEY="..."
cargo run --release
The resulting binary can be found in target/release/demo-api