Coverage Report - org.mule.module.jaas.JaasAuthentication
 
Classes in this File Line Coverage Branch Coverage Complexity
JaasAuthentication
0%
0/18
N/A
1
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.module.jaas;
 8  
 
 9  
 import org.mule.api.security.Authentication;
 10  
 import org.mule.api.security.Credentials;
 11  
 
 12  
 import java.util.Map;
 13  
 
 14  
 import javax.security.auth.Subject;
 15  
 
 16  
 public class JaasAuthentication implements Authentication
 17  
 {
 18  
     private boolean authenticated;
 19  
     private char[] credentials;
 20  
     private String user;
 21  
     private Map properties;
 22  
     private Subject subject;
 23  
   
 24  
     public JaasAuthentication(Credentials credentials)
 25  0
     {
 26  0
         this.user = credentials.getUsername();
 27  0
         this.credentials = credentials.getPassword();
 28  0
     }
 29  
     
 30  
     public JaasAuthentication(Object user, Object credentials, Subject subject)
 31  0
     {
 32  0
         this.user = (String) user;
 33  0
         this.credentials = ((String) credentials).toCharArray();
 34  0
         this.subject = subject;
 35  0
     }
 36  
 
 37  
     public void setAuthenticated(boolean b)
 38  
     {
 39  0
         authenticated = b;
 40  0
     }
 41  
 
 42  
     public boolean isAuthenticated()
 43  
     {
 44  0
         return authenticated;
 45  
     }
 46  
 
 47  
     public Object getCredentials()
 48  
     {
 49  0
         return new String(credentials);
 50  
     }
 51  
 
 52  
     public Object getPrincipal()
 53  
     {
 54  0
         return user;
 55  
     }
 56  
 
 57  
     public Map getProperties()
 58  
     {
 59  0
         return properties;
 60  
     }
 61  
 
 62  
     public void setProperties(Map properties)
 63  
     {
 64  0
         this.properties = properties;
 65  0
     }
 66  
 
 67  
     public Subject getSubject()
 68  
     {
 69  0
         return subject;
 70  
     }
 71  
 }