Skip to content

Commit 8673d1f

Browse files
Switch to v1/user
1 parent 3899612 commit 8673d1f

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

rsconnect/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def _tweak_response(self, response: HTTPResponse) -> JsonData | HTTPResponse:
399399
)
400400

401401
def me(self) -> UserRecord:
402-
response = cast(Union[UserRecord, HTTPResponse], self.get("me"))
402+
response = cast(Union[UserRecord, HTTPResponse], self.get("v1/user"))
403403
response = self._server.handle_bad_response(response)
404404
return response
405405

rsconnect/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,12 @@ class UserRecord(TypedDict):
601601
first_name: str
602602
last_name: str
603603
password: str
604+
user_role: str
604605
created_time: str
605606
updated_time: str
606607
active_time: str | None
607608
confirmed: bool
608609
locked: bool
609610
guid: str
610611
preferences: dict[str, object]
612+
privileges: list[str]

tests/test_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ def test_deploy_draft(self, command, target, expected_activate, caplog):
125125
)
126126
httpretty.register_uri(
127127
httpretty.GET,
128-
"http://fake_server/__api__/me",
129-
body=open("tests/testdata/rstudio-responses/get-user.json", "r").read(),
128+
"http://fake_server/__api__/v1/user",
129+
body=open("tests/testdata/connect-responses/me.json", "r").read(),
130130
adding_headers={"Content-Type": "application/json"},
131131
status=200,
132132
)

tests/test_main_content.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def register_content_endpoints(i: int, guid: str):
5555
)
5656
httpretty.register_uri(
5757
httpretty.GET,
58-
f"{connect_server}/__api__/me",
58+
f"{connect_server}/__api__/v1/user",
5959
body=open("tests/testdata/connect-responses/me.json", "r").read(),
6060
adding_headers={"Content-Type": "application/json"},
6161
)

0 commit comments

Comments
 (0)