309. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/5/2017 12:06:46 PM Central Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

309.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingVistaRealm\main\src\java\gov\va\med\imaging\tomcat\vistarealm SpecificRealmAuthentication.java Mon Dec 4 21:35:12 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingVistaRealm\main\src\java\gov\va\med\imaging\tomcat\vistarealm SpecificRealmAuthentication.java Mon Dec 4 22:03:45 2017 UTC

309.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 278
Changed 2 4
Inserted 0 0
Removed 0 0

309.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

309.4 Active regular expressions

No regular expressions were active.

309.5 Comparison detail

  1   /**
  2    * 
  3     Package:  MAG - Vis tA Imaging
  4     WARNING:  Per VHA D irective 2 004-038, t his routin e should n ot be modi fied.
  5     Date Cre ated: Feb  15, 2012
  6     Site Nam e:  Washin gton OI Fi eld Office , Silver S pring, MD
  7       Developer:          
WERFEJ
  8     Descript ion: 
  9  
  10           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  11           ;;  Property  of the US  Government .
  12           ;;  No permis sion to co py or redi stribute t his softwa re is give n.
  13           ;;  Use of un released v ersions of  this soft ware requi res the us er
  14           ;;   to execu te a writt en test ag reement wi th the Vis tA Imaging
  15           ;;   Developm ent Office  of the De partment o f Veterans  Affairs,
  16           ;;   telephon e (301) 73 4-0100.
  17           ;;
  18           ;;  The Food  and Drug A dministrat ion classi fies this  software a s
  19           ;;  a Class I I medical  device.  A s such, it  may not b e changed
  20           ;;  in any wa y.  Modifi cations to  this soft ware may r esult in a n
  21           ;;  adulterat ed medical  device un der 21CFR8 20, the us e of which
  22           ;;  is consid ered to be  a violati on of US F ederal Sta tutes.
  23           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  24  
  25    */
  26   package go v.va.med.i maging.tom cat.vistar ealm;
  27  
  28   import jav a.security .Principal ;
  29   import jav a.util.Arr ayList;
  30   import jav a.util.Has hMap;
  31   import jav a.util.Lis t;
  32   import jav ax.managem ent.*;
  33  
  34   import org .apache.ca talina.Con tainer;
  35   import org .apache.ca talina.Rea lm;
  36   import org .apache.ca talina.Ser ver;
  37   import org .apache.ca talina.Ser vice;
  38   import org .apache.ca talina.cor e.Standard Server;
  39   import org .apache.lo gging.log4 j.LogManag er;
  40   import org .apache.lo gging.log4 j.Logger;
  41  
  42   /**
  43    * @author         
WERFEJ
  44    *
  45    */
  46   public cla ss Specifi cRealmAuth entication
  47   {
  48           pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Spec ificRealmA uthenticat ion.class) ;
  49           pr ivate stat ic List<Re alm> realm s = null;
  50           
  51           pr ivate sync hronized s tatic List <Realm> ge tRealms()
  52           {
  53                    if(r ealms == n ull)
  54                    {
  55                             realms  = new Arr ayList<Rea lm>();
  56                    
  57                             //Stan dardServer  server =  (StandardS erver)Serv erFactory. getServer( );
  58                             Standa rdServer s erver = ge tServer();
  59                             if (se rver != nu ll)
  60                             {
  61                             for (S ervice ser vice : ser ver.findSe rvices())
  62                             {
  63                                      addVista RealmsToLi st(service );
  64                             }
  65                             }
  66                    }
  67                    retu rn realms;
  68           }
  69           
  70  
  71           pu blic stati c Standard Server get Server()
  72           {
  73                    try
  74                    {
  75                             MBeanS erver mBea nServer =  MBeanServe rFactory.f indMBeanSe rver(null) .get(0);
  76                             Object Name name  = new Obje ctName("Ca talina","t ype","Serv er");
  77                             return  (Standard Server) mB eanServer. getAttribu te(name, " managedRes ource");
  78                    }
  79                    catc h (Malform edObjectNa meExceptio n e)
  80                    {
  81                             return  null;
  82                    }
  83                    catc h (MBeanEx ception e)
  84                    {
  85                             return  null;
  86                    }
  87                    catc h (Attribu teNotFound Exception  e)
  88                    {
  89                             return  null;
  90                    }
  91                    catc h (Instanc eNotFoundE xception e )
  92                    {
  93                             return  null;
  94                    }
  95                    catc h (Reflect ionExcepti on e)
  96                    {
  97                             return  null;
  98                    }
  99           
  100           }
  101           
  102           pu blic stati c Principa l authenti cate(Class <? extends  Realm> se archRealm,  String ac cessCode,  String ver ifyCode)
  103           {
  104                    for( Realm r :  getRealms( ))
  105                    {
  106                             if(r.g etClass()  == searchR ealm)
  107                             {
  108                                      return r .authentic ate(access Code, veri fyCode);
  109                             }
  110                    }
  111                    retu rn null;
  112           }
  113           
  114           pr ivate stat ic void ad dVistaReal msToList(S ervice ser vice)
  115           {
  116                    recu rseContain ers(servic e.getConta iner());
  117           }
  118  
  119           pr ivate stat ic void re curseConta iners(Cont ainer cont ainer)
  120           {
  121                    try
  122                    {
  123                             for (C ontainer c hildContai ner : cont ainer.find Children() )
  124                             {
  125                                      recurseC ontainers( childConta iner);
  126                             }
  127           
  128                             if (co ntainer in stanceof o rg.apache. catalina.c ore.Standa rdHost ||
  129                                      containe r instance of org.apa che.catali na.core.St andardEngi ne ||
  130                                      containe r instance of org.apa che.catali na.core.St andardServ ice)
  131                                      return;
  132                             
  133                             if(con tainer.get Realm() !=  null)
  134                                      realms.a dd(contain er.getReal m());
  135                    }
  136                    catc h (Throwab le t)
  137                    {
  138                             logger .error(t.g etMessage( ), t);
  139                    }
  140           }
  141   }