mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-22 06:47:56 +01:00
Implement wiki and URN links
This commit is contained in:
parent
4d2b0ea29c
commit
7bcb0712ae
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -515,7 +515,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "diflouroborane"
|
||||
version = "0.2.0"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"async-trait",
|
||||
|
@ -148,6 +148,10 @@ impl machines::Server for Machines {
|
||||
if let Some(ref desc) = machine.desc.description {
|
||||
builder.set_description(desc);
|
||||
}
|
||||
if let Some(ref wiki) = machine.desc.wiki {
|
||||
builder.set_wiki(wiki);
|
||||
}
|
||||
builder.set_urn(&format!("urn:fabaccess:resource:{}", &name));
|
||||
|
||||
let machineapi = Machine::new(user.clone(), perms, machine.clone());
|
||||
let state = machine.get_status().await;
|
||||
|
@ -80,6 +80,7 @@ impl Default for Config {
|
||||
machines.insert("Testmachine".to_string(), MachineDescription {
|
||||
name: "Testmachine".to_string(),
|
||||
description: Some("A test machine".to_string()),
|
||||
wiki: None,
|
||||
privs: PrivilegesBuf {
|
||||
disclose: PermissionBuf::from_string("lab.test.read".to_string()),
|
||||
read: PermissionBuf::from_string("lab.test.read".to_string()),
|
||||
|
@ -65,7 +65,7 @@ pub struct Machine {
|
||||
}
|
||||
|
||||
impl Machine {
|
||||
pub fn new(inner: Inner, desc: MachineDescription, ) -> Self {
|
||||
pub fn new(inner: Inner, desc: MachineDescription) -> Self {
|
||||
Self {
|
||||
id: uuid::Uuid::default(),
|
||||
inner: Arc::new(Mutex::new(inner)),
|
||||
@ -226,6 +226,10 @@ pub struct MachineDescription {
|
||||
/// An optional description of the Machine.
|
||||
pub description: Option<String>,
|
||||
|
||||
#[serde(default)]
|
||||
#[serde(flatten)]
|
||||
pub wiki: Option<String>,
|
||||
|
||||
/// The permission required
|
||||
#[serde(flatten)]
|
||||
pub privs: access::PrivilegesBuf,
|
||||
|
Loading…
Reference in New Issue
Block a user