mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 22:37:55 -05:00
* fix(eks): accept a role ARN from another partition the way STS does An account keeps one IAM namespace whichever partition a request is for (partitions.md, Known gaps). STS AssumeRole already resolved a role ARN from another partition to the account's role, while EKS Pod Identity and add-ons required the cluster's partition and an exact stored-ARN match. Move the STS role-ARN matcher to IamService.roleArnMatches and use it for the Pod Identity roleArn and the add-on role ARNs; targetRoleArn accepts any well-formed partition. The Pod Identity session names the stored role's ARN, as an STS session does. The EKS model sets no pattern on roleArn or targetRoleArn. * fix(eks): keep a role recreated under another path out of a pod identity session The credentials endpoint finds the association's role by name only. Since the session started naming the stored role's ARN, a role deleted and recreated under another path gave the session its ARN and role id through the old association. The found role now has to match the association's role ARN the way roleArnMatches does everywhere else; one that does not is treated as absent, as before this branch. The association test also checks that a rejected role update leaves the stored role ARN as it was. * fix(eks): refuse pod identity credentials when the association's role is gone EKS Auth assumes the association's role through STS, so a role that no longer exists gets no credentials. The endpoint still issued them, and since enforcement loads a session's policies by role name, a pod whose role was recreated under another path ran with the replacement's policies. A role that is missing, or that does not match the association's role ARN, is now a 400 AccessDeniedException and no session is registered.