mirror of
https://github.com/optim-enterprises-bv/databunker.git
synced 2025-10-30 17:37:50 +00:00
add support for user lookup by different indeces
This commit is contained in:
@@ -210,7 +210,7 @@ func (e mainEnv) setupRouter() *httprouter.Router {
|
||||
router.POST("/v1/exp/start/:mode/:identity", e.expStart)
|
||||
router.DELETE("/v1/exp/cancel/:mode/:identity", e.expCancel)
|
||||
|
||||
router.POST("/v1/sharedrecord/token/:token", e.newSharedRecord)
|
||||
router.POST("/v1/sharedrecord/:mode/:identity", e.newSharedRecord)
|
||||
router.GET("/v1/get/:record", e.getRecord)
|
||||
|
||||
router.GET("/v1/request/:request", e.getUserRequest)
|
||||
|
||||
@@ -13,11 +13,13 @@ import (
|
||||
)
|
||||
|
||||
func (e mainEnv) newSharedRecord(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
userTOKEN := ps.ByName("token")
|
||||
event := audit("create shareable record by user token", userTOKEN, "token", userTOKEN)
|
||||
identity := ps.ByName("identity")
|
||||
mode := ps.ByName("mode")
|
||||
event := audit("create shareable record by "+mode, identity, "token", identity)
|
||||
defer func() { event.submit(e.db, e.conf) }()
|
||||
|
||||
if enforceUUID(w, userTOKEN, event) == false {
|
||||
userTOKEN := e.loadUserToken(w, r, mode, identity, event)
|
||||
if userTOKEN == "" {
|
||||
return
|
||||
}
|
||||
if e.enforceAuth(w, r, event) == "" {
|
||||
|
||||
Reference in New Issue
Block a user