Commit Graph

377 Commits

Author SHA1 Message Date
Colin McDonald
68f6f5ea79 Readd permission checks respecting * 2016-08-04 17:34:33 -04:00
Colin McDonald
23a6739eb1 Update /staff for Ariel (new schhema) 2016-08-02 19:16:21 -04:00
Colin McDonald
7f10888151 Rank schema changes 2016-08-02 19:03:21 -04:00
Colin McDonald
d9d87872cb Update Server+ServerGroup cache more frequently 2016-08-01 16:21:17 -04:00
Colin McDonald
3dad944ca3 Fix logic in server timeout check 2016-07-27 16:06:28 -04:00
Colin McDonald
e52d451fa1 Optimize imports 2016-07-27 15:04:37 -04:00
Colin McDonald
694394a670 Don't run SyncUtils.runBlocking methods in AuditLog callbacks (these callbacks are ran on an event loop thread) 2016-07-27 15:04:11 -04:00
Colin McDonald
79a9f7770c Remove test code in main class, fix small issue in UserSessionUtils 2016-07-25 21:10:34 -04:00
Colin McDonald
1c64109862 Add ip validation exclusion for IPv6 localhost ip (Ariel's testing server) 2016-07-25 20:59:34 -04:00
Colin McDonald
4b0d66985e Add ip validations where needed 2016-07-25 20:58:52 -04:00
Colin McDonald
e827a30131 Cleanup password verification code 2016-07-25 17:14:27 -04:00
Colin McDonald
3ab317da1f Fix issue with User#findByEmailToken caused by field renaming 2016-07-25 16:58:10 -04:00
Colin McDonald
5805506372 Return 404s automatically when our response is null 2016-07-25 16:57:44 -04:00
Colin McDonald
df938dcd0a Fix flow issue in POST /users/:id/changePassword 2016-07-25 15:49:38 -04:00
Colin McDonald
02f79731a9 Fix UserSessionUtils#invalidateAllSessions with no active sessions 2016-07-25 15:49:22 -04:00
Colin McDonald
dc7f828e13 Remove + as a valid char in emails 2016-07-25 15:48:53 -04:00
Colin McDonald
2ba32f752d Fix NPE in POST /users/:id/registerEmail 2016-07-23 19:58:43 -04:00
Colin McDonald
303634dedc Remove unneeded request parameters in Mandrill request 2016-07-23 19:53:08 -04:00
Colin McDonald
1b1e1bb3e9 Perform better validation on Mandrill responses 2016-07-23 18:46:02 -04:00
Colin McDonald
b668d19448 Comment out uuid refresh code 2016-07-23 14:30:05 -04:00
Colin McDonald
60dfe6b03e Fix issue where multiple users could confirm with the same email 2016-07-23 14:29:26 -04:00
Colin McDonald
95440504d5 Rename User#findByEmail to User#findByConfirmedEmail to remove ambiguity 2016-07-23 14:28:44 -04:00
Colin McDonald
18c0868baf unfinished uuid refresh feature 2016-07-20 01:47:51 -04:00
Colin McDonald
2cc28e907d Add permission checks for adding/removing grants/punishments 2016-07-18 19:45:34 -04:00
Colin McDonald
bc92c39ce0 Fix User#getRanksScoped registered logic 2016-07-17 17:47:04 -04:00
Colin McDonald
57729c17e0 Add null check to cached type lookups 2016-07-17 17:06:53 -04:00
Colin McDonald
612fe880dc Create an ip ban for the user's last used ip address if their current ip address is not provided when banning. Closes #46 2016-07-17 16:56:51 -04:00
Colin McDonald
c30f11ead4 Make cached type lookups case insensitive. Closes #47 2016-07-17 16:51:18 -04:00
Colin McDonald
bc1cc8265f Automatically add "registered" rank to all registered users. Closes #48 2016-07-17 16:48:24 -04:00
Colin McDonald
81a7806629 Modify DELETE /users/:id/activePunishment to remove all active punishments (instead of just the first one found) - this removes any possible confusion due to having to unban someone multiple times (due to the data importer creating duplicate punishments) 2016-07-17 16:20:42 -04:00
Colin McDonald
f9a423b457 Make converter changes for push to production 2016-07-17 00:20:27 -04:00
Colin McDonald
eb03636a6b Rework MaxMind circuit breaker 2016-07-16 22:57:09 -04:00
Colin McDonald
5f322824ac Use Google's libphonenumber to perform more robust phone number validation and to convert all phone numbers to E164 before storing them. Closes #45 2016-07-16 17:23:31 -04:00
Colin McDonald
628c8d656b Properly wrap mongo call in IpIntel#findOrCreateById in vertx callback 2016-07-16 16:51:07 -04:00
Colin McDonald
fece3e0265 Add phoneNumber field to Zang result object 2016-07-16 16:50:19 -04:00
Colin McDonald
07b503504a Reset copiedRanks at the end of each iteration in User#getRanksScoped. This is a fix for an issue where the Iterator#remove call used here would fail if there was more than one other conflicting grants. We change this method to use a Set#remove to prevent the issues caused by trying to call Iterator#remove() multiple times and throwing an IllegalStateException. 2016-07-16 14:39:50 -04:00
Colin McDonald
cf045e2a49 Add gamePrefix field to Ranks 2016-07-16 01:01:20 -04:00
Colin McDonald
07e2906d0e Test IntelliJ reformatting 2016-07-14 21:54:55 -04:00
Colin McDonald
3ea54fdfcd Fix up server timeout code 2016-07-14 21:51:48 -04:00
Colin McDonald
fba48cf223 Add proper chat filter. Finishes #41 2016-07-14 20:40:48 -04:00
Colin McDonald
da992e864b Make POST /users/:id/login fully asynchronous 2016-07-14 20:16:05 -04:00
Colin McDonald
43e91b63be Add commented out website token code 2016-07-14 19:39:42 -04:00
Colin McDonald
f49135a781 Add missing break statement in server heartbeat's event type switch 2016-07-14 18:12:13 -04:00
Colin McDonald
c7a84e6e63 Move POST /users/:userId/leave to an event in the server heartbeat 2016-07-14 17:54:10 -04:00
Colin McDonald
91432b3d71 Set users as on their server immediately upon login 2016-07-14 17:15:54 -04:00
Colin McDonald
fbc9438e91 Fix ip address validation in POST /server 2016-07-13 23:56:17 -04:00
Colin McDonald
3a213de233 Fix permissions inheritance issue on newly created server groups 2016-07-13 23:14:42 -04:00
Colin McDonald
6c16fa7b18 Fix silly inversion mistake 2016-07-13 19:47:52 -04:00
Colin McDonald
3e78262cd5 Add disposable login tokens feature. Documentation is available at https://github.com/FrozenOrb/APIv3/wiki/Disposable-Login-Token-Routes 2016-07-13 19:38:55 -04:00
Colin McDonald
ea70e1b347 Remove ip null checks directly before a call to IpUtils#isValidIp, as IpUtils#isValidIp will perform a null check automatically 2016-07-13 19:37:51 -04:00
Colin McDonald
f04ee19b6c Remove note regarding audit log / punishment / grant / ip ban lookups 2016-07-13 19:36:40 -04:00
Colin McDonald
131e255116 Change public reason used on imported punishments 2016-07-13 19:36:01 -04:00
Colin McDonald
24a73f72cf Add the ability to rollback created punishments via the audit log 2016-07-13 19:35:35 -04:00
Colin McDonald
2502f4a1b2 Add user session integration. We still need to add routes that require auth in our session handler 2016-07-12 21:56:28 -04:00
Colin McDonald
f42f714863 Add logging with log4j. Completes #40 2016-07-11 23:54:21 -04:00
Colin McDonald
38dec65bf9 Add ip ban dumps. Adds #39 2016-07-11 23:05:00 -04:00
Colin McDonald
8e85914d64 Change default values in GETDumpsType.java to be immutable versions 2016-07-11 22:56:30 -04:00
Colin McDonald
e65686f339 Make queries made as part of punishment, ip ban, grant, and audit log lookups use UuidUtils.parseUuid to accept uuids without dashes 2016-07-11 22:54:28 -04:00
Colin McDonald
254d5336bf Don't require removedBy field when deleting grants, ip bans, and punishments 2016-07-11 22:53:31 -04:00
Colin McDonald
e48a0c1736 Add audit log todo 2016-07-11 21:50:37 -04:00
Colin McDonald
1f3d01b4e2 Remove debug from MaxMind util 2016-07-11 18:39:20 -04:00
Colin McDonald
d2dcd8c3e1 Add default permissions 2016-07-11 18:39:07 -04:00
Colin McDonald
b9c9a3f9bc Change default log level back to error 2016-07-11 18:38:48 -04:00
Colin McDonald
536de6d8b2 Make all save and delete methods on models use void callbacks (instead of exposing Mongo's internal result) 2016-07-10 16:15:29 -04:00
Colin McDonald
ecaf008f66 Properly register POST /users/:userId/confirmPhone 2016-07-10 15:49:29 -04:00
Colin McDonald
5e44d53216 Fix naming of some path parameters 2016-07-10 15:48:51 -04:00
Colin McDonald
45a706e0d7 Encode and then decode GET /metrics response to fix serialization issue with Vertx's JsonObject 2016-07-10 15:43:29 -04:00
Colin McDonald
529bf25daf Replace 3 line BlockingCallback pattern with 1 line SyncUtils#runBlocking lambda pattern 2016-07-10 15:42:42 -04:00
Colin McDonald
6319f944bb Optimize imports 2016-07-10 14:20:29 -04:00
Colin McDonald
07e1090445 Modify User#findByPhone to search for usages in both confirmed numbers and pending numbers 2016-07-10 14:20:16 -04:00
Colin McDonald
f84f8635a2 Finish Zang telephone linking (hopefully!). Completes #27 2016-07-10 14:17:18 -04:00
Colin McDonald
0071291236 Move body handler up in the route order to fix stack traces we were having 2016-07-10 13:12:31 -04:00
Colin McDonald
752c2cae96 Add debug to MaxMind circuit breaker 2016-07-10 13:12:01 -04:00
Colin McDonald
6e4169c6ad Add formatted timestamps to API logs 2016-07-10 13:11:45 -04:00
Colin McDonald
e4a574852a Add support for reading the http keystore path + keystore password from our config file 2016-07-10 12:50:04 -04:00
Colin McDonald
5aa0827d18 Change default log level to warn 2016-07-10 12:45:41 -04:00
Colin McDonald
b6f987e75a Readd metrics integration with Librato (and small redis metrics) 2016-07-10 12:45:13 -04:00
Colin McDonald
a61ad36151 Add commented line with code to return relative time in responses 2016-07-10 12:18:33 -04:00
Colin McDonald
53aa9ce368 Remove debug code from main class, use vertx's timeout handler instead of our debugging version 2016-07-10 12:18:07 -04:00
Colin McDonald
f0d8256f07 Add MaxMind circuit breaker. Finishes #38 2016-07-10 12:17:03 -04:00
Colin McDonald
53a56401e0 Change POST /grants|ipBans|punishments to use expiresIn (a relative field in seconds) instead of expiresAt (absolute time) 2016-07-10 11:48:53 -04:00
Colin McDonald
6fbc8925eb Optimize imports 2016-07-09 17:25:54 -04:00
Colin McDonald
f431cd40d6 Remove unused @Slf4j annotations 2016-07-09 17:25:18 -04:00
Colin McDonald
9043abfa72 Add short circuit to MaxMindUtils until we can fix (with timeout + circuit breaker) 2016-07-09 17:23:34 -04:00
Colin McDonald
a6e31129e9 Commit two forgotten files from taking out metrics 2016-07-09 17:23:02 -04:00
Colin McDonald
a30823099d Remove unneeded @Slf4j annotation in User and MojangUtils 2016-07-09 17:22:39 -04:00
Colin McDonald
d519527986 Commit ?active=true flag for GET /punishments 2016-07-09 17:21:43 -04:00
Colin McDonald
97b296a79d Add store order + item id for Ariel 2016-07-09 17:21:24 -04:00
Colin McDonald
f999319666 Remove metrics, change GET /ipLog/:id to accept both ips and user uuids 2016-07-09 17:20:57 -04:00
Colin McDonald
d55325d255 Add SyncUtils#vertxWrap. This is something we wrap all mongo callbacks with so all business logic is ran on vertx worker threads. This is important for 2 reasons:
1. Running all of our logic on the vertx threads makes sense, as we're a vertx application. (This also allows us to utilize vertx's thread pool logic + config, instead of relying on mongo's thread pool)
2. The more important one, it allows exceptions to be processed (instead of swallowed by mongo) with relevant context information.

There is an overhead to the thread switching we'll be doing because of this, but doing all of our work on a better thought out thread pool and (more importantly) having stack traces completely make this change worth the overhead.
2016-07-09 17:19:20 -04:00
Colin McDonald
5de25c498b Fix NPE when checking an access token's locked ips 2016-07-09 17:14:04 -04:00
Colin McDonald
a99d10c002 Add basic metrics + GET /metrics route 2016-07-03 19:59:42 -04:00
Colin McDonald
7bb1b17575 Small changes discovered while writing documentation 2016-07-03 19:41:01 -04:00
Colin McDonald
85b98b4a1d Add debug timeout handler, change default log level (for now) 2016-07-03 16:32:56 -04:00
Colin McDonald
fa5aee848a Commit two totp changes from before 2016-07-03 16:32:02 -04:00
Colin McDonald
d3bdeb6d50 Public/private reasons on punishments 2016-07-03 16:31:43 -04:00
Colin McDonald
252a18d326 Add translationId and translationParams to non-standard error types 2016-07-03 16:31:17 -04:00
Colin McDonald
035e9fbb81 Add UuidUtils#parseUuid, which is more liberal on what it accepts, and convert most everything to use it 2016-07-03 16:30:24 -04:00
Colin McDonald
527f465c12 Fail properly if MaxMind fails to respond / returns invalid data 2016-07-03 16:28:31 -04:00
Colin McDonald
77c3e49048 Fix logins not saving users, ip intel in heartbeats 2016-07-02 17:39:30 -04:00