juergen     02/02/26 00:49:32

  Modified:    src/share/org/apache/slide/authenticate
                        CredentialsToken.java
  Log:
  cache principal instance and added getPrincipal method. Because I need the principal 
in the stores (Eckehard)
  
  Revision  Changes    Path
  1.5       +30 -17    
jakarta-slide/src/share/org/apache/slide/authenticate/CredentialsToken.java
  
  Index: CredentialsToken.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/authenticate/CredentialsToken.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CredentialsToken.java     25 Nov 2000 01:34:48 -0000      1.4
  +++ CredentialsToken.java     26 Feb 2002 08:49:32 -0000      1.5
  @@ -1,13 +1,13 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/authenticate/CredentialsToken.java,v
 1.4 2000/11/25 01:34:48 remm Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/11/25 01:34:48 $
  + * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/authenticate/CredentialsToken.java,v
 1.5 2002/02/26 08:49:32 juergen Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/02/26 08:49:32 $
    *
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -15,7 +15,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -23,15 +23,15 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution, if
  - *    any, must include the following acknowlegement:  
  - *       "This product includes software developed by the 
  + *    any, must include the following acknowlegement:
  + *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowlegement may appear in the software itself,
    *    if and wherever such third-party acknowlegements normally appear.
    *
    * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
    *    Foundation" must not be used to endorse or promote products derived
  - *    from this software without prior written permission. For written 
  + *    from this software without prior written permission. For written
    *    permission, please contact [EMAIL PROTECTED]
    *
    * 5. Products derived from this software may not be called "Apache"
  @@ -59,7 +59,7 @@
    *
    * [Additional notices, if required by prior licensing conditions]
    *
  - */ 
  + */
   
   package org.apache.slide.authenticate;
   
  @@ -68,7 +68,7 @@
   
   /**
    * Credentials token class.
  - * 
  + *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Remy Maucherat</a>
    */
   public final class CredentialsToken {
  @@ -79,7 +79,7 @@
       
       /**
        * Constructor.
  -     * 
  +     *
        * @param credentials Credentials stored in this token
        */
       public CredentialsToken(String credentials) {
  @@ -90,17 +90,22 @@
       
       /**
        * Constructor.
  -     * 
  +     *
        * @param credentials Credentials stored in this token
        */
       public CredentialsToken(Principal principal) {
           this.credentials = principal.getName();
           this.trusted = true;
  +        this.principal = principal;
       }
       
       
       // ----------------------------------------------------- Instance Variables
       
  +    /**
  +     *  principal instance.
  +     */
  +    private Principal principal;
       
       /**
        * Credentials, or principal.
  @@ -119,7 +124,7 @@
       
       /**
        * Is this credentials token to be trusted ?
  -     * 
  +     *
        * @return boolean
        */
       public boolean isTrusted() {
  @@ -129,19 +134,27 @@
       
       /**
        * Returns the private credentials.
  -     * 
  -     * @return String 
  +     *
  +     * @return String
        */
       public String getPrivateCredentials() {
           // FIXME ?
           return credentials;
       }
       
  +    /**
  +     * Returns the current principal
  +     *
  +     * @return java.security.Principal
  +     */
  +    public Principal getPrinipal() {
  +         return principal;
  +    }
       
       /**
        * Returns the public creddentials.
  -     * 
  -     * @return String 
  +     *
  +     * @return String
        */
       public String getPublicCredentials() {
           return credentials;
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to