Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
go-sso
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
id
go-sso
Commits
1df6f233
Commit
1df6f233
authored
5 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Support reading SAML XML descriptors from file or inline
parent
6182a298
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saml/saml.go
+9
-3
9 additions, 3 deletions
saml/saml.go
with
9 additions
and
3 deletions
saml/saml.go
+
9
−
3
View file @
1df6f233
...
...
@@ -26,6 +26,8 @@ import (
)
type
serviceProvider
struct
{
// Descriptor can either be an inline XML document, or it can
// be read from a file with the syntax "@filename".
Descriptor
string
`yaml:"descriptor"`
SSOGroups
[]
string
`yaml:"sso_groups"`
...
...
@@ -81,9 +83,13 @@ func (c *Config) check() error {
func
(
c
*
Config
)
loadServiceProviders
()
error
{
c
.
serviceProviderMap
=
make
(
map
[
string
]
*
serviceProvider
)
for
_
,
sp
:=
range
c
.
ServiceProviders
{
data
,
err
:=
ioutil
.
ReadFile
(
sp
.
Descriptor
)
if
err
!=
nil
{
return
err
var
data
[]
byte
if
strings
.
HasPrefix
(
sp
.
Descriptor
,
"@"
)
{
var
err
error
data
,
err
=
ioutil
.
ReadFile
(
sp
.
Descriptor
[
1
:
])
if
err
!=
nil
{
return
err
}
}
var
ent
saml
.
EntityDescriptor
if
err
:=
xml
.
Unmarshal
(
data
,
&
ent
);
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment