Skip to content

Commit

Permalink
QuickSight support users with special characters (#8169)
Browse files Browse the repository at this point in the history
  • Loading branch information
MSSputnik authored Oct 1, 2024
1 parent c3150cf commit ed76836
Show file tree
Hide file tree
Showing 3 changed files with 221 additions and 67 deletions.
9 changes: 5 additions & 4 deletions moto/quicksight/responses.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Handles incoming quicksight requests, invokes methods, returns responses."""

import json
from urllib.parse import unquote

from moto.core.common_types import TYPE_RESPONSE
from moto.core.responses import BaseResponse
Expand Down Expand Up @@ -42,7 +43,7 @@ def create_group_membership(self) -> str:
aws_account_id = self.path.split("/")[-7]
namespace = self.path.split("/")[-5]
group_name = self.path.split("/")[-3]
user_name = self.path.split("/")[-1]
user_name = unquote(self.path.split("/")[-1])
member = self.quicksight_backend.create_group_membership(
aws_account_id, namespace, group_name, user_name
)
Expand All @@ -58,7 +59,7 @@ def describe_group_membership(self) -> str:
aws_account_id = self.path.split("/")[-7]
namespace = self.path.split("/")[-5]
group_name = self.path.split("/")[-3]
user_name = self.path.split("/")[-1]
user_name = unquote(self.path.split("/")[-1])
member = self.quicksight_backend.describe_group_membership(
aws_account_id, namespace, group_name, user_name
)
Expand Down Expand Up @@ -116,7 +117,7 @@ def describe_group(self) -> str:
def describe_user(self) -> str:
aws_account_id = self.path.split("/")[-5]
namespace = self.path.split("/")[-3]
user_name = self.path.split("/")[-1]
user_name = unquote(self.path.split("/")[-1])

user = self.quicksight_backend.describe_user(
aws_account_id, namespace, user_name
Expand All @@ -134,7 +135,7 @@ def delete_group(self) -> TYPE_RESPONSE:
def delete_user(self) -> TYPE_RESPONSE:
aws_account_id = self.path.split("/")[-5]
namespace = self.path.split("/")[-3]
user_name = self.path.split("/")[-1]
user_name = unquote(self.path.split("/")[-1])

self.quicksight_backend.delete_user(aws_account_id, namespace, user_name)
return 204, {"status": 204}, json.dumps({"Status": 204})
Expand Down
3 changes: 3 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ prompt_toolkit

# type stubs that mypy doesn't install automatically
botocore-stubs
types-requests
types-python-dateutil
types-PyYAML


# typing_extensions is currently used for:
Expand Down
Loading

0 comments on commit ed76836

Please sign in to comment.