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
74e79105
Commit
74e79105
authored
Oct 10, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup provider validation
parent
824aeacd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
lib/gitlab/ldap/config.rb
lib/gitlab/ldap/config.rb
+9
-1
spec/lib/gitlab/ldap/config_spec.rb
spec/lib/gitlab/ldap/config_spec.rb
+4
-0
No files found.
lib/gitlab/ldap/config.rb
View file @
74e79105
...
...
@@ -17,8 +17,8 @@ module Gitlab
end
def
initialize
(
provider
)
raise
"Unknown provider (
#{
provider
}
). Available providers:
#{
self
.
class
.
providers
}
"
@provider
=
provider
invalid_provider
unless
valid_provider?
@options
=
config_for
(
provider
)
end
...
...
@@ -89,6 +89,14 @@ module Gitlab
end
end
def
valid_provider?
self
.
class
.
providers
.
include?
(
provider
)
end
def
invalid_provider
raise
"Unknown provider (
#{
provider
}
). Available providers:
#{
self
.
class
.
providers
}
"
end
def
auth_options
{
auth:
{
...
...
spec/lib/gitlab/ldap/config_spec.rb
View file @
74e79105
...
...
@@ -12,5 +12,9 @@ describe Gitlab::LDAP::Config do
it
"works"
do
expect
(
config
).
to
be_a
described_class
end
it
"raises an error if a unknow provider is used"
do
expect
{
Gitlab
::
LDAP
::
Config
.
new
'unknown'
}.
to
raise_error
end
end
end
\ No newline at end of file
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