Skip to content

Commit

Permalink
Make security more compact
Browse files Browse the repository at this point in the history
  • Loading branch information
jmattheis committed Nov 24, 2018
1 parent 9e7859c commit 76ca344
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 84 deletions.
25 changes: 5 additions & 20 deletions api/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ type ApplicationAPI struct {
// ---
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// parameters:
// - name: body
// in: body
Expand Down Expand Up @@ -84,10 +81,7 @@ func (a *ApplicationAPI) CreateApplication(ctx *gin.Context) {
// ---
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// responses:
// 200:
// description: Ok
Expand Down Expand Up @@ -126,10 +120,7 @@ func (a *ApplicationAPI) GetApplications(ctx *gin.Context) {
// description: the application id
// required: true
// type: integer
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// responses:
// 200:
// description: Ok
Expand Down Expand Up @@ -170,10 +161,7 @@ func (a *ApplicationAPI) DeleteApplication(ctx *gin.Context) {
// ---
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// parameters:
// - name: body
// in: body
Expand Down Expand Up @@ -234,10 +222,7 @@ func (a *ApplicationAPI) UpdateApplication(ctx *gin.Context) {
// consumes:
// - multipart/form-data
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// parameters:
// - name: file
// in: formData
Expand Down
15 changes: 3 additions & 12 deletions api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ type ClientAPI struct {
// ---
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// parameters:
// - name: body
// in: body
Expand Down Expand Up @@ -78,10 +75,7 @@ func (a *ClientAPI) CreateClient(ctx *gin.Context) {
// ---
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// responses:
// 200:
// description: Ok
Expand Down Expand Up @@ -117,10 +111,7 @@ func (a *ClientAPI) GetClients(ctx *gin.Context) {
// description: the client id
// required: true
// type: integer
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// responses:
// 200:
// description: Ok
Expand Down
25 changes: 5 additions & 20 deletions api/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ type pagingParams struct {
//
// ---
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// parameters:
// - name: limit
// in: query
Expand Down Expand Up @@ -132,10 +129,7 @@ func withPaging(ctx *gin.Context, f func(pagingParams *pagingParams)) {
//
// ---
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// parameters:
// - name: id
// in: path
Expand Down Expand Up @@ -198,10 +192,7 @@ func (a *MessageAPI) GetMessagesWithApplication(ctx *gin.Context) {
//
// ---
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// responses:
// 200:
// description: Ok
Expand All @@ -225,10 +216,7 @@ func (a *MessageAPI) DeleteMessages(ctx *gin.Context) {
//
// ---
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// parameters:
// - name: id
// in: path
Expand Down Expand Up @@ -271,10 +259,7 @@ func (a *MessageAPI) DeleteMessageWithApplication(ctx *gin.Context) {
//
// ---
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// parameters:
// - name: id
// in: path
Expand Down
5 changes: 1 addition & 4 deletions api/stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ func (a *API) register(client *client) {
// ---
// schema: ws, wss
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// responses:
// 200:
// description: Ok
Expand Down
35 changes: 7 additions & 28 deletions api/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ type UserAPI struct {
//
// ---
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// responses:
// 200:
// description: Ok
Expand Down Expand Up @@ -70,10 +67,7 @@ func (a *UserAPI) GetUsers(ctx *gin.Context) {
//
// ---
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// responses:
// 200:
// description: Ok
Expand All @@ -100,10 +94,7 @@ func (a *UserAPI) GetCurrentUser(ctx *gin.Context) {
// ---
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// parameters:
// - name: body
// in: body
Expand Down Expand Up @@ -149,10 +140,7 @@ func (a *UserAPI) CreateUser(ctx *gin.Context) {
// ---
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// parameters:
// - name: id
// in: path
Expand Down Expand Up @@ -197,10 +185,7 @@ func (a *UserAPI) GetUserByID(ctx *gin.Context) {
//
// ---
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// parameters:
// - name: id
// in: path
Expand Down Expand Up @@ -245,10 +230,7 @@ func (a *UserAPI) DeleteUserByID(ctx *gin.Context) {
// ---
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// parameters:
// - name: body
// in: body
Expand Down Expand Up @@ -288,10 +270,7 @@ func (a *UserAPI) ChangePassword(ctx *gin.Context) {
// ---
// consumes: [application/json]
// produces: [application/json]
// security:
// - clientTokenHeader: []
// - clientTokenQuery: []
// - basicAuth: []
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
// parameters:
// - name: id
// in: path
Expand Down

0 comments on commit 76ca344

Please sign in to comment.