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
2fec9ba3
Commit
2fec9ba3
authored
Apr 23, 2018
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Group SAML strips LRM chars from ADFS cert fingerprint
parent
63b15013
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
ee/app/models/saml_provider.rb
ee/app/models/saml_provider.rb
+8
-0
ee/changelogs/unreleased/jej-strip-lrm-for-adfs.yml
ee/changelogs/unreleased/jej-strip-lrm-for-adfs.yml
+5
-0
ee/spec/models/saml_provider_spec.rb
ee/spec/models/saml_provider_spec.rb
+4
-0
No files found.
ee/app/models/saml_provider.rb
View file @
2fec9ba3
...
@@ -21,6 +21,10 @@ class SamlProvider < ActiveRecord::Base
...
@@ -21,6 +21,10 @@ class SamlProvider < ActiveRecord::Base
NAME_IDENTIFIER_FORMAT
NAME_IDENTIFIER_FORMAT
end
end
def
certificate_fingerprint
=
(
value
)
super
(
strip_left_to_right_chars
(
value
))
end
def
settings
def
settings
{
{
assertion_consumer_service_url:
assertion_consumer_service_url
,
assertion_consumer_service_url:
assertion_consumer_service_url
,
...
@@ -44,4 +48,8 @@ class SamlProvider < ActiveRecord::Base
...
@@ -44,4 +48,8 @@ class SamlProvider < ActiveRecord::Base
def
host
def
host
@host
||=
Gitlab
.
config
.
gitlab
.
url
@host
||=
Gitlab
.
config
.
gitlab
.
url
end
end
def
strip_left_to_right_chars
(
input
)
input
&
.
gsub
(
/[\u200E]/
,
''
)
end
end
end
ee/changelogs/unreleased/jej-strip-lrm-for-adfs.yml
0 → 100644
View file @
2fec9ba3
---
title
:
Per-Group SAML (for GitLab.com) strips LRM chars from ADFS certificate fingerprints
merge_request
:
5466
author
:
type
:
fixed
ee/spec/models/saml_provider_spec.rb
View file @
2fec9ba3
...
@@ -29,6 +29,10 @@ describe SamlProvider do
...
@@ -29,6 +29,10 @@ describe SamlProvider do
expect
(
subject
).
not_to
allow_value
(
invalid_characters
).
for
(
:certificate_fingerprint
)
expect
(
subject
).
not_to
allow_value
(
invalid_characters
).
for
(
:certificate_fingerprint
)
end
end
it
'strips left-to-right marks from certificate_fingerprint'
do
expect
(
subject
).
to
allow_value
(
"
\u
200E00 00 30 ED C2 85 E0 1D 6B 5E A3 30 10 A7 9A DD 14 2F 50 04"
).
for
(
:certificate_fingerprint
)
end
it
'requires group to be top-level'
do
it
'requires group to be top-level'
do
group
=
create
(
:group
)
group
=
create
(
:group
)
nested_group
=
create
(
:group
,
:nested
)
nested_group
=
create
(
:group
,
:nested
)
...
...
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