|
|
@ -21,6 +21,7 @@ import (
|
|
|
|
container_module "code.gitea.io/gitea/modules/packages/container"
|
|
|
|
container_module "code.gitea.io/gitea/modules/packages/container"
|
|
|
|
"code.gitea.io/gitea/modules/setting"
|
|
|
|
"code.gitea.io/gitea/modules/setting"
|
|
|
|
api "code.gitea.io/gitea/modules/structs"
|
|
|
|
api "code.gitea.io/gitea/modules/structs"
|
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/test"
|
|
|
|
"code.gitea.io/gitea/tests"
|
|
|
|
"code.gitea.io/gitea/tests"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/minio/sha256-simd"
|
|
|
|
"github.com/minio/sha256-simd"
|
|
|
@ -106,6 +107,14 @@ func TestPackageContainer(t *testing.T) {
|
|
|
|
req = NewRequest(t, "GET", fmt.Sprintf("%sv2", setting.AppURL)).
|
|
|
|
req = NewRequest(t, "GET", fmt.Sprintf("%sv2", setting.AppURL)).
|
|
|
|
AddTokenAuth(anonymousToken)
|
|
|
|
AddTokenAuth(anonymousToken)
|
|
|
|
MakeRequest(t, req, http.StatusOK)
|
|
|
|
MakeRequest(t, req, http.StatusOK)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defer test.MockVariableValue(&setting.Service.RequireSignInView, true)()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
req = NewRequest(t, "GET", fmt.Sprintf("%sv2", setting.AppURL))
|
|
|
|
|
|
|
|
MakeRequest(t, req, http.StatusUnauthorized)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
req = NewRequest(t, "GET", fmt.Sprintf("%sv2/token", setting.AppURL))
|
|
|
|
|
|
|
|
MakeRequest(t, req, http.StatusUnauthorized)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
t.Run("User", func(t *testing.T) {
|
|
|
|
t.Run("User", func(t *testing.T) {
|
|
|
|