Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 03:37 UTC
| 1 | import { describe, expect, test } from 'bun:test'; |
| 2 | |
| 3 | import { normalizeNoAuthSecurity } from '../../lib/openapi'; |
| 4 | |
| 5 | describe('normalizeNoAuthSecurity', () => { |
| 6 | test('removes the no_auth sentinel without discarding real alternatives', () => { |
| 7 | const document = { |
| 8 | paths: { |
| 9 | '/public': { |
| 10 | get: { |
| 11 | security: [{ no_auth: [] }], |
| 12 | }, |
| 13 | }, |
| 14 | '/mixed': { |
| 15 | post: { |
| 16 | security: [{ no_auth: [] }, { bearer: [] }], |
| 17 | }, |
| 18 | }, |
| 19 | }, |
| 20 | }; |
| 21 | |
| 22 | normalizeNoAuthSecurity(document); |
| 23 | |
| 24 | expect(document.paths['/public'].get.security).toEqual([]); |
| 25 | expect(document.paths['/mixed'].post.security).toEqual([{ bearer: [] }]); |
| 26 | }); |
| 27 | }); |