-
Notifications
You must be signed in to change notification settings - Fork 44
Unicron v3 apis test coverage dev 2 #4846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 82 commits
7e2222e
275e4f9
1a21481
a95477e
c4ee277
50815ad
2fc5ab1
82c781e
2f51d6e
f83bc6d
0d299c5
40a1e75
1e05dd3
df5c252
c733936
b869e96
dfa1b8c
517dc22
2e68432
7b08e8c
4efeb16
1942a10
e0401e4
b908892
eec7d94
4c71f02
9209baa
5d9f620
46d1bc4
212eef7
ead98f0
6056152
d77b567
74ed6bc
4895661
46c0e2f
766ad71
b7f056a
e236f60
cad5d33
410d2e2
8a574b6
b7d6543
75fb66d
eed616c
cd2913a
92bf4f0
51bc25c
b0be84b
7fa0efa
54b5591
c95bd24
223cc5f
08d9389
0a77e0a
0bc422a
73b0663
80996a7
2708c72
4b627a3
6131a7f
798c858
1f0cbf5
e7f51c9
61a5b74
a5a70e6
66e6bb8
1bd5767
5c70742
3be1bf7
3d8ef8a
42951d6
53396dc
a197846
5fa38e2
24387c7
ed89041
da5d39c
a835e8c
16904f3
b7ab422
3820161
f5e5027
d3be008
a22ff71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -38,6 +38,14 @@ | |||||||||||||||||||||||||||||
| get_log_middleware | ||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Check if authenticated user (via bearer token) is the same as user_id - if not raise exception permission denied | ||||||||||||||||||||||||||||||
| # LG: comment this out to tunr off this chekc added after LFID is required everywhere in EasyCLA | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| # LG: comment this out to tunr off this chekc added after LFID is required everywhere in EasyCLA | |
| # LG: comment this out to turn off this check added after LFID is required everywhere in EasyCLA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typos and misleading context in authentication helper.
The helper has two issues:
- Typo in comment: "tunr off this chekc" → "turn off this check"
- Log message references
request_individual_signaturebut this is a generic helper used across many endpoints
Apply this diff:
-# Check if authenticated user (via bearer token) is the same as user_id - if not raise exception permission denied
-# LG: comment this out to tunr off this chekc added after LFID is required everywhere in EasyCLA
+# Check if authenticated user (via bearer token) is the same as user_id - if not raise permission denied exception
+# LG: comment this out to turn off this check added after LFID is required everywhere in EasyCLA
def check_user_id_is_current(auth_user, user_id):
auth_user_id = cla.controllers.user.get_or_create_user(auth_user).get_user_id()
if str(user_id) != auth_user_id:
- cla.log.debug(f'request_individual_signature - auth user UUID {auth_user_id} is not the same as requested signature UUID {str(user_id)}')
+ cla.log.debug(f'check_user_id_is_current - auth user UUID {auth_user_id} is not the same as requested user UUID {str(user_id)}')
raise cla.auth.AuthError('permission denied')📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Check if authenticated user (via bearer token) is the same as user_id - if not raise exception permission denied | |
| # LG: comment this out to tunr off this chekc added after LFID is required everywhere in EasyCLA | |
| def check_user_id_is_current(auth_user, user_id): | |
| auth_user_id = cla.controllers.user.get_or_create_user(auth_user).get_user_id() | |
| if str(user_id) != auth_user_id: | |
| cla.log.debug(f'request_individual_signature - auth user UUID {auth_user_id} is not the same as requested signature UUID {str(user_id)}') | |
| raise cla.auth.AuthError('permission denied') | |
| # Check if authenticated user (via bearer token) is the same as user_id - if not raise permission denied exception | |
| # LG: comment this out to turn off this check added after LFID is required everywhere in EasyCLA | |
| def check_user_id_is_current(auth_user, user_id): | |
| auth_user_id = cla.controllers.user.get_or_create_user(auth_user).get_user_id() | |
| if str(user_id) != auth_user_id: | |
| cla.log.debug(f'check_user_id_is_current - auth user UUID {auth_user_id} is not the same as requested user UUID {str(user_id)}') | |
| raise cla.auth.AuthError('permission denied') |
🤖 Prompt for AI Agents
In cla-backend/cla/routes.py around lines 41 to 47, fix the comment typo and
misleading log context: update the comment to "turn off this check" (instead of
"tunr off this chekc") and change the debug log to a generic message that does
not reference request_individual_signature (e.g., mention "auth user UUID does
not match requested user UUID" or similar) so the helper's log accurately
reflects its generic use; keep the permission denied raise behavior unchanged.
Uh oh!
There was an error while loading. Please reload this page.