[code generated by opus 5.5, reviewed by me, i found the tests maybe excessive but not useless]
Scopes::new and Scope::parse reject valid repo scopes that name their collection with the collection query parameter instead of positionally. my project sister-radio failed to start with these scopes, which @atcute/oauth-types generates:
- repo?collection=fm.teal.feed.play&collection=app.bsky.feed.post&action=create
- repo?collection=fm.teal.actor.status&action=create&action=update
the error was invalid OAuth scopes: Parse error: error in ``: regex failure - invalid. the parser treated the empty text before "?" as the collection and failed NSID validation, and never read the collection parameter.
the patch reads the collection either from after the colon or from the collection query parameters. it also rejects no collection at all and ones that give the collection both after the colon and as a parameter, like repo:a?collection=b per spec https://github.com/bluesky-social/atproto-website/blob/main/src/app/%5Blocale%5D/specs/permission/en.mdx#repo
theres also a regression in 0.12 where the generated code produces unused warnings