benkehoe / aws-assume-role-lib

Assumed role session chaining (with credential refreshing) for boto3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`generate_lambda_session_name` can return a session name >64 chars

lorengordon opened this issue · comments

Just ran into this issue... if the function name is sufficiently long, the session name returned by generate_lambda_session_name will fail...

An error occurred (ValidationError) when calling the AssumeRole operation: 1 validation error detected: Value 'new-account-trust-policy-nnnnnnnnnnn.mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm' at 'roleSessionName' failed to satisfy constraint: Member must have length less than or equal to 64

Do you think it should be the function name or the identifier that should be truncated? My gut says identifier, there's more uniqueness in it than the function name

I think I agree... Use only the first 64 chars and whatever snippet of the identifier makes it, hopefully will be unique enough to trace it down...

Try version 1.7. I tried to make it smart, so the format is always kept, rather than just truncating it plainly. See the readme.

Works like a champ, thanks!