diff options
| -rw-r--r-- | src/authorization/entities.rs | 6 | ||||
| -rw-r--r-- | src/bin/cli.rs | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/authorization/entities.rs b/src/authorization/entities.rs index 6b3807d6..c2e56bd7 100644 --- a/src/authorization/entities.rs +++ b/src/authorization/entities.rs @@ -29,10 +29,8 @@ pub struct EntitiesRepository { } impl EntitiesRepository { - pub fn new(token: String, host: String) -> EntitiesRepository { - EntitiesRepository { - api: Api::new(token, host), - } + pub fn new(api: Api) -> EntitiesRepository { + EntitiesRepository { api: api } } pub async fn all( diff --git a/src/bin/cli.rs b/src/bin/cli.rs index c6c741a2..0751ed05 100644 --- a/src/bin/cli.rs +++ b/src/bin/cli.rs @@ -1,4 +1,5 @@ use authzd::EntitiesRepository; +use authzd::gitlab::Api; use clap::{Parser, Subcommand}; #[derive(Parser, Debug)] @@ -50,7 +51,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { token, host, } => { - let repository = EntitiesRepository::new(token, host); + let repository = EntitiesRepository::new(Api::new(token, host)); let entities = repository.all(project).await?; let json = serde_json::to_string_pretty(&entities)?; std::fs::write(output, json)?; |
