mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
Guard pairing token renewal against concurrent edits and cap pairing names
This commit is contained in:
1 parent
3c7bc80988
commit
12dab07b87
4 files changed
+65
-3
No files matched your search
@@ -130,6 +130,16 @@ describe('parseOpenCodeConnectLink', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('caps a long QR payload name to the create request maximum', () => {
|
||||
const payload = JSON.stringify({
|
||||
code: 'abc',
|
||||
urls: ['https://abc.def.opentunnel.xyz'],
|
||||
name: 'n'.repeat(150),
|
||||
})
|
||||
|
||||
expect(parseOpenCodeConnectLink(payload)?.name).toBe('n'.repeat(100))
|
||||
})
|
||||
|
||||
it.each([
|
||||
['no urls', JSON.stringify({ code: 'abc', urls: [] })],
|
||||
['a non-string url', JSON.stringify({ code: 'abc', urls: [42] })],
|
||||
|
||||
Reference in new issue
Block a user