<div dir="ltr"><div>Hi Dominic.</div><div><br></div><div>In order to add custom fields or support extensions there are several things to do, since currently RedDog doesn't have a simple way to do such things (definitely this should be easier to do, this will be added on a future release). You're right, the renderer exists specifically for support different output formats; if any content is going to be added, this should be done also at the objects in another level. </div><div><br></div><div>So, these are the things that could be done to achieve what you're looking for:</div><div><br></div><div>[MAIN UPDATES]</div><div><br></div><div>Project "rdap-server"</div><div><span style="white-space:pre-wrap">   </span>+ Add the extension to the RDAP conformance list, just as stated in RFC 7483 section 4.1. This can be added to the "RdapResponse" object; let's take "mx.nic.rdap.server.result.DomainResult" as an example, the extension can be added at following lines in the constructor:</div><div><br></div><div><span style="white-space:pre-wrap">          </span>domainResponse.setRdapConformance(new ArrayList<>());</div><div><span style="white-space:pre-wrap">              </span>domainResponse.getRdapConformance().add("rdap_level_0");</div><div><span style="white-space:pre-wrap">               </span>domainResponse.getRdapConformance().add("my_extension"); // Custom extension added</div><div><br></div><div>Project "rdap-core"</div><div><span style="white-space:pre-wrap">        </span>+ Depending on the objects altered by the extension, the new properties could be added to the core, either to an existing object or stated at a new object. Note that all objects extend "mx.nic.rdap.core.db.RdapObject".</div><div><br></div><div>Project "rdap-sql-provider" (only if you're using this reference implementation)</div><div><span style="white-space:pre-wrap">       </span>+ Depending on how the data is loaded from the DB, the queries at "src/main/resources/META-INF/sql" should be updated to load such data. The new columns must be mapped just as stated in the next point.</div><div><span style="white-space:pre-wrap">      </span>+ The properties mapped to the corresponding DB fields should be loaded in the affected classes at "mx.nic.rdap.sql.objects" package.</div><div><span style="white-space:pre-wrap">  </span>+ Probably the classes at "mx.nic.rdap.sql.model" package won't be modified, but if there's something that must be done different when querying the DB, then the corresponding classes must be updated.</div><div><br></div><div>Project "rdap-json-renderer" (only if you're using this reference implementation)</div><div><span style="white-space:pre-wrap"> </span>+ Depending on which object the new data is displayed, the changes must be made at the corresponding renderer. The class "mx.nic.rdap.renderer.json.JsonRenderer" is the implementation used to render the information, the properties could be added here or to a lower level, at the classes of "mx.nic.rdap.renderer.json.writer" package. Take a look on this classes to learn how they show the data.</div><div><br></div><div><span style="white-space:pre-wrap">  </span></div><div>[PRIVACY UPDATES]</div><div>If there are properties related to the extension that need privacy settings, these are the steps to follow:</div><div><br></div><div>Project "rdap-server"</div><div><span style="white-space:pre-wrap">        </span>+ Update the default privacy settings directory (src/main/resources/META-INF/privacy_default) by adding the new properties to the existing files, or by adding a new file containing the corresponding properties keys. Additionally, the privacy configuration directory must mirror those changes and can be configured just as stated in the documentation <a href="https://www.reddog.mx/response-privacy.html" target="_blank">https://www.reddog.mx/response-privacy.html</a>.</div><div><span style="white-space:pre-wrap">     </span>+ The privacy settings are loaded at "mx.nic.rdap.server.util.PrivacyUtil", so all the changes made at the privacy settings files must be loaded at this class. Note that if new properties were added to the existing files, there's no need to make changes at this class; but if there were new files added to the privacy settings directory, then such files must be added to be loaded. Take the "Domain" object as an example to know what must be done:</div><div><br></div><div><span style="white-space:pre-wrap">         </span>public static final String DOMAIN = "domain"; // Add the key</div><div><span style="white-space:pre-wrap">           </span>public static void loadAllPrivacySettings() throws IOException {</div><div><span style="white-space:pre-wrap">                 </span>/* ... */</div><div><span style="white-space:pre-wrap">                        </span>loadObjectPrivacySettings(DOMAIN); // Load its content</div><div><span style="white-space:pre-wrap">                   </span>/* ... */</div><div><span style="white-space:pre-wrap">                </span>}</div><div><span style="white-space:pre-wrap">                </span>public static Map<String, PrivacySetting> getDomainPrivacySettings() {</div><div><span style="white-space:pre-wrap">                     </span>return OBJECTS_PRIVACY_SETTING.get(DOMAIN); // Create its getter</div><div><span style="white-space:pre-wrap">         </span>}</div><div><br></div><div><span style="white-space:pre-wrap">       </span>+ Take a look at the "*Filter" classes in the "mx.nic.rdap.server.privacy" package (e.g. "AutnumPrivacyFilter", "DomainPrivacyFilter"). The properties related to the extension could be added to an existing filter, or they could have their own filter, whichever suits your needs. If new properties were added, its keys must be added as well; if a whole new file was added, then its corresponding filter could be added. Again, take as an example "Domain", in this case the "DomainPrivacyFilter" class; look how the "PrivacyUtil.getDomain*PrivacySettings()" function is called to iterate over the keys returned and apply the corresponding privacy setting.</div><div><br></div><div><br></div><div>Basically that's it, and if we're missing something or there's doubt, don't hesitate to let us know that. We admit that probably isn't an easy task to add a custom extension or properties, but this kind of things will help us to improve this RDAP implementation.</div><div><br></div><div>Best regards, RedDog's development team</div><div dir="ltr"><div><br></div><br><div class="gmail_quote"><div dir="ltr">El jue., 8 de mar. de 2018 a la(s) 09:55, Dominic Ast <<a href="mailto:dominic.ast@switch.ch" target="_blank">dominic.ast@switch.ch</a>> escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi there<br>
<br>
I am looking at the RegDog RDAP implementation respectively it's<br>
documentation. Is there a way to add custom fields for example to a<br>
domain which is allowed by RFC7483 (prefixed)  or to support a RDAP<br>
extension? I didnt see that stuff in the documentation as I think that<br>
the renderer is just for supporting different output formats and not for<br>
adding content? Thank you for any hint.<br>
<br>
Best regards, Dominic<br>
<br>
<br>
_______________________________________________<br>
Reddog-public mailing list<br>
<a href="mailto:Reddog-public@nic.mx" target="_blank">Reddog-public@nic.mx</a><br>
<a href="https://mail-lists.nic.mx/listas/listinfo/reddog-public" rel="noreferrer" target="_blank">https://mail-lists.nic.mx/listas/listinfo/reddog-public</a><br>
</blockquote></div></div></div>