Has anyone seen a change to the AWS API pagination system lately? I can't find any documentation about a change, the API docs still say the returned token should be between 1 and 1024 characters. But I'm making calls to the :cloudformation API and getting results back with a :NextToken that is 1076 characters long, and then a spec error from Cognitect when I try to apply that to the next request because it's outside spec
we have noticed some change in the structure of ec2 describe instances api calls too.
I have no idea if it would actually work as a token value, because I haven't looked into overriding the spec yet
Can you work around the spec check by turning off validation?
(aws/validate-requests my-aws-api-client false)Ooh, I didn't even know you could do that. Thanks!
Yup! That worked 🙂 Thanks!
So I would say this is a bug in the lib, but given that AWS's own spec says it shouldn't be possible for that field to be that long, I'm going to point the finger very firmly at them...
Do you have a link to that spec handy?
Aah, I wasn't actually using that in the 'official' context. I was going off https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackResources.html I am trying to find the schema that presumably is also what Cognitect build the Clojure SDK from, but I've not found it yet
I was just looking for that, too. https://github.com/aws/aws-sdk-js/blob/3d94bab2d0881471606847df507cc9fe53bd9bf8/apis/cloudformation-2010-05-15.normal.json#L4436-L4440 (the latest commit as of this writing). Looks like it still specifies a max of 1024.
I have no idea what has made this particular token very long, as I have several other stacks where the call works because the token comes back 900-odd chars, so I suspect it'll be pretty hard for you to reproduce. I can try and raise a ticket with AWS support? Although at the level we have I don't know how much attention they'll pay
Just so I'm clear: even though this next token value has length 1076, you are able to pass it in a subsequent request to AWS, and it works? You get the next page of results? The token seems to function as a valid token, from Amazon's point-of-view? In that case, yes, it sure seems to be a bug on their end.
Correct
Validation shouldn’t be enabled by default
I've gone and had a poke. We have an internal lib which sets up a client, adds some additional credential providers for web identity tokens and the like. That is explicitly turning it on. I'll have to make that optional 🙂