604. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 7/6/2017 8:23:35 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.

604.1 Files compared

# Location File Last Modified
1 OSCIF_CTT_v4_build 1.zip\VUID-rest\src\main\java\gov\vha\vuid\rest\session PrismeIntegratedUserService.java Wed May 31 03:59:14 2017 UTC
2 OSCIF_CTT_v4_build 1.zip\VUID-rest\src\main\java\gov\vha\vuid\rest\session PrismeIntegratedUserService.java Mon Jul 3 23:41:01 2017 UTC

604.2 Comparison summary

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

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

604.4 Active regular expressions

No regular expressions were active.

604.5 Comparison detail

  1   /**
  2    * Copyrig ht Notice
  3    *
  4    * This is  a work of  the U.S.  Government  and is no t subject  to copyrig ht
  5    * protect ion in the  United St ates. Fore ign copyri ghts may a pply.
  6    * 
  7    * License d under th e Apache L icense, Ve rsion 2.0  (the "Lice nse");
  8    * you may  not use t his file e xcept in c ompliance  with the L icense.
  9    * You may  obtain a  copy of th e License  at
  10    *
  11    * http:// www.apache .org/licen ses/LICENS E-2.0
  12    *
  13    * Unless  required b y applicab le law or  agreed to  in writing , software
  14    * distrib uted under  the Licen se is dist ributed on  an "AS IS " BASIS,
  15    * WITHOUT  WARRANTIE S OR CONDI TIONS OF A NY KIND, e ither expr ess or imp lied.
  16    * See the  License f or the spe cific lang uage gover ning permi ssions and
  17    * limitat ions under  the Licen se.
  18    */
  19   package go v.vha.vuid .rest.sess ion;
  20  
  21   import jav a.io.IOExc eption;
  22   import jav a.net.URL;
  23   import jav a.util.Opt ional;
  24   import jav a.util.Set ;
  25   import jav a.util.UUI D;
  26   import jav ax.inject. Singleton;
  27   import org .apache.lo gging.log4 j.LogManag er;
  28   import org .apache.lo gging.log4 j.Logger;
  29   import org .glassfish .hk2.api.R ank;
  30   import org .jvnet.hk2 .annotatio ns.Service ;
  31   import com .fasterxml .jackson.c ore.JsonPa rseExcepti on;
  32   import com .fasterxml .jackson.d atabind.Js onMappingE xception;
  33   import gov .vha.isaac .ochre.api .User;
  34   import gov .vha.isaac .ochre.api .UserRole;
  35  
  36   /**
  37    * The Cla ss PrismeI ntegratedU serService
  38    *
  39    * {@link  PrismeInte gratedUser Service}
  40    * 
  41    * @author  <a href=" mailto:joe l.kniaz.li st@gmail.c om">Joel K niaz</a>
  42    */
  43   @Service(n ame="rest- prismeUser Service")
  44   @Rank(valu e = 10)
  45   @Singleton
  46   public cla ss PrismeI ntegratedU serService  implement s PrismeUs erService  {
  47           pr ivate stat ic Logger  log = LogM anager.get Logger(Pri smeIntegra tedUserSer vice.class );
  48           
  49           // private Pr operties p rismePrope rties_ = n ull;
  50  
  51           pr otected Pr ismeIntegr atedUserSe rvice() {
  52                    //fo r HK2
  53           }
  54  
  55           /* *
  56            *  
  57            *  @see gov. vha.vuid.r est.sessio n.PrismeUs erService# getUser(ja va.lang.St ring)
  58            * /
  59           @O verride
  60           pu blic Optio nal<User>  getUser(St ring ssoTo ken) {
  61                    try  {
  62                             return  Optional. of(getUser FromPrisme (ssoToken) );
  63                    } ca tch (Excep tion e) {
  64                             log.er ror("Faile d to retre ive user f rom prisme  with ssoT oken '" +  ssoToken +  "'", e);
  65                             return  Optional. empty();
  66                    }
  67           }
  68  
  69           /* *
  70            *  @see gov. vha.isaac. ochre.api. UserRoleSe rvice#getU serRoles(j ava.util.U UID)
  71            * /
  72           @O verride
  73           pu blic Set<U serRole> g etUserRole s(UUID use rId)
  74           {
  75                    thro w new Unsu pportedOpe rationExce ption();
  76           }
  77  
  78           //  Private h elpers
  79           pr otected Us er getUser FromPrisme (String ss oToken) th rows JsonP arseExcept ion, JsonM appingExce ption, IOE xception {
  80   //               /*
  81   //                * E xample URL  for get_r oles_by_to ken
  82   //                 * URL url  = new URL( "https:// DNS                        /
?token=" +  token);
  83   //                */
  84   //               /*
  85   //                * E xample SSO  Token
  86   //                * % 5B%22u%5Cf %5Cx8F%5Cx B1X%5C%22% 5CxC2%5CxE E%5CxFA%5C xE1%5Cx94% 5CxBF3%5Cx A9%5Cx16K% 22%2C+%22% 7EK%5CxC4% 5CxEFXk%5C x80%5CxB1% 5CxA3%5CxF 3%5Cx8D%5C xB1%5Cx7F% 5CxBC%5Cx0 2K%22%2C+% 22k%5Cf%5C xDC%5CxF7% 2CP%5CxB2% 5Cx97%5Cx9 9%5Cx99%5C xE0%5CxE1% 7C%5CxBF%5 Cx1DK%22%2 C+%22J%5Cf %5Cx9B%5Cx D8w%5Cx15% 5CxFE%5CxD 3%5CxC7%5C xDC%5CxAC% 5Cx9E%5Cx1 C%5CxD0bG% 22%5D
  87   //                */
  88   //                //String j son = "{\" roles\":[{ \"id\":100 00,\"name\ ":\"read_o nly\",\"re source_id\ ":null,\"r esource_ty pe\":null, \"created_ at\":\"201 6-09-13T14 :48:18.000 Z\",\"upda ted_at\":\ "2016-09-1 3T14:48:18 .000Z\"}], \"token_pa rsed?\":tr ue,\"user\ ":\"
D NS     ",\"type\" :\"ssoi\", \"id\":100 05}";
  89                    Stri ng prismeR olesByToke nUrlStr =  PrismeServ iceUtils.g etConfigPr operty("pr isme_roles _by_token_ url");
  90                    URL  url = new  URL(prisme RolesByTok enUrlStr);
  91                    User  user = Us erServiceU tils.getUs erFromUrl( url, ssoTo ken);
  92                    log. trace("Ret rieved fro m " + pris meRolesByT okenUrlStr  + " user= \"" + user  + "\"");
  93                    retu rn user;
  94           }
  95  
  96           /* *
  97            *  @see gov. vha.isaac. ochre.api. UserRoleSe rvice#getA llUserRole s()
  98            * /
  99           @O verride
  100           pu blic Set<U serRole> g etAllUserR oles()
  101           {
  102                    thro w new Unsu pportedOpe rationExce ption();
  103           }
  104   }