mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-19 10:52:04 +00:00
feat(iam): add ListRolePolicies handler returning empty inline list
Satisfies the AWS provider's aws_iam_role read-back. Spinifex only attaches managed policies, never inline, so this always returns empty.
This commit is contained in:
@@ -126,6 +126,9 @@ var iamActions = map[string]IAMHandler{
|
||||
"ListAttachedRolePolicies": iamHandler(func(accountID string, input *iam.ListAttachedRolePoliciesInput, gw *GatewayConfig) (any, error) {
|
||||
return gateway_iam.ListAttachedRolePolicies(accountID, input, gw.IAMService)
|
||||
}),
|
||||
"ListRolePolicies": iamHandler(func(accountID string, input *iam.ListRolePoliciesInput, gw *GatewayConfig) (any, error) {
|
||||
return gateway_iam.ListRolePolicies(accountID, input, gw.IAMService)
|
||||
}),
|
||||
|
||||
// Instance profile CRUD
|
||||
"CreateInstanceProfile": iamHandler(func(accountID string, input *iam.CreateInstanceProfileInput, gw *GatewayConfig) (any, error) {
|
||||
|
||||
@@ -79,3 +79,15 @@ func ListAttachedRolePolicies(accountID string, input *iam.ListAttachedRolePolic
|
||||
}
|
||||
return svc.ListAttachedRolePolicies(accountID, input)
|
||||
}
|
||||
|
||||
// ListRolePolicies lists inline role policies. Spinifex only ever attaches
|
||||
// managed policies (AttachRolePolicy), never inline, so this always returns an
|
||||
// empty list — enough to satisfy the AWS provider's aws_iam_role read-back.
|
||||
func ListRolePolicies(accountID string, input *iam.ListRolePoliciesInput, svc handlers_iam.IAMService) (*iam.ListRolePoliciesOutput, error) {
|
||||
if input.RoleName == nil || *input.RoleName == "" {
|
||||
return nil, errors.New(awserrors.ErrorMissingParameter)
|
||||
}
|
||||
return &iam.ListRolePoliciesOutput{
|
||||
PolicyNames: []*string{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user