google-nomulus/javatests/google/registry
jianglai 6352b8a01a Use self-managed credential in remote api installer
RemoteApiOption has a package-private method that takes a Stream representing the content of a JSON and use a GoogleCredential created from it as its credential. This CL uses reflection to change the access modifier of that method in order to supply a credential stream that is self-managed. This is obviously not ideal and prone to breakage in case the getGoogleCredentialStream method is changed. Unfortunately upstream is not willing to make it public citing the reason that GoogleCredential.fromStream() (which getGoogleCredentialStream uses) is a @Beta annotated function (see https://groups.google.com[]forum/#!searchin/domain-registry-eng/remoteapioptions%7Csort:date/domain-registry-eng/Flsah6skszQ/CySZv2XEBwAJ). However this function is introduced 5 years ago as a public function (b857184bfa). I think at this point it is safe to assume that it is part of the widely used APIs and will not change without sufficient notice.

Note here that RemoteApiOptions creates its own copy of GoogleCredential to be used to call App Engine APIs locally, whereas communications to Nomulus endpoints use the Credential provided in AuthModule. Even though both credentials are created from the same client id, client secret and refresh token (the three elements needed to construct a GoogleCredential this way, see https://github.com/googleapis/google-api-java-client/blob/master/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.java#L842), their refreshes cycles are independent of each other. I verified that refreshing one of the credential does not invalidate the access token of the other credential, as long as it is not expired yet.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=224156131
2018-12-05 16:02:28 -05: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 Make BillingModule.OVERALL_INVOICE_PREFIX configurable 2018-11-16 17:00:38 -05: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 Move YamlUtils to be under google.registry.util package 2018-11-14 12:00:45 -05: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 proper external dependency references recognized by moe 2018-11-16 17:03:50 -05:00
flows Move more lifecycle test helper methods to base class 2018-12-03 19:21:52 -05:00
groups Add support G-Suite group whose members have ADMIN access to registrar console 2018-11-12 14:51:40 -05:00
keyring Remove the ability to download service account credentials 2018-12-05 16:00:51 -05:00
mapreduce/inputs Clean up internal imports in BUILD files 2018-07-14 01:37:03 -04:00
model Explicitly set the shard size when saving the claims list 2018-10-22 19:13:11 -04:00
module Remove the ability to download service account credentials 2018-12-05 16:00:51 -05:00
monitoring/whitebox Stop exporting EPP flow metrics to BigQuery 2018-10-08 16:59:29 -04:00
pricing Clean up third_party imports in BUILD files 2018-07-14 01:11:51 -04:00
proxy Fix EPP quota handling bug 2018-10-17 11:56:04 -04:00
rdap Move AuthenticatedRegistrarAccessor to request/auth/ 2018-11-16 16:54:21 -05:00
rde Refactor StringGenerator bindings 2018-10-22 19:06:35 -04:00
reporting Make BillingModule.OVERALL_INVOICE_PREFIX configurable 2018-11-16 17:00:38 -05:00
request Allow only OWNERs to change owner-related data on registrar console 2018-12-03 18:56:28 -05: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 Remove the ability to download service account credentials 2018-12-05 16:00:51 -05:00
tldconfig/idn Remove the use of InjectRule in IdnLabelValidatorTest 2018-10-22 18:54:53 -04:00
tmch Refactor TmchCertificateAuthority 2018-10-25 14:40:38 -04:00
tools Use self-managed credential in remote api installer 2018-12-05 16:02:28 -05:00
ui Hide the edit/add buttons for fields the user can't update 2018-12-03 19:25:05 -05:00
util Move YamlUtils to be under google.registry.util package 2018-11-14 12:00:45 -05: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