uuid used

This commit is contained in:
2026-02-20 15:06:15 +02:00
parent 35e83ed705
commit 8546ad496f
31 changed files with 265 additions and 238 deletions
+8 -7
View File
@@ -16,6 +16,7 @@ import (
"mstore/app/operator"
"mstore/app/router"
"mstore/pkg/auxuuid"
"mstore/pkg/terms"
)
@@ -32,7 +33,7 @@ func (hand *Handler) BlobExists(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -72,7 +73,7 @@ func (hand *Handler) PostUpload(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -88,7 +89,7 @@ func (hand *Handler) PostUpload(rctx *router.Context) {
} else {
rctx.SetHeader("Location", res.Location)
rctx.SetHeader("Content-Length", res.ContentLength)
rctx.SetHeader("Docker-Upload-UUID", res.DockerUploadUUID)
rctx.SetHeader("Docker-Upload-UUID", string(res.DockerUploadUUID))
}
rctx.SetStatus(code)
}
@@ -117,7 +118,7 @@ func (hand *Handler) PatchUpload(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -161,7 +162,7 @@ func (hand *Handler) PutUpload(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -191,7 +192,7 @@ func (hand *Handler) GetBlob(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -237,7 +238,7 @@ func (hand *Handler) DeleteBlob(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return