Skip to content

Commit f9a1a80

Browse files
authored
[CLN] Enable quota for fork (#4360)
## Description of changes *Summarize the changes made by this PR.* - Improvements & Bug fixes - Enables quota for fork in order to gate access - New functionality - None ## Test plan *How are these changes tested?* - [x] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Documentation Changes None
1 parent 5b242e4 commit f9a1a80

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

rust/frontend/src/server.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ pub struct ForkCollectionPayload {
11351135
)
11361136
)]
11371137
async fn fork_collection(
1138-
_headers: HeaderMap,
1138+
headers: HeaderMap,
11391139
Path((tenant, database, collection_id)): Path<(String, String, String)>,
11401140
State(mut server): State<FrontendServer>,
11411141
Json(payload): Json<ForkCollectionPayload>,
@@ -1152,17 +1152,17 @@ async fn fork_collection(
11521152
);
11531153
// NOTE: The quota check if skipped for fork collection for now, and we rely on the scorecard to limit access to certain tenents
11541154
// TODO: Unify the quota and scorecard
1155-
// server
1156-
// .authenticate_and_authorize(
1157-
// &headers,
1158-
// AuthzAction::ForkCollection,
1159-
// AuthzResource {
1160-
// tenant: Some(tenant.clone()),
1161-
// database: Some(database.clone()),
1162-
// collection: Some(collection_id.clone()),
1163-
// },
1164-
// )
1165-
// .await?;
1155+
server
1156+
.authenticate_and_authorize(
1157+
&headers,
1158+
AuthzAction::ForkCollection,
1159+
AuthzResource {
1160+
tenant: Some(tenant.clone()),
1161+
database: Some(database.clone()),
1162+
collection: Some(collection_id.clone()),
1163+
},
1164+
)
1165+
.await?;
11661166
let _guard =
11671167
server.scorecard_request(&["op:fork_collection", format!("tenant:{}", tenant).as_str()]);
11681168
let collection_id =

0 commit comments

Comments
 (0)