Commit Graph

343 Commits (cf1dcbf4ae8af6efab352be78aa238d0d7fff653)

Author SHA1 Message Date
Matheus Lima e23d9ab840 Created endpoint to upload skills manifest 2019-03-27 11:23:59 -03:00
Matheus Lima 0deb202125 Added etag support to the device location endpoint 2019-03-27 11:21:26 -03:00
Matheus Lima f3e67f9677 Created endpoint to fetch a location associated with a device 2019-03-27 11:21:26 -03:00
Matheus Lima a55211f0b5 Fixing tests 2019-03-27 11:21:26 -03:00
Chris Veilleux 4b100a4176 change the logic around membership changes to fix some things and adapt to a change in how the UI is sending the data. 2019-03-26 18:57:18 -05:00
Chris Veilleux 28977e6355 ensure the geographical location is associated with an account before the device is added 2019-03-25 19:02:48 -05:00
Chris Veilleux a684242648 to improve security, UI will pass authentication tokens to this endpoint instead of email addresses. endpoint will use tokens to obtain email address from provider. 2019-03-25 18:40:01 -05:00
Chris Veilleux 549fdfb8af add a todo to revisit the post logic when I have a better understanding of Angular forms 2019-03-25 16:21:17 -05:00
Chris Veilleux 818f2dc863 ensure the geographical location is associated with an account before the device is added 2019-03-23 18:43:09 -05:00
Chris Veilleux cbb476ea4a fixed incorrect query parameters 2019-03-22 12:36:47 -05:00
Chris Veilleux 037892b4e5 fixed a bug where the API was passing an object instead of a string 2019-03-22 12:18:35 -05:00
Chris Veilleux e61a3ab461 removed link from skill to skill display 2019-03-22 12:05:01 -05:00
Chris Veilleux bbc893766f fixed a cut and paste issue 2019-03-22 00:21:50 -05:00
Chris Veilleux 2b46cac1b5
added stripe package 2019-03-21 13:33:36 -05:00
Chris Veilleux f94b1bbe6b applied code review changes 2019-03-21 12:24:46 -05:00
Chris Veilleux 425be9a0a8 merge dev into add-device 2019-03-21 12:08:38 -05:00
Chris Veilleux af49cdb63a return no content (204) when logout is successful 2019-03-20 22:25:17 -05:00
Chris Veilleux 3bd458476a implemented a post request to add a device and did some refactoring 2019-03-20 17:17:40 -05:00
Chris Veilleux 8f4e10aa4d implemented add device tests 2019-03-20 17:16:46 -05:00
Chris Veilleux 330390fd81 commented these out for now since they depend on an endpoint that was moved. 2019-03-20 17:16:18 -05:00
Chris Veilleux 4042775422 apply schema changes 2019-03-20 17:15:56 -05:00
Chris Veilleux db230cc208 removed add device endpoint as it now exists in the account API 2019-03-20 17:12:32 -05:00
Chris Veilleux 3b0a8cfa9e added payment id to subscription arguments to fix a bug 2019-03-20 17:10:48 -05:00
Chris Veilleux 7d7f0bbd01 new endpoint for account defaults 2019-03-20 13:42:17 -05:00
Chris Veilleux 1f757a4ee9 new post method for account preferences 2019-03-19 17:59:36 -05:00
Matheus Lima c0ee6224d9 Created functions to epire etags from the device entity and the device's settings entity, at device and account level. Fixed the query used to fetch the devices from a user 2019-03-19 12:42:16 -03:00
Matheus Lima b422de76c2 Implemented etag support on the endpoint `GET /device/{uuid}/setting` 2019-03-18 20:21:46 -03:00
Chris Veilleux c851624256 Merge remote-tracking branch 'remotes/origin/dev' into add-device
# Conflicts:
#	api/account/account_api/api.py
#	api/account/tests/features/steps/update_membership.py
#	shared/selene/api/endpoints/account.py
#	shared/selene/data/account/repository/sql/get_active_membership_by_account_id.sql
2019-03-18 17:05:08 -05:00
Matheus Lima df14af5322 Implemented etag support on the endpoint `GET /device/{uuid}` 2019-03-18 16:34:34 -03:00
Matheus Lima 134bd9cc03 Fixing broken test after adding the payment_id column to the account_membership table 2019-03-18 11:19:32 -03:00
Matheus Lima ff16ce4477 Adding payment_id column into the account_membership table, and removing the previous subscription from stripe when a user changes his membership 2019-03-15 11:58:00 -03:00
Matheus Lima d88d58525c Fixing conflicts with dev branch 2019-03-15 11:31:47 -03:00
Matheus Lima 0b22767e7f Applying camel case and fixing query used to get the active membership 2019-03-15 11:18:11 -03:00
Matheus Lima b5a53d4c91 Fixed an created test for the membership updating 2019-03-15 11:14:21 -03:00
Matheus Lima 37058475b2 Created PATCH request to update membership 2019-03-15 11:14:21 -03:00
Chris Veilleux aafcd5d3b6 added endpoint to get membership types and the supporting repository logic 2019-03-15 11:11:16 -03:00
Matheus Lima f547a452a3 Created PATCH request to update membership 2019-03-15 11:07:12 -03:00
Matheus Lima 497d7b2740 Implemented stripe integration 2019-03-15 11:07:12 -03:00
Chris Veilleux 2cb58c50e8 added endpoint to get membership types and the supporting repository logic 2019-03-15 11:07:12 -03:00
Chris Veilleux 0d667e4d84 moved shared package out of dev 2019-03-15 11:07:12 -03:00
Matheus Lima d29a3ee857 Starting to implement the stripe integration 2019-03-15 11:07:12 -03:00
Chris Veilleux 159ce1c06b api endpoints for geographical locations and the repository code to support it 2019-03-15 01:05:19 -05:00
Chris Veilleux ef921c308b allow for a user with no preferences setup 2019-03-14 23:50:34 -05:00
Chris Veilleux 133bf2a8a5 applied schema changes 2019-03-14 23:49:38 -05:00
Matheus Lima 9f75bf93c4 Applying camel case and fixing query used to get the active membership 2019-03-14 20:26:16 -03:00
Matheus Lima a367c1d07c Created more tests 2019-03-14 17:00:38 -03:00
Matheus Lima 7d87531e26 Fixed an created test for the membership updating 2019-03-14 14:31:55 -03:00
Matheus Lima bdcdeffe18 Created PATCH request to update membership 2019-03-13 21:21:52 -03:00
Matheus Lima 9ba79f4a2d Implemented stripe integration 2019-03-13 21:21:52 -03:00
Chris Veilleux daad2ea4b2 added endpoint to get membership types and the supporting repository logic 2019-03-13 21:21:52 -03:00
Chris Veilleux b37a566b51 moved shared package out of dev 2019-03-13 21:21:52 -03:00
Matheus Lima 0508824702 Starting to implement the stripe integration 2019-03-13 21:21:52 -03:00
Matheus Lima 7fc2a54ab0 Created PATCH request to update membership 2019-03-13 18:19:13 -03:00
Matheus Lima f02d1f151e Implemented stripe integration 2019-03-09 00:32:09 -03:00
Chris Veilleux 10b7ea675a added endpoint to get membership types and the supporting repository logic 2019-03-08 17:27:45 -06:00
Chris Veilleux ee879ff6b5 moved shared package out of dev 2019-03-08 16:56:53 -06:00
Matheus Lima 5ebad16060 Starting to implement the stripe integration 2019-03-08 19:37:45 -03:00
Matheus Lima 4f401285bd minor fix to make the core more readable 2019-03-08 17:48:29 -03:00
Matheus Lima 8484d8289b - Changing the validation in the endpoints used to update the device fields and to activate the device and to upload the skill settings
- Checking the authentication token in the before_request function. This is a tricky to make the api compatible with the mycroft core is expecting today. Today tartarus returns 401 when it calls and endpoint with a non existent path (like /device/{uuid} without pass the uuid). That is the value core expect to check if it needs to perform a device pairing. We should change that in future versions
- Changed device endpoint to send the user uuid together with the device
2019-03-08 17:09:53 -03:00
Chris Veilleux 38494522de
Merge pull request #72 from MycroftAI/put-v1-public-api
Adding the /v1 prefix to the endpoints
2019-03-07 20:14:35 -06:00
Matheus Lima 164d2280f9 Adding the /v1 prefix to the endpoints 2019-03-07 23:08:19 -03:00
Chris Veilleux 3053c5f15a added uwsgi to project requirements 2019-03-07 18:13:57 -06:00
Chris Veilleux 789a07b020 added uwsgi.ini file 2019-03-07 17:16:26 -06:00
Matheus Lima e4bd9930d7 Created endpoint to patch device fields 2019-03-06 22:39:34 -03:00
Matheus Lima 4dc2b47c63 Applying the new authentication logic in the endpoints of the public API 2019-03-06 22:10:59 -03:00
Matheus Lima e8fc54d657 Moved logic related to create a device login session to a python function, allowing it being used by the creating and refreshing token endpoint and by the behavioral tests 2019-03-06 21:31:49 -03:00
Matheus Lima c44284fbef Implemented authentication mechanism for the public API 2019-03-06 18:15:45 -03:00
Matheus Lima a4ecbae369 Moving the cache instance to the PublicEndpoint class 2019-03-06 17:11:16 -03:00
Matheus Lima fe8466a309 Created test to validate that when we update the skills settings, the device API is able to fetch the skill settings with the new values 2019-03-06 16:42:57 -03:00
Matheus Lima c1f0e70980 Created test to validate that when we update the skills settings, the device API is able to fetch the skill settings with the new values 2019-03-06 15:35:35 -03:00
Matheus Lima b85809f316 Implemented skill uploading 2019-03-06 15:35:35 -03:00
Matheus Lima fabcba8c54 Created endpoint to communicate with the wolfram alpha spoken api 2019-03-06 15:33:39 -03:00
Matheus Lima e8e30f9d6e Created endpoint to refresh device oauth token 2019-03-06 15:22:45 -03:00
Chris Veilleux b7cbc5a733 fixed a bug where the request data was not un-serialized before processing 2019-03-05 22:39:06 -06:00
Chris Veilleux c806bcc689 added configs to uwsgi.ini files 2019-03-05 21:34:25 -06:00
Chris Veilleux 84965186dc added geography endpoint and the repository code to support it 2019-03-05 16:04:38 -06:00
Chris Veilleux 1bfa7800c5 added voice endpoint and the repository code to support it 2019-03-05 15:43:32 -06:00
Chris Veilleux a039bcfb0e new endpoint to manage wake words and the repository changes to support it 2019-03-05 15:23:24 -06:00
Chris Veilleux a16bdae969 new account api endpoint to retreive account preferences, along with the necessary repository changes 2019-03-05 15:22:09 -06:00
Chris Veilleux ac7f1cb593 added device endpoint to account api and altered repository to serve it data 2019-03-05 15:20:31 -06:00
Chris Veilleux 59872f4d24 socket change 2019-03-04 00:43:56 -06:00
Chris Veilleux f1bd6ce1e2 added a uwsgi.ini file for the account api 2019-03-03 22:20:14 -06:00
Matheus Lima a5dcdf0c94 Applying model changes 2019-03-03 22:46:00 -03:00
Matheus Lima a90833f178 Fixing tests after rebase 2019-03-03 22:46:00 -03:00
Matheus Lima 737167b854 Fixed skill endpoints applying the changes related to the skill settings model. 2019-03-03 22:46:00 -03:00
Chris Veilleux c422ed26f5 changed environment setup to deal with new naming 2019-03-03 19:11:27 -06:00
Chris Veilleux 9595eef5c2 changed behavior tests to deal with naming changes 2019-03-03 19:09:16 -06:00
Chris Veilleux 2f4206a2ab removed hash column again because it was determined to be used in a device ownership feature that will be deprecated. 2019-03-03 18:20:47 -06:00
Chris Veilleux 581bf1812d renamed a few items in the database schema 2019-03-01 20:33:35 -06:00
Chris Veilleux 0d6cb7d3f1 resolve merge conflicts 2019-02-28 22:01:21 -06:00
Chris Veilleux 7cd7967091 added skill setting update logic. also added logic to return a number of devices per account 2019-02-28 21:48:35 -06:00
Chris Veilleux c3608a10bf
Merge pull request #56 from MycroftAI/populate-profile-page
Populate profile page
2019-02-28 20:44:22 -06:00
Chris Veilleux 61e884b0f6 implemented a sql trick to group by json that made the code a lot simpler 2019-02-26 14:09:31 -06:00
Chris Veilleux 638b74206d added some logic on how to determine the skill name displayed in the ui 2019-02-26 09:37:56 -06:00
Chris Veilleux d19a1fcdf6 new endpoint for account skills 2019-02-25 23:27:54 -06:00
Matheus Lima eccb83ed44 - Refactoring to use a AccountRepository to get an account using the device id
- Created tests for the metrics service
2019-02-25 19:03:08 -03:00
Matheus Lima a6533fbe32 Removed blocking operation from the db transaction 2019-02-25 16:42:11 -03:00
Matheus Lima edc43ed39a Created endpoint to communicate with metrics service 2019-02-25 16:42:11 -03:00
Matheus Lima e722e519bf Fixed the endpoint used to get the subscription type of a device and created tests for this endpoint 2019-02-25 16:28:14 -03:00
Matheus Lima 88aaccd073 Adding test for the device setting endpoint 2019-02-25 16:28:14 -03:00
Matheus Lima 588525ea47 Created test to the endpoint used to fetch a device 2019-02-25 16:28:14 -03:00
Matheus Lima ae5c148b92 Removing unused import 2019-02-22 14:23:43 -03:00
Matheus Lima b68dabe0b9 Clean up and adding tests for the device email endpoint 2019-02-22 14:23:43 -03:00
Matheus Lima 577c470d90 - Using schematics to validate POST data
- Fixed test
- Fixed error handler to present a better error message
2019-02-22 14:23:43 -03:00
Matheus Lima af45f633d1 Created endpoint to send email to the account associated to a device 2019-02-22 14:23:43 -03:00
Chris Veilleux 57d46dcd09 Merge remote-tracking branch 'remotes/origin/tartarus-overhaul' into account-api 2019-02-20 17:32:52 -06:00
Chris Veilleux a2a4b4e834 added checks to auth token refresh test to address bug. 2019-02-20 17:31:49 -06:00
Matheus Lima 1ad957142a Applying requested changes 2019-02-20 20:25:21 -03:00
Matheus Lima af83a190db Applying requested changes 2019-02-20 20:25:21 -03:00
Matheus Lima 23e056ca96 Created test to validate device pairing workflow 2019-02-20 20:25:21 -03:00
Matheus Lima 640f08ffbe Refactoring 2019-02-20 20:25:21 -03:00
Matheus Lima 750921fb7d Created endpoint to activate a device that is in a pairing process 2019-02-20 20:25:21 -03:00
Matheus Lima 5b6776c92e - Created endpoint to add a device to an account using a pairing code
- Renamed selene_cache module to cache
2019-02-20 20:25:21 -03:00
Matheus Lima 64e513a7df Created endpoint to get the device pairing code 2019-02-20 20:25:21 -03:00
Chris Veilleux 24faf0fbbd fixed a bug with new account logic when a user opts out of membership 2019-02-20 14:45:06 -06:00
Chris Veilleux afcbbc05a5 changed display name to username 2019-02-19 17:16:19 -06:00
Chris Veilleux 772a908237 removed flask-restful 2019-02-19 14:44:29 -06:00
Chris Veilleux 2b996a99ad convert from flask-restful to flask 2019-02-19 14:41:36 -06:00
Chris Veilleux c4919b155b Merge remote-tracking branch 'remotes/origin/tartarus-overhaul' into account-api 2019-02-19 14:01:34 -06:00
Chris Veilleux 0b555261b5 new tests for authentication token behaviors 2019-02-19 13:35:03 -06:00
Chris Veilleux 406f2a43a7 new file with common step code 2019-02-19 13:34:36 -06:00
Chris Veilleux b98f667f30 refactored to build access and refresh tokens independently for re-usability in other tests. 2019-02-19 13:31:58 -06:00
Chris Veilleux 97cefc9ce1 minor refactor 2019-02-19 13:30:50 -06:00
Chris Veilleux 20e9f760b9 changed test to expect new value from UI 2019-02-19 10:58:01 -06:00
Matheus Lima dea0e6737f Changing code to use relative imports 2019-02-19 10:06:30 -03:00
Matheus Lima c02f308392 Created behave test for the google stt endpoint 2019-02-19 10:06:30 -03:00
Matheus Lima d6bab8fb8f Removed unused import 2019-02-19 10:06:30 -03:00
Matheus Lima 6c25c2f85d Migrating the project from flask-restful to flask 2019-02-19 10:06:30 -03:00
Matheus Lima ed2e7eada6 Refactoring 2019-02-19 10:06:30 -03:00
Matheus Lima 73ad03c7b6 Created endpoint to communicate with the Google STT API 2019-02-19 10:06:30 -03:00
Chris Veilleux 3c624ea1e0 new version of shared package 2019-02-18 14:53:53 -06:00
Chris Veilleux 4f5512ab63 changed to use new class signature 2019-02-18 14:53:34 -06:00
Chris Veilleux ee5731d86e applied code review corrections 2019-02-18 11:12:06 -06:00
Chris Veilleux b45908da72 removed flask-restful 2019-02-15 21:47:10 -06:00
Chris Veilleux fda4f7a788 added test for a missing attribute in the new account request 2019-02-15 21:45:08 -06:00
Chris Veilleux 16b2cffc21 converted from flask-restful to flask 2019-02-15 21:44:19 -06:00
Chris Veilleux b762dc7f79 added schematics library 2019-02-15 01:02:03 -06:00
Chris Veilleux 3b083bed72 removed unused import 2019-02-15 01:01:30 -06:00
Chris Veilleux eeb8213a46 behave tests for add account feature 2019-02-15 01:00:56 -06:00
Chris Veilleux d8a6987888 change to reflect new data structure 2019-02-15 01:00:31 -06:00
Chris Veilleux ec943dad50 changed to use IDs in repository objects 2019-02-15 00:12:31 -06:00
Chris Veilleux 4abb12b60c applied agreement repository to testing setup 2019-02-12 11:19:10 -06:00
Chris Veilleux 58202b001f added tests for agreement endpoint 2019-02-12 10:44:43 -06:00
Chris Veilleux 584e91c547 added agreement endpoint and logging config 2019-02-12 10:43:20 -06:00
Chris Veilleux 0d54672b10
Merge pull request #43 from MycroftAI/account-api
added account profile endpoint to account API
2019-02-08 16:28:53 -06:00
Matheus Lima 6f6cd0aac6 Using relative imports 2019-02-08 16:13:32 -03:00
Matheus Lima 7a41eaabe7 Created endpoint to communicate with the Open Weather Map API 2019-02-08 13:10:07 -03:00
Chris Veilleux 44cf4e9e6f added tests of the account endpoint returning subscription and agreement data 2019-02-07 22:41:12 -06:00
Chris Veilleux a80d71df02 account api initial commit with an account endpoint 2019-02-07 20:04:08 -06:00
Chris Veilleux 02a3db7c0f moved token generation test code to api library for re-use 2019-02-07 20:02:43 -06:00
Chris Veilleux bfed3ab8f3
new location for response formatter 2019-02-07 19:55:20 -06:00
Matheus Lima 793caa4142 Created endpoint to communicate with the Wolfram Alpha API 2019-02-07 22:00:14 -03:00
Matheus Lima 492d298a1e Using relative imports to define package level APIs 2019-02-07 17:48:39 -03:00
Matheus Lima edaba3c812 Fixes related to previous refactoring 2019-02-07 17:34:47 -03:00
Matheus Lima e38274e92a Fixes related to previous refactoring 2019-02-07 17:12:21 -03:00
Chris Veilleux 0b28b18b39 moved all data access layer code into a new selene.data package 2019-02-07 13:14:40 -06:00
Chris Veilleux ae9d0dc3a7 fixed merge conflicts 2019-02-07 12:49:20 -06:00
Chris Veilleux 5fa2d6f707 removed commented-out code 2019-02-07 12:15:24 -06:00
Chris Veilleux 3ef7059e31 added docstrings 2019-02-07 12:14:54 -06:00
Chris Veilleux c487bcc7f9 removed a config that was used for tartarus 2019-02-07 12:14:33 -06:00
Matheus Lima 022e2780f9 - Adding comments to the code
- Fixing small issue with the get_setting_by_device_id query
2019-02-07 15:13:56 -03:00
Chris Veilleux 8dccd5e360 removed some unused packages 2019-02-07 11:54:51 -06:00
Matheus Lima 676eb3f158 - Created endpoint to fetch the subscription type using the device id 2019-02-07 12:35:46 -03:00
Chris Veilleux fb359343e3 moved some of the feature setup/teardown to scenario level 2019-02-06 22:46:36 -06:00
Matheus Lima 768a692fb8 - Refactored endpoint `device/{uuid}/skill` to fetch all skills using a single query
- Created endpoint to fetch a skill using device id and version_hash
- Removing useless sql files
2019-02-06 21:51:00 -03:00
Chris Veilleux fa5da2a914 added test for logout function 2019-02-06 13:37:39 -06:00
Chris Veilleux 8c38d69321 changed to add a dummy user at before feature and remove said user after feature 2019-02-05 17:41:13 -06:00
Chris Veilleux 1eb1d6152a passlib added 2019-02-05 17:37:26 -06:00
Chris Veilleux 745f7fd7e3 added ability to expire a token cookie 2019-02-05 13:25:22 -06:00
Chris Veilleux dc5a330a59 removed unused import 2019-02-05 13:00:36 -06:00
Chris Veilleux 6b6a687a00 updated tests to include the validate_federated endpoint 2019-02-05 12:59:23 -06:00
Chris Veilleux e6b8748296 replaced previous social login logic with new client-side implementation 2019-02-05 11:33:19 -06:00
Chris Veilleux aea9851116 moved the hook to add the cookies to the response into the base class to avoid re-coding it in every place it is needed. 2019-02-04 15:04:22 -06:00
Matheus Lima ade99800ef - Fixing setup.py to properly include the data files described by MANIFEST.in
- Initializing the API config
- Fixing the endpoints to use the config variable to access the connection pool
2019-02-02 22:39:00 -03:00
Chris Veilleux c5c287047f added the behave and hamcrest packages for testing 2019-02-02 18:53:18 -06:00
Chris Veilleux 59c1075b7e added tests for internal login endpoint and fixed bugs the test uncovered 2019-02-02 18:52:43 -06:00
Chris Veilleux 7fd66423df changed url of internal login endpoint and removed database close logic as it was being called at the wrong time 2019-02-02 18:51:19 -06:00
Matheus Lima 9f29aa5a86 Moving custom encoder logic to the util package in the shared project 2019-02-02 20:36:53 -03:00
Chris Veilleux ad0d4820f0 added logic to add a refresh token on sign in; moved refresh token functions in the account repository to their own repository; moved authentication repo into account repo 2019-02-01 22:08:59 -06:00
Matheus Lima b6440abd38 Moving setting folder content into device folder in the shared project 2019-02-01 20:34:59 -03:00
Matheus Lima f5bbaa0892 Creating endpoints to fetch device, device's setting and device's skills 2019-02-01 20:34:59 -03:00
Chris Veilleux eb4a7e5343 performed some cleanup that was causing virtualenv issues 2019-02-01 15:26:47 -06:00
Chris Veilleux ff875fc79f added refresh token logic 2019-02-01 00:31:50 -06:00
Chris Veilleux 2a3c89961e added logger and fixed a couple of minor bugs 2019-02-01 00:30:22 -06:00
Chris Veilleux a69a262e87 added some docstrings 2019-01-30 23:20:40 -06:00
Chris Veilleux db1c1ffee8 removed app-specific config file because all configs are in the global file 2019-01-30 23:18:28 -06:00
Chris Veilleux 1b4574a367 changed to use new library config code and changed internal endpoint naming 2019-01-30 23:17:59 -06:00
Chris Veilleux 5b2d65d546 renamed from "antisocial" to "internal" and changed logic to use new architecture 2019-01-30 23:16:59 -06:00
Chris Veilleux 4cf170592d moved common API logic from selene.util to new selene.api package. the util package is for non-business logic and the common api bits contain business logic 2019-01-30 19:16:46 -06:00
Chris Veilleux f1da779571 updated pipfile.lock 2019-01-30 14:53:37 -06:00
Chris Veilleux 74285d017c made the new selene package a dev requirement for pipenv 2019-01-30 14:53:08 -06:00
Chris Veilleux 3377670bf8 changed imports to use new directory structure for shared code 2019-01-30 14:52:23 -06:00
Chris Veilleux f199e0969b moved the contents of the "backend" directory up one level since this repo is now just for backend code 2019-01-30 14:47:18 -06:00