Commit graph

23 commits

Author SHA1 Message Date
guyben
e224a67eda Change @Auth to an AutoValue, and created a set of predefined Auths
We want to be safer and more explicit about the authentication needed by the many actions that exist.

As such, we make the 'auth' parameter required in @Action (so it's always clear who can run a specific action) and we replace the @Auth with an enum so that only pre-approved configurations that are aptly named and documented can be used.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162210306
2017-08-01 16:33:10 -04:00
mountford
bc63d80a5e Change auth settings on some tools service actions
This brings the affected actions into line with the settings on other similar actions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157259842
2017-06-05 18:17:09 -04:00
mmuller
5ffb424682 Add a "loadtest" command to nomulus tool
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151034721
2017-03-27 13:16:35 -04:00
nickfelt
2353bcd8c5 Cut over to generating new HMAC-based XSRF tokens
This is the second step of migrating to our new XSRF token format.  The
first step ([] made validate() start accepting new tokens
(basically, dual-read).  This step cuts over our "writing" to write the
new token format.  The third and final step will drop support for
validating the old token format (back to single-read).  We'll do that
in a subsequent push so that we don't invalidate all the current XSRF
tokens that people might have in their browsers.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149790648
2017-03-13 11:22:56 -04:00
mmuller
4eef02f17f Inject token manager into LoadTestAction constructor
Inject into constructor instead of an instance variable, since it gets used
in the constructor before the instance variables get injected.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149452717
2017-03-13 10:29:22 -04:00
nickfelt
2e969d6ed1 Change XsrfTokenManager to support new HMAC token format
This follows up on Brian's work to transition not just to a new format
with an empty scope value, but instead to replace the existing format
entirely with a new one that:

  1) includes a version number to support future format migrations
  2) doesn't include a field for the scope at all, since scoping the
     tokens adds no real security benefit and just makes verification
     more difficult
  3) replaces the raw SHA-256 hash with a SHA-256 HMAC instead, as a
     best practice to avoid length-extension attacks [1], even though
     in our particular case they would only be able to extend the
     timestamp and would thus be relatively innocuous

The new format will be produced by calling generateToken(), and the
scope-accepting version is renamed to generateLegacyToken() in addition
to its existing deprecation, for maximum clarity.

I changed the validateToken() logic to stop accepting a scope entirely;
when validating a legacy-style token, we'll test it against the two
existing legacy scope values ("admin" and "console") and accept it if
it matches either one.

Note that this means the xsrfScope parameter in @Action is now wholly
obsolete; I'll remove it in a follow-up to avoid bringing extra files
into this CL.

After this CL hits production, the next one will replace all calls to
generateLegacyToken() with generateToken().  Once that CL is deployed,
the last step will be removing the legacy fallback in validateToken().

[1] See https://en.wikipedia.org/wiki/Length_extension_attack

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=148936805
2017-03-07 13:31:46 -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
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
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
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
1ac0832c79 Fix double-URL-encoding bug in LoadTestAction
This was inadvertently introduced in [] - the original code manually URL-encoded the XML, but the TaskOptions.param() method does that for you, so now we're double-URL-encoding the XML and as a result the actual /_dr/epptool invocation is failing with a syntax error (which was somewhat hard to diagnose, since it logs nothing and returns HTTP 200 in that case - to be fixed separately).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137321114
2016-11-02 15:19:34 -04:00
mcilwain
8e5bd45976 Fix bugs in load test action so that it actually works
This adds XSRF tokens so that the epptool request succeeds, adds better logging for debugging load test requests, adds better validation, and improves documentation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136885117
2016-10-24 11:57:00 -04:00
jart
2e81de9954 Make essential Bazel packages publicly visible
This allows separate Bazel projects to reference Nomulus as an external
repository. They can then copy the []
directory structure into their own project and customize the Action
and Module lists for the GAE modules in their own deployment.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136863886
2016-10-24 11:57:00 -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
4813ed392b Rename "clientIdentifier" to "clientId" almost everywhere
It's best to be consistent and use the same thing everywhere.  "clientId" was
already used in more places and is shorter and no more ambiguous, so it's the
logical one to win out.

Note that this CL is almost solely a big Eclipse-assisted refactoring. There are
two places that I did not change clientIdentifier -- the actual entity field on
Registrar (though I did change all getters and setters), and the name of a
column on the exported registrar spreadsheet. Both would require data
migrations.

Also fixes a few minor nits discovered in touched files, including an incorrect
test in OfyFilterTest.java and some superfluous uses of String.format() when
calling checkArgument().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133956465
2016-09-22 14:30:05 -04:00
Justine Tunney
7f3f03ee97 MOE strip compatible_with
This is an internal-only feature that breaks the open source build.

CL created with:

    dr-replace '(compatible_with.*)' '\1  # MOE:strip_line'

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128852873
2016-08-02 19:14:28 -04:00
Chris Povirk
5332ac4e4a Set compatible_with=appengine on GAE targets
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128475519
2016-08-02 19:09:11 -04:00
mcilwain
aa2f283f7c Convert entire project to strict lexicographical import sort ordering
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127234970
2016-07-13 15:59:53 -04:00
Justine Tunney
45747fd792 Make open source build pass
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124868265
2016-06-14 16:33:56 -04:00
Corey Goldfeder
366c5a344d Change the LoadTestAction to use /_dr/epptool
The load tests used to directly build EPP, but that becomes
problematic for an upcoming CL that refactors a lot of the
EPP flow code. Instead, use the existing tool endpoint
(conveniently, LoadTestAction is already in the tools module).
This required changing the EppToolServlet to get its
xml from a param rather than from the request payload,
since task queues won't allow both a payload and request
params on the same task.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124351878
2016-06-14 16:29:22 -04:00
Michael Muller
c458c05801 Rename Java packages to use the .google TLD
The dark lord Gosling designed the Java package naming system so that
ownership flows from the DNS system. Since we own the domain name
registry.google, it seems only appropriate that we should use
google.registry as our package name.
2016-05-13 20:04:42 -04:00
Justine Tunney
5012893c1d mv com/google/domain/registry google/registry
This change renames directories in preparation for the great package
rename. The repository is now in a broken state because the code
itself hasn't been updated. However this should ensure that git
correctly preserves history for each file.
2016-05-13 18:55:08 -04:00