Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
id
go-sso
Commits
01df95f6
Commit
01df95f6
authored
Aug 23, 2020
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enforce group membership checks in the SAML server
parent
d00e7f54
Pipeline
#7585
passed with stages
in 29 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
saml/saml.go
saml/saml.go
+15
-1
No files found.
saml/saml.go
View file @
01df95f6
...
...
@@ -124,6 +124,20 @@ func (c *Config) GetSSOGroups(serviceProviderID string) []string {
return
sp
.
SSOGroups
}
func
(
c
*
Config
)
GetAllSSOGroups
()
[]
string
{
tmp
:=
make
(
map
[
string
]
struct
{})
for
_
,
sp
:=
range
c
.
serviceProviderMap
{
for
_
,
group
:=
range
sp
.
SSOGroups
{
tmp
[
group
]
=
struct
{}{}
}
}
var
out
[]
string
for
group
:=
range
tmp
{
out
=
append
(
out
,
group
)
}
return
out
}
// Read users from a YAML-encoded file, in a format surprisingly
// compatible with git.autistici.org/id/auth/server.
//
...
...
@@ -311,7 +325,7 @@ func NewSAMLIDP(config *Config) (http.Handler, error) {
h
:=
idp
.
Handler
()
root
:=
mux
.
NewRouter
()
root
.
PathPrefix
(
ssoURL
.
Path
)
.
Handler
(
w
.
Wrap
(
h
,
svc
,
nil
))
root
.
PathPrefix
(
ssoURL
.
Path
)
.
Handler
(
w
.
Wrap
(
h
,
svc
,
config
.
GetAllSSOGroups
()
))
root
.
Handle
(
metadataURL
.
Path
,
h
)
return
root
,
nil
}
...
...
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