Skip to content

Commit 89f27da

Browse files
committed
Rename read/write permissions to fetch/store
1 parent 086a2af commit 89f27da

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

pkg/sybil.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ kinit = false
3838
# Permission to list
3939
list = false
4040
# Permission to fetch
41-
read = false
41+
fetch = false
4242
# Permission to store
43-
write = false
43+
store = false
4444
# Permission to masquerade as any user
4545
masquerade = false

src/auth.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ bitflags! {
1717
pub struct Permissions : u32 {
1818
const KINIT = 1;
1919
const LIST = 1 << 1;
20-
const READ = 1 << 2;
21-
const WRITE = 1 << 3;
20+
const FETCH = 1 << 2;
21+
const STORE = 1 << 3;
2222
const MASQUERADE = 1 << 4;
2323
}
2424
}
@@ -34,8 +34,8 @@ impl From<&conf::Permissions> for Permissions {
3434
Self::default()
3535
| perms.kinit.then_some(Self::KINIT).unwrap_or_default()
3636
| perms.list.then_some(Self::LIST).unwrap_or_default()
37-
| perms.read.then_some(Self::READ).unwrap_or_default()
38-
| perms.write.then_some(Self::WRITE).unwrap_or_default()
37+
| perms.fetch.then_some(Self::FETCH).unwrap_or_default()
38+
| perms.store.then_some(Self::STORE).unwrap_or_default()
3939
| perms.masquerade.then_some(Self::MASQUERADE).unwrap_or_default()
4040
}
4141
}

src/conf.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const DEFAULT_TKT_MINIMUM_LIFETIME: &str = "5m";
2323
pub struct Permissions {
2424
pub kinit: bool,
2525
pub list: bool,
26-
pub read: bool,
27-
pub write: bool,
26+
pub fetch: bool,
27+
pub store: bool,
2828
pub masquerade: bool,
2929
}
3030

@@ -89,8 +89,8 @@ impl fmt::Display for Permissions {
8989
"{}{}{}{}{}",
9090
if self.kinit { "k" } else { "-" },
9191
if self.list { "l" } else { "-" },
92-
if self.read { "r" } else { "-" },
93-
if self.write { "w" } else { "-" },
92+
if self.fetch { "f" } else { "-" },
93+
if self.store { "s" } else { "-" },
9494
if self.masquerade { "m" } else { "-" }
9595
)
9696
}

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl Sybil for SybilServer {
287287
}
288288

289289
async fn put_creds(self, _: Context) -> Result<(), SybilError> {
290-
let id = &self.authorize(auth::Permissions::WRITE).await?;
290+
let id = &self.authorize(auth::Permissions::STORE).await?;
291291

292292
tracing::info!(principal = %id.principal, "put credentials request");
293293

@@ -325,9 +325,9 @@ impl Sybil for SybilServer {
325325
return Err(SybilError::Unauthorized);
326326
}
327327
let perms = if uid.is_some() {
328-
auth::Permissions::READ | auth::Permissions::MASQUERADE
328+
auth::Permissions::FETCH | auth::Permissions::MASQUERADE
329329
} else {
330-
auth::Permissions::READ
330+
auth::Permissions::FETCH
331331
};
332332
let id = &self.authorize(perms).await?;
333333

0 commit comments

Comments
 (0)