audit log

This commit is contained in:
Konstantin Lebedev
2021-12-07 12:15:48 +05:00
parent 3ac48cd540
commit 4ec8715f20
17 changed files with 106 additions and 87 deletions

View File

@@ -16,6 +16,12 @@
package http
import (
"github.com/gorilla/mux"
"net/http"
"strings"
)
// Standard S3 HTTP request constants
const (
// S3 storage class
@@ -34,3 +40,14 @@ const (
AmzIdentityId = "s3-identity-id"
AmzIsAdmin = "s3-is-admin" // only set to http request header as a context
)
func GetBucketAndObject(r *http.Request) (bucket, object string) {
vars := mux.Vars(r)
bucket = vars["bucket"]
object = vars["object"]
if !strings.HasPrefix(object, "/") {
object = "/" + object
}
return
}