backblaze icon indicating copy to clipboard operation
backblaze copied to clipboard

Resiliency to newly-added capabilities

Open logiclrd opened this issue 1 year ago • 3 comments

Backblaze periodically adds new "capabilities" to the B2 API. The current strategy for parsing the models associated with successful logins requires all capabilities to be recognized. This breaks the library every time it happens. This PR aims to provide resiliency to this situation, by making the raw parsing of the "Allowed" structure in new type AllowedRaw just use a list of strings for the capabilities, and then later sorting them into known and unknown capabilities for the actual Allowed object returned by the Connect call.

logiclrd avatar Oct 08 '24 07:10 logiclrd

@logiclrd Thanks again for your contribution. I will take a look that these pull requests this weekend. You don't by any chance have any test cases for these additions?

microcompiler avatar Oct 10 '24 11:10 microcompiler

I tested them by hand, by temporarily undoing the previous PR that added the new capabilities for bucket notifications. I'll have to look into whether there's a simple way to test this from the other side...

logiclrd avatar Oct 10 '24 12:10 logiclrd

@microcompiler There you go. :-)

logiclrd avatar Oct 10 '24 16:10 logiclrd