Skip to content

Commit

Permalink
Merge pull request #34 from titouanfreville/issue-30-secureAPI
Browse files Browse the repository at this point in the history
Updated doc
  • Loading branch information
titouanfreville authored Mar 10, 2017
2 parents 0047b51 + 440dea7 commit 5b9f1f7
Show file tree
Hide file tree
Showing 8 changed files with 892 additions and 67 deletions.
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func basicRoutes(router *chi.Mux) {
r.Route("/newfrominvite", func(r chi.Router) {
r.Use(tokenAuth.Verifier)
r.Use(allowUserCreationFromToken)
// swagger:route POST /publicuser/newfrominvite Users newPublicUser
// swagger:route POST /publicuser/newfrominvite Users newInvitedUser
//
// New user
//
Expand Down
20 changes: 19 additions & 1 deletion api/api_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,29 @@ type loginParameterModel struct {
Password string `json:"password"`
}

// swagger:parameters Login
// swagger:parameters login
type loginParam struct {
// Login informations
// in:body
Login loginParameterModel `json:"login"`
}

// <><><><><> <><><><><> <><><><><> <><><><><> //
// <><><><><> TOKENS PARAMETERS <><><><><> //

// swagger:parameters getAllAvatar getAllAvatar1 newAvatar newAvatar1 getAvatarFromLink getAvatarFromName updateAvatar deleteAvatar getAllChannel getAllChannel1 newChannel newChannel1 getPublicChannel getPrivateChannel getChannelFromType getChannelFromName updateChannel deleteChannel getAllEmoji getAllEmoji1 newEmoji1 newEmoji getEmojiFromLink getEmojiFromName getEmojiFromShortcut updateEmoji deleteEmoji getAllFolder getAllFolder1 newFolder newFolder1 getFolderFromMessage getFolderFromName getFolderFromLink getFolderFromType updateFolder deleteFolder getAllMember getAllMember1 newMember newMember1 getMemberFromChannel getMemberFromUser getMemberFromRole updateMember deleteMember getAllMessage getAllMessage1 newMessage newMessage1 getMessageFromChannel getMessageFromUser getMessageFromDate updateMessage deleteMessage getAllOrganisation getAllOrganisation1 newOrganisation newOrganisation1 updateOrganisation getAllParameter getAllParameter1 newParameter newParameter1 updateParameter getAllRole getAllRole1 newRole newRole1 getRoleFromRights getRoleFromName updateRole deleteRole getAllUser getAllUser1 newUser newUser1 inviteUser getDeletedUser getUserFromRole getOrderedByDate getUserFromName getUserFromNickName getUserFromFirstName getUserFromLastName updateUser deleteUser
type userTokenParameter struct {
// User token you got from login call. Pass it as Authentication: bearer {{token}} in the header
// required: true
// in:header
Token string `json:"token"`
}

// swagger:parameters newInvitedUser
type inviteToken struct {
// Invite token you got from user/invite call. Pass it as Authentication: bearer {{token}} in the header
// in:body
Token string `json:"token"`
}

// <><><><><> <><><><><> <><><><><> <><><><><> //
2 changes: 1 addition & 1 deletion api/avatar_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func initAvatarRoute(router chi.Router) {
// 503: databaseError
// default: genericError
r.Put("/update", updateAvatar)
// swagger:route PUT /avatar/{avatarID} Avatars updateAvatar
// swagger:route PUT /avatar/{avatarID} Avatars deleteAvatar
//
// Update avatar
//
Expand Down
2 changes: 1 addition & 1 deletion api/member_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func initMemberRoute(router chi.Router) {
// 503: databaseError
// default: genericError
r.Put("/update", updateMember)
// swagger:route PUT /member/{memberID} Members updateMember
// swagger:route PUT /member/{memberID} Members deleteMember
//
// Update member
//
Expand Down
2 changes: 1 addition & 1 deletion api/message_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func initMessageRoute(router chi.Router) {
// 503: databaseError
// default: genericError
r.Put("/update", updateMessage)
// swagger:route PUT /message/{messageID} Messages updateMessage
// swagger:route PUT /message/{messageID} Messages deleteMessage
//
// Update message
//
Expand Down
2 changes: 1 addition & 1 deletion api/role_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func initRoleRoute(router chi.Router) {
// 503: databaseError
// default: genericError
r.Get("/", getAllRole)
// swagger:route GET /role Roles getAllRole
// swagger:route GET /role Roles newRole
//
// Get roles
//
Expand Down
2 changes: 1 addition & 1 deletion api/user_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func initUserRoute(router chi.Router) {
// 503: databaseError
// default: genericError
r.Put("/update", updateUser)
// swagger:route PUT /user/{userID} Users updateUser
// swagger:route PUT /user/{userID} Users deleteUser
//
// Update user
//
Expand Down
Loading

0 comments on commit 5b9f1f7

Please sign in to comment.