125 Commits

Author SHA1 Message Date
Rahul Rudragoudar
5c3bdfeb83
GC, Seed and User management (#52)
* Update sql to map uuid to token

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Fix millis to secs conversion

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Add synchronisation to media enpoint DB access

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Change error code for rate limiter

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* move prepared statements to Thread Local Storage

* Change test end points

* init GC

* Add GC

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Change status return

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Auto generate token in db

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Remove user management and rate limiting

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Add seed for random number generator

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Store random instance as class member

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Update locustfile

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Add API documentation

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Move updateTimeStamp to getChallenge methdod
Remove user tables for the DB

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Update Timestamp when creating mapId entry

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Add request method type

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Minor fixes

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2020-09-23 22:58:42 +05:30
hrj
9af66adf9f refactor: don't inherit classes from DBConn 2020-07-16 17:53:26 +05:30
hrj
7bfde4eddb simplified check for user access
1. Make fields private as much as possible
2. single public function to check if user is valid and is within limit.
   Advantage is that only a single call to synchronisation() is required.
3. Bumped up the rate limit
2020-07-16 17:36:19 +05:30
hrj
f08f6041ec renaming and removal of unused code 2020-07-16 17:23:48 +05:30
Rahul Rudragoudar
1d7ef512bd
DB synchronisation on media endpoint (#47)
* Update sql to map uuid to token

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Fix millis to secs conversion

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Add synchronisation to media enpoint DB access

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>

* Change error code for rate limiter

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2020-07-08 21:28:11 +05:30
hrj
62b3a098bd synchronise access to database statements 2020-07-05 00:50:05 +05:30
hrj
ab6abaf5c0 minor, formatting 2020-07-04 01:23:05 +05:30
hrj
245521017a labelcaptcha: store filenames in the token
This is a hack, for the purposes of the POC.
2020-07-04 01:22:26 +05:30
hrj
b300fa2178 minor: privatised some vars 2020-07-04 01:21:02 +05:30
hrj
3d147950a4 prevent resource leak by using try-with-resource syntax 2020-07-03 22:20:30 +05:30
hrj
300ff3162d minor: rate limit increase 2020-07-03 22:17:40 +05:30
hrj
1515af5f72 minor debug 2020-07-03 22:17:29 +05:30
hrj
239bf2cefc gracefully handle wrong input from API 2020-07-03 22:16:23 +05:30
hrj
644a106a31 return error as json when rate limit reached or user not found 2020-07-03 22:15:27 +05:30
hrj
80ff9bfe6d select a random captcha 2020-07-03 22:14:33 +05:30
hrj
fd5dcff335 map token correctly to secret and provider 2020-07-03 22:13:51 +05:30
hrj
03548d17ae refactor, separate code into files 2020-07-03 20:21:35 +05:30
hrj
e45302df8c updated dependecies to latest version 2020-06-30 09:15:23 +05:30
hrj
21dfbe310f made db statements lazy 2020-06-30 00:20:07 +05:30
Rahul Rudragoudar
d65d050038
Minor fixes
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2019-06-20 11:45:29 +05:30
Rahul Rudragoudar
a63cf3976d
Add rate limiter
Add user validation for every request

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2019-06-17 00:20:18 +05:30
Rahul Rudragoudar
1a57942a0b
User validation for every request
Implemented a separate class for db connection, for the ease of accessing queries

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2019-06-13 00:48:29 +05:30
Rahul Rudragoudar
886055c642
Update query to cross refernce uuid to token
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2019-06-09 14:12:21 +05:30
Rahul Rudragoudar
7c7285b9f7
Conflict resolution
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2019-06-09 14:04:25 +05:30
hrj
8ff9ebaf3f correct content type for raindrops catpcha 2019-06-08 11:43:47 +05:30
hrj
6b35e53fe3 register raindrops captcha 2019-06-08 11:43:27 +05:30
hrj
b08f381f72 add an app to generate samples 2019-06-08 11:43:17 +05:30
hrj
715b9e4206 set anti-aliasing 2019-06-08 11:21:13 +05:30
hrj
c047691424 rename filters to providers 2019-06-08 11:07:36 +05:30
hrj
cf71757b5f return correct content type 2019-06-08 11:07:06 +05:30
hrj
9c7efb5e4a toString method for Challenge 2019-06-08 11:06:53 +05:30
Rahul Rudragoudar
535c59a218 Merge branch 'mapId' 2019-04-07 22:36:23 +05:30
Rahul Rudragoudar
f3f8900fd4
Minor fixes
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2019-04-07 20:50:56 +05:30
Rahul Rudragoudar
ed05489cd0
Add UUID support
mapId table in implemented for mapping of public to private ID
Challenge returns a random UUID instead of captcha token

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2019-04-07 13:11:14 +05:30
Rahul Rudragoudar
fe9138dbaf
Add method to check for unsolved captchas
The framework checks for existing unsolved captchas before generating new captcha
The captcha is set to solved after the media is requested

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2019-04-07 10:49:34 +05:30
Rahul Rudragoudar
89a1039c87
Minor fixes
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2019-04-06 23:26:51 +05:30
Rahul Rudragoudar
184d167085
Add buffer to inital throttle
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2019-04-06 11:42:11 +05:30
Rahul Rudragoudar
97d703a217 Merge remote-tracking branch 'upstream/master' 2019-04-06 11:31:22 +05:30
Rahul Rudragoudar
37bf3b1d7f
Add Captcha thread throttle
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2019-04-06 11:30:06 +05:30
hrj
1d3573c59f rain drops captcha tweaks 2019-04-01 18:32:56 +05:30
hrj
a207b9dee6 refining the Rain drop captcha 2019-04-01 00:30:45 +05:30
hrj
beb184d7a9 rain drop animation 2019-03-31 22:58:58 +05:30
hrj
80cf6b66fd add attribution to gif sequence writer class 2019-03-31 19:03:22 +05:30
hrj
9d9657d373 rain drop single frame 2019-03-31 18:53:16 +05:30
Rahul Rudragoudar
4c0d832803 Minor fixes
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2019-03-27 08:20:28 +05:30
Rahul Rudragoudar
aa9d602950 Merge branch 'master' of https://github.com/rr83019/lc-core 2019-03-26 23:19:48 +05:30
Rahul Rudragoudar
e18354c259 Add LabelCaptcha plugin
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2019-03-26 23:19:01 +05:30
hrj
ece47037d4
Merge branch 'master' into master 2019-03-26 18:57:21 +05:30
Rahul Rudragoudar
8e99f2713d Add method to choose random captcha 2019-03-26 18:44:31 +05:30
Prajwal Goudar
f2c588ef23 support for loading fonts dynamically with an option to choose level (#26)
* support for loading fonts dynamically with an option to choose level("easy","medium","hard")

* removed unwanted method

* changes made as required
2019-03-25 19:44:38 +05:30