1   package com.atlassian.seraph.auth;
2   
3   import javax.servlet.http.HttpServletRequest;
4   import java.security.Principal;
5   
6   /**
7    * Implementers of this interface will be called to normalise a given principal to ensure its up to date.
8    * <p/>
9    * Seraph code can store a Principal object in the HTTP session and it can be useful to ensure that the
10   * object in the session is up to date.
11   */
12  public interface PrincipalNormaliser
13  {
14      /**
15       * Called to normalise the given Principal into an up to date object.
16       *
17       * @param httpServletRequest the HTTP request in play
18       * @param principal the current principal in play
19       * @return and up to date Principal or the current object.  If the input it null then the output must be null
20       */
21      Principal normalisePrincipal(final HttpServletRequest httpServletRequest, final Principal principal);
22  }