summaryrefslogtreecommitdiff
path: root/src/authorization/entities.rs
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-10 14:01:26 -0600
committermo khan <mo@mokhan.ca>2025-07-10 14:01:26 -0600
commit8e297ae732660b8174703af67b574d64145bd7dc (patch)
tree376d9ce71980be0b10d6f3fa06458dfdf5542b74 /src/authorization/entities.rs
parent155895d188ad6199247f1831b7188018532385d7 (diff)
refactor: pass project path to all()
Diffstat (limited to 'src/authorization/entities.rs')
-rw-r--r--src/authorization/entities.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/authorization/entities.rs b/src/authorization/entities.rs
index 6e7fd568..6b3807d6 100644
--- a/src/authorization/entities.rs
+++ b/src/authorization/entities.rs
@@ -26,22 +26,23 @@ pub struct CedarParent {
pub struct EntitiesRepository {
api: Api,
- project: String,
}
impl EntitiesRepository {
- pub fn new(token: String, host: String, project: String) -> EntitiesRepository {
+ pub fn new(token: String, host: String) -> EntitiesRepository {
EntitiesRepository {
api: Api::new(token, host),
- project,
}
}
- pub async fn all(&self) -> Result<Vec<CedarEntity>, Box<dyn std::error::Error>> {
+ pub async fn all(
+ &self,
+ project_path: String,
+ ) -> Result<Vec<CedarEntity>, Box<dyn std::error::Error>> {
let mut entities = Vec::new();
let mut groups = HashSet::new();
- let project = self.api.get_project(&self.project).await?;
+ let project = self.api.get_project(&project_path).await?;
entities.push(CedarEntity {
uid: CedarUid {