Skip to content

Commit

Permalink
add support for crowd as authentication provider
Browse files Browse the repository at this point in the history
this adds basic support for atlassian crowd as an authentication
provider. while ldap and crowd are mutually exclusive, this module
will not ensure that only one of them is active.
  • Loading branch information
Jan Jungnickel committed Jul 3, 2012
1 parent fcaf2dd commit 2bad117
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
9 changes: 8 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$user_system = true,
$service = 'sonar', $installroot = '/usr/local', $home = '/var/local/sonar',
$port = 9000, $download_url = 'http://dist.sonar.codehaus.org',
$context_path = '/', $arch = '', $ldap = {},
$context_path = '/', $arch = '', $ldap = {}, $crowd = {},
$jdbc = {
url => 'jdbc:derby://localhost:1527/sonar;create=true',
driver_class_name => 'org.apache.derby.jdbc.ClientDriver',
Expand Down Expand Up @@ -135,6 +135,13 @@
notify => Service[$service],
} ->

sonar::plugin { 'sonar-crowd-plugin' :
ensure => empty($crowd) ? {true => absent, false => present},
artifactid => 'sonar-crowd-plugin',
version => '1.0',
notify => Service[$service],
} ->

service { $service:
ensure => running,
name => $service,
Expand Down
31 changes: 31 additions & 0 deletions templates/sonar.properties.erb
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,34 @@ ldap.bindPassword: <%=ldap['bind_password']%>
# Default is 'com.sun.jndi.ldap.LdapCtxFactory'.
#ldap.contextFactoryClass: com.sun.jndi.ldap.LdapCtxFactory
<% end %>
<% if !crowd.empty? %>
#-------------------
# Sonar Crowd Plugin
#-------------------
# IMPORTANT : before activation, make sure that one Sonar administrator is defined in the external system
# Activates the plugin. Leave blank or comment out to use default sonar authentication.
sonar.authenticator.class: org.sonar.plugins.crowd.CrowdAuthenticator

# Ignore failure at startup if the connection to external system is refused.
# Users can browse sonar but not log in as long as the connection fails.
# When set to true, Sonar will not start if connection to external system fails.
# Default is false.
#sonar.authenticator.ignoreStartupFailure: true

# Automatically create users (available since Sonar 2.0).
# When set to true, user will be created after successful authentication, if doesn't exists.
# The default group affected to new users can be defined online, in Sonar general settings. The default value is "sonar-users".
# Default is false.
sonar.authenticator.createUsers: true

# URL of the Crowd server (usually ends with /services/).
crowd.url: <%=crowd['service_url']%>

# Crowd application name.
# Default is 'sonar'.
crowd.application: <%=crowd['application']%>

# Crowd application password.
crowd.password: <%=crowd['password']%>
<% end %>

0 comments on commit 2bad117

Please sign in to comment.