Skip to content
This repository has been archived by the owner on Aug 21, 2021. It is now read-only.

Resolve Issues SONARPLUGINS-2931 (Update pom.xml) and SONARPLUGINS-3028 (Use the sonar.security.realm property) #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<packaging>sonar-plugin</packaging>

<name>Sonar Crowd Plugin</name>
<description>Enables the delegation of Sonar authentication to Atlassian Crowd.</description>
<description>Delegates authentication to Atlassian Crowd.</description>
<url>http://docs.codehaus.org/display/SONAR/Crowd+Plugin</url>
<inceptionYear>2009</inceptionYear>
<organization>
Expand Down
15 changes: 8 additions & 7 deletions src/main/java/org/sonar/plugins/crowd/CrowdPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
/**
* @author Evgeny Mandrikov
*/

public class CrowdPlugin extends SonarPlugin {
public List<Class<? extends Extension>> getExtensions() {
ArrayList<Class<? extends Extension>> extensions = new ArrayList<Class<? extends Extension>>();
extensions.add(CrowdAuthenticator.class);
extensions.add(CrowdConfiguration.class);
return extensions;
}
}
public List<Class<? extends Extension>> getExtensions() {
ArrayList<Class<? extends Extension>> extensions = new ArrayList<Class<? extends Extension>>();
extensions.add(CrowdRealm.class);
extensions.add(CrowdConfiguration.class);
return extensions;
}
}
47 changes: 47 additions & 0 deletions src/main/java/org/sonar/plugins/crowd/CrowdRealm.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Sonar Crowd Plugin
* Copyright (C) 2009 SonarSource
* dev@sonar.codehaus.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
package org.sonar.plugins.crowd;

import org.sonar.api.security.LoginPasswordAuthenticator;
import org.sonar.api.security.SecurityRealm;

public class CrowdRealm extends SecurityRealm {

private CrowdAuthenticator authenticator;
private final CrowdConfiguration configuration;

public CrowdRealm(CrowdConfiguration configuration) {
this.configuration = configuration;
}

public String getName() {
return "Crowd";
}

@Override
public void init() {
authenticator = new CrowdAuthenticator(configuration);
}

@Override
public LoginPasswordAuthenticator getLoginPasswordAuthenticator() {
return authenticator;
}
}