1.delete apiversion and kind in property

2.alter function in registries
3.alter path
This commit is contained in:
yanmingfan
2018-05-26 14:02:54 +08:00
parent ba6392e0cf
commit 710b4b871f
5 changed files with 56 additions and 102 deletions

View File

@@ -20,18 +20,33 @@ import (
"github.com/emicklei/go-restful"
"kubesphere.io/kubesphere/pkg/models"
"kubesphere.io/kubesphere/pkg/filter/route"
"net/http"
)
func Register(ws *restful.WebService,subPath string) {
func Register(ws *restful.WebService, subPath string) {
ws.Route(ws.POST(subPath+"/login").To(models.RegistryLoginAuth).Filter(route.RouteLogging)).
Consumes(restful.MIME_JSON).
Produces(restful.MIME_JSON)
ws.Route(ws.POST(subPath+"/key").To(models.RegistryKey).Filter(route.RouteLogging)).
ws.Route(ws.POST(subPath + "/validation").To(handlerRegistryValidation).Filter(route.RouteLogging)).
Consumes(restful.MIME_JSON).
Produces(restful.MIME_JSON)
}
func handlerRegistryValidation(request *restful.Request, response *restful.Response) {
authinfo := models.AuthInfo{}
err := request.ReadEntity(&authinfo)
if err != nil {
response.WriteError(http.StatusInternalServerError, err)
}
result := models.RegistryLoginAuth(authinfo)
response.WriteAsJson(result)
}