feat(iam): implement ListUserPolicies API action (#8991)

* feat(iam): implement ListUserPolicies API action (#8987)

Add ListUserPolicies support to both embedded and standalone IAM servers,
resolving the NotImplemented error when calling `aws iam list-user-policies`.

* fix: address review feedback for ListUserPolicies

- Add handleImplicitUsername for ListUserPolicies in both IAM servers
  so omitting UserName defaults to the calling user (Gemini review)
- Assert synthetic policy name in unit test (CodeRabbit)
- Use require.True for error type assertion in integration test (CodeRabbit)
This commit is contained in:
Chris Lu
2026-04-08 12:27:03 -07:00
committed by GitHub
parent fbe758efa8
commit 45ee2ab4b9
6 changed files with 188 additions and 2 deletions
+11
View File
@@ -178,6 +178,17 @@ type ListAttachedUserPoliciesResponse struct {
CommonResponse
}
// ListUserPoliciesResponse is the response for ListUserPolicies action.
type ListUserPoliciesResponse struct {
XMLName xml.Name `xml:"https://iam.amazonaws.com/doc/2010-05-08/ ListUserPoliciesResponse"`
ListUserPoliciesResult struct {
PolicyNames []string `xml:"PolicyNames>member"`
IsTruncated bool `xml:"IsTruncated"`
Marker string `xml:"Marker,omitempty"`
} `xml:"ListUserPoliciesResult"`
CommonResponse
}
// GetUserPolicyResponse is the response for GetUserPolicy action.
type GetUserPolicyResponse struct {
XMLName xml.Name `xml:"https://iam.amazonaws.com/doc/2010-05-08/ GetUserPolicyResponse"`