-
-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rust): enable auto-retry on all repositories
- Loading branch information
1 parent
a33af77
commit ef8189b
Showing
9 changed files
with
241 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
implementations/rust/ockam/ockam_api/src/cli_state/policies.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
use crate::cli_state::CliState; | ||
use crate::cli_state::{AutoRetry, CliState}; | ||
use ockam_abac::{Policies, ResourcePolicySqlxDatabase, ResourceTypePolicySqlxDatabase}; | ||
use std::sync::Arc; | ||
|
||
impl CliState { | ||
pub fn policies(&self, node_name: &str) -> Policies { | ||
Policies::new( | ||
Arc::new(ResourcePolicySqlxDatabase::new(self.database(), node_name)), | ||
Arc::new(ResourceTypePolicySqlxDatabase::new( | ||
Arc::new(AutoRetry::new(ResourcePolicySqlxDatabase::new( | ||
self.database(), | ||
node_name, | ||
)), | ||
))), | ||
Arc::new(AutoRetry::new(ResourceTypePolicySqlxDatabase::new( | ||
self.database(), | ||
node_name, | ||
))), | ||
) | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
implementations/rust/ockam/ockam_api/src/cli_state/resources.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
use crate::cli_state::AutoRetry; | ||
use crate::CliState; | ||
use ockam_abac::{Resources, ResourcesSqlxDatabase}; | ||
use std::sync::Arc; | ||
|
||
impl CliState { | ||
pub fn resources(&self, node_name: &str) -> Resources { | ||
Resources::new(Arc::new(ResourcesSqlxDatabase::new( | ||
Resources::new(Arc::new(AutoRetry::new(ResourcesSqlxDatabase::new( | ||
self.database(), | ||
node_name, | ||
))) | ||
)))) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.