Skip to content

Commit

Permalink
[Rename] Removed "diem" from secure directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLind authored and aptos-bot committed Mar 28, 2022
1 parent 79acf64 commit fe143cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions secure/storage/src/vault.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ pub mod policy {
use crate::{Capability, Identity, Policy};
use aptos_vault_client as vault;

const DIEM_DEFAULT: &str = "diem_default";
const APTOS_DEFAULT: &str = "aptos_default";

/// VaultStorage utilizes Vault for maintaining encrypted, authenticated data. This
/// version currently matches the behavior of OnDiskStorage and InMemoryStorage. In the future,
Expand Down Expand Up @@ -357,7 +357,7 @@ pub mod policy {

/// Creates a token but uses the namespace for policies
pub fn create_token(&self, mut policies: Vec<&str>) -> Result<String, Error> {
policies.push(DIEM_DEFAULT);
policies.push(APTOS_DEFAULT);
let result = if let Some(ns) = &self.namespace {
let policies: Vec<_> = policies.iter().map(|p| format!("{}/{}", ns, p)).collect();
self.client()
Expand Down Expand Up @@ -420,7 +420,7 @@ pub mod policy {
match &perm.id {
Identity::User(id) => self.set_policy(id, engine, name, &perm.capabilities)?,
Identity::Anyone => {
self.set_policy(DIEM_DEFAULT, engine, name, &perm.capabilities)?
self.set_policy(APTOS_DEFAULT, engine, name, &perm.capabilities)?
}
Identity::NoOne => (),
};
Expand Down
8 changes: 4 additions & 4 deletions secure/storage/vault/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use std::{
process::{Child, Command, Stdio},
};

static DIEM_VAULT: Lazy<Option<VaultRunner>> = Lazy::new(|| match VaultRunner::run() {
static APTOS_VAULT: Lazy<Option<VaultRunner>> = Lazy::new(|| match VaultRunner::run() {
Err(err) => {
assert!(
std::env::var("DIEM_REQUIRE_VAULT_TESTS").is_err(),
std::env::var("APTOS_REQUIRE_VAULT_TESTS").is_err(),
"Vault is not running: {}",
err
);
Expand All @@ -24,7 +24,7 @@ static DIEM_VAULT: Lazy<Option<VaultRunner>> = Lazy::new(|| match VaultRunner::r
/// This will return the vault host, if vault was started successfully. If vault is expected to be
/// available, an assertion will cause this to fail.
pub fn test_host_safe() -> Option<String> {
DIEM_VAULT.as_ref().map(|v| v.host().to_string())
APTOS_VAULT.as_ref().map(|v| v.host().to_string())
}

/// This will return the vault host or panic.
Expand Down Expand Up @@ -134,7 +134,7 @@ fn run_vault() {
let vr = VaultRunner::run();
if let Err(err) = vr {
assert!(
std::env::var("DIEM_REQUIRE_VAULT_TESTS").is_err(),
std::env::var("APTOS_REQUIRE_VAULT_TESTS").is_err(),
"Vault is not running: {}",
err
);
Expand Down

0 comments on commit fe143cf

Please sign in to comment.