Skip to content

Commit 3ddb050

Browse files
lmvasquezgmeta-codesync[bot]
authored andcommitted
Implement validate_slacl hook logic
Summary: Wire up the actual .slacl validation by reusing the existing parse_acl_file parser from restricted_paths_acl_file. The hook now reads file contents for any file named .slacl, attempts to parse it as a valid restricted paths ACL file (TOML format, version 0, REPO_REGION identity type), and rejects the push with a descriptive error on parse failure. Updates the test assertions from the previous commit to assert Rejected for malformed inputs. Reviewed By: gustavoavena Differential Revision: D104667156 fbshipit-source-id: 4bf1136a142281a206fa7f20e7f7a77c98a7cea3
1 parent 79b3143 commit 3ddb050

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

eden/mononoke/features/hooks/BUCK

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ rust_library(
8484
"//eden/mononoke/repo_attributes/repo_derived_data:repo_derived_data",
8585
"//eden/mononoke/repo_attributes/repo_identity:repo_identity",
8686
"//eden/mononoke/repo_attributes/restricted_paths:restricted_paths",
87+
"//eden/mononoke/repo_attributes/restricted_paths_acl_file:restricted_paths_acl_file",
8788
"//eden/mononoke/scs/if:source_control-rust",
8889
"//eden/mononoke/scs/if:source_control-rust-clients",
8990
"//eden/mononoke/servers/slapi/slapi_server/context:context",

eden/mononoke/features/hooks/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ repo_cross_repo = { version = "0.1.0", path = "../../repo_attributes/repo_cross_
5050
repo_derived_data = { version = "0.1.0", path = "../../repo_attributes/repo_derived_data" }
5151
repo_identity = { version = "0.1.0", path = "../../repo_attributes/repo_identity" }
5252
restricted_paths = { version = "0.1.0", path = "../../repo_attributes/restricted_paths" }
53+
restricted_paths_acl_file = { version = "0.1.0", path = "../../repo_attributes/restricted_paths_acl_file" }
5354
sapling-clientinfo = { version = "0.1.0", path = "../../../scm/lib/clientinfo" }
5455
scuba_ext = { version = "0.1.0", path = "../../common/scuba_ext" }
5556
serde = { version = "1.0.219", features = ["derive", "rc"] }

0 commit comments

Comments
 (0)