Skip to content

Commit

Permalink
Updates PR 586 Gazelle XUA Username enum class with two new construct…
Browse files Browse the repository at this point in the history
…ors and a toString() method that returns the proper username. This will replace the "DOT" string replace method calls.
  • Loading branch information
Bhaskarla authored and Bhaskarla committed May 22, 2023
1 parent bde9b75 commit b11c62d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,33 @@ public enum GazelleXuaUsername {
secondpurposeofuse,
withauthzconsent,

secondpurposeofuseDOTCOVERAGE,
secondpurposeofuseDOTOPERATIONS,
secondpurposeofuseDOTPAYMENT,
secondpurposeofuseDOTPUBLICHEALTH,
secondpurposeofuseDOTREQUEST,
secondpurposeofuseDOTTREATMENT,
secondpurposeofuseDOTLEGACYTREATMENT,
secondpurposeofuseDOTREASSURANCE,
secondpurposeofuseDOTTREATMENTOID,
secondpurposeofuseDOTCOVERAGEOID,
secondpurposeofuseDOTOPERATIONSOID,
secondpurposeofuseDOTPAYMENTOID,
secondpurposeofuseDOTPUBLICHEALTHOID,
secondpurposeofuseDOTREQUESTOID
secondpurposeofuseDOTCOVERAGE("secondpurposeofuse.COVERAGE"),
secondpurposeofuseDOTOPERATIONS("secondpurposeofuse.OPERATIONS"),
secondpurposeofuseDOTPAYMENT("secondpurposeofuse.PAYMENT"),
secondpurposeofuseDOTPUBLICHEALTH("secondpurposeofuse.PUBLICHEALTH"),
secondpurposeofuseDOTREQUEST("secondpurposeofuse.REQUEST"),
secondpurposeofuseDOTTREATMENT("secondpurposeofuse.TREATMENT"),
secondpurposeofuseDOTLEGACYTREATMENT("secondpurposeofuse.LEGACYTREATMENT"),
secondpurposeofuseDOTREASSURANCE("secondpurposeofuse.REASSURANCE"),
secondpurposeofuseDOTTREATMENTOID("secondpurposeofuse.TREATMENTOID"),
secondpurposeofuseDOTCOVERAGEOID("secondpurposeofuse.COVERAGEOID"),
secondpurposeofuseDOTOPERATIONSOID("secondpurposeofuse.OPERATIONSOID"),
secondpurposeofuseDOTPAYMENTOID("secondpurposeofuse.PAYMENTOID"),
secondpurposeofuseDOTPUBLICHEALTHOID("secondpurposeofuse.PUBLICHEALTHOID"),
secondpurposeofuseDOTREQUESTOID("secondpurposeofuse.REQUESTOID");

private String username;

GazelleXuaUsername() {
this.username = this.name();
}

GazelleXuaUsername(String username) {
this.username = username;
}

@Override
public String toString() {
return this.username;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public void redisplay(boolean clearResults) {
samlListBox = new ListBox();
samlListBox.addItem("SAML OFF", "NoSaml");
for (GazelleXuaUsername username : GazelleXuaUsername.values()) {
String name = username.name().replace("DOT", ".");
String name = username.toString(); // name().replace("DOT", ".");
samlListBox.addItem("SAML - " + name, name);
}
samlListBox.setVisibleItemCount(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2053,10 +2053,10 @@ public String getStsSamlAssertion(GetStsSamlAssertionRequest request) throws Exc
public Map<String,String> getStsSamlAssertionsMap(GetStsSamlAssertionMapRequest request) throws Exception {
Map<String,String> assertionMap = null;
for (GazelleXuaUsername username : GazelleXuaUsername.values()) {
String usernameStr = username.name();
if (usernameStr.contains("DOT")) {
usernameStr = usernameStr.replace("DOT", ".");
}
String usernameStr = username.toString();
// if (usernameStr.contains("DOT")) {
// usernameStr = usernameStr.replace("DOT", ".");
// }
if (request.getParams()!=null) {
request.getParams().clear();
request.getParams().put("$saml-username$", usernameStr);
Expand Down

0 comments on commit b11c62d

Please sign in to comment.