test: раскрытие сервисов в role-compile, права на корень и заимствованные объекты

Кейсы: раскрытие HTTP- и веб-сервиса, раскрытие сервиса интеграции, раскрытие
заимствованного сервиса, дедупликация раскрытого листа с явным, отказ без
метаданных, отказ основной роли расширения, право на корень сервиса в
role-validate и в cfe-validate.

Фикстуры HTTP- и веб-сервиса строит preRun через meta-compile — рукописный XML
платформа отвергала (у Operation обязателен замыкающий ChildObjects, у сервиса
нужен Ext/Module.bsl). Оба кейса проходят verify-snapshots: 1С принимает
конфигурацию с раскрытыми правами при полной загрузке.

Вручную написаны только фикстуры, которые навыками не собрать, — сервис
интеграции (meta-compile его не поддерживает) и расширение с заимствованным
сервисом (выгрузка Конфигуратора); оба с skipPlatformVerify и причиной.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-08-17 16:54:08 +03:00
co-authored by Claude Opus 5
parent 9702a4c485
commit 261ea8c96d
55 changed files with 2470 additions and 0 deletions
@@ -0,0 +1,12 @@
{
"name": "Ошибка: основная роль расширения даёт права на заимствованный объект",
"setup": "fixture:adopted-in-default-role",
"params": { "extensionPath": "." },
"expectError": true,
"noSnapshot": "негативный кейс: навык ничего не пишет, проверяется текст и код возврата",
"expect": {
"stdoutContains": [
"Роль 'Расш1_ОсновнаяРоль' входит в DefaultRoles и даёт права на заимствованный HTTPService.ЭДО"
]
}
}
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<ConfigDumpInfo xmlns="http://v8.1c.ru/8.3/xcf/dumpinfo" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" format="Hierarchical" version="2.20">
<ConfigVersions>
<Metadata name="Configuration.Расширение1" id="397bd84b-3d37-4beb-8536-dba836ae92bd" configVersion="e7043a58cdb52bee32ce7203b307b1d906e6e0f6"/>
<Metadata name="HTTPService.Расш1_HTTPСервис1" id="6c941eed-1e98-4f99-acca-36ea67d496fd" configVersion="dace55e5b7d03787e0afd82b3a317a0ae5961c40">
<Metadata name="HTTPService.Расш1_HTTPСервис1.URLTemplate.ШаблонURL1.Method.Метод1" id="88695ffb-354b-489e-8526-dc13e16c66f7"/>
<Metadata name="HTTPService.Расш1_HTTPСервис1.URLTemplate.ШаблонURL1" id="c3736df9-c579-4fba-9172-44e83994aa9e"/>
</Metadata>
<Metadata name="HTTPService.Расш1_HTTPСервис1.Module" id="6c941eed-1e98-4f99-acca-36ea67d496fd.0" configVersion="991b3ccee21ed3b68db2970f9349b4a91ab3bdd4"/>
<Metadata name="HTTPService.ЭДО" id="f4c12d1d-3b1f-4b91-9140-6ac350f7b73a" configVersion="4cda642007e1bdf2d297f2dcc188658ef6d3eefa">
<Metadata name="HTTPService.ЭДО.URLTemplate.ЕстьНовыеДокументы" id="24778e70-17fe-4509-9aab-7a46bdfe30a6"/>
<Metadata name="HTTPService.ЭДО.URLTemplate.ЕстьНовыеДокументы.Method.POST" id="6253109e-d955-4efc-bcaf-94fed3f69dfc"/>
</Metadata>
<Metadata name="Language.Русский" id="eebce631-949d-40a3-9d4d-d51bc60f9579" configVersion="e74ea5ed9dcdd8a24f296934f27dccb8ad8f3f65"/>
<Metadata name="Role.Расш1_ОсновнаяРоль" id="5686fa70-df27-4c0e-b146-85a540b0d306" configVersion="f9d9315caa23d860de262485db126170f275bdba"/>
<Metadata name="Role.Расш1_ОсновнаяРоль.Rights" id="5686fa70-df27-4c0e-b146-85a540b0d306.0" configVersion="954648fd330f50c4422e9b6b732c5b6ef242c4e7"/>
<Metadata name="Role.Расш1_Роль1" id="37030a0a-9c9d-4423-8a24-162c4c615f34" configVersion="0e34d999ff7cc7fc86498eac6516bed86ec543e7"/>
<Metadata name="Role.Расш1_Роль1.Rights" id="37030a0a-9c9d-4423-8a24-162c4c615f34.0" configVersion="00455851a838119e5f674d0121e000390fa29a09"/>
</ConfigVersions>
</ConfigDumpInfo>
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.20">
<Configuration uuid="397bd84b-3d37-4beb-8536-dba836ae92bd">
<InternalInfo>
<xr:ContainedObject>
<xr:ClassId>9cd510cd-abfc-11d4-9434-004095e12fc7</xr:ClassId>
<xr:ObjectId>849f13e5-3711-47a6-a511-7abdbf69ac7d</xr:ObjectId>
</xr:ContainedObject>
<xr:ContainedObject>
<xr:ClassId>9fcd25a0-4822-11d4-9414-008048da11f9</xr:ClassId>
<xr:ObjectId>418e82dc-9ef8-4b8d-b25a-927607e1dcfc</xr:ObjectId>
</xr:ContainedObject>
<xr:ContainedObject>
<xr:ClassId>e3687481-0a87-462c-a166-9f34594f9bba</xr:ClassId>
<xr:ObjectId>1d719d73-2ee5-4c3b-a13e-0c6e9f241ee1</xr:ObjectId>
</xr:ContainedObject>
<xr:ContainedObject>
<xr:ClassId>9de14907-ec23-4a07-96f0-85521cb6b53b</xr:ClassId>
<xr:ObjectId>d0a4b93b-f5c5-4f3a-8e2b-39b04355a9ae</xr:ObjectId>
</xr:ContainedObject>
<xr:ContainedObject>
<xr:ClassId>51f2d5d8-ea4d-4064-8892-82951750031e</xr:ClassId>
<xr:ObjectId>5e044713-4d7d-4a70-8207-7a2ce7e05339</xr:ObjectId>
</xr:ContainedObject>
<xr:ContainedObject>
<xr:ClassId>e68182ea-4237-4383-967f-90c1e3370bc7</xr:ClassId>
<xr:ObjectId>9ba64f34-16f4-4c52-8588-722d900f0b0e</xr:ObjectId>
</xr:ContainedObject>
<xr:ContainedObject>
<xr:ClassId>fb282519-d103-4dd3-bc12-cb271d631dfc</xr:ClassId>
<xr:ObjectId>0c8f9b8d-6e16-4d99-b0f0-0c0a99ae9953</xr:ObjectId>
</xr:ContainedObject>
</InternalInfo>
<Properties>
<ObjectBelonging>Adopted</ObjectBelonging>
<Name>Расширение1</Name>
<Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Расширение1</v8:content>
</v8:item>
</Synonym>
<Comment/>
<ConfigurationExtensionPurpose>Customization</ConfigurationExtensionPurpose>
<KeepMappingToExtendedConfigurationObjectsByIDs>true</KeepMappingToExtendedConfigurationObjectsByIDs>
<NamePrefix>Расш1_</NamePrefix>
<ConfigurationExtensionCompatibilityMode>Version8_3_17</ConfigurationExtensionCompatibilityMode>
<DefaultRunMode>ManagedApplication</DefaultRunMode>
<UsePurposes>
<v8:Value xsi:type="app:ApplicationUsePurpose">PlatformApplication</v8:Value>
</UsePurposes>
<ScriptVariant>Russian</ScriptVariant>
<DefaultRoles>
<xr:Item xsi:type="xr:MDObjectRef">Role.Расш1_ОсновнаяРоль</xr:Item>
</DefaultRoles>
<Vendor/>
<Version/>
<DefaultLanguage>Language.Русский</DefaultLanguage>
<BriefInformation/>
<DetailedInformation/>
<Copyright/>
<VendorInformationAddress/>
<ConfigurationInformationAddress/>
<InterfaceCompatibilityMode>TaxiEnableVersion8_2</InterfaceCompatibilityMode>
</Properties>
<ChildObjects>
<Language>Русский</Language>
<Role>Расш1_ОсновнаяРоль</Role>
<Role>Расш1_Роль1</Role>
<HTTPService>ЭДО</HTTPService>
<HTTPService>Расш1_HTTPСервис1</HTTPService>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.20">
<HTTPService uuid="6c941eed-1e98-4f99-acca-36ea67d496fd">
<Properties>
<Name>Расш1_HTTPСервис1</Name>
<Synonym/>
<Comment/>
<RootURL>test</RootURL>
<ReuseSessions>AutoUse</ReuseSessions>
<SessionMaxAge>20</SessionMaxAge>
</Properties>
<ChildObjects>
<URLTemplate uuid="c3736df9-c579-4fba-9172-44e83994aa9e">
<Properties>
<Name>ШаблонURL1</Name>
<Synonym/>
<Comment/>
<Template>/*</Template>
</Properties>
<ChildObjects>
<Method uuid="88695ffb-354b-489e-8526-dc13e16c66f7">
<Properties>
<Name>Метод1</Name>
<Synonym/>
<Comment/>
<HTTPMethod>GET</HTTPMethod>
<Handler>ШаблонURL1Метод1</Handler>
</Properties>
</Method>
</ChildObjects>
</URLTemplate>
</ChildObjects>
</HTTPService>
</MetaDataObject>
@@ -0,0 +1,5 @@
Функция ШаблонURL1Метод1(Запрос)
Ответ = Новый HTTPСервисОтвет(200);
Возврат Ответ;
КонецФункции
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.20">
<HTTPService uuid="f4c12d1d-3b1f-4b91-9140-6ac350f7b73a">
<InternalInfo/>
<Properties>
<ObjectBelonging>Adopted</ObjectBelonging>
<Name>ЭДО</Name>
<Comment/>
<ExtendedConfigurationObject>2c3b27e6-6a40-446b-9e8f-eab3e6309aed</ExtendedConfigurationObject>
</Properties>
<ChildObjects>
<URLTemplate uuid="24778e70-17fe-4509-9aab-7a46bdfe30a6">
<InternalInfo/>
<Properties>
<ObjectBelonging>Adopted</ObjectBelonging>
<Name>ЕстьНовыеДокументы</Name>
<Comment/>
<ExtendedConfigurationObject>9f859b05-8d06-47bd-ac5b-b4f9ff1ebb03</ExtendedConfigurationObject>
</Properties>
<ChildObjects>
<Method uuid="6253109e-d955-4efc-bcaf-94fed3f69dfc">
<InternalInfo/>
<Properties>
<ObjectBelonging>Adopted</ObjectBelonging>
<Name>POST</Name>
<Comment/>
<ExtendedConfigurationObject>a582f07a-8972-4b6a-a7d0-0a562937dce1</ExtendedConfigurationObject>
</Properties>
</Method>
</ChildObjects>
</URLTemplate>
</ChildObjects>
</HTTPService>
</MetaDataObject>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.20">
<Language uuid="eebce631-949d-40a3-9d4d-d51bc60f9579">
<InternalInfo/>
<Properties>
<ObjectBelonging>Adopted</ObjectBelonging>
<Name>Русский</Name>
<Comment/>
<ExtendedConfigurationObject>0663bf5b-bcba-4a40-a862-a0b3baa2d884</ExtendedConfigurationObject>
<LanguageCode>ru</LanguageCode>
</Properties>
</Language>
</MetaDataObject>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.20">
<Role uuid="5686fa70-df27-4c0e-b146-85a540b0d306">
<Properties>
<Name>Расш1_ОсновнаяРоль</Name>
<Synonym/>
<Comment/>
</Properties>
</Role>
</MetaDataObject>
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Rights xmlns="http://v8.1c.ru/8.2/roles" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Rights" version="2.20">
<setForNewObjects>false</setForNewObjects>
<setForAttributesByDefault>true</setForAttributesByDefault>
<independentRightsOfChildObjects>false</independentRightsOfChildObjects>
<object>
<name>Configuration.Расширение1</name>
<right>
<name>ThinClient</name>
<value>true</value>
</right>
<right>
<name>WebClient</name>
<value>true</value>
</right>
<right>
<name>MobileClient</name>
<value>true</value>
</right>
<right>
<name>MainWindowModeNormal</name>
<value>true</value>
</right>
<right>
<name>MainWindowModeWorkplace</name>
<value>true</value>
</right>
<right>
<name>MainWindowModeEmbeddedWorkplace</name>
<value>true</value>
</right>
<right>
<name>MainWindowModeFullscreenWorkplace</name>
<value>true</value>
</right>
<right>
<name>MainWindowModeKiosk</name>
<value>true</value>
</right>
<right>
<name>AnalyticsSystemClient</name>
<value>true</value>
</right>
<right>
<name>SaveUserData</name>
<value>true</value>
</right>
<right>
<name>Output</name>
<value>true</value>
</right>
</object>
<object>
<name>HTTPService.ЭДО.URLTemplate.ЕстьНовыеДокументы.Method.POST</name>
<right>
<name>Use</name>
<value>true</value>
</right>
</object>
<object>
<name>HTTPService.Расш1_HTTPСервис1.URLTemplate.ШаблонURL1.Method.Метод1</name>
<right>
<name>Use</name>
<value>true</value>
</right>
</object>
</Rights>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.20">
<Role uuid="37030a0a-9c9d-4423-8a24-162c4c615f34">
<Properties>
<Name>Расш1_Роль1</Name>
<Synonym/>
<Comment/>
</Properties>
</Role>
</MetaDataObject>
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Rights xmlns="http://v8.1c.ru/8.2/roles" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Rights" version="2.20">
<setForNewObjects>false</setForNewObjects>
<setForAttributesByDefault>true</setForAttributesByDefault>
<independentRightsOfChildObjects>false</independentRightsOfChildObjects>
<object>
<name>Configuration.Расширение1</name>
<right>
<name>ThinClient</name>
<value>true</value>
</right>
<right>
<name>WebClient</name>
<value>true</value>
</right>
<right>
<name>MobileClient</name>
<value>true</value>
</right>
<right>
<name>MainWindowModeNormal</name>
<value>true</value>
</right>
<right>
<name>MainWindowModeWorkplace</name>
<value>true</value>
</right>
<right>
<name>MainWindowModeEmbeddedWorkplace</name>
<value>true</value>
</right>
<right>
<name>MainWindowModeFullscreenWorkplace</name>
<value>true</value>
</right>
<right>
<name>MainWindowModeKiosk</name>
<value>true</value>
</right>
<right>
<name>AnalyticsSystemClient</name>
<value>true</value>
</right>
<right>
<name>SaveUserData</name>
<value>true</value>
</right>
<right>
<name>Output</name>
<value>true</value>
</right>
</object>
<object>
<name>HTTPService.ЭДО.URLTemplate.ЕстьНовыеДокументы.Method.POST</name>
<right>
<name>Use</name>
<value>true</value>
</right>
</object>
<object>
<name>HTTPService.Расш1_HTTPСервис1.URLTemplate.ШаблонURL1.Method.Метод1</name>
<right>
<name>Use</name>
<value>true</value>
</right>
</object>
</Rights>