Commit graph

57 commits

Author SHA1 Message Date
larryruili
578673141c Migrate to new Sheets v4 api
This moves us from the oudated google/data XML api to the OnePlatform REST/JSON api, finally silencing the deprecation warnings we've been seeing.

The synchronization algorithm diffs the spreadsheet's current values with its internally sourced values, adding the row to a batch update request if there's a discrepancy. Additional internal data are added as an append operation to the end of the sheet, and any extraneous spreadsheet data is cleared from the spreadsheet.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169273590
2017-09-20 10:27:17 -04:00
mcilwain
7dc1940cdb Move ResaveAllEppResources mapreduce from tools service to backend
It makes sense for all mapreduces to run in backend, especially onces
that are scheduled regularly to run in cron like this one now. We don't
have many instances configured for the tools service anymore on some
of our environments, so backend is the friendliest place for a mapreduce
to run.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168882122
2017-09-20 10:27:17 -04:00
larryruili
477617eec9 Add activity report generation code
This adds Bigquery API client code to generate the activity reports from our
now standardSQL queries. The naming mirrors that of RDE (Staging generates the
reports and uploads them to GCS).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164656344
2017-08-29 15:53:33 -04:00
larryruili
4130a8a75e Create ICANN report upload action
This is the first step in moving the current []cron-Python reporting scripts
into App Engine, as an official part of the Nomulus package. This copies the
structure of RDE uploads, with a few changes specific to monthly reporting.

I've left some TODOs related to actually testing it on the ICANN endpoint, as we're still not sure how files to be uploaded will be staged, and whether we can actually ping their endpoint on valid ports (80 or 443).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160408703
2017-07-10 11:27:58 -04:00
mountford
9d96072e01 Remove requireLogin action attribute
The affected actions have been changed to check that the user is logged in by [] so this attribute is no longer needed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159572365
2017-06-21 10:04:05 -04:00
mountford
7d2f53a6fe Remove xsrfScope and xsrfProtection authentication attributes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159121132
2017-06-21 09:46:40 -04:00
mmuller
e6af34301d Move restore from backend to tools
Move the "restoreCommitLogs" command from the backend module to the tools
module so it's easier to access with nomulus.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=156768389
2017-05-23 17:22:49 -04:00
shikhman
2b1ab579dc Move metrics shutdown behavior to a ShutdownHook
HttpServlet#destroy() is not called on instance shutdown, so the metrics code was never shut down correctly before.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=156360866
2017-05-23 17:22:49 -04:00
guyben
ab515cb352 Replace KeystoreKeyring with KmsKeystore comparison
Replace KeystoreKeyring with ComparatorKeyring between KeystoreKeyring and
KmsKeystore. In the opensource version, will replace DummyKeyring with
KmsKeyring directly.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152893767
2017-04-13 10:58:57 -04:00
mountford
4f94464eaf Allow RdeStagingAction to be invoked manually
RdeStagingAction always processed all RDE and BRDA deposits currently outstanding, updating the cursors appropriately and kicking off the upload job. Sometimes we don't want all that. We just want to create a specific deposit by hand, without modifying the cursors or uploading. This CL adds parameters to support that.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152415959
2017-04-10 13:47:51 -04:00
mountford
5d4287a375 Add mapreduce cleanup action
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149432516
2017-03-13 10:24:57 -04:00
nickfelt
1e7fc4d64d Remove Builder type param on RequestComponentBuilder/RequestHandler
It turns out this type parameter was never necessary.  A builder only needs the reflexive second type parameter when you want to have a builder inheritance hierarchy where the descendant builders have methods that the ancestor builder doesn't.  In that case, the type param enables the ancestor builder's setter methods to automatically return the correct derived type, so that if you start with a derived builder, you can call a setter method inherited from an ancestor and then continue the chain with setters from the derived builder (e.g. new ContactResource.Builder().setCreationTime(now).setContactId(), which otherwise would have returned an EppResource.Builder from setCreationTime(), at which point the call to setContactId() would not compile).

Even then, it's not strictly necessary to use the type parameter, since you could instead just have each derived type override every inherited method to specify itself as the return type.  But that would be a lot of extra boilerplate and brittleness.

Anyway, in this case, there is a builder hierarchy, but RequestComponentBuilder specifies all the methods that we're ever going to want on our builders, so there's never any need to be able to call specific derived builder methods.  We only even need the individual builder classes so that Dagger can generate them separately for each component.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=148269178
2017-02-27 11:12:07 -05:00
mountford
0417f3d3a1 Daggerize XsrfTokenManager
The one-day validity period is also moved from the caller into XsrfTokenManager.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=147857716
2017-02-22 11:43:10 -05:00
mountford
c41f5bb31c Make first pass at new OAuth-aware server authentication framework
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=147081745
2017-02-14 11:59:19 -05:00
Wolfgang Meyers
da1f83a7b4 Add host linker mapreduce for RDE imports
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=147025088
2017-02-09 14:24:27 -05:00
Wolfgang Meyers
a904f2c6ee Add mapper to import domains from RDE deposits
With some additional cleanup by Ben McIlwain.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146695665
2017-02-06 16:46:46 -05:00
mmuller
b70f57b7c7 Update copyright year on all license headers
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146111211
2017-02-02 16:27:22 -05:00
jianglai
4fed3a9ae6 Daggerize ExportSnapshotServlet and CheckSnapshotServlet
Eradicate the last remnants of un-injectable servlets!

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145598002
2017-01-30 15:03:53 -05:00
mcilwain
eaec03e670 Move ConfigModule and LocalTestConfig into RegistryConfig
This is the final preparatory step necessary in order to load and load
configuration from YAML in a static context and then provide it either via
Dagger (using ConfigModule) or through RegistryConfig's existing static
functions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143819983
2017-01-09 12:01:09 -05:00
jart
734130aa73 Restructure Maven dependencies in build
We're now using java_import_external instead of maven_jar. This allows
us to specify the relationships between jars, thereby allowing us to
eliminate scores of vendor BUILD files that did nothing but re-export
@foo//jar targets, thus addressing the concerns of djhworld on Hacker
News: https://news.ycombinator.com/item?id=12738072

We now have redundant failover mirrors, which is a feature I added to
Bazel 0.4.2 in ed7ced0018

A new standard naming convention is now being used for all Maven repos.
Those names are calculated from the group_artifact name using the
following algorithm that eliminates redundancy:
https://gist.github.com/jart/41bfd977b913c2301627162f1c038e55

The JSR330 dep has been removed from java targets if they also depend
on Dagger, since Dagger always exports JSR330.

Annotation processor dependencies should now be leaner and meaner, by
more appropriately managing what needs to be on the classpath at
runtime. This should trim down the production jar by >1MB. As it stands
currently in the open source world:

- backend_jar_deploy.jar: 50MB
- frontend_jar_deploy.jar: 30MB
- tools_jar_deploy.jar: 45MB

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143487929
2017-01-09 11:59:04 -05:00
mcilwain
28f6c770c8 Add MOE equivalence for sync on 2016-12-19
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142449539
2017-01-09 11:59:04 -05:00
mountford
0afafeff03 Move VerifyEntityIntegrityAction to batch package
By moving []s into the batch package, which is not included in the frontend service, we pave the way to remove the dependency of frontend on the [] library.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142265351
2016-12-19 11:09:20 -05:00
mountford
669c3dc975 Move the async [] classes out of the flows package
We should be able to remove the dependency on the App Engine [] library from the frontend service, since no []s actually run there. In order to do this, we need to remove the various []-reliant classes from the frontend service build. This CL begins the process by moving the two async "flows" to a different package which is not included in the frontend service.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142159568
2016-12-19 11:09:19 -05:00
mcilwain
a56a0677ba Refactor RDE import stuff into its own rde.imports package
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141566236
2016-12-13 15:57:46 -05:00
mcilwain
2b7d580bb3 Run buildifier on codebase to format BUILD files
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140362453
2016-11-28 18:15:21 -05:00
nickfelt
f742ac8056 Refactor RequestHandler to handle request component construction
This refactors RequestHandler so that it handles the construction of the request
component itself, rather than being handed a pre-built request component
instance constructed by the invoking servlet.

The motivation for this change is so that RequestHandler can be extended in
future CLs to compute authentication results, and can provide those results as
an available binding in the constructed request component.  An alternative
approach could have been to compute the authentication results within
RequestModule itself, but I think it's clearer to keep business logic like
that outside of Dagger providers.

This CL makes the following individual changes:

- Adds request component builders, which implement a RequestComponentBuilder
  interface so they can all be manipulated by RequestHandler

- Instead of obtaining request components via factory methods on the global
  components, one now can have global-scoped bindings just inject the request
  component builders (which requires adding a module to each global component
  declaring the subcomponent).  This follows the recommended approach here:
  http://google.github.io/dagger/subcomponents.html

- Instead of exposing request components on the global component interface,
  we now expose module-specific subclasses of RequestHandler that @Inject the
  appropriate request component builder's provider and pass it to the superclass
  (note that inheritance isn't strictly necessary here but saves boilerplate)

- RequestHandler now takes the Provider<RequestComponentBuilder> and builds
  the component itself using its own fresh RequestModule instance. This provides
  some nice encapsulation but is mainly needed for adding a RequestAuthModule
  in future work.

- RequestHandler also takes UserService now, which can be provided via Dagger
  by the subclass.  Longer-term that will go away in favor of instead providing
  AuthStrategy instances, some of which will use UserService internally.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138815648
2016-11-15 10:49:05 -05:00
nickfelt
9122372e38 Change Router to do reflective setAccessible() calls itself
This change moves the reflective setAccessible() calls on the request component
methods (needed so that they can be invoked reflectively from RequestHandler)
to within Router itself, eliminating the need to manually call this from each
Servlet class and then pass in the resulting Method objects.  Instead, we just
pass in the request component class and let Router do the rest.

Old comments say that cross-package reflection is not allowed on AppEngine, but
while it's quite possible this was once the case, I can't reproduce that
limitation, and the documentation seems to contradict any such restriction:

"""
An application is allowed full, unrestricted, reflective access to its own
classes.  It can query any private members, call the method
java.lang.reflect.AccessibleObject.setAccessible(), and read/set private
members.
"""
https://cloud.google.com/appengine/docs/java/runtime#reflection

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138693006
2016-11-10 12:30:44 -05:00
dxy
a4d78afd70 Rename CloudDnsModule to CloudDnsWriterModule for consistency
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137070028
2016-11-02 15:19:34 -04:00
Wolfgang Meyers
4cfe107475 Add mapreduce for RDE hosts import
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136766682
2016-10-24 11:56:53 -04:00
shikhman
f76bc70f91 Preserve test logs and test summary output for Kokoro CI runs
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135494972
2016-10-14 16:57:43 -04:00
mcilwain
94c549d960 Delete obsoleted non-batched DNS refresh on host rename action
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135681285
2016-10-11 11:27:48 -04:00
mcilwain
e192c11adf Add a batched [] for DNS refreshing on host renames
This will replace the existing DnsRefreshForHostRenameAction.

This is stage one of a three stage migration process. It adds the new queue and
[] but doesn't call them yet. Stage two will cut over to using the new
functionality, and stage three will remove the old functionality.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134793963
2016-10-03 16:11:00 -04:00
mcilwain
b6fbe1f3df Consolidate expand billing events action into 'batch' package
Now it lives alongside the delete prober data action, as well as any future
batch/maintenance tasks that should run periodically.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134435668
2016-10-03 15:49:35 -04:00
mcilwain
1dcc5e5cc6 Remove non-batch async contact/host deletion actions
They have been superseded by DeleteContactsAndHostsAction.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134424453
2016-10-03 15:47:58 -04:00
mcilwain
7f0cb4eae5 Move prober deletion action to backend module
Also creates a new package named 'batch' to house it.

TESTED=I deployed it to alpha, sent a POST request to the task URL, and it
successfully ran the [].

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134332999
2016-10-03 15:41:38 -04:00
Wolfgang Meyers
28eeda189d Add map reduce job for contact import
Some additional changes were made by Ben McIlwain.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133875824
2016-09-22 14:29:20 -04:00
mcilwain
00ea99960a Improve efficiency of async contact and host deletion with batching
This allows handling of N asynchronous deletion requests simultaneously instead
of just 1.  An accumulation pull queue is used for deletion requests, and the
async deletion [] is now fired off whenever that pull queue isn't empty,
and processes many tasks at once.  This doesn't particularly take more time,
because the bulk of the cost of the async delete operation is simply iterating
over all DomainBases (which has to happen regardless of how many contacts and
hosts are being deleted).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133169336
2016-09-19 11:47:55 -04:00
nickfelt
e478fd09fb Remove straggling JarKeyring link and sort MOE-added imports
Followups from []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132564245
2016-09-14 15:29:30 -04:00
jart
b77ebd1df9 Don't use modules to instantiate classes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132380251
2016-09-07 12:17:58 -04:00
mcilwain
3b4b7a475b Replace VoidKeyring with InMemoryKeyring and a dummy module
VoidKeyring always threw exceptions whenever any of its methods were called,
which caused several parts of the system to fail early (and thus required a
proper Keyring to be implemented almost immediately, early on in the "just
playing around with the system" phase).

I'm swapping this out with an InMemoryKeyring which is supplied by
DummyKeyringModule, which, instead of throwing exceptions, returns dummy
values, delaying the onset of errors to when connecting to external services
is attempted.  This pushes off the required implementation of a real Keyring-
providing module, allowing the system to be played around with more first.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132361157
2016-09-07 12:15:08 -04:00
shikhman
1c5b4e16c6 Add metrics to PublishDnsUpdatesAction
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131190862
2016-08-26 09:43:30 -04:00
shikhman
87314c4469 Add missing dependency to open source build
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130981257
2016-08-22 17:38:40 -04:00
shikhman
b45c2ca2ee Wire in MetricReporter into the backend servlet to publish metrics
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130468842
2016-08-22 14:07:45 -04:00
jianglai
27820c512e Small fixes for orphan glue cleanup []
Moving to tools module for consistency.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130435371
2016-08-22 14:04:44 -04:00
jianglai
d2f033d9ed Ad-hoc refresh of all domains to clean up orphan glues
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130424917
2016-08-22 13:57:22 -04:00
mcilwain
8a76171417 Unbreak build by including DNS packages and modules
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129660098
2016-08-08 16:34:00 -04:00
Greg Shikhman
751df4b488 Re-indent module list in BackendComponent
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129453164
2016-08-05 20:40:54 -04:00
Greg Shikhman
a620d06239 Add dagger map for injecting DnsWriter implementations
This is one of several CLs in a sequence for allowing per-TLD DNS
implementations.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129445641
2016-08-05 20:38:21 -04:00
Greg Shikhman
1ba739a6b6 Refactor DnsWriter into the model package
This is one of several CLs in order to support per-TLD DnsWriter
implementations, modeled on the work done for PremiumPricingEngine.

Since DnsWriters will be set inside the Registry object, the DnsWriter
interface definition needs to be moved to models to create minimal
dependency on the rest of the registry codebase to avoid cyclic
dependency.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128711643
2016-08-02 19:10:49 -04:00
Brian Mountford
2c9567e183 Remove old DNS queue processing code.
The old DNS processing was performed by WriteDnsAction, which was invoked by the standard cron fanout action. The new code, which has been running for several months in production, uses ReadDnsQueueAction to do a custom fanout to PublishDnsUpdatesAction. We no longer need the old code, so it's time to remove it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127983115
2016-07-21 14:55:18 -04:00