• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender-server / 1622978334

13 Jan 2025 03:51PM UTC coverage: 72.802% (-3.8%) from 76.608%
1622978334

Pull #300

gitlab-ci

alfrunes
fix: Deployment device count should not exceed max devices

Added a condition to skip deployments when the device count reaches max
devices.

Changelog: Title
Ticket: MEN-7847
Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
Pull Request #300: fix: Deployment device count should not exceed max devices

4251 of 6164 branches covered (68.96%)

Branch coverage included in aggregate %.

0 of 18 new or added lines in 1 file covered. (0.0%)

2544 existing lines in 83 files now uncovered.

42741 of 58384 relevant lines covered (73.21%)

21.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.3
/backend/services/useradm/utils/similar_checker.go
1
package utils
2

3
import (
4
        "strings"
5

6
        "github.com/mendersoftware/mender-server/services/useradm/model"
7
)
8

9
func CheckIfPassSimilarToEmailRaw(mail string, pass string) bool {
3✔
10
        if len(mail) == 0 || len(pass) == 0 {
3✔
UNCOV
11
                return false
×
UNCOV
12
        }
×
13
        lmail := strings.ToLower(mail)
3✔
14
        lpass := strings.ToLower(pass)
3✔
15
        return strings.Contains(lmail, lpass)
3✔
16
}
17
func CheckIfPassSimilarToEmail(user *model.User, userUpdate *model.UserUpdate) bool {
2✔
18
        if len(userUpdate.Password) > 0 {
4✔
19
                pwd := userUpdate.Password
2✔
20
                // Check if similar to updated email
2✔
21
                if userUpdate.Email != "" &&
2✔
22
                        CheckIfPassSimilarToEmailRaw(string(userUpdate.Email), pwd) {
3✔
23
                        return true
1✔
24
                }
1✔
25
                // Check if similar to (old) email
26
                return CheckIfPassSimilarToEmailRaw(string(user.Email), pwd)
2✔
27
        } else if len(userUpdate.Email) > 0 {
2✔
28
                // check when changing the email
1✔
29
                return CheckIfPassSimilarToEmailRaw(
1✔
30
                        string(userUpdate.Email),
1✔
31
                        userUpdate.CurrentPassword)
1✔
32
        }
1✔
33
        return false
1✔
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc