diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-10 13:10:52 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-10 13:10:52 -0600 |
| commit | ff30574117a996df332e23d1fb6f65259b316b5b (patch) | |
| tree | 8105765403000ae2a792ba4af5946f3928c6ec04 /src/bin/cli.rs | |
| parent | 7f253078df95ea0ec725ccbd000f11723697b64d (diff) | |
refactor: move functions to repository type
Diffstat (limited to 'src/bin/cli.rs')
| -rw-r--r-- | src/bin/cli.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/bin/cli.rs b/src/bin/cli.rs index 275bd410..d0bbe989 100644 --- a/src/bin/cli.rs +++ b/src/bin/cli.rs @@ -1,4 +1,4 @@ -use authzd::{generate_entities_from_api, write_entities_file}; +use authzd::EntitiesRepository; use clap::{Parser, Subcommand}; #[derive(Parser, Debug)] @@ -50,9 +50,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { token, host, } => { - let entities = generate_entities_from_api(token, host, project).await?; - - write_entities_file(&entities, &output)?; + let repository = EntitiesRepository::new(token, host, project); + let entities = repository.generate().await?; + let json = serde_json::to_string_pretty(&entities)?; + std::fs::write(output, json)?; } } |
