Commit graph

854 commits

Author SHA1 Message Date
Ankush Menat
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +05:30
Gavin D'souza
65273ee828 Merge branch 'develop' of github.com:frappe/frappe into refactor-oauth-tests 2022-08-05 11:38:55 +05:30
Ankush Menat
40f27f908a style: format JS files with prettier 2022-08-04 14:51:01 +05:30
Gavin D'souza
2933a06e80 Merge branch 'develop' of github.com:frappe/frappe into refactor-oauth-tests 2022-08-03 16:37:38 +05:30
Gavin D'souza
85e3ee9403 chore: Minified DocType JSON notation from old verbose notation 2022-08-03 12:22:03 +05:30
Gavin D'souza
2ae50f911a chore: Minimize OAuth Client DocType 2022-08-03 12:01:36 +05:30
Gavin D'souza
f7d5cb504a test(oauth-client): Generate new client for each test 2022-08-03 12:00:09 +05:30
phot0n
090d0321a8 chore: fix linter 2022-07-26 23:17:04 +05:30
phot0n
f71562fd49 chore: add integration request doctype back (with utils) 2022-07-26 23:17:04 +05:30
phot0n
83fe747f75 chore: remove payment utils and hooks 2022-07-26 15:11:56 +05:30
phot0n
f3473b059e chore: remove payment gateway and integration request doctype 2022-07-26 15:11:56 +05:30
phot0n
725b8fb13a chore: remove payments card from integration workspace 2022-07-26 15:11:56 +05:30
phot0n
310b8327c7 chore: remove payment doctypes 2022-07-26 15:11:56 +05:30
Ankush Menat
066d5a4245
Merge pull request #17528 from phot0n/mis-fixes-goauth
fix: misc fixes (google oauth)
2022-07-19 15:55:24 +05:30
Gavin D'souza
c55bb98482 test: LDAP test for website user creation 2022-07-19 15:01:16 +05:30
Gavin D'souza
c7726d6394 fix: Pick default_role for Sytem User type only 2022-07-19 15:00:23 +05:30
Gavin D'souza
26f4654b31 test: Check user role & type updated via LDAP 2022-07-18 18:22:12 +05:30
phot0n
943334a90c chore: fix docstrings 2022-07-18 17:47:57 +05:30
Gavin D'souza
a588879094 refactor(minor): LDAP Settings Test Suite
* Re-write blocks for better readability
* De-indent everything
* Add typing, etc
2022-07-18 17:30:04 +05:30
gavin
155a7c2343
Merge branch 'develop' into ldap-user_type 2022-07-18 15:41:10 +05:30
Ankush Menat
29c855b028
fix: db.get_value -> db.get_single_value (#17531)
db.get_value for singles returns string type always, this is confusing
behaviour, db.get_single_value should be used instead.

semgrep rule: https://github.com/frappe/semgrep-rules/pull/16
2022-07-18 15:10:49 +05:30
phot0n
f679dc3fdd fix(security): restrict the god google callback
the common google callback can be used to trigger any method in the whole codebase
restrict it by only allowing domain specific callback method and raise
an error if the domain is not found
2022-07-17 21:37:21 +05:30
phot0n
7d5262f5e0 chore: translate authorization message and add nosemgrep 2022-07-13 12:50:04 +05:30
phot0n
31c5f260d7 chore: use f-strings 2022-07-13 12:29:25 +05:30
phot0n
01a1860491 fix(ux): better ux for successful oauthorization 2022-07-13 12:05:46 +05:30
phot0n
5b7d37477e chore: add link for google settings when throwing error 2022-07-13 12:05:46 +05:30
phot0n
8b38fcb438 chore: move getting site address to GoogleOAuth 2022-07-13 12:05:46 +05:30
phot0n
484758d6e0 chore: remove additional/unnecessary set_value calls 2022-07-13 12:05:46 +05:30
phot0n
6848c93770 chore: remove GET method whitelisting from google integrations 2022-07-13 12:05:46 +05:30
phot0n
ab9a577474 minor: better oauth flow 2022-07-13 12:05:46 +05:30
phot0n
221423c718 chore: added docstrings 2022-07-13 12:05:46 +05:30
phot0n
07a577af86 feat: google oauth for google emails
* used unique constraint on email_id in Email Account Doctype
2022-07-13 12:05:46 +05:30
phot0n
26dd606831 refactor: GoogleOAuth
* refactor: single callback method for google oauth
2022-07-13 12:05:46 +05:30
Ankush Menat
d5820213f0 feat: preview Webhook request data 2022-07-11 18:26:57 +05:30
Ankush Menat
1531e36004 fix: allow JSON array as request body 2022-07-11 18:26:54 +05:30
Ankush Menat
d4fe142674 fix(UX): correctly validate python condition 2022-07-11 18:26:54 +05:30
Gavin D'souza
ee97038c71 chore: Add typing + reduce import paths 2022-07-08 13:24:26 +05:30
Gavin D'souza
b20f77b9b9 fix(ldap): Set default user type to System User 2022-07-08 12:31:58 +05:30
Gavin D'souza
e7023fa74d feat(ldap): Allow setting "User Type" for new users
Prior to this, every user found in LDAP would mean a System User is
created - now pick the type and role you want to give newly created
users. For the given user types, the role may be picked from:

System User | ldap_settings.default_user_role (Fetched from LDAP settings)
Website User | N/A
{{ Custom Type }} | user_type.role (Fetched from User Type record)
2022-07-07 17:13:59 +05:30
Suraj Shetty
d4166dbe20 refactor: Replace html2text with markdownify 2022-07-06 08:23:14 +05:30
Ankush Menat
261fbfcd11
Revert "fix(doc)!: Always cast datetime, date and time fields"
Revert "fix(doc)!: Always cast datetime, date and time fields (#15891)"

This reverts commit d7789ab6ff.
2022-07-05 13:43:32 +05:30
Himanshu
d7789ab6ff
fix(doc)!: Always cast datetime, date and time fields (#15891)
### BREAKING CHANGE
#### Datetime, Date and Time fields will always be cast to respective objects in `setattr`, this will ensure uniformity while accessing the values, no more `getdate`, `get_datetime`, `to_timedelta` wrapper.
- While importing data, the framework does check for `set_only_once`.
- In normal case scenarios, this will work flawlessly since most date fields might not be set_only_once.
- But in Subscription, the date field is set to `set_only_once` and in `after_insert`, `document.save` is called, and while doing so, `set_only_once` is checked [here](1944a547f9/frappe/model/document.py (L566)).
-This works fine if the data imported is in the correct format.
- If the date's data is not in the correct format, the framework throws an error.
- for eg `06-02-2022 00:00:00 != 06-02-2022`
- fixes [Issue/#15370](https://github.com/frappe/frappe/issues/15370)

> no-docs
2022-07-05 07:07:16 +00:00
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Gavin D'souza
96b3ee4dc3 fix(webhook): Unbound 'r' through request timeout
Errors like `requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='httpbin.org', port=443): Read timed out. (read timeout=5)`

ref: https://github.com/frappe/frappe/runs/7126891200?check_suite_focus=true
2022-06-30 13:36:08 +05:30
Ankush Menat
d35d7ffbe2 fix: remove bare exception catching
A bare except catches lots of things (like generator iteration end) and should never be used.
2022-06-28 18:05:00 +05:30
Gavin D'souza
80b19a6031 fix: Cast singles_dict' values
This is to adapt with the changes made in frappe.db.get_singles_dict in
the previous commit
2022-06-15 10:40:26 +05:30
Gavin D'souza
7e25cc4568 perf: Login Page
Improves performance 3x - from 0.047s to 0.017s

* Use frappe.get_*_settings to query table once
* Use cached LDAP Settings' document via get_ldap_client_settings
* Use single get_all to query all Social Login providers and related
  data
* Skip provider if client_secret doesn't exist
2022-06-13 18:39:56 +05:30
Ankush Menat
d1938ee271
perf: remove naming series from log-like doctypes (#16823)
- webhook request log
- access log
2022-05-04 10:54:52 +05:30
mergify[bot]
ee40bda491
Merge pull request #16602 from resilient-tech/int-req
refactor: Integration Request
2022-05-02 12:49:27 +00:00
Rucha Mahabal
693a6a7789 fix: frappe.log_error arguments while capturing razorpay payment failures 2022-05-01 11:34:08 +05:30