Doc("TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.").
Reads(iam.TokenReview{}).
Reads(iam.TokenReview{}).
Writes(iam.TokenReview{}).
Returns(http.StatusOK,ok,iam.TokenReview{}).
Doc("k8s token review").
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.POST("/login").
ws.Route(ws.POST("/login").
To(iam.LoginHandler).
To(iam.LoginHandler).
Doc("User login").
Doc("KubeSphere APIs support token-based authentication via the Authtoken request header. The POST Login API is used to retrieve the authentication token. After the authentication token is obtained, it must be inserted into the Authtoken header for all requests.").
Reads(iam.LoginRequest{}).
Reads(iam.LoginRequest{}).
Writes(models.Token{}).
Returns(http.StatusOK,ok,models.Token{}).
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.GET("/users/{username}").
ws.Route(ws.GET("/users/{username}").
To(iam.DescribeUser).
To(iam.DescribeUser).
Doc("User detail").
Doc("Describes the specified user.").
Param(ws.PathParameter("username","username")).
Param(ws.PathParameter("username","username")).
Writes(models.User{}).
Returns(http.StatusOK,ok,models.User{}).
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.POST("/users").
ws.Route(ws.POST("/users").
To(iam.CreateUser).
To(iam.CreateUser).
Doc("Create a user account.").
Reads(models.User{}).
Reads(models.User{}).
Writes(errors.Error{}).
Returns(http.StatusOK,ok,errors.Error{}).
Doc("Create user").
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.DELETE("/users/{name}").
ws.Route(ws.DELETE("/users/{name}").
To(iam.DeleteUser).
To(iam.DeleteUser).
Doc("Remove a specified user.").
Param(ws.PathParameter("name","username")).
Param(ws.PathParameter("name","username")).
Doc("Delete user").
Returns(http.StatusOK,ok,errors.Error{}).
Writes(errors.Error{}).
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.PUT("/users/{name}").
ws.Route(ws.PUT("/users/{name}").
To(iam.UpdateUser).
To(iam.UpdateUser).
Doc("Updates information about the specified user.").
Param(ws.PathParameter("name","username")).
Param(ws.PathParameter("name","username")).
Reads(models.User{}).
Reads(models.User{}).
Writes(errors.Error{}).
Returns(http.StatusOK,ok,errors.Error{}).
Doc("Update user").
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.GET("/users/{name}/log").
ws.Route(ws.GET("/users/{name}/log").
To(iam.UserLoginLog).
To(iam.UserLoginLog).
Doc("This method is used to retrieve the \"login logs\" for the specified user.").
Param(ws.PathParameter("name","username")).
Param(ws.PathParameter("name","username")).
Doc("User login log").
Returns(http.StatusOK,ok,struct{
Writes([]map[string]string{}).
LoginTimestring`json:"login_time"`
LoginIPstring`json:"login_ip"`
}{}).
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.GET("/users").
ws.Route(ws.GET("/users").
To(iam.ListUsers).
To(iam.ListUsers).
Doc("User list").
Doc("List all users.").
Writes(models.PageableResponse{}).
Returns(http.StatusOK,ok,pageableUserList).
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.GET("/groups").
ws.Route(ws.GET("/groups").
To(iam.ListGroups).
To(iam.ListGroups).
Writes([]models.Group{}).
Doc("List all user groups.").
Doc("User group list").
Returns(http.StatusOK,ok,[]models.Group{}).
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.GET("/groups/{path}").
ws.Route(ws.GET("/groups/{path}").
To(iam.DescribeGroup).
To(iam.DescribeGroup).
Param(ws.PathParameter("path","group path")).
Doc("Describes the specified user group.").
Doc("User group detail").
Param(ws.PathParameter("path","user group path separated by colon.")).
Returns(http.StatusOK,ok,models.Group{}).
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.GET("/groups/{path}/users").
ws.Route(ws.GET("/groups/{path}/users").
To(iam.ListGroupUsers).
To(iam.ListGroupUsers).
Param(ws.PathParameter("path","group path")).
Doc("List all users in the specified user group.").
Doc("Group user list").
Param(ws.PathParameter("path","user group path separated by colon.")).
Returns(http.StatusOK,ok,[]models.User{}).
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.POST("/groups").
ws.Route(ws.POST("/groups").
To(iam.CreateGroup).
To(iam.CreateGroup).
Doc("Create a user group.").
Reads(models.Group{}).
Reads(models.Group{}).
Doc("Create user group").
Returns(http.StatusOK,ok,models.Group{}).
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.DELETE("/groups/{path}").
ws.Route(ws.DELETE("/groups/{path}").
To(iam.DeleteGroup).
To(iam.DeleteGroup).
Param(ws.PathParameter("path","group path")).
Doc("Delete a user group.").
Doc("Delete user group").
Param(ws.PathParameter("path","user group path separated by colon.")).
Returns(http.StatusOK,ok,errors.Error{}).
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.PUT("/groups/{path}").
ws.Route(ws.PUT("/groups/{path}").
To(iam.UpdateGroup).
To(iam.UpdateGroup).
Param(ws.PathParameter("path","group path")).
Doc("Updates information about the user group.").
Doc("Update user group").
Param(ws.PathParameter("path","user group path separated by colon.")).
Reads(models.Group{}).
Returns(http.StatusOK,ok,models.Group{}).
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.GET("/users/{username}/roles").
ws.Route(ws.GET("/users/{username}/roles").
To(iam.ListUserRoles).
To(iam.ListUserRoles).
Doc("This method is used to retrieve all the roles that are assigned to the user.").
Param(ws.PathParameter("username","username")).
Param(ws.PathParameter("username","username")).
Doc("Get user role list").
Returns(http.StatusOK,ok,iam.RoleList{}).
Metadata(restfulspec.KeyOpenAPITags,tags))
Metadata(restfulspec.KeyOpenAPITags,tags))
ws.Route(ws.GET("/namespaces/{namespace}/roles").
ws.Route(ws.GET("/namespaces/{namespace}/roles").
To(iam.ListRoles).
To(iam.ListRoles).
Param(ws.PathParameter("namespace","namespace")).
Doc("This method is used to retrieve the roles that are assigned to the user in the specified namespace.").