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