Remove remote users from the license counting and explicitly dissallow them to log in (#22582)
* Making all the counts aware of Remote users * Disable login for remote users * Adding tests for login remote_users error * Adding tests for the store * Adding frontend part of not counting remote users in the license * Addressing PR review comment * Adding the new ExternaUserId field to users * Running make migrations-extract * Running make app-layers and make gen-serialized * Revert "Adding the new ExternaUserId field to users" This reverts commit 12e5fd518962a16cdbdb8964179b6cd8e915f230. * Adding GetUserByRemoteID methods * Adding needed migration for users * i18n-extract * Fixing postgres increase remote user id field size migration up and down * run make gen-serialized * Removing migration code * Not count remote users as part of the cloud pricing * Add the cloud subscription when a user gets promote from remote to not-remote * Fixing merge problems --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5a349873f7
Коммит
5f7482e541
@@ -12739,6 +12739,27 @@ func (s *RetryLayerUserStore) GetByEmail(email string) (*model.User, error) {
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerUserStore) GetByRemoteID(remoteID string) (*model.User, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.UserStore.GetByRemoteID(remoteID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
if !isRepeatableError(err) {
|
||||
return result, err
|
||||
}
|
||||
tries++
|
||||
if tries >= 3 {
|
||||
err = errors.Wrap(err, "giving up after 3 consecutive repeatable transaction failures")
|
||||
return result, err
|
||||
}
|
||||
timepkg.Sleep(100 * timepkg.Millisecond)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerUserStore) GetByUsername(username string) (*model.User, error) {
|
||||
|
||||
tries := 0
|
||||
|
||||
Ссылка в новой задаче
Block a user