312. 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.

312.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 VistaRemoteSiteRemotelyAuthenticatedRealm.java Mon Dec 4 21:35:10 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingVistaRealm\main\src\java\gov\va\med\imaging\tomcat\vistarealm VistaRemoteSiteRemotelyAuthenticatedRealm.java Mon Dec 4 22:03:48 2017 UTC

312.2 Comparison summary

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

312.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

312.4 Active regular expressions

No regular expressions were active.

312.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.security .cert.X509 Certificat e;
  30  
  31   import org .apache.ca talina.Lif ecycleStat e;
  32   import org .apache.ca talina.Cre dentialHan dler;
  33   import org .apache.ca talina.Con tainer;
  34   import org .apache.ca talina.Rea lm;
  35   import org .apache.lo gging.log4 j.LogManag er;
  36   import org .apache.lo gging.log4 j.Logger;
  37   import org .ietf.jgss .GSSContex t;
  38  
  39   /**
  40    * @author         
WERFEJ
  41    *
  42    */
  43   public cla ss VistaRe moteSiteRe motelyAuth enticatedR ealm
  44   extends Ab stractVist aRealmImpl
  45   implements  Realm, or g.apache.c atalina.Li fecycle, V istaRemote SiteAccess VerifyReal mMBean
  46   {
  47           
  48           pr ivate Cont ainer pare ntContaine r = null;
  49           pr ivate Real m parentCo ntainerRea lm = null;
  50           
  51           pr ivate Stri ng claimsS iteNumber  = null;
  52           pr ivate Bool ean genera teBseToken  = Boolean .TRUE;
  53  
  54           pr ivate Logg er logger  = LogManag er.getLogg er(this.ge tClass());
  55           pr ivate Cred entialHand ler creden tialHandle r = null;
  56           
  57           pu blic Vista RemoteSite RemotelyAu thenticate dRealm()
  58           {
  59                    logg er.info(Vi staRemoteS iteRemotel yAuthentic atedRealm. class.getC anonicalNa me() + " c tor()");
  60                    this .setSiteNu mber("<all >");// the  site numb er must no t be null  (prevent e xceptions)  but this  realm fron ts
  61                    
  62           }
  63  
  64           /*  (non-Java doc)
  65            *  @see gov. va.med.ima ging.tomca t.vistarea lm.Abstrac tVistaReal mImpl#getL ogger()
  66            * /
  67           @O verride
  68           pr otected Lo gger getLo gger() 
  69           {
  70                    retu rn logger;
  71           }
  72  
  73           /* *
  74            *  @return t he claimsS iteNumber
  75            * /
  76           pu blic Strin g getClaim sSiteNumbe r()
  77           {
  78                    retu rn claimsS iteNumber;
  79           }
  80  
  81           /* *
  82            *  @param cl aimsSiteNu mber the c laimsSiteN umber to s et
  83            * /
  84           pu blic void  setClaimsS iteNumber( String cla imsSiteNum ber)
  85           {
  86                    this .claimsSit eNumber =  claimsSite Number;
  87           }
  88  
  89           /* *
  90            *  @return t he generat eBseToken
  91            * /
  92           pu blic Boole an getGene rateBseTok en()
  93           {
  94                    retu rn generat eBseToken;
  95           }
  96  
  97           /* *
  98            *  @param ge nerateBseT oken the g enerateBse Token to s et
  99            * /
  100           pu blic void  setGenerat eBseToken( Boolean ge nerateBseT oken)
  101           {
  102                    this .generateB seToken =  generateBs eToken;
  103           }
  104  
  105           /*  (non-Java doc)
  106            *  @see gov. va.med.ima ging.tomca t.vistarea lm.Abstrac tVistaReal mImpl#isIn itialized( )
  107            * /
  108           @O verride
  109           pu blic boole an isIniti alized() 
  110           {
  111                    bool ean result  = true;
  112                    //Co ntainer co ntainer =  this.getCo ntainer();
  113                    //St ring conta inerName =  container  == null ?  null : co ntainer.ge tName();                                            
  114  
  115                    retu rn result;
  116           }
  117  
  118           /*  (non-Java doc)
  119            *  @see org. apache.cat alina.Real m#authenti cate(java. lang.Strin g, byte[])
  120            * /
  121           // @Override
  122           pu blic Princ ipal authe nticate(St ring usern ame, byte[ ] credenti als) 
  123           {
  124                    retu rn authent icate(user name, new  String(cre dentials)) ;
  125           }
  126  
  127           /*  (non-Java doc)
  128            *  @see org. apache.cat alina.Real m#authenti cate(java. lang.Strin g, java.la ng.String,  java.lang .String, j ava.lang.S tring, jav a.lang.Str ing, java. lang.Strin g, java.la ng.String,  java.lang .String)
  129            * /
  130           @O verride
  131           pu blic Princ ipal authe nticate(St ring usern ame, Strin g clientDi gest, Stri ng nOnce,  String nc,  
  132                             String  cnonce, S tring qop,  String re alm, Strin g md5a2) 
  133           {
  134                    getL ogger().in fo("authen ticate ("  + username  + ", dige st)");
  135                    retu rn null;
  136           }
  137  
  138           /*  (non-Java doc)
  139            *  @see org. apache.cat alina.Real m#authenti cate(java. lang.Strin g, java.la ng.String)
  140            * /
  141           @O verride
  142           pu blic Princ ipal authe nticate(St ring usern ame, Strin g password
  143           {
  144                    Vist aRealmPrin cipal prin cipal = nu ll;
  145                    
  146                    Stri ng siteNum ber = user name;
  147  
  148                    getL ogger().in fo("Realm  '" + siteN umber + "' -authentic ate");
  149                    
  150                    prin cipal = ne w VistaRea lmPrincipa l(siteNumb er, false,
  151                             VistaR ealmPrinci pal.Authen ticationCr edentialsT ype.Passwo rd);             
  152                    prin cipal.setP reemptiveA uthorizati on(this);
  153                    
  154                    
  155                    if(c laimsSiteN umber != n ull && cla imsSiteNum ber.equals (siteNumbe r))
  156                    {
  157                             getLog ger().info ("Claims u ser authen tication") ;
  158  
  159                             princi pal.addRol e("claims" ); // add  the claims  role to a llow the u ser to acc ess withou t having t he necessa ry keys
  160                    }
  161                    else
  162                    {
  163                             princi pal.addRol e("remote- user");
  164                    }
  165  
  166                    retu rn princip al;
  167           }
  168  
  169           /*  (non-Java doc)
  170            *  @see org. apache.cat alina.Real m#authenti cate(java. lang.Strin g)
  171            * /
  172           @O verride
  173           pu blic Princ ipal authe nticate(St ring uid)
  174           {
  175                    retu rn null;
  176           }
  177  
  178           /*  (non-Java doc)
  179            *  @see org. apache.cat alina.Real m#authenti cate(org.i etf.jgss.G SSContext; , java.lan g.String)
  180            * /
  181           @O verride
  182           pu blic Princ ipal authe nticate(GS SContext g ssContext,  boolean s toreCreds)
  183           {
  184                    retu rn null;
  185           }
  186  
  187           /*  (non-Java doc)
  188            *  @see org. apache.cat alina.Real m#authenti cate(java. security.c ert.X509Ce rtificate[ ])
  189            * /
  190           @O verride
  191           pu blic Princ ipal authe nticate(X5 09Certific ate certs[ ]) 
  192           {
  193                    getL ogger().de bug("Authe nticating  using X509  certifica te.");
  194                    retu rn null;
  195           }
  196           
  197           //  ========= ========== ========== ========== ========== ========== ========== ========== ========== ========== ========
  198           //  Realm imp lementatio n
  199           //  ========= ========== ========== ========== ========== ========== ========== ========== ========== ========== ========
  200  
  201           /* *
  202            *  A Contain er is an o bject that  can execu te request s received  from a
  203            *  client, a nd return  responses  based on t hose reque sts. Engin e -
  204            *  Represent ation of t he entire  Catalina s ervlet eng ine. Host  -
  205            *  Represent ation of a  virtual h ost contai ning a num ber of Con texts. Con text -
  206            *  Represent ation of a  single Se rvletConte xt, which  will typic ally conta in
  207            *  one or mo re Wrapper s for the  supported  servlets.  Wrapper -  Representa tion
  208            *  of an ind ividual se rvlet defi nition.
  209            * /
  210  
  211           @O verride
  212           pu blic void  setContain er(Contain er contain er)
  213           {
  214                    supe r.setConta iner(conta iner);
  215  
  216                    // i f the cont ainer has  a parent t hen get it s realm
  217                    // t his class  will authe nticate ag ainst that  realm as  well as it s own
  218                    // a uthenticat ion reposi tory
  219                    if ( getContain er() != nu ll)
  220                    {
  221                             getLog ger().info ("Containe r name is  '" + getCo ntainer(). getName()  + "' conta iner type  is '" + ge tContainer ().getClas s().getNam e() + "'") ;
  222                             
  223                             parent Container  = getConta iner().get Parent();
  224                             if (pa rentContai ner != nul l)
  225                             {
  226                                      getLogge r().info(" Parent con tainer nam e is '" +  parentCont ainer.getN ame() + 
  227                                               "' parent  container  type is '"  + parentC ontainer.g etClass(). getName()  + "'");
  228                                      parentCo ntainerRea lm = paren tContainer .getRealm( );
  229                                      getLogge r().info(" Parent con tainer rea lm type is  '" + 
  230                                               (parentCon tainerReal m == null  ? "null" :  parentCon tainerReal m.getClass ().getName ()) + 
  231                                               "'");
  232                             }
  233                             else
  234                             {
  235                                      getLogge r().info(" Parent con tainer is  null.  Del egation to  parent re alm will b e disabled .");
  236                             }
  237                    }
  238           }
  239           
  240           
  241           /*  (non-Java doc)
  242            *  @see gov. va.med.ima ging.tomca t.vistarea lm.Abstrac tVistaReal mImpl#toSt ring()
  243            * /
  244           @O verride
  245           pu blic Strin g toString () 
  246           {
  247                    Stri ngBuilder  sb = new S tringBuild er();
  248           
  249           sb .append(th is.getClas s().getSim pleName()) ;
  250           
  251                return s b.toString ();
  252           }
  253  
  254           /*  (non-Java doc)
  255            *  @see gov. va.med.ima ging.tomca t.vistarea lm.Abstrac tVistaReal mImpl#getS iteName()
  256            * /
  257           @O verride
  258           pu blic Strin g getSiteN ame() 
  259           {
  260                    retu rn "<site  name>";
  261           }
  262  
  263           /*  (non-Java doc)
  264            *  @see gov. va.med.ima ging.tomca t.vistarea lm.Abstrac tVistaReal mImpl#getS iteAbbrevi ation()
  265            * /
  266           @O verride
  267           pu blic Strin g getSiteA bbreviatio n() 
  268           {
  269                    retu rn "<site  abbr>";
  270           }
  271  
  272           
  273           /*  (non-Java doc)
  274            *  @see org. apache.cat alina.Real m#isAvaila ble()
  275           */
  276           pu blic boole an isAvail able()
  277           {
  278                    retu rn true;
  279           }
  280  
  281           /*  (non-Java doc)
  282            *  @see org. apache.cat alina.Real m#getRoles (java.secu rity.Princ ipal)
  283            * /
  284           pu blic Strin g[] getRol es(Princip al princip al)
  285           {
  286                    retu rn null;
  287           }
  288  
  289           /*  (non-Java doc)
  290            *  @see org. apache.cat alina.Real m#setCrede ntialHandl er(org.apa che.catali na.Credent ialHandler )
  291           */
  292           @O verride
  293           pu blic void  setCredent ialHandler (Credentia lHandler c redentialH andler)
  294           {
  295                    this .credentia lHandler =  credentia lHandler;
  296           }
  297           
  298           /*  (non-Java doc)
  299            *  @see org. apache.cat alina.Real m#getCrede ntialHandl er()
  300           */
  301           @O verride
  302           pu blic Crede ntialHandl er getCred entialHand ler()
  303           {
  304                    retu rn credent ialHandler ;
  305           }
  306  
  307           /*  (non-Java doc)
  308            *  @see org. apache.cat alina.Life cycle#getS tateName()
  309           */
  310           @O verride
  311           pu blic Strin g getState Name()
  312           {
  313                    retu rn null; / /getParent ContainerR ealm() ==  null ? nul l : getPar entContain erRealm(). getStateNa me();
  314           }
  315  
  316           /*  (non-Java doc)
  317            *  @see org. apache.cat alina.Life cycle#getS tate()
  318           */
  319           @O verride
  320           pu blic Lifec ycleState  getState()
  321           {
  322                    retu rn null; / /getParent ContainerR ealm() ==  null ? nul l : getPar entContain erRealm(). getState() ;
  323           }
  324           
  325           /*  (non-Java doc)
  326            *  @see org. apache.Lif ecycle.des troy()
  327           */
  328           @O verride
  329           pu blic void  destroy()
  330           {
  331           }
  332           
  333           /*  (non-Java doc)
  334            *  @see org. apache.Lif ecycle.ini t()
  335           */
  336           @O verride
  337           pu blic void  init()
  338           {
  339           }
  340  
  341   }