Block RGW request using Lua

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello everyone,

I've started playing with Lua scripting and would like to ask If anyone knows about a way to drop or close user request on the prerequest context.

I would like to block creating buckets with dots in the name, but the use-case could be blocking certain operations, etc.

I was able to come up with some like this

if string.find(Request.HTTP.URI, '%.') then
   Request.Response.HTTPStatusCode = 400
   Request.Response.HTTPStatus = "InvalidBucketName"
   Request.Response.Message = "Dots are not allowed."
end

This works fine, but the bucket is created which is something that I don't want to do. As a dirty workaround, I've thought about changing the bucket name here to an already existing bucket, but the Request.Bucket.Name = "taken" doesn't seem to work as the log gives me an error "attempt to index a nil value (field 'Bucket')".

Any help is much appreciated.
_______________________________________________
ceph-users mailing list -- ceph-users@xxxxxxx
To unsubscribe send an email to ceph-users-leave@xxxxxxx



[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux