-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Api v2 delete note #734
Api v2 delete note #734
Conversation
…r}/notes, to create a note
… case_identifier does not exist
… with directory_id does not exist
… with directory_id is in another case
…identifier}/notes
…/{case_identifier}/notes/{identifier}
…not correspond to existing objects
… to any existing case
…cases/{case_identifier}/notes/{identifier}
…v2/cases/{case_identifier}/notes/{identifier}
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@@ -130,5 +124,4 @@ | |||
track_activity(f'user \'{user.user}\' successfully logged-in', ctx_less=True, display_in_ui=False) | |||
|
|||
next_url = _filter_next_url(request.args.get('next'), user.ctx_case) | |||
|
|||
return redirect(next_url) | |||
return redirect(next_url) |
Check warning
Code scanning / CodeQL
URL redirection from remote source Medium
user-provided value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 4 days ago
To fix the problem, we need to enhance the URL validation to ensure that the next_url
is safe for redirection. We will:
- Update the
_is_safe_url
function to handle additional edge cases, such as URLs with backslashes and malformed URLs. - Ensure that the
next_url
is either a relative URL or has the same host as the current request. - Use the
url_has_allowed_host_and_scheme
function from Django (if available) or implement similar logic to validate the URL.
-
Copy modified line R77 -
Copy modified line R79
@@ -76,5 +76,5 @@ | ||
""" | ||
ref_url = urlparse(request.host_url) | ||
target = target.replace('\\', '') | ||
test_url = urlparse(urljoin(request.host_url, target)) | ||
return test_url.scheme in ('http', 'https') and ref_url.netloc == test_url.netloc | ||
return test_url.scheme in ('http', 'https') and not test_url.netloc or test_url.netloc == urlparse(request.host_url).netloc | ||
|
Implementation of endpoint
DELETE /api/v2/cases/{case_identifier}/notes/{identifier}
to delete a note.Tasks performed:
POST /case/notes/delete/{note_id}
PUT /api/v2/cases/{case_identifier}/notes/{identifier}
should return 403 when user has no permission to access to caseThis PR goes with the accompanying documentation iris-doc-src PR#44.
It is built on top of branch
api_v2_update_node
. So it should not be merged before PR#732