mirror of
https://github.com/gotify/server.git
synced 2026-06-07 23:37:06 +08:00
Make security more compact
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -52,10 +52,7 @@ type pagingParams struct {
|
||||
//
|
||||
// ---
|
||||
// produces: [application/json]
|
||||
// security:
|
||||
// - clientTokenHeader: []
|
||||
// - clientTokenQuery: []
|
||||
// - basicAuth: []
|
||||
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
|
||||
// parameters:
|
||||
// - name: limit
|
||||
// in: query
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
35
api/user.go
35
api/user.go
@@ -33,10 +33,7 @@ type UserAPI struct {
|
||||
//
|
||||
// ---
|
||||
// produces: [application/json]
|
||||
// security:
|
||||
// - clientTokenHeader: []
|
||||
// - clientTokenQuery: []
|
||||
// - basicAuth: []
|
||||
// security: [clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]
|
||||
// responses:
|
||||
// 200:
|
||||
// description: Ok
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user