bucket: refactor policies and fix bugs related to enforcing policies. (#2766)

This patch also addresses the problem of double caching at
object layer once at XL and another at handler layer.
This commit is contained in:
Harshavardhana
2016-09-22 23:47:48 -07:00
committed by GitHub
parent aa579bbc20
commit ca5ca8332b
10 changed files with 46 additions and 148 deletions

View File

@@ -1298,11 +1298,17 @@ func initTestAPIEndPoints(objLayer ObjectLayer, apiFunctions []string) http.Hand
// initialize a new mux router.
// goriilla/mux is the library used to register all the routes and handle them.
muxRouter := router.NewRouter()
// All object storage operations are registered as HTTP handlers on `objectAPIHandlers`.
// When the handlers get a HTTP request they use the underlyting ObjectLayer to perform operations.
objLayerMutex.Lock()
globalObjectAPI = objLayer
objLayerMutex.Unlock()
api := objectAPIHandlers{
ObjectAPI: func() ObjectLayer { return objLayer },
ObjectAPI: newObjectLayerFn,
}
// API Router.
apiRouter := muxRouter.NewRoute().PathPrefix("/").Subrouter()
// Bucket router.