Skip to content

Commit e1a4eec

Browse files
authored
Merge pull request #101 from code42/bugfix/user-risk-profile-page-param
fix `page` query param in user-risk-profile query
2 parents 09e9fac + e9a23b4 commit e1a4eec

File tree

5 files changed

+28
-11
lines changed

5 files changed

+28
-11
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
The intended audience of this file is for `incydr` SDK and CLI consumers -- as such, changes that don't affect
9+
how a consumer would use the library or CLI tool (e.g. adding unit tests, updating documentation, etc) are not captured
10+
here.
11+
12+
## 1.0.1 2023-04-21
13+
14+
### Fixed
15+
16+
- Bug in the `user_risk_profile` client, where `get_page()` was using the incorrect query param for the page number.
17+
- Bug in `AuditEventsPage` model that prevented some audit log events from being parsed correctly.

src/_incydr_sdk/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-FileCopyrightText: 2022-present Code42 Software <integrations@code42.com>
22
#
33
# SPDX-License-Identifier: MIT
4-
__version__ = "1.0.0"
4+
__version__ = "1.0.1"

src/_incydr_sdk/user_risk_profiles/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def get_page(
9797
"""
9898
page_size = page_size or self._parent.settings.page_size
9999
data = QueryUserRiskProfilesRequest(
100-
page_num=page_num,
100+
page=page_num,
101101
page_size=page_size,
102102
manager_id=manager_id,
103103
title=title,

src/_incydr_sdk/user_risk_profiles/models.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from typing import List
44
from typing import Optional
55

6-
from pydantic import BaseModel
76
from pydantic import Field
87
from rich.markdown import Markdown
98

9+
from _incydr_sdk.core.models import Model
1010
from _incydr_sdk.core.models import ResponseModel
1111

1212

@@ -125,8 +125,8 @@ class UserRiskProfilesPage(ResponseModel):
125125
)
126126

127127

128-
class QueryUserRiskProfilesRequest(BaseModel):
129-
page_num: Optional[int]
128+
class QueryUserRiskProfilesRequest(Model):
129+
page: Optional[int]
130130
page_size: Optional[int]
131131
manager_id: Optional[str]
132132
title: Optional[str]
@@ -144,7 +144,7 @@ class Config:
144144
use_enum_values = True
145145

146146

147-
class UpdateUserRiskProfileRequest(BaseModel):
147+
class UpdateUserRiskProfileRequest(Model):
148148
endDate: Optional[Date] = None
149149
notes: Optional[str] = Field(
150150
None,
@@ -154,14 +154,14 @@ class UpdateUserRiskProfileRequest(BaseModel):
154154
startDate: Optional[Date] = None
155155

156156

157-
class AddCloudAliasesRequest(BaseModel):
157+
class AddCloudAliasesRequest(Model):
158158
cloudAliases: Optional[List[str]] = None
159159
userId: Optional[str] = Field(
160160
None, description="The ID of the user to add cloud aliases.", example="123"
161161
)
162162

163163

164-
class DeleteCloudAliasesRequest(BaseModel):
164+
class DeleteCloudAliasesRequest(Model):
165165
cloudAliases: Optional[List[str]] = None
166166
userId: Optional[str] = Field(
167167
None, description="The ID of the user to delete cloud aliases.", example="123"

tests/test_user_risk_profiles.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ def test_iter_all_when_default_params_returns_expected_data(
158158
httpserver_auth: HTTPServer,
159159
):
160160
query_1 = {
161-
"page_num": 1,
161+
"page": 1,
162162
"page_size": 2,
163163
}
164-
query_2 = {"page_num": 2, "page_size": 2}
164+
query_2 = {"page": 2, "page_size": 2}
165165

166166
user_risk_profile_data_1 = {
167167
"userRiskProfiles": [TEST_USER_RISK_PROFILE_1, TEST_USER_RISK_PROFILE_2],
@@ -243,7 +243,7 @@ def test_delete_cloud_alias_when_default_params_returns_expected_data(
243243

244244
def test_cli_list_makes_expected_call(httpserver_auth: HTTPServer, runner):
245245
query_1 = {
246-
"page_num": 1,
246+
"page": 1,
247247
"page_size": 100,
248248
}
249249
user_risk_profile_data_1 = {

0 commit comments

Comments
 (0)