2. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 4/23/2019 12:14:25 PM Central Daylight 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.

2.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\CCRS\CaseManagement-B6S3\CaseManagement-B6S3\ccrs_ro_rest\src\ccrs_ro\login\rest\login LoginRWS.java Thu Mar 28 18:39:56 2019 UTC
2 C:\AraxisMergeCompare\Pri_re\CCRS\CaseManagement-B6S3\CaseManagement-B6S3\ccrs_ro_rest\src\ccrs_ro\login\rest\login LoginRWS.java Thu Apr 18 17:41:07 2019 UTC

2.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 232
Changed 1 2
Inserted 0 0
Removed 0 0

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

2.4 Active regular expressions

No regular expressions were active.

2.5 Comparison detail

  1   /**
  2    * ccrs_ro .login.res t.login 
  3    * LoginRW S.java
  4    * LoginRW S
  5    * stuartb edoll
  6    * 12:42:5 9 PM
  7    * 2019
  8    *
  9    */
  10   package cc rs_ro.logi n.rest.log in;
  11  
  12   import jav a.io.IOExc eption;
  13   import jav a.security .Principal ;
  14   import jav a.util.Ite rator;
  15   import jav a.util.Lis t;
  16   import jav a.util.Set ;
  17  
  18   import jav ax.securit y.auth.Sub ject;
  19   import jav ax.securit y.auth.cal lback.Name Callback;
  20   import jav ax.securit y.auth.log in.LoginCo ntext;
  21   import jav ax.servlet .ServletCo nfig;
  22   import jav ax.servlet .http.Http ServletRes ponse;
  23   import jav ax.ws.rs.C onsumes;
  24   import jav ax.ws.rs.G ET;
  25   import jav ax.ws.rs.P ath;
  26   import jav ax.ws.rs.P roduces;
  27   import jav ax.ws.rs.c ore.Contex t;
  28   import jav ax.ws.rs.c ore.HttpHe aders;
  29   import jav ax.ws.rs.c ore.MediaT ype;
  30   import jav ax.ws.rs.c ore.Multiv aluedMap;
  31   import jav ax.ws.rs.c ore.UriInf o;
  32  
  33   import com .ibm.json. java.JSONO bject;
  34   import com .ibm.websp here.secur ity.auth.W SSubject;
  35   import com .sun.manag ement.jmx. Trace;
  36  
  37   import ccr s_ro.commo n.authenti cation.CCR SIAMPrinci pal;
  38   import ccr s_ro.commo n.constant s.Constant s;
  39   import ccr s_ro.commo n.logger.C CRS_RO_Log ger;
  40   import ccr s_ro.commo n.logger.L oggerInter face;
  41  
  42   /**
  43    * @author  stuartbed oll
  44    *
  45    */
  46   @Path("/lo gin")
  47   public cla ss LoginRW S {
  48           pr ivate stat ic final L oggerInter face logge r = CCRS_R O_Logger.s ingleton() ;
  49           @P ath("/weba gent")
  50           @G ET
  51           @C onsumes(Me diaType.AP PLICATION_ JSON)
  52           @P roduces(Me diaType.AP PLICATION_ JSON)
  53           pu blic JSONO bject test Service(@C ontext Ser vletConfig  servletCo nfig, @Con text HttpH eaders htt pHeaders,
  54                             @Conte xt HttpSer vletRespon se sRespon se, @Conte xt UriInfo  uriInfo)  throws IOE xception {
  55                    JSON Object res ponse = ne w JSONObje ct();
  56                     String use rname =  AI ;
  57                    fina l String m ethodName  = "testSer vice";
  58                    
  59                    try  {
  60                         logger.tra ceEntry(th is, method Name);
  61                             Multiv aluedMap<S tring,Stri ng> header Map = http Headers.ge tRequestHe aders();
  62                         List<Strin g> headerV alues = he aderMap.ge t(Constant s.IAMHTTP_ ADSAMACCOU NTNAME);
  63                        
  64                             Subjec t s = new  Subject();
  65                             if (he aderValues  != null & & !headerV alues.isEm pty()) {
  66                                      for(Stri ng header  : headerVa lues){
  67                                               logger.inf o("Http he ader "+hea der);
  68                                               username =  header;
  69                                      }
  70                             }else  {
  71                                      username  = "ruruse r";
  72                             }
  73                             CCRSIA MPrincipal  iamPrinci pal = null ;
  74                             if (us ername !=  null && !u sername.is Empty()) {
  75                                      iamPrinc ipal = new  CCRSIAMPr incipal(us ername);
  76                             }else  {
  77                                      
  78                                      iamPrinc ipal = new  CCRSIAMPr incipal("r uruser");
  79                             }
  80                             
  81                             s.getP rincipals( ).add(iamP rincipal);
  82                             
  83                             logger .info("Log inRWS:  te st service  entry ..  yea!");
  84                             NameCa llback han dler = new  NameCallb ack(userna me);
  85                             
  86                             //Logi nContext l c = new Lo ginContext ("customId entityAsse rtion", ha ndler);
  87                             //syst em.DEFAULT   system.W EB_INBOUND
  88                             LoginC ontext lc  = new Logi nContext(" system.WEB _INBOUND", s);
  89   //                        LoginC ontext lc  = new Logi nContext(" system.DEF AULT",s);
  90                             if (lc  != null)  {
  91                                      lc.login ();  //ass ume succes sful 
  92                                      s = lc.g etSubject( );
  93                                      logger.i nfo("Login RWS:  test  service e ntry .. lc .login ok" );
  94                             }
  95                             
  96                             
  97                             if (s  != null) {
  98                                      WSSubjec t.setRunAs Subject(s) ;
  99                                      logger.i nfo("Login RWS:  test  service p rincipal s ize .."+s. getPrincip als().size ());
  100                                      Set<Prin cipal> pri ncipals =  s.getPrinc ipals();
  101                                      Iterator <Principal > pit = pr incipals.i terator();
  102                                      while (p it.hasNext ()) {
  103                                               Principal  principal  = pit.next ();
  104                                               logger.inf o("LoginRW S:  test s ervice pri ncipal nam e .."+prin cipal.getN ame());
  105                                      }
  106                             }
  107                             logger .traceExit (this, met hodName);
  108                    } ca tch (Excep tion e) {
  109                             // TOD O Auto-gen erated cat ch block
  110                             logger .exception (this, met hodName, e );
  111                    }
  112                    retu rn respons e;
  113           }
  114  
  115   }
  116  
  117