Commit graph

793 commits

Author SHA1 Message Date
Christoph Kappel
c99e576e1b fix: offer all (also modern) supported tls versions (PROTOCOL_TLS_CLIENT [1]) to LDAP endpoints instead of only (deprecated) PROTOCOL_TLSv1 [2]
Background: Currently, when connecting to a ldap backend, ssl.PROTOCOL_TLSv1 [2] is offered as only option to the backend.

This leads to following issues:
- LDAP Backends that do not support TLSv1.0 (because of security reasons [3]) cannot be used in ERPNext
- erpnext can ONLY connect to LDAP Backends offering the insecure [3] TLSv1.0 protocol  (see ldap_settings.py ln: 61, 63)

With this change to ssl.PROTOCOL_TLS_CLIENT we allow erpnext customers to configure LDAP Backends that also support more modern/secure (TLSv1.2 and up) transport
while still ensure backwards compatibility and allowing TLSv1.0,
since ssl.PROTOCOL_TLS "Auto-negotiates the highest protocol version that both the client and server support" [1]

[1]: https://docs.python.org/3/library/ssl.html#ssl.PROTOCOL_TLS_CLIENT
[2]: https://docs.python.org/3/library/ssl.html#ssl.PROTOCOL_TLSv1
[3]: https://tools.ietf.org/id/draft-ietf-tls-oldversions-deprecate-02.html
2022-01-04 16:52:55 +01:00
Raffael Meyer
829475a98d
fix: don't run webhook in migrate 2021-12-25 22:53:17 +01:00
Jannat Patel
7771e0b2c9 fix: removed unused imports 2021-11-09 14:49:27 +05:30
Jannat Patel
845c589497 test: ignore permissions 2021-11-09 14:33:41 +05:30
Jannat Patel
08faf731e0 test: github login 2021-11-09 13:38:17 +05:30
Jannat Patel
88d8c1e56a fix: public info api 2021-11-08 20:17:07 +05:30
Jannat Patel
f3f01d1978 fix: github api endpoint 2021-11-03 14:58:16 +05:30
Shariq Ansari
0dfc5989fd
Merge branch 'frappe:develop' into wspace-code-cleanup 2021-10-19 20:16:33 +05:30
Sagar Vora
c560d67a57 fix: remove/update older whitelist calls 2021-10-18 16:47:11 +05:30
Shariq Ansari
6839f6b4db
Merge branch 'frappe:develop' into wspace-code-cleanup 2021-10-11 16:35:34 +05:30
Shridhar Patil
34f93330e9
fix: Missing save doc. 2021-09-29 16:24:47 +05:30
Shariq Ansari
5d00602f06 fix: Removing unused code for worspace 2021-09-20 21:27:14 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Gavin D'souza
ebc220db39 refactor(tests): frappe.db.delete > frappe.db.sql
Use frappe.db.delete wherever possible. Get rid of all the frappe.db.sql ;)
This commit focuses on the tests written under the doctype specific
tests
2021-08-19 19:50:48 +05:30
mergify[bot]
bd6ed2033f
Merge pull request #13152 from shariquerik/wiki-based-desk
feat: Workspace 2.0
2021-08-13 06:44:32 +00:00
mergify[bot]
be5f7125cf
Merge pull request #13777 from jon-nfc/issue-13738
feat: Improve LDAP implementation to be standards compliant
2021-08-11 06:01:55 +00:00
shariquerik
5bed8031a2 fix: removed padding code from wspace json files & patch 2021-08-10 17:52:42 +05:30
shariquerik
bf4611e84b fix: updated wspace json files & minor onboarding fix 2021-08-06 14:07:22 +05:30
Shariq Ansari
cec1de0389
Merge branch 'frappe:develop' into wiki-based-desk 2021-08-05 11:30:18 +05:30
mergify[bot]
555bcc4153
feat: Improvements in Webhooks (backport #13320) (#13791)
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2021-08-05 11:08:01 +05:30
shariquerik
84f195ca19 fix: Resolved Conflicts 2021-08-03 17:53:14 +05:30
Saqib Ansari
d6b4974bde refactor: use session.request to commonify code 2021-07-31 11:56:30 +05:30
Jon Lockwood
3beea20ddd feat(ldap): Validate additional required fields.
If the user selects 'Custom' LDAP Directory, when they hit save, validate the additional required fields ('ldap_group_objectclass' and 'ldap_group_member_attribute') for this selection to function.

Issue #13738
2021-07-30 10:59:23 +09:30
Jon Lockwood
172d1b31e8 test: LDAP unit-tests
Created unit tests for integration LDAP. These tests are designed to confirm that LDAP will continue to work after changes are made to frappe.

PR-#13777
2021-07-30 10:59:23 +09:30
Jon Lockwood
26b0fe3023 docs(ldap): update field to be a fdn
User can use any valid LDAP fdn to search. fields updated to refect.

issue #13738 PR-#13777
2021-07-30 10:59:23 +09:30
Jon Lockwood
c37e16bd09 feat(ldap): validate the user and group search path
to prevent exceptions in other locations, validate the user and group search paths at the timeof input.

issue #13738 PR-#13777
2021-07-30 10:59:23 +09:30
Jon Lockwood
99b141017f fix(ldap): fetch_ldap_groups attribute vallidation
Function requires attributes to be of type x, validate to ensure any changes will break function and to prevent further exceptions. Only output to console as it's only a developer who will generate this error.

PR-#13777
2021-07-27 11:18:32 +09:30
Jon Lockwood
1b2ec4ff77 feat(ldap): validate user fields that are ldap attributes
As the user provides some of the ldap attributes, validate those entries when the 'LDAP Settings' editor clicks save. Provide an error message if validation fails stating what is incorrect.

issue #13738 PR-#13777
2021-07-27 11:02:36 +09:30
Jon Lockwood
c0565ae2d3 fix(ldap): Don't reach outside of function for details supplied
A user object is passed to the function. Use this to derived the user details.

PR #13777
2021-07-27 10:21:08 +09:30
Jon Lockwood
ac5f85fa7a chore(ldap): remove unused var
sider #issue-5810499
2021-07-27 10:16:23 +09:30
Jon Lockwood
7927af30e1 fix(ldap): Don't reach outside function for user details
a user document is passed to the function. use this to derive user details

issue #13738
2021-07-26 17:34:07 +09:30
Jon Lockwood
5f6f6a77e5 fix(ldap): ldap3 exception
A blank password causes exception 'ldap3.core.exceptions.LDAPPasswordIsMandatoryError'. Validate the user input.

Issue #13738
2021-07-25 17:23:34 +09:30
Jon Lockwood
36c5b7fa09 feat(ldap): ldap search string validation
ldap search string is user input. validate to ensure is enclosed in '()', has the '{0}' placeholder and has the same number of brackets as used in complex ldap search strings.

issue #13738
2021-07-25 11:15:52 +09:30
Jon Lockwood
ba81929519 refactor(ldap): reuse existing connection
to confirm user credentials, use 'rebind' instead of re-connecting to ldap. This also enables unit testing of all functions except the connection to ldap.

issue #13738
2021-07-25 11:15:52 +09:30
Jon Lockwood
9ff38dec39 feat(ldap): sync ldap groups to roles
ldap_group_field set for depreciation.

issue #13738 fixes frappe/frappe#10794
2021-07-25 11:15:52 +09:30
Jon Lockwood
09cf8ee246 chore(ldap): typo
issue #13738
2021-07-25 11:15:52 +09:30
Jon Lockwood
05e978c5ec feat(ldap): validate LDAP search filter
Validate the LDAP search filter including enclosing in '()'. Note: if a user has a complex filter that misses the last ')' it will not be added. i.e. (&(objectclass=posixgroup)(uid={0}) is invalid but will pass validation.

issue #13738
2021-07-25 11:15:52 +09:30
Jon Lockwood
f971b8c456 feat(ldap): allow more complex ldap search filters
User needs to be able to conduct complex filtering. As long as the placeholder '{0}' for the username is included in the ldap search filter, the user can customize as required. searches must be enclosed in '()' i.e '(uid={0}) or '(&(objecttype=posixaccount)(uid={0}))' etc.

issue #13738 close frappe/frappe#6037
2021-07-25 11:15:52 +09:30
Jon Lockwood
a5085695bf refactor(ldap): ldap operations under base dn user
All LDAP operations should be done by ldap base dn user. This allows an administrator to lock down their directory to the user the LDAP operations are being conducted by.

issue #13738
2021-07-25 11:15:52 +09:30
Jon Lockwood
0914d8a296 refactor(ldap): use posixgroup
adjusted to posixgroup as openldap groups use objectclass 'posixgroup' for both a posix group and a samba group.

issue #13738
2021-07-25 11:15:52 +09:30
Jon Lockwood
68a5ac2b34 fix: username required
as part of the search the login/user name is required to find the user

issue #13738
2021-07-25 11:15:52 +09:30
Jon Lockwood
622800453a feat: new method to search for members ldap groups
New method to search for user group membership. Replaces old logic of using an ldap users attribute memberof which is not supported by all LDAP implementations

issue #13738
2021-07-25 11:03:47 +09:30
Jon Lockwood
1f0e0d23ed feat: update interface
Add new fields for the new group feature

issue #13738
2021-07-25 11:02:00 +09:30
Saqib Ansari
0fa9abde4c feat: add put request to integration utils 2021-07-13 14:35:16 +05:30
shariquerik
8475c6c426 fix: updated wspace json files 2021-07-08 17:41:22 +05:30
shariquerik
f2a91f5709 fix: updated wspace json files 2021-07-08 15:37:01 +05:30
barredterra
5592bf6b1c feat: remove "All" access from Google Settings 2021-06-29 18:43:20 +02:00
barredterra
d9044815f4 style: use double quotes 2021-06-29 18:42:43 +02:00
barredterra
b02d2715be test: remove test_picker_as_guest
Guest access was disabled. Testing this would be equivalent to testing frappe.whitelist.
2021-06-29 18:42:15 +02:00
barredterra
99594b0fd8 test: change test cases after interface change 2021-06-29 16:02:27 +02:00