Skip to main content
Glama
fixtures.ts3.76 kB
export const dangerousStrings = { scriptTag: '<script>alert("XSS")</script>', javascriptProtocol: '<a href="javascript:alert(\'XSS\')">Click me</a>', eventHandler: '<img src="x" onerror="alert(\'XSS\');">', iframeTag: '<iframe src="http://example.com"></iframe>', unclosedTag: '<b>hello', }; export const safeStrings = { plainText: 'This is a safe string.', withFormatting: '<b>This is bold</b> and <i>this is italic</i>.', withLinks: '<a href="https://example.com" title="Example">Example Link</a>', textWithNumbers: 'Here are some numbers 12345', }; export const cryptoTestData = { shortText: 'Hello, World!', longText: 'This is a longer piece of text that will be used for testing encryption and decryption functions to ensure they work correctly with larger data blocks.', objectToEncrypt: { id: 'user-123', name: 'John Doe', permissions: ['read', 'write'], }, }; export const temporaryTokenTestCases = [ { description: 'should generate and validate a standard token', payload: { userId: 'abc' }, durationSeconds: 60, expectedValid: true, }, { description: 'should fail validation for an expired token', payload: { userId: 'def' }, durationSeconds: -1, expectedValid: false, }, { description: 'should fail validation for a token with wrong secret', payload: { userId: 'ghi' }, durationSeconds: 60, secret: 'wrong-secret', expectedValid: false, }, ]; export const getMockClientCapabilities = (overrides = {}) => ({ protocolVersion: '2024-11-05', tools: { list: true, execute: true, versions: ['1.0', '2.0-alpha'], }, authentication: { supported: ['oauth2', 'apiKey'], required: true, }, ...overrides, }); export const capabilityNegotiationTestCases = [ { description: 'should accept client with exact same capabilities', clientCaps: getMockClientCapabilities(), expected: { protocolVersion: '2024-11-05', tools: { call: true, list: true, listChanged: true, subscribe: true }, resources: { get: true, put: true, delete: true, listChanged: true, subscribe: true }, prompts: { get: true, list: true, listChanged: true, subscribe: true }, logging: { level: 'info', subscribe: true } }, }, { description: 'should reject client with unsupported auth', clientCaps: getMockClientCapabilities({ authentication: { supported: ['none'] } }), expected: { protocolVersion: '2024-11-05', tools: { call: true, list: true, listChanged: true, subscribe: true }, resources: { get: true, put: true, delete: true, listChanged: true, subscribe: true }, prompts: { get: true, list: true, listChanged: true, subscribe: true }, logging: { level: 'info', subscribe: true } }, }, { description: 'should select highest common tool version', clientCaps: getMockClientCapabilities({ tools: { versions: ['0.5', '1.0', '1.5-beta'] } }), expected: { protocolVersion: '2024-11-05', tools: { call: true, list: true, listChanged: true, subscribe: true }, resources: { get: true, put: true, delete: true, listChanged: true, subscribe: true }, prompts: { get: true, list: true, listChanged: true, subscribe: true }, logging: { level: 'info', subscribe: true } }, }, ];

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/learnwithcc/tally-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server