Enable explicitly configured private artifact storage for authenticated production releases
This commit is contained in:
@@ -51,8 +51,8 @@ fn regular(file: &File, owner: u32, expected_size: u64) -> Result<fs::Metadata>
|
||||
impl UpdateArtifacts {
|
||||
pub fn new(profile: &str, root: PathBuf, owner: u32) -> Result<Self> {
|
||||
ensure!(
|
||||
profile == "development",
|
||||
"update object adapter is development-only"
|
||||
matches!(profile, "development" | "production") && root.is_absolute(),
|
||||
"release store requires a configured profile and absolute path"
|
||||
);
|
||||
Self::private_directory(root, owner)
|
||||
}
|
||||
@@ -246,7 +246,9 @@ mod tests {
|
||||
fs::set_permissions(&root, fs::Permissions::from_mode(0o700)).unwrap();
|
||||
let owner = fs::metadata(&root).unwrap().uid();
|
||||
let store = UpdateArtifacts::new("development", root.clone(), owner).unwrap();
|
||||
assert!(UpdateArtifacts::new("production", root.clone(), owner).is_err());
|
||||
assert!(UpdateArtifacts::new("production", root.clone(), owner).is_ok());
|
||||
assert!(UpdateArtifacts::new("unknown", root.clone(), owner).is_err());
|
||||
assert!(UpdateArtifacts::new("production", PathBuf::from("relative"), owner).is_err());
|
||||
let tenant = Uuid::new_v4();
|
||||
let bytes = vec![37_u8; 300_007];
|
||||
let hash = rmm_domain::jobs::hash(&bytes);
|
||||
|
||||
Reference in New Issue
Block a user