Skip to content

Commit

Permalink
[FIXED JENKINS-23417] Noting merge of #1277.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Jun 12, 2014
1 parent 65b7d8a commit 6dd071e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -58,6 +58,9 @@
<li class=rfe>
Jenkins can now kill Win32 processes from Win64 JVMs.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-23410">issue 23410</a>)
<li class=rfe>
Allow custom security realm plugins to fire events to <code>SecurityListener</code>s.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-23417">issue 23417</a>)
<li class=bug>
Recover gracefully if a build permalink has a non-numeric value.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21631">issue 21631</a>)
Expand Down
7 changes: 5 additions & 2 deletions core/src/main/java/jenkins/security/SecurityListener.java
Expand Up @@ -35,8 +35,6 @@
import jenkins.model.Jenkins;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.userdetails.UserDetails;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

/**
* Listener notified of various significant events related to security.
Expand Down Expand Up @@ -87,6 +85,7 @@ public abstract class SecurityListener implements ExtensionPoint {
// TODO event for new user signed up (e.g. in HudsonPrivateSecurityRealm)
// TODO event for CAPTCHA failure

/** @since 1.569 */
public static void fireAuthenticated(@Nonnull UserDetails details) {
if (LOGGER.isLoggable(Level.FINE)) {
List<String> groups = new ArrayList<String>();
Expand All @@ -102,27 +101,31 @@ public static void fireAuthenticated(@Nonnull UserDetails details) {
}
}

/** @since 1.569 */
public static void fireFailedToAuthenticate(@Nonnull String username) {
LOGGER.log(Level.FINE, "failed to authenticate: {0}", username);
for (SecurityListener l : all()) {
l.failedToAuthenticate(username);
}
}

/** @since 1.569 */
public static void fireLoggedIn(@Nonnull String username) {
LOGGER.log(Level.FINE, "logged in: {0}", username);
for (SecurityListener l : all()) {
l.loggedIn(username);
}
}

/** @since 1.569 */
public static void fireFailedToLogIn(@Nonnull String username) {
LOGGER.log(Level.FINE, "failed to log in: {0}", username);
for (SecurityListener l : all()) {
l.failedToLogIn(username);
}
}

/** @since 1.569 */
public static void fireLoggedOut(@Nonnull String username) {
LOGGER.log(Level.FINE, "logged out: {0}", username);
for (SecurityListener l : all()) {
Expand Down

0 comments on commit 6dd071e

Please sign in to comment.