Skip to content

Commit 85da675

Browse files
authored
30425 & 30422 - Bad request on large org_id & clean up logging for skip_404_logging (bcgov#3499)
1 parent 37f2c21 commit 85da675

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

auth-api/src/auth_api/resources/v1/org.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,17 @@
6060
@_jwt.has_one_of_roles([Role.SYSTEM.value, Role.STAFF_VIEW_ACCOUNTS.value, Role.PUBLIC_USER.value])
6161
def search_organizations():
6262
"""Search orgs."""
63+
org_id = extract_numbers(request.args.get("id", None))
64+
if org_id and org_id.isdigit() and int(org_id) >= 2147483647:
65+
raise BusinessException(Error.INVALID_INPUT, None)
6366
org_search = OrgSearch(
6467
request.args.get("name", None),
6568
request.args.get("branchName", None),
6669
request.args.get("affiliation", None),
6770
request.args.getlist("status", None),
6871
request.args.getlist("accessType", None),
6972
request.args.get("bcolAccountId", None),
70-
extract_numbers(request.args.get("id", None)),
73+
org_id,
7174
request.args.get("decisionMadeBy", None),
7275
request.args.get("orgType", None),
7376
string_to_bool(request.args.get("includeMembers", "False")),

auth-api/src/auth_api/services/rest_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def get( # pylint: disable=too-many-positional-arguments,too-many-arguments
219219
current_app.logger.error(exc)
220220
raise ServiceUnavailableException(exc) from exc
221221
except HTTPError as exc:
222-
if not (exc.response and exc.response.status_code == 404 and skip_404_logging):
222+
if exc.response and exc.response.status_code == 404 and skip_404_logging is False:
223223
current_app.logger.error(
224224
f"HTTPError on GET {endpoint} "
225225
f"with status code {exc.response.status_code if exc.response else ''}"

auth-api/update_poetry_dependencies.sh

100644100755
File mode changed.

queue_services/account-mailer/poetry.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

queue_services/account-mailer/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ urllib3 = "2.5.0"
3232
zipp = "3.19.1"
3333

3434
# VCS dependencies
35-
auth-api = { git = "https://github.com/seeker25/sbc-auth.git", branch = "jinja_security_fix", subdirectory = "auth-api" }
35+
auth-api = { git = "https://github.com/bcgov/sbc-auth", branch = "30423", subdirectory = "auth-api" }
3636
simple-cloudevent = { git = "https://github.com/daxiom/simple-cloudevent.py.git" }
3737
cloud-sql-python-connector = "^1.13.0"
3838
pkginfo = "^1.12.1.2"

queue_services/auth-queue/poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

queue_services/auth-queue/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ zipp = "3.19.1"
3434

3535

3636
# VCS dependencies
37-
auth-api = { git = "https://github.com/seeker25/sbc-auth.git", branch = "jinja_fix_p2", subdirectory = "auth-api" }
37+
auth-api = { git = "https://github.com/bcgov/sbc-auth", branch = "30423", subdirectory = "auth-api" }
3838
simple-cloudevent = { git = "https://github.com/daxiom/simple-cloudevent.py.git" }
3939
cloud-sql-python-connector = "^1.13.0"
4040

0 commit comments

Comments
 (0)