admin: require CSRF for S3 tables bucket writes

This commit is contained in:
Chris Lu
2026-02-10 17:58:45 -08:00
parent 5c365e7090
commit 263b7bbf53

View File

@@ -579,6 +579,9 @@ func (s *AdminServer) ListS3TablesBucketsAPI(c *gin.Context) {
}
func (s *AdminServer) CreateS3TablesBucket(c *gin.Context) {
if !requireSessionCSRFToken(c) {
return
}
var req struct {
Name string `json:"name"`
Tags map[string]string `json:"tags"`
@@ -664,6 +667,9 @@ func (s *AdminServer) SetTableBucketOwner(ctx context.Context, bucketName, owner
}
func (s *AdminServer) DeleteS3TablesBucket(c *gin.Context) {
if !requireSessionCSRFToken(c) {
return
}
bucketArn := c.Query("bucket")
if bucketArn == "" {
c.JSON(400, gin.H{"error": "Bucket ARN is required"})