fix(plugin): remediate ML-07 R2 findings
This commit is contained in:
@@ -46,6 +46,28 @@ function operations(): DataServiceOperations {
|
||||
}
|
||||
|
||||
describe('Data Service plugin adapter', () => {
|
||||
it('validates the parsed tool supplied by the capability registry', async () => {
|
||||
const dataService = operations();
|
||||
const adapter = createDataServicePluginAdapter(dataService);
|
||||
const inspect = DATA_SERVICE_TOOL_DEFINITIONS.find(({ name }) => name === 'data_service_inspect');
|
||||
if (!inspect) throw new Error('inspect definition missing');
|
||||
|
||||
const result = await adapter.invoke(context, {
|
||||
...inspect,
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
additionalProperties: false,
|
||||
required: ['registry_token'],
|
||||
properties: { registry_token: { type: 'string', minLength: 1 } },
|
||||
},
|
||||
}, {});
|
||||
|
||||
expect(result).toMatchObject({
|
||||
success: false, status: 422, code: 'plugin_input_invalid', data: null,
|
||||
});
|
||||
expect(dataService.inspect).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('maps all ten package operations through DataServiceOperations', async () => {
|
||||
const dataService = operations();
|
||||
const adapter = createDataServicePluginAdapter(dataService);
|
||||
|
||||
Reference in New Issue
Block a user