feat(sync): use regclient for sync extension (#2903)

* feat(sync): use regclient for sync extension

replaced containers/image package with regclient/regclient package

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* fix(sync): fixed converting innner docker list mediatype

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* feat(sync): added option to preserve digest

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* fix(sync): added coverage and various fixes

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* fix(metadb): fixed converting manifest list not setting platform and annotations

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* fix(sync): remove read lock on storage, not used concurrently

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* feat(sync): added cache for repo tags

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* fix(sync): fixed Makefile
removed opengpg tag

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* fix(sync): add test for on demand referrer

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

---------

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>
This commit is contained in:
peusebiu
2025-04-16 02:58:15 +03:00
committed by GitHub
parent 2592d4c784
commit 0e2aa81439
58 changed files with 2279 additions and 3741 deletions
+24 -9
View File
@@ -34,6 +34,12 @@ func MakeAuthTestServer(serverKey, signAlg string, unauthorizedNamespace string)
signingMethod := jwt.GetSigningMethod(signAlg)
authTestServer := httptest.NewServer(http.HandlerFunc(func(response http.ResponseWriter, request *http.Request) {
if request.Method != http.MethodGet {
response.WriteHeader(http.StatusMethodNotAllowed)
return
}
var access []api.ResourceAccess
scope := request.URL.Query().Get("scope")
@@ -94,10 +100,21 @@ func MakeAuthTestServerLegacy(serverKey string, unauthorizedNamespace string) *h
}
authTestServer := httptest.NewServer(http.HandlerFunc(func(response http.ResponseWriter, request *http.Request) {
if request.Method != http.MethodGet {
response.WriteHeader(http.StatusMethodNotAllowed)
return
}
var access []auth.AccessEntry
scope := request.URL.Query().Get("scope")
if scope != "" {
scopes := request.URL.Query()["scope"]
for _, scope := range scopes {
if scope == "" {
continue
}
parts := strings.Split(scope, ":")
name := parts[1]
actions := strings.Split(parts[2], ",")
@@ -106,13 +123,11 @@ func MakeAuthTestServerLegacy(serverKey string, unauthorizedNamespace string) *h
actions = []string{}
}
access = []auth.AccessEntry{
{
Name: name,
Type: "repository",
Actions: actions,
},
}
access = append(access, auth.AccessEntry{
Name: name,
Type: "repository",
Actions: actions,
})
}
token, err := cmTokenGenerator.GenerateToken(access, time.Minute*1)