Commit graph

31 commits

Author SHA1 Message Date
Chris Hemmings
fbf07ddf6e
fix: OAuth2 absolute authorize, access token and api urls (#34266)
* fix: OAuth2 absolute authorize, access token and api urls

* fix: add back keycloak check, just use the function instead

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
2025-10-09 16:47:38 +05:30
Akhil Narang
84ef6ec677
refactor: fixup with ruff 0.8.1
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-04 13:18:04 +05:30
David Arnold
c114e5fae8
refactor: unit vs integration treewide (#27992)
* refactor: constitute unit test case

* fix: docs and type hints

* refactor: mark presumed integration test cases explicitly

At time of writing, we now have at least two base test classes:

- frappe.tests.UnitTestCase
- frappe.tests.IntegrationTestCase

They load in their perspective priority queue during execution.

Probably more to come for more efficient queing and scheduling.

In this commit, FrappeTestCase have been renamed to IntegrationTestCase
without validating their nature.

* feat: Move test-related functions from test_runner.py to tests/utils.py

* refactor: add bare UnitTestCase to all doctype tests

This should teach LLMs in their next pass that the distinction matters
and that this is widely used framework practice
2024-10-06 09:43:36 +00:00
Akhil Narang
26ae0f3460
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Ankush Menat
793f4ebba3 perf: defer loading JWT 2023-06-24 19:50:08 +05:30
Ankush Menat
8485ac5d62 build(deps): bump many dependencies
test: change code to adapt to new werkzeug client

fix: avoid setting charset

utf8 is default and assumed now by werkzeug, setting this manually is
deprecated.

fix: use string instead of bytes for setting headers

DeprecationWarning: Passing bytes as a header value is deprecated and will not be supported in Werkzeug 3.0.
12:23:34 web.1         |   response.headers["X-Page-Name"] = path.encode("ascii", errors="xmlcharrefreplace")
2023-06-10 20:47:27 +05:30
William Luke
e0ed7d3b97
fix(oauth): add exp to idToken (#20694) 2023-05-05 01:19:03 +05:30
Ankush Menat
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +05:30
Gavin D'souza
e7a16135e0 fix: Setup test_client for each test 2022-08-05 15:12:52 +05:30
Gavin D'souza
7b149d4273 fix: Allow setting kwarg site for make_request test util 2022-08-05 13:54:58 +05:30
Gavin D'souza
b00ae8043f test: Set sid as client cookie instead of oauth payload 2022-08-05 12:25:04 +05:30
Gavin D'souza
832fbb6c85 chore: Remove dead imports 2022-08-05 11:39:39 +05:30
Gavin D'souza
060498c3e4 test: Pass sid to requests to maintain a session 2022-08-05 10:41:13 +05:30
Gavin D'souza
f7d5cb504a test(oauth-client): Generate new client for each test 2022-08-03 12:00:09 +05:30
Gavin D'souza
7f2c9e84b3 feat(minor): Expose use_cookies kwarg to test client 2022-08-02 17:30:07 +05:30
Gavin D'souza
e32ecb394d refactor: Oauth20 tests
Use App client app directly instead of requests. This removes dependency
on needing a web server running for your tests. Also, contributes to
coverage now. We can see which lines are impacted with each use case.
2022-08-02 17:30:07 +05:30
Aditya Hase
23cad54802
test(oauth): Send id_token of the authorized user instead of Guest
This only affects OAuth clients that use `id_token` obtained from `frappe.integrations.oauth2.get_token`.

Doesn't affect OAuth clients that ignore id_token and explicitly use `frappe.integrations.oauth2.openid_profile` endpoint for getting user details. e.g. Frappe OAuth client.

A simple way to replicate this is to setup Frappe-Frappe OAuth client-server pair and use `login_via_oauth2_id_token` instead of `login_via_oauth2` in `login_via_frappe`.
2022-06-21 21:50:16 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +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
165ff8e1bf chore: Update PyJWT dependency
* Update pinned dep fromm 1.7.1 to 2.0.1
* Updated usages as per changelog

ref: https://python.libhunt.com/pyjwt-changelog
2021-05-29 17:22:30 +05:30
Rohan Bansal
dade7ed216 refactor: fix py3 datatypes and remove references to six in oauth 2021-04-28 14:02:23 +05:30
Revant Nandgaonkar
72fbcac70c fix: sider issues 2021-04-26 23:04:43 +05:30
Revant Nandgaonkar
4e8b00ba1f feat: OAuth 2 openid-configuration and introspect_token endpoint 2021-04-26 22:56:14 +05:30
Revant Nandgaonkar
96d6971ee4 refactor: improve oauthlib implementation
implement openid provider
implement PKCE
improve errors
2021-04-26 22:56:14 +05:30
barredterra
e93a38f912 refactor: move encode_params from test to oauth2.py 2020-11-20 19:02:33 +01:00
barredterra
28d9ca79e9 test: special method to encode spaces the right way 2020-09-26 20:23:59 +02:00
barredterra
8dda805654 fix: simplify test 2020-09-25 17:14:31 +02:00
barredterra
dbcf6bc5c3 fix: login, get_full_url 2020-09-25 16:54:36 +02:00
barredterra
8dfea8a3e3 test: fix/refactor oauth tests 2020-09-25 16:43:24 +02:00
Revant Nandgaonkar
953d9b8488 fix(tests): OAuth 2.0 tests 2019-10-21 14:30:52 +05:30
Renamed from frappe/tests/ui/test_oauth20.py (Browse further)