aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/views/api (follow)
Commit message (Collapse)AuthorAgeLines
* Merge remote-tracking branch 'origin/master'Gravatar Gareth Coles2018-05-19-6/+166
|\
| * Snake cog (#71)Gravatar Leon Sandøy2018-05-19-6/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Tables that are initialized with JSON files in the table_init folder will now sync properly if the JSON file is changed after initialization. Any lines that are either added or removed will be updated whenever site is rebooted. * Initial API endpoint for snake_quiz * reverting database.py * I WILL KILL YOU * Added the snake_fact API endpoint * Moving snake tables to the new migrations system * Set up initial data for all new tables, added table objects, wrote endpoints, and wrote tests for the new endpoints. * Removing the snake_movies endpoint. That idea didn't pan out. * Added an endpoint for getting special snake cases * broken json * Fixing the initial data slightly, better picture of bob. * Changing JSON indentation to be 4 spaces consistently in all initial_data, to address Aperture's review. Also changing all the endpoints to have correct namespacing, addressing gdude's review. * Fixing tests to point to new API endpoints
* | GDPR compliance for jammer profilesGravatar Gareth Coles2018-05-19-0/+13
|/
* Add snowflake index on oauth_data and use it for deletionsGravatar Gareth Coles2018-05-15-2/+2
| | | | We were using id previously, but that was no longer the correct key
* [GDPR] Also remove OAuth dataGravatar Gareth Coles2018-05-15-1/+21
|
* [GDPR] Small fixesGravatar Gareth Coles2018-05-15-2/+2
|
* [GDPR] Users are now updated and removed correctlyGravatar Gareth Coles2018-05-15-1/+49
|
* Declaring the encoding to be utf-8 is not necessary in Python3 projects, as ↵Gravatar Leon Sandøy2018-04-27-8/+0
| | | | this is the default encoding. Encoding declarations are only useful in py3 if you want to declare it to be something _other_ than utf-8. This was, however, a very useful convention in py2. (#56)
* [#1eeu1] Hiphopify (#54)Gravatar Leon Sandøy2018-04-20-0/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Changed the dev-mode logic to be the same as prod for creating new tables if they don't exist. Also added a new feature where a table can be initialized with data if you create a JSON file in the pysite/database/table_init/ folder and fill it with a list of dicts where each dict represents a row in your table. Included a hiphoppers json so that I can actually test if it works in production. It will only init the table if the table is empty. * Not sure if this will solve it, but I think so. * Renamed the tables and primary keys, and alphabetized the dict. Now complies with the gdudes holy wishes. * Almost done with the initial build for this. Implemented GET and DELETE, in order to finish POST I need to expand the database.py interface class. * Alphabetized database convenience wrappers. * Fixed a few typehints and added the sample convenience wrapper to the database class. * Finishing up the POST method and adding a duration parser to the utils folder so we can handle strings like 2w3d and turn them into a timestamp. * Fixed API blueprint loading, which was broken by the setup method in the DBMixIn. I'd forgotten to remove the check for table_name attribute. Also adde some logging and got the DELETE route working. * Added timezone-sensitivity to the duration parser so it will work with rethink. renamed the json and fixed some bugs in the hiphopify API. * Added a utility to test if rdb timestamps are expired, and only returning data from the GET calls if it isn't expired. * changed some log wording * Setting up Lil Joseph as default image. Adding some rappers to the list. * Adding a bunch of logging * These tests no longer apply. New tests must be written in the long run, removing them for now. * Addressing review comments left by Volcyy * Fixed misleading comment.
* Initial data for tables and refactoring the dev-mode database handling to be ↵Gravatar Leon Sandøy2018-04-15-2/+0
| | | | | | | | | | similar to prod-mode. (#53) * Changed the dev-mode logic to be the same as prod for creating new tables if they don't exist. Also added a new feature where a table can be initialized with data if you create a JSON file in the pysite/database/table_init/ folder and fill it with a list of dicts where each dict represents a row in your table. Included a hiphoppers json so that I can actually test if it works in production. It will only init the table if the table is empty. * Not sure if this will solve it, but I think so. * Renamed the tables and primary keys, and alphabetized the dict. Now complies with the gdudes holy wishes.
* Snowflakes should be handled as stringsGravatar Gareth Coles2018-04-10-2/+2
|
* CSRF error route doesn't do shit, sadlyGravatar Gareth Coles2018-04-04-36/+0
|
* CSRF error route for APIGravatar Gareth Coles2018-04-04-0/+36
|
* Accept username/discriminator from the bot and remove it from oauthGravatar Gareth Coles2018-03-30-6/+3
|
* Flake8Gravatar Gareth Coles2018-03-30-1/+1
|
* Collect all roles from users instead of just a single oneGravatar Gareth Coles2018-03-30-3/+5
|
* Fix error routing and more work on static filesGravatar Gareth Coles2018-03-29-3/+1
|
* Fix error handler managementGravatar Gareth Coles2018-03-29-1/+4
|
* Fix up route namesGravatar Gareth Coles2018-03-29-5/+5
|
* Minor bugfix to allow tag.delete to return success as False if the tag ↵Gravatar Leon Sandøy2018-03-13-5/+8
| | | | doesn't exist
* API for tags (#34)Gravatar Leon Sandøy2018-03-06-57/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Help page and misc improvements Committing so I can go home >:| * [WIP] - API improvements for the tag features. Not completed. * renaming tag.py to tags.py and refactoring the nomenclature of docs to tags * fixed error message in tags, cleaning up app_test.py * tests for the tags feature * ignoring jsonify returns cause coverall can't handle them * Catch-all error view for the API blueprint * cleaning up APIErrorView a little * bringing coverage for tags.py to 100% * how did this get in here? * how did this get in here? ROUND 2 * Removing the 503 database error handling. It's not in use and we should probably rethink that whole custom error handling system anyway. * Converting the tags file to use the @api_params decorator instead of validating manually. Tested with bot staging.
* Add error messages (#30)Gravatar Joseph2018-02-28-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add error messages Signed-off-by: JoeBanks13 <[email protected]> * Remove un-used keyword arg from 404 * Assert for status code instead of full content * PEP8 * test lint * please coverage * oh * Exclude websockets.py from coverage * Move code output into terminal * Switch typewriter href protocol * Add tests for websockets.py * Abort previous commit, coveralls did not let coverage go down * Add more pauses and request => response * move css and js out, add typewriter JS to our own repo & add method for appending text in bulk. * Enable REPL on 4XX and change error descriptions * commas * /error path
* brings coverage to 90% (#24)Gravatar Christopher Baklid2018-02-26-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * brings coverage to 75% * satisfy flake8 * missing docstring added * one more test * artificially inflate coverage because python acts strange * testing decorators * fixed instantiation of test route * straggling newlines from debugging code * remove debug comments * restructure tests into logical class separations. more exlusions. more tests * testing websocket echo tests * added missing comment * convert single quotes to double quotes to satisfy docstrings
* Integrate websockets into the Flask webappGravatar Gareth Coles2018-02-17-5/+6
|
* Simplify user API route and return changesGravatar Gareth Coles2018-02-16-9/+5
|
* API schema validation decorator #yzuf (#15)Gravatar Gareth Coles2018-02-16-23/+21
| | | | | | | | | | * API schema validation decorator * Remove stray comma * Remove unnecessary conditional * Only cast to list when needed to
* API view for syncing users from the bot #yumr (#14)Gravatar Gareth Coles2018-02-15-0/+45
| | | | | | * API view for syncing users from the bot * Fix view class name
* Fix up API key validation and database api locationGravatar Gareth Coles2018-02-15-3/+3
|
* Move API validation decorator to its own file #yxdkGravatar Gareth Coles2018-02-15-27/+27
|
* Database API Improvements #1qcra (#13)Gravatar Gareth Coles2018-02-14-37/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * A large set of changes, including: * A mixin for views that need the DB * Many changes to the database class in order to make things more fluid * Provide the route manager in view setup() methods * Pushing up the progress so far * snekchek * Full (undocumented) database implementation * snekchek * Don't rely on exceptions for table deletion * Add RethinkDB data to gitignore * Documentation for DB class * Make Flake8 ignore P102 What even is that? What does "docstring does contain unindexed parameters" mean? * Document the base_routes module * Cleanup RE latest reviews * snekchek (bah)
* [API] You need to return the value of `self.error()`Gravatar Gareth Coles2018-02-14-3/+3
|
* RethinkDB API Views #yqhgGravatar lmn2018-02-13-2/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Refactoring the database implementation into a class of its own. * Refactoring the database implementation into a class of its own. * healthcheck should belong to the API. * dynamic subdomain loading, setting up basic handling for staff.pythondiscord.com, and started on a TagView for a bot tag feature. * Oops, forgot to fix some merges. * Some quality of life updates - default values for env variables that aren't secret, and starting to get through the tag view. * Refactoring the database implementation into a class of its own. * healthcheck should belong to the API. * dynamic subdomain loading, setting up basic handling for staff.pythondiscord.com, and started on a TagView for a bot tag feature. * Oops, forgot to fix some merges. * Some quality of life updates - default values for env variables that aren't secret, and starting to get through the tag view. * API validation added to the APIView class, TagView should be finished as well. * super important commit you guys * fixed a bug with the RethinkDB class where host and port attributes were accessed before being created * Fixed my editor now you guys * Fixing up some of the problems brought up in gdude's review * Handling GET requests with param indata and POST with JSON. Fixed error handling to use the constants and the baseclass self.error(). * Get API-key from headers, context manage the db assignment, and default env var values * Changed API-KEY header to X_API_Key. Added a default for secret key. it should no longer be necessary with environment variables to run this system locally. * Changing back the nav to have relative paths * Why am I like this
* Drop Asana integration, we moved to ClickUpGravatar Gareth Coles2018-02-12-216/+0
|
* [Asana] Disable all non-functional debugging code for nowGravatar Gareth Coles2018-02-11-78/+79
|
* [Asana] Asana wraps everything in a "data" key for some reasonGravatar Gareth Coles2018-02-11-1/+1
|
* [Asana] Asana wraps everything in a "data" key for some reasonGravatar Gareth Coles2018-02-11-3/+3
|
* F821: Undefined nameGravatar Gareth Coles2018-02-11-1/+0
|
* More error-hunting.Gravatar Gareth Coles2018-02-11-13/+26
| | | | Beats me why this documentation is so bad.
* [Asana] Smallish fixesGravatar Gareth Coles2018-02-11-7/+11
|
* [Asana] Raise for status properlyGravatar Gareth Coles2018-02-11-4/+6
|
* [Asana] Supply bearer token to API callsGravatar Gareth Coles2018-02-11-0/+4
|
* [Asana] Better errorsGravatar Gareth Coles2018-02-11-13/+34
|
* [Asana] Basic task handler; Asana does not make this easy thoughGravatar Gareth Coles2018-02-11-0/+34
|
* [Asana] Apparently not all stories have types?Gravatar Gareth Coles2018-02-11-2/+2
|
* [Asana] Apparently not all stories have types?Gravatar Gareth Coles2018-02-11-1/+2
|
* First attempt at story hookGravatar Gareth Coles2018-02-11-1/+41
|
* Perhaps adding the `s` to `sort_keys` would help as well.Gravatar Gareth Coles2018-02-11-2/+2
|
* You can't rename kwargs, stupid!Gravatar Gareth Coles2018-02-11-2/+2
|
* Remove key verification webhook messageGravatar Gareth Coles2018-02-11-6/+0
|
* Slightly more verbose loggingGravatar Gareth Coles2018-02-11-0/+7
|