Documentation ¶
Index ¶
- Constants
- type Guard
- func (g *Guard) AddNodeToRole(c *gin.Context)
- func (g *Guard) AddUserToRole(c *gin.Context)
- func (g *Guard) BanUser(c *gin.Context)
- func (g *Guard) BatchRemoveNodeFromRole(c *gin.Context)
- func (g *Guard) BatchRemoveUserFromRole(c *gin.Context)
- func (g *Guard) CreateNode(c *gin.Context)
- func (g *Guard) CreateRole(c *gin.Context)
- func (g *Guard) CreateSpace(c *gin.Context)
- func (g *Guard) CreateUser(c *gin.Context)
- func (g *Guard) DeleteNode(c *gin.Context)
- func (g *Guard) DeleteRole(c *gin.Context)
- func (g *Guard) GetAuthorizedKeys(c *gin.Context)
- func (g *Guard) GetCA(c *gin.Context)
- func (g *Guard) GetKRL(c *gin.Context)
- func (g *Guard) GetPrincipals(c *gin.Context)
- func (g *Guard) GetUser(c *gin.Context)
- func (g *Guard) GrantCert(c *gin.Context)
- func (g *Guard) IsAllowedNode(c *gin.Context)
- func (g *Guard) ListNode(c *gin.Context)
- func (g *Guard) ListRole(c *gin.Context)
- func (g *Guard) ListRoleNode(c *gin.Context)
- func (g *Guard) ListRoleUser(c *gin.Context)
- func (g *Guard) ListSpace(c *gin.Context)
- func (g *Guard) ListUser(c *gin.Context)
- func (g *Guard) QueryUser(c *gin.Context)
- func (g *Guard) Signature(c *gin.Context)
- func (g *Guard) UpdateNodeLastHeartbeat(c *gin.Context)
- func (g *Guard) UpdateUserPublicKey(c *gin.Context)
Constants ¶
const ( HeaderTimestamp = "X-Timestamp" HeaderSignature = "X-Signature" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Guard ¶
type Guard struct {
// contains filtered or unexported fields
}
func (*Guard) AddNodeToRole ¶
@Summary AddNodeToRole @Description Add node to role @Tags role @Param spaceID path int true "Space ID" @Param roleID path int true "Role ID" @Param body body service.RoleNodeListRequest true "node list" @Success 200 {object} nil @Router /api/v1/guard/space/{spaceID}/role/{roleID}/node [post]
func (*Guard) AddUserToRole ¶
@Summary AddUserToRole @Description Add user to role @Tags role @Param spaceID path int true "Space ID" @Param roleID path int true "Role ID" @Param body body []int64 true "User IDs" @Success 200 {object} nil @Router /api/v1/guard/space/{spaceID}/role/{roleID}/user [post]
func (*Guard) BanUser ¶
@Summary BanUser @Description Ban user @Tags user @Param userID path int true "User ID" @Success 200 {object} nil @Router /api/v1/guard/user/{userID}/ban [post]
func (*Guard) BatchRemoveNodeFromRole ¶
@Summary BatchRemoveNodeFromRole @Description Batch remove node from role @Tags role @Param spaceID path int true "Space ID" @Param roleID path int true "Role ID" @Param body body []int64 true "Node IDs" @Success 200 {object} nil @Router /api/v1/guard/space/{spaceID}/role/{roleID}/node/batch/delete [post]
func (*Guard) BatchRemoveUserFromRole ¶
@Summary BatchRemoveUserFromRole @Description Batch remove user from role @Tags role @Param spaceID path int true "Space ID" @Param roleID path int true "Role ID" @Param body body []int64 true "User IDs" @Success 200 {object} nil @Router /api/v1/guard/space/{spaceID}/role/{roleID}/user/batch/delete [post]
func (*Guard) CreateNode ¶
@Summary CreateNode @Description Create node @Tags node @Param spaceID path int true "Space ID" @Param body body service.CreateNodeRequest true "Create node request" @Success 200 {object} service.CreateNodeResponse @Router /api/v1/guard/space/{spaceID}/node [post]
func (*Guard) CreateRole ¶
@Summary CreateRole @Description Create role @Tags role @Param spaceID path int true "Space ID" @Param body body service.CreateRoleRequest true "Create role request" @Success 200 {object} nil
func (*Guard) CreateSpace ¶
@Summary CreateSpace @Description Create space @Tags space @Param body body service.CreateSpaceRequest true "Create space request" @Success 200 {object} nil @Router /api/v1/guard/space [post]
func (*Guard) CreateUser ¶
@Summary CreateUser @Description Create user @Tags user @Router /api/v1/guard/user [post] @Param body body service.CreateUserRequest true "Create user request" @Success 200 {object} nil
func (*Guard) DeleteNode ¶
@Summary DeleteNode @Description Delete node @Tags node @Param spaceID path int true "Space ID" @Param nodeID path int true "Node ID" @Success 200 {object} nil @Router /api/v1/guard/space/{spaceID}/node/{nodeID} [delete]
func (*Guard) DeleteRole ¶
@Summary DeleteRole @Description Delete role @Tags role @Param spaceID path int true "Space ID" @Param roleID path int true "Role ID" @Success 200 {object} nil @Router /api/v1/guard/space/{spaceID}/role/{roleID} [delete]
func (*Guard) GetAuthorizedKeys ¶
@Summary GetAuthorizedKeys @Description Get authorized keys @Tags Guard @Param node_id query string true "Node ID" @Param X-Timestamp header string true "unix timestamp, seconds" @Param X-Signature header string true "signature" @Success 200 {object} []string "Authorized keys" @Router /api/v1/guard/authorizedKeys [get]
func (*Guard) GetCA ¶
@Summary GetCA @Description Get CA certificate @Tags Guard @Param node_id query string true "Node ID" @Param X-Timestamp header string true "unix timestamp, seconds" @Param X-Signature header string true "signature" @Router /api/v1/guard/ca [get] @Router /api/v1/guard/ca [get] @Success 200 {string} string "CA certificate"
func (*Guard) GetKRL ¶
@Summary GetKRL @Description Get revoked key list (KRL) @Tags Guard @Param node_id query string true "Node ID" @Param X-Timestamp header string true "unix timestamp, seconds" @Param X-Signature header string true "signature" @Success 200 {object} []byte "KRL" @Router /api/v1/guard/krl [get]
func (*Guard) GetPrincipals ¶
@Summary GetPrincipals @Description Get principals @Tags Guard @Param node_id query string true "Node ID" @Param X-Timestamp header string true "unix timestamp, seconds" @Param X-Signature header string true "signature" @Success 200 {object} service.PrincipalList "principals" @Router /api/v1/guard/principals [get]
func (*Guard) GetUser ¶
@Summary GetUser @Description Get user @Tags user @Param userID path int true "User ID" @Success 200 {object} service.UserVO @Router /api/v1/guard/user/{userID} [get]
func (*Guard) GrantCert ¶
@Summary GrantCert @Description Grant certificate @Tags user @Param userID path int true "User ID" @Param body body service.GrantCertRequest true "Grant certificate request" @Success 200 {object} service.GrantCertResponse @Router /api/v1/guard/user/{userID}/cert [post]
func (*Guard) IsAllowedNode ¶
func (*Guard) ListNode ¶
@Summary ListNode @Description List nodes @Tags node @Param spaceID path int true "Space ID" @Param page query int true "page" @Param limit query int true "limit" @Success 200 {object} service.ListNodeResponse @Router /api/v1/guard/space/{spaceID}/node [get]
func (*Guard) ListRole ¶
@Summary ListRole @Description List roles @Tags role @Param spaceID path int true "Space ID" @Success 200 {object} service.ListRoleResponse @Router /api/v1/guard/space/{spaceID}/role [get]
func (*Guard) ListRoleNode ¶
@Summary ListRoleNode @Description List role nodes @Tags role @Param spaceID path int true "Space ID" @Param roleID path int true "Role ID" @Success 200 {object} service.ListRoleNodeResponse @Router /api/v1/guard/space/{spaceID}/role/{roleID}/node [get]
func (*Guard) ListRoleUser ¶
@Summary ListRoleUser @Description List role users @Tags role @Param spaceID path int true "Space ID" @Param roleID path int true "Role ID" @Success 200 {object} service.ListRoleUserResponse @Router /api/v1/guard/space/{spaceID}/role/{roleID}/user [get]
func (*Guard) ListSpace ¶
@Summary ListSpace @Description List spaces @Tags space @Success 200 {object} service.ListSpaceResponse @Router /api/v1/guard/space [get]
func (*Guard) ListUser ¶
@Summary ListUser @Description List users @Tags user @Param page query int true "page" @Param limit query int tue "limit" @Success 200 {object} service.ListUserResponse @Router /api/v1/guard/user [get]
func (*Guard) QueryUser ¶
@Summary QueryUser @Description Query user @Tags user @Param email query string true "Email" @Success 200 {object} service.UserVO @Router /api/v1/guard/user [get]
func (*Guard) Signature ¶
Signature is a middleware to sign the response with the secret of the node
func (*Guard) UpdateNodeLastHeartbeat ¶
func (*Guard) UpdateUserPublicKey ¶
@Summary UpdateUserPublicKey @Description Update user public key @Tags user @Param userID path int true "User ID" @Param body body string true "Public key" @Success 200 {object} nil @Router /api/v1/guard/user/{userID}/publicKey [put]