MCPcopy Create free account
hub / github.com/apache/tomcat / makeLegalForJAAS

Method makeLegalForJAAS

java/org/apache/catalina/realm/JAASRealm.java:582–597  ·  view source on GitHub ↗

Ensure the given name is legal for JAAS configuration. Added for Bugzilla 30869, made protected for easy customization in case my implementation is insufficient, which I think is very likely. @param src The name to validate @return A string that's a valid JAAS realm name

(final String src)

Source from the content-addressed store, hash-verified

580 * @return A string that's a valid JAAS realm name
581 */
582 protected String makeLegalForJAAS(final String src) {
583 String result = src;
584
585 // Default name is "other" per JAAS spec
586 if (result == null) {
587 result = "other";
588 }
589
590 // Strip leading slash if present, as Sun JAAS impl
591 // barfs on it (see Bugzilla 30869 bug report).
592 if (result.startsWith("/")) {
593 result = result.substring(1);
594 }
595
596 return result;
597 }
598
599
600 // ------------------------------------------------------ Lifecycle Methods

Callers 1

setContainerMethod · 0.95

Calls 1

startsWithMethod · 0.45

Tested by

no test coverage detected