Given the scope of its usage at this point, this becomes a problem when you'd have a field named y,n, true, false and order_by that field, or have the same values for a document name that parent parameter would accept out of all those that Frappe REST allows.
`GET /api/resource/ToDo?limit=10&debug=False&as_dict=0` would be received by the resource handler as debug="False" and as_dict="0" which are both truthy values.
So, even though you requested for a list of lists response without debugging on, you'd get the exact opposite; debug on and a list of dicts.
- Evaluate boolean values for `GET /api/resource/<doctype>`
- Added `limit` parameter as an alias for `limit_page_length`
- Added `frappe.utils.data.sbool` that converts strings to bool values if applicable.
- Added some seemingly stupid comments for the sake of consistency.
* do not overwrite user if it's already set
* Update frappe/api.py
* chore: fix syntax error and translation syntax
Co-authored-by: Chinmay Pai <chinmaydpai@gmail.com>
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
* fix: REST API utf-8 decoding on creates/updates
Creating or updating a document via the REST API would generate an error of:
`TypeError: the JSON object must be str, not 'bytes'`
Because get_data() returns bytes which must be explicitly converted to a string before parsing as JSON.
Defect introduced by efe94886a and a71a92341e
* fix: switch to safe_decode
* token based authentication
* authentication
Basic base64encode(api_key:api_secret)
token api_key:api_secret
* test added
Validation: only user with system manager can generate the keys
* codacy issues fixed
* token based authentication
* authentication
Basic base64encode(api_key:api_secret)
token api_key:api_secret
* test added
Validation: only user with system manager can generate the keys
* codacy issues fixed
* use frappe.safe_encode
* base64 encode use frappe.safe_encode
* set frappe.local.form_dict after setting user
* removed test
* removed unused imports
* test for python 3
* Update user.js
* [user.py] throw correct error
* Update user.py
* [fix] remove razorpay from integration service
* [fix] clean-up js side integration service dependancies
* [fix] remove integration service, .py cleanup, move integration request to integration
* [fix] move oauth to integrations and deprecate integration broker
* [fix] mark services enabled and update integrations listing
* [fix] V7.1 and V7.2 integration service related pathch fixes and move payment gateway dotype to core module
* [fix] create payment gateway records if not exists
* [fix] module page for integrations
* [minor][fix] minor checks
* [fix] remove integration broker module only if not allocated to any doctype
* OAuth 2.0 Classes Added
Added oauthlib in requirement.txt
Added class WebApplicationServer for Authorization code grant and Bearer tokens.
Added class OAuthWebRequestValidator for Validating Oauth Request for Web Application
* copied code from mnt_oauth needs review
* [New] OAuth2 Doctypes and endpoints added
Integrations > OAuth Provider Settings
Integration Broker > OAuth Bearer Token
Integration Broker > OAuth Authorization Code
Integration Broker > OAuth Client
endpoints for authorize, approve, get_token, revoke_token and test_resource
* oauth2.py: renamed skipauth to skip_auth
* [Fix] Parse URL instead of storing it in settings
* [Fix] get skip_auth from OAuth Provider Settings
* Success URL format. Failure URL added. Confirmation dialog layout changed.
* Validate access token if passed during use of REST API
* OAuth Confirmation colours fixed
* Multiple Changes
Added links for OAuth under Integrations in Module list.
Updated permissions on OAuth doctypes.
Updated layout of OAuth Client doctype.
* [Docs] Integrations > How to setup OAuth
* [Docs] Integration > Using OAuth
* [Fix] get_token endpoint must to handle POST request
* [Fix] http verbs and responses for OAuth 2.0 Endpoints
* [Fix] accept oauth2 access_token from headers
* Removed unused imports from api.py