Similar to T260636: OAuth doesn't validate length of grants fields/T277379: OAuth doesn't validate length of oarc_grants and oarc_oauth2_allowed_grants JSON, and T260633: BotPasswords doesn't validate length of resultant bp_grants JSON before it, we should add validation that the length of oathauth_devices.oad_data doesn't end up larger than the maximum length:
{ "name": "oad_data", "comment": "Data", "type": "blob", "options": { "length": 65530, "notnull": false } }
Useful for T108255: Enable MariaDB/MySQL's Strict Mode down the line for WMF wikis, but also prevents issues in dev wikis etc.
As it is possible to also set OATHMaxRecoveryCodesCount and OATHRecoveryCodesCount to large values, it is possible for this overflow the length of the DB field.
While this is mostly theoretical, 10 encrypted recovery codes takes up 664 characters.
A recovery code when encrypted takes 59 characters, so (65530-664)/59 would be ~1100 more (encrypted) recovery codes to be somewhere near the limit.
This is without other changes to the schema or similar in the future, which may increase the data size in other ways.