Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalClient
Commits
5562cd0e
Commit
5562cd0e
authored
Nov 15, 2018
by
Lukas Burgey
Browse files
Strip entitlements of the group-authority
parent
32c650e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.go
View file @
5562cd0e
...
...
@@ -8,6 +8,7 @@ import (
"log"
"net/http"
"os"
"regexp"
"time"
"gopkg.in/alecthomas/kingpin.v2"
...
...
@@ -208,6 +209,16 @@ func getConfig(configFile string) (c config, err error) {
return
}
// strip the group authority from entitlement names
nameExtractor
:=
regexp
.
MustCompile
(
"^(.*?)#"
)
for
entName
,
entServices
:=
range
c
.
EntitlementToServices
{
match
:=
nameExtractor
.
FindStringSubmatch
(
entName
)
if
len
(
match
)
==
2
{
delete
(
c
.
EntitlementToServices
,
entName
)
c
.
EntitlementToServices
[
match
[
1
]]
=
entServices
}
}
c
.
Log
(
"Groups: %s"
,
c
.
GroupToServices
)
c
.
Log
(
"Entitlements: %s"
,
c
.
EntitlementToServices
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment