mirror of
https://github.com/pushbits/server.git
synced 2025-05-24 22:36:33 +02:00
Add option to enforce strict compatibility
Some plugins check for token length. Since PushBits uses longer tokens by default for better security, these plugins are incompatible. With this patch, users can decide if they want an application to have a short token, so that said plugins can talk to PushBits again.
This commit is contained in:
parent
fb90808288
commit
d7721e827b
8 changed files with 106 additions and 30 deletions
|
@ -11,10 +11,13 @@ type Application struct {
|
|||
|
||||
// CreateApplication is used to process queries for creating applications.
|
||||
type CreateApplication struct {
|
||||
Name string `form:"name" query:"name" json:"name" binding:"required"`
|
||||
Name string `form:"name" query:"name" json:"name" binding:"required"`
|
||||
StrictCompatibility bool `form:"strict_compatibility" query:"strict_compatibility" json:"strict_compatibility"`
|
||||
}
|
||||
|
||||
// UpdateApplication is used to process queries for updating applications.
|
||||
type UpdateApplication struct {
|
||||
Name *string `json:"name"`
|
||||
Name *string `form:"new_name" query:"new_name" json:"new_name"`
|
||||
RefreshToken *bool `form:"refresh_token" query:"refresh_token" json:"refresh_token"`
|
||||
StrictCompatibility *bool `form:"strict_compatibility" query:"strict_compatibility" json:"strict_compatibility"`
|
||||
}
|
||||
|
|
|
@ -79,8 +79,8 @@ func (u *User) IntoExternalUser() *ExternalUser {
|
|||
|
||||
// UpdateUser is used to process queries for updating users.
|
||||
type UpdateUser struct {
|
||||
Name *string `json:"name"`
|
||||
Password *string `json:"password"`
|
||||
IsAdmin *bool `json:"is_admin"`
|
||||
MatrixID *string `json:"matrix_id"`
|
||||
Name *string `form:"name" query:"name" json:"name"`
|
||||
Password *string `form:"password" query:"password" json:"password"`
|
||||
IsAdmin *bool `form:"is_admin" query:"is_admin" json:"is_admin"`
|
||||
MatrixID *string `form:"matrix_id" query:"matrix_id" json:"matrix_id"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue