diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/authorization/entities.rs | 11 | ||||
| -rw-r--r-- | src/bin/cli.rs | 4 |
2 files changed, 8 insertions, 7 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 { diff --git a/src/bin/cli.rs b/src/bin/cli.rs index fbd07d35..c6c741a2 100644 --- a/src/bin/cli.rs +++ b/src/bin/cli.rs @@ -50,8 +50,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { token, host, } => { - let repository = EntitiesRepository::new(token, host, project); - let entities = repository.all().await?; + let repository = EntitiesRepository::new(token, host); + let entities = repository.all(project).await?; let json = serde_json::to_string_pretty(&entities)?; std::fs::write(output, json)?; } |
