gitlab-username_bot_identifier 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gitlab/username_bot_identifier.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c13c124abd3cda5da49ee2a8ed012eedb5dc1933d4937228efc7534809fe05a0
|
|
4
|
+
data.tar.gz: 8ecea796a996860474f30f78d371523358a6b57c6fcb4802349afd6d6232c84e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9440770e67e137bfef1405f4c0e0e29c4cad87cf7ad7954af2b8fbc3c9ba2284c927861bd181a7cc0c0feb1ea8cb4738518341bd295458660d80ecd4af1620bb
|
|
7
|
+
data.tar.gz: d8a5799c1f0a931759199eaec6c33c02235a559f66aeda4e78393452510fa93b6f8719f06305abadd98933302bc9a620b63c58b29d43202163ad5416b57c17d3
|
|
@@ -39,7 +39,7 @@ module Gitlab
|
|
|
39
39
|
# Can be spoofed (e.g. someone can register project_1_bot, project_2_bot_abc123)
|
|
40
40
|
PROJECT_ACCESS_TOKEN_REGEX = /^project_\d+_bot_?\w*$/.freeze
|
|
41
41
|
GROUP_ACCESS_TOKEN_REGEX = /^group_\d+_bot_?\w*$/.freeze
|
|
42
|
-
SERVICE_ACCOUNT_REGEX = /^
|
|
42
|
+
SERVICE_ACCOUNT_REGEX = /^service_account_(group|project)_\d+_?\w*$/.freeze
|
|
43
43
|
|
|
44
44
|
# Used as best practice by GitLab team members when creating "service accounts"
|
|
45
45
|
KNOWN_SERVICE_ACCOUNT_REGEX = /^gl-service-[-\w]+$/.freeze
|
|
@@ -79,7 +79,8 @@ module Gitlab
|
|
|
79
79
|
username.match?(GROUP_ACCESS_TOKEN_REGEX)
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
-
# "service accounts" are accounts
|
|
82
|
+
# "service accounts" are accounts created through the service accounts feature,
|
|
83
|
+
# scoped to either a group or a project.
|
|
83
84
|
# See https://docs.gitlab.com/ee/user/profile/service_accounts.html
|
|
84
85
|
def service_account?
|
|
85
86
|
username.match?(SERVICE_ACCOUNT_REGEX)
|