google-nomulus/javatests/google/registry
guyben 70273fa791 Fix error reply from RegistrarSettingsAction
RegistrarSettingsAction is a JSON in / JSON out endpoint, meaning the reply is consumed as JSON.

The current state is that if an error occurs, there are two possible replies:
- a JSON error reply is sent out, or
- a 402 HTML reply is sent out with the exception.getMessage()

The difference is only - do we actively catch the exception to translate it to JSON or not.

This fix catches ALL exceptions and translates them to JSON format. Note that there's no security change by giving the getMessage in the JSON reply since we were returning that anyway (in the HTML).

In addition - changed the "gaeUserId" to "user.getEmail" as the identifier, since it's clearer to the users who see that error - and I do want to transition to a more "email identifier" way of checking access (since that's what users put in the registrar contact info)

This too isn't leaking new information because
- the initial HTML page load already gives the user's email, and
- the logs already log the user's email for every request

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215213807
2018-10-03 12:07:20 -04:00
..
backup Clean up third_party imports in BUILD files 2018-07-14 01:11:51 -04:00
batch Delete the verify entity integrity mapreduce 2018-09-20 11:19:36 -04:00
beam Handle Purchase Order numbers explicitly in billing pipeline 2018-09-20 11:19:36 -04:00
bigquery Use @DefaultCredential for Cloud API access in GAE 2018-09-20 11:19:36 -04:00
builddefs Format .bzl files with buildifier 2018-07-14 01:37:03 -04:00
config Mark CloudDnsConfigTest as GoogleInternal 2018-09-20 11:19:36 -04:00
cron Clean up third_party imports in BUILD files 2018-07-14 01:11:51 -04:00
dns Clean up third_party imports in BUILD files 2018-07-14 01:11:51 -04:00
export Use @DefaultCredential for Cloud API access in GAE 2018-09-20 11:19:36 -04:00
flows Remove checking of SNI headers 2018-09-14 21:34:44 -04:00
groups Clean up internal imports in BUILD files 2018-07-14 01:37:03 -04:00
keyring Delete all Braintree code 2018-07-14 01:37:03 -04:00
mapreduce/inputs Clean up internal imports in BUILD files 2018-07-14 01:37:03 -04:00
model Index the allocation token's redemption history entry field 2018-10-03 11:52:31 -04:00
module Delete the verify entity integrity mapreduce 2018-09-20 11:19:36 -04:00
monitoring/whitebox Use @DefaultCredential for Cloud API access in GAE 2018-09-20 11:19:36 -04:00
pricing Clean up third_party imports in BUILD files 2018-07-14 01:11:51 -04:00
proxy Move GCP proxy code to the old [] proxy's location 2018-09-20 11:19:36 -04:00
rdap Clean up registrar console login flow 2018-10-03 11:57:34 -04:00
rde Move the RDE TAR file encoding to a dedicated file 2018-08-10 13:46:48 -04:00
reporting Deploy spec11 reporting to production 2018-09-14 21:31:34 -04:00
request Get rid of Providers class 2018-09-20 11:19:36 -04:00
security Improve internal build system speed 2018-06-27 15:28:52 -04:00
server Delete all Braintree code 2018-07-14 01:37:03 -04:00
storage/drive Merge JUnitBackport's expectThrows into assertThrows 2018-03-06 18:56:15 -05:00
testing Move GCP proxy code to the old [] proxy's location 2018-09-20 11:19:36 -04:00
tldconfig/idn Merge JUnitBackport's expectThrows into assertThrows 2018-03-06 18:56:15 -05:00
tmch Clean up third_party imports in BUILD files 2018-07-14 01:11:51 -04:00
tools Add nomulus command for deleting AllocationTokens 2018-10-03 11:54:10 -04:00
ui Fix error reply from RegistrarSettingsAction 2018-10-03 12:07:20 -04:00
util Add newline after closing boundary in multipart upload of LORDN 2018-09-14 11:49:12 -04:00
whois Clean up annotation imports in BUILD files 2018-06-27 15:28:53 -04:00
xjc Clean up internal imports in BUILD files 2018-07-14 01:37:03 -04:00
xml Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00