mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Avoid showing personal contact data in RDAP when not logged in
This CL changes the RDAP responses. When the requester asks for information about a domain, and is not logged in as the owning registrar, no contact information is shown. When the requester asks for information about a contact, and is not logged in as the owner registrar, the existence of the contact is shown, but not any personal data (the existence is shown to make things easier to test). The login uses the same functionality as the registrar console. For the most part, this CL does not include the necessary tests to make sure that data is not returned when not logged in. The CL is so large that I didn't want to burden it further. Those tests will be added in a follow-on CL. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=168022034
This commit is contained in:
parent
e892a2f0fe
commit
c85dc0c089
23 changed files with 853 additions and 266 deletions
|
@ -60,7 +60,7 @@ import org.joda.time.DateTime;
|
|||
@Action(
|
||||
path = RdapEntitySearchAction.PATH,
|
||||
method = {GET, HEAD},
|
||||
auth = Auth.AUTH_PUBLIC_ANONYMOUS
|
||||
auth = Auth.AUTH_PUBLIC
|
||||
)
|
||||
public class RdapEntitySearchAction extends RdapActionBase {
|
||||
|
||||
|
@ -254,6 +254,7 @@ public class RdapEntitySearchAction extends RdapActionBase {
|
|||
// There can be more results than our max size, partially because we have two pools to draw from
|
||||
// (contacts and registrars), and partially because we try to fetch one more than the max size,
|
||||
// so we can tell whether to display the truncation notification.
|
||||
Optional<String> loggedInClientId = getLoggedInClientId();
|
||||
List<ImmutableMap<String, Object>> jsonOutputList = new ArrayList<>();
|
||||
for (ContactResource contact : contacts) {
|
||||
if (jsonOutputList.size() >= rdapResultSetMaxSize) {
|
||||
|
@ -268,7 +269,8 @@ public class RdapEntitySearchAction extends RdapActionBase {
|
|||
rdapLinkBase,
|
||||
rdapWhoisServer,
|
||||
now,
|
||||
outputDataType));
|
||||
outputDataType,
|
||||
loggedInClientId));
|
||||
}
|
||||
for (Registrar registrar : registrars) {
|
||||
if (registrar.isActiveAndPubliclyVisible()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue