Refactor the websocket client and add fixes
The websocket client and hub interaction has been simplified a bit. The hub now acts only as a tee writer to the various clients that register. Clients must register and unregister explicitly. The hub is no longer passed in to the client. Websocket clients now watch for password changes or jwt token expiration times. Clients are disconnected if auth token expires or if the password is changed. Various aditional safety checks have been added. Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
ca7f20b62d
commit
dd1740c189
17 changed files with 426 additions and 143 deletions
|
|
@ -543,9 +543,11 @@ type User struct {
|
|||
Email string `json:"email"`
|
||||
Username string `json:"username"`
|
||||
FullName string `json:"full_name"`
|
||||
Password string `json:"-"`
|
||||
Enabled bool `json:"enabled"`
|
||||
IsAdmin bool `json:"is_admin"`
|
||||
// Do not serialize sensitive info.
|
||||
Password string `json:"-"`
|
||||
Generation uint `json:"-"`
|
||||
}
|
||||
|
||||
// JWTResponse holds the JWT token returned as a result of a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue