Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _build_authentication_response(
raise ValueError(f"Invalid home_directory_type: {home_directory_type}")

if user_uid is not None:
response["PosixProfile"] = {"Gid": user_gid, "Uid": user_gid}
response["PosixProfile"] = {"Gid": user_gid, "Uid": user_uid}

if policy:
response["Policy"] = policy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,22 @@ def test_build_authentication_response_efs(home_directory_type):
assert "HomeDirectory" not in response


def test_build_authentication_response_efs_posix_profile():
# GIVEN a Authorizer response
response = TransferFamilyAuthorizerResponse()

# WHEN building an authentication response for EFS with different uid and gid
response = response.build_authentication_response_efs(
role_arn="arn:aws:iam::123456789012:role/EFSAccess",
home_directory="/fs-12345678/user",
user_gid=1000,
user_uid=1001,
)

# THEN the PosixProfile uses the uid and gid that were passed
assert response.get("PosixProfile") == {"Gid": 1000, "Uid": 1001}


def test_build_authentication_missing_home_directory():
# GIVEN a Authorizer response
response = TransferFamilyAuthorizerResponse()
Expand Down