mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2025-06-11 19:03:21 +02:00
Merge branch 'feature/demo-sprint' into 'development'
merge feature/demo-sprint See merge request fabinfra/fabaccess/bffh!6
This commit is contained in:
@ -1,12 +1,9 @@
|
||||
# API-Testsetup
|
||||
|
||||
wirklich nur um das API zu testen. ATM implementiert: machine::read
|
||||
wirklich nur um das API zu testen. ATM implementiert: machines::* & machine::read, authenticate
|
||||
|
||||
1. `cargo run -- --print-default > /tmp/bffh.toml` um eine default config zu generieren
|
||||
1. in /tmp/bffh.toml den parameter `machines` auf ./examples/machines.toml umbiegen
|
||||
* Bei mir z.b. `~/Development/FabInfra/Diflouroborane/examples/machines.toml`
|
||||
1. Ein mosquitto o.ä MQTT Server starten
|
||||
* Bringt aber leider gerade nicht viel ^^'
|
||||
1. `cargo run -- -c /tmp/bffh.toml`
|
||||
1. Datenbanken füllen: `cargo run -- -c examples/bffh.dhall --load=examples`
|
||||
1. Daemon starten: `cargo run -- -c examples/bffh.dhall`
|
||||
1. ???
|
||||
1. PROFIT!
|
||||
|
20
examples/bffh.dhall
Normal file
20
examples/bffh.dhall
Normal file
@ -0,0 +1,20 @@
|
||||
{ actor_connections = [{ _1 = "Testmachine", _2 = "Actor" }]
|
||||
, actors =
|
||||
{ Actor = { module = "Shelly", params = {=} }
|
||||
}
|
||||
, init_connections = [{ _1 = "Initiator", _2 = "Testmachine" }]
|
||||
, initiators =
|
||||
{ Initiator = { module = "Dummy", params = {=} }
|
||||
}
|
||||
, listens = [{ address = "localhost", port = Some 59661 }]
|
||||
, machines =
|
||||
{ Testmachine =
|
||||
{ description = Some "A test machine"
|
||||
, disclose = "lab.test.read"
|
||||
, manage = "lab.test.admin"
|
||||
, name = "Testmachine"
|
||||
, read = "lab.test.read"
|
||||
, write = "lab.test.write"
|
||||
} }
|
||||
, mqtt_url = "tcp://localhost:1883"
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
[e5408099-d3e5-440b-a92b-3aabf7683d6b]
|
||||
name = "Somemachine"
|
||||
disclose = "lab.some.disclose"
|
||||
read = "lab.some.read"
|
||||
write = "lab.some.write"
|
||||
manage = "lab.some.admin"
|
||||
|
||||
[eaabebae-34d1-4a3a-912a-967b495d3d6e]
|
||||
name = "Testmachine"
|
||||
description = "An optional description"
|
||||
disclose = "lab.test.read"
|
||||
read = "lab.test.read"
|
||||
write = "lab.test.write"
|
||||
manage = "lab.test.admin"
|
1
examples/pass.toml
Normal file
1
examples/pass.toml
Normal file
@ -0,0 +1 @@
|
||||
Testuser = "secret"
|
11
examples/users.toml
Normal file
11
examples/users.toml
Normal file
@ -0,0 +1,11 @@
|
||||
[Testuser]
|
||||
# Define them in roles.toml as well
|
||||
roles = []
|
||||
|
||||
# If two or more users want to use the same machine at once the higher prio
|
||||
# wins
|
||||
priority = 0
|
||||
|
||||
# You can add whatever random data you want.
|
||||
# It will get stored in the `kv` field in UserData.
|
||||
noot = "noot!"
|
Reference in New Issue
Block a user