You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever an invalid value is placed at the properties in webapp/WEB-INF/privacy/*.properties an IllegalArgumentException is thrown. Eg. at the file "autnum_events.properties", set "eventAction=anyy" (note the typo) and start the server.
The issue is at mx.nic.rdap.server.util.PrivacyUtil function loadObjectPrivacySettings(String). This block is at the function, I added some comments:
Stringproperty = properties.getProperty((String) key).trim();
/** Here's the problem, the exception is never handled. The enum will never have an invalid value. **/PrivacyStatusprivacyProperty = PrivacyStatus.valueOf(property.toUpperCase());
switch (privacyProperty) {
caseOWNER:
break;
caseAUTHENTICATED:
break;
caseANY:
break;
caseNONE:
break;
default:
/** Good intentions, but the code is never reached **/isInvalidProperties = true;
builder.append(key + "=" + property + ", ");
continue;
}
The text was updated successfully, but these errors were encountered:
Whenever an invalid value is configured, the server will indicate it in a friendly manner (logged at console) since the exception IllegalArgumentException is now handled.
Verified. If an invalid value is configured for privacy status properties (for example "supernintendochalmers" for handle property in domain.properties), the following stack trace is displayed on logs:
04-Oct-2017 19:05:44.200 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class mx.nic.rdap.server.listener.RdapInitializer
java.lang.IllegalArgumentException: java.lang.RuntimeException: Invalid privacy file 'domain.properties'.
Invalid values: handle=supernintendochalmers,
at mx.nic.rdap.server.listener.RdapInitializer.contextInitialized(RdapInitializer.java:67)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)
Whenever an invalid value is placed at the properties in
webapp/WEB-INF/privacy/*.properties
anIllegalArgumentException
is thrown. Eg. at the file "autnum_events.properties", set "eventAction=anyy" (note the typo) and start the server.The issue is at
mx.nic.rdap.server.util.PrivacyUtil
functionloadObjectPrivacySettings(String)
. This block is at the function, I added some comments:The text was updated successfully, but these errors were encountered: