Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a6bed5dc
Commit
a6bed5dc
authored
May 23, 2018
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SamlProvider uses URL helpers for issuer and callback
parent
c10d067f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
14 deletions
+6
-14
ee/app/models/saml_provider.rb
ee/app/models/saml_provider.rb
+4
-12
ee/spec/features/groups/saml_providers_spec.rb
ee/spec/features/groups/saml_providers_spec.rb
+1
-1
ee/spec/models/saml_provider_spec.rb
ee/spec/models/saml_provider_spec.rb
+1
-1
No files found.
ee/app/models/saml_provider.rb
View file @
a6bed5dc
...
...
@@ -28,6 +28,8 @@ class SamlProvider < ActiveRecord::Base
end
class
DefaultOptions
include
Gitlab
::
Routing
NAME_IDENTIFIER_FORMAT
=
'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified'
.
freeze
def
initialize
(
group_path
)
...
...
@@ -38,16 +40,12 @@ class SamlProvider < ActiveRecord::Base
NAME_IDENTIFIER_FORMAT
end
def
full_group_path
"
#{
host
}
/groups/
#{
@group_path
}
"
end
def
issuer
full_group_path
group_canonical_url
(
@group_path
)
end
def
assertion_consumer_service_url
"
#{
full_group_path
}
/-/saml/callback"
callback_group_saml_providers_url
(
@group_path
)
end
def
to_h
...
...
@@ -58,12 +56,6 @@ class SamlProvider < ActiveRecord::Base
idp_sso_target_url_runtime_params:
{
redirect_to: :RelayState
}
}
end
private
def
host
@host
||=
Gitlab
.
config
.
gitlab
.
url
end
end
private
...
...
ee/spec/features/groups/saml_providers_spec.rb
View file @
a6bed5dc
...
...
@@ -8,7 +8,7 @@ describe 'SAML provider settings' do
let
(
:callback_path
)
{
"/groups/
#{
group
.
path
}
/-/saml/callback"
}
before
do
stub_
config_setting
(
url:
'https://localhost'
)
stub_
default_url_options
(
protocol:
"https"
)
stub_saml_config
group
.
add_owner
(
user
)
end
...
...
ee/spec/models/saml_provider_spec.rb
View file @
a6bed5dc
...
...
@@ -58,7 +58,7 @@ describe SamlProvider do
subject
(
:saml_provider
)
{
create
(
:saml_provider
,
group:
group
)
}
before
do
stub_
config_setting
(
url:
'https://localhost'
)
stub_
default_url_options
(
protocol:
"https"
)
end
it
'generates callback URL'
do
...
...
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