skip configuration update in readonly mode

Admin must have a way to switch off the readonly by call configuration api,
either internal or external.

Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
wang yan 2020-03-06 00:34:23 +08:00
parent c8ca6a5ccf
commit 8b4211717e

View File

@ -41,6 +41,8 @@ var (
// readonlySkippers skip the post request when harbor sets to readonly. // readonlySkippers skip the post request when harbor sets to readonly.
readonlySkippers = []middleware.Skipper{ readonlySkippers = []middleware.Skipper{
middleware.MethodAndPathSkipper(http.MethodPut, match("^/api/v2.0/configurations")),
middleware.MethodAndPathSkipper(http.MethodPut, match("^/api/internal/configurations")),
middleware.MethodAndPathSkipper(http.MethodPost, match("^/c/login")), middleware.MethodAndPathSkipper(http.MethodPost, match("^/c/login")),
middleware.MethodAndPathSkipper(http.MethodPost, match("^/c/userExists")), middleware.MethodAndPathSkipper(http.MethodPost, match("^/c/userExists")),
middleware.MethodAndPathSkipper(http.MethodPost, match("^/c/oidc/onboard")), middleware.MethodAndPathSkipper(http.MethodPost, match("^/c/oidc/onboard")),