diff options
author | cerevra <cerevra@yandex-team.ru> | 2022-02-10 16:45:58 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:58 +0300 |
commit | bf41dd01f6c920583e9faae7cd55ed25e547e052 (patch) | |
tree | ec7c8c285ffa648a5c5efeff453787a15ab811ac | |
parent | e2c3e3004f7cd68441cefcfa4aaccd3d8051c846 (diff) | |
download | ydb-bf41dd01f6c920583e9faae7cd55ed25e547e052.tar.gz |
Restoring authorship annotation for <cerevra@yandex-team.ru>. Commit 1 of 2.
1898 files changed, 25403 insertions, 25403 deletions
diff --git a/build/docs/all.md b/build/docs/all.md index 50051b596c..12cacc2d3d 100644 --- a/build/docs/all.md +++ b/build/docs/all.md @@ -1026,7 +1026,7 @@ Available allocators are: "LF", "LF\_YT", "LF\_DBG", "YT", "J", "B", "BM", "C", - J - The JEMalloc allocator (https://a.yandex-team.ru/arc/trunk/arcadia/library/malloc/jemalloc) - B - The balloc allocator named Pyotr Popov and Anton Samokhvalov - Discussion: https://ironpeter.at.yandex-team.ru/replies.xml?item\_no=126 - - Code: https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/balloc + - Code: https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/balloc - BM - The balloc for market (agri@ commits from july 2018 till November 2018 saved) - C - Like B, but can be disabled for each thread to LF or SYSTEM one (B can be disabled only to SYSTEM) - MIM - Microsoft's mimalloc (actual version) (https://a.yandex-team.ru/arc/trunk/arcadia/library/malloc/mimalloc) diff --git a/build/docs/readme.md b/build/docs/readme.md index 3db0a653c7..c1e8e9253f 100644 --- a/build/docs/readme.md +++ b/build/docs/readme.md @@ -758,7 +758,7 @@ Available allocators are: "LF", "LF\_YT", "LF\_DBG", "YT", "J", "B", "BM", "C", - J - The JEMalloc allocator (https://a.yandex-team.ru/arc/trunk/arcadia/library/malloc/jemalloc) - B - The balloc allocator named Pyotr Popov and Anton Samokhvalov - Discussion: https://ironpeter.at.yandex-team.ru/replies.xml?item\_no=126 - - Code: https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/balloc + - Code: https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/balloc - BM - The balloc for market (agri@ commits from july 2018 till November 2018 saved) - C - Like B, but can be disabled for each thread to LF or SYSTEM one (B can be disabled only to SYSTEM) - MIM - Microsoft's mimalloc (actual version) (https://a.yandex-team.ru/arc/trunk/arcadia/library/malloc/mimalloc) diff --git a/build/plugins/res.py b/build/plugins/res.py index a937caba81..d0cc9da08c 100644 --- a/build/plugins/res.py +++ b/build/plugins/res.py @@ -35,7 +35,7 @@ def remove_prefix(text, prefix): def onfat_resource(unit, *args): - unit.onpeerdir(['library/cpp/resource']) + unit.onpeerdir(['library/cpp/resource']) # Since the maximum length of lpCommandLine string for CreateProcess is 8kb (windows) characters, # we make several calls of rescompiler diff --git a/build/plugins/xsyn.py b/build/plugins/xsyn.py index ab7c1639db..7b2bb582d5 100644 --- a/build/plugins/xsyn.py +++ b/build/plugins/xsyn.py @@ -15,9 +15,9 @@ class Xsyn(iw.CustomCommand): def input(self): return common.make_tuples([ - '$S/library/cpp/xml/parslib/xsyn2ragel.py', + '$S/library/cpp/xml/parslib/xsyn2ragel.py', self._path, - '$S/library/cpp/xml/parslib/xmlpars.xh' + '$S/library/cpp/xml/parslib/xmlpars.xh' ]) def output(self): diff --git a/build/rules/contrib_deps.policy b/build/rules/contrib_deps.policy index 9af4b85cc2..a3caf067e1 100644 --- a/build/rules/contrib_deps.policy +++ b/build/rules/contrib_deps.policy @@ -5,9 +5,9 @@ ALLOW contrib -> library/python/resource ALLOW contrib -> library/cpp/testing/unittest_main ALLOW contrib -> library/cpp/testing/unittest ALLOW contrib -> library/cpp/getopt -ALLOW contrib -> library/cpp/resource -ALLOW contrib -> library/cpp/charset -ALLOW contrib -> library/cpp/svnversion +ALLOW contrib -> library/cpp/resource +ALLOW contrib -> library/cpp/charset +ALLOW contrib -> library/cpp/svnversion ALLOW contrib -> certs ALLOW contrib/libs/.*/ut -> library ALLOW contrib/java/.*/ut -> devtools/jtest @@ -37,18 +37,18 @@ ALLOW contrib/python/python-magic -> library/python/symbols/libmagic ALLOW contrib/python/typecode -> library/python/symbols/libmagic ALLOW contrib/tools/jdk/test -> devtools/ya/yalibrary/tools ALLOW contrib/libs/clang12/tools/extra/clang-tidy/tool -> library/cpp/clang_tidy -ALLOW contrib/libs/inja -> library/cpp/scheme +ALLOW contrib/libs/inja -> library/cpp/scheme ALLOW contrib/libs/geos/capi/ctypes -> library/python/ctypes -ALLOW contrib/libs/leveldb -> library/cpp/deprecated/mapped_file -ALLOW contrib/libs/leveldb -> library/cpp/logger -ALLOW contrib/libs/leveldb -> library/cpp/digest/crc32c -ALLOW contrib/libs/lua -> library/cpp/archive -ALLOW contrib/libs/phonedetect/src -> library/cpp/digest/md5 +ALLOW contrib/libs/leveldb -> library/cpp/deprecated/mapped_file +ALLOW contrib/libs/leveldb -> library/cpp/logger +ALLOW contrib/libs/leveldb -> library/cpp/digest/crc32c +ALLOW contrib/libs/lua -> library/cpp/archive +ALLOW contrib/libs/phonedetect/src -> library/cpp/digest/md5 ALLOW contrib/python/certifi -> library/python/certifi ALLOW contrib/python/horovod/horovod/common/syms -> library/python/symbols/registry -ALLOW contrib/python/opensfm -> library/cpp/vl_feat +ALLOW contrib/python/opensfm -> library/cpp/vl_feat ALLOW contrib/python/Wand/ImageMagick -> library/python/symbols/registry -ALLOW contrib/nginx/modules/nginx-rtmp-module -> library/cpp/json +ALLOW contrib/nginx/modules/nginx-rtmp-module -> library/cpp/json ALLOW contrib/python/gino -> library/python/pyscopg2 ALLOW contrib/python/psycopg2/tests -> mail/devpack ALLOW contrib/python/asn1crypto -> library/python/symbols/crypto diff --git a/build/rules/contrib_python.policy b/build/rules/contrib_python.policy index 60fd149753..05d1b92b0b 100644 --- a/build/rules/contrib_python.policy +++ b/build/rules/contrib_python.policy @@ -142,7 +142,7 @@ ALLOW maps/streetview/backoffice/lib -> contrib/python/MySQL-python ALLOW market/sre/tools/cs_mysql_monitoring/mysql_monitoring -> contrib/python/MySQL-python ALLOW metrika/core/monitoring/mobile-logs-api-export-generator-check -> contrib/python/MySQL-python ALLOW passport/backend/social -> contrib/python/MySQL-python -ALLOW passport/infra/daemons/yasmsapi/db -> contrib/python/MySQL-python +ALLOW passport/infra/daemons/yasmsapi/db -> contrib/python/MySQL-python ALLOW testenv/core -> contrib/python/MySQL-python ALLOW testenv/recipes/ut -> contrib/python/MySQL-python # avia task to migrate from MySQL-python https://st.yandex-team.ru/RASPTICKETS-18201 @@ -222,7 +222,7 @@ ALLOW mds/s3/s3_mds_proxy -> contrib/python/pycrypto ALLOW metrika/core -> contrib/python/pycrypto ALLOW mlp/mail -> contrib/python/pycrypto ALLOW mssngr/router/tools/export_legacy_messages -> contrib/python/pycrypto -ALLOW passport/infra/daemons/blackbox/ut/totp_manual/tests -> contrib/python/pycrypto +ALLOW passport/infra/daemons/blackbox/ut/totp_manual/tests -> contrib/python/pycrypto ALLOW quality/functionality/turbo/merger/ut/medium -> contrib/python/pycrypto ALLOW samogon -> contrib/python/pycrypto ALLOW sandbox/common -> contrib/python/pycrypto @@ -540,7 +540,7 @@ ALLOW passport/backend/vault/api/tests/models -> contrib/python/sqlalchemy/sqlal ALLOW passport/backend/vault/api/tests/views/secrets -> contrib/python/sqlalchemy/sqlalchemy-1.2 ALLOW passport/backend/vault/api/tests/views -> contrib/python/sqlalchemy/sqlalchemy-1.2 ALLOW passport/backend/vault/api -> contrib/python/sqlalchemy/sqlalchemy-1.2 -ALLOW passport/infra/daemons/yasmsapi/db -> contrib/python/sqlalchemy/sqlalchemy-1.2 +ALLOW passport/infra/daemons/yasmsapi/db -> contrib/python/sqlalchemy/sqlalchemy-1.2 ALLOW quality/ab_testing/scripts/ems -> contrib/python/sqlalchemy/sqlalchemy-1.2 ALLOW quality/ab_testing/tools/postgres_local/tests_recipe -> contrib/python/sqlalchemy/sqlalchemy-1.2 ALLOW quality/ab_testing/tools/postgres_local -> contrib/python/sqlalchemy/sqlalchemy-1.2 diff --git a/build/rules/contrib_restricted.policy b/build/rules/contrib_restricted.policy index a83ead1904..3d95f3c853 100644 --- a/build/rules/contrib_restricted.policy +++ b/build/rules/contrib_restricted.policy @@ -33,11 +33,11 @@ ALLOW clickhouse -> contrib/restricted/abseil-cpp ALLOW clickhouse -> contrib/restricted/turbo_base64 # For HBase client: CONTRIB-1790 -ALLOW passport/infra -> contrib/restricted/thrift - -# keyutils is LGPL: CONTRIB-2236 -ALLOW passport/infra -> contrib/restricted/keyutils +ALLOW passport/infra -> contrib/restricted/thrift +# keyutils is LGPL: CONTRIB-2236 +ALLOW passport/infra -> contrib/restricted/keyutils + # For Apache Arrow: CONTRIB-1662 ALLOW mds -> contrib/restricted/uriparser @@ -78,7 +78,7 @@ ALLOW speechkit -> contrib/restricted/openal-soft ALLOW dict/mt/video -> contrib/restricted/rubberband # Allowed subset of abseil is exported via library/ -ALLOW library/cpp/containers/absl_flat_hash -> contrib/restricted/abseil-cpp/absl/container +ALLOW library/cpp/containers/absl_flat_hash -> contrib/restricted/abseil-cpp/absl/container ALLOW library/cpp/containers/absl_tstring_flat_hash -> contrib/restricted/abseil-cpp-tstring/y_absl/container # spdlog is just yet another best logging engine diff --git a/build/rules/go/vendor.policy b/build/rules/go/vendor.policy index 3e9c0acada..d4aa20fd9a 100644 --- a/build/rules/go/vendor.policy +++ b/build/rules/go/vendor.policy @@ -287,9 +287,9 @@ ALLOW .* -> vendor/github.com/Masterminds/squirrel # isatty for golang ALLOW .* -> vendor/github.com/mattn/go-isatty -# go-sqlite3 for golang -ALLOW .* -> vendor/github.com/mattn/go-sqlite3 - +# go-sqlite3 for golang +ALLOW .* -> vendor/github.com/mattn/go-sqlite3 + # complete and usable DNS library ALLOW .* -> vendor/github.com/miekg/dns @@ -404,9 +404,9 @@ ALLOW .* -> vendor/golang.org/x/image/webp # less experimental implementation of Go error inspection ALLOW .* -> vendor/golang.org/x/xerrors -# golang.org/x/sys required for SO_REUSEPORT, for example -ALLOW .* -> vendor/golang.org/x/sys - +# golang.org/x/sys required for SO_REUSEPORT, for example +ALLOW .* -> vendor/golang.org/x/sys + ALLOW .* -> vendor/golang.org/x/mod # basic LDAP v3 functionality for the GO programming language diff --git a/build/rules/library_deprecated.policy b/build/rules/library_deprecated.policy index af1eb06386..4ad53c084c 100644 --- a/build/rules/library_deprecated.policy +++ b/build/rules/library_deprecated.policy @@ -2,215 +2,215 @@ ALLOW kernel/geo -> library/cpp/deprecated/small_array ALLOW ysite/yandex/clicks -> library/cpp/deprecated/small_array ALLOW ysite/yandex/indexuser -> library/cpp/deprecated/small_array DENY .* -> library/cpp/deprecated/small_array - + ALLOW jupytercloud/arcadia_kernel -> library/python/clickhouse_client ALLOW market/idx/export/mbi_qdata_reporter/bin -> library/python/clickhouse_client ALLOW sandbox/projects/oko -> library/python/clickhouse_client ALLOW statbox/python-statinfra -> library/python/clickhouse_client ALLOW quality/ab_testing/cofe/bin/lib/files/py2/cofe_kernel_yql -> library/python/clickhouse_client DENY .* -> library/python/clickhouse_client - -# ticket_parser2 -# TODO: drop temporary rule with entire library: PASSP-30786 -DENY .* -> library/java/ticket_parser2 - -# please use https://a.yandex-team.ru/arc/trunk/arcadia/library/python/tvmauth instead -# https://clubs.at.yandex-team.ru/passport/3619 -ALLOW addappter/backend/addappter -> library/python/deprecated/ticket_parser2 -ALLOW ads/bsyeti/bb_viewer/viewer -> library/python/deprecated/ticket_parser2 -ALLOW ads/bsyeti/caesar/tools/logtests/samplers -> library/python/deprecated/ticket_parser2 -ALLOW ads/bsyeti/tests/test_lib/data_collector -> library/python/deprecated/ticket_parser2 -ALLOW ads/bsyeti/tools/bb_requester -> library/python/deprecated/ticket_parser2 -ALLOW alice/uniproxy/library/auth -> library/python/deprecated/ticket_parser2 -ALLOW alice/uniproxy/library/integration_tests -> library/python/deprecated/ticket_parser2 -ALLOW alice/vins/apps/navi -> library/python/deprecated/ticket_parser2 -ALLOW analytics/geo/navi/team-x-vin-transfer -> library/python/deprecated/ticket_parser2 -ALLOW analytics/images/upload_urls_to_avatars -> library/python/deprecated/ticket_parser2 -ALLOW antiadblock/argus/result_agregate_task -> library/python/deprecated/ticket_parser2 -ALLOW antiadblock/configs_api/lib -> library/python/deprecated/ticket_parser2 -ALLOW antiadblock/cryprox/cryprox -> library/python/deprecated/ticket_parser2 -ALLOW antiadblock/monrelay -> library/python/deprecated/ticket_parser2 -ALLOW antiadblock/tasks/autoredirect_data -> library/python/deprecated/ticket_parser2 -ALLOW antiadblock/tasks/change_current_cookie -> library/python/deprecated/ticket_parser2 -ALLOW antiadblock/tasks/configs_stub_server -> library/python/deprecated/ticket_parser2 -ALLOW antiadblock/tasks/decrypt_url_configs -> library/python/deprecated/ticket_parser2 -ALLOW antiadblock/tasks/experiments/lib -> library/python/deprecated/ticket_parser2 -ALLOW antiadblock/tasks/gdpr_aab_cookies -> library/python/deprecated/ticket_parser2 -ALLOW antiadblock/tasks/money_tickets_updater/plugins -> library/python/deprecated/ticket_parser2 -ALLOW antiadblock/tasks/tools -> library/python/deprecated/ticket_parser2 -ALLOW antiadblock/tasks/update_lj_custom_domains -> library/python/deprecated/ticket_parser2 -ALLOW antirobot/captcha/captcha_test_service/bin -> library/python/deprecated/ticket_parser2 -ALLOW antirobot/cbb/cbb_django/cbb/views -> library/python/deprecated/ticket_parser2 -ALLOW antirobot/scripts/parsers/cbb_api_clear_from_dump -> library/python/deprecated/ticket_parser2 -ALLOW antirobot/scripts/parsers/cbb_api_example -> library/python/deprecated/ticket_parser2 -ALLOW antirobot/scripts/parsers/upload_ip_to_cbb -> library/python/deprecated/ticket_parser2 -ALLOW april/common -> library/python/deprecated/ticket_parser2 -ALLOW april/etl/utils -> library/python/deprecated/ticket_parser2 -ALLOW april/tools/clients/tvm_client -> library/python/deprecated/ticket_parser2 -ALLOW billing/bcl/src/tests/regression -> library/python/deprecated/ticket_parser2 -ALLOW billing/dcs/dcs -> library/python/deprecated/ticket_parser2 -ALLOW cloud/bootstrap/api/src/backend -> library/python/deprecated/ticket_parser2 -ALLOW cloud/marketplace/queue/yc_marketplace_queue -> library/python/deprecated/ticket_parser2 -ALLOW cloud/mdb/dbm/internal -> library/python/deprecated/ticket_parser2 -ALLOW cmnt/tools/regression/lib -> library/python/deprecated/ticket_parser2 -ALLOW cmnt/tools/request_generator -> library/python/deprecated/ticket_parser2 -ALLOW cv/cbir_search/yt_classifier/image_tools -> library/python/deprecated/ticket_parser2 -ALLOW datacloud/dev_utils/tvm -> library/python/deprecated/ticket_parser2 -ALLOW datacloud/log_reader/lib -> library/python/deprecated/ticket_parser2 -ALLOW datalens/backend/app/bi_billing -> library/python/deprecated/ticket_parser2 -ALLOW datalens/backend/lib/bi_core -> library/python/deprecated/ticket_parser2 -ALLOW devtools/experimental/tvm2 -> library/python/deprecated/ticket_parser2 -ALLOW devtools/experimental/xprod/score_api -> library/python/deprecated/ticket_parser2 -ALLOW devtools/qafw/selenium/lb_sender -> library/python/deprecated/ticket_parser2 -ALLOW devtools/yanotifybot/server/lib -> library/python/deprecated/ticket_parser2 -ALLOW dict/mt/web/misc/identity -> library/python/deprecated/ticket_parser2 -ALLOW dict/mt/web/misc/takeout -> library/python/deprecated/ticket_parser2 -ALLOW district/scripts/nirvana_actions_lb_writer -> library/python/deprecated/ticket_parser2 -ALLOW district/scripts/push_triggers_to_lb -> library/python/deprecated/ticket_parser2 -ALLOW dj/services/ecom/lib/pymiddle_turbo_requester -> library/python/deprecated/ticket_parser2 -ALLOW drive/analytics/pybase/helpers -> library/python/deprecated/ticket_parser2 -ALLOW education/lib/clients -> library/python/deprecated/ticket_parser2 -ALLOW entity/ontodb/tasks/import_persons_to_saas/lib -> library/python/deprecated/ticket_parser2 -ALLOW entity/ugc/db/python/client -> library/python/deprecated/ticket_parser2 -ALLOW entity/ugc/nirvana/utils/yt -> library/python/deprecated/ticket_parser2 -ALLOW entity/ugc/robot/tools/achivery/lib -> library/python/deprecated/ticket_parser2 -ALLOW entity/ugc/robot/tools/antispam/lib -> library/python/deprecated/ticket_parser2 -ALLOW entity/ugc/robot/tools/ugcdb/ugcdb_uploader -> library/python/deprecated/ticket_parser2 -ALLOW entity/ugc/tools/comments/business_reply_fix_util -> library/python/deprecated/ticket_parser2 -ALLOW entity/ugc/tools/nirvana/blackbox -> library/python/deprecated/ticket_parser2 -ALLOW entity/ugc/tools/nirvana/comments/init_commentator_chat -> library/python/deprecated/ticket_parser2 -ALLOW entity/ugc/tools/nirvana/comments/wait_comment_moderation -> library/python/deprecated/ticket_parser2 -ALLOW entity/ugc/tools/nirvana/enricher/lib -> library/python/deprecated/ticket_parser2 -ALLOW entity/ugc/tools/nirvana/ugcdb/lib -> library/python/deprecated/ticket_parser2 -ALLOW entity/ugc/tools/viewer_server/lib -> library/python/deprecated/ticket_parser2 -ALLOW ether/ether_common -> library/python/deprecated/ticket_parser2 -ALLOW ether/zen/highlights/ugc/highlight_importer -> library/python/deprecated/ticket_parser2 -ALLOW ether/zen/highlights/vh/video_exporter -> library/python/deprecated/ticket_parser2 -ALLOW ether/zen/zen_tools -> library/python/deprecated/ticket_parser2 -ALLOW extsearch/geo/conveyors/gdpr/takeout_daemon -> library/python/deprecated/ticket_parser2 -ALLOW extsearch/geo/conveyors/gdpr/uploader -> library/python/deprecated/ticket_parser2 -ALLOW extsearch/video/quality/recommender/tools/zen_load -> library/python/deprecated/ticket_parser2 -ALLOW extsearch/video/robot/crawling/stevenson/backend/bin/webapp -> library/python/deprecated/ticket_parser2 -ALLOW extsearch/video/ugc/sqs_moderation/clients -> library/python/deprecated/ticket_parser2 -ALLOW extsearch/video/vh/ydb/lb2ydb -> library/python/deprecated/ticket_parser2 -ALLOW extsearch/wizards/fastres2/tools/data_delivery/rtmr/delivery/common -> library/python/deprecated/ticket_parser2 -ALLOW geoproduct/external_cc_events/app -> library/python/deprecated/ticket_parser2 -ALLOW geoproduct/price_info_proxy/app -> library/python/deprecated/ticket_parser2 -ALLOW haas/terminal_itdc/export_tasks -> library/python/deprecated/ticket_parser2 -ALLOW health/articles/articles_pipeline/lib -> library/python/deprecated/ticket_parser2 -ALLOW health/common_libs/utils -> library/python/deprecated/ticket_parser2 -ALLOW health/turbo_articles/commentator_api -> library/python/deprecated/ticket_parser2 -ALLOW health/turbo_articles/parser/libs -> library/python/deprecated/ticket_parser2 -ALLOW htf/predictions/common_data/blackbox_markup_puids -> library/python/deprecated/ticket_parser2 -ALLOW htf/viewers/demo -> library/python/deprecated/ticket_parser2 -ALLOW infra/deploy_notifications_controller/lib -> library/python/deprecated/ticket_parser2 -ALLOW infra/nanny/instancectl/src -> library/python/deprecated/ticket_parser2 -ALLOW infra/qyp/qdm/src -> library/python/deprecated/ticket_parser2 -ALLOW infra/qyp/vmagent/src -> library/python/deprecated/ticket_parser2 -ALLOW infra/qyp/vmproxy/src -> library/python/deprecated/ticket_parser2 -ALLOW infra/swatlib -> library/python/deprecated/ticket_parser2 -ALLOW infra/vmagent/src/vmagent -> library/python/deprecated/ticket_parser2 -ALLOW infra/walle/server/walle -> library/python/deprecated/ticket_parser2 -ALLOW intranet/trip/ext_api/src -> library/python/deprecated/ticket_parser2 -ALLOW inventori/etl -> library/python/deprecated/ticket_parser2 -ALLOW inventori/pylibs/common -> library/python/deprecated/ticket_parser2 -ALLOW junk/kalmykov-ad/geocoder -> library/python/deprecated/ticket_parser2 -ALLOW junk/swarmer/news/vh_selfservice_resend_tool -> library/python/deprecated/ticket_parser2 -ALLOW junk/ulgen4a/devops/schedule -> library/python/deprecated/ticket_parser2 -ALLOW junk/zankin/docker_example -> library/python/deprecated/ticket_parser2 -ALLOW kikimr/juggler/ydb_availability -> library/python/deprecated/ticket_parser2 -ALLOW kikimr/tools/duty_bot -> library/python/deprecated/ticket_parser2 -ALLOW kikimr/tools/rolling_restart -> library/python/deprecated/ticket_parser2 -ALLOW library/python/awssdk-extensions -> library/python/deprecated/ticket_parser2 -ALLOW library/python/awssdk_async_extensions/lib -> library/python/deprecated/ticket_parser2 -ALLOW library/python/deprecated/ticket_parser2 -> library/python/deprecated/ticket_parser2 -ALLOW library/python/flask_passport -> library/python/deprecated/ticket_parser2 -ALLOW library/recipes/tvmapi/ut_simple -> library/python/deprecated/ticket_parser2 -ALLOW library/recipes/tvmapi/ut_with_tvmtool -> library/python/deprecated/ticket_parser2 -ALLOW load/projects/lunaparkapi/web -> library/python/deprecated/ticket_parser2 -ALLOW logbroker/tools/ansible/plugins -> library/python/deprecated/ticket_parser2 -ALLOW logbroker/tools/python3 -> library/python/deprecated/ticket_parser2 -ALLOW mail/calendar-attach-processor -> library/python/deprecated/ticket_parser2 -ALLOW mail/calendar/python/client -> library/python/deprecated/ticket_parser2 -ALLOW mail/catdog/catdog/requirements -> library/python/deprecated/ticket_parser2 -ALLOW mail/collectors-ext/tests-system/src -> library/python/deprecated/ticket_parser2 -ALLOW mail/collectors/tests-system/src -> library/python/deprecated/ticket_parser2 -ALLOW mail/furita/tests/common/utils -> library/python/deprecated/ticket_parser2 -ALLOW mail/payments/payments -> library/python/deprecated/ticket_parser2 -ALLOW mail/so/daemons/knn_bot -> library/python/deprecated/ticket_parser2 -ALLOW mail/support/nirvana/pdb_fos -> library/python/deprecated/ticket_parser2 -ALLOW mail/tools/yamail_info/lib -> library/python/deprecated/ticket_parser2 -ALLOW mail/transfer -> library/python/deprecated/ticket_parser2 -ALLOW maps/analytics/legacy/nirvana/navi/team-x-vin-transfer -> library/python/deprecated/ticket_parser2 -ALLOW maps/analyzer/services/eta_comparison/lib -> library/python/deprecated/ticket_parser2 -ALLOW maps/automotive/carwashes/tools/carwashes_downloader -> library/python/deprecated/ticket_parser2 -ALLOW maps/automotive/tollroads/tools/plazas_downloader -> library/python/deprecated/ticket_parser2 -ALLOW maps/geomarketing/Roland/consumer -> library/python/deprecated/ticket_parser2 -ALLOW maps/geomarketing/Virgille/consumer -> library/python/deprecated/ticket_parser2 -ALLOW maps/renderer/stylerepo/lib -> library/python/deprecated/ticket_parser2 -ALLOW maps/search/scripts/transit/coverage/lib -> library/python/deprecated/ticket_parser2 -ALLOW market/checkout/checkouter-load-test/checkouter-market-delivery-blue-order-creator -> library/python/deprecated/ticket_parser2 -ALLOW market/idx/admin/system_offers/lib -> library/python/deprecated/ticket_parser2 -ALLOW market/idx/api/backend -> library/python/deprecated/ticket_parser2 -ALLOW market/idx/devtools/dukalis/offer_diagnostics/lib/analyzer -> library/python/deprecated/ticket_parser2 -ALLOW market/idx/devtools/dukalis/promo_diagnostics/lib/analyzer -> library/python/deprecated/ticket_parser2 -ALLOW market/pylibrary/logbroker -> library/python/deprecated/ticket_parser2 -ALLOW market/sre/services/colba/common/lb_client -> library/python/deprecated/ticket_parser2 -ALLOW market/sre/services/colba/dispatcher -> library/python/deprecated/ticket_parser2 -ALLOW market/sre/services/colba/master -> library/python/deprecated/ticket_parser2 -ALLOW market/sre/services/colba/minion -> library/python/deprecated/ticket_parser2 -ALLOW market/tools/corewatcher-rtc/src -> library/python/deprecated/ticket_parser2 -ALLOW market/vimobu/lib -> library/python/deprecated/ticket_parser2 -ALLOW mds/nscfg/server -> library/python/deprecated/ticket_parser2 -ALLOW mds/s3/s3_mds_proxy -> library/python/deprecated/ticket_parser2 -ALLOW metrika/admin/brb/server/lib/utils -> library/python/deprecated/ticket_parser2 -ALLOW metrika/admin/python/bishop/config_api/base -> library/python/deprecated/ticket_parser2 -ALLOW metrika/admin/python/bishop/frontend/base -> library/python/deprecated/ticket_parser2 -ALLOW metrika/admin/python/clickhouse_backups/frontend/base -> library/python/deprecated/ticket_parser2 -ALLOW metrika/admin/python/clickhouse_rbac/frontend/base -> library/python/deprecated/ticket_parser2 -ALLOW metrika/admin/python/cms/agent/lib -> library/python/deprecated/ticket_parser2 -ALLOW metrika/admin/python/cms/frontend/base -> library/python/deprecated/ticket_parser2 -ALLOW metrika/admin/python/cms/lib -> library/python/deprecated/ticket_parser2 -ALLOW metrika/admin/python/duty/frontend/base -> library/python/deprecated/ticket_parser2 -ALLOW metrika/admin/python/mi/frontend/base -> library/python/deprecated/ticket_parser2 -ALLOW metrika/admin/python/scripts/oauth-tokens-checker -> library/python/deprecated/ticket_parser2 -ALLOW metrika/admin/python/zooface/frontend/base -> library/python/deprecated/ticket_parser2 -ALLOW metrika/core/programs/mobile_startup_admin/base -> library/python/deprecated/ticket_parser2 -ALLOW metrika/pylib/auth/tvm -> library/python/deprecated/ticket_parser2 -ALLOW mlp/mail/smartcompose/dev/SMARTCOMPOSE-154 -> library/python/deprecated/ticket_parser2 -ALLOW mlp/mail/smartcompose/dev/SMARTCOMPOSE-192 -> library/python/deprecated/ticket_parser2 -ALLOW mlp/mail/smartcompose/dev/SMARTCOMPOSE-197 -> library/python/deprecated/ticket_parser2 -ALLOW mlp/mail/smartcompose/dev/hounder -> library/python/deprecated/ticket_parser2 -ALLOW mlp/mail/smartcompose/tools/calc_matches_runtime -> library/python/deprecated/ticket_parser2 -ALLOW mlp/mail/smartsubject/dev/SMARTSUBJECT-5 -> library/python/deprecated/ticket_parser2 -ALLOW mlp/mail/smartsubject/juggler_bundle -> library/python/deprecated/ticket_parser2 -ALLOW mlp/mail/smartsubject/tools/calc_metrics -> library/python/deprecated/ticket_parser2 -ALLOW modadvert/libs/connectors/loggers/it -> library/python/deprecated/ticket_parser2 -ALLOW modadvert/libs/http -> library/python/deprecated/ticket_parser2 -ALLOW modadvert/libs/laas/workers/logging_worker -> library/python/deprecated/ticket_parser2 -ALLOW modadvert/libs/program/tvm_mixin -> library/python/deprecated/ticket_parser2 -ALLOW modadvert/libs/tvm -> library/python/deprecated/ticket_parser2 -ALLOW modadvert/nirvana/send_to_lb/libs -> library/python/deprecated/ticket_parser2 -ALLOW modadvert/test_utils/tvm -> library/python/deprecated/ticket_parser2 -ALLOW mssngr/botplatform/src/bots/common -> library/python/deprecated/ticket_parser2 -ALLOW mssngr/botplatform/src/bots/core/testutils -> library/python/deprecated/ticket_parser2 -ALLOW mssngr/router/lib/python/userid -> library/python/deprecated/ticket_parser2 -ALLOW mssngr/router/lib/python/utils -> library/python/deprecated/ticket_parser2 -ALLOW mssngr/router/tests/chat_mirror_test/test_suites/light -> library/python/deprecated/ticket_parser2 -ALLOW mssngr/router/tests/files_test/test_suites/light -> library/python/deprecated/ticket_parser2 -ALLOW mssngr/router/tests/lb_subscriber2_test/test_suites/light -> library/python/deprecated/ticket_parser2 -ALLOW mssngr/router/tests/registry_test/test_suites/light -> library/python/deprecated/ticket_parser2 -ALLOW mssngr/router/tests/server_test/test_suites/fat -> library/python/deprecated/ticket_parser2 -ALLOW mssngr/router/tests/support_gateway_test/test_suites/light -> library/python/deprecated/ticket_parser2 -ALLOW noc/ipv4mgr -> library/python/deprecated/ticket_parser2 -ALLOW ofd/common/services/tvm -> library/python/deprecated/ticket_parser2 -ALLOW ofd/common/tests/test_tvm_service -> library/python/deprecated/ticket_parser2 -ALLOW offline_data/call_center/nirvana/send_sms -> library/python/deprecated/ticket_parser2 -ALLOW orgvisits/viewers/geotrack/backend -> library/python/deprecated/ticket_parser2 + +# ticket_parser2 +# TODO: drop temporary rule with entire library: PASSP-30786 +DENY .* -> library/java/ticket_parser2 + +# please use https://a.yandex-team.ru/arc/trunk/arcadia/library/python/tvmauth instead +# https://clubs.at.yandex-team.ru/passport/3619 +ALLOW addappter/backend/addappter -> library/python/deprecated/ticket_parser2 +ALLOW ads/bsyeti/bb_viewer/viewer -> library/python/deprecated/ticket_parser2 +ALLOW ads/bsyeti/caesar/tools/logtests/samplers -> library/python/deprecated/ticket_parser2 +ALLOW ads/bsyeti/tests/test_lib/data_collector -> library/python/deprecated/ticket_parser2 +ALLOW ads/bsyeti/tools/bb_requester -> library/python/deprecated/ticket_parser2 +ALLOW alice/uniproxy/library/auth -> library/python/deprecated/ticket_parser2 +ALLOW alice/uniproxy/library/integration_tests -> library/python/deprecated/ticket_parser2 +ALLOW alice/vins/apps/navi -> library/python/deprecated/ticket_parser2 +ALLOW analytics/geo/navi/team-x-vin-transfer -> library/python/deprecated/ticket_parser2 +ALLOW analytics/images/upload_urls_to_avatars -> library/python/deprecated/ticket_parser2 +ALLOW antiadblock/argus/result_agregate_task -> library/python/deprecated/ticket_parser2 +ALLOW antiadblock/configs_api/lib -> library/python/deprecated/ticket_parser2 +ALLOW antiadblock/cryprox/cryprox -> library/python/deprecated/ticket_parser2 +ALLOW antiadblock/monrelay -> library/python/deprecated/ticket_parser2 +ALLOW antiadblock/tasks/autoredirect_data -> library/python/deprecated/ticket_parser2 +ALLOW antiadblock/tasks/change_current_cookie -> library/python/deprecated/ticket_parser2 +ALLOW antiadblock/tasks/configs_stub_server -> library/python/deprecated/ticket_parser2 +ALLOW antiadblock/tasks/decrypt_url_configs -> library/python/deprecated/ticket_parser2 +ALLOW antiadblock/tasks/experiments/lib -> library/python/deprecated/ticket_parser2 +ALLOW antiadblock/tasks/gdpr_aab_cookies -> library/python/deprecated/ticket_parser2 +ALLOW antiadblock/tasks/money_tickets_updater/plugins -> library/python/deprecated/ticket_parser2 +ALLOW antiadblock/tasks/tools -> library/python/deprecated/ticket_parser2 +ALLOW antiadblock/tasks/update_lj_custom_domains -> library/python/deprecated/ticket_parser2 +ALLOW antirobot/captcha/captcha_test_service/bin -> library/python/deprecated/ticket_parser2 +ALLOW antirobot/cbb/cbb_django/cbb/views -> library/python/deprecated/ticket_parser2 +ALLOW antirobot/scripts/parsers/cbb_api_clear_from_dump -> library/python/deprecated/ticket_parser2 +ALLOW antirobot/scripts/parsers/cbb_api_example -> library/python/deprecated/ticket_parser2 +ALLOW antirobot/scripts/parsers/upload_ip_to_cbb -> library/python/deprecated/ticket_parser2 +ALLOW april/common -> library/python/deprecated/ticket_parser2 +ALLOW april/etl/utils -> library/python/deprecated/ticket_parser2 +ALLOW april/tools/clients/tvm_client -> library/python/deprecated/ticket_parser2 +ALLOW billing/bcl/src/tests/regression -> library/python/deprecated/ticket_parser2 +ALLOW billing/dcs/dcs -> library/python/deprecated/ticket_parser2 +ALLOW cloud/bootstrap/api/src/backend -> library/python/deprecated/ticket_parser2 +ALLOW cloud/marketplace/queue/yc_marketplace_queue -> library/python/deprecated/ticket_parser2 +ALLOW cloud/mdb/dbm/internal -> library/python/deprecated/ticket_parser2 +ALLOW cmnt/tools/regression/lib -> library/python/deprecated/ticket_parser2 +ALLOW cmnt/tools/request_generator -> library/python/deprecated/ticket_parser2 +ALLOW cv/cbir_search/yt_classifier/image_tools -> library/python/deprecated/ticket_parser2 +ALLOW datacloud/dev_utils/tvm -> library/python/deprecated/ticket_parser2 +ALLOW datacloud/log_reader/lib -> library/python/deprecated/ticket_parser2 +ALLOW datalens/backend/app/bi_billing -> library/python/deprecated/ticket_parser2 +ALLOW datalens/backend/lib/bi_core -> library/python/deprecated/ticket_parser2 +ALLOW devtools/experimental/tvm2 -> library/python/deprecated/ticket_parser2 +ALLOW devtools/experimental/xprod/score_api -> library/python/deprecated/ticket_parser2 +ALLOW devtools/qafw/selenium/lb_sender -> library/python/deprecated/ticket_parser2 +ALLOW devtools/yanotifybot/server/lib -> library/python/deprecated/ticket_parser2 +ALLOW dict/mt/web/misc/identity -> library/python/deprecated/ticket_parser2 +ALLOW dict/mt/web/misc/takeout -> library/python/deprecated/ticket_parser2 +ALLOW district/scripts/nirvana_actions_lb_writer -> library/python/deprecated/ticket_parser2 +ALLOW district/scripts/push_triggers_to_lb -> library/python/deprecated/ticket_parser2 +ALLOW dj/services/ecom/lib/pymiddle_turbo_requester -> library/python/deprecated/ticket_parser2 +ALLOW drive/analytics/pybase/helpers -> library/python/deprecated/ticket_parser2 +ALLOW education/lib/clients -> library/python/deprecated/ticket_parser2 +ALLOW entity/ontodb/tasks/import_persons_to_saas/lib -> library/python/deprecated/ticket_parser2 +ALLOW entity/ugc/db/python/client -> library/python/deprecated/ticket_parser2 +ALLOW entity/ugc/nirvana/utils/yt -> library/python/deprecated/ticket_parser2 +ALLOW entity/ugc/robot/tools/achivery/lib -> library/python/deprecated/ticket_parser2 +ALLOW entity/ugc/robot/tools/antispam/lib -> library/python/deprecated/ticket_parser2 +ALLOW entity/ugc/robot/tools/ugcdb/ugcdb_uploader -> library/python/deprecated/ticket_parser2 +ALLOW entity/ugc/tools/comments/business_reply_fix_util -> library/python/deprecated/ticket_parser2 +ALLOW entity/ugc/tools/nirvana/blackbox -> library/python/deprecated/ticket_parser2 +ALLOW entity/ugc/tools/nirvana/comments/init_commentator_chat -> library/python/deprecated/ticket_parser2 +ALLOW entity/ugc/tools/nirvana/comments/wait_comment_moderation -> library/python/deprecated/ticket_parser2 +ALLOW entity/ugc/tools/nirvana/enricher/lib -> library/python/deprecated/ticket_parser2 +ALLOW entity/ugc/tools/nirvana/ugcdb/lib -> library/python/deprecated/ticket_parser2 +ALLOW entity/ugc/tools/viewer_server/lib -> library/python/deprecated/ticket_parser2 +ALLOW ether/ether_common -> library/python/deprecated/ticket_parser2 +ALLOW ether/zen/highlights/ugc/highlight_importer -> library/python/deprecated/ticket_parser2 +ALLOW ether/zen/highlights/vh/video_exporter -> library/python/deprecated/ticket_parser2 +ALLOW ether/zen/zen_tools -> library/python/deprecated/ticket_parser2 +ALLOW extsearch/geo/conveyors/gdpr/takeout_daemon -> library/python/deprecated/ticket_parser2 +ALLOW extsearch/geo/conveyors/gdpr/uploader -> library/python/deprecated/ticket_parser2 +ALLOW extsearch/video/quality/recommender/tools/zen_load -> library/python/deprecated/ticket_parser2 +ALLOW extsearch/video/robot/crawling/stevenson/backend/bin/webapp -> library/python/deprecated/ticket_parser2 +ALLOW extsearch/video/ugc/sqs_moderation/clients -> library/python/deprecated/ticket_parser2 +ALLOW extsearch/video/vh/ydb/lb2ydb -> library/python/deprecated/ticket_parser2 +ALLOW extsearch/wizards/fastres2/tools/data_delivery/rtmr/delivery/common -> library/python/deprecated/ticket_parser2 +ALLOW geoproduct/external_cc_events/app -> library/python/deprecated/ticket_parser2 +ALLOW geoproduct/price_info_proxy/app -> library/python/deprecated/ticket_parser2 +ALLOW haas/terminal_itdc/export_tasks -> library/python/deprecated/ticket_parser2 +ALLOW health/articles/articles_pipeline/lib -> library/python/deprecated/ticket_parser2 +ALLOW health/common_libs/utils -> library/python/deprecated/ticket_parser2 +ALLOW health/turbo_articles/commentator_api -> library/python/deprecated/ticket_parser2 +ALLOW health/turbo_articles/parser/libs -> library/python/deprecated/ticket_parser2 +ALLOW htf/predictions/common_data/blackbox_markup_puids -> library/python/deprecated/ticket_parser2 +ALLOW htf/viewers/demo -> library/python/deprecated/ticket_parser2 +ALLOW infra/deploy_notifications_controller/lib -> library/python/deprecated/ticket_parser2 +ALLOW infra/nanny/instancectl/src -> library/python/deprecated/ticket_parser2 +ALLOW infra/qyp/qdm/src -> library/python/deprecated/ticket_parser2 +ALLOW infra/qyp/vmagent/src -> library/python/deprecated/ticket_parser2 +ALLOW infra/qyp/vmproxy/src -> library/python/deprecated/ticket_parser2 +ALLOW infra/swatlib -> library/python/deprecated/ticket_parser2 +ALLOW infra/vmagent/src/vmagent -> library/python/deprecated/ticket_parser2 +ALLOW infra/walle/server/walle -> library/python/deprecated/ticket_parser2 +ALLOW intranet/trip/ext_api/src -> library/python/deprecated/ticket_parser2 +ALLOW inventori/etl -> library/python/deprecated/ticket_parser2 +ALLOW inventori/pylibs/common -> library/python/deprecated/ticket_parser2 +ALLOW junk/kalmykov-ad/geocoder -> library/python/deprecated/ticket_parser2 +ALLOW junk/swarmer/news/vh_selfservice_resend_tool -> library/python/deprecated/ticket_parser2 +ALLOW junk/ulgen4a/devops/schedule -> library/python/deprecated/ticket_parser2 +ALLOW junk/zankin/docker_example -> library/python/deprecated/ticket_parser2 +ALLOW kikimr/juggler/ydb_availability -> library/python/deprecated/ticket_parser2 +ALLOW kikimr/tools/duty_bot -> library/python/deprecated/ticket_parser2 +ALLOW kikimr/tools/rolling_restart -> library/python/deprecated/ticket_parser2 +ALLOW library/python/awssdk-extensions -> library/python/deprecated/ticket_parser2 +ALLOW library/python/awssdk_async_extensions/lib -> library/python/deprecated/ticket_parser2 +ALLOW library/python/deprecated/ticket_parser2 -> library/python/deprecated/ticket_parser2 +ALLOW library/python/flask_passport -> library/python/deprecated/ticket_parser2 +ALLOW library/recipes/tvmapi/ut_simple -> library/python/deprecated/ticket_parser2 +ALLOW library/recipes/tvmapi/ut_with_tvmtool -> library/python/deprecated/ticket_parser2 +ALLOW load/projects/lunaparkapi/web -> library/python/deprecated/ticket_parser2 +ALLOW logbroker/tools/ansible/plugins -> library/python/deprecated/ticket_parser2 +ALLOW logbroker/tools/python3 -> library/python/deprecated/ticket_parser2 +ALLOW mail/calendar-attach-processor -> library/python/deprecated/ticket_parser2 +ALLOW mail/calendar/python/client -> library/python/deprecated/ticket_parser2 +ALLOW mail/catdog/catdog/requirements -> library/python/deprecated/ticket_parser2 +ALLOW mail/collectors-ext/tests-system/src -> library/python/deprecated/ticket_parser2 +ALLOW mail/collectors/tests-system/src -> library/python/deprecated/ticket_parser2 +ALLOW mail/furita/tests/common/utils -> library/python/deprecated/ticket_parser2 +ALLOW mail/payments/payments -> library/python/deprecated/ticket_parser2 +ALLOW mail/so/daemons/knn_bot -> library/python/deprecated/ticket_parser2 +ALLOW mail/support/nirvana/pdb_fos -> library/python/deprecated/ticket_parser2 +ALLOW mail/tools/yamail_info/lib -> library/python/deprecated/ticket_parser2 +ALLOW mail/transfer -> library/python/deprecated/ticket_parser2 +ALLOW maps/analytics/legacy/nirvana/navi/team-x-vin-transfer -> library/python/deprecated/ticket_parser2 +ALLOW maps/analyzer/services/eta_comparison/lib -> library/python/deprecated/ticket_parser2 +ALLOW maps/automotive/carwashes/tools/carwashes_downloader -> library/python/deprecated/ticket_parser2 +ALLOW maps/automotive/tollroads/tools/plazas_downloader -> library/python/deprecated/ticket_parser2 +ALLOW maps/geomarketing/Roland/consumer -> library/python/deprecated/ticket_parser2 +ALLOW maps/geomarketing/Virgille/consumer -> library/python/deprecated/ticket_parser2 +ALLOW maps/renderer/stylerepo/lib -> library/python/deprecated/ticket_parser2 +ALLOW maps/search/scripts/transit/coverage/lib -> library/python/deprecated/ticket_parser2 +ALLOW market/checkout/checkouter-load-test/checkouter-market-delivery-blue-order-creator -> library/python/deprecated/ticket_parser2 +ALLOW market/idx/admin/system_offers/lib -> library/python/deprecated/ticket_parser2 +ALLOW market/idx/api/backend -> library/python/deprecated/ticket_parser2 +ALLOW market/idx/devtools/dukalis/offer_diagnostics/lib/analyzer -> library/python/deprecated/ticket_parser2 +ALLOW market/idx/devtools/dukalis/promo_diagnostics/lib/analyzer -> library/python/deprecated/ticket_parser2 +ALLOW market/pylibrary/logbroker -> library/python/deprecated/ticket_parser2 +ALLOW market/sre/services/colba/common/lb_client -> library/python/deprecated/ticket_parser2 +ALLOW market/sre/services/colba/dispatcher -> library/python/deprecated/ticket_parser2 +ALLOW market/sre/services/colba/master -> library/python/deprecated/ticket_parser2 +ALLOW market/sre/services/colba/minion -> library/python/deprecated/ticket_parser2 +ALLOW market/tools/corewatcher-rtc/src -> library/python/deprecated/ticket_parser2 +ALLOW market/vimobu/lib -> library/python/deprecated/ticket_parser2 +ALLOW mds/nscfg/server -> library/python/deprecated/ticket_parser2 +ALLOW mds/s3/s3_mds_proxy -> library/python/deprecated/ticket_parser2 +ALLOW metrika/admin/brb/server/lib/utils -> library/python/deprecated/ticket_parser2 +ALLOW metrika/admin/python/bishop/config_api/base -> library/python/deprecated/ticket_parser2 +ALLOW metrika/admin/python/bishop/frontend/base -> library/python/deprecated/ticket_parser2 +ALLOW metrika/admin/python/clickhouse_backups/frontend/base -> library/python/deprecated/ticket_parser2 +ALLOW metrika/admin/python/clickhouse_rbac/frontend/base -> library/python/deprecated/ticket_parser2 +ALLOW metrika/admin/python/cms/agent/lib -> library/python/deprecated/ticket_parser2 +ALLOW metrika/admin/python/cms/frontend/base -> library/python/deprecated/ticket_parser2 +ALLOW metrika/admin/python/cms/lib -> library/python/deprecated/ticket_parser2 +ALLOW metrika/admin/python/duty/frontend/base -> library/python/deprecated/ticket_parser2 +ALLOW metrika/admin/python/mi/frontend/base -> library/python/deprecated/ticket_parser2 +ALLOW metrika/admin/python/scripts/oauth-tokens-checker -> library/python/deprecated/ticket_parser2 +ALLOW metrika/admin/python/zooface/frontend/base -> library/python/deprecated/ticket_parser2 +ALLOW metrika/core/programs/mobile_startup_admin/base -> library/python/deprecated/ticket_parser2 +ALLOW metrika/pylib/auth/tvm -> library/python/deprecated/ticket_parser2 +ALLOW mlp/mail/smartcompose/dev/SMARTCOMPOSE-154 -> library/python/deprecated/ticket_parser2 +ALLOW mlp/mail/smartcompose/dev/SMARTCOMPOSE-192 -> library/python/deprecated/ticket_parser2 +ALLOW mlp/mail/smartcompose/dev/SMARTCOMPOSE-197 -> library/python/deprecated/ticket_parser2 +ALLOW mlp/mail/smartcompose/dev/hounder -> library/python/deprecated/ticket_parser2 +ALLOW mlp/mail/smartcompose/tools/calc_matches_runtime -> library/python/deprecated/ticket_parser2 +ALLOW mlp/mail/smartsubject/dev/SMARTSUBJECT-5 -> library/python/deprecated/ticket_parser2 +ALLOW mlp/mail/smartsubject/juggler_bundle -> library/python/deprecated/ticket_parser2 +ALLOW mlp/mail/smartsubject/tools/calc_metrics -> library/python/deprecated/ticket_parser2 +ALLOW modadvert/libs/connectors/loggers/it -> library/python/deprecated/ticket_parser2 +ALLOW modadvert/libs/http -> library/python/deprecated/ticket_parser2 +ALLOW modadvert/libs/laas/workers/logging_worker -> library/python/deprecated/ticket_parser2 +ALLOW modadvert/libs/program/tvm_mixin -> library/python/deprecated/ticket_parser2 +ALLOW modadvert/libs/tvm -> library/python/deprecated/ticket_parser2 +ALLOW modadvert/nirvana/send_to_lb/libs -> library/python/deprecated/ticket_parser2 +ALLOW modadvert/test_utils/tvm -> library/python/deprecated/ticket_parser2 +ALLOW mssngr/botplatform/src/bots/common -> library/python/deprecated/ticket_parser2 +ALLOW mssngr/botplatform/src/bots/core/testutils -> library/python/deprecated/ticket_parser2 +ALLOW mssngr/router/lib/python/userid -> library/python/deprecated/ticket_parser2 +ALLOW mssngr/router/lib/python/utils -> library/python/deprecated/ticket_parser2 +ALLOW mssngr/router/tests/chat_mirror_test/test_suites/light -> library/python/deprecated/ticket_parser2 +ALLOW mssngr/router/tests/files_test/test_suites/light -> library/python/deprecated/ticket_parser2 +ALLOW mssngr/router/tests/lb_subscriber2_test/test_suites/light -> library/python/deprecated/ticket_parser2 +ALLOW mssngr/router/tests/registry_test/test_suites/light -> library/python/deprecated/ticket_parser2 +ALLOW mssngr/router/tests/server_test/test_suites/fat -> library/python/deprecated/ticket_parser2 +ALLOW mssngr/router/tests/support_gateway_test/test_suites/light -> library/python/deprecated/ticket_parser2 +ALLOW noc/ipv4mgr -> library/python/deprecated/ticket_parser2 +ALLOW ofd/common/services/tvm -> library/python/deprecated/ticket_parser2 +ALLOW ofd/common/tests/test_tvm_service -> library/python/deprecated/ticket_parser2 +ALLOW offline_data/call_center/nirvana/send_sms -> library/python/deprecated/ticket_parser2 +ALLOW orgvisits/viewers/geotrack/backend -> library/python/deprecated/ticket_parser2 ALLOW passport/backend/social/common -> library/python/deprecated/ticket_parser2 ALLOW passport/backend/tvm_keyring -> library/python/deprecated/ticket_parser2 -ALLOW passport/infra/daemons/tvmapi/ut_py -> library/python/deprecated/ticket_parser2 -ALLOW passport/infra/daemons/tvmtool/ut_py -> library/python/deprecated/ticket_parser2 +ALLOW passport/infra/daemons/tvmapi/ut_py -> library/python/deprecated/ticket_parser2 +ALLOW passport/infra/daemons/tvmtool/ut_py -> library/python/deprecated/ticket_parser2 ALLOW passport/backend/core/grants -> library/python/deprecated/ticket_parser2 ALLOW passport/backend/core/logging_utils -> library/python/deprecated/ticket_parser2 ALLOW passport/backend/core/tvm/faker/tests -> library/python/deprecated/ticket_parser2 @@ -219,146 +219,146 @@ ALLOW passport/backend/core/tvm/tests -> library/python/deprecated/ticket_parser ALLOW passport/backend/core/tvm -> library/python/deprecated/ticket_parser2 ALLOW passport/backend/tasks_nirvana/antifraud -> library/python/deprecated/ticket_parser2 ALLOW passport/backend/vault/api -> library/python/deprecated/ticket_parser2 -ALLOW payplatform/nirvana/lib -> library/python/deprecated/ticket_parser2 -ALLOW plus/analytics/tools/bb_user_info -> library/python/deprecated/ticket_parser2 -ALLOW plus/cobra/project -> library/python/deprecated/ticket_parser2 -ALLOW plus/gift/project -> library/python/deprecated/ticket_parser2 -ALLOW plus/landing_backend/project -> library/python/deprecated/ticket_parser2 -ALLOW plus/oneyear/project -> library/python/deprecated/ticket_parser2 -ALLOW plus/plusminus/project -> library/python/deprecated/ticket_parser2 -ALLOW quality/antifraud/scripts/prod/dump_viewers_data -> library/python/deprecated/ticket_parser2 -ALLOW quality/antifraud/xurma/tools/xurma_admin/lib -> library/python/deprecated/ticket_parser2 -ALLOW quality/antifraud/xurma/tools/xurma_viewer/backend/lib -> library/python/deprecated/ticket_parser2 -ALLOW quality/functionality/chats/common/tvm_client -> library/python/deprecated/ticket_parser2 -ALLOW quality/functionality/entity_search/factqueries/custom/metro -> library/python/deprecated/ticket_parser2 -ALLOW quality/functionality/entity_search/factqueries/instructions/avatars_uploader -> library/python/deprecated/ticket_parser2 -ALLOW quality/functionality/turbo/ecommerce/smart_campaign_uploader/lib -> library/python/deprecated/ticket_parser2 -ALLOW quality/functionality/turbo/forms/job/lib -> library/python/deprecated/ticket_parser2 -ALLOW quality/functionality/turbo/tools/api_tasks/lib -> library/python/deprecated/ticket_parser2 -ALLOW quality/functionality/turbo/tools/duty_absence_notifier -> library/python/deprecated/ticket_parser2 -ALLOW quasar/infra/tasklets/datasync_uploader/impl -> library/python/deprecated/ticket_parser2 -ALLOW quasar/infra/tasklets/group_maintenance/impl -> library/python/deprecated/ticket_parser2 -ALLOW robot/pluto/patents/apphost -> library/python/deprecated/ticket_parser2 -ALLOW robot/samovar/tools/wikimedia_updates_reader -> library/python/deprecated/ticket_parser2 -ALLOW rt-research/broadmatching/scripts/tvm/update_service_tickets -> library/python/deprecated/ticket_parser2 -ALLOW rtc/recorder -> library/python/deprecated/ticket_parser2 -ALLOW rtmapreduce/monitoring/solomon -> library/python/deprecated/ticket_parser2 -ALLOW saas/tools/devops/billing_send -> library/python/deprecated/ticket_parser2 -ALLOW saas/tools/refresh_mon -> library/python/deprecated/ticket_parser2 -ALLOW saas/tools/user_if/ssm-front/backend -> library/python/deprecated/ticket_parser2 -ALLOW samogon/libs/tvm_api -> library/python/deprecated/ticket_parser2 -ALLOW sandbox/projects/ab_testing -> library/python/deprecated/ticket_parser2 -ALLOW sandbox/projects/metrika/mobile/ios/symbols/upload_system_ios_symbols -> library/python/deprecated/ticket_parser2 -ALLOW sandbox/projects/noc/ExportNetworkMetering -> library/python/deprecated/ticket_parser2 -ALLOW sandbox/projects/noc/MeteringCacheZapekatel -> library/python/deprecated/ticket_parser2 -ALLOW sandbox/projects/noc/TopAS -> library/python/deprecated/ticket_parser2 -ALLOW sandbox/projects/quasar/datasync_uploader/lib -> library/python/deprecated/ticket_parser2 -ALLOW sandbox/projects/qyp -> library/python/deprecated/ticket_parser2 -ALLOW sandbox/projects/staff_login_checker/PrepareUidsFile -> library/python/deprecated/ticket_parser2 -ALLOW sandbox/projects/suggest/watchdog -> library/python/deprecated/ticket_parser2 -ALLOW sandbox/projects/yabs/duty_calendar -> library/python/deprecated/ticket_parser2 -ALLOW search/metadoc/tools/request_saas -> library/python/deprecated/ticket_parser2 -ALLOW security/takeout -> library/python/deprecated/ticket_parser2 -ALLOW sport/backend -> library/python/deprecated/ticket_parser2 -ALLOW sprav/snezhana_v3/lib -> library/python/deprecated/ticket_parser2 -ALLOW sup/ml/saas -> library/python/deprecated/ticket_parser2 -ALLOW sup/tools/bell_delete -> library/python/deprecated/ticket_parser2 -ALLOW sup/tools/datasync_loader -> library/python/deprecated/ticket_parser2 -ALLOW taxi/logistic-dispatcher/library/cargo_ld_test -> library/python/deprecated/ticket_parser2 -ALLOW taxi/logistic-dispatcher/tools/configure-sharding -> library/python/deprecated/ticket_parser2 -ALLOW taxi/logistic-dispatcher/tools/qa-axe/platform_requests -> library/python/deprecated/ticket_parser2 -ALLOW taxi/logistic-dispatcher/tools/quick-tvm/quick_tvm_generator -> library/python/deprecated/ticket_parser2 -ALLOW taxi/logistic-dispatcher/tools/rt-robot-dc-configuration -> library/python/deprecated/ticket_parser2 -ALLOW taxi/logistic-dispatcher/tools/unsafe-robot-configurations -> library/python/deprecated/ticket_parser2 -ALLOW testenv/core/api/ci -> library/python/deprecated/ticket_parser2 -ALLOW testenv/core/common -> library/python/deprecated/ticket_parser2 -ALLOW travel/avia/subscriptions/app/settings -> library/python/deprecated/ticket_parser2 -ALLOW travel/avia/travelers -> library/python/deprecated/ticket_parser2 -ALLOW travel/cpa/collectors/avia/aeroflot_boy -> library/python/deprecated/ticket_parser2 -ALLOW travel/cpa/collectors/generic/order -> library/python/deprecated/ticket_parser2 -ALLOW travel/cpa/collectors/lib -> library/python/deprecated/ticket_parser2 -ALLOW travel/cpa/collectors/suburban/suburban_boy -> library/python/deprecated/ticket_parser2 -ALLOW travel/cpa/collectors/train/im_boy -> library/python/deprecated/ticket_parser2 -ALLOW travel/hotels/devops/slack_forwarder -> library/python/deprecated/ticket_parser2 -ALLOW travel/hotels/lib/python3/tvm -> library/python/deprecated/ticket_parser2 -ALLOW travel/hotels/tools/api_req_replicator -> library/python/deprecated/ticket_parser2 -ALLOW travel/hotels/tools/cli -> library/python/deprecated/ticket_parser2 -ALLOW travel/hotels/tools/expedia_token_validator -> library/python/deprecated/ticket_parser2 -ALLOW travel/hotels/tools/room_photos_uploader -> library/python/deprecated/ticket_parser2 -ALLOW travel/library/python/tvm_ticket_provider -> library/python/deprecated/ticket_parser2 -ALLOW travel/orders/tools/library -> library/python/deprecated/ticket_parser2 -ALLOW travel/rasp/bus/admin/app -> library/python/deprecated/ticket_parser2 -ALLOW travel/rasp/bus_gdpr_api/src -> library/python/deprecated/ticket_parser2 -ALLOW travel/rasp/pathfinder_maps -> library/python/deprecated/ticket_parser2 -ALLOW travel/rasp/pathfinder_proxy/settings -> library/python/deprecated/ticket_parser2 -ALLOW travel/rasp/pathfinder_proxy -> library/python/deprecated/ticket_parser2 -ALLOW trust/utils -> library/python/deprecated/ticket_parser2 -ALLOW weather/libs/utils/tvm -> library/python/deprecated/ticket_parser2 -ALLOW weather/workers/exports/logbroker -> library/python/deprecated/ticket_parser2 -ALLOW yabs/indoor/py_libs/banana_client -> library/python/deprecated/ticket_parser2 -ALLOW yabs/indoor/py_libs/indoor_client -> library/python/deprecated/ticket_parser2 -ALLOW yabs/indoor/py_libs/tvm -> library/python/deprecated/ticket_parser2 -ALLOW yabs/outdoor/libs/operators_api -> library/python/deprecated/ticket_parser2 -ALLOW yabs/python-libs/tornado-utils -> library/python/deprecated/ticket_parser2 -ALLOW yabs/python-libs/tvm -> library/python/deprecated/ticket_parser2 -ALLOW yabs/rmp/backend/src/tvm -> library/python/deprecated/ticket_parser2 -ALLOW yabs/stat/infra/idm/src -> library/python/deprecated/ticket_parser2 -ALLOW yabs/telephony/telephony_data_transfer -> library/python/deprecated/ticket_parser2 -ALLOW yabs/vh/cms-pgaas/chat_creator -> library/python/deprecated/ticket_parser2 -ALLOW yabs/vh/cms-pgaas/chat_lib -> library/python/deprecated/ticket_parser2 -ALLOW yabs/vh/cms-pgaas/cmnt_lib -> library/python/deprecated/ticket_parser2 -ALLOW yabs/vh/cms-pgaas/cms_common -> library/python/deprecated/ticket_parser2 -ALLOW yabs/vh/cms-pgaas/logbroker -> library/python/deprecated/ticket_parser2 -ALLOW yabs/vh/cms-pgaas/partner_api -> library/python/deprecated/ticket_parser2 -ALLOW yabs/vh/cms-pgaas/self_service_api -> library/python/deprecated/ticket_parser2 -ALLOW yabs/vh/cms-pgaas/strm_thumb_repeat_importer -> library/python/deprecated/ticket_parser2 -ALLOW yabs/vh/cms-pgaas/ugc_api -> library/python/deprecated/ticket_parser2 -ALLOW yabs/vh/cms-pgaas/utils/auth/tvm -> library/python/deprecated/ticket_parser2 -ALLOW yaphone/advisor/advisor -> library/python/deprecated/ticket_parser2 -ALLOW yaphone/advisor/common -> library/python/deprecated/ticket_parser2 -ALLOW yaphone/advisor/project -> library/python/deprecated/ticket_parser2 -ALLOW yaphone/dialer/project -> library/python/deprecated/ticket_parser2 -ALLOW ydo/analytics/nirvana/puidification/phone_masks_retriever -> library/python/deprecated/ticket_parser2 -ALLOW ydo/async_api/lib/logbroker_consumer -> library/python/deprecated/ticket_parser2 -ALLOW ydo/bg_task_processor/bin -> library/python/deprecated/ticket_parser2 -ALLOW ydo/libs/blackbox/test -> library/python/deprecated/ticket_parser2 -ALLOW ydo/libs/blackbox -> library/python/deprecated/ticket_parser2 -ALLOW ydo/libs/tvm -> library/python/deprecated/ticket_parser2 -ALLOW ydo/payments/product_orders_processor/bin -> library/python/deprecated/ticket_parser2 -ALLOW ydo/tools/messenger/sms_notify/lib -> library/python/deprecated/ticket_parser2 -ALLOW ydo/tools/messenger/sms_notify -> library/python/deprecated/ticket_parser2 -ALLOW ydo/tools/search_index/prepare_index_data/prepare_direct_certificates/lib -> library/python/deprecated/ticket_parser2 -ALLOW yp/idm_role_provider/src -> library/python/deprecated/ticket_parser2 -ALLOW yp/tests/blackbox_recipe/bin -> library/python/deprecated/ticket_parser2 -ALLOW yp/tests/secret_vault_recipe/bin -> library/python/deprecated/ticket_parser2 -ALLOW yt/cron/duty -> library/python/deprecated/ticket_parser2 -ALLOW yt/cron/map_users_to_pools -> library/python/deprecated/ticket_parser2 -ALLOW yweb/antiporno/cp_conv/prepare_suggestive_cp_img_basket -> library/python/deprecated/ticket_parser2 -ALLOW yweb/antispam/cid/library/normalizer -> library/python/deprecated/ticket_parser2 -ALLOW yweb/antispam/cid/library -> library/python/deprecated/ticket_parser2 -ALLOW yweb/antispam/clean_web/lib -> library/python/deprecated/ticket_parser2 -ALLOW yweb/antispam/clean_web/tools/make_alert -> library/python/deprecated/ticket_parser2 -ALLOW yweb/antispam/clean_web/tools/upload_images_to_mds -> library/python/deprecated/ticket_parser2 -ALLOW yweb/antispam/mascot/sources -> library/python/deprecated/ticket_parser2 -ALLOW yweb/antispam/pth/instances/ownpth/hostinfo_viewer -> library/python/deprecated/ticket_parser2 -ALLOW yweb/blender/data_delivery/rtmr_uploader -> library/python/deprecated/ticket_parser2 -ALLOW yweb/freshness/coronavirus/upload_data_to_rtmr -> library/python/deprecated/ticket_parser2 -ALLOW yweb/freshness/scripts/sport_wizard -> library/python/deprecated/ticket_parser2 -ALLOW yweb/news/common/python/logbroker -> library/python/deprecated/ticket_parser2 -ALLOW yweb/news/common/python/logbroker_py2 -> library/python/deprecated/ticket_parser2 -ALLOW yweb/news/common/python/tvm -> library/python/deprecated/ticket_parser2 -ALLOW yweb/news/media/vh_selfservice -> library/python/deprecated/ticket_parser2 -ALLOW yweb/news/news_back/api/partner -> library/python/deprecated/ticket_parser2 -ALLOW yweb/news/pq_importer -> library/python/deprecated/ticket_parser2 -ALLOW yweb/news/python -> library/python/deprecated/ticket_parser2 -ALLOW yweb/news/search/pyuploader -> library/python/deprecated/ticket_parser2 -ALLOW yweb/news/zen/video_export -> library/python/deprecated/ticket_parser2 -ALLOW yweb/rca/server/app -> library/python/deprecated/ticket_parser2 -ALLOW yweb/verticals/scripts/sport_chats -> library/python/deprecated/ticket_parser2 -ALLOW yweb/yasap/answers/answers -> library/python/deprecated/ticket_parser2 -ALLOW yweb/yasap/answers/answers_history/lib -> library/python/deprecated/ticket_parser2 -ALLOW yweb/yasap/pdb/pdb-backend/src -> library/python/deprecated/ticket_parser2 -ALLOW zootopia/analytics/drive/binary/drive -> library/python/deprecated/ticket_parser2 -ALLOW zootopia/analytics/drive/source/drive/utils -> library/python/deprecated/ticket_parser2 -ALLOW zootopia/hub/planex/promo_backend/dispenser -> library/python/deprecated/ticket_parser2 -DENY .* -> library/python/deprecated/ticket_parser2 +ALLOW payplatform/nirvana/lib -> library/python/deprecated/ticket_parser2 +ALLOW plus/analytics/tools/bb_user_info -> library/python/deprecated/ticket_parser2 +ALLOW plus/cobra/project -> library/python/deprecated/ticket_parser2 +ALLOW plus/gift/project -> library/python/deprecated/ticket_parser2 +ALLOW plus/landing_backend/project -> library/python/deprecated/ticket_parser2 +ALLOW plus/oneyear/project -> library/python/deprecated/ticket_parser2 +ALLOW plus/plusminus/project -> library/python/deprecated/ticket_parser2 +ALLOW quality/antifraud/scripts/prod/dump_viewers_data -> library/python/deprecated/ticket_parser2 +ALLOW quality/antifraud/xurma/tools/xurma_admin/lib -> library/python/deprecated/ticket_parser2 +ALLOW quality/antifraud/xurma/tools/xurma_viewer/backend/lib -> library/python/deprecated/ticket_parser2 +ALLOW quality/functionality/chats/common/tvm_client -> library/python/deprecated/ticket_parser2 +ALLOW quality/functionality/entity_search/factqueries/custom/metro -> library/python/deprecated/ticket_parser2 +ALLOW quality/functionality/entity_search/factqueries/instructions/avatars_uploader -> library/python/deprecated/ticket_parser2 +ALLOW quality/functionality/turbo/ecommerce/smart_campaign_uploader/lib -> library/python/deprecated/ticket_parser2 +ALLOW quality/functionality/turbo/forms/job/lib -> library/python/deprecated/ticket_parser2 +ALLOW quality/functionality/turbo/tools/api_tasks/lib -> library/python/deprecated/ticket_parser2 +ALLOW quality/functionality/turbo/tools/duty_absence_notifier -> library/python/deprecated/ticket_parser2 +ALLOW quasar/infra/tasklets/datasync_uploader/impl -> library/python/deprecated/ticket_parser2 +ALLOW quasar/infra/tasklets/group_maintenance/impl -> library/python/deprecated/ticket_parser2 +ALLOW robot/pluto/patents/apphost -> library/python/deprecated/ticket_parser2 +ALLOW robot/samovar/tools/wikimedia_updates_reader -> library/python/deprecated/ticket_parser2 +ALLOW rt-research/broadmatching/scripts/tvm/update_service_tickets -> library/python/deprecated/ticket_parser2 +ALLOW rtc/recorder -> library/python/deprecated/ticket_parser2 +ALLOW rtmapreduce/monitoring/solomon -> library/python/deprecated/ticket_parser2 +ALLOW saas/tools/devops/billing_send -> library/python/deprecated/ticket_parser2 +ALLOW saas/tools/refresh_mon -> library/python/deprecated/ticket_parser2 +ALLOW saas/tools/user_if/ssm-front/backend -> library/python/deprecated/ticket_parser2 +ALLOW samogon/libs/tvm_api -> library/python/deprecated/ticket_parser2 +ALLOW sandbox/projects/ab_testing -> library/python/deprecated/ticket_parser2 +ALLOW sandbox/projects/metrika/mobile/ios/symbols/upload_system_ios_symbols -> library/python/deprecated/ticket_parser2 +ALLOW sandbox/projects/noc/ExportNetworkMetering -> library/python/deprecated/ticket_parser2 +ALLOW sandbox/projects/noc/MeteringCacheZapekatel -> library/python/deprecated/ticket_parser2 +ALLOW sandbox/projects/noc/TopAS -> library/python/deprecated/ticket_parser2 +ALLOW sandbox/projects/quasar/datasync_uploader/lib -> library/python/deprecated/ticket_parser2 +ALLOW sandbox/projects/qyp -> library/python/deprecated/ticket_parser2 +ALLOW sandbox/projects/staff_login_checker/PrepareUidsFile -> library/python/deprecated/ticket_parser2 +ALLOW sandbox/projects/suggest/watchdog -> library/python/deprecated/ticket_parser2 +ALLOW sandbox/projects/yabs/duty_calendar -> library/python/deprecated/ticket_parser2 +ALLOW search/metadoc/tools/request_saas -> library/python/deprecated/ticket_parser2 +ALLOW security/takeout -> library/python/deprecated/ticket_parser2 +ALLOW sport/backend -> library/python/deprecated/ticket_parser2 +ALLOW sprav/snezhana_v3/lib -> library/python/deprecated/ticket_parser2 +ALLOW sup/ml/saas -> library/python/deprecated/ticket_parser2 +ALLOW sup/tools/bell_delete -> library/python/deprecated/ticket_parser2 +ALLOW sup/tools/datasync_loader -> library/python/deprecated/ticket_parser2 +ALLOW taxi/logistic-dispatcher/library/cargo_ld_test -> library/python/deprecated/ticket_parser2 +ALLOW taxi/logistic-dispatcher/tools/configure-sharding -> library/python/deprecated/ticket_parser2 +ALLOW taxi/logistic-dispatcher/tools/qa-axe/platform_requests -> library/python/deprecated/ticket_parser2 +ALLOW taxi/logistic-dispatcher/tools/quick-tvm/quick_tvm_generator -> library/python/deprecated/ticket_parser2 +ALLOW taxi/logistic-dispatcher/tools/rt-robot-dc-configuration -> library/python/deprecated/ticket_parser2 +ALLOW taxi/logistic-dispatcher/tools/unsafe-robot-configurations -> library/python/deprecated/ticket_parser2 +ALLOW testenv/core/api/ci -> library/python/deprecated/ticket_parser2 +ALLOW testenv/core/common -> library/python/deprecated/ticket_parser2 +ALLOW travel/avia/subscriptions/app/settings -> library/python/deprecated/ticket_parser2 +ALLOW travel/avia/travelers -> library/python/deprecated/ticket_parser2 +ALLOW travel/cpa/collectors/avia/aeroflot_boy -> library/python/deprecated/ticket_parser2 +ALLOW travel/cpa/collectors/generic/order -> library/python/deprecated/ticket_parser2 +ALLOW travel/cpa/collectors/lib -> library/python/deprecated/ticket_parser2 +ALLOW travel/cpa/collectors/suburban/suburban_boy -> library/python/deprecated/ticket_parser2 +ALLOW travel/cpa/collectors/train/im_boy -> library/python/deprecated/ticket_parser2 +ALLOW travel/hotels/devops/slack_forwarder -> library/python/deprecated/ticket_parser2 +ALLOW travel/hotels/lib/python3/tvm -> library/python/deprecated/ticket_parser2 +ALLOW travel/hotels/tools/api_req_replicator -> library/python/deprecated/ticket_parser2 +ALLOW travel/hotels/tools/cli -> library/python/deprecated/ticket_parser2 +ALLOW travel/hotels/tools/expedia_token_validator -> library/python/deprecated/ticket_parser2 +ALLOW travel/hotels/tools/room_photos_uploader -> library/python/deprecated/ticket_parser2 +ALLOW travel/library/python/tvm_ticket_provider -> library/python/deprecated/ticket_parser2 +ALLOW travel/orders/tools/library -> library/python/deprecated/ticket_parser2 +ALLOW travel/rasp/bus/admin/app -> library/python/deprecated/ticket_parser2 +ALLOW travel/rasp/bus_gdpr_api/src -> library/python/deprecated/ticket_parser2 +ALLOW travel/rasp/pathfinder_maps -> library/python/deprecated/ticket_parser2 +ALLOW travel/rasp/pathfinder_proxy/settings -> library/python/deprecated/ticket_parser2 +ALLOW travel/rasp/pathfinder_proxy -> library/python/deprecated/ticket_parser2 +ALLOW trust/utils -> library/python/deprecated/ticket_parser2 +ALLOW weather/libs/utils/tvm -> library/python/deprecated/ticket_parser2 +ALLOW weather/workers/exports/logbroker -> library/python/deprecated/ticket_parser2 +ALLOW yabs/indoor/py_libs/banana_client -> library/python/deprecated/ticket_parser2 +ALLOW yabs/indoor/py_libs/indoor_client -> library/python/deprecated/ticket_parser2 +ALLOW yabs/indoor/py_libs/tvm -> library/python/deprecated/ticket_parser2 +ALLOW yabs/outdoor/libs/operators_api -> library/python/deprecated/ticket_parser2 +ALLOW yabs/python-libs/tornado-utils -> library/python/deprecated/ticket_parser2 +ALLOW yabs/python-libs/tvm -> library/python/deprecated/ticket_parser2 +ALLOW yabs/rmp/backend/src/tvm -> library/python/deprecated/ticket_parser2 +ALLOW yabs/stat/infra/idm/src -> library/python/deprecated/ticket_parser2 +ALLOW yabs/telephony/telephony_data_transfer -> library/python/deprecated/ticket_parser2 +ALLOW yabs/vh/cms-pgaas/chat_creator -> library/python/deprecated/ticket_parser2 +ALLOW yabs/vh/cms-pgaas/chat_lib -> library/python/deprecated/ticket_parser2 +ALLOW yabs/vh/cms-pgaas/cmnt_lib -> library/python/deprecated/ticket_parser2 +ALLOW yabs/vh/cms-pgaas/cms_common -> library/python/deprecated/ticket_parser2 +ALLOW yabs/vh/cms-pgaas/logbroker -> library/python/deprecated/ticket_parser2 +ALLOW yabs/vh/cms-pgaas/partner_api -> library/python/deprecated/ticket_parser2 +ALLOW yabs/vh/cms-pgaas/self_service_api -> library/python/deprecated/ticket_parser2 +ALLOW yabs/vh/cms-pgaas/strm_thumb_repeat_importer -> library/python/deprecated/ticket_parser2 +ALLOW yabs/vh/cms-pgaas/ugc_api -> library/python/deprecated/ticket_parser2 +ALLOW yabs/vh/cms-pgaas/utils/auth/tvm -> library/python/deprecated/ticket_parser2 +ALLOW yaphone/advisor/advisor -> library/python/deprecated/ticket_parser2 +ALLOW yaphone/advisor/common -> library/python/deprecated/ticket_parser2 +ALLOW yaphone/advisor/project -> library/python/deprecated/ticket_parser2 +ALLOW yaphone/dialer/project -> library/python/deprecated/ticket_parser2 +ALLOW ydo/analytics/nirvana/puidification/phone_masks_retriever -> library/python/deprecated/ticket_parser2 +ALLOW ydo/async_api/lib/logbroker_consumer -> library/python/deprecated/ticket_parser2 +ALLOW ydo/bg_task_processor/bin -> library/python/deprecated/ticket_parser2 +ALLOW ydo/libs/blackbox/test -> library/python/deprecated/ticket_parser2 +ALLOW ydo/libs/blackbox -> library/python/deprecated/ticket_parser2 +ALLOW ydo/libs/tvm -> library/python/deprecated/ticket_parser2 +ALLOW ydo/payments/product_orders_processor/bin -> library/python/deprecated/ticket_parser2 +ALLOW ydo/tools/messenger/sms_notify/lib -> library/python/deprecated/ticket_parser2 +ALLOW ydo/tools/messenger/sms_notify -> library/python/deprecated/ticket_parser2 +ALLOW ydo/tools/search_index/prepare_index_data/prepare_direct_certificates/lib -> library/python/deprecated/ticket_parser2 +ALLOW yp/idm_role_provider/src -> library/python/deprecated/ticket_parser2 +ALLOW yp/tests/blackbox_recipe/bin -> library/python/deprecated/ticket_parser2 +ALLOW yp/tests/secret_vault_recipe/bin -> library/python/deprecated/ticket_parser2 +ALLOW yt/cron/duty -> library/python/deprecated/ticket_parser2 +ALLOW yt/cron/map_users_to_pools -> library/python/deprecated/ticket_parser2 +ALLOW yweb/antiporno/cp_conv/prepare_suggestive_cp_img_basket -> library/python/deprecated/ticket_parser2 +ALLOW yweb/antispam/cid/library/normalizer -> library/python/deprecated/ticket_parser2 +ALLOW yweb/antispam/cid/library -> library/python/deprecated/ticket_parser2 +ALLOW yweb/antispam/clean_web/lib -> library/python/deprecated/ticket_parser2 +ALLOW yweb/antispam/clean_web/tools/make_alert -> library/python/deprecated/ticket_parser2 +ALLOW yweb/antispam/clean_web/tools/upload_images_to_mds -> library/python/deprecated/ticket_parser2 +ALLOW yweb/antispam/mascot/sources -> library/python/deprecated/ticket_parser2 +ALLOW yweb/antispam/pth/instances/ownpth/hostinfo_viewer -> library/python/deprecated/ticket_parser2 +ALLOW yweb/blender/data_delivery/rtmr_uploader -> library/python/deprecated/ticket_parser2 +ALLOW yweb/freshness/coronavirus/upload_data_to_rtmr -> library/python/deprecated/ticket_parser2 +ALLOW yweb/freshness/scripts/sport_wizard -> library/python/deprecated/ticket_parser2 +ALLOW yweb/news/common/python/logbroker -> library/python/deprecated/ticket_parser2 +ALLOW yweb/news/common/python/logbroker_py2 -> library/python/deprecated/ticket_parser2 +ALLOW yweb/news/common/python/tvm -> library/python/deprecated/ticket_parser2 +ALLOW yweb/news/media/vh_selfservice -> library/python/deprecated/ticket_parser2 +ALLOW yweb/news/news_back/api/partner -> library/python/deprecated/ticket_parser2 +ALLOW yweb/news/pq_importer -> library/python/deprecated/ticket_parser2 +ALLOW yweb/news/python -> library/python/deprecated/ticket_parser2 +ALLOW yweb/news/search/pyuploader -> library/python/deprecated/ticket_parser2 +ALLOW yweb/news/zen/video_export -> library/python/deprecated/ticket_parser2 +ALLOW yweb/rca/server/app -> library/python/deprecated/ticket_parser2 +ALLOW yweb/verticals/scripts/sport_chats -> library/python/deprecated/ticket_parser2 +ALLOW yweb/yasap/answers/answers -> library/python/deprecated/ticket_parser2 +ALLOW yweb/yasap/answers/answers_history/lib -> library/python/deprecated/ticket_parser2 +ALLOW yweb/yasap/pdb/pdb-backend/src -> library/python/deprecated/ticket_parser2 +ALLOW zootopia/analytics/drive/binary/drive -> library/python/deprecated/ticket_parser2 +ALLOW zootopia/analytics/drive/source/drive/utils -> library/python/deprecated/ticket_parser2 +ALLOW zootopia/hub/planex/promo_backend/dispenser -> library/python/deprecated/ticket_parser2 +DENY .* -> library/python/deprecated/ticket_parser2 diff --git a/build/rules/library_deps.policy b/build/rules/library_deps.policy index 954d0198c6..177c7c473f 100644 --- a/build/rules/library_deps.policy +++ b/build/rules/library_deps.policy @@ -4,7 +4,7 @@ ALLOW library -> util ALLOW library -> library ALLOW library -> certs ALLOW library/.*/(n)?yt -> mapreduce/yt -ALLOW library/java -> devtools/junit5-runner +ALLOW library/java -> devtools/junit5-runner ALLOW library/java/.*/ut -> devtools/(jtest)|(junit-runner) ALLOW library/java/.*/src/test -> devtools/(jtest)|(junit-runner) ALLOW library/java/.*/tests -> devtools/(jtest)|(junit-runner) @@ -16,7 +16,7 @@ ALLOW library/.*/ipreg -> ipreg ALLOW library/cpp/deprecated/ipreg1 -> ipreg ALLOW library/cpp/geobase -> geobase ALLOW library/python/zipatch -> vcs/svn/wc/client -ALLOW library/(java/ticket_parser2)|(hnsw) -> iceberg +ALLOW library/(java/ticket_parser2)|(hnsw) -> iceberg ALLOW library/python/bstr -> yt/python/client ALLOW library/python/django -> devtools/ya/yalibrary/makelists ALLOW library/python/django_abc_data -> intranet/sync_tools diff --git a/build/rules/passport.policy b/build/rules/passport.policy index f4358c718b..065c274de4 100644 --- a/build/rules/passport.policy +++ b/build/rules/passport.policy @@ -1,9 +1,9 @@ # PERSISTENT EXCEPTION: 'ya yav' handler ALLOW devtools/ya/handlers/yav -> passport/backend/vault/cli/yav/vault_client_cli -# PERSISTENT EXCEPTION: PASSP-31449 -ALLOW mail/so/daemons/antifraud -> passport/infra/daemons/ysa/fingerprint - +# PERSISTENT EXCEPTION: PASSP-31449 +ALLOW mail/so/daemons/antifraud -> passport/infra/daemons/ysa/fingerprint + # PERSISTENT EXCEPTION: useful for debug purposes ALLOW junk -> passport/ diff --git a/build/scripts/c_templates/svn_interface.c b/build/scripts/c_templates/svn_interface.c index d8bdd1a70d..39bcfa0f95 100644 --- a/build/scripts/c_templates/svn_interface.c +++ b/build/scripts/c_templates/svn_interface.c @@ -1,6 +1,6 @@ // Used indirectly. See build/scripts/vcs_info.py // ya-bin dump vcs-info > vcs.json -// python build/scripts/vcs_info.py vcs.json out.c build/scripts/c_templates/svn_interface.c <any_prefix>library/cpp/svnversion<any_suffix> +// python build/scripts/vcs_info.py vcs.json out.c build/scripts/c_templates/svn_interface.c <any_prefix>library/cpp/svnversion<any_suffix> #include "build/scripts/c_templates/svnversion.h" diff --git a/build/scripts/gen_mx_table.py b/build/scripts/gen_mx_table.py index 187c21c539..ed1d44d64b 100644 --- a/build/scripts/gen_mx_table.py +++ b/build/scripts/gen_mx_table.py @@ -5,7 +5,7 @@ tmpl = """ #include <kernel/matrixnet/mn_sse.h> -#include <library/cpp/archive/yarchive.h> +#include <library/cpp/archive/yarchive.h> #include <util/memory/blob.h> #include <util/generic/hash.h> diff --git a/build/stdafx.hpp b/build/stdafx.hpp index 98b15adda0..e8e4c92b89 100644 --- a/build/stdafx.hpp +++ b/build/stdafx.hpp @@ -139,7 +139,7 @@ #include <util/system/atomic.h> #include <util/system/yield.h> #include <util/system/filemap.h> -#include <library/cpp/deprecated/mapped_file/mapped_file.h> +#include <library/cpp/deprecated/mapped_file/mapped_file.h> #include <util/system/sys_alloc.h> #include <util/system/sysstat.h> #include <util/system/env.h> @@ -180,7 +180,7 @@ #include <util/memory/smallobj.h> #include <util/memory/segmented_string_pool.h> #include <util/memory/mmapalloc.h> -#include <library/cpp/deprecated/split/delim_string_iter.h> +#include <library/cpp/deprecated/split/delim_string_iter.h> #include <util/draft/ip.h> #include <util/draft/matrix.h> #include <util/draft/date.h> @@ -189,8 +189,8 @@ #include <util/draft/holder_vector.h> #include <util/generic/object_counter.h> #include <util/draft/datetime.h> -#include <library/cpp/deprecated/estimators/estimators.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/estimators/estimators.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <util/generic/array_size.h> #include <util/generic/bitmap.h> #include <util/generic/intrlist.h> @@ -254,7 +254,7 @@ #include <util/string/printf.h> #include <util/string/ascii.h> #include <util/string/cast.h> -#include <library/cpp/deprecated/split/split_iterator.h> +#include <library/cpp/deprecated/split/split_iterator.h> #include <util/string/util.h> #include <util/string/strip.h> #include <util/string/builder.h> diff --git a/build/ya.conf.json b/build/ya.conf.json index 5f7cc875d6..f1147fc277 100644 --- a/build/ya.conf.json +++ b/build/ya.conf.json @@ -435,12 +435,12 @@ }, "jstyle": { "description": "Java styler" - }, + }, "ktlint": { "description": "Run kotlin styler" }, - "ya_sed": { - "description": "This tool simplifies replacing of some text in Arcadia" + "ya_sed": { + "description": "This tool simplifies replacing of some text in Arcadia" }, "black": { "description": "Python styler, Python 3 only" @@ -1322,14 +1322,14 @@ } ] }, - "tvmknife": { - "tools": { + "tvmknife": { + "tools": { "tvmknife": { "bottle": "tvmknife", "executable": "tvmknife" } - }, - "platforms": [ + }, + "platforms": [ { "host": { "os": "LINUX" @@ -1348,8 +1348,8 @@ }, "default": true } - ] - }, + ] + }, "sandboxctl": { "tools": { "sandboxctl": { @@ -5341,7 +5341,7 @@ "default": true } ] - }, + }, "ktlint_bundle": { "tools": { "ktlint": { @@ -5386,33 +5386,33 @@ } ] }, - "ya_sed": { - "tools": { - "ya_sed": { - "bottle": "ya_sed", - "executable": "ya_sed" - } - }, - "platforms": [ - { - "host": { - "os": "LINUX" - }, - "default": true - }, - { - "host": { - "os": "WIN" - }, - "default": true - }, - { - "host": { - "os": "DARWIN" - }, - "default": true - } - ] + "ya_sed": { + "tools": { + "ya_sed": { + "bottle": "ya_sed", + "executable": "ya_sed" + } + }, + "platforms": [ + { + "host": { + "os": "LINUX" + }, + "default": true + }, + { + "host": { + "os": "WIN" + }, + "default": true + }, + { + "host": { + "os": "DARWIN" + }, + "default": true + } + ] }, "black": { "tools": { @@ -5909,17 +5909,17 @@ ] } }, - "tvmknife": { - "formula": { + "tvmknife": { + "formula": { "sandbox_id": 1162775119, - "match": "tvmknife" - }, - "executable": { + "match": "tvmknife" + }, + "executable": { "tvmknife": [ "tvmknife" ] - } - }, + } + }, "sandboxctl": { "formula": { "sandbox_id": [ @@ -7772,7 +7772,7 @@ "format.bat" ] } - }, + }, "ktlint_bundle": { "formula": { "sandbox_id": [ @@ -7802,18 +7802,18 @@ ] } }, - "ya_sed": { - "formula": { - "sandbox_id": [ - 1197714990 - ], - "match": "ya_sed" - }, - "executable": { - "ya_sed": [ - "ya_sed" - ] - } + "ya_sed": { + "formula": { + "sandbox_id": [ + 1197714990 + ], + "match": "ya_sed" + }, + "executable": { + "ya_sed": [ + "ya_sed" + ] + } }, "black": { "formula": { diff --git a/build/ya.make b/build/ya.make index 407b8f13e0..dd4a30cd77 100644 --- a/build/ya.make +++ b/build/ya.make @@ -12,8 +12,8 @@ PY_SRCS( ) PEERDIR( - library/cpp/deprecated/enum_codegen - library/cpp/deprecated/split + library/cpp/deprecated/enum_codegen + library/cpp/deprecated/split library/cpp/string_utils/scan ) diff --git a/build/ymake.core.conf b/build/ymake.core.conf index 081833998b..93e54d6a27 100644 --- a/build/ymake.core.conf +++ b/build/ymake.core.conf @@ -519,7 +519,7 @@ OPTIMIZE_PY_PROTOS_FLAG=no # tag:built-in ### @usage: RESOURCE([FORCE_TEXT ][Src Key]* [- Key=Value]*) # built-in ### Add data (resources, random files, strings) to the program) -### The common usage is to place Src file into binary. The Key is used to access it using library/cpp/resource or library/python/resource. +### The common usage is to place Src file into binary. The Key is used to access it using library/cpp/resource or library/python/resource. ### Alternative syntax with '- Key=Value' allows placing Value string as resource data into binary and make it accessible by Key. ### ### This is a simpler but less flexible option than ARCHIVE(), because in the case of ARCHIVE(), you have to use the data explicitly, @@ -965,7 +965,7 @@ when ($PY_PROTOS_FOR == "yes") { # tag:python-specific macro _PY_EVLOG_CMD_BASE(File, Suf, Args...) { .CMD=$_PY_PROTO_CMD_BASE($File $Suf $Args) - .PEERDIR=library/cpp/eventlog/proto + .PEERDIR=library/cpp/eventlog/proto } # tag:python-specific tag:proto @@ -981,7 +981,7 @@ macro _PY_EVLOG_CMD_INTERNAL(File) { # tag:java-specific tag:proto macro _JAVA_EVLOG_CMD(File) { .CMD=$COPY_CMD ${input:File} ${output;nopath;noext;norel;suf=_ev.proto:File} ${kv;hide:"p EV"} ${kv;hide:"pc yellow"} - .PEERDIR=library/cpp/eventlog/proto + .PEERDIR=library/cpp/eventlog/proto } # tag:sanitize @@ -1421,7 +1421,7 @@ when ($COMMON_LINK_SETTINGS == "yes") { when (($MUSL != "yes" && $WITH_VALGRIND == "yes") || $SANITIZER_DEFINED == "yes") { when ($ALLOCATOR in [ "TCMALLOC", "TCMALLOC_SMALL_BUT_SLOW", "TCMALLOC_NUMA_256K", "TCMALLOC_NUMA_LARGE_PAGES", "TCMALLOC_256K", "GOOGLE", "J", "LF", "LF_YT", "LF_DBG", "B", "BM", "C", "LOCKLESS", "YT", "MIM", "HU" ]) { - PEERDIR+=library/cpp/malloc/system + PEERDIR+=library/cpp/malloc/system } } otherwise { @@ -1453,14 +1453,14 @@ when ($COMMON_LINK_SETTINGS == "yes") { PEERDIR+=contrib/libs/tcmalloc/default } "GOOGLE" ? { - PEERDIR+=library/cpp/malloc/galloc + PEERDIR+=library/cpp/malloc/galloc } "J" ? { when ($WIN32 == "yes") { - PEERDIR+=library/cpp/malloc/system + PEERDIR+=library/cpp/malloc/system } otherwise { - PEERDIR+=library/cpp/malloc/jemalloc + PEERDIR+=library/cpp/malloc/jemalloc } } "LF" ? { @@ -1473,16 +1473,16 @@ when ($COMMON_LINK_SETTINGS == "yes") { PEERDIR+=library/cpp/lfalloc/dbg } "B" ? { - PEERDIR+=library/cpp/balloc + PEERDIR+=library/cpp/balloc } "BM" ? { - PEERDIR+=library/cpp/balloc_market + PEERDIR+=library/cpp/balloc_market } "C" ? { - PEERDIR+=library/cpp/malloc/calloc + PEERDIR+=library/cpp/malloc/calloc } "LOCKLESS" ? { - PEERDIR+=library/cpp/malloc/lockless + PEERDIR+=library/cpp/malloc/lockless } "YT" ? { PEERDIR+=library/cpp/ytalloc/impl @@ -1491,7 +1491,7 @@ when ($COMMON_LINK_SETTINGS == "yes") { } when ($ALLOCATOR == "SYSTEM") { - PEERDIR+=library/cpp/malloc/system + PEERDIR+=library/cpp/malloc/system } when ($WERROR != "no") { when ($WERROR_MODE == "all" || ($WERROR_MODE == "compiler_specific" && $WERROR == "yes")) { @@ -1642,11 +1642,11 @@ module _BASE_PROGRAM: _LINK_UNIT { } when ($CPU_CHECK == "yes") { - PEERDIR += library/cpp/cpuid_check + PEERDIR += library/cpp/cpuid_check } when ($USE_ARC_PROFILE == "yes" && $NOUTIL != "yes") { - PEERDIR += library/cpp/execprofile/autostart + PEERDIR += library/cpp/execprofile/autostart } when ($SANITIZER_DEFINED == "yes") { @@ -5266,7 +5266,7 @@ macro ADD_PERL_MODULE(Dir, Module) { ### - J - The JEMalloc allocator (https://a.yandex-team.ru/arc/trunk/arcadia/library/malloc/jemalloc) ### - B - The balloc allocator named Pyotr Popov and Anton Samokhvalov ### - Discussion: https://ironpeter.at.yandex-team.ru/replies.xml?item_no=126 -### - Code: https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/balloc +### - Code: https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/balloc ### - BM - The balloc for market (agri@ commits from july 2018 till November 2018 saved) ### - C - Like B, but can be disabled for each thread to LF or SYSTEM one (B can be disabled only to SYSTEM) ### - MIM - Microsoft's mimalloc (actual version) (https://a.yandex-team.ru/arc/trunk/arcadia/library/malloc/mimalloc) @@ -5839,7 +5839,7 @@ macro _SRC("pln", SRC, SRCFLAGS...) { # tag:src-processing macro _SRC("xsyn", SRC, SRCFLAGS...) { - .CMD=$YMAKE_PYTHON ${input:"library/cpp/xml/parslib/xsyn2ragel.py"} ${input:SRC} ${input:"library/cpp/xml/parslib/xmlpars.xh"} dontuse ${output;stdout:SRC.h.rl5} ${kv;hide:"p XN"} ${kv;hide:"pc yellow"} + .CMD=$YMAKE_PYTHON ${input:"library/cpp/xml/parslib/xsyn2ragel.py"} ${input:SRC} ${input:"library/cpp/xml/parslib/xmlpars.xh"} dontuse ${output;stdout:SRC.h.rl5} ${kv;hide:"p XN"} ${kv;hide:"pc yellow"} } # tag:src-processing @@ -6406,7 +6406,7 @@ macro ARCHIVE_ASM(NAME="", DONTCOMPRESS?"-p":"", REQUIREMENTS[], Files...) { # tag:yweb-specific macro PIRE_INLINE_CMD(SRC) { - .CMD=${tool:"library/cpp/regex/pire/inline"} -o ${output:SRC} ${input:SRC} ${output_include;hide:SRC} ${kv;hide:"p PI"} ${kv;hide:"pc yellow"} + .CMD=${tool:"library/cpp/regex/pire/inline"} -o ${output:SRC} ${input:SRC} ${output_include;hide:SRC} ${kv;hide:"p PI"} ${kv;hide:"pc yellow"} } # tag:yweb-specific @@ -6790,7 +6790,7 @@ macro _MX_BIN_TO_INFO(Src) { MX_GEN_TABLE_INCLS=${output_include;hide:"yabs_mx_calc_table.h"} \ ${output_include;hide:"kernel/matrixnet/mn_sse.h"} \ -${output_include;hide:"library/cpp/archive/yarchive.h"} \ +${output_include;hide:"library/cpp/archive/yarchive.h"} \ ${output_include;hide:"util/memory/blob.h"} \ ${output_include;hide:"util/generic/hash.h"} \ ${output_include;hide:"util/generic/ptr.h"} \ @@ -6799,7 +6799,7 @@ ${output_include;hide:"util/generic/singleton.h"} macro _MX_GEN_TABLE(Srcs...) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/gen_mx_table.py"} $Srcs ${output;stdout:"mx_tables.cpp"} $MX_GEN_TABLE_INCLS ${kv;hide:"p MX"} ${kv;hide:"pc yellow"} PEERDIR(kernel/matrixnet) - PEERDIR(library/cpp/archive) + PEERDIR(library/cpp/archive) } RELEV_FML_CODEGEN_INCLS=${output_include;hide:"kernel/relevfml/relev_fml.h"} ${output_include;hide:"library/cpp/sse/sse.h"} diff --git a/contrib/libs/cctz/tzdata/factory.cpp b/contrib/libs/cctz/tzdata/factory.cpp index 5a4b4a27b6..b80c63b0f1 100644 --- a/contrib/libs/cctz/tzdata/factory.cpp +++ b/contrib/libs/cctz/tzdata/factory.cpp @@ -1,6 +1,6 @@ #include <contrib/libs/cctz/include/cctz/zone_info_source.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> #include <util/generic/string.h> #include <util/stream/str.h> diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/load_arcadia_root_certs.cpp b/contrib/libs/grpc/src/core/lib/security/security_connector/load_arcadia_root_certs.cpp index d07d3b21b8..517e5ec200 100644 --- a/contrib/libs/grpc/src/core/lib/security/security_connector/load_arcadia_root_certs.cpp +++ b/contrib/libs/grpc/src/core/lib/security/security_connector/load_arcadia_root_certs.cpp @@ -1,6 +1,6 @@ #include "load_arcadia_root_certs.h" -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> namespace grpc_core { grpc_slice LoadArcadiaRootCerts() { diff --git a/contrib/libs/libxml/yencoding.cpp b/contrib/libs/libxml/yencoding.cpp index 8092bbfb1c..88cf0a695d 100644 --- a/contrib/libs/libxml/yencoding.cpp +++ b/contrib/libs/libxml/yencoding.cpp @@ -1,8 +1,8 @@ #include "yencoding.h" -#include <library/cpp/charset/codepage.h> -#include <library/cpp/charset/recyr.hh> +#include <library/cpp/charset/codepage.h> +#include <library/cpp/charset/recyr.hh> int diff --git a/contrib/libs/pire/pire/stub/utf8.h b/contrib/libs/pire/pire/stub/utf8.h index 51ea0479d4..7d9bd06048 100644 --- a/contrib/libs/pire/pire/stub/utf8.h +++ b/contrib/libs/pire/pire/stub/utf8.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/charset/codepage.h> +#include <library/cpp/charset/codepage.h> #include <util/charset/unidata.h> inline wchar32 to_lower(wchar32 c) { diff --git a/contrib/python/protobuf/py2/google/protobuf/pyext/message.cc b/contrib/python/protobuf/py2/google/protobuf/pyext/message.cc index 8b41ca47dd..5b333fe386 100644 --- a/contrib/python/protobuf/py2/google/protobuf/pyext/message.cc +++ b/contrib/python/protobuf/py2/google/protobuf/pyext/message.cc @@ -730,7 +730,7 @@ bool IsValidUTF8(PyObject* obj) { } } -bool AllowInvalidUTF8(const FieldDescriptor* field) { return false; } +bool AllowInvalidUTF8(const FieldDescriptor* field) { return false; } PyObject* CheckString(PyObject* arg, const FieldDescriptor* descriptor) { GOOGLE_DCHECK(descriptor->type() == FieldDescriptor::TYPE_STRING || @@ -741,7 +741,7 @@ PyObject* CheckString(PyObject* arg, const FieldDescriptor* descriptor) { return NULL; } - if (!IsValidUTF8(arg) && !AllowInvalidUTF8(descriptor)) { + if (!IsValidUTF8(arg) && !AllowInvalidUTF8(descriptor)) { PyObject* repr = PyObject_Repr(arg); PyErr_Format(PyExc_ValueError, "%s has type str, but isn't valid UTF-8 " diff --git a/contrib/python/protobuf/py3/google/protobuf/pyext/message.cc b/contrib/python/protobuf/py3/google/protobuf/pyext/message.cc index 8b41ca47dd..5b333fe386 100644 --- a/contrib/python/protobuf/py3/google/protobuf/pyext/message.cc +++ b/contrib/python/protobuf/py3/google/protobuf/pyext/message.cc @@ -730,7 +730,7 @@ bool IsValidUTF8(PyObject* obj) { } } -bool AllowInvalidUTF8(const FieldDescriptor* field) { return false; } +bool AllowInvalidUTF8(const FieldDescriptor* field) { return false; } PyObject* CheckString(PyObject* arg, const FieldDescriptor* descriptor) { GOOGLE_DCHECK(descriptor->type() == FieldDescriptor::TYPE_STRING || @@ -741,7 +741,7 @@ PyObject* CheckString(PyObject* arg, const FieldDescriptor* descriptor) { return NULL; } - if (!IsValidUTF8(arg) && !AllowInvalidUTF8(descriptor)) { + if (!IsValidUTF8(arg) && !AllowInvalidUTF8(descriptor)) { PyObject* repr = PyObject_Repr(arg); PyErr_Format(PyExc_ValueError, "%s has type str, but isn't valid UTF-8 " diff --git a/contrib/restricted/thrift/README b/contrib/restricted/thrift/README index 92c9969423..11100fcaf6 100644 --- a/contrib/restricted/thrift/README +++ b/contrib/restricted/thrift/README @@ -1 +1 @@ -This lib is part of https://github.com/apache/thrift: lib/cpp/src/thrift +This lib is part of https://github.com/apache/thrift: lib/cpp/src/thrift diff --git a/contrib/restricted/thrift/compiler/README b/contrib/restricted/thrift/compiler/README index 4393a826d7..857734860d 100644 --- a/contrib/restricted/thrift/compiler/README +++ b/contrib/restricted/thrift/compiler/README @@ -1 +1 @@ -This lib is part of https://github.com/apache/thrift: compiler/cpp/src/thrift +This lib is part of https://github.com/apache/thrift: compiler/cpp/src/thrift diff --git a/contrib/restricted/thrift/compiler/thrift/thriftl.cc b/contrib/restricted/thrift/compiler/thrift/thriftl.cc index b2f7ad0ddf..6bc131ee27 100644 --- a/contrib/restricted/thrift/compiler/thrift/thriftl.cc +++ b/contrib/restricted/thrift/compiler/thrift/thriftl.cc @@ -1,3475 +1,3475 @@ -#line 2 "thriftl.cc" - -#line 4 "thriftl.cc" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include <inttypes.h> -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. - */ -#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE yylex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-yylineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. - */ - #define YY_LESS_LINENO(n) \ - do { \ - int yyl;\ - for ( yyl = n; yyl < yyleng; ++yyl )\ - if ( yytext[yyl] == '\n' )\ - --yylineno;\ - }while(0) - #define YY_LINENO_REWIND_TO(dst) \ - do {\ - const char *p;\ - for ( p = yy_cp-1; p >= (dst); --p)\ - if ( *p == '\n' )\ - --yylineno;\ - }while(0) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state ( void ); - -static void yyensure_buffer_stack ( void ); -static void yy_load_buffer_state ( void ); -static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); - -void *yyalloc ( yy_size_t ); -void *yyrealloc ( void *, yy_size_t ); -void yyfree ( void * ); - -#define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define yywrap() (/*CONSTCOND*/1) -#define YY_SKIP_YYWRAP -typedef flex_uint8_t YY_CHAR; - -FILE *yyin = NULL, *yyout = NULL; - -typedef int yy_state_type; - -#define YY_FLEX_LEX_COMPAT -extern int yylineno; -int yylineno = 1; - -extern char yytext[]; - -static yy_state_type yy_get_previous_state ( void ); -static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); -static int yy_get_next_buffer ( void ); -static void yynoreturn yy_fatal_error ( const char* msg ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - if ( yyleng >= YYLMAX ) \ - YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ - yy_flex_strncpy( yytext, (yytext_ptr), yyleng + 1 ); \ - (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 169 -#define YY_END_OF_BUFFER 170 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static const flex_int16_t yy_accept[768] = - { 0, - 1, 1, 170, 168, 1, 1, 167, 6, 59, 7, - 8, 166, 168, 168, 163, 163, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 1, 6, 0, 163, 163, 0, 166, 4, - 5, 0, 0, 165, 165, 0, 165, 165, 165, 165, - 165, 165, 165, 73, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 87, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 34, 111, 165, 114, 118, 165, 165, 165, 165, - - 165, 165, 165, 165, 165, 165, 165, 126, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 166, 3, - 5, 164, 165, 61, 165, 165, 165, 165, 165, 165, - 165, 165, 71, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 83, 85, 165, 165, 165, 165, 93, 165, 165, 165, - 165, 165, 165, 165, 165, 105, 165, 165, 165, 165, - 35, 36, 37, 165, 165, 165, 165, 165, 165, 165, - - 165, 43, 165, 165, 165, 122, 165, 124, 125, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 45, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 149, 165, 165, 165, 165, 165, 165, - 154, 155, 165, 165, 165, 165, 165, 165, 161, 165, - 165, 0, 2, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 72, 165, 165, 165, 165, 32, 165, - 33, 77, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 89, 90, 165, 165, - - 165, 165, 165, 165, 165, 54, 165, 102, 165, 165, - 165, 165, 165, 107, 165, 165, 110, 165, 165, 165, - 165, 165, 165, 165, 165, 44, 165, 165, 165, 123, - 165, 165, 165, 128, 165, 165, 165, 165, 165, 165, - 165, 165, 134, 165, 165, 165, 165, 165, 165, 139, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 145, 146, 165, 165, 10, 165, 165, 165, 165, - 165, 165, 165, 31, 165, 158, 165, 160, 165, 165, - 60, 165, 165, 165, 165, 165, 165, 165, 165, 70, - 165, 58, 75, 165, 76, 78, 79, 80, 165, 55, - - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 92, 165, 165, 97, 165, 165, 165, 165, - 165, 9, 165, 104, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 130, 165, 165, 165, 165, 133, 165, - 165, 165, 136, 165, 165, 42, 165, 165, 41, 165, - 165, 165, 165, 142, 165, 165, 147, 165, 165, 150, - 49, 165, 165, 153, 165, 165, 159, 165, 165, 165, - 162, 165, 165, 165, 165, 165, 165, 165, 165, 74, - 40, 165, 165, 165, 165, 165, 165, 165, 165, 86, - - 165, 38, 165, 91, 165, 95, 165, 165, 100, 101, - 165, 165, 165, 165, 109, 165, 113, 165, 115, 165, - 165, 165, 119, 120, 165, 121, 46, 165, 165, 165, - 165, 165, 165, 129, 165, 165, 165, 135, 138, 165, - 165, 140, 165, 141, 39, 48, 143, 165, 52, 165, - 165, 151, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 63, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 82, 84, 165, 88, 165, 165, - 165, 165, 165, 51, 103, 106, 165, 165, 30, 165, - 165, 165, 165, 165, 127, 165, 165, 131, 165, 165, - - 165, 165, 165, 53, 165, 165, 165, 47, 165, 156, - 165, 25, 165, 165, 165, 165, 165, 64, 165, 66, - 165, 165, 69, 165, 81, 165, 165, 14, 165, 165, - 165, 165, 165, 99, 165, 108, 165, 165, 165, 165, - 165, 57, 165, 165, 165, 165, 137, 56, 165, 165, - 165, 165, 152, 157, 165, 165, 165, 165, 62, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 98, - 50, 165, 165, 117, 165, 11, 165, 165, 132, 20, - 165, 165, 165, 148, 29, 165, 165, 165, 165, 67, - 165, 165, 165, 165, 165, 165, 94, 96, 112, 116, - - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 13, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 165, 165, 65, 165, 16, 165, - 165, 165, 15, 21, 165, 165, 165, 165, 144, 165, - 27, 26, 68, 12, 165, 165, 19, 165, 165, 165, - 28, 165, 165, 22, 165, 165, 165, 165, 165, 165, - 17, 18, 165, 24, 165, 23, 0 - } ; - -static const YY_CHAR yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 4, 5, 1, 1, 6, 4, 7, - 7, 8, 9, 7, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 17, 19, 17, 7, 7, 7, - 7, 7, 1, 1, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 29, 30, 31, 32, 33, 34, - 29, 35, 36, 37, 38, 29, 29, 29, 29, 29, - 7, 1, 7, 1, 39, 1, 40, 41, 42, 43, - - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 7, 1, 7, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static const YY_CHAR yy_meta[66] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 5, - 5, 5, 5, 4, 5, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, - 5, 5, 5, 4, 5, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6 - } ; - -static const flex_int16_t yy_base[774] = - { 0, - 0, 0, 1609, 1610, 64, 66, 1610, 0, 1610, 1610, - 1610, 60, 61, 74, 71, 1545, 1597, 73, 126, 61, - 96, 102, 117, 116, 172, 152, 77, 186, 76, 81, - 78, 154, 110, 173, 167, 204, 185, 120, 205, 104, - 164, 100, 87, 0, 257, 0, 1543, 268, 69, 1597, - 0, 0, 1594, 1593, 82, 276, 245, 84, 287, 166, - 107, 183, 115, 241, 123, 187, 206, 218, 219, 248, - 290, 269, 247, 200, 291, 255, 251, 293, 303, 306, - 304, 311, 313, 314, 315, 317, 318, 316, 91, 88, - 89, 1592, 1591, 319, 335, 1590, 321, 169, 209, 324, - - 310, 328, 322, 325, 329, 337, 330, 1589, 348, 339, - 342, 344, 327, 352, 347, 356, 363, 350, 346, 368, - 373, 390, 395, 398, 400, 407, 408, 410, 411, 412, - 409, 414, 425, 413, 415, 418, 417, 419, 424, 111, - 0, 0, 416, 1588, 93, 421, 457, 424, 226, 467, - 422, 448, 1587, 435, 468, 469, 470, 473, 472, 474, - 476, 480, 479, 481, 482, 484, 486, 487, 488, 489, - 490, 492, 491, 493, 496, 498, 505, 494, 497, 499, - 495, 507, 500, 515, 517, 521, 509, 524, 519, 542, - 1586, 1585, 1584, 546, 552, 554, 549, 560, 558, 564, - - 559, 1583, 561, 562, 563, 1582, 565, 1581, 1580, 566, - 567, 569, 568, 571, 570, 572, 573, 576, 577, 578, - 580, 575, 579, 574, 581, 582, 585, 583, 584, 1579, - 591, 589, 597, 600, 602, 607, 604, 610, 603, 621, - 627, 630, 632, 1578, 634, 643, 639, 644, 647, 648, - 1577, 1576, 645, 651, 650, 654, 655, 656, 1575, 658, - 657, 235, 1610, 659, 660, 663, 662, 667, 679, 664, - 674, 661, 665, 1574, 672, 675, 690, 676, 1573, 692, - 1572, 1571, 699, 700, 703, 704, 702, 705, 706, 709, - 710, 711, 714, 715, 712, 716, 1570, 721, 722, 720, - - 718, 725, 717, 727, 724, 1569, 728, 1568, 729, 731, - 726, 730, 738, 1567, 735, 745, 1566, 742, 739, 741, - 746, 747, 750, 766, 770, 1565, 774, 778, 780, 1564, - 781, 783, 782, 1563, 785, 787, 788, 790, 794, 796, - 792, 798, 1562, 793, 800, 799, 801, 804, 806, 1561, - 802, 805, 808, 807, 809, 810, 816, 813, 817, 821, - 823, 1560, 1559, 818, 819, 1558, 824, 833, 822, 825, - 839, 840, 829, 1557, 842, 1556, 846, 1555, 854, 861, - 1554, 862, 847, 858, 866, 863, 869, 871, 874, 1553, - 882, 1552, 1551, 883, 1550, 1549, 1548, 1547, 887, 1546, - - 889, 890, 892, 893, 895, 896, 900, 901, 906, 902, - 907, 899, 1545, 910, 903, 1544, 908, 911, 905, 909, - 915, 1543, 912, 1542, 919, 914, 913, 917, 918, 923, - 921, 920, 925, 924, 927, 928, 926, 930, 929, 938, - 961, 965, 966, 1541, 968, 970, 972, 973, 1540, 974, - 975, 977, 1539, 976, 978, 1538, 980, 979, 1537, 982, - 984, 988, 985, 1536, 989, 986, 987, 990, 991, 1535, - 1534, 992, 993, 1533, 999, 994, 1532, 998, 1000, 1001, - 1531, 1015, 1008, 1013, 1018, 1020, 1027, 1043, 1044, 1530, - 1529, 1003, 1005, 1051, 1052, 1009, 1053, 1056, 1057, 1528, - - 1058, 1527, 1059, 1526, 1060, 1061, 1062, 1063, 1525, 1064, - 1065, 1066, 1068, 1070, 1524, 1073, 1523, 1074, 1522, 1067, - 1079, 1080, 1521, 1520, 1085, 1519, 1518, 1086, 1078, 1088, - 1075, 1089, 1072, 1517, 1077, 1092, 1096, 1516, 1515, 1098, - 1097, 1514, 1103, 1513, 1512, 1511, 1510, 1081, 1509, 1100, - 1084, 1508, 1122, 1124, 1129, 1132, 1093, 1135, 1137, 1136, - 1138, 1507, 1139, 1140, 1143, 101, 1145, 1141, 1144, 1146, - 1147, 1148, 1149, 1150, 1506, 1505, 1151, 1504, 1154, 1157, - 1160, 1152, 1153, 1503, 1502, 1501, 1155, 1159, 1500, 1161, - 1164, 1171, 1174, 1163, 1499, 1175, 1166, 1498, 1176, 1179, - - 1162, 1181, 1189, 1497, 1199, 1201, 1205, 1496, 1208, 1495, - 1211, 1494, 1212, 1213, 1215, 1216, 1217, 1493, 1219, 1486, - 1221, 1218, 1474, 1223, 1471, 1222, 1225, 1470, 1230, 1232, - 1224, 1226, 1227, 1469, 1233, 1468, 1229, 1235, 1234, 1237, - 1236, 1466, 1243, 1238, 1249, 1251, 1465, 1464, 1253, 1252, - 1255, 1239, 1462, 1461, 1261, 1263, 1265, 1266, 1460, 1267, - 1269, 995, 1280, 1274, 1275, 1281, 1284, 1290, 1291, 1459, - 1458, 1294, 1296, 1457, 1297, 1456, 1299, 1300, 1455, 1454, - 1301, 1303, 1302, 1453, 1452, 1305, 1304, 1308, 1312, 1451, - 1316, 1306, 1313, 1318, 1319, 1321, 1450, 1449, 1446, 1445, - - 1322, 1325, 1333, 1314, 1334, 1336, 1337, 1339, 1338, 1317, - 1340, 1343, 1444, 1352, 1354, 1356, 1360, 1364, 1365, 1362, - 1371, 1372, 1373, 1375, 1374, 1376, 1443, 1381, 1442, 1377, - 1378, 1382, 1440, 1438, 1386, 1383, 1385, 1387, 1436, 1388, - 1435, 1430, 1428, 1071, 1395, 1399, 506, 1390, 1403, 1391, - 501, 1400, 1409, 423, 1412, 1393, 1405, 1413, 1389, 1414, - 349, 333, 1416, 231, 1418, 224, 1610, 1482, 1486, 1488, - 92, 1494, 1497 - } ; - -static const flex_int16_t yy_def[774] = - { 0, - 767, 1, 767, 767, 767, 767, 767, 768, 767, 767, - 767, 769, 767, 767, 769, 15, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 767, 768, 767, 15, 15, 767, 771, 767, - 772, 773, 770, 770, 770, 767, 25, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 767, 767, - 772, 773, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 767, 767, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 0, 767, 767, 767, - 767, 767, 767 - } ; - -static const flex_int16_t yy_nxt[1676] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 16, 16, 16, 16, 16, 16, 17, - 18, 17, 17, 19, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 20, 21, - 22, 23, 24, 25, 26, 27, 17, 28, 29, 17, - 30, 31, 32, 33, 34, 17, 35, 36, 37, 38, - 39, 40, 41, 42, 17, 43, 43, 43, 43, 45, - 53, 46, 49, 49, 49, 49, 49, 49, 49, 49, - 45, 50, 53, 48, 51, 53, 53, 53, 43, 43, - 53, 53, 48, 53, 48, 49, 55, 53, 53, 59, - - 53, 192, 53, 48, 193, 53, 144, 143, 191, 53, - 53, 53, 48, 53, 48, 97, 53, 100, 262, 53, - 98, 263, 265, 621, 53, 53, 53, 87, 99, 53, - 88, 101, 53, 52, 56, 53, 60, 57, 57, 57, - 57, 57, 57, 57, 57, 65, 61, 138, 62, 66, - 134, 135, 63, 64, 152, 67, 70, 58, 68, 75, - 154, 53, 106, 53, 107, 69, 108, 71, 157, 76, - 72, 73, 129, 53, 74, 53, 53, 130, 53, 77, - 56, 53, 53, 57, 57, 57, 57, 57, 57, 57, - 57, 81, 53, 102, 53, 53, 53, 103, 89, 82, - - 90, 104, 83, 91, 92, 84, 115, 105, 85, 53, - 116, 86, 109, 53, 53, 53, 110, 136, 53, 111, - 200, 137, 78, 151, 79, 153, 117, 53, 53, 112, - 93, 126, 113, 53, 80, 53, 114, 94, 95, 158, - 53, 127, 262, 96, 131, 263, 169, 118, 128, 270, - 53, 119, 132, 767, 120, 121, 53, 53, 133, 159, - 53, 160, 122, 123, 53, 124, 201, 125, 49, 49, - 49, 49, 49, 49, 49, 49, 56, 161, 53, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 54, 53, 54, 155, 53, - - 53, 168, 53, 174, 156, 162, 163, 54, 145, 146, - 166, 147, 53, 53, 173, 53, 148, 149, 150, 53, - 53, 167, 53, 53, 53, 53, 53, 53, 53, 164, - 53, 53, 170, 53, 53, 171, 53, 53, 53, 53, - 175, 172, 53, 165, 53, 177, 53, 180, 53, 181, - 176, 53, 203, 53, 183, 53, 53, 53, 53, 53, - 178, 53, 179, 184, 182, 53, 185, 218, 187, 188, - 186, 189, 53, 194, 190, 208, 195, 53, 202, 204, - 210, 199, 53, 206, 207, 196, 205, 209, 211, 212, - 219, 216, 197, 198, 220, 214, 215, 217, 221, 53, - - 227, 222, 228, 226, 53, 213, 229, 53, 230, 53, - 231, 223, 233, 224, 225, 232, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 234, - 53, 53, 53, 53, 53, 139, 139, 139, 139, 139, - 139, 139, 139, 264, 53, 237, 235, 242, 266, 236, - 239, 269, 238, 246, 240, 251, 256, 53, 247, 260, - 257, 248, 261, 241, 245, 252, 53, 243, 249, 250, - 253, 244, 254, 258, 259, 255, 53, 53, 53, 53, - 272, 53, 53, 53, 267, 53, 271, 273, 53, 53, - 53, 53, 274, 53, 268, 53, 53, 53, 53, 53, - - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 275, 278, 280, 53, 53, 53, 277, 53, 281, - 283, 276, 279, 282, 53, 289, 53, 290, 53, 292, - 53, 295, 296, 53, 285, 293, 308, 286, 284, 291, - 297, 298, 307, 287, 288, 299, 294, 300, 306, 301, - 309, 53, 302, 305, 311, 53, 312, 310, 53, 316, - 314, 53, 303, 53, 313, 315, 304, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 317, 318, 324, 53, 319, - - 53, 321, 320, 323, 325, 328, 53, 322, 336, 53, - 329, 53, 53, 53, 332, 346, 53, 326, 333, 53, - 327, 335, 344, 330, 337, 334, 340, 331, 341, 350, - 53, 339, 338, 343, 353, 342, 53, 347, 345, 53, - 348, 53, 351, 53, 352, 349, 354, 355, 53, 357, - 359, 361, 53, 53, 53, 362, 53, 53, 356, 53, - 53, 358, 360, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 366, 53, 367, 363, 382, - 364, 53, 365, 53, 53, 53, 368, 370, 53, 375, - 381, 384, 369, 374, 371, 372, 379, 383, 385, 53, - - 387, 53, 378, 373, 388, 377, 376, 380, 53, 53, - 386, 53, 53, 53, 53, 53, 392, 389, 53, 53, - 53, 53, 390, 53, 53, 53, 53, 53, 391, 53, - 53, 53, 394, 53, 53, 53, 53, 53, 53, 53, - 53, 395, 393, 399, 53, 396, 398, 53, 53, 406, - 53, 53, 401, 402, 53, 53, 53, 397, 403, 53, - 400, 409, 410, 414, 404, 405, 413, 411, 412, 416, - 407, 415, 408, 418, 422, 53, 423, 425, 417, 53, - 419, 421, 420, 53, 427, 428, 432, 53, 424, 53, - 53, 53, 53, 426, 53, 429, 53, 53, 431, 53, - - 430, 53, 53, 53, 434, 53, 433, 53, 53, 53, - 53, 53, 435, 53, 53, 53, 53, 53, 53, 53, - 439, 441, 53, 442, 436, 53, 53, 53, 53, 445, - 53, 53, 53, 53, 53, 437, 440, 446, 53, 443, - 438, 449, 53, 447, 455, 448, 444, 451, 53, 53, - 450, 53, 457, 456, 463, 53, 53, 461, 452, 460, - 454, 458, 465, 53, 453, 459, 469, 53, 462, 466, - 53, 53, 53, 464, 471, 53, 468, 470, 53, 467, - 53, 484, 472, 53, 473, 483, 486, 485, 475, 477, - 474, 53, 53, 478, 488, 487, 53, 482, 53, 53, - - 476, 53, 53, 481, 53, 53, 479, 480, 53, 53, - 53, 53, 53, 489, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 492, 53, 53, 53, 53, - 53, 495, 53, 53, 53, 53, 53, 53, 53, 53, - 490, 493, 494, 504, 500, 502, 491, 53, 509, 497, - 499, 505, 498, 501, 503, 507, 496, 511, 508, 506, - 513, 514, 512, 515, 519, 518, 523, 510, 516, 521, - 53, 524, 520, 526, 53, 53, 517, 53, 522, 53, - 525, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 528, 53, 527, 53, 53, 53, 53, 53, 53, 53, - - 53, 53, 53, 53, 53, 531, 529, 53, 53, 53, - 53, 533, 53, 534, 53, 535, 691, 53, 53, 530, - 538, 541, 53, 542, 53, 544, 532, 53, 539, 53, - 540, 537, 536, 545, 551, 547, 53, 550, 554, 558, - 543, 555, 548, 546, 549, 553, 562, 559, 556, 552, - 561, 563, 53, 53, 564, 560, 557, 569, 565, 566, - 53, 53, 53, 573, 570, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 567, 53, - 53, 53, 53, 53, 53, 568, 53, 53, 53, 53, - 53, 574, 571, 53, 53, 53, 577, 53, 53, 575, - - 578, 53, 53, 572, 580, 53, 53, 53, 590, 53, - 579, 583, 53, 582, 586, 576, 588, 589, 591, 592, - 581, 595, 584, 587, 593, 594, 597, 596, 608, 585, - 599, 53, 598, 53, 606, 601, 600, 603, 53, 602, - 604, 53, 605, 607, 53, 53, 53, 53, 53, 53, - 53, 613, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 609, 53, 619, 53, 53, - 53, 53, 53, 53, 610, 53, 617, 618, 622, 611, - 53, 620, 612, 53, 53, 53, 614, 615, 53, 625, - 53, 627, 628, 631, 616, 634, 632, 626, 53, 623, - - 624, 633, 629, 630, 638, 639, 635, 636, 53, 644, - 53, 637, 640, 642, 53, 641, 643, 53, 647, 645, - 53, 53, 53, 648, 53, 53, 53, 53, 53, 646, - 53, 53, 53, 53, 53, 53, 53, 662, 53, 53, - 649, 53, 53, 53, 53, 53, 53, 53, 53, 650, - 653, 660, 53, 651, 654, 659, 656, 652, 53, 661, - 53, 53, 53, 658, 53, 657, 663, 669, 655, 666, - 53, 667, 53, 670, 53, 53, 53, 674, 53, 676, - 668, 664, 665, 53, 53, 671, 675, 672, 673, 53, - 53, 679, 677, 53, 680, 678, 681, 684, 689, 53, - - 53, 682, 683, 53, 687, 53, 53, 690, 53, 53, - 53, 53, 53, 53, 53, 53, 693, 53, 685, 688, - 686, 53, 53, 53, 692, 53, 53, 53, 53, 694, - 53, 53, 695, 697, 53, 696, 701, 698, 702, 711, - 700, 705, 53, 53, 708, 53, 53, 53, 53, 53, - 710, 699, 53, 712, 703, 727, 713, 714, 704, 707, - 709, 53, 715, 53, 716, 53, 706, 717, 720, 53, - 718, 53, 719, 53, 53, 721, 724, 726, 728, 723, - 53, 53, 53, 53, 53, 53, 53, 53, 722, 725, - 53, 53, 53, 730, 53, 53, 53, 53, 53, 53, - - 53, 736, 53, 733, 53, 729, 735, 734, 53, 53, - 737, 731, 53, 732, 53, 739, 740, 741, 53, 743, - 744, 53, 53, 53, 748, 53, 742, 53, 738, 747, - 750, 751, 745, 754, 752, 756, 746, 53, 753, 53, - 760, 757, 763, 749, 53, 53, 755, 53, 761, 53, - 758, 53, 53, 53, 53, 53, 762, 759, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 765, 53, 53, 53, 764, 53, 53, 53, - 53, 766, 44, 53, 44, 44, 44, 44, 47, 47, - 54, 54, 54, 54, 141, 53, 141, 141, 141, 141, - - 142, 142, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - - 53, 53, 53, 767, 140, 767, 53, 767, 767, 3, - 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767 - } ; - -static const flex_int16_t yy_chk[1676] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 5, 5, 6, 6, 12, - 20, 12, 13, 13, 13, 13, 13, 13, 13, 13, - 15, 14, 18, 12, 14, 29, 27, 31, 43, 43, - 30, 55, 49, 58, 15, 771, 18, 90, 91, 20, - - 89, 90, 145, 12, 91, 21, 58, 55, 89, 42, - 566, 22, 49, 40, 15, 29, 61, 31, 140, 33, - 30, 140, 145, 566, 63, 24, 23, 27, 30, 38, - 27, 31, 65, 15, 19, 19, 21, 19, 19, 19, - 19, 19, 19, 19, 19, 22, 21, 42, 21, 22, - 40, 40, 21, 21, 61, 22, 23, 19, 22, 24, - 63, 26, 33, 32, 33, 22, 33, 23, 65, 24, - 23, 23, 38, 41, 23, 60, 35, 38, 98, 24, - 25, 25, 34, 25, 25, 25, 25, 25, 25, 25, - 25, 26, 62, 32, 37, 28, 66, 32, 28, 26, - - 28, 32, 26, 28, 28, 26, 35, 32, 26, 74, - 35, 26, 34, 36, 39, 67, 34, 41, 99, 34, - 98, 41, 25, 60, 25, 62, 35, 68, 69, 34, - 28, 37, 34, 766, 25, 149, 34, 28, 28, 66, - 764, 37, 262, 28, 39, 262, 74, 36, 37, 149, - 64, 36, 39, 57, 36, 36, 73, 70, 39, 67, - 77, 68, 36, 36, 76, 36, 99, 36, 45, 45, - 45, 45, 45, 45, 45, 45, 48, 69, 72, 48, - 48, 48, 48, 48, 48, 48, 48, 56, 56, 56, - 56, 56, 56, 56, 56, 57, 59, 57, 64, 71, - - 75, 73, 78, 77, 64, 70, 70, 57, 59, 59, - 72, 59, 79, 81, 76, 80, 59, 59, 59, 101, - 82, 72, 83, 84, 85, 88, 86, 87, 94, 71, - 97, 103, 75, 100, 104, 75, 113, 102, 105, 107, - 78, 75, 762, 71, 95, 79, 106, 80, 110, 80, - 78, 111, 101, 112, 81, 119, 115, 109, 761, 118, - 79, 114, 79, 82, 80, 116, 83, 113, 85, 86, - 84, 87, 117, 94, 88, 104, 95, 120, 100, 102, - 106, 97, 121, 103, 103, 95, 102, 105, 107, 109, - 114, 112, 95, 95, 115, 110, 111, 112, 116, 122, - - 118, 116, 118, 117, 123, 109, 118, 124, 118, 125, - 119, 116, 121, 116, 116, 120, 126, 127, 131, 128, - 129, 130, 134, 132, 135, 143, 137, 136, 138, 122, - 146, 151, 754, 148, 133, 139, 139, 139, 139, 139, - 139, 139, 139, 143, 154, 124, 122, 127, 146, 123, - 126, 148, 125, 129, 126, 130, 134, 152, 129, 137, - 134, 129, 138, 126, 128, 131, 147, 127, 129, 129, - 132, 127, 133, 135, 136, 133, 150, 155, 156, 157, - 151, 159, 158, 160, 147, 161, 150, 152, 163, 162, - 164, 165, 154, 166, 147, 167, 168, 169, 170, 171, - - 173, 172, 174, 178, 181, 175, 179, 176, 180, 183, - 751, 155, 158, 160, 177, 747, 182, 157, 187, 161, - 163, 156, 159, 162, 184, 168, 185, 169, 189, 171, - 186, 173, 174, 188, 165, 172, 181, 166, 164, 170, - 175, 176, 180, 167, 167, 176, 172, 177, 179, 177, - 182, 190, 177, 178, 184, 194, 185, 183, 197, 189, - 187, 195, 177, 196, 186, 188, 177, 199, 201, 198, - 203, 204, 205, 200, 207, 210, 211, 213, 212, 215, - 214, 216, 217, 224, 222, 218, 219, 220, 223, 221, - 225, 226, 228, 229, 227, 190, 194, 199, 232, 194, - - 231, 196, 195, 198, 200, 204, 233, 197, 215, 234, - 205, 235, 239, 237, 211, 224, 236, 201, 212, 238, - 203, 214, 222, 207, 216, 213, 218, 210, 219, 227, - 240, 217, 216, 221, 231, 220, 241, 225, 223, 242, - 225, 243, 228, 245, 229, 226, 232, 233, 247, 235, - 236, 238, 246, 248, 253, 239, 249, 250, 234, 255, - 254, 235, 237, 256, 257, 258, 261, 260, 264, 265, - 272, 267, 266, 270, 273, 243, 268, 245, 240, 265, - 241, 275, 242, 271, 276, 278, 246, 248, 269, 255, - 264, 267, 247, 254, 249, 250, 260, 266, 268, 277, - - 270, 280, 258, 253, 271, 257, 256, 261, 283, 284, - 269, 287, 285, 286, 288, 289, 276, 272, 290, 291, - 292, 295, 273, 293, 294, 296, 303, 301, 275, 300, - 298, 299, 278, 305, 302, 311, 304, 307, 309, 312, - 310, 280, 277, 286, 315, 283, 285, 313, 319, 291, - 320, 318, 288, 289, 316, 321, 322, 284, 289, 323, - 287, 294, 295, 300, 289, 290, 299, 296, 298, 302, - 292, 301, 293, 304, 310, 324, 311, 313, 303, 325, - 305, 309, 307, 327, 316, 318, 322, 328, 312, 329, - 331, 333, 332, 315, 335, 319, 336, 337, 321, 338, - - 320, 341, 344, 339, 324, 340, 323, 342, 346, 345, - 347, 351, 325, 348, 352, 349, 354, 353, 355, 356, - 331, 333, 358, 335, 327, 357, 359, 364, 365, 338, - 360, 369, 361, 367, 370, 328, 332, 339, 373, 336, - 329, 342, 368, 340, 349, 341, 337, 345, 371, 372, - 344, 375, 352, 351, 358, 377, 383, 356, 346, 355, - 348, 353, 360, 379, 347, 354, 367, 384, 357, 361, - 380, 382, 386, 359, 369, 385, 365, 368, 387, 364, - 388, 384, 370, 389, 371, 383, 386, 385, 373, 377, - 372, 391, 394, 379, 388, 387, 399, 382, 401, 402, - - 375, 403, 404, 380, 405, 406, 379, 379, 412, 407, - 408, 410, 415, 389, 419, 409, 411, 417, 420, 414, - 418, 423, 427, 426, 421, 399, 428, 429, 425, 432, - 431, 403, 430, 434, 433, 437, 435, 436, 439, 438, - 391, 401, 402, 412, 408, 410, 394, 440, 419, 405, - 407, 414, 406, 409, 411, 417, 404, 421, 418, 415, - 425, 426, 423, 427, 431, 430, 435, 420, 428, 433, - 441, 436, 432, 438, 442, 443, 429, 445, 434, 446, - 437, 447, 448, 450, 451, 454, 452, 455, 458, 457, - 440, 460, 439, 461, 463, 466, 467, 462, 465, 468, - - 469, 472, 473, 476, 662, 443, 441, 478, 475, 479, - 480, 446, 492, 447, 493, 448, 662, 483, 496, 442, - 452, 457, 484, 458, 482, 461, 445, 485, 454, 486, - 455, 451, 450, 462, 469, 465, 487, 468, 475, 479, - 460, 476, 466, 463, 467, 473, 483, 479, 478, 472, - 482, 484, 488, 489, 485, 480, 478, 492, 486, 487, - 494, 495, 497, 496, 493, 498, 499, 501, 503, 505, - 506, 507, 508, 510, 511, 512, 520, 513, 488, 514, - 744, 533, 516, 518, 531, 489, 535, 529, 521, 522, - 548, 497, 494, 551, 525, 528, 501, 530, 532, 498, - - 503, 536, 557, 495, 506, 537, 541, 540, 520, 550, - 505, 510, 543, 508, 513, 499, 516, 518, 521, 522, - 507, 529, 511, 514, 525, 528, 531, 530, 551, 512, - 533, 553, 532, 554, 548, 536, 535, 540, 555, 537, - 541, 556, 543, 550, 558, 560, 559, 561, 563, 564, - 568, 557, 565, 569, 567, 570, 571, 572, 573, 574, - 577, 582, 583, 579, 587, 553, 580, 564, 588, 581, - 590, 601, 594, 591, 554, 597, 561, 563, 567, 555, - 592, 565, 556, 593, 596, 599, 558, 559, 600, 570, - 602, 572, 573, 579, 560, 582, 580, 571, 603, 568, - - 569, 581, 574, 577, 590, 591, 583, 587, 605, 597, - 606, 588, 592, 594, 607, 593, 596, 609, 601, 599, - 611, 613, 614, 602, 615, 616, 617, 622, 619, 600, - 621, 626, 624, 631, 627, 632, 633, 622, 637, 629, - 603, 630, 635, 639, 638, 641, 640, 644, 652, 605, - 609, 619, 643, 606, 611, 617, 614, 607, 645, 621, - 646, 650, 649, 616, 651, 615, 624, 632, 613, 629, - 655, 630, 656, 633, 657, 658, 660, 639, 661, 641, - 631, 626, 627, 664, 665, 635, 640, 637, 638, 663, - 666, 645, 643, 667, 646, 644, 649, 652, 660, 668, - - 669, 650, 651, 672, 657, 673, 675, 661, 677, 678, - 681, 683, 682, 687, 686, 692, 664, 688, 655, 658, - 656, 689, 693, 704, 663, 691, 710, 694, 695, 665, - 696, 701, 666, 668, 702, 667, 675, 669, 677, 691, - 673, 682, 703, 705, 687, 706, 707, 709, 708, 711, - 689, 672, 712, 692, 678, 710, 693, 694, 681, 686, - 688, 714, 695, 715, 696, 716, 683, 701, 704, 717, - 702, 720, 703, 718, 719, 705, 707, 709, 711, 706, - 721, 722, 723, 725, 724, 726, 730, 731, 705, 708, - 728, 732, 736, 714, 737, 735, 738, 740, 759, 748, - - 750, 720, 756, 717, 745, 712, 719, 718, 746, 752, - 721, 715, 749, 716, 757, 723, 724, 725, 753, 728, - 730, 755, 758, 760, 736, 763, 726, 765, 722, 735, - 738, 740, 731, 748, 745, 750, 732, 743, 746, 742, - 756, 752, 759, 737, 741, 739, 749, 734, 757, 733, - 753, 729, 727, 713, 700, 699, 758, 755, 698, 697, - 690, 685, 684, 680, 679, 676, 674, 671, 670, 659, - 654, 653, 763, 648, 647, 642, 760, 636, 634, 628, - 625, 765, 768, 623, 768, 768, 768, 768, 769, 769, - 770, 770, 770, 770, 772, 620, 772, 772, 772, 772, - - 773, 773, 618, 612, 610, 608, 604, 598, 595, 589, - 586, 585, 584, 578, 576, 575, 562, 552, 549, 547, - 546, 545, 544, 542, 539, 538, 534, 527, 526, 524, - 523, 519, 517, 515, 509, 504, 502, 500, 491, 490, - 481, 477, 474, 471, 470, 464, 459, 456, 453, 449, - 444, 424, 422, 416, 413, 400, 398, 397, 396, 395, - 393, 392, 390, 381, 378, 376, 374, 366, 363, 362, - 350, 343, 334, 330, 326, 317, 314, 308, 306, 297, - 282, 281, 279, 274, 259, 252, 251, 244, 230, 209, - 208, 206, 202, 193, 192, 191, 153, 144, 108, 96, - - 93, 92, 54, 53, 50, 47, 17, 16, 3, 767, - 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767 - } ; - -/* Table of booleans, true if rule could match eol. */ -static const flex_int32_t yy_rule_can_match_eol[170] = - { 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -#ifndef YYLMAX -#define YYLMAX 8192 -#endif - -char yytext[YYLMAX]; -char *yytext_ptr; -#line 1 "thriftl.ll" -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/** - * Thrift scanner. - * - * Tokenizes a thrift definition file. - */ -#line 27 "thriftl.ll" - -/* This is redundant with some of the flags in Makefile.am, but it works - * when people override CXXFLAGS without being careful. The pragmas are - * the 'right' way to do it, but don't work on old-enough GCC (in particular - * the GCC that ship on Mac OS X 10.6.5, *counter* to what the GNU docs say) - * - * We should revert the Makefile.am changes once Apple ships a reasonable - * GCC. - */ -#ifdef __GNUC__ -#pragma GCC diagnostic ignored "-Wunused-function" -#pragma GCC diagnostic ignored "-Wunused-label" -#endif - -#ifdef _MSC_VER -#pragma warning( push ) - -// warning C4102: 'find_rule' : unreferenced label -#pragma warning( disable : 4102 ) - -// warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data -#pragma warning( disable : 4267 ) - -// avoid isatty redefinition -#define YY_NEVER_INTERACTIVE 1 - -#define YY_NO_UNISTD_H 1 -#endif - -#include <cassert> -#include <string> -#include <errno.h> -#include <stdlib.h> - -#ifdef _MSC_VER -#include "thrift/windows/config.h" -#endif -#include "thrift/main.h" -#include "thrift/common.h" -#include "thrift/globals.h" -#include "thrift/parse/t_program.h" - -/** - * Must be included AFTER parse/t_program.h, but I can't remember why anymore - * because I wrote this a while ago. - */ -#if defined(BISON_USE_PARSER_H_EXTENSION) -#include "thrift/thrifty.h" // Y_IGNORE -#else -#include "thrift/thrifty.hh" -#endif - -void thrift_reserved_keyword(char* keyword) { - yyerror("Cannot use reserved language keyword: \"%s\"\n", keyword); - exit(1); -} - -void integer_overflow(char* text) { - yyerror("This integer is too big: \"%s\"\n", text); - exit(1); -} - -void unexpected_token(char* text) { - yyerror("Unexpected token in input: \"%s\"\n", text); - exit(1); -} - -#line 1196 "thriftl.cc" -/** - * Provides the yylineno global, useful for debugging output - */ -/** - * Our inputs are all single files, so no need for yywrap - */ -/** - * We don't use it, and it fires up warnings at -Wall - */ -/** - * Helper definitions, comments, constants, and whatnot - */ -#line 1209 "thriftl.cc" - -#define INITIAL 0 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include <unistd.h> -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals ( void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy ( void ); - -int yyget_debug ( void ); - -void yyset_debug ( int debug_flag ); - -YY_EXTRA_TYPE yyget_extra ( void ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in ( void ); - -void yyset_in ( FILE * _in_str ); - -FILE *yyget_out ( void ); - -void yyset_out ( FILE * _out_str ); - - int yyget_leng ( void ); - -char *yyget_text ( void ); - -int yyget_lineno ( void ); - -void yyset_lineno ( int _line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap ( void ); -#else -extern int yywrap ( void ); -#endif -#endif - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput ( void ); -#else -static int input ( void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - int n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - { -#line 128 "thriftl.ll" - - -#line 1427 "thriftl.cc" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 768 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 1610 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) - { - int yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - - yylineno++; -; - } - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -/* rule 1 can match eol */ -YY_RULE_SETUP -#line 130 "thriftl.ll" -{ /* do nothing */ } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 131 "thriftl.ll" -{ /* do nothing */ } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 133 "thriftl.ll" -{ - std::string parsed("/**"); - int state = 0; // 0 = normal, 1 = "*" seen, "*/" seen - while(state < 2) - { - int ch = yyinput(); - parsed.push_back(ch); - switch (ch) { - case EOF: - yyerror("Unexpected end of file in doc-comment at %d\n", yylineno); - exit(1); - case '*': - state = 1; - break; - case '/': - state = (state == 1) ? 2 : 0; - break; - default: - state = 0; - break; - } - } - pdebug("doctext = \"%s\"\n",parsed.c_str()); - - /* This does not show up in the parse tree. */ - /* Rather, the parser will grab it out of the global. */ - if (g_parse_mode == PROGRAM) { - clear_doctext(); - g_doctext = strdup(parsed.c_str() + 3); - assert(strlen(g_doctext) >= 2); - g_doctext[strlen(g_doctext) - 2] = ' '; - g_doctext[strlen(g_doctext) - 1] = '\0'; - g_doctext = clean_up_doctext(g_doctext); - g_doctext_lineno = yylineno; - if( (g_program_doctext_candidate == NULL) && (g_program_doctext_status == INVALID)){ - g_program_doctext_candidate = strdup(g_doctext); - g_program_doctext_lineno = g_doctext_lineno; - g_program_doctext_status = STILL_CANDIDATE; - pdebug("%s","program doctext set to STILL_CANDIDATE"); - } - } -} - YY_BREAK -case 4: -YY_RULE_SETUP -#line 176 "thriftl.ll" -{ /* parsed, but thrown away */ - std::string parsed("/*"); - int state = 0; // 0 = normal, 1 = "*" seen, "*/" seen - while(state < 2) - { - int ch = yyinput(); - parsed.push_back(ch); - switch (ch) { - case EOF: - yyerror("Unexpected end of file in multiline comment at %d\n", yylineno); - exit(1); - case '*': - state = 1; - break; - case '/': - state = (state == 1) ? 2 : 0; - break; - default: - state = 0; - break; - } - } - pdebug("multi_comm = \"%s\"\n",parsed.c_str()); -} - YY_BREAK -case 5: -YY_RULE_SETUP -#line 201 "thriftl.ll" -{ /* do nothing */ } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 202 "thriftl.ll" -{ /* do nothing */ } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 204 "thriftl.ll" -{ return yytext[0]; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 205 "thriftl.ll" -{ return yytext[0]; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 207 "thriftl.ll" -{ yylval.iconst=0; return tok_int_constant; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 208 "thriftl.ll" -{ yylval.iconst=1; return tok_int_constant; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 210 "thriftl.ll" -{ return tok_namespace; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 211 "thriftl.ll" -{ error_unsupported_namespace_decl("cpp"); /* do nothing */ } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 212 "thriftl.ll" -{ return tok_cpp_include; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 213 "thriftl.ll" -{ return tok_cpp_type; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 214 "thriftl.ll" -{ error_unsupported_namespace_decl("java_package", "java"); /* do nothing */ } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 215 "thriftl.ll" -{ error_unsupported_namespace_decl("cocoa_prefix", "cocoa"); /* do nothing */ } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 216 "thriftl.ll" -{ error_unsupported_namespace_decl("csharp"); /* do nothing */ } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 217 "thriftl.ll" -{ error_unsupported_namespace_decl("delphi"); /* do nothing */ } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 218 "thriftl.ll" -{ error_unsupported_namespace_decl("php"); /* do nothing */ } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 219 "thriftl.ll" -{ error_unsupported_namespace_decl("py_module", "py"); /* do nothing */ } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 220 "thriftl.ll" -{ error_unsupported_namespace_decl("perl_package", "perl"); /* do nothing */ } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 221 "thriftl.ll" -{ error_unsupported_namespace_decl("ruby"); /* do nothing */ } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 222 "thriftl.ll" -{ error_unsupported_namespace_decl("smalltalk_category", "smalltalk.category"); /* do nothing */ } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 223 "thriftl.ll" -{ error_unsupported_namespace_decl("smalltalk_category", "smalltalk.category"); /* do nothing */ } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 224 "thriftl.ll" -{ return tok_xsd_all; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 225 "thriftl.ll" -{ return tok_xsd_optional; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 226 "thriftl.ll" -{ return tok_xsd_nillable; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 227 "thriftl.ll" -{ error_unsupported_namespace_decl("xsd"); /* do nothing */ } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 228 "thriftl.ll" -{ return tok_xsd_attrs; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 229 "thriftl.ll" -{ return tok_include; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 230 "thriftl.ll" -{ return tok_void; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 231 "thriftl.ll" -{ return tok_bool; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 232 "thriftl.ll" -{ - emit_byte_type_warning(); - return tok_i8; -} - YY_BREAK -case 34: -YY_RULE_SETUP -#line 236 "thriftl.ll" -{ return tok_i8; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 237 "thriftl.ll" -{ return tok_i16; } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 238 "thriftl.ll" -{ return tok_i32; } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 239 "thriftl.ll" -{ return tok_i64; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 240 "thriftl.ll" -{ return tok_double; } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 241 "thriftl.ll" -{ return tok_string; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 242 "thriftl.ll" -{ return tok_binary; } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 243 "thriftl.ll" -{ - pwarning(0, "\"slist\" is deprecated and will be removed in a future compiler version. This type should be replaced with \"string\".\n"); - return tok_slist; -} - YY_BREAK -case 42: -YY_RULE_SETUP -#line 247 "thriftl.ll" -{ - pwarning(0, "\"senum\" is deprecated and will be removed in a future compiler version. This type should be replaced with \"string\".\n"); - return tok_senum; -} - YY_BREAK -case 43: -YY_RULE_SETUP -#line 251 "thriftl.ll" -{ return tok_map; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 252 "thriftl.ll" -{ return tok_list; } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 253 "thriftl.ll" -{ return tok_set; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 254 "thriftl.ll" -{ return tok_oneway; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 255 "thriftl.ll" -{ return tok_typedef; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 256 "thriftl.ll" -{ return tok_struct; } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 257 "thriftl.ll" -{ return tok_union; } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 258 "thriftl.ll" -{ return tok_xception; } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 259 "thriftl.ll" -{ return tok_extends; } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 260 "thriftl.ll" -{ return tok_throws; } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 261 "thriftl.ll" -{ return tok_service; } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 262 "thriftl.ll" -{ return tok_enum; } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 263 "thriftl.ll" -{ return tok_const; } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 264 "thriftl.ll" -{ return tok_required; } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 265 "thriftl.ll" -{ return tok_optional; } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 266 "thriftl.ll" -{ - pwarning(0, "\"async\" is deprecated. It is called \"oneway\" now.\n"); - return tok_oneway; -} - YY_BREAK -case 59: -YY_RULE_SETUP -#line 270 "thriftl.ll" -{ return tok_reference; } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 273 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 274 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 275 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 276 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 277 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 278 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 279 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 280 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 281 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 282 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 283 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 284 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 285 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 286 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 287 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 288 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 289 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 290 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 78: -YY_RULE_SETUP -#line 291 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 292 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 293 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 294 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 295 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 296 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 84: -YY_RULE_SETUP -#line 297 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 85: -YY_RULE_SETUP -#line 298 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 86: -YY_RULE_SETUP -#line 299 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 87: -YY_RULE_SETUP -#line 300 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 88: -YY_RULE_SETUP -#line 301 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 89: -YY_RULE_SETUP -#line 302 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 90: -YY_RULE_SETUP -#line 303 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 91: -YY_RULE_SETUP -#line 304 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 92: -YY_RULE_SETUP -#line 305 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 93: -YY_RULE_SETUP -#line 306 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 94: -YY_RULE_SETUP -#line 307 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 95: -YY_RULE_SETUP -#line 308 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 96: -YY_RULE_SETUP -#line 309 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 97: -YY_RULE_SETUP -#line 310 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 98: -YY_RULE_SETUP -#line 311 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 99: -YY_RULE_SETUP -#line 312 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 100: -YY_RULE_SETUP -#line 313 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 101: -YY_RULE_SETUP -#line 314 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 102: -YY_RULE_SETUP -#line 315 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 103: -YY_RULE_SETUP -#line 316 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 104: -YY_RULE_SETUP -#line 317 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 105: -YY_RULE_SETUP -#line 318 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 106: -YY_RULE_SETUP -#line 319 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 107: -YY_RULE_SETUP -#line 320 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 108: -YY_RULE_SETUP -#line 321 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 109: -YY_RULE_SETUP -#line 322 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 110: -YY_RULE_SETUP -#line 323 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 111: -YY_RULE_SETUP -#line 324 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 112: -YY_RULE_SETUP -#line 325 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 113: -YY_RULE_SETUP -#line 326 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 114: -YY_RULE_SETUP -#line 327 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 115: -YY_RULE_SETUP -#line 328 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 116: -YY_RULE_SETUP -#line 329 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 117: -YY_RULE_SETUP -#line 330 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 118: -YY_RULE_SETUP -#line 331 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 119: -YY_RULE_SETUP -#line 332 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 120: -YY_RULE_SETUP -#line 333 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 121: -YY_RULE_SETUP -#line 334 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 122: -YY_RULE_SETUP -#line 335 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 123: -YY_RULE_SETUP -#line 336 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 124: -YY_RULE_SETUP -#line 337 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 125: -YY_RULE_SETUP -#line 338 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 126: -YY_RULE_SETUP -#line 339 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 127: -YY_RULE_SETUP -#line 340 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 128: -YY_RULE_SETUP -#line 341 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 129: -YY_RULE_SETUP -#line 342 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 130: -YY_RULE_SETUP -#line 343 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 131: -YY_RULE_SETUP -#line 344 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 132: -YY_RULE_SETUP -#line 345 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 133: -YY_RULE_SETUP -#line 346 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 134: -YY_RULE_SETUP -#line 347 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 135: -YY_RULE_SETUP -#line 348 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 136: -YY_RULE_SETUP -#line 349 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 137: -YY_RULE_SETUP -#line 350 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 138: -YY_RULE_SETUP -#line 351 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 139: -YY_RULE_SETUP -#line 352 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 140: -YY_RULE_SETUP -#line 353 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 141: -YY_RULE_SETUP -#line 354 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 142: -YY_RULE_SETUP -#line 355 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 143: -YY_RULE_SETUP -#line 356 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 144: -YY_RULE_SETUP -#line 357 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 145: -YY_RULE_SETUP -#line 358 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 146: -YY_RULE_SETUP -#line 359 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 147: -YY_RULE_SETUP -#line 360 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 148: -YY_RULE_SETUP -#line 361 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 149: -YY_RULE_SETUP -#line 362 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 150: -YY_RULE_SETUP -#line 363 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 151: -YY_RULE_SETUP -#line 364 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 152: -YY_RULE_SETUP -#line 365 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 153: -YY_RULE_SETUP -#line 366 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 154: -YY_RULE_SETUP -#line 367 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 155: -YY_RULE_SETUP -#line 368 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 156: -YY_RULE_SETUP -#line 369 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 157: -YY_RULE_SETUP -#line 370 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 158: -YY_RULE_SETUP -#line 371 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 159: -YY_RULE_SETUP -#line 372 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 160: -YY_RULE_SETUP -#line 373 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 161: -YY_RULE_SETUP -#line 374 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 162: -YY_RULE_SETUP -#line 375 "thriftl.ll" -{ thrift_reserved_keyword(yytext); } - YY_BREAK -case 163: -YY_RULE_SETUP -#line 377 "thriftl.ll" -{ - errno = 0; - yylval.iconst = strtoll(yytext, NULL, 10); - if (errno == ERANGE) { - integer_overflow(yytext); - } - return tok_int_constant; -} - YY_BREAK -case 164: -YY_RULE_SETUP -#line 386 "thriftl.ll" -{ - errno = 0; - char sign = yytext[0]; - int shift = sign == '0' ? 2 : 3; - yylval.iconst = strtoll(yytext+shift, NULL, 16); - if (sign == '-') { - yylval.iconst = -yylval.iconst; - } - if (errno == ERANGE) { - integer_overflow(yytext); - } - return tok_int_constant; -} - YY_BREAK -case 165: -YY_RULE_SETUP -#line 400 "thriftl.ll" -{ - yylval.id = strdup(yytext); - return tok_identifier; -} - YY_BREAK -case 166: -YY_RULE_SETUP -#line 405 "thriftl.ll" -{ - /* Deliberately placed after identifier, since "e10" is NOT a double literal (THRIFT-3477) */ - yylval.dconst = atof(yytext); - return tok_dub_constant; -} - YY_BREAK -case 167: -YY_RULE_SETUP -#line 411 "thriftl.ll" -{ - char mark = yytext[0]; - std::string result; - for(;;) - { - int ch = yyinput(); - switch (ch) { - case EOF: - yyerror("End of file while read string at %d\n", yylineno); - exit(1); - case '\n': - yyerror("End of line while read string at %d\n", yylineno - 1); - exit(1); - case '\\': - ch = yyinput(); - switch (ch) { - case 'r': - result.push_back('\r'); - continue; - case 'n': - result.push_back('\n'); - continue; - case 't': - result.push_back('\t'); - continue; - case '"': - result.push_back('"'); - continue; - case '\'': - result.push_back('\''); - continue; - case '\\': - result.push_back('\\'); - continue; - default: - yyerror("Bad escape character\n"); - return -1; - } - break; - default: - if (ch == mark) { - yylval.id = strdup(result.c_str()); - return tok_literal; - } else { - result.push_back(ch); - } - } - } -} - YY_BREAK -case 168: -YY_RULE_SETUP -#line 462 "thriftl.ll" -{ - unexpected_token(yytext); -} - YY_BREAK -case 169: -YY_RULE_SETUP -#line 466 "thriftl.ll" -ECHO; - YY_BREAK -#line 2492 "thriftl.cc" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc( (void *) b->yy_ch_buf, - (yy_size_t) (b->yy_buf_size + 2) ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( - (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 768 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 768 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 767); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - if ( c == '\n' ) - - yylineno++; -; - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf ); - - yyfree( (void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return NULL; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (const char * yystr ) -{ - - return yy_scan_bytes( yystr, (int) strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) yyalloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yynoreturn yy_fatal_error (const char* msg ) -{ - fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -int yyget_leng (void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text (void) -{ - return yytext; -} - -/** Set the current line number. - * @param _line_number line number - * - */ -void yyset_lineno (int _line_number ) -{ - - yylineno = _line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param _in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * _in_str ) -{ - yyin = _in_str ; -} - -void yyset_out (FILE * _out_str ) -{ - yyout = _out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int _bdebug ) -{ - yy_flex_debug = _bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - /* We do not touch yylineno unless the option is enabled. */ - yylineno = 1; - - (yy_buffer_stack) = NULL; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = NULL; - yyout = NULL; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer( YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n ) -{ - - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (const char * s ) -{ - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return malloc(size); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 466 "thriftl.ll" - - -#ifdef _MSC_VER -#pragma warning( pop ) -#endif - -/* vim: filetype=lex -*/ +#line 2 "thriftl.cc" + +#line 4 "thriftl.cc" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <stdlib.h> + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include <inttypes.h> +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern int yyleng; + +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires + * access to the local variable yy_act. Since yyless() is a macro, it would break + * existing scanners that call yyless() from OUTSIDE yylex. + * One obvious solution it to make yy_act a global. I tried that, and saw + * a 5% performance hit in a non-yylineno scanner, because yy_act is + * normally declared as a register variable-- so it is not worth it. + */ + #define YY_LESS_LINENO(n) \ + do { \ + int yyl;\ + for ( yyl = n; yyl < yyleng; ++yyl )\ + if ( yytext[yyl] == '\n' )\ + --yylineno;\ + }while(0) + #define YY_LINENO_REWIND_TO(dst) \ + do {\ + const char *p;\ + for ( p = yy_cp-1; p >= (dst); --p)\ + if ( *p == '\n' )\ + --yylineno;\ + }while(0) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = NULL; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); + +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); + +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define yywrap() (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +FILE *yyin = NULL, *yyout = NULL; + +typedef int yy_state_type; + +#define YY_FLEX_LEX_COMPAT +extern int yylineno; +int yylineno = 1; + +extern char yytext[]; + +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + if ( yyleng >= YYLMAX ) \ + YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ + yy_flex_strncpy( yytext, (yytext_ptr), yyleng + 1 ); \ + (yy_c_buf_p) = yy_cp; +#define YY_NUM_RULES 169 +#define YY_END_OF_BUFFER 170 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[768] = + { 0, + 1, 1, 170, 168, 1, 1, 167, 6, 59, 7, + 8, 166, 168, 168, 163, 163, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 1, 6, 0, 163, 163, 0, 166, 4, + 5, 0, 0, 165, 165, 0, 165, 165, 165, 165, + 165, 165, 165, 73, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 87, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 34, 111, 165, 114, 118, 165, 165, 165, 165, + + 165, 165, 165, 165, 165, 165, 165, 126, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 166, 3, + 5, 164, 165, 61, 165, 165, 165, 165, 165, 165, + 165, 165, 71, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 83, 85, 165, 165, 165, 165, 93, 165, 165, 165, + 165, 165, 165, 165, 165, 105, 165, 165, 165, 165, + 35, 36, 37, 165, 165, 165, 165, 165, 165, 165, + + 165, 43, 165, 165, 165, 122, 165, 124, 125, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 45, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 149, 165, 165, 165, 165, 165, 165, + 154, 155, 165, 165, 165, 165, 165, 165, 161, 165, + 165, 0, 2, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 72, 165, 165, 165, 165, 32, 165, + 33, 77, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 89, 90, 165, 165, + + 165, 165, 165, 165, 165, 54, 165, 102, 165, 165, + 165, 165, 165, 107, 165, 165, 110, 165, 165, 165, + 165, 165, 165, 165, 165, 44, 165, 165, 165, 123, + 165, 165, 165, 128, 165, 165, 165, 165, 165, 165, + 165, 165, 134, 165, 165, 165, 165, 165, 165, 139, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 145, 146, 165, 165, 10, 165, 165, 165, 165, + 165, 165, 165, 31, 165, 158, 165, 160, 165, 165, + 60, 165, 165, 165, 165, 165, 165, 165, 165, 70, + 165, 58, 75, 165, 76, 78, 79, 80, 165, 55, + + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 92, 165, 165, 97, 165, 165, 165, 165, + 165, 9, 165, 104, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 130, 165, 165, 165, 165, 133, 165, + 165, 165, 136, 165, 165, 42, 165, 165, 41, 165, + 165, 165, 165, 142, 165, 165, 147, 165, 165, 150, + 49, 165, 165, 153, 165, 165, 159, 165, 165, 165, + 162, 165, 165, 165, 165, 165, 165, 165, 165, 74, + 40, 165, 165, 165, 165, 165, 165, 165, 165, 86, + + 165, 38, 165, 91, 165, 95, 165, 165, 100, 101, + 165, 165, 165, 165, 109, 165, 113, 165, 115, 165, + 165, 165, 119, 120, 165, 121, 46, 165, 165, 165, + 165, 165, 165, 129, 165, 165, 165, 135, 138, 165, + 165, 140, 165, 141, 39, 48, 143, 165, 52, 165, + 165, 151, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 63, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 82, 84, 165, 88, 165, 165, + 165, 165, 165, 51, 103, 106, 165, 165, 30, 165, + 165, 165, 165, 165, 127, 165, 165, 131, 165, 165, + + 165, 165, 165, 53, 165, 165, 165, 47, 165, 156, + 165, 25, 165, 165, 165, 165, 165, 64, 165, 66, + 165, 165, 69, 165, 81, 165, 165, 14, 165, 165, + 165, 165, 165, 99, 165, 108, 165, 165, 165, 165, + 165, 57, 165, 165, 165, 165, 137, 56, 165, 165, + 165, 165, 152, 157, 165, 165, 165, 165, 62, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 98, + 50, 165, 165, 117, 165, 11, 165, 165, 132, 20, + 165, 165, 165, 148, 29, 165, 165, 165, 165, 67, + 165, 165, 165, 165, 165, 165, 94, 96, 112, 116, + + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 13, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 65, 165, 16, 165, + 165, 165, 15, 21, 165, 165, 165, 165, 144, 165, + 27, 26, 68, 12, 165, 165, 19, 165, 165, 165, + 28, 165, 165, 22, 165, 165, 165, 165, 165, 165, + 17, 18, 165, 24, 165, 23, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 4, 5, 1, 1, 6, 4, 7, + 7, 8, 9, 7, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 17, 19, 17, 7, 7, 7, + 7, 7, 1, 1, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 29, 30, 31, 32, 33, 34, + 29, 35, 36, 37, 38, 29, 29, 29, 29, 29, + 7, 1, 7, 1, 39, 1, 40, 41, 42, 43, + + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 7, 1, 7, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static const YY_CHAR yy_meta[66] = + { 0, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 5, + 5, 5, 5, 4, 5, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, + 5, 5, 5, 4, 5, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6 + } ; + +static const flex_int16_t yy_base[774] = + { 0, + 0, 0, 1609, 1610, 64, 66, 1610, 0, 1610, 1610, + 1610, 60, 61, 74, 71, 1545, 1597, 73, 126, 61, + 96, 102, 117, 116, 172, 152, 77, 186, 76, 81, + 78, 154, 110, 173, 167, 204, 185, 120, 205, 104, + 164, 100, 87, 0, 257, 0, 1543, 268, 69, 1597, + 0, 0, 1594, 1593, 82, 276, 245, 84, 287, 166, + 107, 183, 115, 241, 123, 187, 206, 218, 219, 248, + 290, 269, 247, 200, 291, 255, 251, 293, 303, 306, + 304, 311, 313, 314, 315, 317, 318, 316, 91, 88, + 89, 1592, 1591, 319, 335, 1590, 321, 169, 209, 324, + + 310, 328, 322, 325, 329, 337, 330, 1589, 348, 339, + 342, 344, 327, 352, 347, 356, 363, 350, 346, 368, + 373, 390, 395, 398, 400, 407, 408, 410, 411, 412, + 409, 414, 425, 413, 415, 418, 417, 419, 424, 111, + 0, 0, 416, 1588, 93, 421, 457, 424, 226, 467, + 422, 448, 1587, 435, 468, 469, 470, 473, 472, 474, + 476, 480, 479, 481, 482, 484, 486, 487, 488, 489, + 490, 492, 491, 493, 496, 498, 505, 494, 497, 499, + 495, 507, 500, 515, 517, 521, 509, 524, 519, 542, + 1586, 1585, 1584, 546, 552, 554, 549, 560, 558, 564, + + 559, 1583, 561, 562, 563, 1582, 565, 1581, 1580, 566, + 567, 569, 568, 571, 570, 572, 573, 576, 577, 578, + 580, 575, 579, 574, 581, 582, 585, 583, 584, 1579, + 591, 589, 597, 600, 602, 607, 604, 610, 603, 621, + 627, 630, 632, 1578, 634, 643, 639, 644, 647, 648, + 1577, 1576, 645, 651, 650, 654, 655, 656, 1575, 658, + 657, 235, 1610, 659, 660, 663, 662, 667, 679, 664, + 674, 661, 665, 1574, 672, 675, 690, 676, 1573, 692, + 1572, 1571, 699, 700, 703, 704, 702, 705, 706, 709, + 710, 711, 714, 715, 712, 716, 1570, 721, 722, 720, + + 718, 725, 717, 727, 724, 1569, 728, 1568, 729, 731, + 726, 730, 738, 1567, 735, 745, 1566, 742, 739, 741, + 746, 747, 750, 766, 770, 1565, 774, 778, 780, 1564, + 781, 783, 782, 1563, 785, 787, 788, 790, 794, 796, + 792, 798, 1562, 793, 800, 799, 801, 804, 806, 1561, + 802, 805, 808, 807, 809, 810, 816, 813, 817, 821, + 823, 1560, 1559, 818, 819, 1558, 824, 833, 822, 825, + 839, 840, 829, 1557, 842, 1556, 846, 1555, 854, 861, + 1554, 862, 847, 858, 866, 863, 869, 871, 874, 1553, + 882, 1552, 1551, 883, 1550, 1549, 1548, 1547, 887, 1546, + + 889, 890, 892, 893, 895, 896, 900, 901, 906, 902, + 907, 899, 1545, 910, 903, 1544, 908, 911, 905, 909, + 915, 1543, 912, 1542, 919, 914, 913, 917, 918, 923, + 921, 920, 925, 924, 927, 928, 926, 930, 929, 938, + 961, 965, 966, 1541, 968, 970, 972, 973, 1540, 974, + 975, 977, 1539, 976, 978, 1538, 980, 979, 1537, 982, + 984, 988, 985, 1536, 989, 986, 987, 990, 991, 1535, + 1534, 992, 993, 1533, 999, 994, 1532, 998, 1000, 1001, + 1531, 1015, 1008, 1013, 1018, 1020, 1027, 1043, 1044, 1530, + 1529, 1003, 1005, 1051, 1052, 1009, 1053, 1056, 1057, 1528, + + 1058, 1527, 1059, 1526, 1060, 1061, 1062, 1063, 1525, 1064, + 1065, 1066, 1068, 1070, 1524, 1073, 1523, 1074, 1522, 1067, + 1079, 1080, 1521, 1520, 1085, 1519, 1518, 1086, 1078, 1088, + 1075, 1089, 1072, 1517, 1077, 1092, 1096, 1516, 1515, 1098, + 1097, 1514, 1103, 1513, 1512, 1511, 1510, 1081, 1509, 1100, + 1084, 1508, 1122, 1124, 1129, 1132, 1093, 1135, 1137, 1136, + 1138, 1507, 1139, 1140, 1143, 101, 1145, 1141, 1144, 1146, + 1147, 1148, 1149, 1150, 1506, 1505, 1151, 1504, 1154, 1157, + 1160, 1152, 1153, 1503, 1502, 1501, 1155, 1159, 1500, 1161, + 1164, 1171, 1174, 1163, 1499, 1175, 1166, 1498, 1176, 1179, + + 1162, 1181, 1189, 1497, 1199, 1201, 1205, 1496, 1208, 1495, + 1211, 1494, 1212, 1213, 1215, 1216, 1217, 1493, 1219, 1486, + 1221, 1218, 1474, 1223, 1471, 1222, 1225, 1470, 1230, 1232, + 1224, 1226, 1227, 1469, 1233, 1468, 1229, 1235, 1234, 1237, + 1236, 1466, 1243, 1238, 1249, 1251, 1465, 1464, 1253, 1252, + 1255, 1239, 1462, 1461, 1261, 1263, 1265, 1266, 1460, 1267, + 1269, 995, 1280, 1274, 1275, 1281, 1284, 1290, 1291, 1459, + 1458, 1294, 1296, 1457, 1297, 1456, 1299, 1300, 1455, 1454, + 1301, 1303, 1302, 1453, 1452, 1305, 1304, 1308, 1312, 1451, + 1316, 1306, 1313, 1318, 1319, 1321, 1450, 1449, 1446, 1445, + + 1322, 1325, 1333, 1314, 1334, 1336, 1337, 1339, 1338, 1317, + 1340, 1343, 1444, 1352, 1354, 1356, 1360, 1364, 1365, 1362, + 1371, 1372, 1373, 1375, 1374, 1376, 1443, 1381, 1442, 1377, + 1378, 1382, 1440, 1438, 1386, 1383, 1385, 1387, 1436, 1388, + 1435, 1430, 1428, 1071, 1395, 1399, 506, 1390, 1403, 1391, + 501, 1400, 1409, 423, 1412, 1393, 1405, 1413, 1389, 1414, + 349, 333, 1416, 231, 1418, 224, 1610, 1482, 1486, 1488, + 92, 1494, 1497 + } ; + +static const flex_int16_t yy_def[774] = + { 0, + 767, 1, 767, 767, 767, 767, 767, 768, 767, 767, + 767, 769, 767, 767, 769, 15, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 767, 768, 767, 15, 15, 767, 771, 767, + 772, 773, 770, 770, 770, 767, 25, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 767, 767, + 772, 773, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 767, 767, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 0, 767, 767, 767, + 767, 767, 767 + } ; + +static const flex_int16_t yy_nxt[1676] = + { 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 16, 16, 16, 16, 16, 16, 17, + 18, 17, 17, 19, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 20, 21, + 22, 23, 24, 25, 26, 27, 17, 28, 29, 17, + 30, 31, 32, 33, 34, 17, 35, 36, 37, 38, + 39, 40, 41, 42, 17, 43, 43, 43, 43, 45, + 53, 46, 49, 49, 49, 49, 49, 49, 49, 49, + 45, 50, 53, 48, 51, 53, 53, 53, 43, 43, + 53, 53, 48, 53, 48, 49, 55, 53, 53, 59, + + 53, 192, 53, 48, 193, 53, 144, 143, 191, 53, + 53, 53, 48, 53, 48, 97, 53, 100, 262, 53, + 98, 263, 265, 621, 53, 53, 53, 87, 99, 53, + 88, 101, 53, 52, 56, 53, 60, 57, 57, 57, + 57, 57, 57, 57, 57, 65, 61, 138, 62, 66, + 134, 135, 63, 64, 152, 67, 70, 58, 68, 75, + 154, 53, 106, 53, 107, 69, 108, 71, 157, 76, + 72, 73, 129, 53, 74, 53, 53, 130, 53, 77, + 56, 53, 53, 57, 57, 57, 57, 57, 57, 57, + 57, 81, 53, 102, 53, 53, 53, 103, 89, 82, + + 90, 104, 83, 91, 92, 84, 115, 105, 85, 53, + 116, 86, 109, 53, 53, 53, 110, 136, 53, 111, + 200, 137, 78, 151, 79, 153, 117, 53, 53, 112, + 93, 126, 113, 53, 80, 53, 114, 94, 95, 158, + 53, 127, 262, 96, 131, 263, 169, 118, 128, 270, + 53, 119, 132, 767, 120, 121, 53, 53, 133, 159, + 53, 160, 122, 123, 53, 124, 201, 125, 49, 49, + 49, 49, 49, 49, 49, 49, 56, 161, 53, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 54, 53, 54, 155, 53, + + 53, 168, 53, 174, 156, 162, 163, 54, 145, 146, + 166, 147, 53, 53, 173, 53, 148, 149, 150, 53, + 53, 167, 53, 53, 53, 53, 53, 53, 53, 164, + 53, 53, 170, 53, 53, 171, 53, 53, 53, 53, + 175, 172, 53, 165, 53, 177, 53, 180, 53, 181, + 176, 53, 203, 53, 183, 53, 53, 53, 53, 53, + 178, 53, 179, 184, 182, 53, 185, 218, 187, 188, + 186, 189, 53, 194, 190, 208, 195, 53, 202, 204, + 210, 199, 53, 206, 207, 196, 205, 209, 211, 212, + 219, 216, 197, 198, 220, 214, 215, 217, 221, 53, + + 227, 222, 228, 226, 53, 213, 229, 53, 230, 53, + 231, 223, 233, 224, 225, 232, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 234, + 53, 53, 53, 53, 53, 139, 139, 139, 139, 139, + 139, 139, 139, 264, 53, 237, 235, 242, 266, 236, + 239, 269, 238, 246, 240, 251, 256, 53, 247, 260, + 257, 248, 261, 241, 245, 252, 53, 243, 249, 250, + 253, 244, 254, 258, 259, 255, 53, 53, 53, 53, + 272, 53, 53, 53, 267, 53, 271, 273, 53, 53, + 53, 53, 274, 53, 268, 53, 53, 53, 53, 53, + + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 275, 278, 280, 53, 53, 53, 277, 53, 281, + 283, 276, 279, 282, 53, 289, 53, 290, 53, 292, + 53, 295, 296, 53, 285, 293, 308, 286, 284, 291, + 297, 298, 307, 287, 288, 299, 294, 300, 306, 301, + 309, 53, 302, 305, 311, 53, 312, 310, 53, 316, + 314, 53, 303, 53, 313, 315, 304, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 317, 318, 324, 53, 319, + + 53, 321, 320, 323, 325, 328, 53, 322, 336, 53, + 329, 53, 53, 53, 332, 346, 53, 326, 333, 53, + 327, 335, 344, 330, 337, 334, 340, 331, 341, 350, + 53, 339, 338, 343, 353, 342, 53, 347, 345, 53, + 348, 53, 351, 53, 352, 349, 354, 355, 53, 357, + 359, 361, 53, 53, 53, 362, 53, 53, 356, 53, + 53, 358, 360, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 366, 53, 367, 363, 382, + 364, 53, 365, 53, 53, 53, 368, 370, 53, 375, + 381, 384, 369, 374, 371, 372, 379, 383, 385, 53, + + 387, 53, 378, 373, 388, 377, 376, 380, 53, 53, + 386, 53, 53, 53, 53, 53, 392, 389, 53, 53, + 53, 53, 390, 53, 53, 53, 53, 53, 391, 53, + 53, 53, 394, 53, 53, 53, 53, 53, 53, 53, + 53, 395, 393, 399, 53, 396, 398, 53, 53, 406, + 53, 53, 401, 402, 53, 53, 53, 397, 403, 53, + 400, 409, 410, 414, 404, 405, 413, 411, 412, 416, + 407, 415, 408, 418, 422, 53, 423, 425, 417, 53, + 419, 421, 420, 53, 427, 428, 432, 53, 424, 53, + 53, 53, 53, 426, 53, 429, 53, 53, 431, 53, + + 430, 53, 53, 53, 434, 53, 433, 53, 53, 53, + 53, 53, 435, 53, 53, 53, 53, 53, 53, 53, + 439, 441, 53, 442, 436, 53, 53, 53, 53, 445, + 53, 53, 53, 53, 53, 437, 440, 446, 53, 443, + 438, 449, 53, 447, 455, 448, 444, 451, 53, 53, + 450, 53, 457, 456, 463, 53, 53, 461, 452, 460, + 454, 458, 465, 53, 453, 459, 469, 53, 462, 466, + 53, 53, 53, 464, 471, 53, 468, 470, 53, 467, + 53, 484, 472, 53, 473, 483, 486, 485, 475, 477, + 474, 53, 53, 478, 488, 487, 53, 482, 53, 53, + + 476, 53, 53, 481, 53, 53, 479, 480, 53, 53, + 53, 53, 53, 489, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 492, 53, 53, 53, 53, + 53, 495, 53, 53, 53, 53, 53, 53, 53, 53, + 490, 493, 494, 504, 500, 502, 491, 53, 509, 497, + 499, 505, 498, 501, 503, 507, 496, 511, 508, 506, + 513, 514, 512, 515, 519, 518, 523, 510, 516, 521, + 53, 524, 520, 526, 53, 53, 517, 53, 522, 53, + 525, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 528, 53, 527, 53, 53, 53, 53, 53, 53, 53, + + 53, 53, 53, 53, 53, 531, 529, 53, 53, 53, + 53, 533, 53, 534, 53, 535, 691, 53, 53, 530, + 538, 541, 53, 542, 53, 544, 532, 53, 539, 53, + 540, 537, 536, 545, 551, 547, 53, 550, 554, 558, + 543, 555, 548, 546, 549, 553, 562, 559, 556, 552, + 561, 563, 53, 53, 564, 560, 557, 569, 565, 566, + 53, 53, 53, 573, 570, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 567, 53, + 53, 53, 53, 53, 53, 568, 53, 53, 53, 53, + 53, 574, 571, 53, 53, 53, 577, 53, 53, 575, + + 578, 53, 53, 572, 580, 53, 53, 53, 590, 53, + 579, 583, 53, 582, 586, 576, 588, 589, 591, 592, + 581, 595, 584, 587, 593, 594, 597, 596, 608, 585, + 599, 53, 598, 53, 606, 601, 600, 603, 53, 602, + 604, 53, 605, 607, 53, 53, 53, 53, 53, 53, + 53, 613, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 609, 53, 619, 53, 53, + 53, 53, 53, 53, 610, 53, 617, 618, 622, 611, + 53, 620, 612, 53, 53, 53, 614, 615, 53, 625, + 53, 627, 628, 631, 616, 634, 632, 626, 53, 623, + + 624, 633, 629, 630, 638, 639, 635, 636, 53, 644, + 53, 637, 640, 642, 53, 641, 643, 53, 647, 645, + 53, 53, 53, 648, 53, 53, 53, 53, 53, 646, + 53, 53, 53, 53, 53, 53, 53, 662, 53, 53, + 649, 53, 53, 53, 53, 53, 53, 53, 53, 650, + 653, 660, 53, 651, 654, 659, 656, 652, 53, 661, + 53, 53, 53, 658, 53, 657, 663, 669, 655, 666, + 53, 667, 53, 670, 53, 53, 53, 674, 53, 676, + 668, 664, 665, 53, 53, 671, 675, 672, 673, 53, + 53, 679, 677, 53, 680, 678, 681, 684, 689, 53, + + 53, 682, 683, 53, 687, 53, 53, 690, 53, 53, + 53, 53, 53, 53, 53, 53, 693, 53, 685, 688, + 686, 53, 53, 53, 692, 53, 53, 53, 53, 694, + 53, 53, 695, 697, 53, 696, 701, 698, 702, 711, + 700, 705, 53, 53, 708, 53, 53, 53, 53, 53, + 710, 699, 53, 712, 703, 727, 713, 714, 704, 707, + 709, 53, 715, 53, 716, 53, 706, 717, 720, 53, + 718, 53, 719, 53, 53, 721, 724, 726, 728, 723, + 53, 53, 53, 53, 53, 53, 53, 53, 722, 725, + 53, 53, 53, 730, 53, 53, 53, 53, 53, 53, + + 53, 736, 53, 733, 53, 729, 735, 734, 53, 53, + 737, 731, 53, 732, 53, 739, 740, 741, 53, 743, + 744, 53, 53, 53, 748, 53, 742, 53, 738, 747, + 750, 751, 745, 754, 752, 756, 746, 53, 753, 53, + 760, 757, 763, 749, 53, 53, 755, 53, 761, 53, + 758, 53, 53, 53, 53, 53, 762, 759, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 765, 53, 53, 53, 764, 53, 53, 53, + 53, 766, 44, 53, 44, 44, 44, 44, 47, 47, + 54, 54, 54, 54, 141, 53, 141, 141, 141, 141, + + 142, 142, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + + 53, 53, 53, 767, 140, 767, 53, 767, 767, 3, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767 + } ; + +static const flex_int16_t yy_chk[1676] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 5, 5, 6, 6, 12, + 20, 12, 13, 13, 13, 13, 13, 13, 13, 13, + 15, 14, 18, 12, 14, 29, 27, 31, 43, 43, + 30, 55, 49, 58, 15, 771, 18, 90, 91, 20, + + 89, 90, 145, 12, 91, 21, 58, 55, 89, 42, + 566, 22, 49, 40, 15, 29, 61, 31, 140, 33, + 30, 140, 145, 566, 63, 24, 23, 27, 30, 38, + 27, 31, 65, 15, 19, 19, 21, 19, 19, 19, + 19, 19, 19, 19, 19, 22, 21, 42, 21, 22, + 40, 40, 21, 21, 61, 22, 23, 19, 22, 24, + 63, 26, 33, 32, 33, 22, 33, 23, 65, 24, + 23, 23, 38, 41, 23, 60, 35, 38, 98, 24, + 25, 25, 34, 25, 25, 25, 25, 25, 25, 25, + 25, 26, 62, 32, 37, 28, 66, 32, 28, 26, + + 28, 32, 26, 28, 28, 26, 35, 32, 26, 74, + 35, 26, 34, 36, 39, 67, 34, 41, 99, 34, + 98, 41, 25, 60, 25, 62, 35, 68, 69, 34, + 28, 37, 34, 766, 25, 149, 34, 28, 28, 66, + 764, 37, 262, 28, 39, 262, 74, 36, 37, 149, + 64, 36, 39, 57, 36, 36, 73, 70, 39, 67, + 77, 68, 36, 36, 76, 36, 99, 36, 45, 45, + 45, 45, 45, 45, 45, 45, 48, 69, 72, 48, + 48, 48, 48, 48, 48, 48, 48, 56, 56, 56, + 56, 56, 56, 56, 56, 57, 59, 57, 64, 71, + + 75, 73, 78, 77, 64, 70, 70, 57, 59, 59, + 72, 59, 79, 81, 76, 80, 59, 59, 59, 101, + 82, 72, 83, 84, 85, 88, 86, 87, 94, 71, + 97, 103, 75, 100, 104, 75, 113, 102, 105, 107, + 78, 75, 762, 71, 95, 79, 106, 80, 110, 80, + 78, 111, 101, 112, 81, 119, 115, 109, 761, 118, + 79, 114, 79, 82, 80, 116, 83, 113, 85, 86, + 84, 87, 117, 94, 88, 104, 95, 120, 100, 102, + 106, 97, 121, 103, 103, 95, 102, 105, 107, 109, + 114, 112, 95, 95, 115, 110, 111, 112, 116, 122, + + 118, 116, 118, 117, 123, 109, 118, 124, 118, 125, + 119, 116, 121, 116, 116, 120, 126, 127, 131, 128, + 129, 130, 134, 132, 135, 143, 137, 136, 138, 122, + 146, 151, 754, 148, 133, 139, 139, 139, 139, 139, + 139, 139, 139, 143, 154, 124, 122, 127, 146, 123, + 126, 148, 125, 129, 126, 130, 134, 152, 129, 137, + 134, 129, 138, 126, 128, 131, 147, 127, 129, 129, + 132, 127, 133, 135, 136, 133, 150, 155, 156, 157, + 151, 159, 158, 160, 147, 161, 150, 152, 163, 162, + 164, 165, 154, 166, 147, 167, 168, 169, 170, 171, + + 173, 172, 174, 178, 181, 175, 179, 176, 180, 183, + 751, 155, 158, 160, 177, 747, 182, 157, 187, 161, + 163, 156, 159, 162, 184, 168, 185, 169, 189, 171, + 186, 173, 174, 188, 165, 172, 181, 166, 164, 170, + 175, 176, 180, 167, 167, 176, 172, 177, 179, 177, + 182, 190, 177, 178, 184, 194, 185, 183, 197, 189, + 187, 195, 177, 196, 186, 188, 177, 199, 201, 198, + 203, 204, 205, 200, 207, 210, 211, 213, 212, 215, + 214, 216, 217, 224, 222, 218, 219, 220, 223, 221, + 225, 226, 228, 229, 227, 190, 194, 199, 232, 194, + + 231, 196, 195, 198, 200, 204, 233, 197, 215, 234, + 205, 235, 239, 237, 211, 224, 236, 201, 212, 238, + 203, 214, 222, 207, 216, 213, 218, 210, 219, 227, + 240, 217, 216, 221, 231, 220, 241, 225, 223, 242, + 225, 243, 228, 245, 229, 226, 232, 233, 247, 235, + 236, 238, 246, 248, 253, 239, 249, 250, 234, 255, + 254, 235, 237, 256, 257, 258, 261, 260, 264, 265, + 272, 267, 266, 270, 273, 243, 268, 245, 240, 265, + 241, 275, 242, 271, 276, 278, 246, 248, 269, 255, + 264, 267, 247, 254, 249, 250, 260, 266, 268, 277, + + 270, 280, 258, 253, 271, 257, 256, 261, 283, 284, + 269, 287, 285, 286, 288, 289, 276, 272, 290, 291, + 292, 295, 273, 293, 294, 296, 303, 301, 275, 300, + 298, 299, 278, 305, 302, 311, 304, 307, 309, 312, + 310, 280, 277, 286, 315, 283, 285, 313, 319, 291, + 320, 318, 288, 289, 316, 321, 322, 284, 289, 323, + 287, 294, 295, 300, 289, 290, 299, 296, 298, 302, + 292, 301, 293, 304, 310, 324, 311, 313, 303, 325, + 305, 309, 307, 327, 316, 318, 322, 328, 312, 329, + 331, 333, 332, 315, 335, 319, 336, 337, 321, 338, + + 320, 341, 344, 339, 324, 340, 323, 342, 346, 345, + 347, 351, 325, 348, 352, 349, 354, 353, 355, 356, + 331, 333, 358, 335, 327, 357, 359, 364, 365, 338, + 360, 369, 361, 367, 370, 328, 332, 339, 373, 336, + 329, 342, 368, 340, 349, 341, 337, 345, 371, 372, + 344, 375, 352, 351, 358, 377, 383, 356, 346, 355, + 348, 353, 360, 379, 347, 354, 367, 384, 357, 361, + 380, 382, 386, 359, 369, 385, 365, 368, 387, 364, + 388, 384, 370, 389, 371, 383, 386, 385, 373, 377, + 372, 391, 394, 379, 388, 387, 399, 382, 401, 402, + + 375, 403, 404, 380, 405, 406, 379, 379, 412, 407, + 408, 410, 415, 389, 419, 409, 411, 417, 420, 414, + 418, 423, 427, 426, 421, 399, 428, 429, 425, 432, + 431, 403, 430, 434, 433, 437, 435, 436, 439, 438, + 391, 401, 402, 412, 408, 410, 394, 440, 419, 405, + 407, 414, 406, 409, 411, 417, 404, 421, 418, 415, + 425, 426, 423, 427, 431, 430, 435, 420, 428, 433, + 441, 436, 432, 438, 442, 443, 429, 445, 434, 446, + 437, 447, 448, 450, 451, 454, 452, 455, 458, 457, + 440, 460, 439, 461, 463, 466, 467, 462, 465, 468, + + 469, 472, 473, 476, 662, 443, 441, 478, 475, 479, + 480, 446, 492, 447, 493, 448, 662, 483, 496, 442, + 452, 457, 484, 458, 482, 461, 445, 485, 454, 486, + 455, 451, 450, 462, 469, 465, 487, 468, 475, 479, + 460, 476, 466, 463, 467, 473, 483, 479, 478, 472, + 482, 484, 488, 489, 485, 480, 478, 492, 486, 487, + 494, 495, 497, 496, 493, 498, 499, 501, 503, 505, + 506, 507, 508, 510, 511, 512, 520, 513, 488, 514, + 744, 533, 516, 518, 531, 489, 535, 529, 521, 522, + 548, 497, 494, 551, 525, 528, 501, 530, 532, 498, + + 503, 536, 557, 495, 506, 537, 541, 540, 520, 550, + 505, 510, 543, 508, 513, 499, 516, 518, 521, 522, + 507, 529, 511, 514, 525, 528, 531, 530, 551, 512, + 533, 553, 532, 554, 548, 536, 535, 540, 555, 537, + 541, 556, 543, 550, 558, 560, 559, 561, 563, 564, + 568, 557, 565, 569, 567, 570, 571, 572, 573, 574, + 577, 582, 583, 579, 587, 553, 580, 564, 588, 581, + 590, 601, 594, 591, 554, 597, 561, 563, 567, 555, + 592, 565, 556, 593, 596, 599, 558, 559, 600, 570, + 602, 572, 573, 579, 560, 582, 580, 571, 603, 568, + + 569, 581, 574, 577, 590, 591, 583, 587, 605, 597, + 606, 588, 592, 594, 607, 593, 596, 609, 601, 599, + 611, 613, 614, 602, 615, 616, 617, 622, 619, 600, + 621, 626, 624, 631, 627, 632, 633, 622, 637, 629, + 603, 630, 635, 639, 638, 641, 640, 644, 652, 605, + 609, 619, 643, 606, 611, 617, 614, 607, 645, 621, + 646, 650, 649, 616, 651, 615, 624, 632, 613, 629, + 655, 630, 656, 633, 657, 658, 660, 639, 661, 641, + 631, 626, 627, 664, 665, 635, 640, 637, 638, 663, + 666, 645, 643, 667, 646, 644, 649, 652, 660, 668, + + 669, 650, 651, 672, 657, 673, 675, 661, 677, 678, + 681, 683, 682, 687, 686, 692, 664, 688, 655, 658, + 656, 689, 693, 704, 663, 691, 710, 694, 695, 665, + 696, 701, 666, 668, 702, 667, 675, 669, 677, 691, + 673, 682, 703, 705, 687, 706, 707, 709, 708, 711, + 689, 672, 712, 692, 678, 710, 693, 694, 681, 686, + 688, 714, 695, 715, 696, 716, 683, 701, 704, 717, + 702, 720, 703, 718, 719, 705, 707, 709, 711, 706, + 721, 722, 723, 725, 724, 726, 730, 731, 705, 708, + 728, 732, 736, 714, 737, 735, 738, 740, 759, 748, + + 750, 720, 756, 717, 745, 712, 719, 718, 746, 752, + 721, 715, 749, 716, 757, 723, 724, 725, 753, 728, + 730, 755, 758, 760, 736, 763, 726, 765, 722, 735, + 738, 740, 731, 748, 745, 750, 732, 743, 746, 742, + 756, 752, 759, 737, 741, 739, 749, 734, 757, 733, + 753, 729, 727, 713, 700, 699, 758, 755, 698, 697, + 690, 685, 684, 680, 679, 676, 674, 671, 670, 659, + 654, 653, 763, 648, 647, 642, 760, 636, 634, 628, + 625, 765, 768, 623, 768, 768, 768, 768, 769, 769, + 770, 770, 770, 770, 772, 620, 772, 772, 772, 772, + + 773, 773, 618, 612, 610, 608, 604, 598, 595, 589, + 586, 585, 584, 578, 576, 575, 562, 552, 549, 547, + 546, 545, 544, 542, 539, 538, 534, 527, 526, 524, + 523, 519, 517, 515, 509, 504, 502, 500, 491, 490, + 481, 477, 474, 471, 470, 464, 459, 456, 453, 449, + 444, 424, 422, 416, 413, 400, 398, 397, 396, 395, + 393, 392, 390, 381, 378, 376, 374, 366, 363, 362, + 350, 343, 334, 330, 326, 317, 314, 308, 306, 297, + 282, 281, 279, 274, 259, 252, 251, 244, 230, 209, + 208, 206, 202, 193, 192, 191, 153, 144, 108, 96, + + 93, 92, 54, 53, 50, 47, 17, 16, 3, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767 + } ; + +/* Table of booleans, true if rule could match eol. */ +static const flex_int32_t yy_rule_can_match_eol[170] = + { 0, +1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int yy_flex_debug; +int yy_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#ifndef YYLMAX +#define YYLMAX 8192 +#endif + +char yytext[YYLMAX]; +char *yytext_ptr; +#line 1 "thriftl.ll" +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +/** + * Thrift scanner. + * + * Tokenizes a thrift definition file. + */ +#line 27 "thriftl.ll" + +/* This is redundant with some of the flags in Makefile.am, but it works + * when people override CXXFLAGS without being careful. The pragmas are + * the 'right' way to do it, but don't work on old-enough GCC (in particular + * the GCC that ship on Mac OS X 10.6.5, *counter* to what the GNU docs say) + * + * We should revert the Makefile.am changes once Apple ships a reasonable + * GCC. + */ +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-label" +#endif + +#ifdef _MSC_VER +#pragma warning( push ) + +// warning C4102: 'find_rule' : unreferenced label +#pragma warning( disable : 4102 ) + +// warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data +#pragma warning( disable : 4267 ) + +// avoid isatty redefinition +#define YY_NEVER_INTERACTIVE 1 + +#define YY_NO_UNISTD_H 1 +#endif + +#include <cassert> +#include <string> +#include <errno.h> +#include <stdlib.h> + +#ifdef _MSC_VER +#include "thrift/windows/config.h" +#endif +#include "thrift/main.h" +#include "thrift/common.h" +#include "thrift/globals.h" +#include "thrift/parse/t_program.h" + +/** + * Must be included AFTER parse/t_program.h, but I can't remember why anymore + * because I wrote this a while ago. + */ +#if defined(BISON_USE_PARSER_H_EXTENSION) +#include "thrift/thrifty.h" // Y_IGNORE +#else +#include "thrift/thrifty.hh" +#endif + +void thrift_reserved_keyword(char* keyword) { + yyerror("Cannot use reserved language keyword: \"%s\"\n", keyword); + exit(1); +} + +void integer_overflow(char* text) { + yyerror("This integer is too big: \"%s\"\n", text); + exit(1); +} + +void unexpected_token(char* text) { + yyerror("Unexpected token in input: \"%s\"\n", text); + exit(1); +} + +#line 1196 "thriftl.cc" +/** + * Provides the yylineno global, useful for debugging output + */ +/** + * Our inputs are all single files, so no need for yywrap + */ +/** + * We don't use it, and it fires up warnings at -Wall + */ +/** + * Helper definitions, comments, constants, and whatnot + */ +#line 1209 "thriftl.cc" + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include <unistd.h> +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals ( void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( void ); + +int yyget_debug ( void ); + +void yyset_debug ( int debug_flag ); + +YY_EXTRA_TYPE yyget_extra ( void ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in ( void ); + +void yyset_in ( FILE * _in_str ); + +FILE *yyget_out ( void ); + +void yyset_out ( FILE * _out_str ); + + int yyget_leng ( void ); + +char *yyget_text ( void ); + +int yyget_lineno ( void ); + +void yyset_lineno ( int _line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( void ); +#else +extern int yywrap ( void ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * ); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( void ); +#else +static int input ( void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (void); + +#define YY_DECL int yylex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + { +#line 128 "thriftl.ll" + + +#line 1427 "thriftl.cc" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 768 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 1610 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) + { + int yyl; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + + yylineno++; +; + } + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +/* rule 1 can match eol */ +YY_RULE_SETUP +#line 130 "thriftl.ll" +{ /* do nothing */ } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 131 "thriftl.ll" +{ /* do nothing */ } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 133 "thriftl.ll" +{ + std::string parsed("/**"); + int state = 0; // 0 = normal, 1 = "*" seen, "*/" seen + while(state < 2) + { + int ch = yyinput(); + parsed.push_back(ch); + switch (ch) { + case EOF: + yyerror("Unexpected end of file in doc-comment at %d\n", yylineno); + exit(1); + case '*': + state = 1; + break; + case '/': + state = (state == 1) ? 2 : 0; + break; + default: + state = 0; + break; + } + } + pdebug("doctext = \"%s\"\n",parsed.c_str()); + + /* This does not show up in the parse tree. */ + /* Rather, the parser will grab it out of the global. */ + if (g_parse_mode == PROGRAM) { + clear_doctext(); + g_doctext = strdup(parsed.c_str() + 3); + assert(strlen(g_doctext) >= 2); + g_doctext[strlen(g_doctext) - 2] = ' '; + g_doctext[strlen(g_doctext) - 1] = '\0'; + g_doctext = clean_up_doctext(g_doctext); + g_doctext_lineno = yylineno; + if( (g_program_doctext_candidate == NULL) && (g_program_doctext_status == INVALID)){ + g_program_doctext_candidate = strdup(g_doctext); + g_program_doctext_lineno = g_doctext_lineno; + g_program_doctext_status = STILL_CANDIDATE; + pdebug("%s","program doctext set to STILL_CANDIDATE"); + } + } +} + YY_BREAK +case 4: +YY_RULE_SETUP +#line 176 "thriftl.ll" +{ /* parsed, but thrown away */ + std::string parsed("/*"); + int state = 0; // 0 = normal, 1 = "*" seen, "*/" seen + while(state < 2) + { + int ch = yyinput(); + parsed.push_back(ch); + switch (ch) { + case EOF: + yyerror("Unexpected end of file in multiline comment at %d\n", yylineno); + exit(1); + case '*': + state = 1; + break; + case '/': + state = (state == 1) ? 2 : 0; + break; + default: + state = 0; + break; + } + } + pdebug("multi_comm = \"%s\"\n",parsed.c_str()); +} + YY_BREAK +case 5: +YY_RULE_SETUP +#line 201 "thriftl.ll" +{ /* do nothing */ } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 202 "thriftl.ll" +{ /* do nothing */ } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 204 "thriftl.ll" +{ return yytext[0]; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 205 "thriftl.ll" +{ return yytext[0]; } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 207 "thriftl.ll" +{ yylval.iconst=0; return tok_int_constant; } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 208 "thriftl.ll" +{ yylval.iconst=1; return tok_int_constant; } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 210 "thriftl.ll" +{ return tok_namespace; } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 211 "thriftl.ll" +{ error_unsupported_namespace_decl("cpp"); /* do nothing */ } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 212 "thriftl.ll" +{ return tok_cpp_include; } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 213 "thriftl.ll" +{ return tok_cpp_type; } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 214 "thriftl.ll" +{ error_unsupported_namespace_decl("java_package", "java"); /* do nothing */ } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 215 "thriftl.ll" +{ error_unsupported_namespace_decl("cocoa_prefix", "cocoa"); /* do nothing */ } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 216 "thriftl.ll" +{ error_unsupported_namespace_decl("csharp"); /* do nothing */ } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 217 "thriftl.ll" +{ error_unsupported_namespace_decl("delphi"); /* do nothing */ } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 218 "thriftl.ll" +{ error_unsupported_namespace_decl("php"); /* do nothing */ } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 219 "thriftl.ll" +{ error_unsupported_namespace_decl("py_module", "py"); /* do nothing */ } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 220 "thriftl.ll" +{ error_unsupported_namespace_decl("perl_package", "perl"); /* do nothing */ } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 221 "thriftl.ll" +{ error_unsupported_namespace_decl("ruby"); /* do nothing */ } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 222 "thriftl.ll" +{ error_unsupported_namespace_decl("smalltalk_category", "smalltalk.category"); /* do nothing */ } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 223 "thriftl.ll" +{ error_unsupported_namespace_decl("smalltalk_category", "smalltalk.category"); /* do nothing */ } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 224 "thriftl.ll" +{ return tok_xsd_all; } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 225 "thriftl.ll" +{ return tok_xsd_optional; } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 226 "thriftl.ll" +{ return tok_xsd_nillable; } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 227 "thriftl.ll" +{ error_unsupported_namespace_decl("xsd"); /* do nothing */ } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 228 "thriftl.ll" +{ return tok_xsd_attrs; } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 229 "thriftl.ll" +{ return tok_include; } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 230 "thriftl.ll" +{ return tok_void; } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 231 "thriftl.ll" +{ return tok_bool; } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 232 "thriftl.ll" +{ + emit_byte_type_warning(); + return tok_i8; +} + YY_BREAK +case 34: +YY_RULE_SETUP +#line 236 "thriftl.ll" +{ return tok_i8; } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 237 "thriftl.ll" +{ return tok_i16; } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 238 "thriftl.ll" +{ return tok_i32; } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 239 "thriftl.ll" +{ return tok_i64; } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 240 "thriftl.ll" +{ return tok_double; } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 241 "thriftl.ll" +{ return tok_string; } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 242 "thriftl.ll" +{ return tok_binary; } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 243 "thriftl.ll" +{ + pwarning(0, "\"slist\" is deprecated and will be removed in a future compiler version. This type should be replaced with \"string\".\n"); + return tok_slist; +} + YY_BREAK +case 42: +YY_RULE_SETUP +#line 247 "thriftl.ll" +{ + pwarning(0, "\"senum\" is deprecated and will be removed in a future compiler version. This type should be replaced with \"string\".\n"); + return tok_senum; +} + YY_BREAK +case 43: +YY_RULE_SETUP +#line 251 "thriftl.ll" +{ return tok_map; } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 252 "thriftl.ll" +{ return tok_list; } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 253 "thriftl.ll" +{ return tok_set; } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 254 "thriftl.ll" +{ return tok_oneway; } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 255 "thriftl.ll" +{ return tok_typedef; } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 256 "thriftl.ll" +{ return tok_struct; } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 257 "thriftl.ll" +{ return tok_union; } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 258 "thriftl.ll" +{ return tok_xception; } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 259 "thriftl.ll" +{ return tok_extends; } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 260 "thriftl.ll" +{ return tok_throws; } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 261 "thriftl.ll" +{ return tok_service; } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 262 "thriftl.ll" +{ return tok_enum; } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 263 "thriftl.ll" +{ return tok_const; } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 264 "thriftl.ll" +{ return tok_required; } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 265 "thriftl.ll" +{ return tok_optional; } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 266 "thriftl.ll" +{ + pwarning(0, "\"async\" is deprecated. It is called \"oneway\" now.\n"); + return tok_oneway; +} + YY_BREAK +case 59: +YY_RULE_SETUP +#line 270 "thriftl.ll" +{ return tok_reference; } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 273 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 274 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 275 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 276 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 277 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 278 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 279 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 280 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 281 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 282 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 283 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 284 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 285 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 286 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 287 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 288 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 289 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 290 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 291 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 292 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 293 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 294 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 295 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 296 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 297 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 85: +YY_RULE_SETUP +#line 298 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 299 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 300 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 301 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 302 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 303 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 91: +YY_RULE_SETUP +#line 304 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 92: +YY_RULE_SETUP +#line 305 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 93: +YY_RULE_SETUP +#line 306 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 307 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 95: +YY_RULE_SETUP +#line 308 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 96: +YY_RULE_SETUP +#line 309 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 310 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 98: +YY_RULE_SETUP +#line 311 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 99: +YY_RULE_SETUP +#line 312 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 100: +YY_RULE_SETUP +#line 313 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 101: +YY_RULE_SETUP +#line 314 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 102: +YY_RULE_SETUP +#line 315 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 103: +YY_RULE_SETUP +#line 316 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 104: +YY_RULE_SETUP +#line 317 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 105: +YY_RULE_SETUP +#line 318 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 106: +YY_RULE_SETUP +#line 319 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 107: +YY_RULE_SETUP +#line 320 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 108: +YY_RULE_SETUP +#line 321 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 109: +YY_RULE_SETUP +#line 322 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 323 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 111: +YY_RULE_SETUP +#line 324 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 112: +YY_RULE_SETUP +#line 325 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 113: +YY_RULE_SETUP +#line 326 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 114: +YY_RULE_SETUP +#line 327 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 115: +YY_RULE_SETUP +#line 328 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 116: +YY_RULE_SETUP +#line 329 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 117: +YY_RULE_SETUP +#line 330 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 118: +YY_RULE_SETUP +#line 331 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 119: +YY_RULE_SETUP +#line 332 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 120: +YY_RULE_SETUP +#line 333 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 121: +YY_RULE_SETUP +#line 334 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 122: +YY_RULE_SETUP +#line 335 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 123: +YY_RULE_SETUP +#line 336 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 124: +YY_RULE_SETUP +#line 337 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 125: +YY_RULE_SETUP +#line 338 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 126: +YY_RULE_SETUP +#line 339 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 127: +YY_RULE_SETUP +#line 340 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 128: +YY_RULE_SETUP +#line 341 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 129: +YY_RULE_SETUP +#line 342 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 130: +YY_RULE_SETUP +#line 343 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 344 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 132: +YY_RULE_SETUP +#line 345 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 133: +YY_RULE_SETUP +#line 346 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 134: +YY_RULE_SETUP +#line 347 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 135: +YY_RULE_SETUP +#line 348 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 136: +YY_RULE_SETUP +#line 349 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 137: +YY_RULE_SETUP +#line 350 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 138: +YY_RULE_SETUP +#line 351 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 139: +YY_RULE_SETUP +#line 352 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 140: +YY_RULE_SETUP +#line 353 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 141: +YY_RULE_SETUP +#line 354 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 142: +YY_RULE_SETUP +#line 355 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 143: +YY_RULE_SETUP +#line 356 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 144: +YY_RULE_SETUP +#line 357 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 145: +YY_RULE_SETUP +#line 358 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 146: +YY_RULE_SETUP +#line 359 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 147: +YY_RULE_SETUP +#line 360 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 148: +YY_RULE_SETUP +#line 361 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 149: +YY_RULE_SETUP +#line 362 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 150: +YY_RULE_SETUP +#line 363 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 151: +YY_RULE_SETUP +#line 364 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 152: +YY_RULE_SETUP +#line 365 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 153: +YY_RULE_SETUP +#line 366 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 154: +YY_RULE_SETUP +#line 367 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 155: +YY_RULE_SETUP +#line 368 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 156: +YY_RULE_SETUP +#line 369 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 157: +YY_RULE_SETUP +#line 370 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 158: +YY_RULE_SETUP +#line 371 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 159: +YY_RULE_SETUP +#line 372 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 160: +YY_RULE_SETUP +#line 373 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 161: +YY_RULE_SETUP +#line 374 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 162: +YY_RULE_SETUP +#line 375 "thriftl.ll" +{ thrift_reserved_keyword(yytext); } + YY_BREAK +case 163: +YY_RULE_SETUP +#line 377 "thriftl.ll" +{ + errno = 0; + yylval.iconst = strtoll(yytext, NULL, 10); + if (errno == ERANGE) { + integer_overflow(yytext); + } + return tok_int_constant; +} + YY_BREAK +case 164: +YY_RULE_SETUP +#line 386 "thriftl.ll" +{ + errno = 0; + char sign = yytext[0]; + int shift = sign == '0' ? 2 : 3; + yylval.iconst = strtoll(yytext+shift, NULL, 16); + if (sign == '-') { + yylval.iconst = -yylval.iconst; + } + if (errno == ERANGE) { + integer_overflow(yytext); + } + return tok_int_constant; +} + YY_BREAK +case 165: +YY_RULE_SETUP +#line 400 "thriftl.ll" +{ + yylval.id = strdup(yytext); + return tok_identifier; +} + YY_BREAK +case 166: +YY_RULE_SETUP +#line 405 "thriftl.ll" +{ + /* Deliberately placed after identifier, since "e10" is NOT a double literal (THRIFT-3477) */ + yylval.dconst = atof(yytext); + return tok_dub_constant; +} + YY_BREAK +case 167: +YY_RULE_SETUP +#line 411 "thriftl.ll" +{ + char mark = yytext[0]; + std::string result; + for(;;) + { + int ch = yyinput(); + switch (ch) { + case EOF: + yyerror("End of file while read string at %d\n", yylineno); + exit(1); + case '\n': + yyerror("End of line while read string at %d\n", yylineno - 1); + exit(1); + case '\\': + ch = yyinput(); + switch (ch) { + case 'r': + result.push_back('\r'); + continue; + case 'n': + result.push_back('\n'); + continue; + case 't': + result.push_back('\t'); + continue; + case '"': + result.push_back('"'); + continue; + case '\'': + result.push_back('\''); + continue; + case '\\': + result.push_back('\\'); + continue; + default: + yyerror("Bad escape character\n"); + return -1; + } + break; + default: + if (ch == mark) { + yylval.id = strdup(result.c_str()); + return tok_literal; + } else { + result.push_back(ch); + } + } + } +} + YY_BREAK +case 168: +YY_RULE_SETUP +#line 462 "thriftl.ll" +{ + unexpected_token(yytext); +} + YY_BREAK +case 169: +YY_RULE_SETUP +#line 466 "thriftl.ll" +ECHO; + YY_BREAK +#line 2492 "thriftl.cc" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + yy_state_type yy_current_state; + char *yy_cp; + + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 768 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 768 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 767); + + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return 0; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); + + if ( c == '\n' ) + + yylineno++; +; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void yy_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf ); + + yyfree( (void *) b ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void yypop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (void) +{ + yy_size_t num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr ) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg ) +{ + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int yyget_lineno (void) +{ + + return yylineno; +} + +/** Get the input stream. + * + */ +FILE *yyget_in (void) +{ + return yyin; +} + +/** Get the output stream. + * + */ +FILE *yyget_out (void) +{ + return yyout; +} + +/** Get the length of the current token. + * + */ +int yyget_leng (void) +{ + return yyleng; +} + +/** Get the current token. + * + */ + +char *yyget_text (void) +{ + return yytext; +} + +/** Set the current line number. + * @param _line_number line number + * + */ +void yyset_lineno (int _line_number ) +{ + + yylineno = _line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str ) +{ + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str ) +{ + yyout = _out_str ; +} + +int yyget_debug (void) +{ + return yy_flex_debug; +} + +void yyset_debug (int _bdebug ) +{ + yy_flex_debug = _bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + /* We do not touch yylineno unless the option is enabled. */ + yylineno = 1; + + (yy_buffer_stack) = NULL; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = NULL; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n ) +{ + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s ) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size ) +{ + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size ) +{ + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 466 "thriftl.ll" + + +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + +/* vim: filetype=lex +*/ diff --git a/contrib/restricted/thrift/compiler/thrift/thrifty.cc b/contrib/restricted/thrift/compiler/thrift/thrifty.cc index 877a743b8b..7310292ec6 100644 --- a/contrib/restricted/thrift/compiler/thrift/thrifty.cc +++ b/contrib/restricted/thrift/compiler/thrift/thrifty.cc @@ -1,3058 +1,3058 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.0.4" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - - - -/* Copy the first part of user declarations. */ -#line 4 "thrifty.yy" /* yacc.c:339 */ - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * Thrift parser. - * - * This parser is used on a thrift definition file. - * - */ - -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS -#endif -#ifndef __STDC_FORMAT_MACROS -#define __STDC_FORMAT_MACROS -#endif -#include <stdio.h> -#include <string.h> -#ifndef _MSC_VER -#include <inttypes.h> -#else -#include <stdint.h> -#endif -#include <limits.h> -#ifdef _MSC_VER -#include "thrift/windows/config.h" -#endif -#include "thrift/main.h" -#include "thrift/common.h" -#include "thrift/globals.h" -#include "thrift/parse/t_program.h" -#include "thrift/parse/t_scope.h" - -#ifdef _MSC_VER -//warning C4065: switch statement contains 'default' but no 'case' labels -#pragma warning(disable:4065) -#endif - -/** - * This global variable is used for automatic numbering of field indices etc. - * when parsing the members of a struct. Field values are automatically - * assigned starting from -1 and working their way down. - */ -int y_field_val = -1; -/** - * This global variable is used for automatic numbering of enum values. - * y_enum_val is the last value assigned; the next auto-assigned value will be - * y_enum_val+1, and then it continues working upwards. Explicitly specified - * enum values reset y_enum_val to that value. - */ -int32_t y_enum_val = -1; -int g_arglist = 0; -const int struct_is_struct = 0; -const int struct_is_union = 1; - - -#line 140 "thrifty.cc" /* yacc.c:339 */ - -# ifndef YY_NULLPTR -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "thrifty.hh". */ -#ifndef YY_YY_THRIFTY_HH_INCLUDED -# define YY_YY_THRIFTY_HH_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int yydebug; -#endif -/* "%code requires" blocks. */ -#line 1 "thrifty.yy" /* yacc.c:355 */ - -#include "thrift/parse/t_program.h" - -#line 174 "thrifty.cc" /* yacc.c:355 */ - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - tok_identifier = 258, - tok_literal = 259, - tok_doctext = 260, - tok_int_constant = 261, - tok_dub_constant = 262, - tok_include = 263, - tok_namespace = 264, - tok_cpp_include = 265, - tok_cpp_type = 266, - tok_xsd_all = 267, - tok_xsd_optional = 268, - tok_xsd_nillable = 269, - tok_xsd_attrs = 270, - tok_void = 271, - tok_bool = 272, - tok_string = 273, - tok_binary = 274, - tok_slist = 275, - tok_senum = 276, - tok_i8 = 277, - tok_i16 = 278, - tok_i32 = 279, - tok_i64 = 280, - tok_double = 281, - tok_map = 282, - tok_list = 283, - tok_set = 284, - tok_oneway = 285, - tok_typedef = 286, - tok_struct = 287, - tok_xception = 288, - tok_throws = 289, - tok_extends = 290, - tok_service = 291, - tok_enum = 292, - tok_const = 293, - tok_required = 294, - tok_optional = 295, - tok_union = 296, - tok_reference = 297 - }; -#endif -/* Tokens. */ -#define tok_identifier 258 -#define tok_literal 259 -#define tok_doctext 260 -#define tok_int_constant 261 -#define tok_dub_constant 262 -#define tok_include 263 -#define tok_namespace 264 -#define tok_cpp_include 265 -#define tok_cpp_type 266 -#define tok_xsd_all 267 -#define tok_xsd_optional 268 -#define tok_xsd_nillable 269 -#define tok_xsd_attrs 270 -#define tok_void 271 -#define tok_bool 272 -#define tok_string 273 -#define tok_binary 274 -#define tok_slist 275 -#define tok_senum 276 -#define tok_i8 277 -#define tok_i16 278 -#define tok_i32 279 -#define tok_i64 280 -#define tok_double 281 -#define tok_map 282 -#define tok_list 283 -#define tok_set 284 -#define tok_oneway 285 -#define tok_typedef 286 -#define tok_struct 287 -#define tok_xception 288 -#define tok_throws 289 -#define tok_extends 290 -#define tok_service 291 -#define tok_enum 292 -#define tok_const 293 -#define tok_required 294 -#define tok_optional 295 -#define tok_union 296 -#define tok_reference 297 - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - -union YYSTYPE -{ -#line 82 "thrifty.yy" /* yacc.c:355 */ - - char* id; - int64_t iconst; - double dconst; - bool tbool; - t_doc* tdoc; - t_type* ttype; - t_base_type* tbase; - t_typedef* ttypedef; - t_enum* tenum; - t_enum_value* tenumv; - t_const* tconst; - t_const_value* tconstv; - t_struct* tstruct; - t_service* tservice; - t_function* tfunction; - t_field* tfield; - char* dtext; - t_field::e_req ereq; - t_annotation* tannot; - t_field_id tfieldid; - -#line 293 "thrifty.cc" /* yacc.c:355 */ -}; - -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE yylval; - -int yyparse (void); - -#endif /* !YY_YY_THRIFTY_HH_INCLUDED */ - -/* Copy the second part of user declarations. */ - -#line 310 "thrifty.cc" /* yacc.c:358 */ - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 173 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 56 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 60 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 115 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 200 - -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 297 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 52, 53, 43, 2, 44, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 51, 45, - 54, 48, 55, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 49, 2, 50, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 46, 2, 47, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 250, 250, 262, 273, 282, 287, 292, 296, 308, - 316, 326, 339, 347, 352, 360, 375, 393, 400, 407, - 414, 421, 430, 432, 435, 438, 451, 479, 486, 493, - 507, 522, 534, 546, 553, 560, 567, 586, 595, 601, - 606, 612, 617, 624, 631, 638, 645, 652, 659, 666, - 670, 676, 691, 696, 701, 706, 711, 716, 721, 726, - 731, 745, 759, 764, 769, 782, 787, 794, 800, 815, - 820, 825, 835, 840, 850, 857, 891, 931, 941, 946, - 951, 955, 967, 972, 981, 986, 991, 998, 1017, 1022, - 1028, 1041, 1046, 1051, 1056, 1061, 1066, 1071, 1076, 1081, - 1087, 1098, 1103, 1108, 1115, 1125, 1135, 1146, 1151, 1156, - 1162, 1167, 1175, 1181, 1190, 1196 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "tok_identifier", "tok_literal", - "tok_doctext", "tok_int_constant", "tok_dub_constant", "tok_include", - "tok_namespace", "tok_cpp_include", "tok_cpp_type", "tok_xsd_all", - "tok_xsd_optional", "tok_xsd_nillable", "tok_xsd_attrs", "tok_void", - "tok_bool", "tok_string", "tok_binary", "tok_slist", "tok_senum", - "tok_i8", "tok_i16", "tok_i32", "tok_i64", "tok_double", "tok_map", - "tok_list", "tok_set", "tok_oneway", "tok_typedef", "tok_struct", - "tok_xception", "tok_throws", "tok_extends", "tok_service", "tok_enum", - "tok_const", "tok_required", "tok_optional", "tok_union", - "tok_reference", "'*'", "','", "';'", "'{'", "'}'", "'='", "'['", "']'", - "':'", "'('", "')'", "'<'", "'>'", "$accept", "Program", - "CaptureDocText", "DestroyDocText", "HeaderList", "Header", "Include", - "DefinitionList", "Definition", "TypeDefinition", - "CommaOrSemicolonOptional", "Typedef", "Enum", "EnumDefList", "EnumDef", - "EnumValue", "Senum", "SenumDefList", "SenumDef", "Const", "ConstValue", - "ConstList", "ConstListContents", "ConstMap", "ConstMapContents", - "StructHead", "Struct", "XsdAll", "XsdOptional", "XsdNillable", - "XsdAttributes", "Xception", "Service", "FlagArgs", "UnflagArgs", - "Extends", "FunctionList", "Function", "Oneway", "Throws", "FieldList", - "Field", "FieldIdentifier", "FieldReference", "FieldRequiredness", - "FieldValue", "FunctionType", "FieldType", "BaseType", "SimpleBaseType", - "ContainerType", "SimpleContainerType", "MapType", "SetType", "ListType", - "CppType", "TypeAnnotations", "TypeAnnotationList", "TypeAnnotation", - "TypeAnnotationValue", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 42, 44, 59, 123, 125, 61, 91, - 93, 58, 40, 41, 60, 62 -}; -# endif - -#define YYPACT_NINF -124 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-124))) - -#define YYTABLE_NINF -64 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - -124, 15, 9, -124, 26, 33, 35, 13, 36, -124, - -124, 132, -124, 39, 40, -124, 41, 123, -124, 42, - 45, 46, 123, -124, -124, -124, -124, -124, -124, -124, - 61, -124, -124, -124, 16, -124, 19, -124, -124, -124, - -124, -124, -124, -124, -124, -124, -124, 56, 18, 56, - 70, -124, 16, -124, 16, -124, -124, -124, 29, 43, - 30, 74, 68, -124, -124, -124, 77, 28, 123, 34, - 16, -124, -124, -124, 80, 38, -124, 44, -124, 48, - 7, 3, -124, 123, 32, 123, -23, 49, -124, -124, - 50, 25, -124, 47, -124, -124, -23, 16, -124, 55, - 56, 65, -124, -124, -124, 16, 84, -124, -124, 16, - 98, -124, -124, -124, -124, -124, -124, -124, -23, -124, - -124, 75, 117, -23, -124, -124, 123, -124, -124, -124, - 51, -2, 76, -124, 79, 16, 5, 20, -124, 16, - -124, -124, 78, -124, -124, -124, 123, 95, 82, -124, - 124, -23, -124, 81, -124, -23, -124, -124, 89, -124, - 90, 16, -124, -124, 25, -124, -124, 131, -124, 133, - -124, -124, -23, 87, 92, -124, 25, 141, -124, -124, - -124, 142, 102, -124, 143, 125, 111, 16, 108, 16, - -124, -23, -124, -23, 114, -124, 109, -124, -124, -124 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 6, 0, 13, 1, 0, 3, 0, 0, 0, 5, - 7, 0, 11, 0, 0, 10, 0, 0, 49, 0, - 0, 0, 0, 50, 12, 15, 17, 18, 19, 14, - 0, 20, 21, 16, 110, 9, 0, 87, 94, 91, - 92, 93, 95, 96, 97, 98, 99, 108, 0, 108, - 0, 88, 110, 89, 110, 101, 102, 103, 0, 65, - 0, 0, 53, 112, 8, 34, 0, 0, 0, 0, - 110, 90, 100, 74, 0, 0, 28, 0, 52, 0, - 0, 0, 107, 0, 0, 0, 24, 3, 64, 62, - 3, 0, 74, 115, 109, 111, 24, 110, 33, 0, - 108, 0, 22, 23, 25, 110, 77, 73, 67, 110, - 0, 27, 40, 39, 37, 38, 48, 45, 24, 41, - 42, 3, 0, 24, 35, 32, 0, 106, 105, 60, - 0, 82, 3, 26, 31, 110, 0, 0, 36, 110, - 114, 113, 0, 76, 80, 81, 0, 70, 0, 66, - 0, 24, 46, 0, 43, 24, 51, 104, 79, 69, - 0, 110, 30, 29, 0, 44, 78, 0, 86, 0, - 85, 61, 24, 84, 0, 47, 0, 55, 74, 83, - 54, 57, 3, 56, 59, 72, 0, 110, 0, 110, - 74, 24, 74, 24, 3, 75, 3, 68, 58, 71 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -124, -124, -4, -124, -124, -124, -124, -124, -124, -124, - -93, -124, -124, -124, -124, -124, -124, -124, -124, -124, - -123, -124, -124, -124, -124, -124, -124, -124, -124, -124, - -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, - -87, -124, -124, -124, -124, -124, -124, -22, -124, -124, - -124, -124, -124, -124, -124, -43, -50, -124, -124, -124 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 1, 106, 4, 2, 9, 10, 5, 24, 25, - 104, 26, 27, 90, 111, 135, 28, 81, 98, 29, - 118, 119, 137, 120, 136, 30, 31, 79, 181, 184, - 187, 32, 33, 108, 148, 75, 132, 149, 160, 189, - 87, 107, 131, 167, 146, 177, 169, 50, 51, 52, - 53, 54, 55, 56, 57, 67, 64, 80, 95, 123 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_int16 yytable[] = -{ - 61, 11, 71, 124, 72, 121, 69, 96, 112, 113, - 93, 114, 115, 153, 155, 3, 13, -4, -4, -4, - 86, 102, 103, 112, 113, 138, 114, 115, 112, 113, - 141, 114, 115, -2, 6, 7, 8, 144, 145, 12, - 15, 172, 34, 35, 36, 58, 84, 125, 59, 60, - 97, 116, 152, 179, 117, 129, 14, 127, 163, 133, - 94, 99, 165, 101, 62, 65, 116, 66, 63, 117, - 154, 116, 68, 70, 117, 73, 76, 77, 74, 175, - 78, 82, 83, 88, 89, 151, 110, 100, 85, 156, - 130, 182, 91, 37, 92, 122, 105, 109, 195, 126, - 197, 134, 143, 194, 142, 196, 168, 38, 39, 40, - 41, 171, 42, 43, 44, 45, 46, 47, 48, 49, - 128, 140, 139, -63, 158, 159, 37, 150, 147, 161, - 162, 166, 164, 157, 173, 176, 174, 191, 170, 193, - 38, 39, 40, 41, 178, 42, 43, 44, 45, 46, - 47, 48, 49, 16, 180, 185, 183, 190, 186, 188, - 192, 198, 199, 17, 18, 19, 0, 0, 20, 21, - 22, 0, 0, 23 -}; - -static const yytype_int16 yycheck[] = -{ - 22, 5, 52, 96, 54, 92, 49, 4, 3, 4, - 3, 6, 7, 136, 137, 0, 3, 8, 9, 10, - 70, 44, 45, 3, 4, 118, 6, 7, 3, 4, - 123, 6, 7, 0, 8, 9, 10, 39, 40, 4, - 4, 164, 3, 3, 3, 3, 68, 97, 3, 3, - 47, 46, 47, 176, 49, 105, 43, 100, 151, 109, - 53, 83, 155, 85, 3, 46, 46, 11, 52, 49, - 50, 46, 54, 3, 49, 46, 46, 3, 35, 172, - 12, 4, 54, 3, 46, 135, 90, 55, 54, 139, - 6, 178, 48, 3, 46, 48, 47, 47, 191, 44, - 193, 3, 51, 190, 126, 192, 16, 17, 18, 19, - 20, 161, 22, 23, 24, 25, 26, 27, 28, 29, - 55, 4, 47, 47, 146, 30, 3, 48, 132, 47, - 6, 42, 51, 55, 3, 48, 3, 187, 160, 189, - 17, 18, 19, 20, 52, 22, 23, 24, 25, 26, - 27, 28, 29, 21, 13, 53, 14, 46, 15, 34, - 52, 47, 53, 31, 32, 33, -1, -1, 36, 37, - 38, -1, -1, 41 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 57, 60, 0, 59, 63, 8, 9, 10, 61, - 62, 58, 4, 3, 43, 4, 21, 31, 32, 33, - 36, 37, 38, 41, 64, 65, 67, 68, 72, 75, - 81, 82, 87, 88, 3, 3, 3, 3, 17, 18, - 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, - 103, 104, 105, 106, 107, 108, 109, 110, 3, 3, - 3, 103, 3, 52, 112, 46, 11, 111, 54, 111, - 3, 112, 112, 46, 35, 91, 46, 3, 12, 83, - 113, 73, 4, 54, 103, 54, 112, 96, 3, 46, - 69, 48, 46, 3, 53, 114, 4, 47, 74, 103, - 55, 103, 44, 45, 66, 47, 58, 97, 89, 47, - 58, 70, 3, 4, 6, 7, 46, 49, 76, 77, - 79, 96, 48, 115, 66, 112, 44, 111, 55, 112, - 6, 98, 92, 112, 3, 71, 80, 78, 66, 47, - 4, 66, 103, 51, 39, 40, 100, 58, 90, 93, - 48, 112, 47, 76, 50, 76, 112, 55, 103, 30, - 94, 47, 6, 66, 51, 66, 42, 99, 16, 102, - 103, 112, 76, 3, 3, 66, 48, 101, 52, 76, - 13, 84, 96, 14, 85, 53, 15, 86, 34, 95, - 46, 112, 52, 112, 96, 66, 96, 66, 47, 53 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 56, 57, 58, 59, 60, 60, 61, 61, 61, - 61, 62, 63, 63, 64, 64, 64, 65, 65, 65, - 65, 65, 66, 66, 66, 67, 68, 69, 69, 70, - 71, 71, 72, 73, 73, 74, 75, 76, 76, 76, - 76, 76, 76, 77, 78, 78, 79, 80, 80, 81, - 81, 82, 83, 83, 84, 84, 85, 85, 86, 86, - 87, 88, 89, 90, 91, 91, 92, 92, 93, 94, - 94, 95, 95, 96, 96, 97, 98, 98, 99, 99, - 100, 100, 100, 101, 101, 102, 102, 103, 103, 103, - 104, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 106, 107, 107, 107, 108, 109, 110, 111, 111, 112, - 112, 113, 113, 114, 115, 115 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 2, 0, 0, 3, 0, 1, 4, 3, - 2, 2, 3, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 5, 6, 2, 0, 4, - 3, 1, 6, 2, 0, 2, 6, 1, 1, 1, - 1, 1, 1, 3, 3, 0, 3, 5, 0, 1, - 1, 7, 1, 0, 1, 0, 1, 0, 4, 0, - 6, 9, 0, 0, 2, 0, 2, 0, 10, 1, - 0, 4, 0, 2, 0, 12, 2, 0, 1, 0, - 1, 1, 0, 2, 0, 1, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 1, 1, 1, 7, 5, 5, 2, 0, 3, - 0, 2, 0, 3, 2, 0 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -{ - YYFPRINTF (yyoutput, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) -{ - unsigned long int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -{ - YYUSE (yyvaluep); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; -/* Number of syntax errors so far. */ -int yynerrs; - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (void) -{ - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 251 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Program -> Headers DefinitionList"); - if((g_program_doctext_candidate != NULL) && (g_program_doctext_status != ALREADY_PROCESSED)) - { - g_program->set_doc(g_program_doctext_candidate); - g_program_doctext_status = ALREADY_PROCESSED; - } - clear_doctext(); - } -#line 1548 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 3: -#line 262 "thrifty.yy" /* yacc.c:1646 */ - { - if (g_parse_mode == PROGRAM) { - (yyval.dtext) = g_doctext; - g_doctext = NULL; - } else { - (yyval.dtext) = NULL; - } - } -#line 1561 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 4: -#line 273 "thrifty.yy" /* yacc.c:1646 */ - { - if (g_parse_mode == PROGRAM) { - clear_doctext(); - } - } -#line 1571 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 5: -#line 283 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("HeaderList -> HeaderList Header"); - } -#line 1579 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 6: -#line 287 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("HeaderList -> "); - } -#line 1587 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 7: -#line 293 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Header -> Include"); - } -#line 1595 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 8: -#line 297 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Header -> tok_namespace tok_identifier tok_identifier"); - declare_valid_program_doctext(); - if (g_parse_mode == PROGRAM) { - g_program->set_namespace((yyvsp[-2].id), (yyvsp[-1].id)); - } - if ((yyvsp[0].ttype) != NULL) { - g_program->set_namespace_annotations((yyvsp[-2].id), (yyvsp[0].ttype)->annotations_); - delete (yyvsp[0].ttype); - } - } -#line 1611 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 9: -#line 309 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Header -> tok_namespace * tok_identifier"); - declare_valid_program_doctext(); - if (g_parse_mode == PROGRAM) { - g_program->set_namespace("*", (yyvsp[0].id)); - } - } -#line 1623 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 10: -#line 317 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Header -> tok_cpp_include tok_literal"); - declare_valid_program_doctext(); - if (g_parse_mode == PROGRAM) { - g_program->add_cpp_include((yyvsp[0].id)); - } - } -#line 1635 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 11: -#line 327 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Include -> tok_include tok_literal"); - declare_valid_program_doctext(); - if (g_parse_mode == INCLUDES) { - std::string path = include_file(std::string((yyvsp[0].id))); - if (!path.empty()) { - g_program->add_include(path, std::string((yyvsp[0].id))); - } - } - } -#line 1650 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 12: -#line 340 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("DefinitionList -> DefinitionList Definition"); - if ((yyvsp[-1].dtext) != NULL && (yyvsp[0].tdoc) != NULL) { - (yyvsp[0].tdoc)->set_doc((yyvsp[-1].dtext)); - } - } -#line 1661 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 13: -#line 347 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("DefinitionList -> "); - } -#line 1669 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 14: -#line 353 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Definition -> Const"); - if (g_parse_mode == PROGRAM) { - g_program->add_const((yyvsp[0].tconst)); - } - (yyval.tdoc) = (yyvsp[0].tconst); - } -#line 1681 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 15: -#line 361 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Definition -> TypeDefinition"); - if (g_parse_mode == PROGRAM) { - g_scope->add_type((yyvsp[0].ttype)->get_name(), (yyvsp[0].ttype)); - if (g_parent_scope != NULL) { - g_parent_scope->add_type(g_parent_prefix + (yyvsp[0].ttype)->get_name(), (yyvsp[0].ttype)); - } - if (! g_program->is_unique_typename((yyvsp[0].ttype))) { - yyerror("Type \"%s\" is already defined.", (yyvsp[0].ttype)->get_name().c_str()); - exit(1); - } - } - (yyval.tdoc) = (yyvsp[0].ttype); - } -#line 1700 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 16: -#line 376 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Definition -> Service"); - if (g_parse_mode == PROGRAM) { - g_scope->add_service((yyvsp[0].tservice)->get_name(), (yyvsp[0].tservice)); - if (g_parent_scope != NULL) { - g_parent_scope->add_service(g_parent_prefix + (yyvsp[0].tservice)->get_name(), (yyvsp[0].tservice)); - } - g_program->add_service((yyvsp[0].tservice)); - if (! g_program->is_unique_typename((yyvsp[0].tservice))) { - yyerror("Type \"%s\" is already defined.", (yyvsp[0].tservice)->get_name().c_str()); - exit(1); - } - } - (yyval.tdoc) = (yyvsp[0].tservice); - } -#line 1720 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 17: -#line 394 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("TypeDefinition -> Typedef"); - if (g_parse_mode == PROGRAM) { - g_program->add_typedef((yyvsp[0].ttypedef)); - } - } -#line 1731 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 18: -#line 401 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("TypeDefinition -> Enum"); - if (g_parse_mode == PROGRAM) { - g_program->add_enum((yyvsp[0].tenum)); - } - } -#line 1742 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 19: -#line 408 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("TypeDefinition -> Senum"); - if (g_parse_mode == PROGRAM) { - g_program->add_typedef((yyvsp[0].ttypedef)); - } - } -#line 1753 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 20: -#line 415 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("TypeDefinition -> Struct"); - if (g_parse_mode == PROGRAM) { - g_program->add_struct((yyvsp[0].tstruct)); - } - } -#line 1764 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 21: -#line 422 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("TypeDefinition -> Xception"); - if (g_parse_mode == PROGRAM) { - g_program->add_xception((yyvsp[0].tstruct)); - } - } -#line 1775 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 22: -#line 431 "thrifty.yy" /* yacc.c:1646 */ - {} -#line 1781 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 23: -#line 433 "thrifty.yy" /* yacc.c:1646 */ - {} -#line 1787 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 24: -#line 435 "thrifty.yy" /* yacc.c:1646 */ - {} -#line 1793 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 25: -#line 439 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("TypeDef -> tok_typedef FieldType tok_identifier"); - validate_simple_identifier( (yyvsp[-2].id)); - t_typedef *td = new t_typedef(g_program, (yyvsp[-3].ttype), (yyvsp[-2].id)); - (yyval.ttypedef) = td; - if ((yyvsp[-1].ttype) != NULL) { - (yyval.ttypedef)->annotations_ = (yyvsp[-1].ttype)->annotations_; - delete (yyvsp[-1].ttype); - } - } -#line 1808 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 26: -#line 452 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Enum -> tok_enum tok_identifier { EnumDefList }"); - (yyval.tenum) = (yyvsp[-2].tenum); - validate_simple_identifier( (yyvsp[-4].id)); - (yyval.tenum)->set_name((yyvsp[-4].id)); - if ((yyvsp[0].ttype) != NULL) { - (yyval.tenum)->annotations_ = (yyvsp[0].ttype)->annotations_; - delete (yyvsp[0].ttype); - } - - // make constants for all the enum values - if (g_parse_mode == PROGRAM) { - const std::vector<t_enum_value*>& enum_values = (yyval.tenum)->get_constants(); - std::vector<t_enum_value*>::const_iterator c_iter; - for (c_iter = enum_values.begin(); c_iter != enum_values.end(); ++c_iter) { - std::string const_name = (yyval.tenum)->get_name() + "." + (*c_iter)->get_name(); - t_const_value* const_val = new t_const_value((*c_iter)->get_value()); - const_val->set_enum((yyval.tenum)); - g_scope->add_constant(const_name, new t_const(g_type_i32, (*c_iter)->get_name(), const_val)); - if (g_parent_scope != NULL) { - g_parent_scope->add_constant(g_parent_prefix + const_name, new t_const(g_type_i32, (*c_iter)->get_name(), const_val)); - } - } - } - } -#line 1838 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 27: -#line 480 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("EnumDefList -> EnumDefList EnumDef"); - (yyval.tenum) = (yyvsp[-1].tenum); - (yyval.tenum)->append((yyvsp[0].tenumv)); - } -#line 1848 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 28: -#line 486 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("EnumDefList -> "); - (yyval.tenum) = new t_enum(g_program); - y_enum_val = -1; - } -#line 1858 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 29: -#line 494 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("EnumDef -> EnumValue"); - (yyval.tenumv) = (yyvsp[-2].tenumv); - if ((yyvsp[-3].dtext) != NULL) { - (yyval.tenumv)->set_doc((yyvsp[-3].dtext)); - } - if ((yyvsp[-1].ttype) != NULL) { - (yyval.tenumv)->annotations_ = (yyvsp[-1].ttype)->annotations_; - delete (yyvsp[-1].ttype); - } - } -#line 1874 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 30: -#line 508 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("EnumValue -> tok_identifier = tok_int_constant"); - if ((yyvsp[0].iconst) < INT32_MIN || (yyvsp[0].iconst) > INT32_MAX) { - // Note: this used to be just a warning. However, since thrift always - // treats enums as i32 values, I'm changing it to a fatal error. - // I doubt this will affect many people, but users who run into this - // will have to update their thrift files to manually specify the - // truncated i32 value that thrift has always been using anyway. - failure("64-bit value supplied for enum %s will be truncated.", (yyvsp[-2].id)); - } - y_enum_val = static_cast<int32_t>((yyvsp[0].iconst)); - (yyval.tenumv) = new t_enum_value((yyvsp[-2].id), y_enum_val); - } -#line 1892 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 31: -#line 523 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("EnumValue -> tok_identifier"); - validate_simple_identifier( (yyvsp[0].id)); - if (y_enum_val == INT32_MAX) { - failure("enum value overflow at enum %s", (yyvsp[0].id)); - } - ++y_enum_val; - (yyval.tenumv) = new t_enum_value((yyvsp[0].id), y_enum_val); - } -#line 1906 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 32: -#line 535 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Senum -> tok_senum tok_identifier { SenumDefList }"); - validate_simple_identifier( (yyvsp[-4].id)); - (yyval.ttypedef) = new t_typedef(g_program, (yyvsp[-2].tbase), (yyvsp[-4].id)); - if ((yyvsp[0].ttype) != NULL) { - (yyval.ttypedef)->annotations_ = (yyvsp[0].ttype)->annotations_; - delete (yyvsp[0].ttype); - } - } -#line 1920 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 33: -#line 547 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("SenumDefList -> SenumDefList SenumDef"); - (yyval.tbase) = (yyvsp[-1].tbase); - (yyval.tbase)->add_string_enum_val((yyvsp[0].id)); - } -#line 1930 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 34: -#line 553 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("SenumDefList -> "); - (yyval.tbase) = new t_base_type("string", t_base_type::TYPE_STRING); - (yyval.tbase)->set_string_enum(true); - } -#line 1940 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 35: -#line 561 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("SenumDef -> tok_literal"); - (yyval.id) = (yyvsp[-1].id); - } -#line 1949 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 36: -#line 568 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Const -> tok_const FieldType tok_identifier = ConstValue"); - if (g_parse_mode == PROGRAM) { - validate_simple_identifier( (yyvsp[-3].id)); - g_scope->resolve_const_value((yyvsp[-1].tconstv), (yyvsp[-4].ttype)); - (yyval.tconst) = new t_const((yyvsp[-4].ttype), (yyvsp[-3].id), (yyvsp[-1].tconstv)); - validate_const_type((yyval.tconst)); - - g_scope->add_constant((yyvsp[-3].id), (yyval.tconst)); - if (g_parent_scope != NULL) { - g_parent_scope->add_constant(g_parent_prefix + (yyvsp[-3].id), (yyval.tconst)); - } - } else { - (yyval.tconst) = NULL; - } - } -#line 1970 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 37: -#line 587 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ConstValue => tok_int_constant"); - (yyval.tconstv) = new t_const_value(); - (yyval.tconstv)->set_integer((yyvsp[0].iconst)); - if (!g_allow_64bit_consts && ((yyvsp[0].iconst) < INT32_MIN || (yyvsp[0].iconst) > INT32_MAX)) { - pwarning(1, "64-bit constant \"%" PRIi64"\" may not work in all languages.\n", (yyvsp[0].iconst)); - } - } -#line 1983 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 38: -#line 596 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ConstValue => tok_dub_constant"); - (yyval.tconstv) = new t_const_value(); - (yyval.tconstv)->set_double((yyvsp[0].dconst)); - } -#line 1993 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 39: -#line 602 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ConstValue => tok_literal"); - (yyval.tconstv) = new t_const_value((yyvsp[0].id)); - } -#line 2002 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 40: -#line 607 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ConstValue => tok_identifier"); - (yyval.tconstv) = new t_const_value(); - (yyval.tconstv)->set_identifier((yyvsp[0].id)); - } -#line 2012 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 41: -#line 613 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ConstValue => ConstList"); - (yyval.tconstv) = (yyvsp[0].tconstv); - } -#line 2021 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 42: -#line 618 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ConstValue => ConstMap"); - (yyval.tconstv) = (yyvsp[0].tconstv); - } -#line 2030 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 43: -#line 625 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ConstList => [ ConstListContents ]"); - (yyval.tconstv) = (yyvsp[-1].tconstv); - } -#line 2039 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 44: -#line 632 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ConstListContents => ConstListContents ConstValue CommaOrSemicolonOptional"); - (yyval.tconstv) = (yyvsp[-2].tconstv); - (yyval.tconstv)->add_list((yyvsp[-1].tconstv)); - } -#line 2049 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 45: -#line 638 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ConstListContents =>"); - (yyval.tconstv) = new t_const_value(); - (yyval.tconstv)->set_list(); - } -#line 2059 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 46: -#line 646 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ConstMap => { ConstMapContents }"); - (yyval.tconstv) = (yyvsp[-1].tconstv); - } -#line 2068 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 47: -#line 653 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ConstMapContents => ConstMapContents ConstValue CommaOrSemicolonOptional"); - (yyval.tconstv) = (yyvsp[-4].tconstv); - (yyval.tconstv)->add_map((yyvsp[-3].tconstv), (yyvsp[-1].tconstv)); - } -#line 2078 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 48: -#line 659 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ConstMapContents =>"); - (yyval.tconstv) = new t_const_value(); - (yyval.tconstv)->set_map(); - } -#line 2088 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 49: -#line 667 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.iconst) = struct_is_struct; - } -#line 2096 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 50: -#line 671 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.iconst) = struct_is_union; - } -#line 2104 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 51: -#line 677 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Struct -> tok_struct tok_identifier { FieldList }"); - validate_simple_identifier( (yyvsp[-5].id)); - (yyvsp[-2].tstruct)->set_xsd_all((yyvsp[-4].tbool)); - (yyvsp[-2].tstruct)->set_union((yyvsp[-6].iconst) == struct_is_union); - (yyval.tstruct) = (yyvsp[-2].tstruct); - (yyval.tstruct)->set_name((yyvsp[-5].id)); - if ((yyvsp[0].ttype) != NULL) { - (yyval.tstruct)->annotations_ = (yyvsp[0].ttype)->annotations_; - delete (yyvsp[0].ttype); - } - } -#line 2121 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 52: -#line 692 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tbool) = true; - } -#line 2129 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 53: -#line 696 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tbool) = false; - } -#line 2137 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 54: -#line 702 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tbool) = true; - } -#line 2145 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 55: -#line 706 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tbool) = false; - } -#line 2153 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 56: -#line 712 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tbool) = true; - } -#line 2161 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 57: -#line 716 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tbool) = false; - } -#line 2169 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 58: -#line 722 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tstruct) = (yyvsp[-1].tstruct); - } -#line 2177 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 59: -#line 726 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tstruct) = NULL; - } -#line 2185 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 60: -#line 732 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Xception -> tok_xception tok_identifier { FieldList }"); - validate_simple_identifier( (yyvsp[-4].id)); - (yyvsp[-2].tstruct)->set_name((yyvsp[-4].id)); - (yyvsp[-2].tstruct)->set_xception(true); - (yyval.tstruct) = (yyvsp[-2].tstruct); - if ((yyvsp[0].ttype) != NULL) { - (yyval.tstruct)->annotations_ = (yyvsp[0].ttype)->annotations_; - delete (yyvsp[0].ttype); - } - } -#line 2201 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 61: -#line 746 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Service -> tok_service tok_identifier { FunctionList }"); - validate_simple_identifier( (yyvsp[-7].id)); - (yyval.tservice) = (yyvsp[-3].tservice); - (yyval.tservice)->set_name((yyvsp[-7].id)); - (yyval.tservice)->set_extends((yyvsp[-6].tservice)); - if ((yyvsp[0].ttype) != NULL) { - (yyval.tservice)->annotations_ = (yyvsp[0].ttype)->annotations_; - delete (yyvsp[0].ttype); - } - } -#line 2217 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 62: -#line 759 "thrifty.yy" /* yacc.c:1646 */ - { - g_arglist = 1; - } -#line 2225 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 63: -#line 764 "thrifty.yy" /* yacc.c:1646 */ - { - g_arglist = 0; - } -#line 2233 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 64: -#line 770 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Extends -> tok_extends tok_identifier"); - (yyval.tservice) = NULL; - if (g_parse_mode == PROGRAM) { - (yyval.tservice) = g_scope->get_service((yyvsp[0].id)); - if ((yyval.tservice) == NULL) { - yyerror("Service \"%s\" has not been defined.", (yyvsp[0].id)); - exit(1); - } - } - } -#line 2249 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 65: -#line 782 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tservice) = NULL; - } -#line 2257 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 66: -#line 788 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("FunctionList -> FunctionList Function"); - (yyval.tservice) = (yyvsp[-1].tservice); - (yyvsp[-1].tservice)->add_function((yyvsp[0].tfunction)); - } -#line 2267 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 67: -#line 794 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("FunctionList -> "); - (yyval.tservice) = new t_service(g_program); - } -#line 2276 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 68: -#line 801 "thrifty.yy" /* yacc.c:1646 */ - { - validate_simple_identifier( (yyvsp[-6].id)); - (yyvsp[-4].tstruct)->set_name(std::string((yyvsp[-6].id)) + "_args"); - (yyval.tfunction) = new t_function((yyvsp[-7].ttype), (yyvsp[-6].id), (yyvsp[-4].tstruct), (yyvsp[-2].tstruct), (yyvsp[-8].tbool)); - if ((yyvsp[-9].dtext) != NULL) { - (yyval.tfunction)->set_doc((yyvsp[-9].dtext)); - } - if ((yyvsp[-1].ttype) != NULL) { - (yyval.tfunction)->annotations_ = (yyvsp[-1].ttype)->annotations_; - delete (yyvsp[-1].ttype); - } - } -#line 2293 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 69: -#line 816 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tbool) = true; - } -#line 2301 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 70: -#line 820 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tbool) = false; - } -#line 2309 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 71: -#line 826 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("Throws -> tok_throws ( FieldList )"); - (yyval.tstruct) = (yyvsp[-1].tstruct); - if (g_parse_mode == PROGRAM && !validate_throws((yyval.tstruct))) { - yyerror("Throws clause may not contain non-exception types"); - exit(1); - } - } -#line 2322 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 72: -#line 835 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tstruct) = new t_struct(g_program); - } -#line 2330 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 73: -#line 841 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("FieldList -> FieldList , Field"); - (yyval.tstruct) = (yyvsp[-1].tstruct); - if (!((yyval.tstruct)->append((yyvsp[0].tfield)))) { - yyerror("\"%d: %s\" - field identifier/name has already been used", (yyvsp[0].tfield)->get_key(), (yyvsp[0].tfield)->get_name().c_str()); - exit(1); - } - } -#line 2343 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 74: -#line 850 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("FieldList -> "); - y_field_val = -1; - (yyval.tstruct) = new t_struct(g_program); - } -#line 2353 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 75: -#line 858 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("tok_int_constant : Field -> FieldType tok_identifier"); - if ((yyvsp[-10].tfieldid).auto_assigned) { - pwarning(1, "No field key specified for %s, resulting protocol may have conflicts or not be backwards compatible!\n", (yyvsp[-6].id)); - if (g_strict >= 192) { - yyerror("Implicit field keys are deprecated and not allowed with -strict"); - exit(1); - } - } - validate_simple_identifier((yyvsp[-6].id)); - (yyval.tfield) = new t_field((yyvsp[-8].ttype), (yyvsp[-6].id), (yyvsp[-10].tfieldid).value); - (yyval.tfield)->set_reference((yyvsp[-7].tbool)); - (yyval.tfield)->set_req((yyvsp[-9].ereq)); - if ((yyvsp[-5].tconstv) != NULL) { - g_scope->resolve_const_value((yyvsp[-5].tconstv), (yyvsp[-8].ttype)); - validate_field_value((yyval.tfield), (yyvsp[-5].tconstv)); - (yyval.tfield)->set_value((yyvsp[-5].tconstv)); - } - (yyval.tfield)->set_xsd_optional((yyvsp[-4].tbool)); - (yyval.tfield)->set_xsd_nillable((yyvsp[-3].tbool)); - if ((yyvsp[-11].dtext) != NULL) { - (yyval.tfield)->set_doc((yyvsp[-11].dtext)); - } - if ((yyvsp[-2].tstruct) != NULL) { - (yyval.tfield)->set_xsd_attrs((yyvsp[-2].tstruct)); - } - if ((yyvsp[-1].ttype) != NULL) { - (yyval.tfield)->annotations_ = (yyvsp[-1].ttype)->annotations_; - delete (yyvsp[-1].ttype); - } - } -#line 2389 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 76: -#line 892 "thrifty.yy" /* yacc.c:1646 */ - { - if ((yyvsp[-1].iconst) <= 0) { - if (g_allow_neg_field_keys) { - /* - * g_allow_neg_field_keys exists to allow users to add explicitly - * specified key values to old .thrift files without breaking - * protocol compatibility. - */ - if ((yyvsp[-1].iconst) != y_field_val) { - /* - * warn if the user-specified negative value isn't what - * thrift would have auto-assigned. - */ - pwarning(1, "Nonpositive field key (%" PRIi64") differs from what would be " - "auto-assigned by thrift (%d).\n", (yyvsp[-1].iconst), y_field_val); - } - /* - * Leave $1 as-is, and update y_field_val to be one less than $1. - * The FieldList parsing will catch any duplicate key values. - */ - y_field_val = static_cast<int32_t>((yyvsp[-1].iconst) - 1); - (yyval.tfieldid).value = static_cast<int32_t>((yyvsp[-1].iconst)); - (yyval.tfieldid).auto_assigned = false; - } else { - pwarning(1, "Nonpositive value (%d) not allowed as a field key.\n", - (yyvsp[-1].iconst)); - (yyval.tfieldid).value = y_field_val--; - (yyval.tfieldid).auto_assigned = true; - } - } else { - (yyval.tfieldid).value = static_cast<int32_t>((yyvsp[-1].iconst)); - (yyval.tfieldid).auto_assigned = false; - } - if( (SHRT_MIN > (yyval.tfieldid).value) || ((yyval.tfieldid).value > SHRT_MAX)) { - pwarning(1, "Field key (%d) exceeds allowed range (%d..%d).\n", - (yyval.tfieldid).value, SHRT_MIN, SHRT_MAX); - } - } -#line 2432 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 77: -#line 931 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tfieldid).value = y_field_val--; - (yyval.tfieldid).auto_assigned = true; - if( (SHRT_MIN > (yyval.tfieldid).value) || ((yyval.tfieldid).value > SHRT_MAX)) { - pwarning(1, "Field key (%d) exceeds allowed range (%d..%d).\n", - (yyval.tfieldid).value, SHRT_MIN, SHRT_MAX); - } - } -#line 2445 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 78: -#line 942 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tbool) = true; - } -#line 2453 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 79: -#line 946 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tbool) = false; - } -#line 2461 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 80: -#line 952 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.ereq) = t_field::T_REQUIRED; - } -#line 2469 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 81: -#line 956 "thrifty.yy" /* yacc.c:1646 */ - { - if (g_arglist) { - if (g_parse_mode == PROGRAM) { - pwarning(1, "optional keyword is ignored in argument lists.\n"); - } - (yyval.ereq) = t_field::T_OPT_IN_REQ_OUT; - } else { - (yyval.ereq) = t_field::T_OPTIONAL; - } - } -#line 2484 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 82: -#line 967 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.ereq) = t_field::T_OPT_IN_REQ_OUT; - } -#line 2492 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 83: -#line 973 "thrifty.yy" /* yacc.c:1646 */ - { - if (g_parse_mode == PROGRAM) { - (yyval.tconstv) = (yyvsp[0].tconstv); - } else { - (yyval.tconstv) = NULL; - } - } -#line 2504 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 84: -#line 981 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.tconstv) = NULL; - } -#line 2512 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 85: -#line 987 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("FunctionType -> FieldType"); - (yyval.ttype) = (yyvsp[0].ttype); - } -#line 2521 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 86: -#line 992 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("FunctionType -> tok_void"); - (yyval.ttype) = g_type_void; - } -#line 2530 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 87: -#line 999 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("FieldType -> tok_identifier"); - if (g_parse_mode == INCLUDES) { - // Ignore identifiers in include mode - (yyval.ttype) = NULL; - } else { - // Lookup the identifier in the current scope - (yyval.ttype) = g_scope->get_type((yyvsp[0].id)); - if ((yyval.ttype) == NULL) { - /* - * Either this type isn't yet declared, or it's never - declared. Either way allow it and we'll figure it out - during generation. - */ - (yyval.ttype) = new t_typedef(g_program, (yyvsp[0].id), true); - } - } - } -#line 2553 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 88: -#line 1018 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("FieldType -> BaseType"); - (yyval.ttype) = (yyvsp[0].ttype); - } -#line 2562 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 89: -#line 1023 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("FieldType -> ContainerType"); - (yyval.ttype) = (yyvsp[0].ttype); - } -#line 2571 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 90: -#line 1029 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("BaseType -> SimpleBaseType TypeAnnotations"); - if ((yyvsp[0].ttype) != NULL) { - (yyval.ttype) = new t_base_type(*static_cast<t_base_type*>((yyvsp[-1].ttype))); - (yyval.ttype)->annotations_ = (yyvsp[0].ttype)->annotations_; - delete (yyvsp[0].ttype); - } else { - (yyval.ttype) = (yyvsp[-1].ttype); - } - } -#line 2586 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 91: -#line 1042 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("BaseType -> tok_string"); - (yyval.ttype) = g_type_string; - } -#line 2595 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 92: -#line 1047 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("BaseType -> tok_binary"); - (yyval.ttype) = g_type_binary; - } -#line 2604 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 93: -#line 1052 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("BaseType -> tok_slist"); - (yyval.ttype) = g_type_slist; - } -#line 2613 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 94: -#line 1057 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("BaseType -> tok_bool"); - (yyval.ttype) = g_type_bool; - } -#line 2622 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 95: -#line 1062 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("BaseType -> tok_i8"); - (yyval.ttype) = g_type_i8; - } -#line 2631 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 96: -#line 1067 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("BaseType -> tok_i16"); - (yyval.ttype) = g_type_i16; - } -#line 2640 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 97: -#line 1072 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("BaseType -> tok_i32"); - (yyval.ttype) = g_type_i32; - } -#line 2649 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 98: -#line 1077 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("BaseType -> tok_i64"); - (yyval.ttype) = g_type_i64; - } -#line 2658 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 99: -#line 1082 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("BaseType -> tok_double"); - (yyval.ttype) = g_type_double; - } -#line 2667 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 100: -#line 1088 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ContainerType -> SimpleContainerType TypeAnnotations"); - (yyval.ttype) = (yyvsp[-1].ttype); - if ((yyvsp[0].ttype) != NULL) { - (yyval.ttype)->annotations_ = (yyvsp[0].ttype)->annotations_; - delete (yyvsp[0].ttype); - } - } -#line 2680 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 101: -#line 1099 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("SimpleContainerType -> MapType"); - (yyval.ttype) = (yyvsp[0].ttype); - } -#line 2689 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 102: -#line 1104 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("SimpleContainerType -> SetType"); - (yyval.ttype) = (yyvsp[0].ttype); - } -#line 2698 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 103: -#line 1109 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("SimpleContainerType -> ListType"); - (yyval.ttype) = (yyvsp[0].ttype); - } -#line 2707 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 104: -#line 1116 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("MapType -> tok_map <FieldType, FieldType>"); - (yyval.ttype) = new t_map((yyvsp[-3].ttype), (yyvsp[-1].ttype)); - if ((yyvsp[-5].id) != NULL) { - ((t_container*)(yyval.ttype))->set_cpp_name(std::string((yyvsp[-5].id))); - } - } -#line 2719 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 105: -#line 1126 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("SetType -> tok_set<FieldType>"); - (yyval.ttype) = new t_set((yyvsp[-1].ttype)); - if ((yyvsp[-3].id) != NULL) { - ((t_container*)(yyval.ttype))->set_cpp_name(std::string((yyvsp[-3].id))); - } - } -#line 2731 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 106: -#line 1136 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("ListType -> tok_list<FieldType>"); - check_for_list_of_bytes((yyvsp[-2].ttype)); - (yyval.ttype) = new t_list((yyvsp[-2].ttype)); - if ((yyvsp[0].id) != NULL) { - ((t_container*)(yyval.ttype))->set_cpp_name(std::string((yyvsp[0].id))); - } - } -#line 2744 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 107: -#line 1147 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.id) = (yyvsp[0].id); - } -#line 2752 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 108: -#line 1151 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.id) = NULL; - } -#line 2760 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 109: -#line 1157 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("TypeAnnotations -> ( TypeAnnotationList )"); - (yyval.ttype) = (yyvsp[-1].ttype); - } -#line 2769 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 110: -#line 1162 "thrifty.yy" /* yacc.c:1646 */ - { - (yyval.ttype) = NULL; - } -#line 2777 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 111: -#line 1168 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("TypeAnnotationList -> TypeAnnotationList , TypeAnnotation"); - (yyval.ttype) = (yyvsp[-1].ttype); - (yyval.ttype)->annotations_[(yyvsp[0].tannot)->key] = (yyvsp[0].tannot)->val; - delete (yyvsp[0].tannot); - } -#line 2788 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 112: -#line 1175 "thrifty.yy" /* yacc.c:1646 */ - { - /* Just use a dummy structure to hold the annotations. */ - (yyval.ttype) = new t_struct(g_program); - } -#line 2797 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 113: -#line 1182 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("TypeAnnotation -> TypeAnnotationValue"); - (yyval.tannot) = new t_annotation; - (yyval.tannot)->key = (yyvsp[-2].id); - (yyval.tannot)->val = (yyvsp[-1].id); - } -#line 2808 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 114: -#line 1191 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("TypeAnnotationValue -> = tok_literal"); - (yyval.id) = (yyvsp[0].id); - } -#line 2817 "thrifty.cc" /* yacc.c:1646 */ - break; - - case 115: -#line 1196 "thrifty.yy" /* yacc.c:1646 */ - { - pdebug("TypeAnnotationValue ->"); - (yyval.id) = strdup("1"); - } -#line 2826 "thrifty.cc" /* yacc.c:1646 */ - break; - - -#line 2830 "thrifty.cc" /* yacc.c:1646 */ - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 1201 "thrifty.yy" /* yacc.c:1906 */ - +/* A Bison parser, made by GNU Bison 3.0.4. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "3.0.4" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + + + + +/* Copy the first part of user declarations. */ +#line 4 "thrifty.yy" /* yacc.c:339 */ + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Thrift parser. + * + * This parser is used on a thrift definition file. + * + */ + +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#endif +#include <stdio.h> +#include <string.h> +#ifndef _MSC_VER +#include <inttypes.h> +#else +#include <stdint.h> +#endif +#include <limits.h> +#ifdef _MSC_VER +#include "thrift/windows/config.h" +#endif +#include "thrift/main.h" +#include "thrift/common.h" +#include "thrift/globals.h" +#include "thrift/parse/t_program.h" +#include "thrift/parse/t_scope.h" + +#ifdef _MSC_VER +//warning C4065: switch statement contains 'default' but no 'case' labels +#pragma warning(disable:4065) +#endif + +/** + * This global variable is used for automatic numbering of field indices etc. + * when parsing the members of a struct. Field values are automatically + * assigned starting from -1 and working their way down. + */ +int y_field_val = -1; +/** + * This global variable is used for automatic numbering of enum values. + * y_enum_val is the last value assigned; the next auto-assigned value will be + * y_enum_val+1, and then it continues working upwards. Explicitly specified + * enum values reset y_enum_val to that value. + */ +int32_t y_enum_val = -1; +int g_arglist = 0; +const int struct_is_struct = 0; +const int struct_is_union = 1; + + +#line 140 "thrifty.cc" /* yacc.c:339 */ + +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* In a future release of Bison, this section will be replaced + by #include "thrifty.hh". */ +#ifndef YY_YY_THRIFTY_HH_INCLUDED +# define YY_YY_THRIFTY_HH_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int yydebug; +#endif +/* "%code requires" blocks. */ +#line 1 "thrifty.yy" /* yacc.c:355 */ + +#include "thrift/parse/t_program.h" + +#line 174 "thrifty.cc" /* yacc.c:355 */ + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + tok_identifier = 258, + tok_literal = 259, + tok_doctext = 260, + tok_int_constant = 261, + tok_dub_constant = 262, + tok_include = 263, + tok_namespace = 264, + tok_cpp_include = 265, + tok_cpp_type = 266, + tok_xsd_all = 267, + tok_xsd_optional = 268, + tok_xsd_nillable = 269, + tok_xsd_attrs = 270, + tok_void = 271, + tok_bool = 272, + tok_string = 273, + tok_binary = 274, + tok_slist = 275, + tok_senum = 276, + tok_i8 = 277, + tok_i16 = 278, + tok_i32 = 279, + tok_i64 = 280, + tok_double = 281, + tok_map = 282, + tok_list = 283, + tok_set = 284, + tok_oneway = 285, + tok_typedef = 286, + tok_struct = 287, + tok_xception = 288, + tok_throws = 289, + tok_extends = 290, + tok_service = 291, + tok_enum = 292, + tok_const = 293, + tok_required = 294, + tok_optional = 295, + tok_union = 296, + tok_reference = 297 + }; +#endif +/* Tokens. */ +#define tok_identifier 258 +#define tok_literal 259 +#define tok_doctext 260 +#define tok_int_constant 261 +#define tok_dub_constant 262 +#define tok_include 263 +#define tok_namespace 264 +#define tok_cpp_include 265 +#define tok_cpp_type 266 +#define tok_xsd_all 267 +#define tok_xsd_optional 268 +#define tok_xsd_nillable 269 +#define tok_xsd_attrs 270 +#define tok_void 271 +#define tok_bool 272 +#define tok_string 273 +#define tok_binary 274 +#define tok_slist 275 +#define tok_senum 276 +#define tok_i8 277 +#define tok_i16 278 +#define tok_i32 279 +#define tok_i64 280 +#define tok_double 281 +#define tok_map 282 +#define tok_list 283 +#define tok_set 284 +#define tok_oneway 285 +#define tok_typedef 286 +#define tok_struct 287 +#define tok_xception 288 +#define tok_throws 289 +#define tok_extends 290 +#define tok_service 291 +#define tok_enum 292 +#define tok_const 293 +#define tok_required 294 +#define tok_optional 295 +#define tok_union 296 +#define tok_reference 297 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED + +union YYSTYPE +{ +#line 82 "thrifty.yy" /* yacc.c:355 */ + + char* id; + int64_t iconst; + double dconst; + bool tbool; + t_doc* tdoc; + t_type* ttype; + t_base_type* tbase; + t_typedef* ttypedef; + t_enum* tenum; + t_enum_value* tenumv; + t_const* tconst; + t_const_value* tconstv; + t_struct* tstruct; + t_service* tservice; + t_function* tfunction; + t_field* tfield; + char* dtext; + t_field::e_req ereq; + t_annotation* tannot; + t_field_id tfieldid; + +#line 293 "thrifty.cc" /* yacc.c:355 */ +}; + +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + +extern YYSTYPE yylval; + +int yyparse (void); + +#endif /* !YY_YY_THRIFTY_HH_INCLUDED */ + +/* Copy the second part of user declarations. */ + +#line 310 "thrifty.cc" /* yacc.c:358 */ + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(E) ((void) (E)) +#else +# define YYUSE(E) /* empty */ +#endif + +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 3 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 173 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 56 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 60 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 115 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 200 + +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 297 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 52, 53, 43, 2, 44, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 51, 45, + 54, 48, 55, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 49, 2, 50, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 46, 2, 47, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42 +}; + +#if YYDEBUG + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 250, 250, 262, 273, 282, 287, 292, 296, 308, + 316, 326, 339, 347, 352, 360, 375, 393, 400, 407, + 414, 421, 430, 432, 435, 438, 451, 479, 486, 493, + 507, 522, 534, 546, 553, 560, 567, 586, 595, 601, + 606, 612, 617, 624, 631, 638, 645, 652, 659, 666, + 670, 676, 691, 696, 701, 706, 711, 716, 721, 726, + 731, 745, 759, 764, 769, 782, 787, 794, 800, 815, + 820, 825, 835, 840, 850, 857, 891, 931, 941, 946, + 951, 955, 967, 972, 981, 986, 991, 998, 1017, 1022, + 1028, 1041, 1046, 1051, 1056, 1061, 1066, 1071, 1076, 1081, + 1087, 1098, 1103, 1108, 1115, 1125, 1135, 1146, 1151, 1156, + 1162, 1167, 1175, 1181, 1190, 1196 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || 0 +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "tok_identifier", "tok_literal", + "tok_doctext", "tok_int_constant", "tok_dub_constant", "tok_include", + "tok_namespace", "tok_cpp_include", "tok_cpp_type", "tok_xsd_all", + "tok_xsd_optional", "tok_xsd_nillable", "tok_xsd_attrs", "tok_void", + "tok_bool", "tok_string", "tok_binary", "tok_slist", "tok_senum", + "tok_i8", "tok_i16", "tok_i32", "tok_i64", "tok_double", "tok_map", + "tok_list", "tok_set", "tok_oneway", "tok_typedef", "tok_struct", + "tok_xception", "tok_throws", "tok_extends", "tok_service", "tok_enum", + "tok_const", "tok_required", "tok_optional", "tok_union", + "tok_reference", "'*'", "','", "';'", "'{'", "'}'", "'='", "'['", "']'", + "':'", "'('", "')'", "'<'", "'>'", "$accept", "Program", + "CaptureDocText", "DestroyDocText", "HeaderList", "Header", "Include", + "DefinitionList", "Definition", "TypeDefinition", + "CommaOrSemicolonOptional", "Typedef", "Enum", "EnumDefList", "EnumDef", + "EnumValue", "Senum", "SenumDefList", "SenumDef", "Const", "ConstValue", + "ConstList", "ConstListContents", "ConstMap", "ConstMapContents", + "StructHead", "Struct", "XsdAll", "XsdOptional", "XsdNillable", + "XsdAttributes", "Xception", "Service", "FlagArgs", "UnflagArgs", + "Extends", "FunctionList", "Function", "Oneway", "Throws", "FieldList", + "Field", "FieldIdentifier", "FieldReference", "FieldRequiredness", + "FieldValue", "FunctionType", "FieldType", "BaseType", "SimpleBaseType", + "ContainerType", "SimpleContainerType", "MapType", "SetType", "ListType", + "CppType", "TypeAnnotations", "TypeAnnotationList", "TypeAnnotation", + "TypeAnnotationValue", YY_NULLPTR +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 42, 44, 59, 123, 125, 61, 91, + 93, 58, 40, 41, 60, 62 +}; +# endif + +#define YYPACT_NINF -124 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-124))) + +#define YYTABLE_NINF -64 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = +{ + -124, 15, 9, -124, 26, 33, 35, 13, 36, -124, + -124, 132, -124, 39, 40, -124, 41, 123, -124, 42, + 45, 46, 123, -124, -124, -124, -124, -124, -124, -124, + 61, -124, -124, -124, 16, -124, 19, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, 56, 18, 56, + 70, -124, 16, -124, 16, -124, -124, -124, 29, 43, + 30, 74, 68, -124, -124, -124, 77, 28, 123, 34, + 16, -124, -124, -124, 80, 38, -124, 44, -124, 48, + 7, 3, -124, 123, 32, 123, -23, 49, -124, -124, + 50, 25, -124, 47, -124, -124, -23, 16, -124, 55, + 56, 65, -124, -124, -124, 16, 84, -124, -124, 16, + 98, -124, -124, -124, -124, -124, -124, -124, -23, -124, + -124, 75, 117, -23, -124, -124, 123, -124, -124, -124, + 51, -2, 76, -124, 79, 16, 5, 20, -124, 16, + -124, -124, 78, -124, -124, -124, 123, 95, 82, -124, + 124, -23, -124, 81, -124, -23, -124, -124, 89, -124, + 90, 16, -124, -124, 25, -124, -124, 131, -124, 133, + -124, -124, -23, 87, 92, -124, 25, 141, -124, -124, + -124, 142, 102, -124, 143, 125, 111, 16, 108, 16, + -124, -23, -124, -23, 114, -124, 109, -124, -124, -124 +}; + + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 6, 0, 13, 1, 0, 3, 0, 0, 0, 5, + 7, 0, 11, 0, 0, 10, 0, 0, 49, 0, + 0, 0, 0, 50, 12, 15, 17, 18, 19, 14, + 0, 20, 21, 16, 110, 9, 0, 87, 94, 91, + 92, 93, 95, 96, 97, 98, 99, 108, 0, 108, + 0, 88, 110, 89, 110, 101, 102, 103, 0, 65, + 0, 0, 53, 112, 8, 34, 0, 0, 0, 0, + 110, 90, 100, 74, 0, 0, 28, 0, 52, 0, + 0, 0, 107, 0, 0, 0, 24, 3, 64, 62, + 3, 0, 74, 115, 109, 111, 24, 110, 33, 0, + 108, 0, 22, 23, 25, 110, 77, 73, 67, 110, + 0, 27, 40, 39, 37, 38, 48, 45, 24, 41, + 42, 3, 0, 24, 35, 32, 0, 106, 105, 60, + 0, 82, 3, 26, 31, 110, 0, 0, 36, 110, + 114, 113, 0, 76, 80, 81, 0, 70, 0, 66, + 0, 24, 46, 0, 43, 24, 51, 104, 79, 69, + 0, 110, 30, 29, 0, 44, 78, 0, 86, 0, + 85, 61, 24, 84, 0, 47, 0, 55, 74, 83, + 54, 57, 3, 56, 59, 72, 0, 110, 0, 110, + 74, 24, 74, 24, 3, 75, 3, 68, 58, 71 +}; + + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = +{ + -124, -124, -4, -124, -124, -124, -124, -124, -124, -124, + -93, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -123, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -87, -124, -124, -124, -124, -124, -124, -22, -124, -124, + -124, -124, -124, -124, -124, -43, -50, -124, -124, -124 +}; + + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 1, 106, 4, 2, 9, 10, 5, 24, 25, + 104, 26, 27, 90, 111, 135, 28, 81, 98, 29, + 118, 119, 137, 120, 136, 30, 31, 79, 181, 184, + 187, 32, 33, 108, 148, 75, 132, 149, 160, 189, + 87, 107, 131, 167, 146, 177, 169, 50, 51, 52, + 53, 54, 55, 56, 57, 67, 64, 80, 95, 123 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int16 yytable[] = +{ + 61, 11, 71, 124, 72, 121, 69, 96, 112, 113, + 93, 114, 115, 153, 155, 3, 13, -4, -4, -4, + 86, 102, 103, 112, 113, 138, 114, 115, 112, 113, + 141, 114, 115, -2, 6, 7, 8, 144, 145, 12, + 15, 172, 34, 35, 36, 58, 84, 125, 59, 60, + 97, 116, 152, 179, 117, 129, 14, 127, 163, 133, + 94, 99, 165, 101, 62, 65, 116, 66, 63, 117, + 154, 116, 68, 70, 117, 73, 76, 77, 74, 175, + 78, 82, 83, 88, 89, 151, 110, 100, 85, 156, + 130, 182, 91, 37, 92, 122, 105, 109, 195, 126, + 197, 134, 143, 194, 142, 196, 168, 38, 39, 40, + 41, 171, 42, 43, 44, 45, 46, 47, 48, 49, + 128, 140, 139, -63, 158, 159, 37, 150, 147, 161, + 162, 166, 164, 157, 173, 176, 174, 191, 170, 193, + 38, 39, 40, 41, 178, 42, 43, 44, 45, 46, + 47, 48, 49, 16, 180, 185, 183, 190, 186, 188, + 192, 198, 199, 17, 18, 19, 0, 0, 20, 21, + 22, 0, 0, 23 +}; + +static const yytype_int16 yycheck[] = +{ + 22, 5, 52, 96, 54, 92, 49, 4, 3, 4, + 3, 6, 7, 136, 137, 0, 3, 8, 9, 10, + 70, 44, 45, 3, 4, 118, 6, 7, 3, 4, + 123, 6, 7, 0, 8, 9, 10, 39, 40, 4, + 4, 164, 3, 3, 3, 3, 68, 97, 3, 3, + 47, 46, 47, 176, 49, 105, 43, 100, 151, 109, + 53, 83, 155, 85, 3, 46, 46, 11, 52, 49, + 50, 46, 54, 3, 49, 46, 46, 3, 35, 172, + 12, 4, 54, 3, 46, 135, 90, 55, 54, 139, + 6, 178, 48, 3, 46, 48, 47, 47, 191, 44, + 193, 3, 51, 190, 126, 192, 16, 17, 18, 19, + 20, 161, 22, 23, 24, 25, 26, 27, 28, 29, + 55, 4, 47, 47, 146, 30, 3, 48, 132, 47, + 6, 42, 51, 55, 3, 48, 3, 187, 160, 189, + 17, 18, 19, 20, 52, 22, 23, 24, 25, 26, + 27, 28, 29, 21, 13, 53, 14, 46, 15, 34, + 52, 47, 53, 31, 32, 33, -1, -1, 36, 37, + 38, -1, -1, 41 +}; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 57, 60, 0, 59, 63, 8, 9, 10, 61, + 62, 58, 4, 3, 43, 4, 21, 31, 32, 33, + 36, 37, 38, 41, 64, 65, 67, 68, 72, 75, + 81, 82, 87, 88, 3, 3, 3, 3, 17, 18, + 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, + 103, 104, 105, 106, 107, 108, 109, 110, 3, 3, + 3, 103, 3, 52, 112, 46, 11, 111, 54, 111, + 3, 112, 112, 46, 35, 91, 46, 3, 12, 83, + 113, 73, 4, 54, 103, 54, 112, 96, 3, 46, + 69, 48, 46, 3, 53, 114, 4, 47, 74, 103, + 55, 103, 44, 45, 66, 47, 58, 97, 89, 47, + 58, 70, 3, 4, 6, 7, 46, 49, 76, 77, + 79, 96, 48, 115, 66, 112, 44, 111, 55, 112, + 6, 98, 92, 112, 3, 71, 80, 78, 66, 47, + 4, 66, 103, 51, 39, 40, 100, 58, 90, 93, + 48, 112, 47, 76, 50, 76, 112, 55, 103, 30, + 94, 47, 6, 66, 51, 66, 42, 99, 16, 102, + 103, 112, 76, 3, 3, 66, 48, 101, 52, 76, + 13, 84, 96, 14, 85, 53, 15, 86, 34, 95, + 46, 112, 52, 112, 96, 66, 96, 66, 47, 53 +}; + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 56, 57, 58, 59, 60, 60, 61, 61, 61, + 61, 62, 63, 63, 64, 64, 64, 65, 65, 65, + 65, 65, 66, 66, 66, 67, 68, 69, 69, 70, + 71, 71, 72, 73, 73, 74, 75, 76, 76, 76, + 76, 76, 76, 77, 78, 78, 79, 80, 80, 81, + 81, 82, 83, 83, 84, 84, 85, 85, 86, 86, + 87, 88, 89, 90, 91, 91, 92, 92, 93, 94, + 94, 95, 95, 96, 96, 97, 98, 98, 99, 99, + 100, 100, 100, 101, 101, 102, 102, 103, 103, 103, + 104, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 106, 107, 107, 107, 108, 109, 110, 111, 111, 112, + 112, 113, 113, 114, 115, 115 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 2, 0, 0, 3, 0, 1, 4, 3, + 2, 2, 3, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 5, 6, 2, 0, 4, + 3, 1, 6, 2, 0, 2, 6, 1, 1, 1, + 1, 1, 1, 3, 3, 0, 3, 5, 0, 1, + 1, 7, 1, 0, 1, 0, 1, 0, 4, 0, + 6, 9, 0, 0, 2, 0, 2, 0, 10, 1, + 0, 4, 0, 2, 0, 12, 2, 0, 1, 0, + 1, 1, 0, 2, 0, 1, 1, 1, 1, 1, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 1, 1, 1, 7, 5, 5, 2, 0, 3, + 0, 2, 0, 3, 2, 0 +}; + + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 + + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif + + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +{ + FILE *yyo = yyoutput; + YYUSE (yyo); + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + YYUSE (yytype); +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +{ + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) +{ + unsigned long int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +yystrlen (const char *yystr) +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; +} +#endif /* YYERROR_VERBOSE */ + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +{ + YYUSE (yyvaluep); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + + + +/* The lookahead symbol. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; +/* Number of syntax errors so far. */ +int yynerrs; + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (void) +{ + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + 'yyss': related to states. + 'yyvs': related to semantic values. + + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = yylex (); + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +#line 251 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Program -> Headers DefinitionList"); + if((g_program_doctext_candidate != NULL) && (g_program_doctext_status != ALREADY_PROCESSED)) + { + g_program->set_doc(g_program_doctext_candidate); + g_program_doctext_status = ALREADY_PROCESSED; + } + clear_doctext(); + } +#line 1548 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 3: +#line 262 "thrifty.yy" /* yacc.c:1646 */ + { + if (g_parse_mode == PROGRAM) { + (yyval.dtext) = g_doctext; + g_doctext = NULL; + } else { + (yyval.dtext) = NULL; + } + } +#line 1561 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 4: +#line 273 "thrifty.yy" /* yacc.c:1646 */ + { + if (g_parse_mode == PROGRAM) { + clear_doctext(); + } + } +#line 1571 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 5: +#line 283 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("HeaderList -> HeaderList Header"); + } +#line 1579 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 6: +#line 287 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("HeaderList -> "); + } +#line 1587 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 7: +#line 293 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Header -> Include"); + } +#line 1595 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 8: +#line 297 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Header -> tok_namespace tok_identifier tok_identifier"); + declare_valid_program_doctext(); + if (g_parse_mode == PROGRAM) { + g_program->set_namespace((yyvsp[-2].id), (yyvsp[-1].id)); + } + if ((yyvsp[0].ttype) != NULL) { + g_program->set_namespace_annotations((yyvsp[-2].id), (yyvsp[0].ttype)->annotations_); + delete (yyvsp[0].ttype); + } + } +#line 1611 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 9: +#line 309 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Header -> tok_namespace * tok_identifier"); + declare_valid_program_doctext(); + if (g_parse_mode == PROGRAM) { + g_program->set_namespace("*", (yyvsp[0].id)); + } + } +#line 1623 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 10: +#line 317 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Header -> tok_cpp_include tok_literal"); + declare_valid_program_doctext(); + if (g_parse_mode == PROGRAM) { + g_program->add_cpp_include((yyvsp[0].id)); + } + } +#line 1635 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 11: +#line 327 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Include -> tok_include tok_literal"); + declare_valid_program_doctext(); + if (g_parse_mode == INCLUDES) { + std::string path = include_file(std::string((yyvsp[0].id))); + if (!path.empty()) { + g_program->add_include(path, std::string((yyvsp[0].id))); + } + } + } +#line 1650 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 12: +#line 340 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("DefinitionList -> DefinitionList Definition"); + if ((yyvsp[-1].dtext) != NULL && (yyvsp[0].tdoc) != NULL) { + (yyvsp[0].tdoc)->set_doc((yyvsp[-1].dtext)); + } + } +#line 1661 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 13: +#line 347 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("DefinitionList -> "); + } +#line 1669 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 14: +#line 353 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Definition -> Const"); + if (g_parse_mode == PROGRAM) { + g_program->add_const((yyvsp[0].tconst)); + } + (yyval.tdoc) = (yyvsp[0].tconst); + } +#line 1681 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 15: +#line 361 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Definition -> TypeDefinition"); + if (g_parse_mode == PROGRAM) { + g_scope->add_type((yyvsp[0].ttype)->get_name(), (yyvsp[0].ttype)); + if (g_parent_scope != NULL) { + g_parent_scope->add_type(g_parent_prefix + (yyvsp[0].ttype)->get_name(), (yyvsp[0].ttype)); + } + if (! g_program->is_unique_typename((yyvsp[0].ttype))) { + yyerror("Type \"%s\" is already defined.", (yyvsp[0].ttype)->get_name().c_str()); + exit(1); + } + } + (yyval.tdoc) = (yyvsp[0].ttype); + } +#line 1700 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 16: +#line 376 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Definition -> Service"); + if (g_parse_mode == PROGRAM) { + g_scope->add_service((yyvsp[0].tservice)->get_name(), (yyvsp[0].tservice)); + if (g_parent_scope != NULL) { + g_parent_scope->add_service(g_parent_prefix + (yyvsp[0].tservice)->get_name(), (yyvsp[0].tservice)); + } + g_program->add_service((yyvsp[0].tservice)); + if (! g_program->is_unique_typename((yyvsp[0].tservice))) { + yyerror("Type \"%s\" is already defined.", (yyvsp[0].tservice)->get_name().c_str()); + exit(1); + } + } + (yyval.tdoc) = (yyvsp[0].tservice); + } +#line 1720 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 17: +#line 394 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("TypeDefinition -> Typedef"); + if (g_parse_mode == PROGRAM) { + g_program->add_typedef((yyvsp[0].ttypedef)); + } + } +#line 1731 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 18: +#line 401 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("TypeDefinition -> Enum"); + if (g_parse_mode == PROGRAM) { + g_program->add_enum((yyvsp[0].tenum)); + } + } +#line 1742 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 19: +#line 408 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("TypeDefinition -> Senum"); + if (g_parse_mode == PROGRAM) { + g_program->add_typedef((yyvsp[0].ttypedef)); + } + } +#line 1753 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 20: +#line 415 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("TypeDefinition -> Struct"); + if (g_parse_mode == PROGRAM) { + g_program->add_struct((yyvsp[0].tstruct)); + } + } +#line 1764 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 21: +#line 422 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("TypeDefinition -> Xception"); + if (g_parse_mode == PROGRAM) { + g_program->add_xception((yyvsp[0].tstruct)); + } + } +#line 1775 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 22: +#line 431 "thrifty.yy" /* yacc.c:1646 */ + {} +#line 1781 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 23: +#line 433 "thrifty.yy" /* yacc.c:1646 */ + {} +#line 1787 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 24: +#line 435 "thrifty.yy" /* yacc.c:1646 */ + {} +#line 1793 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 25: +#line 439 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("TypeDef -> tok_typedef FieldType tok_identifier"); + validate_simple_identifier( (yyvsp[-2].id)); + t_typedef *td = new t_typedef(g_program, (yyvsp[-3].ttype), (yyvsp[-2].id)); + (yyval.ttypedef) = td; + if ((yyvsp[-1].ttype) != NULL) { + (yyval.ttypedef)->annotations_ = (yyvsp[-1].ttype)->annotations_; + delete (yyvsp[-1].ttype); + } + } +#line 1808 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 26: +#line 452 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Enum -> tok_enum tok_identifier { EnumDefList }"); + (yyval.tenum) = (yyvsp[-2].tenum); + validate_simple_identifier( (yyvsp[-4].id)); + (yyval.tenum)->set_name((yyvsp[-4].id)); + if ((yyvsp[0].ttype) != NULL) { + (yyval.tenum)->annotations_ = (yyvsp[0].ttype)->annotations_; + delete (yyvsp[0].ttype); + } + + // make constants for all the enum values + if (g_parse_mode == PROGRAM) { + const std::vector<t_enum_value*>& enum_values = (yyval.tenum)->get_constants(); + std::vector<t_enum_value*>::const_iterator c_iter; + for (c_iter = enum_values.begin(); c_iter != enum_values.end(); ++c_iter) { + std::string const_name = (yyval.tenum)->get_name() + "." + (*c_iter)->get_name(); + t_const_value* const_val = new t_const_value((*c_iter)->get_value()); + const_val->set_enum((yyval.tenum)); + g_scope->add_constant(const_name, new t_const(g_type_i32, (*c_iter)->get_name(), const_val)); + if (g_parent_scope != NULL) { + g_parent_scope->add_constant(g_parent_prefix + const_name, new t_const(g_type_i32, (*c_iter)->get_name(), const_val)); + } + } + } + } +#line 1838 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 27: +#line 480 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("EnumDefList -> EnumDefList EnumDef"); + (yyval.tenum) = (yyvsp[-1].tenum); + (yyval.tenum)->append((yyvsp[0].tenumv)); + } +#line 1848 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 28: +#line 486 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("EnumDefList -> "); + (yyval.tenum) = new t_enum(g_program); + y_enum_val = -1; + } +#line 1858 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 29: +#line 494 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("EnumDef -> EnumValue"); + (yyval.tenumv) = (yyvsp[-2].tenumv); + if ((yyvsp[-3].dtext) != NULL) { + (yyval.tenumv)->set_doc((yyvsp[-3].dtext)); + } + if ((yyvsp[-1].ttype) != NULL) { + (yyval.tenumv)->annotations_ = (yyvsp[-1].ttype)->annotations_; + delete (yyvsp[-1].ttype); + } + } +#line 1874 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 30: +#line 508 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("EnumValue -> tok_identifier = tok_int_constant"); + if ((yyvsp[0].iconst) < INT32_MIN || (yyvsp[0].iconst) > INT32_MAX) { + // Note: this used to be just a warning. However, since thrift always + // treats enums as i32 values, I'm changing it to a fatal error. + // I doubt this will affect many people, but users who run into this + // will have to update their thrift files to manually specify the + // truncated i32 value that thrift has always been using anyway. + failure("64-bit value supplied for enum %s will be truncated.", (yyvsp[-2].id)); + } + y_enum_val = static_cast<int32_t>((yyvsp[0].iconst)); + (yyval.tenumv) = new t_enum_value((yyvsp[-2].id), y_enum_val); + } +#line 1892 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 31: +#line 523 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("EnumValue -> tok_identifier"); + validate_simple_identifier( (yyvsp[0].id)); + if (y_enum_val == INT32_MAX) { + failure("enum value overflow at enum %s", (yyvsp[0].id)); + } + ++y_enum_val; + (yyval.tenumv) = new t_enum_value((yyvsp[0].id), y_enum_val); + } +#line 1906 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 32: +#line 535 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Senum -> tok_senum tok_identifier { SenumDefList }"); + validate_simple_identifier( (yyvsp[-4].id)); + (yyval.ttypedef) = new t_typedef(g_program, (yyvsp[-2].tbase), (yyvsp[-4].id)); + if ((yyvsp[0].ttype) != NULL) { + (yyval.ttypedef)->annotations_ = (yyvsp[0].ttype)->annotations_; + delete (yyvsp[0].ttype); + } + } +#line 1920 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 33: +#line 547 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("SenumDefList -> SenumDefList SenumDef"); + (yyval.tbase) = (yyvsp[-1].tbase); + (yyval.tbase)->add_string_enum_val((yyvsp[0].id)); + } +#line 1930 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 34: +#line 553 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("SenumDefList -> "); + (yyval.tbase) = new t_base_type("string", t_base_type::TYPE_STRING); + (yyval.tbase)->set_string_enum(true); + } +#line 1940 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 35: +#line 561 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("SenumDef -> tok_literal"); + (yyval.id) = (yyvsp[-1].id); + } +#line 1949 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 36: +#line 568 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Const -> tok_const FieldType tok_identifier = ConstValue"); + if (g_parse_mode == PROGRAM) { + validate_simple_identifier( (yyvsp[-3].id)); + g_scope->resolve_const_value((yyvsp[-1].tconstv), (yyvsp[-4].ttype)); + (yyval.tconst) = new t_const((yyvsp[-4].ttype), (yyvsp[-3].id), (yyvsp[-1].tconstv)); + validate_const_type((yyval.tconst)); + + g_scope->add_constant((yyvsp[-3].id), (yyval.tconst)); + if (g_parent_scope != NULL) { + g_parent_scope->add_constant(g_parent_prefix + (yyvsp[-3].id), (yyval.tconst)); + } + } else { + (yyval.tconst) = NULL; + } + } +#line 1970 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 37: +#line 587 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ConstValue => tok_int_constant"); + (yyval.tconstv) = new t_const_value(); + (yyval.tconstv)->set_integer((yyvsp[0].iconst)); + if (!g_allow_64bit_consts && ((yyvsp[0].iconst) < INT32_MIN || (yyvsp[0].iconst) > INT32_MAX)) { + pwarning(1, "64-bit constant \"%" PRIi64"\" may not work in all languages.\n", (yyvsp[0].iconst)); + } + } +#line 1983 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 38: +#line 596 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ConstValue => tok_dub_constant"); + (yyval.tconstv) = new t_const_value(); + (yyval.tconstv)->set_double((yyvsp[0].dconst)); + } +#line 1993 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 39: +#line 602 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ConstValue => tok_literal"); + (yyval.tconstv) = new t_const_value((yyvsp[0].id)); + } +#line 2002 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 40: +#line 607 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ConstValue => tok_identifier"); + (yyval.tconstv) = new t_const_value(); + (yyval.tconstv)->set_identifier((yyvsp[0].id)); + } +#line 2012 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 41: +#line 613 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ConstValue => ConstList"); + (yyval.tconstv) = (yyvsp[0].tconstv); + } +#line 2021 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 42: +#line 618 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ConstValue => ConstMap"); + (yyval.tconstv) = (yyvsp[0].tconstv); + } +#line 2030 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 43: +#line 625 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ConstList => [ ConstListContents ]"); + (yyval.tconstv) = (yyvsp[-1].tconstv); + } +#line 2039 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 44: +#line 632 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ConstListContents => ConstListContents ConstValue CommaOrSemicolonOptional"); + (yyval.tconstv) = (yyvsp[-2].tconstv); + (yyval.tconstv)->add_list((yyvsp[-1].tconstv)); + } +#line 2049 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 45: +#line 638 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ConstListContents =>"); + (yyval.tconstv) = new t_const_value(); + (yyval.tconstv)->set_list(); + } +#line 2059 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 46: +#line 646 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ConstMap => { ConstMapContents }"); + (yyval.tconstv) = (yyvsp[-1].tconstv); + } +#line 2068 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 47: +#line 653 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ConstMapContents => ConstMapContents ConstValue CommaOrSemicolonOptional"); + (yyval.tconstv) = (yyvsp[-4].tconstv); + (yyval.tconstv)->add_map((yyvsp[-3].tconstv), (yyvsp[-1].tconstv)); + } +#line 2078 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 48: +#line 659 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ConstMapContents =>"); + (yyval.tconstv) = new t_const_value(); + (yyval.tconstv)->set_map(); + } +#line 2088 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 49: +#line 667 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.iconst) = struct_is_struct; + } +#line 2096 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 50: +#line 671 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.iconst) = struct_is_union; + } +#line 2104 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 51: +#line 677 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Struct -> tok_struct tok_identifier { FieldList }"); + validate_simple_identifier( (yyvsp[-5].id)); + (yyvsp[-2].tstruct)->set_xsd_all((yyvsp[-4].tbool)); + (yyvsp[-2].tstruct)->set_union((yyvsp[-6].iconst) == struct_is_union); + (yyval.tstruct) = (yyvsp[-2].tstruct); + (yyval.tstruct)->set_name((yyvsp[-5].id)); + if ((yyvsp[0].ttype) != NULL) { + (yyval.tstruct)->annotations_ = (yyvsp[0].ttype)->annotations_; + delete (yyvsp[0].ttype); + } + } +#line 2121 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 52: +#line 692 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tbool) = true; + } +#line 2129 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 53: +#line 696 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tbool) = false; + } +#line 2137 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 54: +#line 702 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tbool) = true; + } +#line 2145 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 55: +#line 706 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tbool) = false; + } +#line 2153 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 56: +#line 712 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tbool) = true; + } +#line 2161 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 57: +#line 716 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tbool) = false; + } +#line 2169 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 58: +#line 722 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tstruct) = (yyvsp[-1].tstruct); + } +#line 2177 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 59: +#line 726 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tstruct) = NULL; + } +#line 2185 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 60: +#line 732 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Xception -> tok_xception tok_identifier { FieldList }"); + validate_simple_identifier( (yyvsp[-4].id)); + (yyvsp[-2].tstruct)->set_name((yyvsp[-4].id)); + (yyvsp[-2].tstruct)->set_xception(true); + (yyval.tstruct) = (yyvsp[-2].tstruct); + if ((yyvsp[0].ttype) != NULL) { + (yyval.tstruct)->annotations_ = (yyvsp[0].ttype)->annotations_; + delete (yyvsp[0].ttype); + } + } +#line 2201 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 61: +#line 746 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Service -> tok_service tok_identifier { FunctionList }"); + validate_simple_identifier( (yyvsp[-7].id)); + (yyval.tservice) = (yyvsp[-3].tservice); + (yyval.tservice)->set_name((yyvsp[-7].id)); + (yyval.tservice)->set_extends((yyvsp[-6].tservice)); + if ((yyvsp[0].ttype) != NULL) { + (yyval.tservice)->annotations_ = (yyvsp[0].ttype)->annotations_; + delete (yyvsp[0].ttype); + } + } +#line 2217 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 62: +#line 759 "thrifty.yy" /* yacc.c:1646 */ + { + g_arglist = 1; + } +#line 2225 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 63: +#line 764 "thrifty.yy" /* yacc.c:1646 */ + { + g_arglist = 0; + } +#line 2233 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 64: +#line 770 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Extends -> tok_extends tok_identifier"); + (yyval.tservice) = NULL; + if (g_parse_mode == PROGRAM) { + (yyval.tservice) = g_scope->get_service((yyvsp[0].id)); + if ((yyval.tservice) == NULL) { + yyerror("Service \"%s\" has not been defined.", (yyvsp[0].id)); + exit(1); + } + } + } +#line 2249 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 65: +#line 782 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tservice) = NULL; + } +#line 2257 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 66: +#line 788 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("FunctionList -> FunctionList Function"); + (yyval.tservice) = (yyvsp[-1].tservice); + (yyvsp[-1].tservice)->add_function((yyvsp[0].tfunction)); + } +#line 2267 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 67: +#line 794 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("FunctionList -> "); + (yyval.tservice) = new t_service(g_program); + } +#line 2276 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 68: +#line 801 "thrifty.yy" /* yacc.c:1646 */ + { + validate_simple_identifier( (yyvsp[-6].id)); + (yyvsp[-4].tstruct)->set_name(std::string((yyvsp[-6].id)) + "_args"); + (yyval.tfunction) = new t_function((yyvsp[-7].ttype), (yyvsp[-6].id), (yyvsp[-4].tstruct), (yyvsp[-2].tstruct), (yyvsp[-8].tbool)); + if ((yyvsp[-9].dtext) != NULL) { + (yyval.tfunction)->set_doc((yyvsp[-9].dtext)); + } + if ((yyvsp[-1].ttype) != NULL) { + (yyval.tfunction)->annotations_ = (yyvsp[-1].ttype)->annotations_; + delete (yyvsp[-1].ttype); + } + } +#line 2293 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 69: +#line 816 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tbool) = true; + } +#line 2301 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 70: +#line 820 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tbool) = false; + } +#line 2309 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 71: +#line 826 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("Throws -> tok_throws ( FieldList )"); + (yyval.tstruct) = (yyvsp[-1].tstruct); + if (g_parse_mode == PROGRAM && !validate_throws((yyval.tstruct))) { + yyerror("Throws clause may not contain non-exception types"); + exit(1); + } + } +#line 2322 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 72: +#line 835 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tstruct) = new t_struct(g_program); + } +#line 2330 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 73: +#line 841 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("FieldList -> FieldList , Field"); + (yyval.tstruct) = (yyvsp[-1].tstruct); + if (!((yyval.tstruct)->append((yyvsp[0].tfield)))) { + yyerror("\"%d: %s\" - field identifier/name has already been used", (yyvsp[0].tfield)->get_key(), (yyvsp[0].tfield)->get_name().c_str()); + exit(1); + } + } +#line 2343 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 74: +#line 850 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("FieldList -> "); + y_field_val = -1; + (yyval.tstruct) = new t_struct(g_program); + } +#line 2353 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 75: +#line 858 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("tok_int_constant : Field -> FieldType tok_identifier"); + if ((yyvsp[-10].tfieldid).auto_assigned) { + pwarning(1, "No field key specified for %s, resulting protocol may have conflicts or not be backwards compatible!\n", (yyvsp[-6].id)); + if (g_strict >= 192) { + yyerror("Implicit field keys are deprecated and not allowed with -strict"); + exit(1); + } + } + validate_simple_identifier((yyvsp[-6].id)); + (yyval.tfield) = new t_field((yyvsp[-8].ttype), (yyvsp[-6].id), (yyvsp[-10].tfieldid).value); + (yyval.tfield)->set_reference((yyvsp[-7].tbool)); + (yyval.tfield)->set_req((yyvsp[-9].ereq)); + if ((yyvsp[-5].tconstv) != NULL) { + g_scope->resolve_const_value((yyvsp[-5].tconstv), (yyvsp[-8].ttype)); + validate_field_value((yyval.tfield), (yyvsp[-5].tconstv)); + (yyval.tfield)->set_value((yyvsp[-5].tconstv)); + } + (yyval.tfield)->set_xsd_optional((yyvsp[-4].tbool)); + (yyval.tfield)->set_xsd_nillable((yyvsp[-3].tbool)); + if ((yyvsp[-11].dtext) != NULL) { + (yyval.tfield)->set_doc((yyvsp[-11].dtext)); + } + if ((yyvsp[-2].tstruct) != NULL) { + (yyval.tfield)->set_xsd_attrs((yyvsp[-2].tstruct)); + } + if ((yyvsp[-1].ttype) != NULL) { + (yyval.tfield)->annotations_ = (yyvsp[-1].ttype)->annotations_; + delete (yyvsp[-1].ttype); + } + } +#line 2389 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 76: +#line 892 "thrifty.yy" /* yacc.c:1646 */ + { + if ((yyvsp[-1].iconst) <= 0) { + if (g_allow_neg_field_keys) { + /* + * g_allow_neg_field_keys exists to allow users to add explicitly + * specified key values to old .thrift files without breaking + * protocol compatibility. + */ + if ((yyvsp[-1].iconst) != y_field_val) { + /* + * warn if the user-specified negative value isn't what + * thrift would have auto-assigned. + */ + pwarning(1, "Nonpositive field key (%" PRIi64") differs from what would be " + "auto-assigned by thrift (%d).\n", (yyvsp[-1].iconst), y_field_val); + } + /* + * Leave $1 as-is, and update y_field_val to be one less than $1. + * The FieldList parsing will catch any duplicate key values. + */ + y_field_val = static_cast<int32_t>((yyvsp[-1].iconst) - 1); + (yyval.tfieldid).value = static_cast<int32_t>((yyvsp[-1].iconst)); + (yyval.tfieldid).auto_assigned = false; + } else { + pwarning(1, "Nonpositive value (%d) not allowed as a field key.\n", + (yyvsp[-1].iconst)); + (yyval.tfieldid).value = y_field_val--; + (yyval.tfieldid).auto_assigned = true; + } + } else { + (yyval.tfieldid).value = static_cast<int32_t>((yyvsp[-1].iconst)); + (yyval.tfieldid).auto_assigned = false; + } + if( (SHRT_MIN > (yyval.tfieldid).value) || ((yyval.tfieldid).value > SHRT_MAX)) { + pwarning(1, "Field key (%d) exceeds allowed range (%d..%d).\n", + (yyval.tfieldid).value, SHRT_MIN, SHRT_MAX); + } + } +#line 2432 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 77: +#line 931 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tfieldid).value = y_field_val--; + (yyval.tfieldid).auto_assigned = true; + if( (SHRT_MIN > (yyval.tfieldid).value) || ((yyval.tfieldid).value > SHRT_MAX)) { + pwarning(1, "Field key (%d) exceeds allowed range (%d..%d).\n", + (yyval.tfieldid).value, SHRT_MIN, SHRT_MAX); + } + } +#line 2445 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 78: +#line 942 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tbool) = true; + } +#line 2453 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 79: +#line 946 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tbool) = false; + } +#line 2461 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 80: +#line 952 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.ereq) = t_field::T_REQUIRED; + } +#line 2469 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 81: +#line 956 "thrifty.yy" /* yacc.c:1646 */ + { + if (g_arglist) { + if (g_parse_mode == PROGRAM) { + pwarning(1, "optional keyword is ignored in argument lists.\n"); + } + (yyval.ereq) = t_field::T_OPT_IN_REQ_OUT; + } else { + (yyval.ereq) = t_field::T_OPTIONAL; + } + } +#line 2484 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 82: +#line 967 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.ereq) = t_field::T_OPT_IN_REQ_OUT; + } +#line 2492 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 83: +#line 973 "thrifty.yy" /* yacc.c:1646 */ + { + if (g_parse_mode == PROGRAM) { + (yyval.tconstv) = (yyvsp[0].tconstv); + } else { + (yyval.tconstv) = NULL; + } + } +#line 2504 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 84: +#line 981 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.tconstv) = NULL; + } +#line 2512 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 85: +#line 987 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("FunctionType -> FieldType"); + (yyval.ttype) = (yyvsp[0].ttype); + } +#line 2521 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 86: +#line 992 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("FunctionType -> tok_void"); + (yyval.ttype) = g_type_void; + } +#line 2530 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 87: +#line 999 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("FieldType -> tok_identifier"); + if (g_parse_mode == INCLUDES) { + // Ignore identifiers in include mode + (yyval.ttype) = NULL; + } else { + // Lookup the identifier in the current scope + (yyval.ttype) = g_scope->get_type((yyvsp[0].id)); + if ((yyval.ttype) == NULL) { + /* + * Either this type isn't yet declared, or it's never + declared. Either way allow it and we'll figure it out + during generation. + */ + (yyval.ttype) = new t_typedef(g_program, (yyvsp[0].id), true); + } + } + } +#line 2553 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 88: +#line 1018 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("FieldType -> BaseType"); + (yyval.ttype) = (yyvsp[0].ttype); + } +#line 2562 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 89: +#line 1023 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("FieldType -> ContainerType"); + (yyval.ttype) = (yyvsp[0].ttype); + } +#line 2571 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 90: +#line 1029 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("BaseType -> SimpleBaseType TypeAnnotations"); + if ((yyvsp[0].ttype) != NULL) { + (yyval.ttype) = new t_base_type(*static_cast<t_base_type*>((yyvsp[-1].ttype))); + (yyval.ttype)->annotations_ = (yyvsp[0].ttype)->annotations_; + delete (yyvsp[0].ttype); + } else { + (yyval.ttype) = (yyvsp[-1].ttype); + } + } +#line 2586 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 91: +#line 1042 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("BaseType -> tok_string"); + (yyval.ttype) = g_type_string; + } +#line 2595 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 92: +#line 1047 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("BaseType -> tok_binary"); + (yyval.ttype) = g_type_binary; + } +#line 2604 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 93: +#line 1052 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("BaseType -> tok_slist"); + (yyval.ttype) = g_type_slist; + } +#line 2613 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 94: +#line 1057 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("BaseType -> tok_bool"); + (yyval.ttype) = g_type_bool; + } +#line 2622 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 95: +#line 1062 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("BaseType -> tok_i8"); + (yyval.ttype) = g_type_i8; + } +#line 2631 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 96: +#line 1067 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("BaseType -> tok_i16"); + (yyval.ttype) = g_type_i16; + } +#line 2640 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 97: +#line 1072 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("BaseType -> tok_i32"); + (yyval.ttype) = g_type_i32; + } +#line 2649 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 98: +#line 1077 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("BaseType -> tok_i64"); + (yyval.ttype) = g_type_i64; + } +#line 2658 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 99: +#line 1082 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("BaseType -> tok_double"); + (yyval.ttype) = g_type_double; + } +#line 2667 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 100: +#line 1088 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ContainerType -> SimpleContainerType TypeAnnotations"); + (yyval.ttype) = (yyvsp[-1].ttype); + if ((yyvsp[0].ttype) != NULL) { + (yyval.ttype)->annotations_ = (yyvsp[0].ttype)->annotations_; + delete (yyvsp[0].ttype); + } + } +#line 2680 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 101: +#line 1099 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("SimpleContainerType -> MapType"); + (yyval.ttype) = (yyvsp[0].ttype); + } +#line 2689 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 102: +#line 1104 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("SimpleContainerType -> SetType"); + (yyval.ttype) = (yyvsp[0].ttype); + } +#line 2698 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 103: +#line 1109 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("SimpleContainerType -> ListType"); + (yyval.ttype) = (yyvsp[0].ttype); + } +#line 2707 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 104: +#line 1116 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("MapType -> tok_map <FieldType, FieldType>"); + (yyval.ttype) = new t_map((yyvsp[-3].ttype), (yyvsp[-1].ttype)); + if ((yyvsp[-5].id) != NULL) { + ((t_container*)(yyval.ttype))->set_cpp_name(std::string((yyvsp[-5].id))); + } + } +#line 2719 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 105: +#line 1126 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("SetType -> tok_set<FieldType>"); + (yyval.ttype) = new t_set((yyvsp[-1].ttype)); + if ((yyvsp[-3].id) != NULL) { + ((t_container*)(yyval.ttype))->set_cpp_name(std::string((yyvsp[-3].id))); + } + } +#line 2731 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 106: +#line 1136 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("ListType -> tok_list<FieldType>"); + check_for_list_of_bytes((yyvsp[-2].ttype)); + (yyval.ttype) = new t_list((yyvsp[-2].ttype)); + if ((yyvsp[0].id) != NULL) { + ((t_container*)(yyval.ttype))->set_cpp_name(std::string((yyvsp[0].id))); + } + } +#line 2744 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 107: +#line 1147 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.id) = (yyvsp[0].id); + } +#line 2752 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 108: +#line 1151 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.id) = NULL; + } +#line 2760 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 109: +#line 1157 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("TypeAnnotations -> ( TypeAnnotationList )"); + (yyval.ttype) = (yyvsp[-1].ttype); + } +#line 2769 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 110: +#line 1162 "thrifty.yy" /* yacc.c:1646 */ + { + (yyval.ttype) = NULL; + } +#line 2777 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 111: +#line 1168 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("TypeAnnotationList -> TypeAnnotationList , TypeAnnotation"); + (yyval.ttype) = (yyvsp[-1].ttype); + (yyval.ttype)->annotations_[(yyvsp[0].tannot)->key] = (yyvsp[0].tannot)->val; + delete (yyvsp[0].tannot); + } +#line 2788 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 112: +#line 1175 "thrifty.yy" /* yacc.c:1646 */ + { + /* Just use a dummy structure to hold the annotations. */ + (yyval.ttype) = new t_struct(g_program); + } +#line 2797 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 113: +#line 1182 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("TypeAnnotation -> TypeAnnotationValue"); + (yyval.tannot) = new t_annotation; + (yyval.tannot)->key = (yyvsp[-2].id); + (yyval.tannot)->val = (yyvsp[-1].id); + } +#line 2808 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 114: +#line 1191 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("TypeAnnotationValue -> = tok_literal"); + (yyval.id) = (yyvsp[0].id); + } +#line 2817 "thrifty.cc" /* yacc.c:1646 */ + break; + + case 115: +#line 1196 "thrifty.yy" /* yacc.c:1646 */ + { + pdebug("TypeAnnotationValue ->"); + (yyval.id) = strdup("1"); + } +#line 2826 "thrifty.cc" /* yacc.c:1646 */ + break; + + +#line 2830 "thrifty.cc" /* yacc.c:1646 */ + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) + { + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } +# undef YYSYNTAX_ERROR +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if !defined yyoverflow || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + return yyresult; +} +#line 1201 "thrifty.yy" /* yacc.c:1906 */ + diff --git a/contrib/restricted/thrift/compiler/thrift/thrifty.hh b/contrib/restricted/thrift/compiler/thrift/thrifty.hh index 6fc381c9a4..f61a629a8e 100644 --- a/contrib/restricted/thrift/compiler/thrift/thrifty.hh +++ b/contrib/restricted/thrift/compiler/thrift/thrifty.hh @@ -1,179 +1,179 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -#ifndef YY_YY_THRIFTY_HH_INCLUDED -# define YY_YY_THRIFTY_HH_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int yydebug; -#endif -/* "%code requires" blocks. */ -#line 1 "thrifty.yy" /* yacc.c:1909 */ - -#include "thrift/parse/t_program.h" - -#line 48 "thrifty.hh" /* yacc.c:1909 */ - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - tok_identifier = 258, - tok_literal = 259, - tok_doctext = 260, - tok_int_constant = 261, - tok_dub_constant = 262, - tok_include = 263, - tok_namespace = 264, - tok_cpp_include = 265, - tok_cpp_type = 266, - tok_xsd_all = 267, - tok_xsd_optional = 268, - tok_xsd_nillable = 269, - tok_xsd_attrs = 270, - tok_void = 271, - tok_bool = 272, - tok_string = 273, - tok_binary = 274, - tok_slist = 275, - tok_senum = 276, - tok_i8 = 277, - tok_i16 = 278, - tok_i32 = 279, - tok_i64 = 280, - tok_double = 281, - tok_map = 282, - tok_list = 283, - tok_set = 284, - tok_oneway = 285, - tok_typedef = 286, - tok_struct = 287, - tok_xception = 288, - tok_throws = 289, - tok_extends = 290, - tok_service = 291, - tok_enum = 292, - tok_const = 293, - tok_required = 294, - tok_optional = 295, - tok_union = 296, - tok_reference = 297 - }; -#endif -/* Tokens. */ -#define tok_identifier 258 -#define tok_literal 259 -#define tok_doctext 260 -#define tok_int_constant 261 -#define tok_dub_constant 262 -#define tok_include 263 -#define tok_namespace 264 -#define tok_cpp_include 265 -#define tok_cpp_type 266 -#define tok_xsd_all 267 -#define tok_xsd_optional 268 -#define tok_xsd_nillable 269 -#define tok_xsd_attrs 270 -#define tok_void 271 -#define tok_bool 272 -#define tok_string 273 -#define tok_binary 274 -#define tok_slist 275 -#define tok_senum 276 -#define tok_i8 277 -#define tok_i16 278 -#define tok_i32 279 -#define tok_i64 280 -#define tok_double 281 -#define tok_map 282 -#define tok_list 283 -#define tok_set 284 -#define tok_oneway 285 -#define tok_typedef 286 -#define tok_struct 287 -#define tok_xception 288 -#define tok_throws 289 -#define tok_extends 290 -#define tok_service 291 -#define tok_enum 292 -#define tok_const 293 -#define tok_required 294 -#define tok_optional 295 -#define tok_union 296 -#define tok_reference 297 - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - -union YYSTYPE -{ -#line 82 "thrifty.yy" /* yacc.c:1909 */ - - char* id; - int64_t iconst; - double dconst; - bool tbool; - t_doc* tdoc; - t_type* ttype; - t_base_type* tbase; - t_typedef* ttypedef; - t_enum* tenum; - t_enum_value* tenumv; - t_const* tconst; - t_const_value* tconstv; - t_struct* tstruct; - t_service* tservice; - t_function* tfunction; - t_field* tfield; - char* dtext; - t_field::e_req ereq; - t_annotation* tannot; - t_field_id tfieldid; - -#line 167 "thrifty.hh" /* yacc.c:1909 */ -}; - -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE yylval; - -int yyparse (void); - -#endif /* !YY_YY_THRIFTY_HH_INCLUDED */ +/* A Bison parser, made by GNU Bison 3.0.4. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +#ifndef YY_YY_THRIFTY_HH_INCLUDED +# define YY_YY_THRIFTY_HH_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int yydebug; +#endif +/* "%code requires" blocks. */ +#line 1 "thrifty.yy" /* yacc.c:1909 */ + +#include "thrift/parse/t_program.h" + +#line 48 "thrifty.hh" /* yacc.c:1909 */ + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + tok_identifier = 258, + tok_literal = 259, + tok_doctext = 260, + tok_int_constant = 261, + tok_dub_constant = 262, + tok_include = 263, + tok_namespace = 264, + tok_cpp_include = 265, + tok_cpp_type = 266, + tok_xsd_all = 267, + tok_xsd_optional = 268, + tok_xsd_nillable = 269, + tok_xsd_attrs = 270, + tok_void = 271, + tok_bool = 272, + tok_string = 273, + tok_binary = 274, + tok_slist = 275, + tok_senum = 276, + tok_i8 = 277, + tok_i16 = 278, + tok_i32 = 279, + tok_i64 = 280, + tok_double = 281, + tok_map = 282, + tok_list = 283, + tok_set = 284, + tok_oneway = 285, + tok_typedef = 286, + tok_struct = 287, + tok_xception = 288, + tok_throws = 289, + tok_extends = 290, + tok_service = 291, + tok_enum = 292, + tok_const = 293, + tok_required = 294, + tok_optional = 295, + tok_union = 296, + tok_reference = 297 + }; +#endif +/* Tokens. */ +#define tok_identifier 258 +#define tok_literal 259 +#define tok_doctext 260 +#define tok_int_constant 261 +#define tok_dub_constant 262 +#define tok_include 263 +#define tok_namespace 264 +#define tok_cpp_include 265 +#define tok_cpp_type 266 +#define tok_xsd_all 267 +#define tok_xsd_optional 268 +#define tok_xsd_nillable 269 +#define tok_xsd_attrs 270 +#define tok_void 271 +#define tok_bool 272 +#define tok_string 273 +#define tok_binary 274 +#define tok_slist 275 +#define tok_senum 276 +#define tok_i8 277 +#define tok_i16 278 +#define tok_i32 279 +#define tok_i64 280 +#define tok_double 281 +#define tok_map 282 +#define tok_list 283 +#define tok_set 284 +#define tok_oneway 285 +#define tok_typedef 286 +#define tok_struct 287 +#define tok_xception 288 +#define tok_throws 289 +#define tok_extends 290 +#define tok_service 291 +#define tok_enum 292 +#define tok_const 293 +#define tok_required 294 +#define tok_optional 295 +#define tok_union 296 +#define tok_reference 297 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED + +union YYSTYPE +{ +#line 82 "thrifty.yy" /* yacc.c:1909 */ + + char* id; + int64_t iconst; + double dconst; + bool tbool; + t_doc* tdoc; + t_type* ttype; + t_base_type* tbase; + t_typedef* ttypedef; + t_enum* tenum; + t_enum_value* tenumv; + t_const* tconst; + t_const_value* tconstv; + t_struct* tstruct; + t_service* tservice; + t_function* tfunction; + t_field* tfield; + char* dtext; + t_field::e_req ereq; + t_annotation* tannot; + t_field_id tfieldid; + +#line 167 "thrifty.hh" /* yacc.c:1909 */ +}; + +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + +extern YYSTYPE yylval; + +int yyparse (void); + +#endif /* !YY_YY_THRIFTY_HH_INCLUDED */ diff --git a/contrib/restricted/thrift/compiler/thrift/version.h b/contrib/restricted/thrift/compiler/thrift/version.h index 38e9942677..00f31484ff 100644 --- a/contrib/restricted/thrift/compiler/thrift/version.h +++ b/contrib/restricted/thrift/compiler/thrift/version.h @@ -1,29 +1,29 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#ifndef _THRIFT_VERSION_H_ -#define _THRIFT_VERSION_H_ 1 - -#if defined(_MSC_VER) && (_MSC_VER > 1200) -#pragma once -#endif // _MSC_VER - -#define THRIFT_VERSION "0.10.0-dev" - -#endif // _THRIFT_VERSION_H_ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#ifndef _THRIFT_VERSION_H_ +#define _THRIFT_VERSION_H_ 1 + +#if defined(_MSC_VER) && (_MSC_VER > 1200) +#pragma once +#endif // _MSC_VER + +#define THRIFT_VERSION "0.10.0-dev" + +#endif // _THRIFT_VERSION_H_ diff --git a/contrib/restricted/thrift/compiler/ya.make b/contrib/restricted/thrift/compiler/ya.make index 73f2dd88bb..3b140cb405 100644 --- a/contrib/restricted/thrift/compiler/ya.make +++ b/contrib/restricted/thrift/compiler/ya.make @@ -1,70 +1,70 @@ -PROGRAM() - +PROGRAM() + LICENSE( Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2 -) - +) + LICENSE_TEXTS(.yandex_meta/licenses.list.txt) OWNER(g:contrib) -PEERDIR( - contrib/restricted/boost - contrib/restricted/thrift -) - -ADDINCL( - contrib/restricted/thrift/compiler -) - -NO_UTIL() - -SRCS( - thrift/audit/t_audit.cpp - thrift/common.cc - thrift/generate/t_as3_generator.cc - #thrift/generate/t_c_glib_generator.cc - thrift/generate/t_cl_generator.cc - thrift/generate/t_cocoa_generator.cc - thrift/generate/t_cpp_generator.cc - thrift/generate/t_csharp_generator.cc - thrift/generate/t_d_generator.cc - thrift/generate/t_dart_generator.cc - thrift/generate/t_delphi_generator.cc - thrift/generate/t_erl_generator.cc - thrift/generate/t_generator.cc - thrift/generate/t_go_generator.cc - thrift/generate/t_gv_generator.cc - thrift/generate/t_haxe_generator.cc - thrift/generate/t_hs_generator.cc - thrift/generate/t_html_generator.cc - thrift/generate/t_java_generator.cc - thrift/generate/t_javame_generator.cc - thrift/generate/t_js_generator.cc - thrift/generate/t_json_generator.cc - thrift/generate/t_lua_generator.cc - #thrift/generate/t_netcore_generator.cc - thrift/generate/t_ocaml_generator.cc - thrift/generate/t_perl_generator.cc - thrift/generate/t_php_generator.cc - thrift/generate/t_py_generator.cc - thrift/generate/t_rb_generator.cc - thrift/generate/t_rs_generator.cc - thrift/generate/t_st_generator.cc - thrift/generate/t_swift_generator.cc - thrift/generate/t_xml_generator.cc - thrift/generate/t_xsd_generator.cc - #thrift/logging.cc - thrift/main.cc - thrift/parse/parse.cc - thrift/parse/t_typedef.cc - #thrift/plugin/plugin.cc - #thrift/plugin/plugin_output.cc - thrift/thriftl.cc - thrift/thrifty.cc -) - -CXXFLAGS(-Wno-unused-variable) - -END() +PEERDIR( + contrib/restricted/boost + contrib/restricted/thrift +) + +ADDINCL( + contrib/restricted/thrift/compiler +) + +NO_UTIL() + +SRCS( + thrift/audit/t_audit.cpp + thrift/common.cc + thrift/generate/t_as3_generator.cc + #thrift/generate/t_c_glib_generator.cc + thrift/generate/t_cl_generator.cc + thrift/generate/t_cocoa_generator.cc + thrift/generate/t_cpp_generator.cc + thrift/generate/t_csharp_generator.cc + thrift/generate/t_d_generator.cc + thrift/generate/t_dart_generator.cc + thrift/generate/t_delphi_generator.cc + thrift/generate/t_erl_generator.cc + thrift/generate/t_generator.cc + thrift/generate/t_go_generator.cc + thrift/generate/t_gv_generator.cc + thrift/generate/t_haxe_generator.cc + thrift/generate/t_hs_generator.cc + thrift/generate/t_html_generator.cc + thrift/generate/t_java_generator.cc + thrift/generate/t_javame_generator.cc + thrift/generate/t_js_generator.cc + thrift/generate/t_json_generator.cc + thrift/generate/t_lua_generator.cc + #thrift/generate/t_netcore_generator.cc + thrift/generate/t_ocaml_generator.cc + thrift/generate/t_perl_generator.cc + thrift/generate/t_php_generator.cc + thrift/generate/t_py_generator.cc + thrift/generate/t_rb_generator.cc + thrift/generate/t_rs_generator.cc + thrift/generate/t_st_generator.cc + thrift/generate/t_swift_generator.cc + thrift/generate/t_xml_generator.cc + thrift/generate/t_xsd_generator.cc + #thrift/logging.cc + thrift/main.cc + thrift/parse/parse.cc + thrift/parse/t_typedef.cc + #thrift/plugin/plugin.cc + #thrift/plugin/plugin_output.cc + thrift/thriftl.cc + thrift/thrifty.cc +) + +CXXFLAGS(-Wno-unused-variable) + +END() diff --git a/contrib/restricted/thrift/thrift/concurrency/PlatformThreadFactory.h b/contrib/restricted/thrift/thrift/concurrency/PlatformThreadFactory.h index afa2c94469..119c5d8b90 100644 --- a/contrib/restricted/thrift/thrift/concurrency/PlatformThreadFactory.h +++ b/contrib/restricted/thrift/thrift/concurrency/PlatformThreadFactory.h @@ -23,11 +23,11 @@ // clang-format off #include <thrift/thrift-config.h> #if USE_BOOST_THREAD -#error # include <thrift/concurrency/BoostThreadFactory.h> +#error # include <thrift/concurrency/BoostThreadFactory.h> #elif USE_STD_THREAD # include <thrift/concurrency/StdThreadFactory.h> #else -#error # include <thrift/concurrency/PosixThreadFactory.h> +#error # include <thrift/concurrency/PosixThreadFactory.h> #endif // clang-format on diff --git a/contrib/restricted/thrift/thrift/config.h b/contrib/restricted/thrift/thrift/config.h index dc6c42e202..74bf1a1ee9 100644 --- a/contrib/restricted/thrift/thrift/config.h +++ b/contrib/restricted/thrift/thrift/config.h @@ -1,22 +1,22 @@ -#pragma once - -#define HAVE_ARPA_INET_H -#define HAVE_FCNTL_H -#define HAVE_INTTYPES_H -#define HAVE_NETDB_H -#define HAVE_NETINET_IN_H -#define HAVE_PTHREAD_H -#define HAVE_STDINT_H -#define HAVE_SYS_IOCTL_H -#define HAVE_SYS_POLL_H -#define HAVE_SYS_SOCKET_H -#define HAVE_SYS_STAT_H -#define HAVE_SYS_TIME_H -#define HAVE_SYS_UN_H -#define HAVE_UNISTD_H - -#define PACKAGE_VERSION "0.10.0-dev" - -#define ARITHMETIC_RIGHT_SHIFT 1 -#define SIGNED_RIGHT_SHIFT_IS 1 -#define USE_STD_THREAD 1 +#pragma once + +#define HAVE_ARPA_INET_H +#define HAVE_FCNTL_H +#define HAVE_INTTYPES_H +#define HAVE_NETDB_H +#define HAVE_NETINET_IN_H +#define HAVE_PTHREAD_H +#define HAVE_STDINT_H +#define HAVE_SYS_IOCTL_H +#define HAVE_SYS_POLL_H +#define HAVE_SYS_SOCKET_H +#define HAVE_SYS_STAT_H +#define HAVE_SYS_TIME_H +#define HAVE_SYS_UN_H +#define HAVE_UNISTD_H + +#define PACKAGE_VERSION "0.10.0-dev" + +#define ARITHMETIC_RIGHT_SHIFT 1 +#define SIGNED_RIGHT_SHIFT_IS 1 +#define USE_STD_THREAD 1 diff --git a/contrib/restricted/thrift/thrift/protocol/TProtocol.h b/contrib/restricted/thrift/thrift/protocol/TProtocol.h index b4502051de..cdcb52aafb 100644 --- a/contrib/restricted/thrift/thrift/protocol/TProtocol.h +++ b/contrib/restricted/thrift/thrift/protocol/TProtocol.h @@ -415,7 +415,7 @@ public: virtual uint32_t readBool_virt(bool& value) = 0; - //virtual uint32_t readBool_virt(std::vector<bool>::reference value) = 0; + //virtual uint32_t readBool_virt(std::vector<bool>::reference value) = 0; virtual uint32_t readByte_virt(int8_t& byte) = 0; @@ -536,12 +536,12 @@ public: * rather than bools. We need to define a different version of readBool() * to work with std::vector<bool>. */ - /* + /* uint32_t readBool(std::vector<bool>::reference value) { T_VIRTUAL_CALL(); return readBool_virt(value); } - */ + */ /** * Method to arbitrarily skip over data. diff --git a/contrib/restricted/thrift/thrift/protocol/TProtocolDecorator.h b/contrib/restricted/thrift/thrift/protocol/TProtocolDecorator.h index 7a02bc9af5..7ca734f244 100644 --- a/contrib/restricted/thrift/thrift/protocol/TProtocolDecorator.h +++ b/contrib/restricted/thrift/thrift/protocol/TProtocolDecorator.h @@ -126,11 +126,11 @@ public: virtual uint32_t readSetEnd_virt() { return protocol->readSetEnd(); } virtual uint32_t readBool_virt(bool& value) { return protocol->readBool(value); } - /* + /* virtual uint32_t readBool_virt(std::vector<bool>::reference value) { return protocol->readBool(value); } - */ + */ virtual uint32_t readByte_virt(int8_t& byte) { return protocol->readByte(byte); } diff --git a/contrib/restricted/thrift/thrift/protocol/TVirtualProtocol.h b/contrib/restricted/thrift/thrift/protocol/TVirtualProtocol.h index 95def09c7e..6c6abae2ec 100644 --- a/contrib/restricted/thrift/thrift/protocol/TVirtualProtocol.h +++ b/contrib/restricted/thrift/thrift/protocol/TVirtualProtocol.h @@ -121,13 +121,13 @@ public: "this protocol does not support reading (yet)."); } - /* + /* uint32_t readBool(std::vector<bool>::reference value) { (void)value; throw TProtocolException(TProtocolException::NOT_IMPLEMENTED, "this protocol does not support reading (yet)."); } - */ + */ uint32_t readByte(int8_t& byte) { (void)byte; @@ -441,11 +441,11 @@ public: return static_cast<Protocol_*>(this)->readBool(value); } - /* + /* virtual uint32_t readBool_virt(std::vector<bool>::reference value) { return static_cast<Protocol_*>(this)->readBool(value); } - */ + */ virtual uint32_t readByte_virt(int8_t& byte) { return static_cast<Protocol_*>(this)->readByte(byte); @@ -499,14 +499,14 @@ public: * Subclasses can override this if desired, but there normally shouldn't * be a need to. */ - /* + /* uint32_t readBool(std::vector<bool>::reference value) { bool b = false; uint32_t ret = static_cast<Protocol_*>(this)->readBool(b); value = b; return ret; } - */ + */ using Super_::readBool; // so we don't hide readBool(bool&) protected: diff --git a/contrib/restricted/thrift/thrift/stdcxx.h b/contrib/restricted/thrift/thrift/stdcxx.h index 3e377daa45..ccf988a19b 100644 --- a/contrib/restricted/thrift/thrift/stdcxx.h +++ b/contrib/restricted/thrift/thrift/stdcxx.h @@ -29,24 +29,24 @@ // /////////////////////////////////////////////////////////////////// -#if defined (BOOST_NO_CXX11_HDR_FUNCTIONAL) -#undef BOOST_NO_CXX11_HDR_FUNCTIONAL -#define __SHOULD_RESTORE__BOOST_NO_CXX11_HDR_FUNCTIONAL -#endif - +#if defined (BOOST_NO_CXX11_HDR_FUNCTIONAL) +#undef BOOST_NO_CXX11_HDR_FUNCTIONAL +#define __SHOULD_RESTORE__BOOST_NO_CXX11_HDR_FUNCTIONAL +#endif + #if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) || (defined(_MSC_VER) && _MSC_VER < 1800) || defined(FORCE_BOOST_FUNCTIONAL) #if (BOOST_VERSION <= 106500) -#include <boost/tr1/functional.hpp> // Y_IGNORE +#include <boost/tr1/functional.hpp> // Y_IGNORE #else #include <tr1/functional> #endif #define _THRIFT_FUNCTIONAL_TR1_ 1 #endif -#if defined (__SHOULD_RESTORE__BOOST_NO_CXX11_HDR_FUNCTIONAL) -#define BOOST_NO_CXX11_HDR_FUNCTIONAL -#endif - +#if defined (__SHOULD_RESTORE__BOOST_NO_CXX11_HDR_FUNCTIONAL) +#define BOOST_NO_CXX11_HDR_FUNCTIONAL +#endif + #if _THRIFT_FUNCTIONAL_TR1_ namespace apache { namespace thrift { namespace stdcxx { @@ -101,11 +101,11 @@ // which do not support the feature, so we must continue to use C++98 and boost on them. // We cannot use __cplusplus to detect this either, since Microsoft advertises an older one. -#if defined (BOOST_NO_CXX11_SMART_PTR) -#undef BOOST_NO_CXX11_SMART_PTR -#define __SHOULD_RESTORE__BOOST_NO_CXX11_SMART_PTR -#endif - +#if defined (BOOST_NO_CXX11_SMART_PTR) +#undef BOOST_NO_CXX11_SMART_PTR +#define __SHOULD_RESTORE__BOOST_NO_CXX11_SMART_PTR +#endif + #if defined(BOOST_NO_CXX11_SMART_PTR) || (defined(_MSC_VER) && _MSC_VER < 1800) || defined(FORCE_BOOST_SMART_PTR) #include <boost/smart_ptr.hpp> #else @@ -138,10 +138,10 @@ namespace apache { namespace thrift { namespace stdcxx { #endif -#if defined (__SHOULD_RESTORE__BOOST_NO_CXX11_SMART_PTR) -#define BOOST_NO_CXX11_SMART_PTR -#endif - +#if defined (__SHOULD_RESTORE__BOOST_NO_CXX11_SMART_PTR) +#define BOOST_NO_CXX11_SMART_PTR +#endif + }}} // apache::thrift::stdcxx #endif // #ifndef _THRIFT_STDCXX_H_ diff --git a/contrib/restricted/thrift/thrift/transport/THttpClient.cpp b/contrib/restricted/thrift/thrift/transport/THttpClient.cpp index 5a20874385..d5a434b961 100644 --- a/contrib/restricted/thrift/thrift/transport/THttpClient.cpp +++ b/contrib/restricted/thrift/thrift/transport/THttpClient.cpp @@ -22,7 +22,7 @@ #include <sstream> #include <boost/algorithm/string.hpp> -#include <thrift/thrift-config.h> +#include <thrift/thrift-config.h> #include <thrift/transport/THttpClient.h> #include <thrift/transport/TSocket.h> diff --git a/contrib/restricted/thrift/thrift/transport/THttpServer.cpp b/contrib/restricted/thrift/thrift/transport/THttpServer.cpp index d03a8fe054..ffd57503d5 100644 --- a/contrib/restricted/thrift/thrift/transport/THttpServer.cpp +++ b/contrib/restricted/thrift/thrift/transport/THttpServer.cpp @@ -21,7 +21,7 @@ #include <sstream> #include <iostream> -#include <thrift/thrift-config.h> +#include <thrift/thrift-config.h> #include <thrift/transport/THttpServer.h> #include <thrift/transport/TSocket.h> #if defined(_MSC_VER) || defined(__MINGW32__) diff --git a/contrib/restricted/thrift/thrift/transport/TSocketPool.cpp b/contrib/restricted/thrift/thrift/transport/TSocketPool.cpp index 9aad9b3810..57baec9c55 100644 --- a/contrib/restricted/thrift/thrift/transport/TSocketPool.cpp +++ b/contrib/restricted/thrift/thrift/transport/TSocketPool.cpp @@ -25,7 +25,7 @@ #include <thrift/transport/TSocketPool.h> using std::pair; -using std::random_shuffle; +using std::random_shuffle; using std::string; using std::vector; diff --git a/contrib/restricted/thrift/thrift/windows/config.h b/contrib/restricted/thrift/thrift/windows/config.h index 0afad4fd8a..565fb2eb36 100644 --- a/contrib/restricted/thrift/thrift/windows/config.h +++ b/contrib/restricted/thrift/thrift/windows/config.h @@ -109,6 +109,6 @@ typedef boost::uint8_t uint8_t; #endif #endif // __MINGW32__ -#define PACKAGE_VERSION "0.10.0-dev" - +#define PACKAGE_VERSION "0.10.0-dev" + #endif // _THRIFT_WINDOWS_CONFIG_H_ diff --git a/contrib/restricted/thrift/ya.make b/contrib/restricted/thrift/ya.make index ffdf32e4f7..b25b6f57b7 100644 --- a/contrib/restricted/thrift/ya.make +++ b/contrib/restricted/thrift/ya.make @@ -1,100 +1,100 @@ -LIBRARY() - -VERSION(0.10.0) - -LICENSE(Apache-2.0) - +LIBRARY() + +VERSION(0.10.0) + +LICENSE(Apache-2.0) + LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -OWNER( - g:contrib - g:cpp-contrib -) - -NO_UTIL() - +OWNER( + g:contrib + g:cpp-contrib +) + +NO_UTIL() + NO_COMPILER_WARNINGS() ADDINCL( GLOBAL contrib/restricted/thrift ) - -PEERDIR( - contrib/libs/libevent - contrib/libs/openssl - contrib/libs/zlib - contrib/restricted/boost - contrib/restricted/boost/libs/system - contrib/restricted/boost/libs/thread -) - -SRCS( - thrift/TApplicationException.cpp - thrift/TOutput.cpp - thrift/VirtualProfiling.cpp - thrift/async/TAsyncChannel.cpp - thrift/async/TAsyncProtocolProcessor.cpp - thrift/async/TConcurrentClientSyncInfo.cpp - thrift/async/TEvhttpClientChannel.cpp - thrift/async/TEvhttpServer.cpp - thrift/concurrency/StdMonitor.cpp - thrift/concurrency/StdMutex.cpp - thrift/concurrency/StdThreadFactory.cpp - thrift/concurrency/ThreadManager.cpp - thrift/concurrency/TimerManager.cpp - thrift/concurrency/Util.cpp - thrift/processor/PeekProcessor.cpp - thrift/protocol/TBase64Utils.cpp - thrift/protocol/TDebugProtocol.cpp - thrift/protocol/THeaderProtocol.cpp - thrift/protocol/TJSONProtocol.cpp - thrift/protocol/TMultiplexedProtocol.cpp - thrift/protocol/TProtocol.cpp - thrift/server/TConnectedClient.cpp - thrift/server/TNonblockingServer.cpp - thrift/server/TServer.cpp - thrift/server/TServerFramework.cpp - thrift/server/TSimpleServer.cpp - thrift/server/TThreadPoolServer.cpp - thrift/server/TThreadedServer.cpp - thrift/transport/TBufferTransports.cpp - thrift/transport/TFDTransport.cpp - thrift/transport/TFileTransport.cpp - thrift/transport/THeaderTransport.cpp - thrift/transport/THttpClient.cpp - thrift/transport/THttpServer.cpp - thrift/transport/THttpTransport.cpp - thrift/transport/TNonblockingSSLServerSocket.cpp - thrift/transport/TNonblockingServerSocket.cpp - thrift/transport/TPipe.cpp - thrift/transport/TPipeServer.cpp - thrift/transport/TSSLServerSocket.cpp - thrift/transport/TSSLSocket.cpp - thrift/transport/TServerSocket.cpp - thrift/transport/TSimpleFileTransport.cpp - thrift/transport/TSocket.cpp - thrift/transport/TSocketPool.cpp - thrift/transport/TTransportException.cpp - thrift/transport/TTransportUtils.cpp - thrift/transport/TZlibTransport.cpp -) - -IF (OS_WINDOWS) - SRCS( - thrift/windows/GetTimeOfDay.cpp - thrift/windows/OverlappedSubmissionThread.cpp - thrift/windows/SocketPair.cpp - thrift/windows/TWinsockSingleton.cpp - thrift/windows/WinFcntl.cpp - ) -ELSE() - CXXFLAGS( - -Wno-deprecated-declarations - -Wno-unused-function - -Wno-unused-parameter - -Wno-unused-private-field - -Wno-unused-variable - ) -ENDIF() - -END() + +PEERDIR( + contrib/libs/libevent + contrib/libs/openssl + contrib/libs/zlib + contrib/restricted/boost + contrib/restricted/boost/libs/system + contrib/restricted/boost/libs/thread +) + +SRCS( + thrift/TApplicationException.cpp + thrift/TOutput.cpp + thrift/VirtualProfiling.cpp + thrift/async/TAsyncChannel.cpp + thrift/async/TAsyncProtocolProcessor.cpp + thrift/async/TConcurrentClientSyncInfo.cpp + thrift/async/TEvhttpClientChannel.cpp + thrift/async/TEvhttpServer.cpp + thrift/concurrency/StdMonitor.cpp + thrift/concurrency/StdMutex.cpp + thrift/concurrency/StdThreadFactory.cpp + thrift/concurrency/ThreadManager.cpp + thrift/concurrency/TimerManager.cpp + thrift/concurrency/Util.cpp + thrift/processor/PeekProcessor.cpp + thrift/protocol/TBase64Utils.cpp + thrift/protocol/TDebugProtocol.cpp + thrift/protocol/THeaderProtocol.cpp + thrift/protocol/TJSONProtocol.cpp + thrift/protocol/TMultiplexedProtocol.cpp + thrift/protocol/TProtocol.cpp + thrift/server/TConnectedClient.cpp + thrift/server/TNonblockingServer.cpp + thrift/server/TServer.cpp + thrift/server/TServerFramework.cpp + thrift/server/TSimpleServer.cpp + thrift/server/TThreadPoolServer.cpp + thrift/server/TThreadedServer.cpp + thrift/transport/TBufferTransports.cpp + thrift/transport/TFDTransport.cpp + thrift/transport/TFileTransport.cpp + thrift/transport/THeaderTransport.cpp + thrift/transport/THttpClient.cpp + thrift/transport/THttpServer.cpp + thrift/transport/THttpTransport.cpp + thrift/transport/TNonblockingSSLServerSocket.cpp + thrift/transport/TNonblockingServerSocket.cpp + thrift/transport/TPipe.cpp + thrift/transport/TPipeServer.cpp + thrift/transport/TSSLServerSocket.cpp + thrift/transport/TSSLSocket.cpp + thrift/transport/TServerSocket.cpp + thrift/transport/TSimpleFileTransport.cpp + thrift/transport/TSocket.cpp + thrift/transport/TSocketPool.cpp + thrift/transport/TTransportException.cpp + thrift/transport/TTransportUtils.cpp + thrift/transport/TZlibTransport.cpp +) + +IF (OS_WINDOWS) + SRCS( + thrift/windows/GetTimeOfDay.cpp + thrift/windows/OverlappedSubmissionThread.cpp + thrift/windows/SocketPair.cpp + thrift/windows/TWinsockSingleton.cpp + thrift/windows/WinFcntl.cpp + ) +ELSE() + CXXFLAGS( + -Wno-deprecated-declarations + -Wno-unused-function + -Wno-unused-parameter + -Wno-unused-private-field + -Wno-unused-variable + ) +ENDIF() + +END() diff --git a/contrib/restricted/ya.make b/contrib/restricted/ya.make index b52a206733..3c1dfbb04c 100644 --- a/contrib/restricted/ya.make +++ b/contrib/restricted/ya.make @@ -29,7 +29,7 @@ RECURSE( gst-plugins-good gstreamer http-parser - keyutils + keyutils libelf libffi libiscsi @@ -54,8 +54,8 @@ RECURSE( rnnoise rubberband spdlog - thrift - thrift/compiler + thrift + thrift/compiler turbo_base64 uriparser ) diff --git a/library/README.md b/library/README.md index fc418bef7b..d5bbfb6a42 100644 --- a/library/README.md +++ b/library/README.md @@ -1,48 +1,48 @@ -library -=== -`library/` is a directory with reusable libraries. Common ideas (with [key words](https://tools.ietf.org/html/rfc2119)): +library +=== +`library/` is a directory with reusable libraries. Common ideas (with [key words](https://tools.ietf.org/html/rfc2119)): -1. Libraries are categorized by the languages in which they will be used. - Bindings **MUST** be put in `<language>` directory. +1. Libraries are categorized by the languages in which they will be used. + Bindings **MUST** be put in `<language>` directory. -2. Grouping by any other criteria **SHOULD** be defined by the language committee in `<language>` directory. +2. Grouping by any other criteria **SHOULD** be defined by the language committee in `<language>` directory. -3. The library **SHOULD** be in use in at least two projects. +3. The library **SHOULD** be in use in at least two projects. - If you are not sure if you should put some library in `library/`, please contact `<language>` committee or arcadia-wg@yandex-team.ru. + If you are not sure if you should put some library in `library/`, please contact `<language>` committee or arcadia-wg@yandex-team.ru. -4. The library **SHOULD** be portable. +4. The library **SHOULD** be portable. - Please contact `<language>` committee if you cannot provide usage on all platforms: `linux`, `darwin`, `windows`. + Please contact `<language>` committee if you cannot provide usage on all platforms: `linux`, `darwin`, `windows`. -5. The library **MUST** depend only on a limited list of external components - (currently it is `util/`, `contrib/`, `vendor/`, `library/`). +5. The library **MUST** depend only on a limited list of external components + (currently it is `util/`, `contrib/`, `vendor/`, `library/`). -6. Any code in Arcadia (except `contrib/`, `vendor/` and `util/`) **MAY** depend on the `library/`. +6. Any code in Arcadia (except `contrib/`, `vendor/` and `util/`) **MAY** depend on the `library/`. -7. The library **MUST** be accompanied by `README.md` file and a brief description of the project. +7. The library **MUST** be accompanied by `README.md` file and a brief description of the project. -8. The library **MUST** be accompanied by unit-tests. +8. The library **MUST** be accompanied by unit-tests. -9. CPU- or/and RAM-bound algorithms **SHOULD** provide benchmarks. +9. CPU- or/and RAM-bound algorithms **SHOULD** provide benchmarks. -10. There **MUST** be no trade secrets of Yandex in `library/`: anything that can cause harm on publishing as OpenSource. For example: - * spam filter rules; - * coefficients for ML; - * etc. +10. There **MUST** be no trade secrets of Yandex in `library/`: anything that can cause harm on publishing as OpenSource. For example: + * spam filter rules; + * coefficients for ML; + * etc. -11. All OSS (OpenSource Software) ready code **MUST** be accompanied by macro [LICENCE](https://docs.yandex-team.ru/ya-make/manual/common/macros#licence(license...)) in `ya.make`. +11. All OSS (OpenSource Software) ready code **MUST** be accompanied by macro [LICENCE](https://docs.yandex-team.ru/ya-make/manual/common/macros#licence(license...)) in `ya.make`. -12. All language specific aspects are defined by `<language>` committee: see `library/<language>/README.md`. +12. All language specific aspects are defined by `<language>` committee: see `library/<language>/README.md`. -13. The library **MUST** satisfy `<language>` style-guide. +13. The library **MUST** satisfy `<language>` style-guide. -14. The existing library **SHOULD** be improved instead of creating a new one - if it is possible. +14. The existing library **SHOULD** be improved instead of creating a new one - if it is possible. - Please do not create yet another library for the same thing: just improve existing one. + Please do not create yet another library for the same thing: just improve existing one. -Contacts -=== -If you have any language-specific questions, please contact `<language>` [committee](https://wiki.yandex-team.ru/devrules/#profilnyekomitety). - -If you have any other question about `library/`, please contact arcadia-wg@yandex-team.ru. +Contacts +=== +If you have any language-specific questions, please contact `<language>` [committee](https://wiki.yandex-team.ru/devrules/#profilnyekomitety). + +If you have any other question about `library/`, please contact arcadia-wg@yandex-team.ru. diff --git a/library/cpp/accurate_accumulate/benchmark/main.cpp b/library/cpp/accurate_accumulate/benchmark/main.cpp index 3c5e6e775d..54857b9fa6 100644 --- a/library/cpp/accurate_accumulate/benchmark/main.cpp +++ b/library/cpp/accurate_accumulate/benchmark/main.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/accurate_accumulate/accurate_accumulate.h> +#include <library/cpp/accurate_accumulate/accurate_accumulate.h> #include <library/cpp/testing/benchmark/bench.h> #include <util/generic/algorithm.h> diff --git a/library/cpp/accurate_accumulate/benchmark/metrics/main.py b/library/cpp/accurate_accumulate/benchmark/metrics/main.py index 311fc219ce..317eb597c6 100644 --- a/library/cpp/accurate_accumulate/benchmark/metrics/main.py +++ b/library/cpp/accurate_accumulate/benchmark/metrics/main.py @@ -3,5 +3,5 @@ import yatest.common as yc def test_export_metrics(metrics): metrics.set_benchmark(yc.execute_benchmark( - 'library/cpp/accurate_accumulate/benchmark/benchmark', + 'library/cpp/accurate_accumulate/benchmark/benchmark', threads=8)) diff --git a/library/cpp/accurate_accumulate/benchmark/metrics/ya.make b/library/cpp/accurate_accumulate/benchmark/metrics/ya.make index 5d532e1479..a8a8b05390 100644 --- a/library/cpp/accurate_accumulate/benchmark/metrics/ya.make +++ b/library/cpp/accurate_accumulate/benchmark/metrics/ya.make @@ -12,6 +12,6 @@ TAG( TEST_SRCS(main.py) -DEPENDS(library/cpp/accurate_accumulate/benchmark) +DEPENDS(library/cpp/accurate_accumulate/benchmark) END() diff --git a/library/cpp/accurate_accumulate/benchmark/ya.make b/library/cpp/accurate_accumulate/benchmark/ya.make index 20fd877389..52ad4f9bd2 100644 --- a/library/cpp/accurate_accumulate/benchmark/ya.make +++ b/library/cpp/accurate_accumulate/benchmark/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/accurate_accumulate + library/cpp/accurate_accumulate ) END() diff --git a/library/cpp/actors/core/actorsystem.cpp b/library/cpp/actors/core/actorsystem.cpp index c58698a206..f4642fc6bd 100644 --- a/library/cpp/actors/core/actorsystem.cpp +++ b/library/cpp/actors/core/actorsystem.cpp @@ -11,7 +11,7 @@ #include "log.h" #include "probes.h" #include "ask.h" -#include <library/cpp/actors/util/affinity.h> +#include <library/cpp/actors/util/affinity.h> #include <library/cpp/actors/util/datetime.h> #include <util/generic/hash.h> #include <util/system/rwlock.h> diff --git a/library/cpp/actors/core/actorsystem.h b/library/cpp/actors/core/actorsystem.h index 40499d7586..1a7409ee6c 100644 --- a/library/cpp/actors/core/actorsystem.h +++ b/library/cpp/actors/core/actorsystem.h @@ -11,7 +11,7 @@ #include "mon_stats.h" #include <library/cpp/threading/future/future.h> -#include <library/cpp/actors/util/ticket_lock.h> +#include <library/cpp/actors/util/ticket_lock.h> #include <util/generic/vector.h> #include <util/datetime/base.h> diff --git a/library/cpp/actors/core/defs.h b/library/cpp/actors/core/defs.h index 980b7d767b..832d354e41 100644 --- a/library/cpp/actors/core/defs.h +++ b/library/cpp/actors/core/defs.h @@ -2,7 +2,7 @@ // unique tag to fix pragma once gcc glueing: ./library/actorlib/core/defs.h -#include <library/cpp/actors/util/defs.h> +#include <library/cpp/actors/util/defs.h> #include <util/generic/hash.h> #include <util/string/printf.h> diff --git a/library/cpp/actors/core/event.h b/library/cpp/actors/core/event.h index 6ff02aaf94..d63b87dc07 100644 --- a/library/cpp/actors/core/event.h +++ b/library/cpp/actors/core/event.h @@ -5,7 +5,7 @@ #include "callstack.h" #include "event_load.h" -#include <library/cpp/actors/wilson/wilson_trace.h> +#include <library/cpp/actors/wilson/wilson_trace.h> #include <util/system/hp_timer.h> #include <util/generic/maybe.h> diff --git a/library/cpp/actors/core/event_load.h b/library/cpp/actors/core/event_load.h index 0dab1dd374..00ae9f25c4 100644 --- a/library/cpp/actors/core/event_load.h +++ b/library/cpp/actors/core/event_load.h @@ -3,8 +3,8 @@ #include <util/stream/walk.h> #include <util/system/types.h> #include <util/generic/string.h> -#include <library/cpp/actors/util/rope.h> -#include <library/cpp/actors/wilson/wilson_trace.h> +#include <library/cpp/actors/util/rope.h> +#include <library/cpp/actors/wilson/wilson_trace.h> namespace NActors { class IEventHandle; diff --git a/library/cpp/actors/core/event_pb.h b/library/cpp/actors/core/event_pb.h index d7546b901a..5eaa4a5533 100644 --- a/library/cpp/actors/core/event_pb.h +++ b/library/cpp/actors/core/event_pb.h @@ -5,7 +5,7 @@ #include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/arena.h> -#include <library/cpp/actors/protos/actors.pb.h> +#include <library/cpp/actors/protos/actors.pb.h> #include <util/generic/deque.h> #include <util/system/context.h> #include <util/system/filemap.h> diff --git a/library/cpp/actors/core/event_pb_payload_ut.cpp b/library/cpp/actors/core/event_pb_payload_ut.cpp index eab007bc15..8426f5255b 100644 --- a/library/cpp/actors/core/event_pb_payload_ut.cpp +++ b/library/cpp/actors/core/event_pb_payload_ut.cpp @@ -2,7 +2,7 @@ #include "events.h" #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/actors/protos/unittests.pb.h> +#include <library/cpp/actors/protos/unittests.pb.h> using namespace NActors; diff --git a/library/cpp/actors/core/event_pb_ut.cpp b/library/cpp/actors/core/event_pb_ut.cpp index a16c3092b3..7aece4a24b 100644 --- a/library/cpp/actors/core/event_pb_ut.cpp +++ b/library/cpp/actors/core/event_pb_ut.cpp @@ -1,7 +1,7 @@ #include "event_pb.h" #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/actors/protos/unittests.pb.h> +#include <library/cpp/actors/protos/unittests.pb.h> Y_UNIT_TEST_SUITE(TEventSerialization) { struct TMockEvent: public NActors::IEventBase { diff --git a/library/cpp/actors/core/events.h b/library/cpp/actors/core/events.h index 702cf50fad..b141892c62 100644 --- a/library/cpp/actors/core/events.h +++ b/library/cpp/actors/core/events.h @@ -3,7 +3,7 @@ #include "event.h" #include "event_pb.h" -#include <library/cpp/actors/protos/actors.pb.h> +#include <library/cpp/actors/protos/actors.pb.h> #include <util/system/unaligned_mem.h> namespace NActors { diff --git a/library/cpp/actors/core/executor_pool_base.h b/library/cpp/actors/core/executor_pool_base.h index c84ce1af77..a7aade3b61 100644 --- a/library/cpp/actors/core/executor_pool_base.h +++ b/library/cpp/actors/core/executor_pool_base.h @@ -3,9 +3,9 @@ #include "actorsystem.h" #include "executor_thread.h" #include "scheduler_queue.h" -#include <library/cpp/actors/util/affinity.h> -#include <library/cpp/actors/util/unordered_cache.h> -#include <library/cpp/actors/util/threadparkpad.h> +#include <library/cpp/actors/util/affinity.h> +#include <library/cpp/actors/util/unordered_cache.h> +#include <library/cpp/actors/util/threadparkpad.h> namespace NActors { class TExecutorPoolBaseMailboxed: public IExecutorPool { diff --git a/library/cpp/actors/core/executor_pool_basic.cpp b/library/cpp/actors/core/executor_pool_basic.cpp index 4dce16939a..5fc3baee85 100644 --- a/library/cpp/actors/core/executor_pool_basic.cpp +++ b/library/cpp/actors/core/executor_pool_basic.cpp @@ -1,7 +1,7 @@ #include "executor_pool_basic.h" #include "probes.h" #include "mailbox.h" -#include <library/cpp/actors/util/affinity.h> +#include <library/cpp/actors/util/affinity.h> #include <library/cpp/actors/util/datetime.h> #ifdef _linux_ diff --git a/library/cpp/actors/core/executor_pool_basic.h b/library/cpp/actors/core/executor_pool_basic.h index 023190f7fe..1033268e0c 100644 --- a/library/cpp/actors/core/executor_pool_basic.h +++ b/library/cpp/actors/core/executor_pool_basic.h @@ -4,8 +4,8 @@ #include "executor_thread.h" #include "scheduler_queue.h" #include "executor_pool_base.h" -#include <library/cpp/actors/util/unordered_cache.h> -#include <library/cpp/actors/util/threadparkpad.h> +#include <library/cpp/actors/util/unordered_cache.h> +#include <library/cpp/actors/util/threadparkpad.h> #include <library/cpp/monlib/dynamic_counters/counters.h> #include <util/system/mutex.h> diff --git a/library/cpp/actors/core/executor_pool_basic_ut.cpp b/library/cpp/actors/core/executor_pool_basic_ut.cpp index 76dff693af..850c657e93 100644 --- a/library/cpp/actors/core/executor_pool_basic_ut.cpp +++ b/library/cpp/actors/core/executor_pool_basic_ut.cpp @@ -3,10 +3,10 @@ #include "hfunc.h" #include "scheduler_basic.h" -#include <library/cpp/actors/util/should_continue.h> +#include <library/cpp/actors/util/should_continue.h> #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/actors/protos/unittests.pb.h> +#include <library/cpp/actors/protos/unittests.pb.h> using namespace NActors; diff --git a/library/cpp/actors/core/executor_pool_io.cpp b/library/cpp/actors/core/executor_pool_io.cpp index fb557ae6b0..ede73fe21d 100644 --- a/library/cpp/actors/core/executor_pool_io.cpp +++ b/library/cpp/actors/core/executor_pool_io.cpp @@ -1,6 +1,6 @@ #include "executor_pool_io.h" #include "mailbox.h" -#include <library/cpp/actors/util/affinity.h> +#include <library/cpp/actors/util/affinity.h> #include <library/cpp/actors/util/datetime.h> namespace NActors { diff --git a/library/cpp/actors/core/executor_pool_io.h b/library/cpp/actors/core/executor_pool_io.h index e576d642a1..b51c6f65c2 100644 --- a/library/cpp/actors/core/executor_pool_io.h +++ b/library/cpp/actors/core/executor_pool_io.h @@ -4,9 +4,9 @@ #include "executor_thread.h" #include "scheduler_queue.h" #include "executor_pool_base.h" -#include <library/cpp/actors/util/ticket_lock.h> -#include <library/cpp/actors/util/unordered_cache.h> -#include <library/cpp/actors/util/threadparkpad.h> +#include <library/cpp/actors/util/ticket_lock.h> +#include <library/cpp/actors/util/unordered_cache.h> +#include <library/cpp/actors/util/threadparkpad.h> #include <util/system/condvar.h> namespace NActors { diff --git a/library/cpp/actors/core/executor_pool_united.cpp b/library/cpp/actors/core/executor_pool_united.cpp index dac6245635..6950748e03 100644 --- a/library/cpp/actors/core/executor_pool_united.cpp +++ b/library/cpp/actors/core/executor_pool_united.cpp @@ -6,7 +6,7 @@ #include "probes.h" #include "mailbox.h" #include "scheduler_queue.h" -#include <library/cpp/actors/util/affinity.h> +#include <library/cpp/actors/util/affinity.h> #include <library/cpp/actors/util/datetime.h> #include <library/cpp/actors/util/futex.h> #include <library/cpp/actors/util/intrinsics.h> diff --git a/library/cpp/actors/core/executor_pool_united.h b/library/cpp/actors/core/executor_pool_united.h index a090ba2466..7b9aee74ec 100644 --- a/library/cpp/actors/core/executor_pool_united.h +++ b/library/cpp/actors/core/executor_pool_united.h @@ -5,7 +5,7 @@ #include "scheduler_queue.h" #include "executor_pool_base.h" -#include <library/cpp/actors/util/unordered_cache.h> +#include <library/cpp/actors/util/unordered_cache.h> #include <library/cpp/monlib/dynamic_counters/counters.h> #include <library/cpp/actors/util/unordered_cache.h> diff --git a/library/cpp/actors/core/executor_pool_united_ut.cpp b/library/cpp/actors/core/executor_pool_united_ut.cpp index d4df17f1b8..d6a53010c2 100644 --- a/library/cpp/actors/core/executor_pool_united_ut.cpp +++ b/library/cpp/actors/core/executor_pool_united_ut.cpp @@ -3,10 +3,10 @@ #include "hfunc.h" #include "scheduler_basic.h" -#include <library/cpp/actors/util/should_continue.h> +#include <library/cpp/actors/util/should_continue.h> #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/actors/protos/unittests.pb.h> +#include <library/cpp/actors/protos/unittests.pb.h> using namespace NActors; diff --git a/library/cpp/actors/core/executor_thread.cpp b/library/cpp/actors/core/executor_thread.cpp index 446b651efd..2d840fa32a 100644 --- a/library/cpp/actors/core/executor_thread.cpp +++ b/library/cpp/actors/core/executor_thread.cpp @@ -5,13 +5,13 @@ #include "event.h" #include "events.h" -#include <library/cpp/actors/prof/tag.h> -#include <library/cpp/actors/util/affinity.h> +#include <library/cpp/actors/prof/tag.h> +#include <library/cpp/actors/util/affinity.h> #include <library/cpp/actors/util/datetime.h> -#include <library/cpp/actors/util/thread.h> +#include <library/cpp/actors/util/thread.h> #ifdef BALLOC -#include <library/cpp/balloc/optional/operators.h> +#include <library/cpp/balloc/optional/operators.h> #endif #ifdef _linux_ diff --git a/library/cpp/actors/core/interconnect.h b/library/cpp/actors/core/interconnect.h index 679a4b8cc6..26349e4573 100644 --- a/library/cpp/actors/core/interconnect.h +++ b/library/cpp/actors/core/interconnect.h @@ -2,7 +2,7 @@ #include "events.h" #include "event_local.h" -#include <library/cpp/actors/protos/interconnect.pb.h> +#include <library/cpp/actors/protos/interconnect.pb.h> #include <util/string/cast.h> #include <util/string/builder.h> diff --git a/library/cpp/actors/core/log.h b/library/cpp/actors/core/log.h index c11a7cf3c1..071c9a2d3d 100644 --- a/library/cpp/actors/core/log.h +++ b/library/cpp/actors/core/log.h @@ -13,13 +13,13 @@ #include <util/generic/vector.h> #include <util/string/printf.h> #include <util/string/builder.h> -#include <library/cpp/logger/all.h> +#include <library/cpp/logger/all.h> #include <library/cpp/monlib/dynamic_counters/counters.h> #include <library/cpp/monlib/metrics/metric_registry.h> -#include <library/cpp/json/writer/json.h> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/json/writer/json.h> +#include <library/cpp/svnversion/svnversion.h> -#include <library/cpp/actors/memory_log/memlog.h> +#include <library/cpp/actors/memory_log/memlog.h> // TODO: limit number of messages per second // TODO: make TLogComponentLevelRequest/Response network messages diff --git a/library/cpp/actors/core/log_ut.cpp b/library/cpp/actors/core/log_ut.cpp index 09b5f88ea2..85439869bc 100644 --- a/library/cpp/actors/core/log_ut.cpp +++ b/library/cpp/actors/core/log_ut.cpp @@ -2,7 +2,7 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/actors/testlib/test_runtime.h> +#include <library/cpp/actors/testlib/test_runtime.h> using namespace NMonitoring; using namespace NActors; diff --git a/library/cpp/actors/core/mailbox.h b/library/cpp/actors/core/mailbox.h index 0bd9c4d314..b097ed0db9 100644 --- a/library/cpp/actors/core/mailbox.h +++ b/library/cpp/actors/core/mailbox.h @@ -5,7 +5,7 @@ #include "actor.h" #include "mailbox_queue_simple.h" #include "mailbox_queue_revolving.h" -#include <library/cpp/actors/util/unordered_cache.h> +#include <library/cpp/actors/util/unordered_cache.h> #include <library/cpp/threading/queue/mpsc_htswap.h> #include <library/cpp/threading/queue/mpsc_read_as_filled.h> #include <util/generic/hash.h> diff --git a/library/cpp/actors/core/mailbox_queue_revolving.h b/library/cpp/actors/core/mailbox_queue_revolving.h index b0e78a18db..8524c78856 100644 --- a/library/cpp/actors/core/mailbox_queue_revolving.h +++ b/library/cpp/actors/core/mailbox_queue_revolving.h @@ -1,7 +1,7 @@ #pragma once #include "defs.h" -#include <library/cpp/actors/util/queue_chunk.h> +#include <library/cpp/actors/util/queue_chunk.h> namespace NActors { // add some concurrency to basic queue to avoid hangs under contention (we pay with memory, so use only when really expect contention) diff --git a/library/cpp/actors/core/mailbox_queue_simple.h b/library/cpp/actors/core/mailbox_queue_simple.h index 2e44c21adb..a47f5cadcd 100644 --- a/library/cpp/actors/core/mailbox_queue_simple.h +++ b/library/cpp/actors/core/mailbox_queue_simple.h @@ -1,8 +1,8 @@ #pragma once #include "defs.h" -#include <library/cpp/actors/util/ticket_lock.h> -#include <library/cpp/actors/util/queue_oneone_inplace.h> +#include <library/cpp/actors/util/ticket_lock.h> +#include <library/cpp/actors/util/queue_oneone_inplace.h> namespace NActors { // dead-simple one-one queue, based on serializability guaranties of x64 and ticket lock to ensure writer unicity. diff --git a/library/cpp/actors/core/probes.h b/library/cpp/actors/core/probes.h index 4912d6dd26..2faeeea2e8 100644 --- a/library/cpp/actors/core/probes.h +++ b/library/cpp/actors/core/probes.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #include <util/generic/vector.h> #define LWACTORID(x) (x).RawX1(), (x).RawX2(), (x).NodeId(), (x).PoolID() diff --git a/library/cpp/actors/core/scheduler_actor.cpp b/library/cpp/actors/core/scheduler_actor.cpp index febc5e40dd..57400d2ec1 100644 --- a/library/cpp/actors/core/scheduler_actor.cpp +++ b/library/cpp/actors/core/scheduler_actor.cpp @@ -4,7 +4,7 @@ #include "scheduler_actor.h" #include "scheduler_queue.h" -#include <library/cpp/actors/interconnect/poller_actor.h> +#include <library/cpp/actors/interconnect/poller_actor.h> #include <util/system/hp_timer.h> #ifdef __linux__ diff --git a/library/cpp/actors/core/scheduler_actor_ut.cpp b/library/cpp/actors/core/scheduler_actor_ut.cpp index 09b7369d36..2a5114a57a 100644 --- a/library/cpp/actors/core/scheduler_actor_ut.cpp +++ b/library/cpp/actors/core/scheduler_actor_ut.cpp @@ -6,7 +6,7 @@ #include "events.h" #include "event_local.h" #include "hfunc.h" -#include <library/cpp/actors/interconnect/poller_actor.h> +#include <library/cpp/actors/interconnect/poller_actor.h> #include <library/cpp/testing/unittest/registar.h> #include <util/system/sanitizers.h> diff --git a/library/cpp/actors/core/scheduler_basic.cpp b/library/cpp/actors/core/scheduler_basic.cpp index fba200e16b..38d4eac1fa 100644 --- a/library/cpp/actors/core/scheduler_basic.cpp +++ b/library/cpp/actors/core/scheduler_basic.cpp @@ -2,10 +2,10 @@ #include "scheduler_queue.h" #include <library/cpp/actors/util/datetime.h> -#include <library/cpp/actors/util/thread.h> +#include <library/cpp/actors/util/thread.h> #ifdef BALLOC -#include <library/cpp/balloc/optional/operators.h> +#include <library/cpp/balloc/optional/operators.h> #endif namespace NActors { diff --git a/library/cpp/actors/core/scheduler_basic.h b/library/cpp/actors/core/scheduler_basic.h index 2ccde39235..952d16fb91 100644 --- a/library/cpp/actors/core/scheduler_basic.h +++ b/library/cpp/actors/core/scheduler_basic.h @@ -3,7 +3,7 @@ #include "actorsystem.h" #include "monotonic.h" #include "scheduler_queue.h" -#include <library/cpp/actors/util/queue_chunk.h> +#include <library/cpp/actors/util/queue_chunk.h> #include <library/cpp/threading/future/legacy_future.h> #include <util/generic/hash.h> #include <util/generic/map.h> diff --git a/library/cpp/actors/core/scheduler_queue.h b/library/cpp/actors/core/scheduler_queue.h index 3b8fac28f0..c6cdb12004 100644 --- a/library/cpp/actors/core/scheduler_queue.h +++ b/library/cpp/actors/core/scheduler_queue.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/util/queue_chunk.h> +#include <library/cpp/actors/util/queue_chunk.h> namespace NActors { class IEventHandle; diff --git a/library/cpp/actors/core/ut/ya.make b/library/cpp/actors/core/ut/ya.make index 3ee28d5850..9621339f78 100644 --- a/library/cpp/actors/core/ut/ya.make +++ b/library/cpp/actors/core/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/actors/core) +UNITTEST_FOR(library/cpp/actors/core) OWNER( alexvru @@ -24,8 +24,8 @@ ENDIF() PEERDIR( - library/cpp/actors/interconnect - library/cpp/actors/testlib + library/cpp/actors/interconnect + library/cpp/actors/testlib ) SRCS( diff --git a/library/cpp/actors/core/ya.make b/library/cpp/actors/core/ya.make index 880a9d00db..217d467b57 100644 --- a/library/cpp/actors/core/ya.make +++ b/library/cpp/actors/core/ya.make @@ -14,7 +14,7 @@ ENDIF() IF (ALLOCATOR == "B" OR ALLOCATOR == "BS" OR ALLOCATOR == "C") CXXFLAGS(-DBALLOC) PEERDIR( - library/cpp/balloc/optional + library/cpp/balloc/optional ) ENDIF() @@ -103,16 +103,16 @@ GENERATE_ENUM_SERIALIZATION(defs.h) GENERATE_ENUM_SERIALIZATION(actor.h) PEERDIR( - library/cpp/actors/memory_log - library/cpp/actors/prof - library/cpp/actors/protos - library/cpp/actors/util - library/cpp/execprofile - library/cpp/json/writer - library/cpp/logger - library/cpp/lwtrace + library/cpp/actors/memory_log + library/cpp/actors/prof + library/cpp/actors/protos + library/cpp/actors/util + library/cpp/execprofile + library/cpp/json/writer + library/cpp/logger + library/cpp/lwtrace library/cpp/monlib/dynamic_counters - library/cpp/svnversion + library/cpp/svnversion library/cpp/threading/future ) diff --git a/library/cpp/actors/dnscachelib/probes.h b/library/cpp/actors/dnscachelib/probes.h index 313b7b8712..6880de8e6c 100644 --- a/library/cpp/actors/dnscachelib/probes.h +++ b/library/cpp/actors/dnscachelib/probes.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #define DNSCACHELIB_PROVIDER(PROBE, EVENT, GROUPS, TYPES, NAMES) \ PROBE(Created, GROUPS(), TYPES(), NAMES()) \ diff --git a/library/cpp/actors/dnscachelib/ya.make b/library/cpp/actors/dnscachelib/ya.make index e3a6ad6202..9e82c72dc1 100644 --- a/library/cpp/actors/dnscachelib/ya.make +++ b/library/cpp/actors/dnscachelib/ya.make @@ -18,7 +18,7 @@ SRCS( PEERDIR( contrib/libs/c-ares - library/cpp/lwtrace + library/cpp/lwtrace ) END() diff --git a/library/cpp/actors/helpers/activeactors.h b/library/cpp/actors/helpers/activeactors.h index 0fdb0fab10..52b8fc1d39 100644 --- a/library/cpp/actors/helpers/activeactors.h +++ b/library/cpp/actors/helpers/activeactors.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/events.h> #include <util/generic/hash_set.h> namespace NActors { diff --git a/library/cpp/actors/helpers/flow_controlled_queue.cpp b/library/cpp/actors/helpers/flow_controlled_queue.cpp index d75cc54023..52c30d6a4d 100644 --- a/library/cpp/actors/helpers/flow_controlled_queue.cpp +++ b/library/cpp/actors/helpers/flow_controlled_queue.cpp @@ -1,7 +1,7 @@ #include "flow_controlled_queue.h" -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> #include <library/cpp/actors/util/datetime.h> #include <util/generic/deque.h> diff --git a/library/cpp/actors/helpers/flow_controlled_queue.h b/library/cpp/actors/helpers/flow_controlled_queue.h index d250405304..89c380bbf4 100644 --- a/library/cpp/actors/helpers/flow_controlled_queue.h +++ b/library/cpp/actors/helpers/flow_controlled_queue.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NActors { diff --git a/library/cpp/actors/helpers/future_callback.h b/library/cpp/actors/helpers/future_callback.h index 8ca0d99fda..1939d06b34 100644 --- a/library/cpp/actors/helpers/future_callback.h +++ b/library/cpp/actors/helpers/future_callback.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include <library/cpp/actors/core/hfunc.h> namespace NActors { diff --git a/library/cpp/actors/helpers/selfping_actor.cpp b/library/cpp/actors/helpers/selfping_actor.cpp index f9bfaf8dc0..e1485ddf90 100644 --- a/library/cpp/actors/helpers/selfping_actor.cpp +++ b/library/cpp/actors/helpers/selfping_actor.cpp @@ -1,10 +1,10 @@ #include "selfping_actor.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <library/cpp/containers/stack_vector/stack_vec.h> -#include <library/cpp/sliding_window/sliding_window.h> +#include <library/cpp/sliding_window/sliding_window.h> namespace NActors { diff --git a/library/cpp/actors/helpers/ya.make b/library/cpp/actors/helpers/ya.make index d8771179de..dafb8c0e17 100644 --- a/library/cpp/actors/helpers/ya.make +++ b/library/cpp/actors/helpers/ya.make @@ -13,7 +13,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/monlib/dynamic_counters ) diff --git a/library/cpp/actors/http/http_cache.cpp b/library/cpp/actors/http/http_cache.cpp index 27c4eeb6f3..e9fa22ff34 100644 --- a/library/cpp/actors/http/http_cache.cpp +++ b/library/cpp/actors/http/http_cache.cpp @@ -1,11 +1,11 @@ #include "http.h" #include "http_proxy.h" #include "http_cache.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/scheduler_basic.h> -#include <library/cpp/actors/http/http.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/http/http.h> #include <library/cpp/digest/md5/md5.h> #include <util/digest/multi.h> #include <util/generic/queue.h> diff --git a/library/cpp/actors/http/http_cache.h b/library/cpp/actors/http/http_cache.h index ac38bdcac8..e3746471cc 100644 --- a/library/cpp/actors/http/http_cache.h +++ b/library/cpp/actors/http/http_cache.h @@ -1,5 +1,5 @@ #pragma once -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include "http.h" namespace NHttp { diff --git a/library/cpp/actors/http/http_config.h b/library/cpp/actors/http/http_config.h index faeff79449..3402770eb4 100644 --- a/library/cpp/actors/http/http_config.h +++ b/library/cpp/actors/http/http_config.h @@ -1,7 +1,7 @@ #pragma once #include <util/network/sock.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/protos/services_common.pb.h> namespace NHttp { diff --git a/library/cpp/actors/http/http_proxy.h b/library/cpp/actors/http/http_proxy.h index afd0170997..868fc81e73 100644 --- a/library/cpp/actors/http/http_proxy.h +++ b/library/cpp/actors/http/http_proxy.h @@ -1,13 +1,13 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/interconnect/poller_actor.h> -#include <library/cpp/dns/cache.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/interconnect/poller_actor.h> +#include <library/cpp/dns/cache.h> #include <library/cpp/monlib/metrics/metric_registry.h> #include <util/generic/variant.h> #include "http.h" diff --git a/library/cpp/actors/http/http_static.cpp b/library/cpp/actors/http/http_static.cpp index c075c5f693..e89f5c2e44 100644 --- a/library/cpp/actors/http/http_static.cpp +++ b/library/cpp/actors/http/http_static.cpp @@ -1,10 +1,10 @@ #include "http_proxy.h" #include "http_static.h" -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/scheduler_basic.h> -#include <library/cpp/actors/http/http.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/http/http.h> +#include <library/cpp/resource/resource.h> #include <util/folder/path.h> #include <util/stream/file.h> diff --git a/library/cpp/actors/http/http_static.h b/library/cpp/actors/http/http_static.h index f91e15dfb1..04023ab1cd 100644 --- a/library/cpp/actors/http/http_static.h +++ b/library/cpp/actors/http/http_static.h @@ -1,5 +1,5 @@ #pragma once -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include "http.h" namespace NHttp { diff --git a/library/cpp/actors/http/http_ut.cpp b/library/cpp/actors/http/http_ut.cpp index 4c922f8d0f..0cd80087f7 100644 --- a/library/cpp/actors/http/http_ut.cpp +++ b/library/cpp/actors/http/http_ut.cpp @@ -1,8 +1,8 @@ #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/tests_data.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/scheduler_basic.h> -#include <library/cpp/actors/testlib/test_runtime.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/testlib/test_runtime.h> #include <util/system/tempfile.h> #include "http.h" #include "http_proxy.h" diff --git a/library/cpp/actors/http/ut/ya.make b/library/cpp/actors/http/ut/ya.make index 8b4c04c4d3..43f0b8e7e2 100644 --- a/library/cpp/actors/http/ut/ya.make +++ b/library/cpp/actors/http/ut/ya.make @@ -1,11 +1,11 @@ -UNITTEST_FOR(library/cpp/actors/http) +UNITTEST_FOR(library/cpp/actors/http) OWNER(xenoxeno) SIZE(SMALL) PEERDIR( - library/cpp/actors/testlib + library/cpp/actors/testlib ) IF (NOT OS_WINDOWS) diff --git a/library/cpp/actors/http/ya.make b/library/cpp/actors/http/ya.make index 7ce68b7a75..909a70c681 100644 --- a/library/cpp/actors/http/ya.make +++ b/library/cpp/actors/http/ya.make @@ -23,9 +23,9 @@ SRCS( PEERDIR( contrib/libs/openssl - library/cpp/actors/core - library/cpp/actors/interconnect - library/cpp/dns + library/cpp/actors/core + library/cpp/actors/interconnect + library/cpp/dns library/cpp/monlib/metrics library/cpp/string_utils/quote ) diff --git a/library/cpp/actors/interconnect/event_filter.h b/library/cpp/actors/interconnect/event_filter.h index 47dabf5f16..2c482c60b2 100644 --- a/library/cpp/actors/interconnect/event_filter.h +++ b/library/cpp/actors/interconnect/event_filter.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/event.h> +#include <library/cpp/actors/core/event.h> namespace NActors { diff --git a/library/cpp/actors/interconnect/events_local.h b/library/cpp/actors/interconnect/events_local.h index 8a46ffd535..d57fb5d444 100644 --- a/library/cpp/actors/interconnect/events_local.h +++ b/library/cpp/actors/interconnect/events_local.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/protos/interconnect.pb.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/protos/interconnect.pb.h> #include <util/generic/deque.h> #include <util/network/address.h> diff --git a/library/cpp/actors/interconnect/interconnect.h b/library/cpp/actors/interconnect/interconnect.h index 225a5243fd..6d302c09b4 100644 --- a/library/cpp/actors/interconnect/interconnect.h +++ b/library/cpp/actors/interconnect/interconnect.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/interconnect.h> #include <util/generic/map.h> #include <util/network/address.h> diff --git a/library/cpp/actors/interconnect/interconnect_channel.cpp b/library/cpp/actors/interconnect/interconnect_channel.cpp index a66ba2a154..c0323e87cb 100644 --- a/library/cpp/actors/interconnect/interconnect_channel.cpp +++ b/library/cpp/actors/interconnect/interconnect_channel.cpp @@ -1,12 +1,12 @@ #include "interconnect_channel.h" -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/executor_thread.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/executor_thread.h> +#include <library/cpp/actors/core/log.h> #include <library/cpp/actors/core/probes.h> -#include <library/cpp/actors/protos/services_common.pb.h> -#include <library/cpp/actors/prof/tag.h> -#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/prof/tag.h> +#include <library/cpp/digest/crc32c/crc32c.h> LWTRACE_USING(ACTORLIB_PROVIDER); diff --git a/library/cpp/actors/interconnect/interconnect_channel.h b/library/cpp/actors/interconnect/interconnect_channel.h index e4a0ae3cda..edaa82ba95 100644 --- a/library/cpp/actors/interconnect/interconnect_channel.h +++ b/library/cpp/actors/interconnect/interconnect_channel.h @@ -1,15 +1,15 @@ #pragma once #include <library/cpp/monlib/dynamic_counters/counters.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/event_load.h> -#include <library/cpp/actors/util/rope.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/event_load.h> +#include <library/cpp/actors/util/rope.h> #include <util/generic/deque.h> #include <util/generic/vector.h> #include <util/generic/map.h> #include <util/stream/walk.h> -#include <library/cpp/actors/wilson/wilson_event.h> -#include <library/cpp/actors/helpers/mon_histogram_helper.h> +#include <library/cpp/actors/wilson/wilson_event.h> +#include <library/cpp/actors/helpers/mon_histogram_helper.h> #include "interconnect_common.h" #include "interconnect_counters.h" diff --git a/library/cpp/actors/interconnect/interconnect_common.h b/library/cpp/actors/interconnect/interconnect_common.h index 285709a00c..0cc545fcc7 100644 --- a/library/cpp/actors/interconnect/interconnect_common.h +++ b/library/cpp/actors/interconnect/interconnect_common.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actorid.h> -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actorsystem.h> #include <library/cpp/actors/util/datetime.h> #include <library/cpp/monlib/dynamic_counters/counters.h> #include <library/cpp/monlib/metrics/metric_registry.h> diff --git a/library/cpp/actors/interconnect/interconnect_handshake.cpp b/library/cpp/actors/interconnect/interconnect_handshake.cpp index 9ede998d8e..d7196b142f 100644 --- a/library/cpp/actors/interconnect/interconnect_handshake.cpp +++ b/library/cpp/actors/interconnect/interconnect_handshake.cpp @@ -1,9 +1,9 @@ #include "interconnect_handshake.h" #include "interconnect_tcp_proxy.h" -#include <library/cpp/actors/core/actor_coroutine.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/actor_coroutine.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <util/system/getpid.h> #include <google/protobuf/text_format.h> diff --git a/library/cpp/actors/interconnect/interconnect_handshake.h b/library/cpp/actors/interconnect/interconnect_handshake.h index b3c0db6c5d..98608c6675 100644 --- a/library/cpp/actors/interconnect/interconnect_handshake.h +++ b/library/cpp/actors/interconnect/interconnect_handshake.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/events.h> #include "interconnect_common.h" #include "interconnect_impl.h" diff --git a/library/cpp/actors/interconnect/interconnect_impl.h b/library/cpp/actors/interconnect/interconnect_impl.h index ee29e4d397..0787b3dfb1 100644 --- a/library/cpp/actors/interconnect/interconnect_impl.h +++ b/library/cpp/actors/interconnect/interconnect_impl.h @@ -1,9 +1,9 @@ #pragma once #include "interconnect.h" -#include <library/cpp/actors/protos/interconnect.pb.h> -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/helpers/mon_histogram_helper.h> +#include <library/cpp/actors/protos/interconnect.pb.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/helpers/mon_histogram_helper.h> #include <library/cpp/monlib/dynamic_counters/counters.h> namespace NActors { diff --git a/library/cpp/actors/interconnect/interconnect_mon.h b/library/cpp/actors/interconnect/interconnect_mon.h index 3fb26053fb..1150a22ca8 100644 --- a/library/cpp/actors/interconnect/interconnect_mon.h +++ b/library/cpp/actors/interconnect/interconnect_mon.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include "interconnect_common.h" namespace NInterconnect { diff --git a/library/cpp/actors/interconnect/interconnect_nameserver_table.cpp b/library/cpp/actors/interconnect/interconnect_nameserver_table.cpp index 43419bf70d..ed66bbce0b 100644 --- a/library/cpp/actors/interconnect/interconnect_nameserver_table.cpp +++ b/library/cpp/actors/interconnect/interconnect_nameserver_table.cpp @@ -4,8 +4,8 @@ #include "interconnect_nameserver_base.h" #include "events_local.h" -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/memory_log/memlog.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/memory_log/memlog.h> namespace NActors { diff --git a/library/cpp/actors/interconnect/interconnect_stream.cpp b/library/cpp/actors/interconnect/interconnect_stream.cpp index 158ebc9e1d..feeba23880 100644 --- a/library/cpp/actors/interconnect/interconnect_stream.cpp +++ b/library/cpp/actors/interconnect/interconnect_stream.cpp @@ -1,6 +1,6 @@ #include "interconnect_stream.h" #include "logging.h" -#include <library/cpp/openssl/init/init.h> +#include <library/cpp/openssl/init/init.h> #include <util/network/socket.h> #include <openssl/ssl.h> #include <openssl/err.h> diff --git a/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp b/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp index 0abe9fe659..cd7d337f41 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp +++ b/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp @@ -1,6 +1,6 @@ #include "interconnect_tcp_session.h" #include "interconnect_tcp_proxy.h" -#include <library/cpp/actors/core/probes.h> +#include <library/cpp/actors/core/probes.h> #include <library/cpp/actors/util/datetime.h> namespace NActors { diff --git a/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp b/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp index 7e2d8ccb94..183949d29e 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp +++ b/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp @@ -1,8 +1,8 @@ #include "interconnect_tcp_proxy.h" #include "interconnect_handshake.h" #include "interconnect_tcp_session.h" -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <library/cpp/monlib/service/pages/templates.h> #include <util/system/getpid.h> diff --git a/library/cpp/actors/interconnect/interconnect_tcp_proxy.h b/library/cpp/actors/interconnect/interconnect_tcp_proxy.h index 023e5bd1ee..80dfca7e78 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_proxy.h +++ b/library/cpp/actors/interconnect/interconnect_tcp_proxy.h @@ -1,9 +1,9 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/events.h> #include <library/cpp/monlib/dynamic_counters/counters.h> #include "interconnect_common.h" diff --git a/library/cpp/actors/interconnect/interconnect_tcp_server.cpp b/library/cpp/actors/interconnect/interconnect_tcp_server.cpp index b95c994598..9e4845475f 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_server.cpp +++ b/library/cpp/actors/interconnect/interconnect_tcp_server.cpp @@ -1,8 +1,8 @@ #include "interconnect_tcp_server.h" #include "interconnect_handshake.h" -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include "interconnect_common.h" diff --git a/library/cpp/actors/interconnect/interconnect_tcp_server.h b/library/cpp/actors/interconnect/interconnect_tcp_server.h index fc71073c2d..3870cb7091 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_server.h +++ b/library/cpp/actors/interconnect/interconnect_tcp_server.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/events.h> #include "interconnect_common.h" #include "poller_actor.h" diff --git a/library/cpp/actors/interconnect/interconnect_tcp_session.cpp b/library/cpp/actors/interconnect/interconnect_tcp_session.cpp index 2ded7f9f53..cebfdcbb50 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_session.cpp +++ b/library/cpp/actors/interconnect/interconnect_tcp_session.cpp @@ -2,11 +2,11 @@ #include "interconnect_tcp_session.h" #include "interconnect_handshake.h" -#include <library/cpp/actors/core/probes.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/probes.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/interconnect.h> #include <library/cpp/actors/util/datetime.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <library/cpp/monlib/service/pages/templates.h> namespace NActors { diff --git a/library/cpp/actors/interconnect/interconnect_tcp_session.h b/library/cpp/actors/interconnect/interconnect_tcp_session.h index 7fc00dbcc5..4d93a30937 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_session.h +++ b/library/cpp/actors/interconnect/interconnect_tcp_session.h @@ -1,17 +1,17 @@ #pragma once -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/helpers/mon_histogram_helper.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/helpers/mon_histogram_helper.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <library/cpp/actors/util/datetime.h> -#include <library/cpp/actors/util/rope.h> -#include <library/cpp/actors/util/funnel_queue.h> -#include <library/cpp/actors/util/recentwnd.h> +#include <library/cpp/actors/util/rope.h> +#include <library/cpp/actors/util/funnel_queue.h> +#include <library/cpp/actors/util/recentwnd.h> #include <library/cpp/monlib/dynamic_counters/counters.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <util/generic/queue.h> #include <util/generic/deque.h> diff --git a/library/cpp/actors/interconnect/load.cpp b/library/cpp/actors/interconnect/load.cpp index 2a8443da71..ae9a2d85d6 100644 --- a/library/cpp/actors/interconnect/load.cpp +++ b/library/cpp/actors/interconnect/load.cpp @@ -1,11 +1,11 @@ #include "load.h" #include "interconnect_common.h" #include "events_local.h" -#include <library/cpp/actors/protos/services_common.pb.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/queue.h> namespace NInterconnect { diff --git a/library/cpp/actors/interconnect/load.h b/library/cpp/actors/interconnect/load.h index 0a01a0dc04..258b035f67 100644 --- a/library/cpp/actors/interconnect/load.h +++ b/library/cpp/actors/interconnect/load.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NInterconnect { // load responder -- lives on every node as a service actor diff --git a/library/cpp/actors/interconnect/logging.h b/library/cpp/actors/interconnect/logging.h index c429d1cade..5dd16f3b62 100644 --- a/library/cpp/actors/interconnect/logging.h +++ b/library/cpp/actors/interconnect/logging.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/protos/services_common.pb.h> #define LOG_LOG_IC_X(component, marker, priority, ...) \ do { \ diff --git a/library/cpp/actors/interconnect/packet.h b/library/cpp/actors/interconnect/packet.h index 4ba50a2b5f..6a640f98a3 100644 --- a/library/cpp/actors/interconnect/packet.h +++ b/library/cpp/actors/interconnect/packet.h @@ -1,13 +1,13 @@ #pragma once -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/core/event_load.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/event_load.h> #include <library/cpp/actors/core/events.h> #include <library/cpp/actors/core/actor.h> #include <library/cpp/containers/stack_vector/stack_vec.h> -#include <library/cpp/actors/util/rope.h> -#include <library/cpp/actors/prof/tag.h> -#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/actors/util/rope.h> +#include <library/cpp/actors/prof/tag.h> +#include <library/cpp/digest/crc32c/crc32c.h> #include <library/cpp/lwtrace/shuttle.h> #include <util/generic/string.h> #include <util/generic/list.h> diff --git a/library/cpp/actors/interconnect/poller.h b/library/cpp/actors/interconnect/poller.h index ff7979369f..ce48d6f2cb 100644 --- a/library/cpp/actors/interconnect/poller.h +++ b/library/cpp/actors/interconnect/poller.h @@ -1,7 +1,7 @@ #pragma once #include <functional> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/events.h> namespace NActors { class TSharedDescriptor: public TThrRefBase { diff --git a/library/cpp/actors/interconnect/poller_actor.cpp b/library/cpp/actors/interconnect/poller_actor.cpp index e75cbcaef4..b2c41d8afc 100644 --- a/library/cpp/actors/interconnect/poller_actor.cpp +++ b/library/cpp/actors/interconnect/poller_actor.cpp @@ -2,12 +2,12 @@ #include "interconnect_common.h" #include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> #include <library/cpp/actors/core/probes.h> #include <library/cpp/actors/protos/services_common.pb.h> -#include <library/cpp/actors/util/funnel_queue.h> +#include <library/cpp/actors/util/funnel_queue.h> #include <util/generic/intrlist.h> #include <util/system/thread.h> diff --git a/library/cpp/actors/interconnect/poller_actor.h b/library/cpp/actors/interconnect/poller_actor.h index f927b82089..b0291b25c6 100644 --- a/library/cpp/actors/interconnect/poller_actor.h +++ b/library/cpp/actors/interconnect/poller_actor.h @@ -2,7 +2,7 @@ #include "events_local.h" #include "poller.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NActors { struct TEvPollerRegister : TEventLocal<TEvPollerRegister, ui32(ENetwork::EvPollerRegister)> { diff --git a/library/cpp/actors/interconnect/poller_tcp_unit.cpp b/library/cpp/actors/interconnect/poller_tcp_unit.cpp index 59e7dda810..9f6b9d3d82 100644 --- a/library/cpp/actors/interconnect/poller_tcp_unit.cpp +++ b/library/cpp/actors/interconnect/poller_tcp_unit.cpp @@ -7,8 +7,8 @@ #include "poller_tcp_unit_select.h" #include "poller.h" -#include <library/cpp/actors/prof/tag.h> -#include <library/cpp/actors/util/intrinsics.h> +#include <library/cpp/actors/prof/tag.h> +#include <library/cpp/actors/util/intrinsics.h> #if defined _linux_ #include <pthread.h> diff --git a/library/cpp/actors/interconnect/poller_tcp_unit.h b/library/cpp/actors/interconnect/poller_tcp_unit.h index 692168b968..e0154719bc 100644 --- a/library/cpp/actors/interconnect/poller_tcp_unit.h +++ b/library/cpp/actors/interconnect/poller_tcp_unit.h @@ -1,7 +1,7 @@ #pragma once #include <util/system/thread.h> -#include <library/cpp/actors/util/funnel_queue.h> +#include <library/cpp/actors/util/funnel_queue.h> #include "interconnect_stream.h" diff --git a/library/cpp/actors/interconnect/slowpoke_actor.h b/library/cpp/actors/interconnect/slowpoke_actor.h index 4b02e5da48..884cabc321 100644 --- a/library/cpp/actors/interconnect/slowpoke_actor.h +++ b/library/cpp/actors/interconnect/slowpoke_actor.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> namespace NActors { diff --git a/library/cpp/actors/interconnect/ut/channel_scheduler_ut.cpp b/library/cpp/actors/interconnect/ut/channel_scheduler_ut.cpp index 565a511859..156725eb85 100644 --- a/library/cpp/actors/interconnect/ut/channel_scheduler_ut.cpp +++ b/library/cpp/actors/interconnect/ut/channel_scheduler_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/actors/interconnect/channel_scheduler.h> -#include <library/cpp/actors/interconnect/events_local.h> +#include <library/cpp/actors/interconnect/channel_scheduler.h> +#include <library/cpp/actors/interconnect/events_local.h> #include <library/cpp/testing/unittest/registar.h> using namespace NActors; diff --git a/library/cpp/actors/interconnect/ut/event_holder_pool_ut.cpp b/library/cpp/actors/interconnect/ut/event_holder_pool_ut.cpp index e6b2bd4e4c..0ee45288fc 100644 --- a/library/cpp/actors/interconnect/ut/event_holder_pool_ut.cpp +++ b/library/cpp/actors/interconnect/ut/event_holder_pool_ut.cpp @@ -1,9 +1,9 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/interconnect/interconnect_common.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/interconnect/interconnect_common.h> #include <library/cpp/monlib/dynamic_counters/counters.h> -#include <library/cpp/actors/interconnect/event_holder_pool.h> +#include <library/cpp/actors/interconnect/event_holder_pool.h> #include <atomic> diff --git a/library/cpp/actors/interconnect/ut/large.cpp b/library/cpp/actors/interconnect/ut/large.cpp index ba2a50c6f6..57d199b9f8 100644 --- a/library/cpp/actors/interconnect/ut/large.cpp +++ b/library/cpp/actors/interconnect/ut/large.cpp @@ -2,7 +2,7 @@ #include "lib/test_events.h" #include "lib/test_actors.h" -#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> #include <library/cpp/testing/unittest/tests_data.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/actors/interconnect/ut/lib/ic_test_cluster.h b/library/cpp/actors/interconnect/ut/lib/ic_test_cluster.h index 2b6d27cd3f..84c739b612 100644 --- a/library/cpp/actors/interconnect/ut/lib/ic_test_cluster.h +++ b/library/cpp/actors/interconnect/ut/lib/ic_test_cluster.h @@ -3,8 +3,8 @@ #include "node.h" #include "interrupter.h" -#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> +#include <library/cpp/actors/core/events.h> #include <library/cpp/testing/unittest/tests_data.h> #include <util/generic/noncopyable.h> diff --git a/library/cpp/actors/interconnect/ut/lib/node.h b/library/cpp/actors/interconnect/ut/lib/node.h index ff30b1445e..41ba59a03d 100644 --- a/library/cpp/actors/interconnect/ut/lib/node.h +++ b/library/cpp/actors/interconnect/ut/lib/node.h @@ -1,13 +1,13 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/scheduler_basic.h> #include <library/cpp/actors/core/mailbox.h> #include <library/cpp/actors/dnsresolver/dnsresolver.h> -#include <library/cpp/actors/interconnect/interconnect_tcp_server.h> -#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_server.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> #include <library/cpp/actors/interconnect/interconnect_proxy_wrapper.h> using namespace NActors; diff --git a/library/cpp/actors/interconnect/ut/lib/test_events.h b/library/cpp/actors/interconnect/ut/lib/test_events.h index cd0d9e0152..ecb59a6628 100644 --- a/library/cpp/actors/interconnect/ut/lib/test_events.h +++ b/library/cpp/actors/interconnect/ut/lib/test_events.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/interconnect/ut/protos/interconnect_test.pb.h> +#include <library/cpp/actors/interconnect/ut/protos/interconnect_test.pb.h> namespace NActors { enum { diff --git a/library/cpp/actors/interconnect/ut/ya.make b/library/cpp/actors/interconnect/ut/ya.make index 2f5b13352e..7cb3169a4d 100644 --- a/library/cpp/actors/interconnect/ut/ya.make +++ b/library/cpp/actors/interconnect/ut/ya.make @@ -24,10 +24,10 @@ SRCS( ) PEERDIR( - library/cpp/actors/core - library/cpp/actors/interconnect - library/cpp/actors/interconnect/ut/lib - library/cpp/actors/interconnect/ut/protos + library/cpp/actors/core + library/cpp/actors/interconnect + library/cpp/actors/interconnect/ut/lib + library/cpp/actors/interconnect/ut/protos library/cpp/actors/testlib library/cpp/digest/md5 library/cpp/testing/unittest diff --git a/library/cpp/actors/interconnect/ut_fat/main.cpp b/library/cpp/actors/interconnect/ut_fat/main.cpp index 5d19bc3003..7ff80ef8e5 100644 --- a/library/cpp/actors/interconnect/ut_fat/main.cpp +++ b/library/cpp/actors/interconnect/ut_fat/main.cpp @@ -1,11 +1,11 @@ -#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> -#include <library/cpp/actors/interconnect/ut/protos/interconnect_test.pb.h> -#include <library/cpp/actors/interconnect/ut/lib/ic_test_cluster.h> -#include <library/cpp/actors/interconnect/ut/lib/interrupter.h> -#include <library/cpp/actors/interconnect/ut/lib/test_events.h> -#include <library/cpp/actors/interconnect/ut/lib/test_actors.h> -#include <library/cpp/actors/interconnect/ut/lib/node.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> +#include <library/cpp/actors/interconnect/ut/protos/interconnect_test.pb.h> +#include <library/cpp/actors/interconnect/ut/lib/ic_test_cluster.h> +#include <library/cpp/actors/interconnect/ut/lib/interrupter.h> +#include <library/cpp/actors/interconnect/ut/lib/test_events.h> +#include <library/cpp/actors/interconnect/ut/lib/test_actors.h> +#include <library/cpp/actors/interconnect/ut/lib/node.h> #include <library/cpp/testing/unittest/tests_data.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/actors/interconnect/ut_fat/ya.make b/library/cpp/actors/interconnect/ut_fat/ya.make index 6e58d08154..40c7c971e1 100644 --- a/library/cpp/actors/interconnect/ut_fat/ya.make +++ b/library/cpp/actors/interconnect/ut_fat/ya.make @@ -14,11 +14,11 @@ SRCS( ) PEERDIR( - library/cpp/actors/core - library/cpp/actors/interconnect + library/cpp/actors/core + library/cpp/actors/interconnect library/cpp/actors/interconnect/mock - library/cpp/actors/interconnect/ut/lib - library/cpp/actors/interconnect/ut/protos + library/cpp/actors/interconnect/ut/lib + library/cpp/actors/interconnect/ut/protos library/cpp/testing/unittest ) diff --git a/library/cpp/actors/interconnect/ya.make b/library/cpp/actors/interconnect/ya.make index 60d29b0fc0..df26c59353 100644 --- a/library/cpp/actors/interconnect/ya.make +++ b/library/cpp/actors/interconnect/ya.make @@ -74,21 +74,21 @@ ENDIF() PEERDIR( contrib/libs/libc_compat contrib/libs/openssl - library/cpp/actors/core + library/cpp/actors/core library/cpp/actors/dnscachelib library/cpp/actors/dnsresolver - library/cpp/actors/helpers - library/cpp/actors/prof - library/cpp/actors/protos - library/cpp/actors/util - library/cpp/digest/crc32c + library/cpp/actors/helpers + library/cpp/actors/prof + library/cpp/actors/protos + library/cpp/actors/util + library/cpp/digest/crc32c library/cpp/json - library/cpp/lwtrace + library/cpp/lwtrace library/cpp/monlib/dynamic_counters library/cpp/monlib/metrics library/cpp/monlib/service/pages/tablesorter - library/cpp/openssl/init - library/cpp/packedtypes + library/cpp/openssl/init + library/cpp/packedtypes ) END() diff --git a/library/cpp/actors/prof/tag.cpp b/library/cpp/actors/prof/tag.cpp index 9ccf03e1a9..f2452f3fed 100644 --- a/library/cpp/actors/prof/tag.cpp +++ b/library/cpp/actors/prof/tag.cpp @@ -1,8 +1,8 @@ #include "tag.h" #include "tcmalloc.h" -#include <library/cpp/charset/ci_string.h> -#include <library/cpp/containers/atomizer/atomizer.h> +#include <library/cpp/charset/ci_string.h> +#include <library/cpp/containers/atomizer/atomizer.h> #include <library/cpp/malloc/api/malloc.h> #if defined(PROFILE_MEMORY_ALLOCATIONS) diff --git a/library/cpp/actors/prof/ut/ya.make b/library/cpp/actors/prof/ut/ya.make index 47c58a8fb7..bb964c5385 100644 --- a/library/cpp/actors/prof/ut/ya.make +++ b/library/cpp/actors/prof/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/actors/prof) +UNITTEST_FOR(library/cpp/actors/prof) OWNER( agri diff --git a/library/cpp/actors/prof/ya.make b/library/cpp/actors/prof/ya.make index b5e2497563..e19ef01820 100644 --- a/library/cpp/actors/prof/ya.make +++ b/library/cpp/actors/prof/ya.make @@ -10,14 +10,14 @@ SRCS( ) PEERDIR( - library/cpp/charset - library/cpp/containers/atomizer + library/cpp/charset + library/cpp/containers/atomizer ) IF (PROFILE_MEMORY_ALLOCATIONS) CFLAGS(-DPROFILE_MEMORY_ALLOCATIONS) PEERDIR( - library/cpp/malloc/api + library/cpp/malloc/api library/cpp/lfalloc/dbg_info library/cpp/ytalloc/api ) diff --git a/library/cpp/actors/protos/interconnect.proto b/library/cpp/actors/protos/interconnect.proto index 2e3b0d0d15..316ccdcd65 100644 --- a/library/cpp/actors/protos/interconnect.proto +++ b/library/cpp/actors/protos/interconnect.proto @@ -1,4 +1,4 @@ -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "google/protobuf/descriptor.proto"; package NActorsInterconnect; diff --git a/library/cpp/actors/testlib/test_runtime.cpp b/library/cpp/actors/testlib/test_runtime.cpp index 6fa25b9965..458f6ec51a 100644 --- a/library/cpp/actors/testlib/test_runtime.cpp +++ b/library/cpp/actors/testlib/test_runtime.cpp @@ -1,16 +1,16 @@ #include "test_runtime.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/callstack.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/executor_pool_io.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/callstack.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/executor_pool_io.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/scheduler_basic.h> #include <library/cpp/actors/util/datetime.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <library/cpp/random_provider/random_provider.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> #include <library/cpp/actors/interconnect/interconnect_proxy_wrapper.h> #include <util/generic/maybe.h> diff --git a/library/cpp/actors/testlib/test_runtime.h b/library/cpp/actors/testlib/test_runtime.h index 26e3b45c98..a68da49167 100644 --- a/library/cpp/actors/testlib/test_runtime.h +++ b/library/cpp/actors/testlib/test_runtime.h @@ -1,13 +1,13 @@ #pragma once -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/executor_thread.h> -#include <library/cpp/actors/core/mailbox.h> -#include <library/cpp/actors/util/should_continue.h> -#include <library/cpp/actors/interconnect/poller_tcp.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/executor_thread.h> +#include <library/cpp/actors/core/mailbox.h> +#include <library/cpp/actors/util/should_continue.h> +#include <library/cpp/actors/interconnect/poller_tcp.h> #include <library/cpp/actors/interconnect/mock/ic_mock.h> #include <library/cpp/random_provider/random_provider.h> #include <library/cpp/time_provider/time_provider.h> diff --git a/library/cpp/actors/testlib/ya.make b/library/cpp/actors/testlib/ya.make index 1afb3f6059..dedd349668 100644 --- a/library/cpp/actors/testlib/ya.make +++ b/library/cpp/actors/testlib/ya.make @@ -9,9 +9,9 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/actors/interconnect/mock - library/cpp/actors/protos + library/cpp/actors/protos library/cpp/random_provider library/cpp/time_provider ) diff --git a/library/cpp/actors/util/ut/ya.make b/library/cpp/actors/util/ut/ya.make index 3b08b77984..c4cabb9b03 100644 --- a/library/cpp/actors/util/ut/ya.make +++ b/library/cpp/actors/util/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/actors/util) +UNITTEST_FOR(library/cpp/actors/util) IF (WITH_VALGRIND) TIMEOUT(600) diff --git a/library/cpp/actors/wilson/wilson_event.h b/library/cpp/actors/wilson/wilson_event.h index 7d89c33b51..ec3a096bc5 100644 --- a/library/cpp/actors/wilson/wilson_event.h +++ b/library/cpp/actors/wilson/wilson_event.h @@ -4,7 +4,7 @@ #include <library/cpp/string_utils/base64/base64.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> namespace NWilson { #if !defined(_win_) diff --git a/library/cpp/archive/ut/ya.make b/library/cpp/archive/ut/ya.make index 4f324ccfc6..0d33a63c11 100644 --- a/library/cpp/archive/ut/ya.make +++ b/library/cpp/archive/ut/ya.make @@ -3,10 +3,10 @@ UNITTEST() OWNER(pg) PEERDIR( - ADDINCL library/cpp/archive + ADDINCL library/cpp/archive ) -SRCDIR(library/cpp/archive) +SRCDIR(library/cpp/archive) SRCS( yarchive_ut.cpp diff --git a/library/cpp/balloc/balloc.cpp b/library/cpp/balloc/balloc.cpp index fab489db4c..cdf32632d3 100644 --- a/library/cpp/balloc/balloc.cpp +++ b/library/cpp/balloc/balloc.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/balloc/lib/balloc.h> +#include <library/cpp/balloc/lib/balloc.h> #include <errno.h> namespace NBalloc { diff --git a/library/cpp/balloc/malloc-info.cpp b/library/cpp/balloc/malloc-info.cpp index 604b1fb145..cfdd20d127 100644 --- a/library/cpp/balloc/malloc-info.cpp +++ b/library/cpp/balloc/malloc-info.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/malloc/api/malloc.h> #include <string.h> diff --git a/library/cpp/balloc/optional/operators.h b/library/cpp/balloc/optional/operators.h index 6107d28a6e..fef01120c0 100644 --- a/library/cpp/balloc/optional/operators.h +++ b/library/cpp/balloc/optional/operators.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/malloc/api/malloc.h> #include <util/string/type.h> inline bool BallocEnabled() { diff --git a/library/cpp/balloc/optional/ya.make b/library/cpp/balloc/optional/ya.make index f740fc0b7d..b50758e787 100644 --- a/library/cpp/balloc/optional/ya.make +++ b/library/cpp/balloc/optional/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/malloc/api + library/cpp/malloc/api ) END() diff --git a/library/cpp/balloc/ya.make b/library/cpp/balloc/ya.make index d4457fbba9..adba9190bd 100644 --- a/library/cpp/balloc/ya.make +++ b/library/cpp/balloc/ya.make @@ -19,7 +19,7 @@ ELSE() ) PEERDIR( - library/cpp/balloc/lib + library/cpp/balloc/lib ) ENDIF() diff --git a/library/cpp/binsaver/ut/binsaver_ut.cpp b/library/cpp/binsaver/ut/binsaver_ut.cpp index 37eba5406f..edd17fb58b 100644 --- a/library/cpp/binsaver/ut/binsaver_ut.cpp +++ b/library/cpp/binsaver/ut/binsaver_ut.cpp @@ -1,7 +1,7 @@ -#include <library/cpp/binsaver/util_stream_io.h> -#include <library/cpp/binsaver/mem_io.h> -#include <library/cpp/binsaver/bin_saver.h> -#include <library/cpp/binsaver/ut_util/ut_util.h> +#include <library/cpp/binsaver/util_stream_io.h> +#include <library/cpp/binsaver/mem_io.h> +#include <library/cpp/binsaver/bin_saver.h> +#include <library/cpp/binsaver/ut_util/ut_util.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/buffer.h> diff --git a/library/cpp/binsaver/ut/ya.make b/library/cpp/binsaver/ut/ya.make index 43dc20bff7..7e3fb5c1ba 100644 --- a/library/cpp/binsaver/ut/ya.make +++ b/library/cpp/binsaver/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/binsaver) +UNITTEST_FOR(library/cpp/binsaver) OWNER(gulin) @@ -6,6 +6,6 @@ SRCS( binsaver_ut.cpp ) -PEERDIR(library/cpp/binsaver/ut_util) +PEERDIR(library/cpp/binsaver/ut_util) END() diff --git a/library/cpp/binsaver/ut_util/ut_util.h b/library/cpp/binsaver/ut_util/ut_util.h index 52e7bcf8e1..e07a4f6fe5 100644 --- a/library/cpp/binsaver/ut_util/ut_util.h +++ b/library/cpp/binsaver/ut_util/ut_util.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/binsaver/bin_saver.h> -#include <library/cpp/binsaver/mem_io.h> -#include <library/cpp/binsaver/util_stream_io.h> +#include <library/cpp/binsaver/bin_saver.h> +#include <library/cpp/binsaver/mem_io.h> +#include <library/cpp/binsaver/util_stream_io.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/binsaver/ut_util/ya.make b/library/cpp/binsaver/ut_util/ya.make index 7e60f13ef3..6023a2cd8e 100644 --- a/library/cpp/binsaver/ut_util/ya.make +++ b/library/cpp/binsaver/ut_util/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/binsaver + library/cpp/binsaver library/cpp/testing/unittest ) diff --git a/library/cpp/bit_io/bitoutput.h b/library/cpp/bit_io/bitoutput.h index 2b886c1f02..255b93c0a0 100644 --- a/library/cpp/bit_io/bitoutput.h +++ b/library/cpp/bit_io/bitoutput.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/deprecated/accessors/accessors.h> +#include <library/cpp/deprecated/accessors/accessors.h> #include <util/stream/output.h> #include <util/system/yassert.h> diff --git a/library/cpp/bit_io/ut/ya.make b/library/cpp/bit_io/ut/ya.make index 07ee5b4997..73ae39ff04 100644 --- a/library/cpp/bit_io/ut/ya.make +++ b/library/cpp/bit_io/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/bit_io) +UNITTEST_FOR(library/cpp/bit_io) OWNER( velavokr diff --git a/library/cpp/bit_io/ya.make b/library/cpp/bit_io/ya.make index df1de81ff9..fc3359138d 100644 --- a/library/cpp/bit_io/ya.make +++ b/library/cpp/bit_io/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/deprecated/accessors + library/cpp/deprecated/accessors ) SRCS( diff --git a/library/cpp/blockcodecs/README.md b/library/cpp/blockcodecs/README.md index 417917a475..b1f0d884c9 100644 --- a/library/cpp/blockcodecs/README.md +++ b/library/cpp/blockcodecs/README.md @@ -1,5 +1,5 @@ This is a simple library for block data compression (this means data is compressed/uncompressed -by whole blocks in memory). It's a lite-version of the `library/cpp/codecs`. Lite here means that it +by whole blocks in memory). It's a lite-version of the `library/cpp/codecs`. Lite here means that it provide only well-known compression algorithms, without the possibility of learning. There are two possible ways to work with it. @@ -19,5 +19,5 @@ write to the resulting stream). Using codec plugins =================== If you don't want your code to bloat from unused codecs, you can use the small version of the -library: `library/cpp/blockcodecs/core`. In that case, you need to manually set `PEERDIR()`s to -needed codecs (i.e. `PEERDIR(library/cpp/blockcodecs/codecs/lzma)`). +library: `library/cpp/blockcodecs/core`. In that case, you need to manually set `PEERDIR()`s to +needed codecs (i.e. `PEERDIR(library/cpp/blockcodecs/codecs/lzma)`). diff --git a/library/cpp/blockcodecs/codecs.h b/library/cpp/blockcodecs/codecs.h index fd499b54b0..8d9ae42722 100644 --- a/library/cpp/blockcodecs/codecs.h +++ b/library/cpp/blockcodecs/codecs.h @@ -1,3 +1,3 @@ #pragma once -#include <library/cpp/blockcodecs/core/codecs.h> +#include <library/cpp/blockcodecs/core/codecs.h> diff --git a/library/cpp/blockcodecs/codecs/brotli/brotli.cpp b/library/cpp/blockcodecs/codecs/brotli/brotli.cpp index 6e3cd971bd..ff7d413105 100644 --- a/library/cpp/blockcodecs/codecs/brotli/brotli.cpp +++ b/library/cpp/blockcodecs/codecs/brotli/brotli.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/blockcodecs/core/codecs.h> -#include <library/cpp/blockcodecs/core/common.h> -#include <library/cpp/blockcodecs/core/register.h> +#include <library/cpp/blockcodecs/core/codecs.h> +#include <library/cpp/blockcodecs/core/common.h> +#include <library/cpp/blockcodecs/core/register.h> #include <contrib/libs/brotli/include/brotli/encode.h> #include <contrib/libs/brotli/include/brotli/decode.h> diff --git a/library/cpp/blockcodecs/codecs/brotli/ya.make b/library/cpp/blockcodecs/codecs/brotli/ya.make index 17aff0bb72..dfe81fa403 100644 --- a/library/cpp/blockcodecs/codecs/brotli/ya.make +++ b/library/cpp/blockcodecs/codecs/brotli/ya.make @@ -5,7 +5,7 @@ OWNER(pg) PEERDIR( contrib/libs/brotli/enc contrib/libs/brotli/dec - library/cpp/blockcodecs/core + library/cpp/blockcodecs/core ) SRCS( diff --git a/library/cpp/blockcodecs/codecs/bzip/bzip.cpp b/library/cpp/blockcodecs/codecs/bzip/bzip.cpp index 3a5cfdd0e9..645ed27421 100644 --- a/library/cpp/blockcodecs/codecs/bzip/bzip.cpp +++ b/library/cpp/blockcodecs/codecs/bzip/bzip.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/blockcodecs/core/codecs.h> -#include <library/cpp/blockcodecs/core/common.h> -#include <library/cpp/blockcodecs/core/register.h> +#include <library/cpp/blockcodecs/core/codecs.h> +#include <library/cpp/blockcodecs/core/common.h> +#include <library/cpp/blockcodecs/core/register.h> #include <contrib/libs/libbz2/bzlib.h> diff --git a/library/cpp/blockcodecs/codecs/bzip/ya.make b/library/cpp/blockcodecs/codecs/bzip/ya.make index f0a8aefd62..c2dd3d29d6 100644 --- a/library/cpp/blockcodecs/codecs/bzip/ya.make +++ b/library/cpp/blockcodecs/codecs/bzip/ya.make @@ -4,7 +4,7 @@ OWNER(pg) PEERDIR( contrib/libs/libbz2 - library/cpp/blockcodecs/core + library/cpp/blockcodecs/core ) SRCS( diff --git a/library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp b/library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp index da2831fbd2..f90e9d31ad 100644 --- a/library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp +++ b/library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/blockcodecs/core/codecs.h> -#include <library/cpp/blockcodecs/core/common.h> -#include <library/cpp/blockcodecs/core/register.h> +#include <library/cpp/blockcodecs/core/codecs.h> +#include <library/cpp/blockcodecs/core/common.h> +#include <library/cpp/blockcodecs/core/register.h> #include <contrib/libs/fastlz/fastlz.h> diff --git a/library/cpp/blockcodecs/codecs/fastlz/ya.make b/library/cpp/blockcodecs/codecs/fastlz/ya.make index 59c09b329b..6f6c7250c0 100644 --- a/library/cpp/blockcodecs/codecs/fastlz/ya.make +++ b/library/cpp/blockcodecs/codecs/fastlz/ya.make @@ -4,7 +4,7 @@ OWNER(pg) PEERDIR( contrib/libs/fastlz - library/cpp/blockcodecs/core + library/cpp/blockcodecs/core ) SRCS( diff --git a/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp b/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp index 042f031679..9f149c1091 100644 --- a/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp +++ b/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/blockcodecs/core/codecs.h> -#include <library/cpp/blockcodecs/core/common.h> -#include <library/cpp/blockcodecs/core/register.h> +#include <library/cpp/blockcodecs/core/codecs.h> +#include <library/cpp/blockcodecs/core/common.h> +#include <library/cpp/blockcodecs/core/register.h> #include <contrib/libs/zstd06/common/zstd.h> #include <contrib/libs/zstd06/common/zstd_static.h> diff --git a/library/cpp/blockcodecs/codecs/legacy_zstd06/ya.make b/library/cpp/blockcodecs/codecs/legacy_zstd06/ya.make index 067f731233..ef7e573272 100644 --- a/library/cpp/blockcodecs/codecs/legacy_zstd06/ya.make +++ b/library/cpp/blockcodecs/codecs/legacy_zstd06/ya.make @@ -4,7 +4,7 @@ OWNER(pg) PEERDIR( contrib/libs/zstd06 - library/cpp/blockcodecs/core + library/cpp/blockcodecs/core ) SRCS( diff --git a/library/cpp/blockcodecs/codecs/lz4/lz4.cpp b/library/cpp/blockcodecs/codecs/lz4/lz4.cpp index fbf0fe110f..6edf3695a1 100644 --- a/library/cpp/blockcodecs/codecs/lz4/lz4.cpp +++ b/library/cpp/blockcodecs/codecs/lz4/lz4.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/blockcodecs/core/codecs.h> -#include <library/cpp/blockcodecs/core/common.h> -#include <library/cpp/blockcodecs/core/register.h> +#include <library/cpp/blockcodecs/core/codecs.h> +#include <library/cpp/blockcodecs/core/common.h> +#include <library/cpp/blockcodecs/core/register.h> #include <contrib/libs/lz4/lz4.h> #include <contrib/libs/lz4/lz4hc.h> diff --git a/library/cpp/blockcodecs/codecs/lz4/ya.make b/library/cpp/blockcodecs/codecs/lz4/ya.make index f2471d7d96..60b13c1191 100644 --- a/library/cpp/blockcodecs/codecs/lz4/ya.make +++ b/library/cpp/blockcodecs/codecs/lz4/ya.make @@ -5,7 +5,7 @@ OWNER(pg) PEERDIR( contrib/libs/lz4 contrib/libs/lz4/generated - library/cpp/blockcodecs/core + library/cpp/blockcodecs/core ) SRCS( diff --git a/library/cpp/blockcodecs/codecs/lzma/lzma.cpp b/library/cpp/blockcodecs/codecs/lzma/lzma.cpp index 6c8d5fded4..aabe52567a 100644 --- a/library/cpp/blockcodecs/codecs/lzma/lzma.cpp +++ b/library/cpp/blockcodecs/codecs/lzma/lzma.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/blockcodecs/core/codecs.h> -#include <library/cpp/blockcodecs/core/common.h> -#include <library/cpp/blockcodecs/core/register.h> +#include <library/cpp/blockcodecs/core/codecs.h> +#include <library/cpp/blockcodecs/core/common.h> +#include <library/cpp/blockcodecs/core/register.h> #include <contrib/libs/lzmasdk/LzmaLib.h> diff --git a/library/cpp/blockcodecs/codecs/lzma/ya.make b/library/cpp/blockcodecs/codecs/lzma/ya.make index e145834da6..af78faa05d 100644 --- a/library/cpp/blockcodecs/codecs/lzma/ya.make +++ b/library/cpp/blockcodecs/codecs/lzma/ya.make @@ -4,7 +4,7 @@ OWNER(pg) PEERDIR( contrib/libs/lzmasdk - library/cpp/blockcodecs/core + library/cpp/blockcodecs/core ) SRCS( diff --git a/library/cpp/blockcodecs/codecs/snappy/snappy.cpp b/library/cpp/blockcodecs/codecs/snappy/snappy.cpp index f6be05a05f..8db69e8a29 100644 --- a/library/cpp/blockcodecs/codecs/snappy/snappy.cpp +++ b/library/cpp/blockcodecs/codecs/snappy/snappy.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/blockcodecs/core/codecs.h> -#include <library/cpp/blockcodecs/core/common.h> -#include <library/cpp/blockcodecs/core/register.h> +#include <library/cpp/blockcodecs/core/codecs.h> +#include <library/cpp/blockcodecs/core/common.h> +#include <library/cpp/blockcodecs/core/register.h> #include <contrib/libs/snappy/snappy.h> diff --git a/library/cpp/blockcodecs/codecs/snappy/ya.make b/library/cpp/blockcodecs/codecs/snappy/ya.make index 0cf2be2f94..fa411340b3 100644 --- a/library/cpp/blockcodecs/codecs/snappy/ya.make +++ b/library/cpp/blockcodecs/codecs/snappy/ya.make @@ -4,7 +4,7 @@ OWNER(pg) PEERDIR( contrib/libs/snappy - library/cpp/blockcodecs/core + library/cpp/blockcodecs/core ) SRCS( diff --git a/library/cpp/blockcodecs/codecs/zlib/ya.make b/library/cpp/blockcodecs/codecs/zlib/ya.make index 9f04995f66..488d7da047 100644 --- a/library/cpp/blockcodecs/codecs/zlib/ya.make +++ b/library/cpp/blockcodecs/codecs/zlib/ya.make @@ -4,7 +4,7 @@ OWNER(pg) PEERDIR( contrib/libs/zlib - library/cpp/blockcodecs/core + library/cpp/blockcodecs/core ) SRCS( diff --git a/library/cpp/blockcodecs/codecs/zlib/zlib.cpp b/library/cpp/blockcodecs/codecs/zlib/zlib.cpp index cdb556c36d..a9cab30d1e 100644 --- a/library/cpp/blockcodecs/codecs/zlib/zlib.cpp +++ b/library/cpp/blockcodecs/codecs/zlib/zlib.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/blockcodecs/core/codecs.h> -#include <library/cpp/blockcodecs/core/common.h> -#include <library/cpp/blockcodecs/core/register.h> +#include <library/cpp/blockcodecs/core/codecs.h> +#include <library/cpp/blockcodecs/core/common.h> +#include <library/cpp/blockcodecs/core/register.h> #include <contrib/libs/zlib/zlib.h> diff --git a/library/cpp/blockcodecs/codecs/zstd/ya.make b/library/cpp/blockcodecs/codecs/zstd/ya.make index c077dd47b7..210d0a2a1f 100644 --- a/library/cpp/blockcodecs/codecs/zstd/ya.make +++ b/library/cpp/blockcodecs/codecs/zstd/ya.make @@ -4,7 +4,7 @@ OWNER(pg) PEERDIR( contrib/libs/zstd - library/cpp/blockcodecs/core + library/cpp/blockcodecs/core ) SRCS( diff --git a/library/cpp/blockcodecs/codecs/zstd/zstd.cpp b/library/cpp/blockcodecs/codecs/zstd/zstd.cpp index 95299b3f6d..4ecc5f50a2 100644 --- a/library/cpp/blockcodecs/codecs/zstd/zstd.cpp +++ b/library/cpp/blockcodecs/codecs/zstd/zstd.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/blockcodecs/core/codecs.h> -#include <library/cpp/blockcodecs/core/common.h> -#include <library/cpp/blockcodecs/core/register.h> +#include <library/cpp/blockcodecs/core/codecs.h> +#include <library/cpp/blockcodecs/core/common.h> +#include <library/cpp/blockcodecs/core/register.h> #define ZSTD_STATIC_LINKING_ONLY #include <contrib/libs/zstd/include/zstd.h> diff --git a/library/cpp/blockcodecs/fuzz/main.cpp b/library/cpp/blockcodecs/fuzz/main.cpp index 763c6c5a10..5cb21dc17c 100644 --- a/library/cpp/blockcodecs/fuzz/main.cpp +++ b/library/cpp/blockcodecs/fuzz/main.cpp @@ -1,9 +1,9 @@ #include <contrib/libs/protobuf-mutator/src/libfuzzer/libfuzzer_macro.h> #include <google/protobuf/stubs/logging.h> -#include <library/cpp/blockcodecs/codecs.h> -#include <library/cpp/blockcodecs/fuzz/proto/case.pb.h> -#include <library/cpp/blockcodecs/stream.h> +#include <library/cpp/blockcodecs/codecs.h> +#include <library/cpp/blockcodecs/fuzz/proto/case.pb.h> +#include <library/cpp/blockcodecs/stream.h> #include <util/stream/input.h> #include <util/stream/length.h> diff --git a/library/cpp/blockcodecs/fuzz/ya.make b/library/cpp/blockcodecs/fuzz/ya.make index bc8becc9e1..60ff8c35a9 100644 --- a/library/cpp/blockcodecs/fuzz/ya.make +++ b/library/cpp/blockcodecs/fuzz/ya.make @@ -15,8 +15,8 @@ IF (NOT MSVC) PEERDIR( contrib/libs/protobuf contrib/libs/protobuf-mutator - library/cpp/blockcodecs - library/cpp/blockcodecs/fuzz/proto + library/cpp/blockcodecs + library/cpp/blockcodecs/fuzz/proto ) END() diff --git a/library/cpp/blockcodecs/stream.h b/library/cpp/blockcodecs/stream.h index 96c479cf7e..a6d0d7bdca 100644 --- a/library/cpp/blockcodecs/stream.h +++ b/library/cpp/blockcodecs/stream.h @@ -1,3 +1,3 @@ #pragma once -#include <library/cpp/blockcodecs/core/stream.h> +#include <library/cpp/blockcodecs/core/stream.h> diff --git a/library/cpp/blockcodecs/ut/ya.make b/library/cpp/blockcodecs/ut/ya.make index 25b882c15b..6edd6f6445 100644 --- a/library/cpp/blockcodecs/ut/ya.make +++ b/library/cpp/blockcodecs/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/blockcodecs) +UNITTEST_FOR(library/cpp/blockcodecs) OWNER(pg) diff --git a/library/cpp/blockcodecs/ya.make b/library/cpp/blockcodecs/ya.make index b8f03d5421..b59c5470ec 100644 --- a/library/cpp/blockcodecs/ya.make +++ b/library/cpp/blockcodecs/ya.make @@ -3,16 +3,16 @@ LIBRARY() OWNER(pg) PEERDIR( - library/cpp/blockcodecs/core - library/cpp/blockcodecs/codecs/brotli - library/cpp/blockcodecs/codecs/bzip - library/cpp/blockcodecs/codecs/fastlz - library/cpp/blockcodecs/codecs/legacy_zstd06 - library/cpp/blockcodecs/codecs/lz4 - library/cpp/blockcodecs/codecs/lzma - library/cpp/blockcodecs/codecs/snappy - library/cpp/blockcodecs/codecs/zlib - library/cpp/blockcodecs/codecs/zstd + library/cpp/blockcodecs/core + library/cpp/blockcodecs/codecs/brotli + library/cpp/blockcodecs/codecs/bzip + library/cpp/blockcodecs/codecs/fastlz + library/cpp/blockcodecs/codecs/legacy_zstd06 + library/cpp/blockcodecs/codecs/lz4 + library/cpp/blockcodecs/codecs/lzma + library/cpp/blockcodecs/codecs/snappy + library/cpp/blockcodecs/codecs/zlib + library/cpp/blockcodecs/codecs/zstd ) SRCS( diff --git a/library/cpp/build_info/build_info.cpp.in b/library/cpp/build_info/build_info.cpp.in index 71403af13e..693290cbb5 100644 --- a/library/cpp/build_info/build_info.cpp.in +++ b/library/cpp/build_info/build_info.cpp.in @@ -1,4 +1,4 @@ -#include <library/cpp/build_info/build_info.h> +#include <library/cpp/build_info/build_info.h> extern "C" const char* GetBuildType() { return "@BUILD_TYPE@"; diff --git a/library/cpp/build_info/build_info_static.cpp b/library/cpp/build_info/build_info_static.cpp index 238fb1ecb0..5cabef8b06 100644 --- a/library/cpp/build_info/build_info_static.cpp +++ b/library/cpp/build_info/build_info_static.cpp @@ -1,6 +1,6 @@ #include "build_info_static.h" -#include <library/cpp/build_info/buildinfo_data.h> +#include <library/cpp/build_info/buildinfo_data.h> extern "C" const char* GetCompilerVersion() { #if defined(BUILD_COMPILER_VERSION) diff --git a/library/cpp/build_info/sandbox.cpp.in b/library/cpp/build_info/sandbox.cpp.in index ac3b2d9004..c7434bf444 100644 --- a/library/cpp/build_info/sandbox.cpp.in +++ b/library/cpp/build_info/sandbox.cpp.in @@ -1,4 +1,4 @@ -#include <library/cpp/build_info/sandbox.h> +#include <library/cpp/build_info/sandbox.h> #include <library/cpp/string_utils/base64/base64.h> #include <util/generic/string.h> #include <util/string/subst.h> diff --git a/library/cpp/cgiparam/cgiparam.cpp b/library/cpp/cgiparam/cgiparam.cpp index f3277b8e4b..a9a4d06a38 100644 --- a/library/cpp/cgiparam/cgiparam.cpp +++ b/library/cpp/cgiparam/cgiparam.cpp @@ -34,7 +34,7 @@ bool TCgiParameters::Erase(const TStringBuf name, const TStringBuf val) { const auto pair = equal_range(name); bool found = false; - for (auto it = pair.first; it != pair.second;) { + for (auto it = pair.first; it != pair.second;) { if (val == it->second) { it = erase(it); found = true; diff --git a/library/cpp/charset/generated/cp_data.cpp b/library/cpp/charset/generated/cp_data.cpp index 202362c596..ab017c120f 100644 --- a/library/cpp/charset/generated/cp_data.cpp +++ b/library/cpp/charset/generated/cp_data.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/charset/codepage.h> +#include <library/cpp/charset/codepage.h> extern const char defchars[][DEFCHAR_BUF]; diff --git a/library/cpp/charset/generated/encrec_data.cpp b/library/cpp/charset/generated/encrec_data.cpp index ca59f8ddef..dc1eb1ecf8 100644 --- a/library/cpp/charset/generated/encrec_data.cpp +++ b/library/cpp/charset/generated/encrec_data.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/charset/codepage.h> +#include <library/cpp/charset/codepage.h> extern const char defchars[][DEFCHAR_BUF]; static const char PP_00[257] = diff --git a/library/cpp/charset/ut/ya.make b/library/cpp/charset/ut/ya.make index 1f9934c712..17384046f4 100644 --- a/library/cpp/charset/ut/ya.make +++ b/library/cpp/charset/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/charset) +UNITTEST_FOR(library/cpp/charset) OWNER(alzobnin) diff --git a/library/cpp/codecs/README.md b/library/cpp/codecs/README.md index 42646ccd97..382c3fed02 100644 --- a/library/cpp/codecs/README.md +++ b/library/cpp/codecs/README.md @@ -1,5 +1,5 @@ This is a library of compression algorithms with a unified interface and serialization. -See also library/cpp/codecs/static, where a support for statically compiled dictionaries is implemented. +See also library/cpp/codecs/static, where a support for statically compiled dictionaries is implemented. All algorithms have a common `ICodec` interface (described in codecs.h). diff --git a/library/cpp/codecs/codecs_registry.cpp b/library/cpp/codecs/codecs_registry.cpp index 17d07062ab..837118719c 100644 --- a/library/cpp/codecs/codecs_registry.cpp +++ b/library/cpp/codecs/codecs_registry.cpp @@ -6,7 +6,7 @@ #include "comptable_codec.h" #include "zstd_dict_codec.h" -#include <library/cpp/blockcodecs/codecs.h> +#include <library/cpp/blockcodecs/codecs.h> #include <util/string/builder.h> #include <util/string/cast.h> diff --git a/library/cpp/codecs/comptable_codec.cpp b/library/cpp/codecs/comptable_codec.cpp index 476b8ada80..ab0196f50a 100644 --- a/library/cpp/codecs/comptable_codec.cpp +++ b/library/cpp/codecs/comptable_codec.cpp @@ -1,6 +1,6 @@ #include "comptable_codec.h" -#include <library/cpp/comptable/comptable.h> +#include <library/cpp/comptable/comptable.h> #include <util/string/cast.h> namespace NCodecs { diff --git a/library/cpp/codecs/greedy_dict/ut/ya.make b/library/cpp/codecs/greedy_dict/ut/ya.make index bd67d1a452..a29ffe1e24 100644 --- a/library/cpp/codecs/greedy_dict/ut/ya.make +++ b/library/cpp/codecs/greedy_dict/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/codecs/greedy_dict) +UNITTEST_FOR(library/cpp/codecs/greedy_dict) OWNER(velavokr) diff --git a/library/cpp/codecs/huffman_codec.cpp b/library/cpp/codecs/huffman_codec.cpp index 650fe7cdfd..b9bb53ad60 100644 --- a/library/cpp/codecs/huffman_codec.cpp +++ b/library/cpp/codecs/huffman_codec.cpp @@ -1,6 +1,6 @@ #include "huffman_codec.h" -#include <library/cpp/bit_io/bitinput.h> -#include <library/cpp/bit_io/bitoutput.h> +#include <library/cpp/bit_io/bitinput.h> +#include <library/cpp/bit_io/bitoutput.h> #include <util/generic/algorithm.h> #include <util/generic/bitops.h> diff --git a/library/cpp/codecs/pfor_codec.h b/library/cpp/codecs/pfor_codec.h index d7d4bb8bf4..3a4e0bb288 100644 --- a/library/cpp/codecs/pfor_codec.h +++ b/library/cpp/codecs/pfor_codec.h @@ -5,8 +5,8 @@ #include "delta_codec.h" #include "tls_cache.h" -#include <library/cpp/bit_io/bitinput.h> -#include <library/cpp/bit_io/bitoutput.h> +#include <library/cpp/bit_io/bitinput.h> +#include <library/cpp/bit_io/bitoutput.h> #include <util/string/cast.h> namespace NCodecs { diff --git a/library/cpp/codecs/sample.h b/library/cpp/codecs/sample.h index 15f03afcc5..d4dd186bd5 100644 --- a/library/cpp/codecs/sample.h +++ b/library/cpp/codecs/sample.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/deprecated/accessors/accessors.h> +#include <library/cpp/deprecated/accessors/accessors.h> #include <util/generic/buffer.h> #include <util/generic/vector.h> diff --git a/library/cpp/codecs/solar_codec.cpp b/library/cpp/codecs/solar_codec.cpp index d0692fe2a4..773678c5a4 100644 --- a/library/cpp/codecs/solar_codec.cpp +++ b/library/cpp/codecs/solar_codec.cpp @@ -1,6 +1,6 @@ #include "solar_codec.h" -#include <library/cpp/codecs/greedy_dict/gd_builder.h> +#include <library/cpp/codecs/greedy_dict/gd_builder.h> #include <library/cpp/containers/comptrie/comptrie_builder.h> #include <library/cpp/string_utils/relaxed_escaper/relaxed_escaper.h> diff --git a/library/cpp/codecs/solar_codec.h b/library/cpp/codecs/solar_codec.h index 7158ae7926..35e42b8309 100644 --- a/library/cpp/codecs/solar_codec.h +++ b/library/cpp/codecs/solar_codec.h @@ -2,7 +2,7 @@ #include "codecs.h" #include <library/cpp/containers/comptrie/comptrie_trie.h> -#include <library/cpp/codecs/greedy_dict/gd_builder.h> +#include <library/cpp/codecs/greedy_dict/gd_builder.h> #include <util/string/cast.h> #include <util/string/escape.h> diff --git a/library/cpp/codecs/static/README b/library/cpp/codecs/static/README index 1b07f02433..d73254e855 100644 --- a/library/cpp/codecs/static/README +++ b/library/cpp/codecs/static/README @@ -1 +1 @@ -Support of static libraries in library/cpp/codecs. See library/cpp/codecs/static/example. +Support of static libraries in library/cpp/codecs. See library/cpp/codecs/static/example. diff --git a/library/cpp/codecs/static/builder.cpp b/library/cpp/codecs/static/builder.cpp index 93e34a3edb..344ceeb362 100644 --- a/library/cpp/codecs/static/builder.cpp +++ b/library/cpp/codecs/static/builder.cpp @@ -1,9 +1,9 @@ #include "builder.h" #include "common.h" -#include <library/cpp/codecs/static/static_codec_info.pb.h> +#include <library/cpp/codecs/static/static_codec_info.pb.h> -#include <library/cpp/codecs/codecs.h> +#include <library/cpp/codecs/codecs.h> #include <util/generic/yexception.h> #include <util/string/subst.h> diff --git a/library/cpp/codecs/static/builder.h b/library/cpp/codecs/static/builder.h index d7533be4d5..c67dcfc9c9 100644 --- a/library/cpp/codecs/static/builder.h +++ b/library/cpp/codecs/static/builder.h @@ -2,7 +2,7 @@ #include "static.h" -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/svnversion/svnversion.h> #include <util/datetime/base.h> #include <util/generic/string.h> diff --git a/library/cpp/codecs/static/example/example.cpp b/library/cpp/codecs/static/example/example.cpp index 5b750b717e..e751ed7e2e 100644 --- a/library/cpp/codecs/static/example/example.cpp +++ b/library/cpp/codecs/static/example/example.cpp @@ -1,6 +1,6 @@ #include "example.h" -#include <library/cpp/codecs/static/static.h> +#include <library/cpp/codecs/static/static.h> #include <util/generic/yexception.h> diff --git a/library/cpp/codecs/static/example/ya.make b/library/cpp/codecs/static/example/ya.make index ca6c5fd900..db5f730587 100644 --- a/library/cpp/codecs/static/example/ya.make +++ b/library/cpp/codecs/static/example/ya.make @@ -7,8 +7,8 @@ SRCS( ) PEERDIR( - library/cpp/codecs - library/cpp/codecs/static + library/cpp/codecs + library/cpp/codecs/static ) ARCHIVE_ASM( diff --git a/library/cpp/codecs/static/static.cpp b/library/cpp/codecs/static/static.cpp index 44a07dd73a..a13a545382 100644 --- a/library/cpp/codecs/static/static.cpp +++ b/library/cpp/codecs/static/static.cpp @@ -1,8 +1,8 @@ #include "static.h" #include "common.h" -#include <library/cpp/codecs/static/static_codec_info.pb.h> -#include <library/cpp/archive/yarchive.h> +#include <library/cpp/codecs/static/static_codec_info.pb.h> +#include <library/cpp/archive/yarchive.h> #include <util/draft/datetime.h> diff --git a/library/cpp/codecs/static/static.h b/library/cpp/codecs/static/static.h index c1eaed2a74..80e77999d6 100644 --- a/library/cpp/codecs/static/static.h +++ b/library/cpp/codecs/static/static.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/codecs/codecs.h> +#include <library/cpp/codecs/codecs.h> #include <util/generic/strbuf.h> #include <util/generic/string.h> diff --git a/library/cpp/codecs/static/tools/common/ct_common.cpp b/library/cpp/codecs/static/tools/common/ct_common.cpp index fe77691280..de25d39cba 100644 --- a/library/cpp/codecs/static/tools/common/ct_common.cpp +++ b/library/cpp/codecs/static/tools/common/ct_common.cpp @@ -1,7 +1,7 @@ #include "ct_common.h" -#include <library/cpp/codecs/codecs.h> -#include <library/cpp/codecs/static/static_codec_info.pb.h> +#include <library/cpp/codecs/codecs.h> +#include <library/cpp/codecs/static/static_codec_info.pb.h> #include <library/cpp/string_utils/base64/base64.h> #include <util/stream/output.h> diff --git a/library/cpp/codecs/static/tools/common/ya.make b/library/cpp/codecs/static/tools/common/ya.make index d624222dad..4a429b7099 100644 --- a/library/cpp/codecs/static/tools/common/ya.make +++ b/library/cpp/codecs/static/tools/common/ya.make @@ -7,8 +7,8 @@ SRCS( ) PEERDIR( - library/cpp/codecs - library/cpp/codecs/static + library/cpp/codecs + library/cpp/codecs/static library/cpp/getopt/small library/cpp/string_utils/base64 util/draft diff --git a/library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker.cpp b/library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker.cpp index 9c8d568d82..f2179ee2e9 100644 --- a/library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker.cpp +++ b/library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker.cpp @@ -1,7 +1,7 @@ -#include <library/cpp/codecs/static/tools/common/ct_common.h> -#include <library/cpp/codecs/static/static.h> -#include <library/cpp/codecs/static/static_codec_info.pb.h> -#include <library/cpp/codecs/codecs.h> +#include <library/cpp/codecs/static/tools/common/ct_common.h> +#include <library/cpp/codecs/static/static.h> +#include <library/cpp/codecs/static/static_codec_info.pb.h> +#include <library/cpp/codecs/codecs.h> #include <library/cpp/getopt/small/last_getopt.h> #include <util/digest/city.h> diff --git a/library/cpp/codecs/static/tools/static_codec_checker/ya.make b/library/cpp/codecs/static/tools/static_codec_checker/ya.make index 90e06ca448..3d404c3643 100644 --- a/library/cpp/codecs/static/tools/static_codec_checker/ya.make +++ b/library/cpp/codecs/static/tools/static_codec_checker/ya.make @@ -7,9 +7,9 @@ SRCS( ) PEERDIR( - library/cpp/codecs - library/cpp/codecs/static - library/cpp/codecs/static/tools/common + library/cpp/codecs + library/cpp/codecs/static + library/cpp/codecs/static/tools/common library/cpp/getopt/small ) diff --git a/library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator.cpp b/library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator.cpp index 45fdb5c5fe..8684ddc073 100644 --- a/library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator.cpp +++ b/library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator.cpp @@ -1,7 +1,7 @@ -#include <library/cpp/codecs/static/tools/common/ct_common.h> -#include <library/cpp/codecs/static/static_codec_info.pb.h> -#include <library/cpp/codecs/static/builder.h> -#include <library/cpp/codecs/codecs.h> +#include <library/cpp/codecs/static/tools/common/ct_common.h> +#include <library/cpp/codecs/static/static_codec_info.pb.h> +#include <library/cpp/codecs/static/builder.h> +#include <library/cpp/codecs/codecs.h> #include <library/cpp/getopt/small/last_getopt.h> diff --git a/library/cpp/codecs/static/tools/static_codec_generator/ya.make b/library/cpp/codecs/static/tools/static_codec_generator/ya.make index efbc440dd1..21cafe805f 100644 --- a/library/cpp/codecs/static/tools/static_codec_generator/ya.make +++ b/library/cpp/codecs/static/tools/static_codec_generator/ya.make @@ -7,10 +7,10 @@ SRCS( ) PEERDIR( - library/cpp/codecs - library/cpp/codecs/static - library/cpp/codecs/static/tools/common - library/cpp/digest/md5 + library/cpp/codecs + library/cpp/codecs/static + library/cpp/codecs/static/tools/common + library/cpp/digest/md5 library/cpp/getopt/small ) diff --git a/library/cpp/codecs/static/tools/tests/static_codec_tools.py b/library/cpp/codecs/static/tools/tests/static_codec_tools.py index db4140e370..fc948ee4ad 100644 --- a/library/cpp/codecs/static/tools/tests/static_codec_tools.py +++ b/library/cpp/codecs/static/tools/tests/static_codec_tools.py @@ -4,15 +4,15 @@ import yatest.common as tt import os.path as op def test_static_codec_tools(): - tt.execute([tt.binary_path("library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator")] + tt.execute([tt.binary_path("library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator")] + ["-m", "test codec", "-r", "sbr://143310406", "-f", "plain", "-c", "solar-8k-a:huffman", "-s", "1", "--fake-revision", "r2385905", "--fake-timestamp", "1467494385", "sample.txt"], timeout=60) assert(op.exists("solar-8k-a.huffman.1467494385.codec_info")) - tt.canonical_execute(tt.binary_path("library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker"), + tt.canonical_execute(tt.binary_path("library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker"), args=["-c", "solar-8k-a.huffman.1467494385.codec_info"], timeout=60) - tt.execute([tt.binary_path("library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker")] + tt.execute([tt.binary_path("library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker")] + ["-c", "solar-8k-a.huffman.1467494385.codec_info", "-f", "plain", "-t", "sample.txt"], timeout=60) return tt.canonical_file("solar-8k-a.huffman.1467494385.codec_info") diff --git a/library/cpp/codecs/static/tools/tests/ya.make b/library/cpp/codecs/static/tools/tests/ya.make index c5324eaf53..ccf7c6cfe4 100644 --- a/library/cpp/codecs/static/tools/tests/ya.make +++ b/library/cpp/codecs/static/tools/tests/ya.make @@ -11,8 +11,8 @@ TIMEOUT(4200) TAG(ya:not_autocheck) DEPENDS( - library/cpp/codecs/static/tools/static_codec_checker - library/cpp/codecs/static/tools/static_codec_generator + library/cpp/codecs/static/tools/static_codec_checker + library/cpp/codecs/static/tools/static_codec_generator ) diff --git a/library/cpp/codecs/static/ut/builder_ut.cpp b/library/cpp/codecs/static/ut/builder_ut.cpp index b47c279ed1..a44745a2e4 100644 --- a/library/cpp/codecs/static/ut/builder_ut.cpp +++ b/library/cpp/codecs/static/ut/builder_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/codecs/static/builder.h> -#include <library/cpp/codecs/static/static_codec_info.pb.h> +#include <library/cpp/codecs/static/builder.h> +#include <library/cpp/codecs/static/static_codec_info.pb.h> #include <util/string/vector.h> class TStaticCodecInfoBuilderTest: public NUnitTest::TTestBase { diff --git a/library/cpp/codecs/static/ut/static_ut.cpp b/library/cpp/codecs/static/ut/static_ut.cpp index 57e1e62887..c774165d3b 100644 --- a/library/cpp/codecs/static/ut/static_ut.cpp +++ b/library/cpp/codecs/static/ut/static_ut.cpp @@ -1,5 +1,5 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/codecs/static/example/example.h> +#include <library/cpp/codecs/static/example/example.h> class TStaticCodecUsageTest: public NUnitTest::TTestBase { UNIT_TEST_SUITE(TStaticCodecUsageTest) diff --git a/library/cpp/codecs/static/ut/ya.make b/library/cpp/codecs/static/ut/ya.make index b9116097d8..14d27703a6 100644 --- a/library/cpp/codecs/static/ut/ya.make +++ b/library/cpp/codecs/static/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/codecs/static) +UNITTEST_FOR(library/cpp/codecs/static) OWNER(velavokr) @@ -8,7 +8,7 @@ SRCS( ) PEERDIR( - library/cpp/codecs/static/example + library/cpp/codecs/static/example ) END() diff --git a/library/cpp/codecs/static/ya.make b/library/cpp/codecs/static/ya.make index 00e00fd8d4..41a164f171 100644 --- a/library/cpp/codecs/static/ya.make +++ b/library/cpp/codecs/static/ya.make @@ -9,9 +9,9 @@ SRCS( ) PEERDIR( - library/cpp/codecs - library/cpp/archive - library/cpp/svnversion + library/cpp/codecs + library/cpp/archive + library/cpp/svnversion util/draft ) diff --git a/library/cpp/codecs/ut/codecs_ut.cpp b/library/cpp/codecs/ut/codecs_ut.cpp index caf6089aef..c244c368cc 100644 --- a/library/cpp/codecs/ut/codecs_ut.cpp +++ b/library/cpp/codecs/ut/codecs_ut.cpp @@ -1,9 +1,9 @@ -#include <library/cpp/codecs/delta_codec.h> -#include <library/cpp/codecs/huffman_codec.h> -#include <library/cpp/codecs/pfor_codec.h> -#include <library/cpp/codecs/solar_codec.h> -#include <library/cpp/codecs/zstd_dict_codec.h> -#include <library/cpp/codecs/comptable_codec.h> +#include <library/cpp/codecs/delta_codec.h> +#include <library/cpp/codecs/huffman_codec.h> +#include <library/cpp/codecs/pfor_codec.h> +#include <library/cpp/codecs/solar_codec.h> +#include <library/cpp/codecs/zstd_dict_codec.h> +#include <library/cpp/codecs/comptable_codec.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/codecs/ut/float_huffman_ut.cpp b/library/cpp/codecs/ut/float_huffman_ut.cpp index 3156fb1f46..915767019e 100644 --- a/library/cpp/codecs/ut/float_huffman_ut.cpp +++ b/library/cpp/codecs/ut/float_huffman_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/codecs/float_huffman.h> +#include <library/cpp/codecs/float_huffman.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/codecs/ut/tls_cache_ut.cpp b/library/cpp/codecs/ut/tls_cache_ut.cpp index 8101af761f..6a405ee8af 100644 --- a/library/cpp/codecs/ut/tls_cache_ut.cpp +++ b/library/cpp/codecs/ut/tls_cache_ut.cpp @@ -1,5 +1,5 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/codecs/tls_cache.h> +#include <library/cpp/codecs/tls_cache.h> Y_UNIT_TEST_SUITE(CodecsBufferFactoryTest){ void AssignToBuffer(TBuffer & buf, TStringBuf val){ diff --git a/library/cpp/codecs/ut/ya.make b/library/cpp/codecs/ut/ya.make index 90841b05ef..2bac67788f 100644 --- a/library/cpp/codecs/ut/ya.make +++ b/library/cpp/codecs/ut/ya.make @@ -7,7 +7,7 @@ OWNER( PEERDIR( library/cpp/string_utils/base64 - library/cpp/codecs + library/cpp/codecs library/cpp/string_utils/relaxed_escaper ) diff --git a/library/cpp/codecs/ya.make b/library/cpp/codecs/ya.make index 7e76fb0c9a..6b8a92d1f6 100644 --- a/library/cpp/codecs/ya.make +++ b/library/cpp/codecs/ya.make @@ -20,13 +20,13 @@ SRCS( PEERDIR( contrib/libs/zstd - library/cpp/bit_io - library/cpp/blockcodecs - library/cpp/codecs/greedy_dict - library/cpp/comptable + library/cpp/bit_io + library/cpp/blockcodecs + library/cpp/codecs/greedy_dict + library/cpp/comptable library/cpp/containers/comptrie - library/cpp/deprecated/accessors - library/cpp/packers + library/cpp/deprecated/accessors + library/cpp/packers library/cpp/string_utils/relaxed_escaper ) diff --git a/library/cpp/codecs/zstd_dict_codec.cpp b/library/cpp/codecs/zstd_dict_codec.cpp index c42a2879e6..7c8b01c4f7 100644 --- a/library/cpp/codecs/zstd_dict_codec.cpp +++ b/library/cpp/codecs/zstd_dict_codec.cpp @@ -1,6 +1,6 @@ #include "zstd_dict_codec.h" -#include <library/cpp/packers/packers.h> +#include <library/cpp/packers/packers.h> #include <util/generic/ptr.h> #include <util/generic/refcount.h> diff --git a/library/cpp/colorizer/ut/colorizer_ut.cpp b/library/cpp/colorizer/ut/colorizer_ut.cpp index 20341440af..a6d18ac46c 100644 --- a/library/cpp/colorizer/ut/colorizer_ut.cpp +++ b/library/cpp/colorizer/ut/colorizer_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/str.h> diff --git a/library/cpp/colorizer/ut/ya.make b/library/cpp/colorizer/ut/ya.make index 8a28c189af..f3e60d4521 100644 --- a/library/cpp/colorizer/ut/ya.make +++ b/library/cpp/colorizer/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/colorizer) +UNITTEST_FOR(library/cpp/colorizer) OWNER(pg) diff --git a/library/cpp/compproto/ut/ya.make b/library/cpp/compproto/ut/ya.make index f197a58269..0ad1eb4c6f 100644 --- a/library/cpp/compproto/ut/ya.make +++ b/library/cpp/compproto/ut/ya.make @@ -3,10 +3,10 @@ UNITTEST() OWNER(ironpeter) PEERDIR( - ADDINCL library/cpp/compproto + ADDINCL library/cpp/compproto ) -SRCDIR(library/cpp/compproto) +SRCDIR(library/cpp/compproto) SRCS( compproto_ut.cpp diff --git a/library/cpp/comptable/comptable.cpp b/library/cpp/comptable/comptable.cpp index 8a92d4d1aa..c81e12f4a4 100644 --- a/library/cpp/comptable/comptable.cpp +++ b/library/cpp/comptable/comptable.cpp @@ -4,7 +4,7 @@ #include <util/generic/vector.h> #include <util/string/cast.h> #include <util/stream/file.h> -#include <library/cpp/compproto/huff.h> +#include <library/cpp/compproto/huff.h> #include "comptable.h" diff --git a/library/cpp/comptable/comptable.h b/library/cpp/comptable/comptable.h index d225fed7a0..8f604d0c74 100644 --- a/library/cpp/comptable/comptable.h +++ b/library/cpp/comptable/comptable.h @@ -4,7 +4,7 @@ #include <util/memory/blob.h> #include <util/ysaveload.h> -#include <library/cpp/compproto/huff.h> +#include <library/cpp/compproto/huff.h> namespace NCompTable { struct TCompressorTable { diff --git a/library/cpp/comptable/usage/usage.cpp b/library/cpp/comptable/usage/usage.cpp index 9997c83686..2285f33500 100644 --- a/library/cpp/comptable/usage/usage.cpp +++ b/library/cpp/comptable/usage/usage.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/comptable/comptable.h> +#include <library/cpp/comptable/comptable.h> #include <util/random/random.h> #include <util/random/fast.h> diff --git a/library/cpp/comptable/usage/ya.make b/library/cpp/comptable/usage/ya.make index ab31e7528c..8c832c3596 100644 --- a/library/cpp/comptable/usage/ya.make +++ b/library/cpp/comptable/usage/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/comptable + library/cpp/comptable ) END() diff --git a/library/cpp/comptable/ut/comptable_ut.cpp b/library/cpp/comptable/ut/comptable_ut.cpp index 5901d0246f..d460b6ca28 100644 --- a/library/cpp/comptable/ut/comptable_ut.cpp +++ b/library/cpp/comptable/ut/comptable_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/comptable/comptable.h> +#include <library/cpp/comptable/comptable.h> #include <library/cpp/testing/unittest/registar.h> #include <util/random/random.h> diff --git a/library/cpp/comptable/ut/ya.make b/library/cpp/comptable/ut/ya.make index d0a49793a5..308ecd7077 100644 --- a/library/cpp/comptable/ut/ya.make +++ b/library/cpp/comptable/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/comptable) +UNITTEST_FOR(library/cpp/comptable) OWNER(ironpeter) diff --git a/library/cpp/comptable/ya.make b/library/cpp/comptable/ya.make index 314603c62a..3ef9d934ae 100644 --- a/library/cpp/comptable/ya.make +++ b/library/cpp/comptable/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/compproto + library/cpp/compproto ) END() diff --git a/library/cpp/containers/atomizer/atomizer.h b/library/cpp/containers/atomizer/atomizer.h index 5e40f47ab9..df25899dbb 100644 --- a/library/cpp/containers/atomizer/atomizer.h +++ b/library/cpp/containers/atomizer/atomizer.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/containers/str_map/str_map.h> +#include <library/cpp/containers/str_map/str_map.h> #include <util/generic/vector.h> #include <util/generic/utility.h> diff --git a/library/cpp/containers/atomizer/ya.make b/library/cpp/containers/atomizer/ya.make index 55165a3b67..7076e9d915 100644 --- a/library/cpp/containers/atomizer/ya.make +++ b/library/cpp/containers/atomizer/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(g:util) PEERDIR( - library/cpp/containers/str_map + library/cpp/containers/str_map ) SRCS( diff --git a/library/cpp/containers/bitseq/ut/ya.make b/library/cpp/containers/bitseq/ut/ya.make index 7155e82c06..acaa044db2 100644 --- a/library/cpp/containers/bitseq/ut/ya.make +++ b/library/cpp/containers/bitseq/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/containers/bitseq) +UNITTEST_FOR(library/cpp/containers/bitseq) OWNER(g:util) diff --git a/library/cpp/containers/compact_vector/ut/ya.make b/library/cpp/containers/compact_vector/ut/ya.make index 5e655bc619..f3e72ed41c 100644 --- a/library/cpp/containers/compact_vector/ut/ya.make +++ b/library/cpp/containers/compact_vector/ut/ya.make @@ -2,7 +2,7 @@ UNITTEST() OWNER(nga) -SRCDIR(library/cpp/containers/compact_vector) +SRCDIR(library/cpp/containers/compact_vector) SRCS( compact_vector_ut.cpp diff --git a/library/cpp/containers/comptrie/README.md b/library/cpp/containers/comptrie/README.md index 43c298e2c8..c5efc26cb3 100644 --- a/library/cpp/containers/comptrie/README.md +++ b/library/cpp/containers/comptrie/README.md @@ -37,7 +37,7 @@ integer type, which means that arithmetical operations must be defined for it. serialize the value type to a continuous memory buffer, deserialize it back, and quickly determine its size using the pointer to the beginning of this memory buffer. Good packers have already been written for most types, and they are available in -library/cpp/packers. For more information, please refer to the documentation for these packers. +library/cpp/packers. For more information, please refer to the documentation for these packers. The set.h file defines a modification for cases when keys must be stored without values. diff --git a/library/cpp/containers/comptrie/benchmark/main.cpp b/library/cpp/containers/comptrie/benchmark/main.cpp index 6e42dad18a..431034137b 100644 --- a/library/cpp/containers/comptrie/benchmark/main.cpp +++ b/library/cpp/containers/comptrie/benchmark/main.cpp @@ -5,11 +5,11 @@ #include <library/cpp/containers/comptrie/search_iterator.h> #include <library/cpp/containers/comptrie/pattern_searcher.h> -#include <library/cpp/on_disk/aho_corasick/writer.h> -#include <library/cpp/on_disk/aho_corasick/reader.h> -#include <library/cpp/on_disk/aho_corasick/helpers.h> +#include <library/cpp/on_disk/aho_corasick/writer.h> +#include <library/cpp/on_disk/aho_corasick/reader.h> +#include <library/cpp/on_disk/aho_corasick/helpers.h> -#include <library/cpp/containers/dense_hash/dense_hash.h> +#include <library/cpp/containers/dense_hash/dense_hash.h> #include <util/stream/file.h> #include <util/generic/algorithm.h> diff --git a/library/cpp/containers/comptrie/chunked_helpers_trie.h b/library/cpp/containers/comptrie/chunked_helpers_trie.h index cfa35f5ba2..c139afd316 100644 --- a/library/cpp/containers/comptrie/chunked_helpers_trie.h +++ b/library/cpp/containers/comptrie/chunked_helpers_trie.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/on_disk/chunks/chunked_helpers.h> +#include <library/cpp/on_disk/chunks/chunked_helpers.h> #include "comptrie.h" diff --git a/library/cpp/containers/comptrie/comptrie_builder.inl b/library/cpp/containers/comptrie/comptrie_builder.inl index f273fa6571..5e6bb0f0ad 100644 --- a/library/cpp/containers/comptrie/comptrie_builder.inl +++ b/library/cpp/containers/comptrie/comptrie_builder.inl @@ -5,7 +5,7 @@ #include "make_fast_layout.h" #include "array_with_size.h" -#include <library/cpp/containers/compact_vector/compact_vector.h> +#include <library/cpp/containers/compact_vector/compact_vector.h> #include <util/memory/alloc.h> #include <util/memory/blob.h> diff --git a/library/cpp/containers/comptrie/comptrie_packer.h b/library/cpp/containers/comptrie/comptrie_packer.h index 0341eeeae3..f997d89dd1 100644 --- a/library/cpp/containers/comptrie/comptrie_packer.h +++ b/library/cpp/containers/comptrie/comptrie_packer.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/packers/packers.h> +#include <library/cpp/packers/packers.h> template <class T> class TCompactTriePacker { diff --git a/library/cpp/containers/comptrie/loader/loader.h b/library/cpp/containers/comptrie/loader/loader.h index ee10e9b451..d4f3c0503f 100644 --- a/library/cpp/containers/comptrie/loader/loader.h +++ b/library/cpp/containers/comptrie/loader/loader.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/archive/yarchive.h> +#include <library/cpp/archive/yarchive.h> #include <util/generic/string.h> #include <util/generic/ptr.h> #include <util/generic/yexception.h> diff --git a/library/cpp/containers/comptrie/loader/ya.make b/library/cpp/containers/comptrie/loader/ya.make index 1e23e442a0..2054a8d777 100644 --- a/library/cpp/containers/comptrie/loader/ya.make +++ b/library/cpp/containers/comptrie/loader/ya.make @@ -8,7 +8,7 @@ SRCS( ) PEERDIR( - library/cpp/archive + library/cpp/archive library/cpp/containers/comptrie ) diff --git a/library/cpp/containers/comptrie/pattern_searcher.h b/library/cpp/containers/comptrie/pattern_searcher.h index caab51dc1c..d3cfe82ebf 100644 --- a/library/cpp/containers/comptrie/pattern_searcher.h +++ b/library/cpp/containers/comptrie/pattern_searcher.h @@ -3,7 +3,7 @@ #include "comptrie_builder.h" #include "comptrie_trie.h" #include "comptrie_impl.h" -#include <library/cpp/packers/packers.h> +#include <library/cpp/packers/packers.h> #include <util/system/yassert.h> #include <util/generic/vector.h> diff --git a/library/cpp/containers/comptrie/ya.make b/library/cpp/containers/comptrie/ya.make index 81352da4b2..e063792717 100644 --- a/library/cpp/containers/comptrie/ya.make +++ b/library/cpp/containers/comptrie/ya.make @@ -26,9 +26,9 @@ SRCS( ) PEERDIR( - library/cpp/packers - library/cpp/containers/compact_vector - library/cpp/on_disk/chunks + library/cpp/packers + library/cpp/containers/compact_vector + library/cpp/on_disk/chunks util/draft ) diff --git a/library/cpp/containers/flat_hash/benchmark/flat_hash_benchmark.cpp b/library/cpp/containers/flat_hash/benchmark/flat_hash_benchmark.cpp index 040cff3fff..e2fb2ec3a1 100644 --- a/library/cpp/containers/flat_hash/benchmark/flat_hash_benchmark.cpp +++ b/library/cpp/containers/flat_hash/benchmark/flat_hash_benchmark.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/containers/flat_hash/flat_hash.h> +#include <library/cpp/containers/flat_hash/flat_hash.h> -#include <library/cpp/containers/dense_hash/dense_hash.h> +#include <library/cpp/containers/dense_hash/dense_hash.h> #include <library/cpp/testing/benchmark/bench.h> #include <util/random/random.h> diff --git a/library/cpp/containers/flat_hash/benchmark/ya.make b/library/cpp/containers/flat_hash/benchmark/ya.make index 6f9aedf50d..a6f733431b 100644 --- a/library/cpp/containers/flat_hash/benchmark/ya.make +++ b/library/cpp/containers/flat_hash/benchmark/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/containers/flat_hash + library/cpp/containers/flat_hash ) END() diff --git a/library/cpp/containers/flat_hash/flat_hash.h b/library/cpp/containers/flat_hash/flat_hash.h index 582b8ae8f5..e9555b27bc 100644 --- a/library/cpp/containers/flat_hash/flat_hash.h +++ b/library/cpp/containers/flat_hash/flat_hash.h @@ -1,11 +1,11 @@ #pragma once -#include <library/cpp/containers/flat_hash/lib/map.h> -#include <library/cpp/containers/flat_hash/lib/containers.h> -#include <library/cpp/containers/flat_hash/lib/probings.h> -#include <library/cpp/containers/flat_hash/lib/set.h> -#include <library/cpp/containers/flat_hash/lib/size_fitters.h> -#include <library/cpp/containers/flat_hash/lib/expanders.h> +#include <library/cpp/containers/flat_hash/lib/map.h> +#include <library/cpp/containers/flat_hash/lib/containers.h> +#include <library/cpp/containers/flat_hash/lib/probings.h> +#include <library/cpp/containers/flat_hash/lib/set.h> +#include <library/cpp/containers/flat_hash/lib/size_fitters.h> +#include <library/cpp/containers/flat_hash/lib/expanders.h> #include <util/str_stl.h> diff --git a/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/fuzz.cpp b/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/fuzz.cpp index 9b4cb4c983..0147288df2 100644 --- a/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/fuzz.cpp +++ b/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/fuzz.cpp @@ -1,10 +1,10 @@ -#include <library/cpp/containers/flat_hash/lib/map.h> -#include <library/cpp/containers/flat_hash/lib/containers.h> -#include <library/cpp/containers/flat_hash/lib/probings.h> -#include <library/cpp/containers/flat_hash/lib/size_fitters.h> -#include <library/cpp/containers/flat_hash/lib/expanders.h> +#include <library/cpp/containers/flat_hash/lib/map.h> +#include <library/cpp/containers/flat_hash/lib/containers.h> +#include <library/cpp/containers/flat_hash/lib/probings.h> +#include <library/cpp/containers/flat_hash/lib/size_fitters.h> +#include <library/cpp/containers/flat_hash/lib/expanders.h> -#include <library/cpp/containers/flat_hash/lib/fuzz/fuzz_common/fuzz_common.h> +#include <library/cpp/containers/flat_hash/lib/fuzz/fuzz_common/fuzz_common.h> #include <util/generic/hash.h> #include <util/generic/xrange.h> diff --git a/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/ya.make b/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/ya.make index 3a5d3d6d8c..65478c69b6 100644 --- a/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/ya.make +++ b/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/ya.make @@ -9,7 +9,7 @@ SRCS( ) PEERDIR( - library/cpp/containers/flat_hash/lib/fuzz/fuzz_common + library/cpp/containers/flat_hash/lib/fuzz/fuzz_common ) SIZE(LARGE) diff --git a/library/cpp/containers/flat_hash/lib/fuzz/flat_map_fuzz/fuzz.cpp b/library/cpp/containers/flat_hash/lib/fuzz/flat_map_fuzz/fuzz.cpp index 7fb73af0e9..f15f0877e4 100644 --- a/library/cpp/containers/flat_hash/lib/fuzz/flat_map_fuzz/fuzz.cpp +++ b/library/cpp/containers/flat_hash/lib/fuzz/flat_map_fuzz/fuzz.cpp @@ -1,10 +1,10 @@ -#include <library/cpp/containers/flat_hash/lib/map.h> -#include <library/cpp/containers/flat_hash/lib/containers.h> -#include <library/cpp/containers/flat_hash/lib/probings.h> -#include <library/cpp/containers/flat_hash/lib/size_fitters.h> -#include <library/cpp/containers/flat_hash/lib/expanders.h> +#include <library/cpp/containers/flat_hash/lib/map.h> +#include <library/cpp/containers/flat_hash/lib/containers.h> +#include <library/cpp/containers/flat_hash/lib/probings.h> +#include <library/cpp/containers/flat_hash/lib/size_fitters.h> +#include <library/cpp/containers/flat_hash/lib/expanders.h> -#include <library/cpp/containers/flat_hash/lib/fuzz/fuzz_common/fuzz_common.h> +#include <library/cpp/containers/flat_hash/lib/fuzz/fuzz_common/fuzz_common.h> #include <util/generic/hash.h> #include <util/generic/xrange.h> diff --git a/library/cpp/containers/flat_hash/lib/fuzz/flat_map_fuzz/ya.make b/library/cpp/containers/flat_hash/lib/fuzz/flat_map_fuzz/ya.make index 3a5d3d6d8c..65478c69b6 100644 --- a/library/cpp/containers/flat_hash/lib/fuzz/flat_map_fuzz/ya.make +++ b/library/cpp/containers/flat_hash/lib/fuzz/flat_map_fuzz/ya.make @@ -9,7 +9,7 @@ SRCS( ) PEERDIR( - library/cpp/containers/flat_hash/lib/fuzz/fuzz_common + library/cpp/containers/flat_hash/lib/fuzz/fuzz_common ) SIZE(LARGE) diff --git a/library/cpp/containers/flat_hash/lib/fuzz/fuzz_common/ya.make b/library/cpp/containers/flat_hash/lib/fuzz/fuzz_common/ya.make index ecb590e116..a4a01e75f0 100644 --- a/library/cpp/containers/flat_hash/lib/fuzz/fuzz_common/ya.make +++ b/library/cpp/containers/flat_hash/lib/fuzz/fuzz_common/ya.make @@ -5,7 +5,7 @@ OWNER(tender-bum) SRCS(fuzz_common.cpp) PEERDIR( - library/cpp/containers/flat_hash/lib + library/cpp/containers/flat_hash/lib ) END() diff --git a/library/cpp/containers/flat_hash/lib/ut/containers_ut.cpp b/library/cpp/containers/flat_hash/lib/ut/containers_ut.cpp index b17b30fa80..ac0b2e49cb 100644 --- a/library/cpp/containers/flat_hash/lib/ut/containers_ut.cpp +++ b/library/cpp/containers/flat_hash/lib/ut/containers_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/containers/flat_hash/lib/containers.h> +#include <library/cpp/containers/flat_hash/lib/containers.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/containers/flat_hash/lib/ut/iterator_ut.cpp b/library/cpp/containers/flat_hash/lib/ut/iterator_ut.cpp index 0b77bf043f..f8ef0a4292 100644 --- a/library/cpp/containers/flat_hash/lib/ut/iterator_ut.cpp +++ b/library/cpp/containers/flat_hash/lib/ut/iterator_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/containers/flat_hash/lib/iterator.h> -#include <library/cpp/containers/flat_hash/lib/containers.h> +#include <library/cpp/containers/flat_hash/lib/iterator.h> +#include <library/cpp/containers/flat_hash/lib/containers.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/containers/flat_hash/lib/ut/probings_ut.cpp b/library/cpp/containers/flat_hash/lib/ut/probings_ut.cpp index 593f8cbb1b..0a9339cae7 100644 --- a/library/cpp/containers/flat_hash/lib/ut/probings_ut.cpp +++ b/library/cpp/containers/flat_hash/lib/ut/probings_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/containers/flat_hash/lib/probings.h> +#include <library/cpp/containers/flat_hash/lib/probings.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/containers/flat_hash/lib/ut/size_fitters_ut.cpp b/library/cpp/containers/flat_hash/lib/ut/size_fitters_ut.cpp index 4167947ece..6d3e9cb8bd 100644 --- a/library/cpp/containers/flat_hash/lib/ut/size_fitters_ut.cpp +++ b/library/cpp/containers/flat_hash/lib/ut/size_fitters_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/containers/flat_hash/lib/size_fitters.h> +#include <library/cpp/containers/flat_hash/lib/size_fitters.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/containers/flat_hash/lib/ut/table_ut.cpp b/library/cpp/containers/flat_hash/lib/ut/table_ut.cpp index ea511e2c6a..19606c7948 100644 --- a/library/cpp/containers/flat_hash/lib/ut/table_ut.cpp +++ b/library/cpp/containers/flat_hash/lib/ut/table_ut.cpp @@ -1,8 +1,8 @@ -#include <library/cpp/containers/flat_hash/lib/containers.h> -#include <library/cpp/containers/flat_hash/lib/expanders.h> -#include <library/cpp/containers/flat_hash/lib/probings.h> -#include <library/cpp/containers/flat_hash/lib/size_fitters.h> -#include <library/cpp/containers/flat_hash/lib/table.h> +#include <library/cpp/containers/flat_hash/lib/containers.h> +#include <library/cpp/containers/flat_hash/lib/expanders.h> +#include <library/cpp/containers/flat_hash/lib/probings.h> +#include <library/cpp/containers/flat_hash/lib/size_fitters.h> +#include <library/cpp/containers/flat_hash/lib/table.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/containers/flat_hash/lib/ut/ya.make b/library/cpp/containers/flat_hash/lib/ut/ya.make index 04d65a8c6e..4233dfb56c 100644 --- a/library/cpp/containers/flat_hash/lib/ut/ya.make +++ b/library/cpp/containers/flat_hash/lib/ut/ya.make @@ -11,7 +11,7 @@ SRCS( ) PEERDIR( - library/cpp/containers/flat_hash/lib + library/cpp/containers/flat_hash/lib ) END() diff --git a/library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp b/library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp index 2b9d6a1dc2..d1b9072c0b 100644 --- a/library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp +++ b/library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/containers/flat_hash/flat_hash.h> +#include <library/cpp/containers/flat_hash/flat_hash.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/containers/flat_hash/ut/ya.make b/library/cpp/containers/flat_hash/ut/ya.make index 1d33d36120..5f3a733c00 100644 --- a/library/cpp/containers/flat_hash/ut/ya.make +++ b/library/cpp/containers/flat_hash/ut/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/containers/flat_hash + library/cpp/containers/flat_hash ) END() diff --git a/library/cpp/containers/flat_hash/ya.make b/library/cpp/containers/flat_hash/ya.make index 612e2c1cde..3d0f17f8db 100644 --- a/library/cpp/containers/flat_hash/ya.make +++ b/library/cpp/containers/flat_hash/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(tender-bum) PEERDIR( - library/cpp/containers/flat_hash/lib + library/cpp/containers/flat_hash/lib ) SRCS( diff --git a/library/cpp/containers/intrusive_avl_tree/ut/avltree_ut.cpp b/library/cpp/containers/intrusive_avl_tree/ut/avltree_ut.cpp index cab2365cce..94a9dfe120 100644 --- a/library/cpp/containers/intrusive_avl_tree/ut/avltree_ut.cpp +++ b/library/cpp/containers/intrusive_avl_tree/ut/avltree_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/containers/intrusive_avl_tree/avltree.h> +#include <library/cpp/containers/intrusive_avl_tree/avltree.h> class TAvlTreeTest: public TTestBase { UNIT_TEST_SUITE(TAvlTreeTest); diff --git a/library/cpp/containers/intrusive_avl_tree/ut/ya.make b/library/cpp/containers/intrusive_avl_tree/ut/ya.make index 87920306d7..5ac59fa542 100644 --- a/library/cpp/containers/intrusive_avl_tree/ut/ya.make +++ b/library/cpp/containers/intrusive_avl_tree/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/containers/intrusive_avl_tree) +UNITTEST_FOR(library/cpp/containers/intrusive_avl_tree) OWNER( pg diff --git a/library/cpp/containers/intrusive_rb_tree/fuzz/rb_tree_fuzzing.cpp b/library/cpp/containers/intrusive_rb_tree/fuzz/rb_tree_fuzzing.cpp index 92370760b5..5e85623c73 100644 --- a/library/cpp/containers/intrusive_rb_tree/fuzz/rb_tree_fuzzing.cpp +++ b/library/cpp/containers/intrusive_rb_tree/fuzz/rb_tree_fuzzing.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/containers/intrusive_rb_tree/rb_tree.h> +#include <library/cpp/containers/intrusive_rb_tree/rb_tree.h> #include <util/generic/deque.h> #include <stdint.h> diff --git a/library/cpp/containers/intrusive_rb_tree/fuzz/ya.make b/library/cpp/containers/intrusive_rb_tree/fuzz/ya.make index 61be9919e6..4e3d967f22 100644 --- a/library/cpp/containers/intrusive_rb_tree/fuzz/ya.make +++ b/library/cpp/containers/intrusive_rb_tree/fuzz/ya.make @@ -10,7 +10,7 @@ SIZE(LARGE) TAG(ya:fat) PEERDIR( - library/cpp/containers/intrusive_rb_tree + library/cpp/containers/intrusive_rb_tree ) SRCS( diff --git a/library/cpp/containers/intrusive_rb_tree/ut/ya.make b/library/cpp/containers/intrusive_rb_tree/ut/ya.make index 6f1e3b38ee..d243014bf5 100644 --- a/library/cpp/containers/intrusive_rb_tree/ut/ya.make +++ b/library/cpp/containers/intrusive_rb_tree/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/containers/intrusive_rb_tree) +UNITTEST_FOR(library/cpp/containers/intrusive_rb_tree) OWNER( pg diff --git a/library/cpp/containers/paged_vector/ut/paged_vector_ut.cpp b/library/cpp/containers/paged_vector/ut/paged_vector_ut.cpp index e867808ee4..04a95e6d25 100644 --- a/library/cpp/containers/paged_vector/ut/paged_vector_ut.cpp +++ b/library/cpp/containers/paged_vector/ut/paged_vector_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/containers/paged_vector/paged_vector.h> +#include <library/cpp/containers/paged_vector/paged_vector.h> #include <library/cpp/testing/unittest/registar.h> #include <stdexcept> diff --git a/library/cpp/containers/paged_vector/ut/ya.make b/library/cpp/containers/paged_vector/ut/ya.make index 74cfe5fb4a..0431261100 100644 --- a/library/cpp/containers/paged_vector/ut/ya.make +++ b/library/cpp/containers/paged_vector/ut/ya.make @@ -3,7 +3,7 @@ UNITTEST() OWNER(velavokr) PEERDIR( - library/cpp/containers/paged_vector + library/cpp/containers/paged_vector ) SRCS( diff --git a/library/cpp/containers/stack_array/ut/tests_ut.cpp b/library/cpp/containers/stack_array/ut/tests_ut.cpp index 3e96384f0e..7495b2b661 100644 --- a/library/cpp/containers/stack_array/ut/tests_ut.cpp +++ b/library/cpp/containers/stack_array/ut/tests_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/containers/stack_array/stack_array.h> +#include <library/cpp/containers/stack_array/stack_array.h> #include <library/cpp/testing/unittest/registar.h> Y_UNIT_TEST_SUITE(TestStackArray) { diff --git a/library/cpp/containers/stack_array/ut/ya.make b/library/cpp/containers/stack_array/ut/ya.make index 7db7340073..2d6551b7f6 100644 --- a/library/cpp/containers/stack_array/ut/ya.make +++ b/library/cpp/containers/stack_array/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/containers/stack_array) +UNITTEST_FOR(library/cpp/containers/stack_array) OWNER(pg) diff --git a/library/cpp/containers/top_keeper/README.md b/library/cpp/containers/top_keeper/README.md index f160fb1c01..b5d3add816 100644 --- a/library/cpp/containers/top_keeper/README.md +++ b/library/cpp/containers/top_keeper/README.md @@ -11,7 +11,7 @@ TopKeeper - структура данных для поддержания "top M 5) Удаляем элементы из правой половины Трудоёмкость: -На M добавлений происходит 1 PartitionSort (усреднённая оценка трудоёмкости - О(M)) и удаление M элементов. Таким образом достигается О(1) операций в среднем на 1 добавление. Для алгоритма TLimitedHeap (library/cpp/containers/limited_heap) - эта оценка О(log (M)) +На M добавлений происходит 1 PartitionSort (усреднённая оценка трудоёмкости - О(M)) и удаление M элементов. Таким образом достигается О(1) операций в среднем на 1 добавление. Для алгоритма TLimitedHeap (library/cpp/containers/limited_heap) - эта оценка О(log (M)) Тесты: На случайных потоках данных количество сравнений у TopKeeper и LimitedHeap одинаково (происходит потому что минимум у первого обновляется раз в M добавлений, а у второго - при каждом добавлении). Худший случай LimitedHeap - сортированная последовательность (добавляем каждый элемент), на таком потоке для 2 000 000 000 int TopKeeper выигрывает во много раз. diff --git a/library/cpp/containers/top_keeper/top_keeper/README.md b/library/cpp/containers/top_keeper/top_keeper/README.md index f160fb1c01..2b0f67b214 100644 --- a/library/cpp/containers/top_keeper/top_keeper/README.md +++ b/library/cpp/containers/top_keeper/top_keeper/README.md @@ -11,7 +11,7 @@ TopKeeper - структура данных для поддержания "top M 5) Удаляем элементы из правой половины Трудоёмкость: -На M добавлений происходит 1 PartitionSort (усреднённая оценка трудоёмкости - О(M)) и удаление M элементов. Таким образом достигается О(1) операций в среднем на 1 добавление. Для алгоритма TLimitedHeap (library/cpp/containers/limited_heap) - эта оценка О(log (M)) +На M добавлений происходит 1 PartitionSort (усреднённая оценка трудоёмкости - О(M)) и удаление M элементов. Таким образом достигается О(1) операций в среднем на 1 добавление. Для алгоритма TLimitedHeap (library/cpp/containers/limited_heap) - эта оценка О(log (M)) Тесты: На случайных потоках данных количество сравнений у TopKeeper и LimitedHeap одинаково (происходит потому что минимум у первого обновляется раз в M добавлений, а у второго - при каждом добавлении). Худший случай LimitedHeap - сортированная последовательность (добавляем каждый элемент), на таком потоке для 2 000 000 000 int TopKeeper выигрывает во много раз. @@ -23,4 +23,4 @@ TopKeeper - структура данных для поддержания "top M В ситуации когда нужны чередующиеся добавления / извлечения - используйте LimitedHeap Примеры использования: -library/cpp/containers/top_keeper/ut +library/cpp/containers/top_keeper/ut diff --git a/library/cpp/containers/top_keeper/top_keeper/ut/top_keeper_ut.cpp b/library/cpp/containers/top_keeper/top_keeper/ut/top_keeper_ut.cpp index a938279025..61bc58ccb5 100644 --- a/library/cpp/containers/top_keeper/top_keeper/ut/top_keeper_ut.cpp +++ b/library/cpp/containers/top_keeper/top_keeper/ut/top_keeper_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/containers/limited_heap/limited_heap.h> -#include <library/cpp/containers/top_keeper/top_keeper.h> +#include <library/cpp/containers/limited_heap/limited_heap.h> +#include <library/cpp/containers/top_keeper/top_keeper.h> #include <library/cpp/testing/unittest/registar.h> #include <util/random/random.h> diff --git a/library/cpp/containers/top_keeper/top_keeper/ut/ya.make b/library/cpp/containers/top_keeper/top_keeper/ut/ya.make index 8553389e17..58bc33c3a9 100644 --- a/library/cpp/containers/top_keeper/top_keeper/ut/ya.make +++ b/library/cpp/containers/top_keeper/top_keeper/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/containers/top_keeper) +UNITTEST_FOR(library/cpp/containers/top_keeper) OWNER( mbusel diff --git a/library/cpp/containers/top_keeper/ut/top_keeper_ut.cpp b/library/cpp/containers/top_keeper/ut/top_keeper_ut.cpp index a938279025..9609b71ea8 100644 --- a/library/cpp/containers/top_keeper/ut/top_keeper_ut.cpp +++ b/library/cpp/containers/top_keeper/ut/top_keeper_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/containers/limited_heap/limited_heap.h> +#include <library/cpp/containers/limited_heap/limited_heap.h> #include <library/cpp/containers/top_keeper/top_keeper.h> #include <library/cpp/testing/unittest/registar.h> #include <util/random/random.h> diff --git a/library/cpp/containers/ya.make b/library/cpp/containers/ya.make index 4b1b315e6a..06daa1be53 100644 --- a/library/cpp/containers/ya.make +++ b/library/cpp/containers/ya.make @@ -1,71 +1,71 @@ RECURSE( 2d_array - absl_flat_hash + absl_flat_hash absl_tstring_flat_hash - atomizer - bitseq - bitseq/ut - compact_vector - compact_vector/ut + atomizer + bitseq + bitseq/ut + compact_vector + compact_vector/ut comptrie comptrie/loader comptrie/loader/ut comptrie/ut comptrie/benchmark concurrent_hash - concurrent_hash_set - concurrent_hash_set/ut - dense_hash - dense_hash/dense_hash_benchmark - dense_hash/ut - dictionary - dictionary/ut + concurrent_hash_set + concurrent_hash_set/ut + dense_hash + dense_hash/dense_hash_benchmark + dense_hash/ut + dictionary + dictionary/ut disjoint_interval_tree disjoint_interval_tree/ut ext_priority_queue ext_priority_queue/ut - fast_trie - fast_trie/ut - flat_hash - flat_hash/benchmark - flat_hash/lib - flat_hash/lib/concepts - flat_hash/lib/fuzz - flat_hash/lib/ut - flat_hash/ut - hash_trie - heap_dict - heap_dict/benchmark - heap_dict/ut - intrusive_avl_tree - intrusive_avl_tree/ut - intrusive_hash - intrusive_hash/ut - intrusive_rb_tree - intrusive_rb_tree/fuzz - intrusive_rb_tree/ut - limited_heap - mh_heap - mh_heap/ut - paged_vector - paged_vector/ut - rarefied_array - ring_buffer - safe_vector - safe_vector/ut - segmented_pool_container + fast_trie + fast_trie/ut + flat_hash + flat_hash/benchmark + flat_hash/lib + flat_hash/lib/concepts + flat_hash/lib/fuzz + flat_hash/lib/ut + flat_hash/ut + hash_trie + heap_dict + heap_dict/benchmark + heap_dict/ut + intrusive_avl_tree + intrusive_avl_tree/ut + intrusive_hash + intrusive_hash/ut + intrusive_rb_tree + intrusive_rb_tree/fuzz + intrusive_rb_tree/ut + limited_heap + mh_heap + mh_heap/ut + paged_vector + paged_vector/ut + rarefied_array + ring_buffer + safe_vector + safe_vector/ut + segmented_pool_container sorted_vector sorted_vector/ut - spars_ar - stack_array - stack_array/ut + spars_ar + stack_array + stack_array/ut stack_vector - str_hash - str_map + str_hash + str_map top_keeper top_keeper/ut - two_level_hash - two_level_hash/ut + two_level_hash + two_level_hash/ut vp_tree vp_tree/ut ) diff --git a/library/cpp/coroutine/engine/cont_poller.h b/library/cpp/coroutine/engine/cont_poller.h index b638b2df1a..a1cd1a71f5 100644 --- a/library/cpp/coroutine/engine/cont_poller.h +++ b/library/cpp/coroutine/engine/cont_poller.h @@ -3,7 +3,7 @@ #include "poller.h" #include "sockmap.h" -#include <library/cpp/containers/intrusive_rb_tree/rb_tree.h> +#include <library/cpp/containers/intrusive_rb_tree/rb_tree.h> #include <util/datetime/base.h> #include <util/memory/pool.h> diff --git a/library/cpp/coroutine/engine/impl.h b/library/cpp/coroutine/engine/impl.h index 283a96ecf1..9065909795 100644 --- a/library/cpp/coroutine/engine/impl.h +++ b/library/cpp/coroutine/engine/impl.h @@ -8,7 +8,7 @@ #include "trampoline.h" #include "custom_time.h" -#include <library/cpp/containers/intrusive_rb_tree/rb_tree.h> +#include <library/cpp/containers/intrusive_rb_tree/rb_tree.h> #include <util/system/error.h> #include <util/generic/ptr.h> diff --git a/library/cpp/coroutine/engine/ya.make b/library/cpp/coroutine/engine/ya.make index 8c20b9afc3..02b0df72ea 100644 --- a/library/cpp/coroutine/engine/ya.make +++ b/library/cpp/coroutine/engine/ya.make @@ -10,7 +10,7 @@ GENERATE_ENUM_SERIALIZATION(stack/stack_common.h) PEERDIR( contrib/libs/libc_compat - library/cpp/containers/intrusive_rb_tree + library/cpp/containers/intrusive_rb_tree ) SRCS( diff --git a/library/cpp/coroutine/listener/listen.cpp b/library/cpp/coroutine/listener/listen.cpp index 3d4e711d1d..6f64976a9f 100644 --- a/library/cpp/coroutine/listener/listen.cpp +++ b/library/cpp/coroutine/listener/listen.cpp @@ -1,7 +1,7 @@ #include "listen.h" -#include <library/cpp/coroutine/engine/impl.h> -#include <library/cpp/coroutine/engine/network.h> +#include <library/cpp/coroutine/engine/impl.h> +#include <library/cpp/coroutine/engine/network.h> #include <util/network/ip.h> #include <util/network/address.h> diff --git a/library/cpp/coroutine/listener/ya.make b/library/cpp/coroutine/listener/ya.make index 700c3abe3e..a291679c7b 100644 --- a/library/cpp/coroutine/listener/ya.make +++ b/library/cpp/coroutine/listener/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(pg) PEERDIR( - library/cpp/coroutine/engine + library/cpp/coroutine/engine ) SRCS( diff --git a/library/cpp/dbg_output/DONT_COMMIT.h b/library/cpp/dbg_output/DONT_COMMIT.h index e7b3182c20..a53cf52103 100644 --- a/library/cpp/dbg_output/DONT_COMMIT.h +++ b/library/cpp/dbg_output/DONT_COMMIT.h @@ -10,7 +10,7 @@ #include "dumpers.cpp" #include "engine.cpp" -#include <library/cpp/colorizer/colors.cpp> -#include <library/cpp/colorizer/output.cpp> +#include <library/cpp/colorizer/colors.cpp> +#include <library/cpp/colorizer/output.cpp> #undef DBGDUMP_INLINE_IF_INCLUDED diff --git a/library/cpp/dbg_output/colorscheme.h b/library/cpp/dbg_output/colorscheme.h index a5b9cf749a..3f32487a95 100644 --- a/library/cpp/dbg_output/colorscheme.h +++ b/library/cpp/dbg_output/colorscheme.h @@ -1,7 +1,7 @@ #pragma once #include "engine.h" -#include <library/cpp/colorizer/output.h> +#include <library/cpp/colorizer/output.h> #ifndef DBG_OUTPUT_DEFAULT_COLOR_SCHEME #define DBG_OUTPUT_DEFAULT_COLOR_SCHEME NDbgDump::NColorScheme::TPlain @@ -68,7 +68,7 @@ namespace NDbgDump { } // Background color modifiers - // TODO: support backgrounds in library/cpp/colorizer + // TODO: support backgrounds in library/cpp/colorizer DBG_OUTPUT_COLOR_HANDLER(Key) { if (Depth++ == 0 && Colors.IsTTY()) { stream << DumpRaw(TStringBuf("\033[42m")); diff --git a/library/cpp/dbg_output/ut/dbg_output_ut.cpp b/library/cpp/dbg_output/ut/dbg_output_ut.cpp index 7b285c84cb..8ebc729e73 100644 --- a/library/cpp/dbg_output/ut/dbg_output_ut.cpp +++ b/library/cpp/dbg_output/ut/dbg_output_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/dbg_output/dump.h> +#include <library/cpp/dbg_output/dump.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/str.h> diff --git a/library/cpp/dbg_output/ut/ya.make b/library/cpp/dbg_output/ut/ya.make index 201601295d..49fa473880 100644 --- a/library/cpp/dbg_output/ut/ya.make +++ b/library/cpp/dbg_output/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/dbg_output) +UNITTEST_FOR(library/cpp/dbg_output) OWNER(pg) diff --git a/library/cpp/dbg_output/ya.make b/library/cpp/dbg_output/ya.make index 7d54108f93..3803157cc2 100644 --- a/library/cpp/dbg_output/ya.make +++ b/library/cpp/dbg_output/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(pg) PEERDIR( - library/cpp/colorizer + library/cpp/colorizer ) SRCS( diff --git a/library/cpp/deprecated/accessors/ut/ya.make b/library/cpp/deprecated/accessors/ut/ya.make index 5ea976566f..bfc2ec5f2d 100644 --- a/library/cpp/deprecated/accessors/ut/ya.make +++ b/library/cpp/deprecated/accessors/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/deprecated/accessors) +UNITTEST_FOR(library/cpp/deprecated/accessors) OWNER(velavokr) diff --git a/library/cpp/deprecated/enum_codegen/ut/ya.make b/library/cpp/deprecated/enum_codegen/ut/ya.make index 32e7ad77a2..d6d05b2960 100644 --- a/library/cpp/deprecated/enum_codegen/ut/ya.make +++ b/library/cpp/deprecated/enum_codegen/ut/ya.make @@ -2,10 +2,10 @@ UNITTEST() OWNER(g:util) -SRCDIR(library/cpp/deprecated/enum_codegen) +SRCDIR(library/cpp/deprecated/enum_codegen) PEERDIR( - library/cpp/deprecated/enum_codegen + library/cpp/deprecated/enum_codegen ) SRCS( diff --git a/library/cpp/deprecated/kmp/ut/ya.make b/library/cpp/deprecated/kmp/ut/ya.make index 9c54ee2715..12aafef305 100644 --- a/library/cpp/deprecated/kmp/ut/ya.make +++ b/library/cpp/deprecated/kmp/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/deprecated/kmp) +UNITTEST_FOR(library/cpp/deprecated/kmp) OWNER(g:util) diff --git a/library/cpp/deprecated/mapped_file/ut/mapped_file_ut.cpp b/library/cpp/deprecated/mapped_file/ut/mapped_file_ut.cpp index afbd5b3358..688f6e6faf 100644 --- a/library/cpp/deprecated/mapped_file/ut/mapped_file_ut.cpp +++ b/library/cpp/deprecated/mapped_file/ut/mapped_file_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/deprecated/mapped_file/mapped_file.h> +#include <library/cpp/deprecated/mapped_file/mapped_file.h> #include <library/cpp/testing/unittest/registar.h> #include <util/system/fs.h> diff --git a/library/cpp/deprecated/split/split_iterator.h b/library/cpp/deprecated/split/split_iterator.h index 0eacc29228..eaf2575623 100644 --- a/library/cpp/deprecated/split/split_iterator.h +++ b/library/cpp/deprecated/split/split_iterator.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/deprecated/kmp/kmp.h> +#include <library/cpp/deprecated/kmp/kmp.h> #include <util/string/cast.h> #include <util/string/util.h> #include <util/string/builder.h> diff --git a/library/cpp/deprecated/split/ya.make b/library/cpp/deprecated/split/ya.make index 946e685ac8..2f5b144655 100644 --- a/library/cpp/deprecated/split/ya.make +++ b/library/cpp/deprecated/split/ya.make @@ -8,7 +8,7 @@ SRCS( ) PEERDIR( - library/cpp/deprecated/kmp + library/cpp/deprecated/kmp ) END() diff --git a/library/cpp/deprecated/ya.make b/library/cpp/deprecated/ya.make index 6c753f68a9..b17f631132 100644 --- a/library/cpp/deprecated/ya.make +++ b/library/cpp/deprecated/ya.make @@ -13,10 +13,10 @@ RECURSE( fgood fgood/ut histogram - ipreg1 - ipreg1/ut - ipreg1/ut_full - ipreg1/util + ipreg1 + ipreg1/ut + ipreg1/ut_full + ipreg1/util iter kmp kmp/ut diff --git a/library/cpp/diff/README.md b/library/cpp/diff/README.md index ff68b10eae..f8021b0aad 100644 --- a/library/cpp/diff/README.md +++ b/library/cpp/diff/README.md @@ -1 +1 @@ -Note: underlying algorithm `library/cpp/lcs` has complexity of O(r log n) by time and O(r) of additional memory, where r is the number of pairs (i, j) for which S1[i] = S2[j]. When comparing file with itself (or with little modifications) it becomes quadratic on the number of occurences of the most frequent line. +Note: underlying algorithm `library/cpp/lcs` has complexity of O(r log n) by time and O(r) of additional memory, where r is the number of pairs (i, j) for which S1[i] = S2[j]. When comparing file with itself (or with little modifications) it becomes quadratic on the number of occurences of the most frequent line. diff --git a/library/cpp/diff/diff.h b/library/cpp/diff/diff.h index 94fb00cd0b..92aeda0f74 100644 --- a/library/cpp/diff/diff.h +++ b/library/cpp/diff/diff.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/lcs/lcs_via_lis.h> +#include <library/cpp/lcs/lcs_via_lis.h> #include <util/generic/algorithm.h> #include <util/generic/array_ref.h> diff --git a/library/cpp/diff/ya.make b/library/cpp/diff/ya.make index a05b7ccbbc..3b48b7a379 100644 --- a/library/cpp/diff/ya.make +++ b/library/cpp/diff/ya.make @@ -3,8 +3,8 @@ LIBRARY() OWNER(antonovvk) PEERDIR( - library/cpp/lcs - library/cpp/containers/stack_array + library/cpp/lcs + library/cpp/containers/stack_array ) SRCS( diff --git a/library/cpp/digest/argonish/README.md b/library/cpp/digest/argonish/README.md index 7b3ae79cca..9fbacd2504 100644 --- a/library/cpp/digest/argonish/README.md +++ b/library/cpp/digest/argonish/README.md @@ -50,7 +50,7 @@ How to use ---------- ``` -#include <library/cpp/digest/argonish/argon2.h> +#include <library/cpp/digest/argonish/argon2.h> ... uint32_t tcost = 1; /* one pass */ uint32_t mcost = 32; /* in KB */ @@ -59,7 +59,7 @@ NArgonish::TArgon2Factory afactory; THolder<NArgonish::IArgon2Base> argon2 = afactory.Create(NArgonish::EArgon2Type::Argon2d, tcost, mcost, threads); argon2->Hash(input, insize, salt, saltsize, out, outlen); ... -#include <library/cpp/digest/argonish/blake2b.h> +#include <library/cpp/digest/argonish/blake2b.h> ... NArgonish::TBlake2BFactory bfactory; uint32_t outlen = 32; diff --git a/library/cpp/digest/argonish/benchmark/mbench.cpp b/library/cpp/digest/argonish/benchmark/mbench.cpp index 178c1169c9..adff57302a 100644 --- a/library/cpp/digest/argonish/benchmark/mbench.cpp +++ b/library/cpp/digest/argonish/benchmark/mbench.cpp @@ -1,5 +1,5 @@ #include <library/cpp/testing/benchmark/bench.h> -#include <library/cpp/digest/argonish/argon2.h> +#include <library/cpp/digest/argonish/argon2.h> Y_CPU_BENCHMARK(Argon2d_2048_REF, iface) { NArgonish::TArgon2Factory factory; diff --git a/library/cpp/digest/argonish/benchmark/ya.make b/library/cpp/digest/argonish/benchmark/ya.make index 5aad1b238f..48f6f826f3 100644 --- a/library/cpp/digest/argonish/benchmark/ya.make +++ b/library/cpp/digest/argonish/benchmark/ya.make @@ -3,7 +3,7 @@ OWNER(e-sidorov) Y_BENCHMARK() PEERDIR( - library/cpp/digest/argonish + library/cpp/digest/argonish ) SRCS( diff --git a/library/cpp/digest/argonish/factory/factory.cpp b/library/cpp/digest/argonish/factory/factory.cpp index c1f5f5ce79..2008f068c2 100644 --- a/library/cpp/digest/argonish/factory/factory.cpp +++ b/library/cpp/digest/argonish/factory/factory.cpp @@ -2,14 +2,14 @@ // Created by Evgeny Sidorov on 12/04/17. // -#include <library/cpp/digest/argonish/blake2b.h> -#include <library/cpp/digest/argonish/argon2.h> -#include <library/cpp/digest/argonish/internal/proxies/ref/proxy_ref.h> +#include <library/cpp/digest/argonish/blake2b.h> +#include <library/cpp/digest/argonish/argon2.h> +#include <library/cpp/digest/argonish/internal/proxies/ref/proxy_ref.h> #if !defined(_arm64_) -#include <library/cpp/digest/argonish/internal/proxies/sse2/proxy_sse2.h> -#include <library/cpp/digest/argonish/internal/proxies/ssse3/proxy_ssse3.h> -#include <library/cpp/digest/argonish/internal/proxies/sse41/proxy_sse41.h> -#include <library/cpp/digest/argonish/internal/proxies/avx2/proxy_avx2.h> +#include <library/cpp/digest/argonish/internal/proxies/sse2/proxy_sse2.h> +#include <library/cpp/digest/argonish/internal/proxies/ssse3/proxy_ssse3.h> +#include <library/cpp/digest/argonish/internal/proxies/sse41/proxy_sse41.h> +#include <library/cpp/digest/argonish/internal/proxies/avx2/proxy_avx2.h> #endif #include <util/system/cpu_id.h> diff --git a/library/cpp/digest/argonish/internal/argon2/argon2_avx2.h b/library/cpp/digest/argonish/internal/argon2/argon2_avx2.h index 8bf5367817..a1697e649b 100644 --- a/library/cpp/digest/argonish/internal/argon2/argon2_avx2.h +++ b/library/cpp/digest/argonish/internal/argon2/argon2_avx2.h @@ -2,7 +2,7 @@ #include <immintrin.h> #include "argon2_base.h" -#include <library/cpp/digest/argonish/internal/blamka/blamka_avx2.h> +#include <library/cpp/digest/argonish/internal/blamka/blamka_avx2.h> namespace NArgonish { template <ui32 mcost, ui32 threads> diff --git a/library/cpp/digest/argonish/internal/argon2/argon2_base.h b/library/cpp/digest/argonish/internal/argon2/argon2_base.h index 2385cc947c..9b7baf491f 100644 --- a/library/cpp/digest/argonish/internal/argon2/argon2_base.h +++ b/library/cpp/digest/argonish/internal/argon2/argon2_base.h @@ -1,13 +1,13 @@ #pragma once #include <util/generic/yexception.h> -#include <library/cpp/digest/argonish/argon2.h> -#include <library/cpp/digest/argonish/internal/blake2b/blake2b.h> +#include <library/cpp/digest/argonish/argon2.h> +#include <library/cpp/digest/argonish/internal/blake2b/blake2b.h> #include <library/cpp/threading/poor_man_openmp/thread_helper.h> namespace NArgonish { const ui32 ARGON2_PREHASH_DIGEST_LENGTH = 64; - const ui32 ARGON2_SECRET_MAX_LENGTH = 64; + const ui32 ARGON2_SECRET_MAX_LENGTH = 64; const ui32 ARGON2_PREHASH_SEED_LENGTH = 72; const ui32 ARGON2_BLOCK_SIZE = 1024; const ui32 ARGON2_QWORDS_IN_BLOCK = ARGON2_BLOCK_SIZE / 8; diff --git a/library/cpp/digest/argonish/internal/argon2/argon2_ref.h b/library/cpp/digest/argonish/internal/argon2/argon2_ref.h index 8e5e3fa971..e57700c19b 100644 --- a/library/cpp/digest/argonish/internal/argon2/argon2_ref.h +++ b/library/cpp/digest/argonish/internal/argon2/argon2_ref.h @@ -1,7 +1,7 @@ #pragma once #include "argon2_base.h" -#include <library/cpp/digest/argonish/internal/rotations/rotations_ref.h> +#include <library/cpp/digest/argonish/internal/rotations/rotations_ref.h> namespace NArgonish { static inline ui64 FBlaMka(ui64 x, ui64 y) { diff --git a/library/cpp/digest/argonish/internal/argon2/argon2_sse2.h b/library/cpp/digest/argonish/internal/argon2/argon2_sse2.h index 1d2230a657..26a5f7023c 100644 --- a/library/cpp/digest/argonish/internal/argon2/argon2_sse2.h +++ b/library/cpp/digest/argonish/internal/argon2/argon2_sse2.h @@ -2,7 +2,7 @@ #include <emmintrin.h> #include "argon2_base.h" -#include <library/cpp/digest/argonish/internal/blamka/blamka_sse2.h> +#include <library/cpp/digest/argonish/internal/blamka/blamka_sse2.h> namespace NArgonish { template <ui32 mcost, ui32 threads> diff --git a/library/cpp/digest/argonish/internal/argon2/argon2_sse41.h b/library/cpp/digest/argonish/internal/argon2/argon2_sse41.h index 1ad35048ea..50069d7a62 100644 --- a/library/cpp/digest/argonish/internal/argon2/argon2_sse41.h +++ b/library/cpp/digest/argonish/internal/argon2/argon2_sse41.h @@ -2,7 +2,7 @@ #include <smmintrin.h> #include "argon2_base.h" -#include <library/cpp/digest/argonish/internal/blamka/blamka_ssse3.h> +#include <library/cpp/digest/argonish/internal/blamka/blamka_ssse3.h> namespace NArgonish { template <ui32 mcost, ui32 threads> diff --git a/library/cpp/digest/argonish/internal/argon2/argon2_ssse3.h b/library/cpp/digest/argonish/internal/argon2/argon2_ssse3.h index a25a416834..78e0aad805 100644 --- a/library/cpp/digest/argonish/internal/argon2/argon2_ssse3.h +++ b/library/cpp/digest/argonish/internal/argon2/argon2_ssse3.h @@ -3,7 +3,7 @@ #include <emmintrin.h> #include <tmmintrin.h> #include "argon2_base.h" -#include <library/cpp/digest/argonish/internal/blamka/blamka_ssse3.h> +#include <library/cpp/digest/argonish/internal/blamka/blamka_ssse3.h> namespace NArgonish { template <ui32 mcost, ui32 threads> diff --git a/library/cpp/digest/argonish/internal/argon2/ya.make b/library/cpp/digest/argonish/internal/argon2/ya.make index 85459865ba..592e014951 100644 --- a/library/cpp/digest/argonish/internal/argon2/ya.make +++ b/library/cpp/digest/argonish/internal/argon2/ya.make @@ -3,8 +3,8 @@ LIBRARY() OWNER(e-sidorov) PEERDIR( - library/cpp/digest/argonish/internal/blamka - library/cpp/digest/argonish/internal/blake2b + library/cpp/digest/argonish/internal/blamka + library/cpp/digest/argonish/internal/blake2b ) END() diff --git a/library/cpp/digest/argonish/internal/blake2b/blake2b.h b/library/cpp/digest/argonish/internal/blake2b/blake2b.h index 3dcfc3fc48..961172210e 100644 --- a/library/cpp/digest/argonish/internal/blake2b/blake2b.h +++ b/library/cpp/digest/argonish/internal/blake2b/blake2b.h @@ -2,7 +2,7 @@ #include <util/generic/yexception.h> #include <util/system/compiler.h> -#include <library/cpp/digest/argonish/blake2b.h> +#include <library/cpp/digest/argonish/blake2b.h> namespace NArgonish { const ui32 BLAKE2B_BLOCKBYTES = 128; diff --git a/library/cpp/digest/argonish/internal/blake2b/blake2b_avx2.h b/library/cpp/digest/argonish/internal/blake2b/blake2b_avx2.h index 359ca90ebb..d232be4b8d 100644 --- a/library/cpp/digest/argonish/internal/blake2b/blake2b_avx2.h +++ b/library/cpp/digest/argonish/internal/blake2b/blake2b_avx2.h @@ -2,7 +2,7 @@ #include <immintrin.h> #include "blake2b.h" -#include <library/cpp/digest/argonish/internal/rotations/rotations_avx2.h> +#include <library/cpp/digest/argonish/internal/rotations/rotations_avx2.h> namespace NArgonish { template <> diff --git a/library/cpp/digest/argonish/internal/blake2b/blake2b_ref.h b/library/cpp/digest/argonish/internal/blake2b/blake2b_ref.h index ef98ed8fc8..665e62fbbd 100644 --- a/library/cpp/digest/argonish/internal/blake2b/blake2b_ref.h +++ b/library/cpp/digest/argonish/internal/blake2b/blake2b_ref.h @@ -1,7 +1,7 @@ #pragma once #include "blake2b.h" -#include <library/cpp/digest/argonish/internal/rotations/rotations_ref.h> +#include <library/cpp/digest/argonish/internal/rotations/rotations_ref.h> namespace NArgonish { static const ui8 Sigma[12][16] = { diff --git a/library/cpp/digest/argonish/internal/blake2b/blake2b_sse2.h b/library/cpp/digest/argonish/internal/blake2b/blake2b_sse2.h index e85a78044c..31e8616fcc 100644 --- a/library/cpp/digest/argonish/internal/blake2b/blake2b_sse2.h +++ b/library/cpp/digest/argonish/internal/blake2b/blake2b_sse2.h @@ -2,7 +2,7 @@ #include <emmintrin.h> #include "blake2b.h" -#include <library/cpp/digest/argonish/internal/rotations/rotations_sse2.h> +#include <library/cpp/digest/argonish/internal/rotations/rotations_sse2.h> namespace NArgonish { template <> diff --git a/library/cpp/digest/argonish/internal/blake2b/blake2b_sse41.h b/library/cpp/digest/argonish/internal/blake2b/blake2b_sse41.h index 1a033bcceb..1aa0b6d126 100644 --- a/library/cpp/digest/argonish/internal/blake2b/blake2b_sse41.h +++ b/library/cpp/digest/argonish/internal/blake2b/blake2b_sse41.h @@ -3,7 +3,7 @@ #include <smmintrin.h> #include "blake2b.h" #include "load_sse41.h" -#include <library/cpp/digest/argonish/internal/rotations/rotations_ssse3.h> +#include <library/cpp/digest/argonish/internal/rotations/rotations_ssse3.h> namespace NArgonish { template <> diff --git a/library/cpp/digest/argonish/internal/blake2b/blake2b_ssse3.h b/library/cpp/digest/argonish/internal/blake2b/blake2b_ssse3.h index 4cca5a5e7f..f37b589f3c 100644 --- a/library/cpp/digest/argonish/internal/blake2b/blake2b_ssse3.h +++ b/library/cpp/digest/argonish/internal/blake2b/blake2b_ssse3.h @@ -3,7 +3,7 @@ #include <emmintrin.h> #include <tmmintrin.h> #include "blake2b.h" -#include <library/cpp/digest/argonish/internal/rotations/rotations_ssse3.h> +#include <library/cpp/digest/argonish/internal/rotations/rotations_ssse3.h> namespace NArgonish { template <> diff --git a/library/cpp/digest/argonish/internal/blake2b/ya.make b/library/cpp/digest/argonish/internal/blake2b/ya.make index 0aa6806b31..9f679c01ca 100644 --- a/library/cpp/digest/argonish/internal/blake2b/ya.make +++ b/library/cpp/digest/argonish/internal/blake2b/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(e-sidorov) PEERDIR( - library/cpp/digest/argonish/internal/rotations + library/cpp/digest/argonish/internal/rotations ) END() diff --git a/library/cpp/digest/argonish/internal/blamka/blamka_avx2.h b/library/cpp/digest/argonish/internal/blamka/blamka_avx2.h index 02c506d6ff..57246a1c55 100644 --- a/library/cpp/digest/argonish/internal/blamka/blamka_avx2.h +++ b/library/cpp/digest/argonish/internal/blamka/blamka_avx2.h @@ -1,7 +1,7 @@ #pragma once #include <immintrin.h> -#include <library/cpp/digest/argonish/internal/rotations/rotations_avx2.h> +#include <library/cpp/digest/argonish/internal/rotations/rotations_avx2.h> namespace NArgonish { static inline void BlamkaG1AVX2( diff --git a/library/cpp/digest/argonish/internal/blamka/blamka_sse2.h b/library/cpp/digest/argonish/internal/blamka/blamka_sse2.h index 1b55651b34..a35342c29a 100644 --- a/library/cpp/digest/argonish/internal/blamka/blamka_sse2.h +++ b/library/cpp/digest/argonish/internal/blamka/blamka_sse2.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/digest/argonish/internal/rotations/rotations_sse2.h> +#include <library/cpp/digest/argonish/internal/rotations/rotations_sse2.h> namespace NArgonish { static inline void BlamkaG1SSE2( diff --git a/library/cpp/digest/argonish/internal/blamka/blamka_ssse3.h b/library/cpp/digest/argonish/internal/blamka/blamka_ssse3.h index 46e8500cd6..81a27353a4 100644 --- a/library/cpp/digest/argonish/internal/blamka/blamka_ssse3.h +++ b/library/cpp/digest/argonish/internal/blamka/blamka_ssse3.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/digest/argonish/internal/rotations/rotations_ssse3.h> +#include <library/cpp/digest/argonish/internal/rotations/rotations_ssse3.h> namespace NArgonish { static inline void BlamkaG1SSSE3( diff --git a/library/cpp/digest/argonish/internal/blamka/ya.make b/library/cpp/digest/argonish/internal/blamka/ya.make index 0aa6806b31..9f679c01ca 100644 --- a/library/cpp/digest/argonish/internal/blamka/ya.make +++ b/library/cpp/digest/argonish/internal/blamka/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(e-sidorov) PEERDIR( - library/cpp/digest/argonish/internal/rotations + library/cpp/digest/argonish/internal/rotations ) END() diff --git a/library/cpp/digest/argonish/internal/proxies/avx2/proxy_avx2.cpp b/library/cpp/digest/argonish/internal/proxies/avx2/proxy_avx2.cpp index c1cf004f58..9602959df4 100644 --- a/library/cpp/digest/argonish/internal/proxies/avx2/proxy_avx2.cpp +++ b/library/cpp/digest/argonish/internal/proxies/avx2/proxy_avx2.cpp @@ -3,10 +3,10 @@ // #include "proxy_avx2.h" -#include <library/cpp/digest/argonish/internal/argon2/argon2_base.h> -#include <library/cpp/digest/argonish/internal/argon2/argon2_avx2.h> -#include <library/cpp/digest/argonish/internal/blake2b/blake2b.h> -#include <library/cpp/digest/argonish/internal/blake2b/blake2b_avx2.h> +#include <library/cpp/digest/argonish/internal/argon2/argon2_base.h> +#include <library/cpp/digest/argonish/internal/argon2/argon2_avx2.h> +#include <library/cpp/digest/argonish/internal/blake2b/blake2b.h> +#include <library/cpp/digest/argonish/internal/blake2b/blake2b_avx2.h> #define ZEROUPPER _mm256_zeroupper(); diff --git a/library/cpp/digest/argonish/internal/proxies/avx2/proxy_avx2.h b/library/cpp/digest/argonish/internal/proxies/avx2/proxy_avx2.h index eec0094563..9d082255d5 100644 --- a/library/cpp/digest/argonish/internal/proxies/avx2/proxy_avx2.h +++ b/library/cpp/digest/argonish/internal/proxies/avx2/proxy_avx2.h @@ -1,9 +1,9 @@ #pragma once #include <util/generic/yexception.h> -#include <library/cpp/digest/argonish/argon2.h> -#include <library/cpp/digest/argonish/blake2b.h> -#include <library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h> +#include <library/cpp/digest/argonish/argon2.h> +#include <library/cpp/digest/argonish/blake2b.h> +#include <library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h> namespace NArgonish { ARGON2_PROXY_CLASS_DECL(AVX2) diff --git a/library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h b/library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h index 5ed5f53b4f..acc2284e60 100644 --- a/library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h +++ b/library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h @@ -45,12 +45,12 @@ ythrow yexception() << "key is null or keylen equals 0 or key is too long"; \ \ ARGON2_INSTANCE_DECL(IS, 1, 1) \ - ARGON2_INSTANCE_DECL(IS, 8, 1) \ + ARGON2_INSTANCE_DECL(IS, 8, 1) \ ARGON2_INSTANCE_DECL(IS, 16, 1) \ ARGON2_INSTANCE_DECL(IS, 32, 1) \ ARGON2_INSTANCE_DECL(IS, 64, 1) \ - ARGON2_INSTANCE_DECL(IS, 128, 1) \ - ARGON2_INSTANCE_DECL(IS, 256, 1) \ + ARGON2_INSTANCE_DECL(IS, 128, 1) \ + ARGON2_INSTANCE_DECL(IS, 256, 1) \ ARGON2_INSTANCE_DECL(IS, 512, 1) \ ARGON2_INSTANCE_DECL(IS, 1024, 1) \ ARGON2_INSTANCE_DECL(IS, 2048, 1) \ diff --git a/library/cpp/digest/argonish/internal/proxies/ref/proxy_ref.cpp b/library/cpp/digest/argonish/internal/proxies/ref/proxy_ref.cpp index 0bc51866fd..9cff2e41ff 100644 --- a/library/cpp/digest/argonish/internal/proxies/ref/proxy_ref.cpp +++ b/library/cpp/digest/argonish/internal/proxies/ref/proxy_ref.cpp @@ -3,10 +3,10 @@ // #include "proxy_ref.h" -#include <library/cpp/digest/argonish/internal/argon2/argon2_base.h> -#include <library/cpp/digest/argonish/internal/argon2/argon2_ref.h> -#include <library/cpp/digest/argonish/internal/blake2b/blake2b.h> -#include <library/cpp/digest/argonish/internal/blake2b/blake2b_ref.h> +#include <library/cpp/digest/argonish/internal/argon2/argon2_base.h> +#include <library/cpp/digest/argonish/internal/argon2/argon2_ref.h> +#include <library/cpp/digest/argonish/internal/blake2b/blake2b.h> +#include <library/cpp/digest/argonish/internal/blake2b/blake2b_ref.h> #include <stdexcept> diff --git a/library/cpp/digest/argonish/internal/proxies/ref/proxy_ref.h b/library/cpp/digest/argonish/internal/proxies/ref/proxy_ref.h index 821abc50cd..9123c4f201 100644 --- a/library/cpp/digest/argonish/internal/proxies/ref/proxy_ref.h +++ b/library/cpp/digest/argonish/internal/proxies/ref/proxy_ref.h @@ -1,9 +1,9 @@ #pragma once #include <util/generic/yexception.h> -#include <library/cpp/digest/argonish/argon2.h> -#include <library/cpp/digest/argonish/blake2b.h> -#include <library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h> +#include <library/cpp/digest/argonish/argon2.h> +#include <library/cpp/digest/argonish/blake2b.h> +#include <library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h> namespace NArgonish { ARGON2_PROXY_CLASS_DECL(REF) diff --git a/library/cpp/digest/argonish/internal/proxies/ref/ya.make b/library/cpp/digest/argonish/internal/proxies/ref/ya.make index 7a15f44611..b38ff92194 100644 --- a/library/cpp/digest/argonish/internal/proxies/ref/ya.make +++ b/library/cpp/digest/argonish/internal/proxies/ref/ya.make @@ -5,9 +5,9 @@ LIBRARY() NO_UTIL() PEERDIR( - library/cpp/digest/argonish/internal/proxies/macro - library/cpp/digest/argonish/internal/argon2 - library/cpp/digest/argonish/internal/blake2b + library/cpp/digest/argonish/internal/proxies/macro + library/cpp/digest/argonish/internal/argon2 + library/cpp/digest/argonish/internal/blake2b ) SRCS( diff --git a/library/cpp/digest/argonish/internal/proxies/sse2/proxy_sse2.cpp b/library/cpp/digest/argonish/internal/proxies/sse2/proxy_sse2.cpp index 3e63c9ad62..16e5c18df6 100644 --- a/library/cpp/digest/argonish/internal/proxies/sse2/proxy_sse2.cpp +++ b/library/cpp/digest/argonish/internal/proxies/sse2/proxy_sse2.cpp @@ -3,10 +3,10 @@ // #include "proxy_sse2.h" -#include <library/cpp/digest/argonish/internal/argon2/argon2_base.h> -#include <library/cpp/digest/argonish/internal/argon2/argon2_sse2.h> -#include <library/cpp/digest/argonish/internal/blake2b/blake2b.h> -#include <library/cpp/digest/argonish/internal/blake2b/blake2b_sse2.h> +#include <library/cpp/digest/argonish/internal/argon2/argon2_base.h> +#include <library/cpp/digest/argonish/internal/argon2/argon2_sse2.h> +#include <library/cpp/digest/argonish/internal/blake2b/blake2b.h> +#include <library/cpp/digest/argonish/internal/blake2b/blake2b_sse2.h> #define ZEROUPPER ; diff --git a/library/cpp/digest/argonish/internal/proxies/sse2/proxy_sse2.h b/library/cpp/digest/argonish/internal/proxies/sse2/proxy_sse2.h index a2b74cd9a7..3173078647 100644 --- a/library/cpp/digest/argonish/internal/proxies/sse2/proxy_sse2.h +++ b/library/cpp/digest/argonish/internal/proxies/sse2/proxy_sse2.h @@ -1,9 +1,9 @@ #pragma once #include <util/generic/yexception.h> -#include <library/cpp/digest/argonish/argon2.h> -#include <library/cpp/digest/argonish/blake2b.h> -#include <library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h> +#include <library/cpp/digest/argonish/argon2.h> +#include <library/cpp/digest/argonish/blake2b.h> +#include <library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h> namespace NArgonish { ARGON2_PROXY_CLASS_DECL(SSE2) diff --git a/library/cpp/digest/argonish/internal/proxies/sse41/proxy_sse41.cpp b/library/cpp/digest/argonish/internal/proxies/sse41/proxy_sse41.cpp index b633ad8cbf..9aa1beb42b 100644 --- a/library/cpp/digest/argonish/internal/proxies/sse41/proxy_sse41.cpp +++ b/library/cpp/digest/argonish/internal/proxies/sse41/proxy_sse41.cpp @@ -3,10 +3,10 @@ // #include "proxy_sse41.h" -#include <library/cpp/digest/argonish/internal/argon2/argon2_base.h> -#include <library/cpp/digest/argonish/internal/argon2/argon2_sse41.h> -#include <library/cpp/digest/argonish/internal/blake2b/blake2b.h> -#include <library/cpp/digest/argonish/internal/blake2b/blake2b_sse41.h> +#include <library/cpp/digest/argonish/internal/argon2/argon2_base.h> +#include <library/cpp/digest/argonish/internal/argon2/argon2_sse41.h> +#include <library/cpp/digest/argonish/internal/blake2b/blake2b.h> +#include <library/cpp/digest/argonish/internal/blake2b/blake2b_sse41.h> #define ZEROUPPER ; diff --git a/library/cpp/digest/argonish/internal/proxies/sse41/proxy_sse41.h b/library/cpp/digest/argonish/internal/proxies/sse41/proxy_sse41.h index 2a4b6614aa..8e7f61404b 100644 --- a/library/cpp/digest/argonish/internal/proxies/sse41/proxy_sse41.h +++ b/library/cpp/digest/argonish/internal/proxies/sse41/proxy_sse41.h @@ -1,9 +1,9 @@ #pragma once #include <util/generic/yexception.h> -#include <library/cpp/digest/argonish/argon2.h> -#include <library/cpp/digest/argonish/blake2b.h> -#include <library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h> +#include <library/cpp/digest/argonish/argon2.h> +#include <library/cpp/digest/argonish/blake2b.h> +#include <library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h> namespace NArgonish { ARGON2_PROXY_CLASS_DECL(SSE41) diff --git a/library/cpp/digest/argonish/internal/proxies/ssse3/proxy_ssse3.cpp b/library/cpp/digest/argonish/internal/proxies/ssse3/proxy_ssse3.cpp index d77b55737c..71b5b5fa27 100644 --- a/library/cpp/digest/argonish/internal/proxies/ssse3/proxy_ssse3.cpp +++ b/library/cpp/digest/argonish/internal/proxies/ssse3/proxy_ssse3.cpp @@ -3,10 +3,10 @@ // #include "proxy_ssse3.h" -#include <library/cpp/digest/argonish/internal/argon2/argon2_base.h> -#include <library/cpp/digest/argonish/internal/argon2/argon2_ssse3.h> -#include <library/cpp/digest/argonish/internal/blake2b/blake2b.h> -#include <library/cpp/digest/argonish/internal/blake2b/blake2b_ssse3.h> +#include <library/cpp/digest/argonish/internal/argon2/argon2_base.h> +#include <library/cpp/digest/argonish/internal/argon2/argon2_ssse3.h> +#include <library/cpp/digest/argonish/internal/blake2b/blake2b.h> +#include <library/cpp/digest/argonish/internal/blake2b/blake2b_ssse3.h> #define ZEROUPPER ; diff --git a/library/cpp/digest/argonish/internal/proxies/ssse3/proxy_ssse3.h b/library/cpp/digest/argonish/internal/proxies/ssse3/proxy_ssse3.h index 994133e88e..a025f99714 100644 --- a/library/cpp/digest/argonish/internal/proxies/ssse3/proxy_ssse3.h +++ b/library/cpp/digest/argonish/internal/proxies/ssse3/proxy_ssse3.h @@ -1,9 +1,9 @@ #pragma once #include <util/generic/yexception.h> -#include <library/cpp/digest/argonish/argon2.h> -#include <library/cpp/digest/argonish/blake2b.h> -#include <library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h> +#include <library/cpp/digest/argonish/argon2.h> +#include <library/cpp/digest/argonish/blake2b.h> +#include <library/cpp/digest/argonish/internal/proxies/macro/proxy_macros.h> namespace NArgonish { ARGON2_PROXY_CLASS_DECL(SSSE3) diff --git a/library/cpp/digest/argonish/ut/ut.cpp b/library/cpp/digest/argonish/ut/ut.cpp index 12ef530a18..e7d8b795b9 100644 --- a/library/cpp/digest/argonish/ut/ut.cpp +++ b/library/cpp/digest/argonish/ut/ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/digest/argonish/argon2.h> -#include <library/cpp/digest/argonish/blake2b.h> +#include <library/cpp/digest/argonish/argon2.h> +#include <library/cpp/digest/argonish/blake2b.h> #include <library/cpp/testing/unittest/registar.h> Y_UNIT_TEST_SUITE(ArgonishTest) { @@ -134,7 +134,7 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { const ui32 mcost = 16; const ui32 tcost = 1; TArrayHolder<ui8> memory(new ui8[mcost * 1024]); - const ui8 TResult[165] = { + const ui8 TResult[165] = { 0xe6, 0xff, 0x7b, 0xa1, 0xfa, 0x93, 0x0a, 0x51, 0x24, 0xf3, 0xbc, 0xc4, 0x98, 0xe2, 0x32, 0x08, 0x22, 0x7d, 0x4d, 0xf9, 0xe7, 0x2c, 0xd2, 0xd8, @@ -163,13 +163,13 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { for (int i = (int)NArgonish::EInstructionSet::REF; i <= (int)maxInstructionSet; ++i) { auto argon2d = factory.Create((NArgonish::EInstructionSet)i, NArgonish::EArgon2Type::Argon2d, tcost, mcost, 1, FrSecret, sizeof(FrSecret)); - ui8 hashResult[sizeof(TResult)]; + ui8 hashResult[sizeof(TResult)]; argon2d->HashWithCustomMemory(memory.Get(), mcost * 1024, FrPassword, sizeof(FrPassword), FrSalt, sizeof(FrSalt), hashResult, sizeof(hashResult)); - UNIT_ASSERT(memcmp(hashResult, TResult, sizeof(hashResult)) == 0); + UNIT_ASSERT(memcmp(hashResult, TResult, sizeof(hashResult)) == 0); UNIT_ASSERT(argon2d->VerifyWithCustomMemory(memory.Get(), mcost * 1024, FrPassword, sizeof(FrPassword), - FrSalt, sizeof(FrSalt), TResult, sizeof(TResult))); + FrSalt, sizeof(FrSalt), TResult, sizeof(TResult))); } } catch (...) { UNIT_FAIL("Argon2 fraction len test fail"); @@ -195,7 +195,7 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { } Y_UNIT_TEST(Argon2d) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x7b, 0xa5, 0xa1, 0x7a, 0x72, 0xf7, 0xe5, 0x99, 0x77, 0xf7, 0xf2, 0x3d, 0x10, 0xe6, 0x21, 0x89, 0x8c, 0x63, 0xce, 0xbe, 0xed, 0xda, 0xbd, 0x15, @@ -212,17 +212,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2d->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2d->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2i) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x87, 0x4d, 0x23, 0xfb, 0x9f, 0x55, 0xe2, 0xff, 0x66, 0xbc, 0x19, 0x03, 0x46, 0xe7, 0x01, 0x19, 0x7c, 0x9f, 0x25, 0xd1, 0x1d, 0xa4, 0x5a, 0xad, @@ -239,17 +239,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2i->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2i->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2id) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x99, 0xdf, 0xcf, 0xc2, 0x89, 0x76, 0x93, 0x9d, 0xa2, 0x97, 0x09, 0x44, 0x34, 0xd8, 0x6f, 0xd0, 0x0c, 0x94, 0x9a, 0x0f, 0x31, 0x8c, 0x22, 0xf0, @@ -266,17 +266,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2id->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2id->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2d_2p) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x59, 0xb0, 0x94, 0x62, 0xcf, 0xdc, 0xd2, 0xb4, 0x0a, 0xbd, 0x17, 0x81, 0x0a, 0x47, 0x4a, 0x8e, 0xc1, 0xab, 0xb7, 0xc1, 0x8d, 0x07, 0x53, 0x7c, @@ -293,17 +293,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2d->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2d->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2i_2p) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0xc1, 0x0f, 0x00, 0x5e, 0xf8, 0x78, 0xc8, 0x07, 0x0e, 0x2c, 0xc5, 0x2f, 0x57, 0x75, 0x25, 0xc9, 0x71, 0xc7, 0x30, 0xeb, 0x00, 0x64, 0x4a, 0x4e, @@ -320,17 +320,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2i->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2i->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2id_2p) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x6c, 0x00, 0xb7, 0xa9, 0x00, 0xe5, 0x00, 0x4c, 0x24, 0x46, 0x9e, 0xc1, 0xe7, 0xc0, 0x1a, 0x99, 0xb2, 0xb8, 0xf7, 0x73, 0x75, 0xd4, 0xec, 0xa7, @@ -347,17 +347,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2id->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2id->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2d_2p_2th) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x2b, 0x47, 0x35, 0x39, 0x4a, 0x40, 0x3c, 0xc9, 0x05, 0xfb, 0x51, 0x25, 0x96, 0x68, 0x64, 0x43, 0x02, 0x16, 0x38, 0xa6, 0xc1, 0x58, 0xfc, 0x8d, @@ -374,17 +374,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2d->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2d->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2id_2p_4th) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x4f, 0x93, 0xb5, 0xad, 0x78, 0xa4, 0xa9, 0x49, 0xfb, 0xe3, 0x55, 0x96, 0xd5, 0xa0, 0xc2, 0xab, 0x6f, 0x52, 0x2d, 0x2d, 0x29, 0xbc, 0x98, 0x49, @@ -401,17 +401,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2id->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2id->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2d_2p_4th) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x8f, 0xa2, 0x7c, 0xed, 0x28, 0x38, 0x79, 0x0f, 0xba, 0x5c, 0x11, 0x85, 0x1c, 0xdf, 0x90, 0x88, 0xb2, 0x18, 0x44, 0xd7, 0xf0, 0x4c, 0x97, 0xb2, @@ -428,17 +428,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2d->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2d->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2i_2p_4th) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x61, 0x1c, 0x99, 0x3c, 0xb0, 0xb7, 0x23, 0x16, 0xbd, 0xa2, 0x6c, 0x4c, 0x2f, 0xe8, 0x2d, 0x39, 0x9c, 0x8f, 0x1c, 0xfd, 0x45, 0xd9, 0x58, 0xa9, @@ -455,17 +455,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2i->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2i->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2d_128) { - const ui8 TResult[128] = { + const ui8 TResult[128] = { 0x4e, 0xc4, 0x6c, 0x4e, 0x8c, 0x32, 0x89, 0x65, 0xf9, 0x82, 0x2b, 0x00, 0x95, 0x00, 0x50, 0x0a, 0x72, 0x0d, 0xc5, 0x12, 0x8d, 0x6b, 0xbd, 0x84, @@ -494,17 +494,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2d->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2d->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Blake2B_16_ABC) { - const ui8 TResult[16] = { + const ui8 TResult[16] = { 0xcf, 0x4a, 0xb7, 0x91, 0xc6, 0x2b, 0x8d, 0x2b, 0x21, 0x09, 0xc9, 0x02, 0x75, 0x28, 0x78, 0x16}; const ui8 data[] = {'a', 'b', 'c'}; @@ -512,18 +512,18 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { NArgonish::TBlake2BFactory factory; NArgonish::EInstructionSet maxInstructionSet = factory.GetInstructionSet(); for (int i = (int)NArgonish::EInstructionSet::REF; i <= (int)maxInstructionSet; ++i) { - auto blake2b = factory.Create((NArgonish::EInstructionSet)i, sizeof(TResult)); + auto blake2b = factory.Create((NArgonish::EInstructionSet)i, sizeof(TResult)); ui8 hashResult[16] = {0}; blake2b->Update(data, sizeof(data)); blake2b->Final(hashResult, sizeof(hashResult)); - UNIT_ASSERT(memcmp(hashResult, TResult, sizeof(TResult)) == 0); + UNIT_ASSERT(memcmp(hashResult, TResult, sizeof(TResult)) == 0); } } Y_UNIT_TEST(Blake2B_64_ABC) { - const ui8 TResult[64] = { + const ui8 TResult[64] = { 0xba, 0x80, 0xa5, 0x3f, 0x98, 0x1c, 0x4d, 0x0d, 0x6a, 0x27, 0x97, 0xb6, 0x9f, 0x12, 0xf6, 0xe9, 0x4c, 0x21, 0x2f, 0x14, 0x68, 0x5a, 0xc4, 0xb7, @@ -537,13 +537,13 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { NArgonish::TBlake2BFactory factory; NArgonish::EInstructionSet maxInstructionSet = factory.GetInstructionSet(); for (int i = (int)NArgonish::EInstructionSet::REF; i <= (int)maxInstructionSet; ++i) { - auto blake2b = factory.Create((NArgonish::EInstructionSet)i, sizeof(TResult)); + auto blake2b = factory.Create((NArgonish::EInstructionSet)i, sizeof(TResult)); ui8 hashResult[64] = {0}; blake2b->Update(data, sizeof(data)); blake2b->Final(hashResult, sizeof(hashResult)); - UNIT_ASSERT(memcmp(hashResult, TResult, sizeof(TResult)) == 0); + UNIT_ASSERT(memcmp(hashResult, TResult, sizeof(TResult)) == 0); } } } diff --git a/library/cpp/digest/argonish/ut/ya.make b/library/cpp/digest/argonish/ut/ya.make index 3440908799..965f23a5df 100644 --- a/library/cpp/digest/argonish/ut/ya.make +++ b/library/cpp/digest/argonish/ut/ya.make @@ -1,9 +1,9 @@ -UNITTEST_FOR(library/cpp/digest/argonish) +UNITTEST_FOR(library/cpp/digest/argonish) OWNER(e-sidorov) PEERDIR( - library/cpp/digest/argonish + library/cpp/digest/argonish ) SRCS( diff --git a/library/cpp/digest/argonish/ut_fat/ut.cpp b/library/cpp/digest/argonish/ut_fat/ut.cpp index 41fa001685..535b6d588a 100644 --- a/library/cpp/digest/argonish/ut_fat/ut.cpp +++ b/library/cpp/digest/argonish/ut_fat/ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/digest/argonish/argon2.h> -#include <library/cpp/digest/argonish/blake2b.h> +#include <library/cpp/digest/argonish/argon2.h> +#include <library/cpp/digest/argonish/blake2b.h> #include <library/cpp/testing/unittest/registar.h> Y_UNIT_TEST_SUITE(ArgonishTest) { @@ -100,7 +100,7 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { } Y_UNIT_TEST(Argon2d) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x7b, 0xa5, 0xa1, 0x7a, 0x72, 0xf7, 0xe5, 0x99, 0x77, 0xf7, 0xf2, 0x3d, 0x10, 0xe6, 0x21, 0x89, 0x8c, 0x63, 0xce, 0xbe, 0xed, 0xda, 0xbd, 0x15, @@ -116,17 +116,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2d->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2d->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2i) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x87, 0x4d, 0x23, 0xfb, 0x9f, 0x55, 0xe2, 0xff, 0x66, 0xbc, 0x19, 0x03, 0x46, 0xe7, 0x01, 0x19, 0x7c, 0x9f, 0x25, 0xd1, 0x1d, 0xa4, 0x5a, 0xad, @@ -142,17 +142,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2i->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2i->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2id) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x99, 0xdf, 0xcf, 0xc2, 0x89, 0x76, 0x93, 0x9d, 0xa2, 0x97, 0x09, 0x44, 0x34, 0xd8, 0x6f, 0xd0, 0x0c, 0x94, 0x9a, 0x0f, 0x31, 0x8c, 0x22, 0xf0, @@ -168,17 +168,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2id->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2id->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2d_2p) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x59, 0xb0, 0x94, 0x62, 0xcf, 0xdc, 0xd2, 0xb4, 0x0a, 0xbd, 0x17, 0x81, 0x0a, 0x47, 0x4a, 0x8e, 0xc1, 0xab, 0xb7, 0xc1, 0x8d, 0x07, 0x53, 0x7c, @@ -194,17 +194,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2d->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2d->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2i_2p) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0xc1, 0x0f, 0x00, 0x5e, 0xf8, 0x78, 0xc8, 0x07, 0x0e, 0x2c, 0xc5, 0x2f, 0x57, 0x75, 0x25, 0xc9, 0x71, 0xc7, 0x30, 0xeb, 0x00, 0x64, 0x4a, 0x4e, @@ -220,17 +220,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2i->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2i->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2id_2p) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x6c, 0x00, 0xb7, 0xa9, 0x00, 0xe5, 0x00, 0x4c, 0x24, 0x46, 0x9e, 0xc1, 0xe7, 0xc0, 0x1a, 0x99, 0xb2, 0xb8, 0xf7, 0x73, 0x75, 0xd4, 0xec, 0xa7, @@ -246,17 +246,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2id->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2id->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2d_2p_2th) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x2b, 0x47, 0x35, 0x39, 0x4a, 0x40, 0x3c, 0xc9, 0x05, 0xfb, 0x51, 0x25, 0x96, 0x68, 0x64, 0x43, 0x02, 0x16, 0x38, 0xa6, 0xc1, 0x58, 0xfc, 0x8d, @@ -272,17 +272,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2d->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2d->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2id_2p_4th) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x4f, 0x93, 0xb5, 0xad, 0x78, 0xa4, 0xa9, 0x49, 0xfb, 0xe3, 0x55, 0x96, 0xd5, 0xa0, 0xc2, 0xab, 0x6f, 0x52, 0x2d, 0x2d, 0x29, 0xbc, 0x98, 0x49, @@ -298,17 +298,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2id->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2id->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2d_2p_4th) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x8f, 0xa2, 0x7c, 0xed, 0x28, 0x38, 0x79, 0x0f, 0xba, 0x5c, 0x11, 0x85, 0x1c, 0xdf, 0x90, 0x88, 0xb2, 0x18, 0x44, 0xd7, 0xf0, 0x4c, 0x97, 0xb2, @@ -324,17 +324,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2d->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2d->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2i_2p_4th) { - const ui8 TResult[32] = { + const ui8 TResult[32] = { 0x61, 0x1c, 0x99, 0x3c, 0xb0, 0xb7, 0x23, 0x16, 0xbd, 0xa2, 0x6c, 0x4c, 0x2f, 0xe8, 0x2d, 0x39, 0x9c, 0x8f, 0x1c, 0xfd, 0x45, 0xd9, 0x58, 0xa9, @@ -350,17 +350,17 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2i->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2i->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Argon2d_128) { - const ui8 TResult[128] = { + const ui8 TResult[128] = { 0x4e, 0xc4, 0x6c, 0x4e, 0x8c, 0x32, 0x89, 0x65, 0xf9, 0x82, 0x2b, 0x00, 0x95, 0x00, 0x50, 0x0a, 0x72, 0x0d, 0xc5, 0x12, 0x8d, 0x6b, 0xbd, 0x84, @@ -388,35 +388,35 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { argon2d->Hash(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), result, sizeof(result), GenKatAAD, sizeof(GenKatAAD)); - UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); + UNIT_ASSERT(memcmp(result, TResult, sizeof(result)) == 0); UNIT_ASSERT(argon2d->Verify(GenKatPassword, sizeof(GenKatPassword), GenKatSalt, sizeof(GenKatSalt), - TResult, sizeof(TResult), + TResult, sizeof(TResult), GenKatAAD, sizeof(GenKatAAD))); } } Y_UNIT_TEST(Blake2B_16_ABC) { - const ui8 TResult[16] = { + const ui8 TResult[16] = { 0xcf, 0x4a, 0xb7, 0x91, 0xc6, 0x2b, 0x8d, 0x2b, 0x21, 0x09, 0xc9, 0x02, 0x75, 0x28, 0x78, 0x16}; const ui8 data[] = {'a', 'b', 'c'}; NArgonish::TBlake2BFactory factory; for (int i = (int)NArgonish::EInstructionSet::REF; i <= (int)MaxArch; ++i) { - auto blake2b = factory.Create((NArgonish::EInstructionSet)i, sizeof(TResult)); + auto blake2b = factory.Create((NArgonish::EInstructionSet)i, sizeof(TResult)); ui8 hashResult[16] = {0}; blake2b->Update(data, sizeof(data)); blake2b->Final(hashResult, sizeof(hashResult)); - UNIT_ASSERT(memcmp(hashResult, TResult, sizeof(TResult)) == 0); + UNIT_ASSERT(memcmp(hashResult, TResult, sizeof(TResult)) == 0); } } Y_UNIT_TEST(Blake2B_64_ABC) { - const ui8 TResult[64] = { + const ui8 TResult[64] = { 0xba, 0x80, 0xa5, 0x3f, 0x98, 0x1c, 0x4d, 0x0d, 0x6a, 0x27, 0x97, 0xb6, 0x9f, 0x12, 0xf6, 0xe9, 0x4c, 0x21, 0x2f, 0x14, 0x68, 0x5a, 0xc4, 0xb7, @@ -429,13 +429,13 @@ Y_UNIT_TEST_SUITE(ArgonishTest) { NArgonish::TBlake2BFactory factory; for (int i = (int)NArgonish::EInstructionSet::REF; i <= (int)(int)MaxArch; ++i) { - auto blake2b = factory.Create((NArgonish::EInstructionSet)i, sizeof(TResult)); + auto blake2b = factory.Create((NArgonish::EInstructionSet)i, sizeof(TResult)); ui8 hashResult[64] = {0}; blake2b->Update(data, sizeof(data)); blake2b->Final(hashResult, sizeof(hashResult)); - UNIT_ASSERT(memcmp(hashResult, TResult, sizeof(TResult)) == 0); + UNIT_ASSERT(memcmp(hashResult, TResult, sizeof(TResult)) == 0); } } } diff --git a/library/cpp/digest/argonish/ut_fat/ya.make b/library/cpp/digest/argonish/ut_fat/ya.make index 94ebda9225..2d79d1b50d 100644 --- a/library/cpp/digest/argonish/ut_fat/ya.make +++ b/library/cpp/digest/argonish/ut_fat/ya.make @@ -1,9 +1,9 @@ -UNITTEST_FOR(library/cpp/digest/argonish) +UNITTEST_FOR(library/cpp/digest/argonish) OWNER(e-sidorov) PEERDIR( - library/cpp/digest/argonish + library/cpp/digest/argonish ) SRCS( diff --git a/library/cpp/digest/crc32c/ut/ya.make b/library/cpp/digest/crc32c/ut/ya.make index 325622e080..08b2cca955 100644 --- a/library/cpp/digest/crc32c/ut/ya.make +++ b/library/cpp/digest/crc32c/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/digest/crc32c) +UNITTEST_FOR(library/cpp/digest/crc32c) OWNER(pg) diff --git a/library/cpp/digest/lower_case/ut/ya.make b/library/cpp/digest/lower_case/ut/ya.make index f083257b3d..8ab3a5564d 100644 --- a/library/cpp/digest/lower_case/ut/ya.make +++ b/library/cpp/digest/lower_case/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/digest/lower_case) +UNITTEST_FOR(library/cpp/digest/lower_case) OWNER( pg diff --git a/library/cpp/digest/md5/bench/main.cpp b/library/cpp/digest/md5/bench/main.cpp index 70672e6741..488fa26771 100644 --- a/library/cpp/digest/md5/bench/main.cpp +++ b/library/cpp/digest/md5/bench/main.cpp @@ -1,6 +1,6 @@ #include <benchmark/benchmark.h> -#include <library/cpp/digest/md5/md5.h> +#include <library/cpp/digest/md5/md5.h> #define MD5_DEF(N) \ static void MD5Benchmark_##N(benchmark::State& st) { \ diff --git a/library/cpp/digest/md5/bench/ya.make b/library/cpp/digest/md5/bench/ya.make index 5c3e3c1c42..35abaeae30 100644 --- a/library/cpp/digest/md5/bench/ya.make +++ b/library/cpp/digest/md5/bench/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/digest/md5 + library/cpp/digest/md5 ) SRCS( diff --git a/library/cpp/digest/md5/medium_ut/ya.make b/library/cpp/digest/md5/medium_ut/ya.make index 418c57f086..7b895a5c00 100644 --- a/library/cpp/digest/md5/medium_ut/ya.make +++ b/library/cpp/digest/md5/medium_ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/digest/md5) +UNITTEST_FOR(library/cpp/digest/md5) SIZE(MEDIUM) diff --git a/library/cpp/digest/md5/ut/ya.make b/library/cpp/digest/md5/ut/ya.make index ad1eddbff2..caff598a3f 100644 --- a/library/cpp/digest/md5/ut/ya.make +++ b/library/cpp/digest/md5/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/digest/md5) +UNITTEST_FOR(library/cpp/digest/md5) OWNER( pg diff --git a/library/cpp/digest/old_crc/crc.cpp b/library/cpp/digest/old_crc/crc.cpp index 994755f34d..d363edd2ef 100644 --- a/library/cpp/digest/old_crc/crc.cpp +++ b/library/cpp/digest/old_crc/crc.cpp @@ -1,6 +1,6 @@ #include "crc.h" -#include <library/cpp/digest/old_crc/crc.inc> +#include <library/cpp/digest/old_crc/crc.inc> #include <util/system/defaults.h> diff --git a/library/cpp/digest/old_crc/ut/ya.make b/library/cpp/digest/old_crc/ut/ya.make index a783bbae5b..070b838811 100644 --- a/library/cpp/digest/old_crc/ut/ya.make +++ b/library/cpp/digest/old_crc/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/digest/old_crc) +UNITTEST_FOR(library/cpp/digest/old_crc) OWNER( pg diff --git a/library/cpp/digest/old_crc/ya.make b/library/cpp/digest/old_crc/ya.make index aa6ea8f6c5..477e0030de 100644 --- a/library/cpp/digest/old_crc/ya.make +++ b/library/cpp/digest/old_crc/ya.make @@ -10,7 +10,7 @@ SRCS( ) RUN_PROGRAM( - library/cpp/digest/old_crc/gencrc + library/cpp/digest/old_crc/gencrc STDOUT crc.inc ) diff --git a/library/cpp/digest/sfh/ut/ya.make b/library/cpp/digest/sfh/ut/ya.make index 256a66295a..258d586f24 100644 --- a/library/cpp/digest/sfh/ut/ya.make +++ b/library/cpp/digest/sfh/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/digest/sfh) +UNITTEST_FOR(library/cpp/digest/sfh) OWNER( pg diff --git a/library/cpp/dns/ut/dns_ut.cpp b/library/cpp/dns/ut/dns_ut.cpp index aae05a742c..d91cd77783 100644 --- a/library/cpp/dns/ut/dns_ut.cpp +++ b/library/cpp/dns/ut/dns_ut.cpp @@ -1,5 +1,5 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/dns/cache.h> +#include <library/cpp/dns/cache.h> #include <util/network/address.h> Y_UNIT_TEST_SUITE(TestDNS) { diff --git a/library/cpp/dns/ut/ya.make b/library/cpp/dns/ut/ya.make index 7cfd0c4c32..f7d06c347b 100644 --- a/library/cpp/dns/ut/ya.make +++ b/library/cpp/dns/ut/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/dns + library/cpp/dns ) SRCS( diff --git a/library/cpp/enumbitset/ut/ya.make b/library/cpp/enumbitset/ut/ya.make index c893e6eb13..aae9e33042 100644 --- a/library/cpp/enumbitset/ut/ya.make +++ b/library/cpp/enumbitset/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/enumbitset) +UNITTEST_FOR(library/cpp/enumbitset) OWNER(alzobnin) diff --git a/library/cpp/execprofile/autostart/start.cpp b/library/cpp/execprofile/autostart/start.cpp index 4fffb03ae1..4b5d41b8a4 100644 --- a/library/cpp/execprofile/autostart/start.cpp +++ b/library/cpp/execprofile/autostart/start.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/execprofile/profile.h> +#include <library/cpp/execprofile/profile.h> namespace { struct TInit { diff --git a/library/cpp/execprofile/autostart/ya.make b/library/cpp/execprofile/autostart/ya.make index a5b61f075f..9305a13048 100644 --- a/library/cpp/execprofile/autostart/ya.make +++ b/library/cpp/execprofile/autostart/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(pg) PEERDIR( - library/cpp/execprofile + library/cpp/execprofile ) SRCS( diff --git a/library/cpp/getopt/last_getopt_demo/demo.cpp b/library/cpp/getopt/last_getopt_demo/demo.cpp index 79426a9cc9..ddcd9ea1de 100644 --- a/library/cpp/getopt/last_getopt_demo/demo.cpp +++ b/library/cpp/getopt/last_getopt_demo/demo.cpp @@ -1,6 +1,6 @@ #include <library/cpp/getopt/last_getopt.h> #include <library/cpp/getopt/modchooser.h> -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> // For the sake of this example, let's implement Wget diff --git a/library/cpp/getopt/print.cpp b/library/cpp/getopt/print.cpp index 8cf1c62e4d..d2c46477af 100644 --- a/library/cpp/getopt/print.cpp +++ b/library/cpp/getopt/print.cpp @@ -6,8 +6,8 @@ #include "posix_getopt.h" #include "ygetopt.h" -#include <library/cpp/svnversion/svnversion.h> -#include <library/cpp/build_info/build_info.h> +#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/build_info/build_info.h> namespace NLastGetoptPrivate { TString InitVersionString() { diff --git a/library/cpp/getopt/small/completer_command.cpp b/library/cpp/getopt/small/completer_command.cpp index 5e593eec7e..2027ebbd77 100644 --- a/library/cpp/getopt/small/completer_command.cpp +++ b/library/cpp/getopt/small/completer_command.cpp @@ -4,7 +4,7 @@ #include "last_getopt.h" #include "wrap.h" -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> #include <util/string/subst.h> diff --git a/library/cpp/getopt/small/last_getopt_opts.cpp b/library/cpp/getopt/small/last_getopt_opts.cpp index 03c432849f..488a814d6e 100644 --- a/library/cpp/getopt/small/last_getopt_opts.cpp +++ b/library/cpp/getopt/small/last_getopt_opts.cpp @@ -3,7 +3,7 @@ #include "wrap.h" #include "last_getopt_parser.h" -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> #include <util/stream/format.h> #include <util/charset/utf8.h> diff --git a/library/cpp/getopt/small/last_getopt_opts.h b/library/cpp/getopt/small/last_getopt_opts.h index 825b99c871..9112cb3b1c 100644 --- a/library/cpp/getopt/small/last_getopt_opts.h +++ b/library/cpp/getopt/small/last_getopt_opts.h @@ -2,7 +2,7 @@ #include "last_getopt_opt.h" -#include <library/cpp/colorizer/fwd.h> +#include <library/cpp/colorizer/fwd.h> #include <util/generic/map.h> diff --git a/library/cpp/getopt/small/last_getopt_parser.cpp b/library/cpp/getopt/small/last_getopt_parser.cpp index 7668b12a03..bd7ded5e14 100644 --- a/library/cpp/getopt/small/last_getopt_parser.cpp +++ b/library/cpp/getopt/small/last_getopt_parser.cpp @@ -1,6 +1,6 @@ #include "last_getopt_parser.h" -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> #include <util/string/escape.h> diff --git a/library/cpp/getopt/small/last_getopt_parser.h b/library/cpp/getopt/small/last_getopt_parser.h index 2cf8a6c308..2860218ca4 100644 --- a/library/cpp/getopt/small/last_getopt_parser.h +++ b/library/cpp/getopt/small/last_getopt_parser.h @@ -2,7 +2,7 @@ #include "last_getopt_opts.h" -#include <library/cpp/colorizer/fwd.h> +#include <library/cpp/colorizer/fwd.h> #include <util/generic/hash_set.h> #include <util/generic/list.h> diff --git a/library/cpp/getopt/small/modchooser.cpp b/library/cpp/getopt/small/modchooser.cpp index 2fa5cfd070..71df8e3d9a 100644 --- a/library/cpp/getopt/small/modchooser.cpp +++ b/library/cpp/getopt/small/modchooser.cpp @@ -4,7 +4,7 @@ #include "last_getopt.h" #include "modchooser.h" -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> #include <util/stream/output.h> #include <util/stream/format.h> diff --git a/library/cpp/getopt/small/wrap.cpp b/library/cpp/getopt/small/wrap.cpp index 9fbd38842a..08032c8de5 100644 --- a/library/cpp/getopt/small/wrap.cpp +++ b/library/cpp/getopt/small/wrap.cpp @@ -1,6 +1,6 @@ #include "wrap.h" -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> #include <util/generic/string.h> #include <util/stream/str.h> diff --git a/library/cpp/getopt/small/ya.make b/library/cpp/getopt/small/ya.make index 96de0f04b1..941096d8c6 100644 --- a/library/cpp/getopt/small/ya.make +++ b/library/cpp/getopt/small/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(pg) PEERDIR( - library/cpp/colorizer + library/cpp/colorizer ) SRCS( diff --git a/library/cpp/getopt/ut/last_getopt_ut.cpp b/library/cpp/getopt/ut/last_getopt_ut.cpp index c99a1d053d..ffa9c0399c 100644 --- a/library/cpp/getopt/ut/last_getopt_ut.cpp +++ b/library/cpp/getopt/ut/last_getopt_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/getopt/last_getopt.h> -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> #include <library/cpp/testing/unittest/registar.h> #include <util/generic/array_size.h> diff --git a/library/cpp/getopt/ya.make b/library/cpp/getopt/ya.make index 6df23b22b2..99c49e8118 100644 --- a/library/cpp/getopt/ya.make +++ b/library/cpp/getopt/ya.make @@ -4,8 +4,8 @@ OWNER(pg) PEERDIR( library/cpp/getopt/small - library/cpp/svnversion - library/cpp/build_info + library/cpp/svnversion + library/cpp/build_info ) SRCS( diff --git a/library/cpp/grpc/server/grpc_request.h b/library/cpp/grpc/server/grpc_request.h index 5bd8d3902b..034de84776 100644 --- a/library/cpp/grpc/server/grpc_request.h +++ b/library/cpp/grpc/server/grpc_request.h @@ -5,7 +5,7 @@ #include <google/protobuf/message.h> #include <library/cpp/monlib/dynamic_counters/counters.h> -#include <library/cpp/logger/priority.h> +#include <library/cpp/logger/priority.h> #include "grpc_response.h" #include "event_callback.h" diff --git a/library/cpp/histogram/adaptive/adaptive_histogram.h b/library/cpp/histogram/adaptive/adaptive_histogram.h index fa8f48433f..b9155a9f0d 100644 --- a/library/cpp/histogram/adaptive/adaptive_histogram.h +++ b/library/cpp/histogram/adaptive/adaptive_histogram.h @@ -3,7 +3,7 @@ #include "histogram.h" #include "common.h" -#include <library/cpp/histogram/adaptive/protos/histo.pb.h> +#include <library/cpp/histogram/adaptive/protos/histo.pb.h> #include <util/generic/ptr.h> #include <util/generic/set.h> diff --git a/library/cpp/histogram/adaptive/auto_histogram.h b/library/cpp/histogram/adaptive/auto_histogram.h index 9fdf0b9abe..f25ffd5435 100644 --- a/library/cpp/histogram/adaptive/auto_histogram.h +++ b/library/cpp/histogram/adaptive/auto_histogram.h @@ -4,7 +4,7 @@ #include "fixed_bin_histogram.h" #include "histogram.h" -#include <library/cpp/histogram/adaptive/protos/histo.pb.h> +#include <library/cpp/histogram/adaptive/protos/histo.pb.h> #include <util/generic/ptr.h> #include <util/generic/yexception.h> diff --git a/library/cpp/histogram/adaptive/block_histogram.cpp b/library/cpp/histogram/adaptive/block_histogram.cpp index 6586d13ff6..cb558eac5c 100644 --- a/library/cpp/histogram/adaptive/block_histogram.cpp +++ b/library/cpp/histogram/adaptive/block_histogram.cpp @@ -1,6 +1,6 @@ #include "block_histogram.h" -#include <library/cpp/histogram/adaptive/protos/histo.pb.h> +#include <library/cpp/histogram/adaptive/protos/histo.pb.h> #include <util/generic/algorithm.h> #include <util/generic/yexception.h> diff --git a/library/cpp/histogram/adaptive/block_histogram.h b/library/cpp/histogram/adaptive/block_histogram.h index 266bb2f2b2..1f7c5227fb 100644 --- a/library/cpp/histogram/adaptive/block_histogram.h +++ b/library/cpp/histogram/adaptive/block_histogram.h @@ -3,7 +3,7 @@ #include "histogram.h" #include "common.h" -#include <library/cpp/histogram/adaptive/protos/histo.pb.h> +#include <library/cpp/histogram/adaptive/protos/histo.pb.h> #include <util/generic/ptr.h> #include <util/generic/vector.h> diff --git a/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp b/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp index 558aba9e2d..41df8d5677 100644 --- a/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp +++ b/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp @@ -1,7 +1,7 @@ #include "fixed_bin_histogram.h" #include "auto_histogram.h" -#include <library/cpp/histogram/adaptive/protos/histo.pb.h> +#include <library/cpp/histogram/adaptive/protos/histo.pb.h> #include <util/generic/algorithm.h> #include <util/generic/yexception.h> diff --git a/library/cpp/histogram/adaptive/fixed_bin_histogram.h b/library/cpp/histogram/adaptive/fixed_bin_histogram.h index bd380bd94a..7894e9543c 100644 --- a/library/cpp/histogram/adaptive/fixed_bin_histogram.h +++ b/library/cpp/histogram/adaptive/fixed_bin_histogram.h @@ -2,7 +2,7 @@ #include "histogram.h" -#include <library/cpp/histogram/adaptive/protos/histo.pb.h> +#include <library/cpp/histogram/adaptive/protos/histo.pb.h> #include <util/generic/ptr.h> #include <util/generic/vector.h> diff --git a/library/cpp/histogram/adaptive/multi_histogram.h b/library/cpp/histogram/adaptive/multi_histogram.h index 41caac5ba6..011eb6de4c 100644 --- a/library/cpp/histogram/adaptive/multi_histogram.h +++ b/library/cpp/histogram/adaptive/multi_histogram.h @@ -3,7 +3,7 @@ #include "histogram.h" #include "auto_histogram.h" -#include <library/cpp/histogram/adaptive/protos/histo.pb.h> +#include <library/cpp/histogram/adaptive/protos/histo.pb.h> #include <util/generic/hash.h> #include <util/generic/ptr.h> diff --git a/library/cpp/histogram/adaptive/protos/python/ya.make b/library/cpp/histogram/adaptive/protos/python/ya.make index 3328c27965..3f2e13eed1 100644 --- a/library/cpp/histogram/adaptive/protos/python/ya.make +++ b/library/cpp/histogram/adaptive/protos/python/ya.make @@ -1,3 +1,3 @@ OWNER(abogutskiy) -PY_PROTOS_FOR(library/cpp/histogram/adaptive/protos) +PY_PROTOS_FOR(library/cpp/histogram/adaptive/protos) diff --git a/library/cpp/histogram/adaptive/ya.make b/library/cpp/histogram/adaptive/ya.make index b589801b27..50789152e9 100644 --- a/library/cpp/histogram/adaptive/ya.make +++ b/library/cpp/histogram/adaptive/ya.make @@ -14,7 +14,7 @@ SRCS( PEERDIR( contrib/libs/protobuf - library/cpp/histogram/adaptive/protos + library/cpp/histogram/adaptive/protos ) END() diff --git a/library/cpp/histogram/hdr/ut/ya.make b/library/cpp/histogram/hdr/ut/ya.make index 13ceb143c8..83c65dbdde 100644 --- a/library/cpp/histogram/hdr/ut/ya.make +++ b/library/cpp/histogram/hdr/ut/ya.make @@ -3,7 +3,7 @@ OWNER( jamel ) -UNITTEST_FOR(library/cpp/histogram/hdr) +UNITTEST_FOR(library/cpp/histogram/hdr) SRCS( histogram_ut.cpp diff --git a/library/cpp/html/escape/ut/escape_ut.cpp b/library/cpp/html/escape/ut/escape_ut.cpp index cd7b955138..4fadc4ede4 100644 --- a/library/cpp/html/escape/ut/escape_ut.cpp +++ b/library/cpp/html/escape/ut/escape_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/html/escape/escape.h> +#include <library/cpp/html/escape/escape.h> #include <library/cpp/testing/unittest/registar.h> using namespace NHtml; diff --git a/library/cpp/html/escape/ut/ya.make b/library/cpp/html/escape/ut/ya.make index 27d3a3d65a..9fadd6a76a 100644 --- a/library/cpp/html/escape/ut/ya.make +++ b/library/cpp/html/escape/ut/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/html/escape + library/cpp/html/escape ) END() diff --git a/library/cpp/html/pcdata/ut/ya.make b/library/cpp/html/pcdata/ut/ya.make index bc947baa89..e6d136fe84 100644 --- a/library/cpp/html/pcdata/ut/ya.make +++ b/library/cpp/html/pcdata/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/html/pcdata) +UNITTEST_FOR(library/cpp/html/pcdata) OWNER(vladon) diff --git a/library/cpp/html/ya.make b/library/cpp/html/ya.make index ab904be3b9..a20dcac956 100644 --- a/library/cpp/html/ya.make +++ b/library/cpp/html/ya.make @@ -1,32 +1,32 @@ RECURSE( - dehtml - dehtml/ut - detect - blob - entity - entity/ut - escape - escape/ut - face - face/blob - html5 - html5/tests - html5/ut - lexer - lexer/ut - pcdata - pcdata/ut - pdoc - print - relalternate - relalternate/ut + dehtml + dehtml/ut + detect + blob + entity + entity/ut + escape + escape/ut + face + face/blob + html5 + html5/tests + html5/ut + lexer + lexer/ut + pcdata + pcdata/ut + pdoc + print + relalternate + relalternate/ut sanitize - spec - storage - storage/ut - strip - tree - url - zoneconf - zoneconf/ut + spec + storage + storage/ut + strip + tree + url + zoneconf + zoneconf/ut ) diff --git a/library/cpp/http/fetch/exthttpcodes.h b/library/cpp/http/fetch/exthttpcodes.h index 6b525052cd..a24352210d 100644 --- a/library/cpp/http/fetch/exthttpcodes.h +++ b/library/cpp/http/fetch/exthttpcodes.h @@ -1,7 +1,7 @@ #pragma once #include <util/system/defaults.h> -#include <library/cpp/http/misc/httpcodes.h> +#include <library/cpp/http/misc/httpcodes.h> enum ExtHttpCodes { // Custom diff --git a/library/cpp/http/fetch/http_digest.cpp b/library/cpp/http/fetch/http_digest.cpp index 1eaa02b7f2..76ed887dd2 100644 --- a/library/cpp/http/fetch/http_digest.cpp +++ b/library/cpp/http/fetch/http_digest.cpp @@ -1,6 +1,6 @@ #include "http_digest.h" -#include <library/cpp/digest/md5/md5.h> +#include <library/cpp/digest/md5/md5.h> #include <util/stream/output.h> #include <util/stream/str.h> diff --git a/library/cpp/http/fetch/http_digest.h b/library/cpp/http/fetch/http_digest.h index 3b1872d70b..c32a38570e 100644 --- a/library/cpp/http/fetch/http_digest.h +++ b/library/cpp/http/fetch/http_digest.h @@ -3,7 +3,7 @@ #include "httpheader.h" #include <util/system/compat.h> -#include <library/cpp/http/misc/httpcodes.h> +#include <library/cpp/http/misc/httpcodes.h> class httpDigestHandler { protected: diff --git a/library/cpp/http/fetch/httpfetcher.h b/library/cpp/http/fetch/httpfetcher.h index 7fc251afd2..019dd6492c 100644 --- a/library/cpp/http/fetch/httpfetcher.h +++ b/library/cpp/http/fetch/httpfetcher.h @@ -4,7 +4,7 @@ #include <io.h> #endif -#include <library/cpp/http/misc/httpdate.h> +#include <library/cpp/http/misc/httpdate.h> #include "httpagent.h" #include "httpparser.h" diff --git a/library/cpp/http/fetch/httpfsm.rl6 b/library/cpp/http/fetch/httpfsm.rl6 index eab0328b18..3485539a68 100644 --- a/library/cpp/http/fetch/httpfsm.rl6 +++ b/library/cpp/http/fetch/httpfsm.rl6 @@ -1,15 +1,15 @@ #include <stdio.h> #include <time.h> -#include <library/cpp/charset/doccodes.h> -#include <library/cpp/charset/codepage.h> -#include <library/cpp/http/misc/httpcodes.h> +#include <library/cpp/charset/doccodes.h> +#include <library/cpp/charset/codepage.h> +#include <library/cpp/http/misc/httpcodes.h> #include <util/datetime/base.h> #include <util/generic/ylimits.h> #include <algorithm> // max -#include <library/cpp/http/fetch/httpheader.h> -#include <library/cpp/http/fetch/httpfsm.h> +#include <library/cpp/http/fetch/httpheader.h> +#include <library/cpp/http/fetch/httpfsm.h> #ifdef _MSC_VER #pragma warning(disable: 4702) // unreachable code @@ -39,7 +39,7 @@ static inline void setguarded(x &val, long cnt) { %%{ machine http_header_parser; -include HttpDateTimeParser "../../../../util/datetime/parser.rl6"; +include HttpDateTimeParser "../../../../util/datetime/parser.rl6"; alphtype unsigned char; diff --git a/library/cpp/http/fetch/httpfsm_ut.cpp b/library/cpp/http/fetch/httpfsm_ut.cpp index b018e80101..66518bc8c5 100644 --- a/library/cpp/http/fetch/httpfsm_ut.cpp +++ b/library/cpp/http/fetch/httpfsm_ut.cpp @@ -3,7 +3,7 @@ #include "library-htfetch_ut_hreflang_out.h" #include <util/generic/ptr.h> -#include <library/cpp/charset/doccodes.h> +#include <library/cpp/charset/doccodes.h> #include <library/cpp/testing/unittest/registar.h> class THttpHeaderParserTestSuite: public TTestBase { diff --git a/library/cpp/http/fetch/httpheader.h b/library/cpp/http/fetch/httpheader.h index b2810bbd41..3bec3e0709 100644 --- a/library/cpp/http/fetch/httpheader.h +++ b/library/cpp/http/fetch/httpheader.h @@ -2,7 +2,7 @@ #include "exthttpcodes.h" -#include <library/cpp/mime/types/mime.h> +#include <library/cpp/mime/types/mime.h> #include <util/system/defaults.h> #include <util/system/compat.h> diff --git a/library/cpp/http/fetch/httpload.h b/library/cpp/http/fetch/httpload.h index e22e4b809e..44b7b2790a 100644 --- a/library/cpp/http/fetch/httpload.h +++ b/library/cpp/http/fetch/httpload.h @@ -7,8 +7,8 @@ #include <util/system/compat.h> #include <util/string/vector.h> #include <util/network/ip.h> -#include <library/cpp/uri/http_url.h> -#include <library/cpp/http/misc/httpcodes.h> +#include <library/cpp/uri/http_url.h> +#include <library/cpp/http/misc/httpcodes.h> /********************************************************/ // Section 1: socket handlers diff --git a/library/cpp/http/fetch/httpparser.h b/library/cpp/http/fetch/httpparser.h index 769828e4ae..caf3fb8cc1 100644 --- a/library/cpp/http/fetch/httpparser.h +++ b/library/cpp/http/fetch/httpparser.h @@ -3,9 +3,9 @@ #include "httpfsm.h" #include "httpheader.h" -#include <library/cpp/mime/types/mime.h> +#include <library/cpp/mime/types/mime.h> #include <util/system/yassert.h> -#include <library/cpp/http/misc/httpcodes.h> +#include <library/cpp/http/misc/httpcodes.h> template <size_t headermax = 100 << 10, size_t bodymax = 1 << 20> struct TFakeCheck { diff --git a/library/cpp/http/fetch/ut/ya.make b/library/cpp/http/fetch/ut/ya.make index 7486986b36..7e44099e23 100644 --- a/library/cpp/http/fetch/ut/ya.make +++ b/library/cpp/http/fetch/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/http/fetch) +UNITTEST_FOR(library/cpp/http/fetch) OWNER( g:zora diff --git a/library/cpp/http/fetch/ya.make b/library/cpp/http/fetch/ya.make index 7737127463..8c1b086bb7 100644 --- a/library/cpp/http/fetch/ya.make +++ b/library/cpp/http/fetch/ya.make @@ -6,12 +6,12 @@ OWNER( PEERDIR( contrib/libs/zlib - library/cpp/charset - library/cpp/digest/md5 - library/cpp/http/misc - library/cpp/logger - library/cpp/mime/types - library/cpp/uri + library/cpp/charset + library/cpp/digest/md5 + library/cpp/http/misc + library/cpp/logger + library/cpp/mime/types + library/cpp/uri ) SRCS( diff --git a/library/cpp/http/io/compression.cpp b/library/cpp/http/io/compression.cpp index 8fa1f62ae6..be4210f27d 100644 --- a/library/cpp/http/io/compression.cpp +++ b/library/cpp/http/io/compression.cpp @@ -1,15 +1,15 @@ #include "compression.h" #if defined(ENABLE_GPL) -#include <library/cpp/streams/lz/lz.h> +#include <library/cpp/streams/lz/lz.h> #endif -#include <library/cpp/streams/brotli/brotli.h> -#include <library/cpp/streams/lzma/lzma.h> -#include <library/cpp/streams/bzip2/bzip2.h> +#include <library/cpp/streams/brotli/brotli.h> +#include <library/cpp/streams/lzma/lzma.h> +#include <library/cpp/streams/bzip2/bzip2.h> -#include <library/cpp/blockcodecs/stream.h> -#include <library/cpp/blockcodecs/codecs.h> +#include <library/cpp/blockcodecs/stream.h> +#include <library/cpp/blockcodecs/codecs.h> #include <util/stream/zlib.h> diff --git a/library/cpp/http/io/fuzz/main.cpp b/library/cpp/http/io/fuzz/main.cpp index 8ded9c7e32..1553015281 100644 --- a/library/cpp/http/io/fuzz/main.cpp +++ b/library/cpp/http/io/fuzz/main.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/http/io/stream.h> +#include <library/cpp/http/io/stream.h> #include <util/generic/vector.h> #include <util/stream/mem.h> diff --git a/library/cpp/http/io/fuzz/ya.make b/library/cpp/http/io/fuzz/ya.make index 8b3ccb1969..2226bdbb7e 100644 --- a/library/cpp/http/io/fuzz/ya.make +++ b/library/cpp/http/io/fuzz/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/http/io + library/cpp/http/io ) SIZE(MEDIUM) diff --git a/library/cpp/http/io/headers_ut.cpp b/library/cpp/http/io/headers_ut.cpp index 1d23ef8fdc..883dd0d786 100644 --- a/library/cpp/http/io/headers_ut.cpp +++ b/library/cpp/http/io/headers_ut.cpp @@ -3,7 +3,7 @@ #include <util/generic/strbuf.h> #include <utility> -#include <library/cpp/http/io/headers.h> +#include <library/cpp/http/io/headers.h> #include <library/cpp/testing/unittest/registar.h> namespace { diff --git a/library/cpp/http/io/list_codings/main.cpp b/library/cpp/http/io/list_codings/main.cpp index 9818d02bdf..20f9df4a26 100644 --- a/library/cpp/http/io/list_codings/main.cpp +++ b/library/cpp/http/io/list_codings/main.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/http/io/stream.h> +#include <library/cpp/http/io/stream.h> #include <util/stream/output.h> int main() { diff --git a/library/cpp/http/io/list_codings/ya.make b/library/cpp/http/io/list_codings/ya.make index e5c5fed6dc..02ded23816 100644 --- a/library/cpp/http/io/list_codings/ya.make +++ b/library/cpp/http/io/list_codings/ya.make @@ -3,7 +3,7 @@ PROGRAM() OWNER(pg) PEERDIR( - library/cpp/http/io + library/cpp/http/io ) SRCS( diff --git a/library/cpp/http/io/stream.cpp b/library/cpp/http/io/stream.cpp index 6689be684f..89942c4748 100644 --- a/library/cpp/http/io/stream.cpp +++ b/library/cpp/http/io/stream.cpp @@ -139,7 +139,7 @@ public: , Buffered_(Slave_, SuggestBufferSize()) , ChunkedInput_(nullptr) , Input_(nullptr) - , FirstLine_(ReadFirstLine(Buffered_)) + , FirstLine_(ReadFirstLine(Buffered_)) , Headers_(&Buffered_) , KeepAlive_(false) , HasContentLength_(false) @@ -151,12 +151,12 @@ public: Y_ASSERT(Input_); } - static TString ReadFirstLine(TBufferedInput& in) { - TString s; - Y_ENSURE_EX(in.ReadLine(s), THttpReadException() << "Failed to get first line"); - return s; - } - + static TString ReadFirstLine(TBufferedInput& in) { + TString s; + Y_ENSURE_EX(in.ReadLine(s), THttpReadException() << "Failed to get first line"); + return s; + } + inline ~TImpl() { } diff --git a/library/cpp/http/io/stream.h b/library/cpp/http/io/stream.h index 78ca4fc814..0f46920e0c 100644 --- a/library/cpp/http/io/stream.h +++ b/library/cpp/http/io/stream.h @@ -18,9 +18,9 @@ struct THttpException: public yexception { struct THttpParseException: public THttpException { }; -struct THttpReadException: public THttpException { -}; - +struct THttpReadException: public THttpException { +}; + /// Чтение ответа HTTP-сервера. class THttpInput: public IInputStream { public: diff --git a/library/cpp/http/io/stream_ut.cpp b/library/cpp/http/io/stream_ut.cpp index 1ea35df675..9ad15ad7ac 100644 --- a/library/cpp/http/io/stream_ut.cpp +++ b/library/cpp/http/io/stream_ut.cpp @@ -1,7 +1,7 @@ #include "stream.h" #include "chunk.h" -#include <library/cpp/http/server/http_ex.h> +#include <library/cpp/http/server/http_ex.h> #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/tests_data.h> diff --git a/library/cpp/http/io/ut/medium/ya.make b/library/cpp/http/io/ut/medium/ya.make index 235a23dcd7..1c51e783fb 100644 --- a/library/cpp/http/io/ut/medium/ya.make +++ b/library/cpp/http/io/ut/medium/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/http/io) +UNITTEST_FOR(library/cpp/http/io) SIZE(MEDIUM) diff --git a/library/cpp/http/io/ut/ya.make b/library/cpp/http/io/ut/ya.make index 84f6949db3..8f79421039 100644 --- a/library/cpp/http/io/ut/ya.make +++ b/library/cpp/http/io/ut/ya.make @@ -1,9 +1,9 @@ -UNITTEST_FOR(library/cpp/http/io) +UNITTEST_FOR(library/cpp/http/io) OWNER(g:util) PEERDIR( - library/cpp/http/server + library/cpp/http/server ) SRCS( diff --git a/library/cpp/http/io/ya.make b/library/cpp/http/io/ya.make index dcfbd79885..90dd4679ad 100644 --- a/library/cpp/http/io/ya.make +++ b/library/cpp/http/io/ya.make @@ -6,10 +6,10 @@ OWNER( ) PEERDIR( - library/cpp/blockcodecs - library/cpp/streams/brotli - library/cpp/streams/bzip2 - library/cpp/streams/lzma + library/cpp/blockcodecs + library/cpp/streams/brotli + library/cpp/streams/bzip2 + library/cpp/streams/lzma ) SRCS( diff --git a/library/cpp/http/misc/httpreqdata.h b/library/cpp/http/misc/httpreqdata.h index 16e59c4d78..fe3eaea5ba 100644 --- a/library/cpp/http/misc/httpreqdata.h +++ b/library/cpp/http/misc/httpreqdata.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/digest/lower_case/hash_ops.h> +#include <library/cpp/digest/lower_case/hash_ops.h> #include <util/str_stl.h> diff --git a/library/cpp/http/misc/ut/ya.make b/library/cpp/http/misc/ut/ya.make index f4bdd35662..fcfa5bdbbf 100644 --- a/library/cpp/http/misc/ut/ya.make +++ b/library/cpp/http/misc/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/http/misc) +UNITTEST_FOR(library/cpp/http/misc) OWNER(g:util) diff --git a/library/cpp/http/misc/ya.make b/library/cpp/http/misc/ya.make index fceb3cf79c..5e52839870 100644 --- a/library/cpp/http/misc/ya.make +++ b/library/cpp/http/misc/ya.make @@ -16,7 +16,7 @@ SRCS( PEERDIR( library/cpp/cgiparam - library/cpp/digest/lower_case + library/cpp/digest/lower_case ) END() diff --git a/library/cpp/http/server/conn.h b/library/cpp/http/server/conn.h index 3aa5329af4..3ac4788bc2 100644 --- a/library/cpp/http/server/conn.h +++ b/library/cpp/http/server/conn.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/http/io/stream.h> +#include <library/cpp/http/io/stream.h> #include <util/generic/ptr.h> class TSocket; diff --git a/library/cpp/http/server/http.h b/library/cpp/http/server/http.h index b292d38f27..015cac718b 100644 --- a/library/cpp/http/server/http.h +++ b/library/cpp/http/server/http.h @@ -4,7 +4,7 @@ #include "options.h" #include <util/thread/pool.h> -#include <library/cpp/http/io/stream.h> +#include <library/cpp/http/io/stream.h> #include <util/memory/blob.h> #include <util/generic/ptr.h> #include <util/generic/vector.h> diff --git a/library/cpp/http/server/http_ex.h b/library/cpp/http/server/http_ex.h index 1ef43ea4fd..e6d082881f 100644 --- a/library/cpp/http/server/http_ex.h +++ b/library/cpp/http/server/http_ex.h @@ -2,7 +2,7 @@ #include "http.h" -#include <library/cpp/http/misc/httpreqdata.h> +#include <library/cpp/http/misc/httpreqdata.h> class THttpClientRequestExtension: public TClientRequest { public: diff --git a/library/cpp/http/server/response.h b/library/cpp/http/server/response.h index a75cb85605..0ae08b9b06 100644 --- a/library/cpp/http/server/response.h +++ b/library/cpp/http/server/response.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/http/misc/httpcodes.h> -#include <library/cpp/http/io/stream.h> +#include <library/cpp/http/misc/httpcodes.h> +#include <library/cpp/http/io/stream.h> #include <util/generic/strbuf.h> #include <util/string/cast.h> diff --git a/library/cpp/http/server/ut/ya.make b/library/cpp/http/server/ut/ya.make index bcb4d4c0b8..d81231448a 100644 --- a/library/cpp/http/server/ut/ya.make +++ b/library/cpp/http/server/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/http/server) +UNITTEST_FOR(library/cpp/http/server) OWNER(pg) diff --git a/library/cpp/http/server/ya.make b/library/cpp/http/server/ya.make index bae6f33306..d5db661500 100644 --- a/library/cpp/http/server/ya.make +++ b/library/cpp/http/server/ya.make @@ -17,8 +17,8 @@ SRCS( ) PEERDIR( - library/cpp/http/misc - library/cpp/http/io + library/cpp/http/misc + library/cpp/http/io library/cpp/threading/equeue ) diff --git a/library/cpp/http/ya.make b/library/cpp/http/ya.make index fa2d1edef6..158e9167e8 100644 --- a/library/cpp/http/ya.make +++ b/library/cpp/http/ya.make @@ -1,25 +1,25 @@ -RECURSE( - client - client/cookies - cookies - coro - examples - fetch +RECURSE( + client + client/cookies + cookies + coro + examples + fetch fetch_gpl - io - io/fuzz - io/list_codings - misc - multipart - push_parser - server - simple - static -) - -IF (NOT OS_WINDOWS) - RECURSE_FOR_TESTS( - io/ut - io/ut/medium - ) -ENDIF() + io + io/fuzz + io/list_codings + misc + multipart + push_parser + server + simple + static +) + +IF (NOT OS_WINDOWS) + RECURSE_FOR_TESTS( + io/ut + io/ut/medium + ) +ENDIF() diff --git a/library/cpp/hyperloglog/ut/ya.make b/library/cpp/hyperloglog/ut/ya.make index f5f1c0d25a..76789b2644 100644 --- a/library/cpp/hyperloglog/ut/ya.make +++ b/library/cpp/hyperloglog/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/hyperloglog) +UNITTEST_FOR(library/cpp/hyperloglog) OWNER( anskor diff --git a/library/cpp/int128/bench/main.cpp b/library/cpp/int128/bench/main.cpp index be4f8d1500..aeb5e8e833 100644 --- a/library/cpp/int128/bench/main.cpp +++ b/library/cpp/int128/bench/main.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/int128/int128.h> +#include <library/cpp/int128/int128.h> #include <library/cpp/testing/benchmark/bench.h> #include <util/generic/xrange.h> diff --git a/library/cpp/int128/bench/ya.make b/library/cpp/int128/bench/ya.make index 4800e7883d..df833a6786 100644 --- a/library/cpp/int128/bench/ya.make +++ b/library/cpp/int128/bench/ya.make @@ -9,7 +9,7 @@ SRCS( ) PEERDIR( - library/cpp/int128 + library/cpp/int128 ) END() diff --git a/library/cpp/int128/ut/i128_and_intrinsic_identity_ut.cpp b/library/cpp/int128/ut/i128_and_intrinsic_identity_ut.cpp index dbb7507a73..9b23acfa14 100644 --- a/library/cpp/int128/ut/i128_and_intrinsic_identity_ut.cpp +++ b/library/cpp/int128/ut/i128_and_intrinsic_identity_ut.cpp @@ -2,7 +2,7 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/int128/int128.h> +#include <library/cpp/int128/int128.h> #include <util/generic/cast.h> diff --git a/library/cpp/int128/ut/i128_comparison_ut.cpp b/library/cpp/int128/ut/i128_comparison_ut.cpp index 7b8d508815..4f8915f861 100644 --- a/library/cpp/int128/ut/i128_comparison_ut.cpp +++ b/library/cpp/int128/ut/i128_comparison_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/int128/int128.h> +#include <library/cpp/int128/int128.h> #include <util/generic/cast.h> diff --git a/library/cpp/int128/ut/i128_division_ut.cpp b/library/cpp/int128/ut/i128_division_ut.cpp index 46b0ca27f5..45123abf80 100644 --- a/library/cpp/int128/ut/i128_division_ut.cpp +++ b/library/cpp/int128/ut/i128_division_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/int128/int128.h> +#include <library/cpp/int128/int128.h> #include <util/generic/cast.h> diff --git a/library/cpp/int128/ut/i128_type_traits_ut.cpp b/library/cpp/int128/ut/i128_type_traits_ut.cpp index 4ed87bf229..c330ae0362 100644 --- a/library/cpp/int128/ut/i128_type_traits_ut.cpp +++ b/library/cpp/int128/ut/i128_type_traits_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/int128/int128.h> +#include <library/cpp/int128/int128.h> #include <util/generic/cast.h> diff --git a/library/cpp/int128/ut/i128_ut.cpp b/library/cpp/int128/ut/i128_ut.cpp index c196d132a2..46477ad17f 100644 --- a/library/cpp/int128/ut/i128_ut.cpp +++ b/library/cpp/int128/ut/i128_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/int128/int128.h> +#include <library/cpp/int128/int128.h> #include <util/generic/cast.h> diff --git a/library/cpp/int128/ut/int128_old_ut.cpp b/library/cpp/int128/ut/int128_old_ut.cpp index 2c5b9e9610..ea61740e56 100644 --- a/library/cpp/int128/ut/int128_old_ut.cpp +++ b/library/cpp/int128/ut/int128_old_ut.cpp @@ -1,5 +1,5 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/int128/int128.h> +#include <library/cpp/int128/int128.h> #include "int128_ut_helpers.h" diff --git a/library/cpp/int128/ut/int128_typetraits_ut.cpp b/library/cpp/int128/ut/int128_typetraits_ut.cpp index fd5f19d7b8..8329f2463e 100644 --- a/library/cpp/int128/ut/int128_typetraits_ut.cpp +++ b/library/cpp/int128/ut/int128_typetraits_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/int128/int128.h> +#include <library/cpp/int128/int128.h> #include <type_traits> diff --git a/library/cpp/int128/ut/int128_ut.cpp b/library/cpp/int128/ut/int128_ut.cpp index 7339264017..e38910186c 100644 --- a/library/cpp/int128/ut/int128_ut.cpp +++ b/library/cpp/int128/ut/int128_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/int128/int128.h> +#include <library/cpp/int128/int128.h> #include <util/generic/cast.h> diff --git a/library/cpp/int128/ut/int128_ut_helpers.h b/library/cpp/int128/ut/int128_ut_helpers.h index b7778c3f32..2ad19a8999 100644 --- a/library/cpp/int128/ut/int128_ut_helpers.h +++ b/library/cpp/int128/ut/int128_ut_helpers.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/int128/int128.h> +#include <library/cpp/int128/int128.h> #include <array> diff --git a/library/cpp/int128/ut/int128_via_intrinsic_ut.cpp b/library/cpp/int128/ut/int128_via_intrinsic_ut.cpp index 9decc2fd48..3924f6d743 100644 --- a/library/cpp/int128/ut/int128_via_intrinsic_ut.cpp +++ b/library/cpp/int128/ut/int128_via_intrinsic_ut.cpp @@ -1,34 +1,34 @@ -#include <library/cpp/int128/int128.h> - +#include <library/cpp/int128/int128.h> + #include <library/cpp/testing/unittest/registar.h> - + // from https://a.yandex-team.ru/arc/trunk/arcadia/library/ticket_parser/c/src/ut/utils_ut.cpp?rev=4221861 - + #if defined(Y_HAVE_INT128) Y_UNIT_TEST_SUITE(Int128ViaIntrinsicSuite) { - using guint128_t = unsigned __int128; + using guint128_t = unsigned __int128; guint128_t toGcc(ui128 num) { - guint128_t res = 0; + guint128_t res = 0; res |= GetLow(num); res |= guint128_t(GetHigh(num)) << 64; - return res; - } - + return res; + } + Y_UNIT_TEST(bigintTest) { UNIT_ASSERT(guint128_t(127) == toGcc(ui128(127))); UNIT_ASSERT(guint128_t(127) * guint128_t(127) == toGcc(ui128(127) * ui128(127))); UNIT_ASSERT(guint128_t(127) + guint128_t(127) == toGcc(ui128(127) + ui128(127))); UNIT_ASSERT(guint128_t(127) << 3 == toGcc(ui128(127) << 3)); UNIT_ASSERT(guint128_t(127) >> 1 == toGcc(ui128(127) >> 1)); - + UNIT_ASSERT(guint128_t(1000000000027UL) * guint128_t(1000000000027UL) == toGcc(ui128(1000000000027UL) * ui128(1000000000027UL))); UNIT_ASSERT(guint128_t(1000000000027UL) + guint128_t(1000000000027UL) == toGcc(ui128(1000000000027UL) + ui128(1000000000027UL))); UNIT_ASSERT(guint128_t(1000000000027UL) << 3 == toGcc(ui128(1000000000027UL) << 3)); UNIT_ASSERT(guint128_t(1000000000027UL) >> 1 == toGcc(ui128(1000000000027UL) >> 1)); UNIT_ASSERT((guint128_t(1000000000027UL) * guint128_t(1000000000027UL)) << 3 == toGcc((ui128(1000000000027UL) * ui128(1000000000027UL)) << 3)); UNIT_ASSERT((guint128_t(1000000000027UL) + guint128_t(1000000000027UL)) >> 1 == toGcc((ui128(1000000000027UL) + ui128(1000000000027UL)) >> 1)); - + UNIT_ASSERT((ui64)(guint128_t(1000000000027UL) * guint128_t(1000000000027UL)) == GetLow(ui128(1000000000027UL) * ui128(1000000000027UL))); - } -} + } +} #endif diff --git a/library/cpp/int128/ut/ui128_division_ut.cpp b/library/cpp/int128/ut/ui128_division_ut.cpp index 4826a531e0..0073838c32 100644 --- a/library/cpp/int128/ut/ui128_division_ut.cpp +++ b/library/cpp/int128/ut/ui128_division_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/int128/int128.h> +#include <library/cpp/int128/int128.h> #include <util/generic/cast.h> diff --git a/library/cpp/int128/ut/ya.make b/library/cpp/int128/ut/ya.make index fd43531c5f..98612fbee3 100644 --- a/library/cpp/int128/ut/ya.make +++ b/library/cpp/int128/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/int128) +UNITTEST_FOR(library/cpp/int128) OWNER(vladon) diff --git a/library/cpp/ipmath/ipmath_ut.cpp b/library/cpp/ipmath/ipmath_ut.cpp index 5fe459ecc8..8e5e6e776b 100644 --- a/library/cpp/ipmath/ipmath_ut.cpp +++ b/library/cpp/ipmath/ipmath_ut.cpp @@ -2,7 +2,7 @@ #include "range_set.h" #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/testing/gmock_in_unittest/gmock.h> +#include <library/cpp/testing/gmock_in_unittest/gmock.h> #include <library/cpp/ipv6_address/ipv6_address.h> diff --git a/library/cpp/ipmath/ut/ya.make b/library/cpp/ipmath/ut/ya.make index b860cefd03..74b0a1ab86 100644 --- a/library/cpp/ipmath/ut/ya.make +++ b/library/cpp/ipmath/ut/ya.make @@ -10,7 +10,7 @@ SRCS( ) PEERDIR( - library/cpp/testing/gmock_in_unittest + library/cpp/testing/gmock_in_unittest ) END() diff --git a/library/cpp/ipv6_address/ipv6_address.h b/library/cpp/ipv6_address/ipv6_address.h index 1d7eb0b65f..802af84816 100644 --- a/library/cpp/ipv6_address/ipv6_address.h +++ b/library/cpp/ipv6_address/ipv6_address.h @@ -4,7 +4,7 @@ #include <util/network/ip.h> #include <util/stream/input.h> -#include <library/cpp/int128/int128.h> +#include <library/cpp/int128/int128.h> #if defined(_freebsd_) // #include required to avoid problem with undefined 'socklen_t' on FreeBSD diff --git a/library/cpp/ipv6_address/ut/ipv6_address_ut.cpp b/library/cpp/ipv6_address/ut/ipv6_address_ut.cpp index 73bb7cffdd..c1a25fcb4d 100644 --- a/library/cpp/ipv6_address/ut/ipv6_address_ut.cpp +++ b/library/cpp/ipv6_address/ut/ipv6_address_ut.cpp @@ -1,5 +1,5 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/ipv6_address/ipv6_address.h> +#include <library/cpp/ipv6_address/ipv6_address.h> #include <unordered_set> class TIpv6AddressTest: public TTestBase { diff --git a/library/cpp/ipv6_address/ut/ya.make b/library/cpp/ipv6_address/ut/ya.make index bd22899379..e7e66cbe66 100644 --- a/library/cpp/ipv6_address/ut/ya.make +++ b/library/cpp/ipv6_address/ut/ya.make @@ -1,6 +1,6 @@ OWNER(g:zora) -UNITTEST_FOR(library/cpp/ipv6_address) +UNITTEST_FOR(library/cpp/ipv6_address) SRCS( ipv6_address_ut.cpp diff --git a/library/cpp/ipv6_address/ya.make b/library/cpp/ipv6_address/ya.make index 5c9bf7e383..c1573f8779 100644 --- a/library/cpp/ipv6_address/ya.make +++ b/library/cpp/ipv6_address/ya.make @@ -9,7 +9,7 @@ SRCS( ) PEERDIR( - library/cpp/int128 + library/cpp/int128 ) END() diff --git a/library/cpp/json/easy_parse/json_easy_parser.cpp b/library/cpp/json/easy_parse/json_easy_parser.cpp index 3c781f544b..54f7b11a00 100644 --- a/library/cpp/json/easy_parse/json_easy_parser.cpp +++ b/library/cpp/json/easy_parse/json_easy_parser.cpp @@ -1,5 +1,5 @@ #include "json_easy_parser.h" -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> #include <util/string/cast.h> #include <util/string/split.h> #include <util/string/strip.h> diff --git a/library/cpp/json/easy_parse/ya.make b/library/cpp/json/easy_parse/ya.make index 2304c542f2..2390414aff 100644 --- a/library/cpp/json/easy_parse/ya.make +++ b/library/cpp/json/easy_parse/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/json + library/cpp/json ) END() diff --git a/library/cpp/json/fast_sax/parser.h b/library/cpp/json/fast_sax/parser.h index b5f031dd9e..68f24815c1 100644 --- a/library/cpp/json/fast_sax/parser.h +++ b/library/cpp/json/fast_sax/parser.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/json/common/defs.h> +#include <library/cpp/json/common/defs.h> namespace NJson { bool ReadJsonFast(TStringBuf in, TJsonCallbacks* callbacks); diff --git a/library/cpp/json/fast_sax/parser.rl6 b/library/cpp/json/fast_sax/parser.rl6 index edb4e9ee1b..e4dbc704dd 100644 --- a/library/cpp/json/fast_sax/parser.rl6 +++ b/library/cpp/json/fast_sax/parser.rl6 @@ -1,5 +1,5 @@ -#include <library/cpp/json/fast_sax/unescape.h> -#include <library/cpp/json/fast_sax/parser.h> +#include <library/cpp/json/fast_sax/unescape.h> +#include <library/cpp/json/fast_sax/parser.h> #include <util/string/cast.h> #include <util/generic/buffer.h> diff --git a/library/cpp/json/fast_sax/ya.make b/library/cpp/json/fast_sax/ya.make index c6447ab6ac..260fef079e 100644 --- a/library/cpp/json/fast_sax/ya.make +++ b/library/cpp/json/fast_sax/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/json/common + library/cpp/json/common ) SRCS( diff --git a/library/cpp/json/flex_buffers/cvt.cpp b/library/cpp/json/flex_buffers/cvt.cpp index fee0cea0b8..7037a48fd8 100644 --- a/library/cpp/json/flex_buffers/cvt.cpp +++ b/library/cpp/json/flex_buffers/cvt.cpp @@ -2,8 +2,8 @@ #include <flatbuffers/flexbuffers.h> -#include <library/cpp/json/fast_sax/parser.h> -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/fast_sax/parser.h> +#include <library/cpp/json/json_reader.h> #include <util/generic/vector.h> #include <util/stream/output.h> diff --git a/library/cpp/json/flex_buffers/ut/cvt_ut.cpp b/library/cpp/json/flex_buffers/ut/cvt_ut.cpp index 9fffef4d38..9ec67ee58e 100644 --- a/library/cpp/json/flex_buffers/ut/cvt_ut.cpp +++ b/library/cpp/json/flex_buffers/ut/cvt_ut.cpp @@ -1,5 +1,5 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/json/flex_buffers/cvt.h> +#include <library/cpp/json/flex_buffers/cvt.h> using namespace NJson; diff --git a/library/cpp/json/flex_buffers/ut/ya.make b/library/cpp/json/flex_buffers/ut/ya.make index 3fdc93f88e..f92a8ed3f4 100644 --- a/library/cpp/json/flex_buffers/ut/ya.make +++ b/library/cpp/json/flex_buffers/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/json/flex_buffers) +UNITTEST_FOR(library/cpp/json/flex_buffers) OWNER(pg) diff --git a/library/cpp/json/flex_buffers/ya.make b/library/cpp/json/flex_buffers/ya.make index 3ece5e3703..9329c04800 100644 --- a/library/cpp/json/flex_buffers/ya.make +++ b/library/cpp/json/flex_buffers/ya.make @@ -5,7 +5,7 @@ OWNER(pg) ADDINCL(contrib/libs/flatbuffers/include) PEERDIR( - library/cpp/json + library/cpp/json contrib/libs/flatbuffers ) diff --git a/library/cpp/json/fuzzy_test/main.cpp b/library/cpp/json/fuzzy_test/main.cpp index 29a53aac14..3676bafa20 100644 --- a/library/cpp/json/fuzzy_test/main.cpp +++ b/library/cpp/json/fuzzy_test/main.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> #include <util/random/random.h> #include <util/stream/str.h> diff --git a/library/cpp/json/fuzzy_test/ya.make b/library/cpp/json/fuzzy_test/ya.make index ff50bc1f62..6658fedfcf 100644 --- a/library/cpp/json/fuzzy_test/ya.make +++ b/library/cpp/json/fuzzy_test/ya.make @@ -3,7 +3,7 @@ FUZZ() OWNER(pg) PEERDIR( - library/cpp/json + library/cpp/json ) SRCS( diff --git a/library/cpp/json/json_reader.h b/library/cpp/json/json_reader.h index b673788330..58d8e537f7 100644 --- a/library/cpp/json/json_reader.h +++ b/library/cpp/json/json_reader.h @@ -2,8 +2,8 @@ #include "json_value.h" -#include <library/cpp/json/common/defs.h> -#include <library/cpp/json/fast_sax/parser.h> +#include <library/cpp/json/common/defs.h> +#include <library/cpp/json/fast_sax/parser.h> #include <util/generic/yexception.h> @@ -134,7 +134,7 @@ namespace NJson { bool CloseComplexValue(); }; - //// relaxed json, used in library/cpp/scheme + //// relaxed json, used in library/cpp/scheme bool ReadJsonFastTree(TStringBuf in, TJsonValue* out, bool throwOnError = false, bool notClosedBracketIsError = false); TJsonValue ReadJsonFastTree(TStringBuf in, bool notClosedBracketIsError = false); } diff --git a/library/cpp/json/json_value.h b/library/cpp/json/json_value.h index f70f4d2ee8..515141a9eb 100644 --- a/library/cpp/json/json_value.h +++ b/library/cpp/json/json_value.h @@ -1,3 +1,3 @@ #pragma once -#include <library/cpp/json/writer/json_value.h> +#include <library/cpp/json/writer/json_value.h> diff --git a/library/cpp/json/json_writer.h b/library/cpp/json/json_writer.h index c7f5c9499a..b9a565f5f4 100644 --- a/library/cpp/json/json_writer.h +++ b/library/cpp/json/json_writer.h @@ -1,10 +1,10 @@ #pragma once -// Deprecated. Use library/cpp/json/writer in new code. +// Deprecated. Use library/cpp/json/writer in new code. #include "json_value.h" -#include <library/cpp/json/writer/json.h> +#include <library/cpp/json/writer/json.h> #include <util/stream/output.h> #include <util/generic/hash.h> diff --git a/library/cpp/json/ut/json_prettifier_ut.cpp b/library/cpp/json/ut/json_prettifier_ut.cpp index ae5f8dd81a..acfec1477e 100644 --- a/library/cpp/json/ut/json_prettifier_ut.cpp +++ b/library/cpp/json/ut/json_prettifier_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/json/json_prettifier.h> +#include <library/cpp/json/json_prettifier.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/json/ut/json_reader_fast_ut.cpp b/library/cpp/json/ut/json_reader_fast_ut.cpp index 60dffc91c7..0218e5ca10 100644 --- a/library/cpp/json/ut/json_reader_fast_ut.cpp +++ b/library/cpp/json/ut/json_reader_fast_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_prettifier.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_prettifier.h> #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/string_utils/relaxed_escaper/relaxed_escaper.h> diff --git a/library/cpp/json/ut/json_reader_ut.cpp b/library/cpp/json/ut/json_reader_ut.cpp index cd31afa0b8..a724f0675f 100644 --- a/library/cpp/json/ut/json_reader_ut.cpp +++ b/library/cpp/json/ut/json_reader_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_writer.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/str.h> diff --git a/library/cpp/json/ut/json_saveload_ut.cpp b/library/cpp/json/ut/json_saveload_ut.cpp index b480a80fe4..8b3637b8c9 100644 --- a/library/cpp/json/ut/json_saveload_ut.cpp +++ b/library/cpp/json/ut/json_saveload_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_value.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/buffer.h> diff --git a/library/cpp/json/ut/json_writer_ut.cpp b/library/cpp/json/ut/json_writer_ut.cpp index ca11d34dad..4110d47244 100644 --- a/library/cpp/json/ut/json_writer_ut.cpp +++ b/library/cpp/json/ut/json_writer_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_writer.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/str.h> diff --git a/library/cpp/json/ut/ya.make b/library/cpp/json/ut/ya.make index 8e0362d84b..661b46a9bb 100644 --- a/library/cpp/json/ut/ya.make +++ b/library/cpp/json/ut/ya.make @@ -1,6 +1,6 @@ OWNER(velavokr) -UNITTEST_FOR(library/cpp/json) +UNITTEST_FOR(library/cpp/json) PEERDIR( library/cpp/string_utils/relaxed_escaper diff --git a/library/cpp/json/writer/README b/library/cpp/json/writer/README index a20489f32e..bb63029bcd 100644 --- a/library/cpp/json/writer/README +++ b/library/cpp/json/writer/README @@ -3,7 +3,7 @@ where HTML special characters are always escaped. Use it like this: - #include <library/cpp/json/writer/json.h> + #include <library/cpp/json/writer/json.h> ... NJsonWriter::TBuf json; diff --git a/library/cpp/json/writer/json.cpp b/library/cpp/json/writer/json.cpp index 02370c2d79..d9cc4924c9 100644 --- a/library/cpp/json/writer/json.cpp +++ b/library/cpp/json/writer/json.cpp @@ -1,6 +1,6 @@ #include "json.h" -#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_value.h> #include <util/string/cast.h> #include <util/string/strspn.h> diff --git a/library/cpp/json/writer/json_ut.cpp b/library/cpp/json/writer/json_ut.cpp index 9980555683..b228218574 100644 --- a/library/cpp/json/writer/json_ut.cpp +++ b/library/cpp/json/writer/json_ut.cpp @@ -2,7 +2,7 @@ #include <util/system/sanitizers.h> #include "json.h" -#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_value.h> #include <limits> diff --git a/library/cpp/json/writer/json_value.h b/library/cpp/json/writer/json_value.h index 3f0f50bc4c..93f0a32ef8 100644 --- a/library/cpp/json/writer/json_value.h +++ b/library/cpp/json/writer/json_value.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/json/common/defs.h> +#include <library/cpp/json/common/defs.h> #include <util/generic/string.h> #include <util/generic/hash.h> diff --git a/library/cpp/json/writer/ut/ya.make b/library/cpp/json/writer/ut/ya.make index 1e39dae6a1..0f2058b079 100644 --- a/library/cpp/json/writer/ut/ya.make +++ b/library/cpp/json/writer/ut/ya.make @@ -3,10 +3,10 @@ UNITTEST() OWNER(myltsev) PEERDIR( - ADDINCL library/cpp/json/writer + ADDINCL library/cpp/json/writer ) -SRCDIR(library/cpp/json/writer) +SRCDIR(library/cpp/json/writer) SRCS( json_ut.cpp diff --git a/library/cpp/json/writer/ya.make b/library/cpp/json/writer/ya.make index 3989ff3504..6a4a99eeea 100644 --- a/library/cpp/json/writer/ya.make +++ b/library/cpp/json/writer/ya.make @@ -7,7 +7,7 @@ OWNER( ) PEERDIR( - library/cpp/json/common + library/cpp/json/common ) SRCS( diff --git a/library/cpp/json/ya.make b/library/cpp/json/ya.make index d58eead8ec..700a9cde24 100644 --- a/library/cpp/json/ya.make +++ b/library/cpp/json/ya.make @@ -14,9 +14,9 @@ SRCS( PEERDIR( contrib/libs/rapidjson - library/cpp/json/common - library/cpp/json/fast_sax - library/cpp/json/writer + library/cpp/json/common + library/cpp/json/fast_sax + library/cpp/json/writer library/cpp/string_utils/relaxed_escaper ) diff --git a/library/cpp/json/yson/json2yson.h b/library/cpp/json/yson/json2yson.h index 758eb6d0cf..25449a0cf7 100644 --- a/library/cpp/json/yson/json2yson.h +++ b/library/cpp/json/yson/json2yson.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_value.h> #include <library/cpp/yson/writer.h> namespace NJson2Yson { diff --git a/library/cpp/json/yson/json2yson_ut.cpp b/library/cpp/json/yson/json2yson_ut.cpp index 9eb23354cf..5942ea9568 100644 --- a/library/cpp/json/yson/json2yson_ut.cpp +++ b/library/cpp/json/yson/json2yson_ut.cpp @@ -1,7 +1,7 @@ -#include "library/cpp/json/yson/json2yson.h" +#include "library/cpp/json/yson/json2yson.h" -#include <library/cpp/blockcodecs/codecs.h> -#include <library/cpp/histogram/simple/histogram.h> +#include <library/cpp/blockcodecs/codecs.h> +#include <library/cpp/histogram/simple/histogram.h> #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/tests_data.h> diff --git a/library/cpp/json/yson/ut/ya.make b/library/cpp/json/yson/ut/ya.make index 4ceb65b279..783dc9ae2e 100644 --- a/library/cpp/json/yson/ut/ya.make +++ b/library/cpp/json/yson/ut/ya.make @@ -3,15 +3,15 @@ OWNER( elshiko ) -UNITTEST_FOR(library/cpp/json/yson) +UNITTEST_FOR(library/cpp/json/yson) ALLOCATOR(LF) DATA(sbr://363537653) PEERDIR( - library/cpp/blockcodecs - library/cpp/histogram/simple + library/cpp/blockcodecs + library/cpp/histogram/simple library/cpp/testing/unittest ) diff --git a/library/cpp/json/yson/ya.make b/library/cpp/json/yson/ya.make index 9b289d674f..c6deed6198 100644 --- a/library/cpp/json/yson/ya.make +++ b/library/cpp/json/yson/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/json + library/cpp/json library/cpp/yson library/cpp/yson/json ) diff --git a/library/cpp/lcs/lcs_via_lis.h b/library/cpp/lcs/lcs_via_lis.h index d26733d94e..e97747792e 100644 --- a/library/cpp/lcs/lcs_via_lis.h +++ b/library/cpp/lcs/lcs_via_lis.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/containers/paged_vector/paged_vector.h> +#include <library/cpp/containers/paged_vector/paged_vector.h> #include <util/generic/ptr.h> #include <util/generic/hash.h> diff --git a/library/cpp/lcs/ut/ya.make b/library/cpp/lcs/ut/ya.make index 3d12898788..00533bef80 100644 --- a/library/cpp/lcs/ut/ya.make +++ b/library/cpp/lcs/ut/ya.make @@ -3,10 +3,10 @@ OWNER(velavokr) UNITTEST() PEERDIR( - ADDINCL library/cpp/lcs + ADDINCL library/cpp/lcs ) -SRCDIR(library/cpp/lcs) +SRCDIR(library/cpp/lcs) SRCS( lcs_via_lis_ut.cpp diff --git a/library/cpp/lcs/ya.make b/library/cpp/lcs/ya.make index 3a7caafc88..709cfa2a0d 100644 --- a/library/cpp/lcs/ya.make +++ b/library/cpp/lcs/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(velavokr) PEERDIR( - library/cpp/containers/paged_vector + library/cpp/containers/paged_vector ) SRCS( diff --git a/library/cpp/lfalloc/dbg/ya.make b/library/cpp/lfalloc/dbg/ya.make index 3dce653a8c..3840d80cb6 100644 --- a/library/cpp/lfalloc/dbg/ya.make +++ b/library/cpp/lfalloc/dbg/ya.make @@ -24,7 +24,7 @@ ELSE() ENDIF() PEERDIR( - library/cpp/malloc/api + library/cpp/malloc/api ) SET(IDE_FOLDER "util") diff --git a/library/cpp/lfalloc/dbg_info/dbg_info.cpp b/library/cpp/lfalloc/dbg_info/dbg_info.cpp index 1fb9f7ad93..aa9534da01 100644 --- a/library/cpp/lfalloc/dbg_info/dbg_info.cpp +++ b/library/cpp/lfalloc/dbg_info/dbg_info.cpp @@ -1,6 +1,6 @@ #include "dbg_info.h" -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/malloc/api/malloc.h> namespace NAllocDbg { //////////////////////////////////////////////////////////////////////////////// diff --git a/library/cpp/lfalloc/dbg_info/ya.make b/library/cpp/lfalloc/dbg_info/ya.make index efecba5993..43462634f0 100644 --- a/library/cpp/lfalloc/dbg_info/ya.make +++ b/library/cpp/lfalloc/dbg_info/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(vskipin) PEERDIR( - library/cpp/malloc/api + library/cpp/malloc/api ) SRCS( diff --git a/library/cpp/lfalloc/lf_allocX64.h b/library/cpp/lfalloc/lf_allocX64.h index fd2a906d6f..974c8ee7f9 100644 --- a/library/cpp/lfalloc/lf_allocX64.h +++ b/library/cpp/lfalloc/lf_allocX64.h @@ -4,7 +4,7 @@ #include <stdio.h> #include <stdarg.h> -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/malloc/api/malloc.h> #include <util/system/compat.h> #include <util/system/compiler.h> diff --git a/library/cpp/lfalloc/ya.make b/library/cpp/lfalloc/ya.make index cace05f9d8..c6a74eac74 100644 --- a/library/cpp/lfalloc/ya.make +++ b/library/cpp/lfalloc/ya.make @@ -17,7 +17,7 @@ ELSE() ENDIF() PEERDIR( - library/cpp/malloc/api + library/cpp/malloc/api ) SET(IDE_FOLDER "util") diff --git a/library/cpp/lfalloc/yt/ya.make b/library/cpp/lfalloc/yt/ya.make index 8c1a4f8a72..f4bb1b3701 100644 --- a/library/cpp/lfalloc/yt/ya.make +++ b/library/cpp/lfalloc/yt/ya.make @@ -21,7 +21,7 @@ ELSE() ENDIF() PEERDIR( - library/cpp/malloc/api + library/cpp/malloc/api ) SET(IDE_FOLDER "util") diff --git a/library/cpp/linear_regression/benchmark/main.cpp b/library/cpp/linear_regression/benchmark/main.cpp index 735d41e988..5361e4ce0f 100644 --- a/library/cpp/linear_regression/benchmark/main.cpp +++ b/library/cpp/linear_regression/benchmark/main.cpp @@ -1,6 +1,6 @@ #include "pool.h" -#include <library/cpp/linear_regression/linear_regression.h> +#include <library/cpp/linear_regression/linear_regression.h> #include <util/datetime/base.h> #include <util/datetime/cputimer.h> diff --git a/library/cpp/linear_regression/benchmark/ya.make b/library/cpp/linear_regression/benchmark/ya.make index bbc4f2683a..0f3fefe372 100644 --- a/library/cpp/linear_regression/benchmark/ya.make +++ b/library/cpp/linear_regression/benchmark/ya.make @@ -9,7 +9,7 @@ SRCS( ) PEERDIR( - library/cpp/linear_regression + library/cpp/linear_regression ) END() diff --git a/library/cpp/linear_regression/linear_regression.h b/library/cpp/linear_regression/linear_regression.h index e57de5ff6c..3f398f7436 100644 --- a/library/cpp/linear_regression/linear_regression.h +++ b/library/cpp/linear_regression/linear_regression.h @@ -3,7 +3,7 @@ #include "linear_model.h" #include "welford.h" -#include <library/cpp/accurate_accumulate/accurate_accumulate.h> +#include <library/cpp/accurate_accumulate/accurate_accumulate.h> #include <util/generic/vector.h> #include <util/generic/hash.h> diff --git a/library/cpp/linear_regression/linear_regression_ut.cpp b/library/cpp/linear_regression/linear_regression_ut.cpp index e71a16b67a..80e1d9af82 100644 --- a/library/cpp/linear_regression/linear_regression_ut.cpp +++ b/library/cpp/linear_regression/linear_regression_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/linear_regression/linear_regression.h> +#include <library/cpp/linear_regression/linear_regression.h> #include <library/cpp/testing/unittest/registar.h> #include <util/generic/vector.h> diff --git a/library/cpp/linear_regression/ut/ya.make b/library/cpp/linear_regression/ut/ya.make index f410410673..7ce4cd3400 100644 --- a/library/cpp/linear_regression/ut/ya.make +++ b/library/cpp/linear_regression/ut/ya.make @@ -3,10 +3,10 @@ UNITTEST() OWNER(alex-sh) PEERDIR( - ADDINCL library/cpp/linear_regression + ADDINCL library/cpp/linear_regression ) -SRCDIR(library/cpp/linear_regression) +SRCDIR(library/cpp/linear_regression) SRCS( linear_regression_ut.cpp diff --git a/library/cpp/linear_regression/welford.h b/library/cpp/linear_regression/welford.h index ee865d6693..00f1c32ee3 100644 --- a/library/cpp/linear_regression/welford.h +++ b/library/cpp/linear_regression/welford.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/accurate_accumulate/accurate_accumulate.h> +#include <library/cpp/accurate_accumulate/accurate_accumulate.h> #include <util/ysaveload.h> diff --git a/library/cpp/linear_regression/ya.make b/library/cpp/linear_regression/ya.make index 4cfcc3d673..8a1fb5b98d 100644 --- a/library/cpp/linear_regression/ya.make +++ b/library/cpp/linear_regression/ya.make @@ -9,7 +9,7 @@ SRCS( ) PEERDIR( - library/cpp/accurate_accumulate + library/cpp/accurate_accumulate ) END() diff --git a/library/cpp/logger/global/common.h b/library/cpp/logger/global/common.h index 7dcf650dec..474c2a7747 100644 --- a/library/cpp/logger/global/common.h +++ b/library/cpp/logger/global/common.h @@ -10,7 +10,7 @@ #include <util/string/printf.h> #include <util/system/src_location.h> -#include <library/cpp/logger/log.h> +#include <library/cpp/logger/log.h> namespace NLoggingImpl { const size_t SingletonPriority = 500; diff --git a/library/cpp/logger/global/ut/ya.make b/library/cpp/logger/global/ut/ya.make index 8aea38906f..c3432e21ba 100644 --- a/library/cpp/logger/global/ut/ya.make +++ b/library/cpp/logger/global/ut/ya.make @@ -3,10 +3,10 @@ UNITTEST() OWNER(salmin) PEERDIR( - library/cpp/logger/global + library/cpp/logger/global ) -SRCDIR(library/cpp/logger/global) +SRCDIR(library/cpp/logger/global) SRCS( rty_formater_ut.cpp diff --git a/library/cpp/logger/global/ya.make b/library/cpp/logger/global/ya.make index 20eb361e72..0fece830c7 100644 --- a/library/cpp/logger/global/ya.make +++ b/library/cpp/logger/global/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(g:geosaas) PEERDIR( - library/cpp/logger + library/cpp/logger ) IF (OS_WINDOWS) diff --git a/library/cpp/logger/ut/ya.make b/library/cpp/logger/ut/ya.make index 2a461c1353..704986e8c6 100644 --- a/library/cpp/logger/ut/ya.make +++ b/library/cpp/logger/ut/ya.make @@ -3,12 +3,12 @@ UNITTEST() OWNER(pg) PEERDIR( - ADDINCL library/cpp/logger + ADDINCL library/cpp/logger library/cpp/logger/init_context library/cpp/yconf/patcher ) -SRCDIR(library/cpp/logger) +SRCDIR(library/cpp/logger) SRCS( log_ut.cpp diff --git a/library/cpp/lwtrace/control.h b/library/cpp/lwtrace/control.h index 16b24eafd2..1f654d6bbe 100644 --- a/library/cpp/lwtrace/control.h +++ b/library/cpp/lwtrace/control.h @@ -6,7 +6,7 @@ #include "log_shuttle.h" #include "probe.h" -#include <library/cpp/lwtrace/protos/lwtrace.pb.h> +#include <library/cpp/lwtrace/protos/lwtrace.pb.h> #include <google/protobuf/repeated_field.h> diff --git a/library/cpp/lwtrace/custom_action.h b/library/cpp/lwtrace/custom_action.h index 92a3c66b84..c1bb7d2ad3 100644 --- a/library/cpp/lwtrace/custom_action.h +++ b/library/cpp/lwtrace/custom_action.h @@ -2,7 +2,7 @@ #include "probe.h" -#include <library/cpp/lwtrace/protos/lwtrace.pb.h> +#include <library/cpp/lwtrace/protos/lwtrace.pb.h> #include <util/generic/hash.h> diff --git a/library/cpp/lwtrace/event.h b/library/cpp/lwtrace/event.h index e53a620c45..d88f6c700d 100644 --- a/library/cpp/lwtrace/event.h +++ b/library/cpp/lwtrace/event.h @@ -4,7 +4,7 @@ #include "signature.h" #include "param_traits.h" -#include <library/cpp/lwtrace/protos/lwtrace.pb.h> +#include <library/cpp/lwtrace/protos/lwtrace.pb.h> namespace NLWTrace { // Common class for all events diff --git a/library/cpp/lwtrace/example1/lwtrace_example1.cpp b/library/cpp/lwtrace/example1/lwtrace_example1.cpp index 6b32c405ee..85fe9311ed 100644 --- a/library/cpp/lwtrace/example1/lwtrace_example1.cpp +++ b/library/cpp/lwtrace/example1/lwtrace_example1.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #define LWTRACE_EXAMPLE_PROVIDER(PROBE, EVENT, GROUPS, TYPES, NAMES) \ PROBE(IterationProbe, GROUPS(), TYPES(i32, double), NAMES("n", "result")) \ diff --git a/library/cpp/lwtrace/example1/ya.make b/library/cpp/lwtrace/example1/ya.make index 5ae8c4a48e..5785a16a58 100644 --- a/library/cpp/lwtrace/example1/ya.make +++ b/library/cpp/lwtrace/example1/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/lwtrace + library/cpp/lwtrace ) END() diff --git a/library/cpp/lwtrace/example2/lwtrace_example2.cpp b/library/cpp/lwtrace/example2/lwtrace_example2.cpp index 7a4f7a1daf..10799c144b 100644 --- a/library/cpp/lwtrace/example2/lwtrace_example2.cpp +++ b/library/cpp/lwtrace/example2/lwtrace_example2.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/lwtrace/control.h> -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/control.h> +#include <library/cpp/lwtrace/all.h> #include <library/cpp/getopt/last_getopt.h> #include <google/protobuf/text_format.h> diff --git a/library/cpp/lwtrace/example2/ya.make b/library/cpp/lwtrace/example2/ya.make index 22e34239c8..bb694d3224 100644 --- a/library/cpp/lwtrace/example2/ya.make +++ b/library/cpp/lwtrace/example2/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/lwtrace + library/cpp/lwtrace library/cpp/getopt ) diff --git a/library/cpp/lwtrace/example3/lwtrace_example3.cpp b/library/cpp/lwtrace/example3/lwtrace_example3.cpp index 4493dc0077..7f46b71fa0 100644 --- a/library/cpp/lwtrace/example3/lwtrace_example3.cpp +++ b/library/cpp/lwtrace/example3/lwtrace_example3.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #include <google/protobuf/text_format.h> #include "my_action.h" diff --git a/library/cpp/lwtrace/example3/my_action.h b/library/cpp/lwtrace/example3/my_action.h index 9a04293ba2..20fdae8dd2 100644 --- a/library/cpp/lwtrace/example3/my_action.h +++ b/library/cpp/lwtrace/example3/my_action.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #include <util/stream/file.h> // Example of custom state for custom executors diff --git a/library/cpp/lwtrace/example3/ya.make b/library/cpp/lwtrace/example3/ya.make index c5b31586e9..905c18f59e 100644 --- a/library/cpp/lwtrace/example3/ya.make +++ b/library/cpp/lwtrace/example3/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/lwtrace + library/cpp/lwtrace ) END() diff --git a/library/cpp/lwtrace/example4/lwtrace_example4.cpp b/library/cpp/lwtrace/example4/lwtrace_example4.cpp index 7b55a07c75..65dcf1b612 100644 --- a/library/cpp/lwtrace/example4/lwtrace_example4.cpp +++ b/library/cpp/lwtrace/example4/lwtrace_example4.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #define LWTRACE_EXAMPLE_PROVIDER(PROBE, EVENT, GROUPS, TYPES, NAMES) \ PROBE(BackTrack, GROUPS(), TYPES(NLWTrace::TSymbol), NAMES("frame")) \ diff --git a/library/cpp/lwtrace/example4/ya.make b/library/cpp/lwtrace/example4/ya.make index a3004340a8..e547b43004 100644 --- a/library/cpp/lwtrace/example4/ya.make +++ b/library/cpp/lwtrace/example4/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/lwtrace + library/cpp/lwtrace ) END() diff --git a/library/cpp/lwtrace/example5/lwtrace_example5.cpp b/library/cpp/lwtrace/example5/lwtrace_example5.cpp index 1c324473c2..864278a46c 100644 --- a/library/cpp/lwtrace/example5/lwtrace_example5.cpp +++ b/library/cpp/lwtrace/example5/lwtrace_example5.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/lwtrace/all.h> -#include <library/cpp/lwtrace/lwprobe.h> +#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/lwprobe.h> template <ui64 N> ui64 Fact() { diff --git a/library/cpp/lwtrace/example5/ya.make b/library/cpp/lwtrace/example5/ya.make index 06dd4dc569..8ff96e7876 100644 --- a/library/cpp/lwtrace/example5/ya.make +++ b/library/cpp/lwtrace/example5/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/lwtrace + library/cpp/lwtrace ) END() diff --git a/library/cpp/lwtrace/mon/mon_lwtrace.cpp b/library/cpp/lwtrace/mon/mon_lwtrace.cpp index a61ee9ce22..5d3cacf31e 100644 --- a/library/cpp/lwtrace/mon/mon_lwtrace.cpp +++ b/library/cpp/lwtrace/mon/mon_lwtrace.cpp @@ -5,13 +5,13 @@ #include <google/protobuf/text_format.h> #include <library/cpp/lwtrace/mon/analytics/all.h> -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #include <library/cpp/monlib/service/pages/mon_page.h> #include <library/cpp/monlib/service/pages/resource_mon_page.h> #include <library/cpp/monlib/service/pages/templates.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> #include <library/cpp/string_utils/base64/base64.h> -#include <library/cpp/html/pcdata/pcdata.h> +#include <library/cpp/html/pcdata/pcdata.h> #include <util/string/escape.h> #include <util/system/condvar.h> #include <util/system/execpath.h> @@ -3852,7 +3852,7 @@ private: "<li" << (request.GetParams().Get("mode") == "dashboards"? active: "") << "><a href=\"?mode=dashboards\">Dashboard</a></li>" "<li" << (request.GetParams().Get("mode") == "builder"? active: "") << "><a href=\"?mode=builder\">Builder</a></li>" "<li" << (request.GetParams().Get("mode") == "analytics"? active: "") << "><a href=\"?mode=analytics&id=\">Analytics</a></li>" - "<li><a href=\"https://wiki.yandex-team.ru/development/poisk/arcadia/library/cpp/lwtrace/\" target=\"_blank\">Documentation</a></li>" + "<li><a href=\"https://wiki.yandex-team.ru/development/poisk/arcadia/library/cpp/lwtrace/\" target=\"_blank\">Documentation</a></li>" "</ul>" "</div></nav>" ; diff --git a/library/cpp/lwtrace/mon/mon_lwtrace.h b/library/cpp/lwtrace/mon/mon_lwtrace.h index 8030f6ea61..09c5b5e0b7 100644 --- a/library/cpp/lwtrace/mon/mon_lwtrace.h +++ b/library/cpp/lwtrace/mon/mon_lwtrace.h @@ -2,7 +2,7 @@ #include <library/cpp/lwtrace/protos/lwtrace.pb.h> #include <library/cpp/monlib/service/monservice.h> -#include <library/cpp/lwtrace/control.h> +#include <library/cpp/lwtrace/control.h> #include <util/generic/vector.h> diff --git a/library/cpp/lwtrace/mon/ya.make b/library/cpp/lwtrace/mon/ya.make index bdcb315754..8bd476c2a0 100644 --- a/library/cpp/lwtrace/mon/ya.make +++ b/library/cpp/lwtrace/mon/ya.make @@ -45,10 +45,10 @@ SRCS( PEERDIR( library/cpp/html/pcdata - library/cpp/lwtrace + library/cpp/lwtrace library/cpp/lwtrace/mon/analytics library/cpp/monlib/dynamic_counters - library/cpp/resource + library/cpp/resource library/cpp/string_utils/base64 ) diff --git a/library/cpp/lwtrace/signature.h b/library/cpp/lwtrace/signature.h index 868bd9bcf2..f710d67ec7 100644 --- a/library/cpp/lwtrace/signature.h +++ b/library/cpp/lwtrace/signature.h @@ -2,7 +2,7 @@ #include "preprocessor.h" -#include <library/cpp/lwtrace/protos/lwtrace.pb.h> +#include <library/cpp/lwtrace/protos/lwtrace.pb.h> #include <util/generic/cast.h> #include <util/generic/string.h> diff --git a/library/cpp/lwtrace/tests/trace_tests.cpp b/library/cpp/lwtrace/tests/trace_tests.cpp index 6762e344a7..d33624e225 100644 --- a/library/cpp/lwtrace/tests/trace_tests.cpp +++ b/library/cpp/lwtrace/tests/trace_tests.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #include <library/cpp/getopt/last_getopt.h> diff --git a/library/cpp/lwtrace/tests/ya.make b/library/cpp/lwtrace/tests/ya.make index 6225ab1fa0..f7fd0b4a8f 100644 --- a/library/cpp/lwtrace/tests/ya.make +++ b/library/cpp/lwtrace/tests/ya.make @@ -9,7 +9,7 @@ SRCS( PEERDIR( contrib/libs/protobuf library/cpp/getopt - library/cpp/lwtrace + library/cpp/lwtrace ) END() diff --git a/library/cpp/lwtrace/trace_ut.cpp b/library/cpp/lwtrace/trace_ut.cpp index cb03e4fbde..891ca31df2 100644 --- a/library/cpp/lwtrace/trace_ut.cpp +++ b/library/cpp/lwtrace/trace_ut.cpp @@ -1,6 +1,6 @@ #include "all.h" -#include <library/cpp/lwtrace/protos/lwtrace.pb.h> +#include <library/cpp/lwtrace/protos/lwtrace.pb.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/lwtrace/ut/ya.make b/library/cpp/lwtrace/ut/ya.make index f43118bab7..029d7a7391 100644 --- a/library/cpp/lwtrace/ut/ya.make +++ b/library/cpp/lwtrace/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/lwtrace) +UNITTEST_FOR(library/cpp/lwtrace) OWNER(serxa) diff --git a/library/cpp/lwtrace/ya.make b/library/cpp/lwtrace/ya.make index d9accb3006..c2db963ef2 100644 --- a/library/cpp/lwtrace/ya.make +++ b/library/cpp/lwtrace/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(serxa) PEERDIR( - library/cpp/lwtrace/protos + library/cpp/lwtrace/protos ) SRCS( diff --git a/library/cpp/malloc/api/helpers/io.cpp b/library/cpp/malloc/api/helpers/io.cpp index 5177969f4d..a69710f925 100644 --- a/library/cpp/malloc/api/helpers/io.cpp +++ b/library/cpp/malloc/api/helpers/io.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/malloc/api/malloc.h> #include <util/stream/output.h> diff --git a/library/cpp/malloc/api/helpers/ya.make b/library/cpp/malloc/api/helpers/ya.make index 62875bca0e..07f9856779 100644 --- a/library/cpp/malloc/api/helpers/ya.make +++ b/library/cpp/malloc/api/helpers/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(pg) PEERDIR( - library/cpp/malloc/api + library/cpp/malloc/api ) SRCS( diff --git a/library/cpp/malloc/api/ut/ut.cpp b/library/cpp/malloc/api/ut/ut.cpp index 7eccd0bf8d..5951230f6e 100644 --- a/library/cpp/malloc/api/ut/ut.cpp +++ b/library/cpp/malloc/api/ut/ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/malloc/api/malloc.h> Y_UNIT_TEST_SUITE(MallocApi) { Y_UNIT_TEST(ToStream) { diff --git a/library/cpp/malloc/api/ut/ya.make b/library/cpp/malloc/api/ut/ya.make index e57225b45d..8799b27eb2 100644 --- a/library/cpp/malloc/api/ut/ya.make +++ b/library/cpp/malloc/api/ut/ya.make @@ -3,7 +3,7 @@ UNITTEST() OWNER(nga) PEERDIR( - library/cpp/malloc/api/helpers + library/cpp/malloc/api/helpers ) SRCS( diff --git a/library/cpp/malloc/jemalloc/malloc-info.cpp b/library/cpp/malloc/jemalloc/malloc-info.cpp index 2643ca4766..aa1668f45d 100644 --- a/library/cpp/malloc/jemalloc/malloc-info.cpp +++ b/library/cpp/malloc/jemalloc/malloc-info.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/malloc/api/malloc.h> using namespace NMalloc; diff --git a/library/cpp/malloc/jemalloc/ya.make b/library/cpp/malloc/jemalloc/ya.make index 99db474eab..e56db432e8 100644 --- a/library/cpp/malloc/jemalloc/ya.make +++ b/library/cpp/malloc/jemalloc/ya.make @@ -6,11 +6,11 @@ OWNER(nga) IF (OS_ANDROID) PEERDIR( - library/cpp/malloc/system + library/cpp/malloc/system ) ELSE() PEERDIR( - library/cpp/malloc/api + library/cpp/malloc/api contrib/libs/jemalloc ) SRCS( diff --git a/library/cpp/messagebus/acceptor.h b/library/cpp/messagebus/acceptor.h index 57cb010bf2..00c5788299 100644 --- a/library/cpp/messagebus/acceptor.h +++ b/library/cpp/messagebus/acceptor.h @@ -7,7 +7,7 @@ #include "session_impl.h" #include "shutdown_state.h" -#include <library/cpp/messagebus/actor/actor.h> +#include <library/cpp/messagebus/actor/actor.h> #include <util/system/event.h> diff --git a/library/cpp/messagebus/actor/actor_ut.cpp b/library/cpp/messagebus/actor/actor_ut.cpp index b76ab55bfa..12f64ac208 100644 --- a/library/cpp/messagebus/actor/actor_ut.cpp +++ b/library/cpp/messagebus/actor/actor_ut.cpp @@ -3,7 +3,7 @@ #include "actor.h" #include "queue_in_actor.h" -#include <library/cpp/messagebus/misc/test_sync.h> +#include <library/cpp/messagebus/misc/test_sync.h> #include <util/generic/object_counter.h> #include <util/system/event.h> diff --git a/library/cpp/messagebus/all/ya.make b/library/cpp/messagebus/all/ya.make index ffa2dbfabc..36d9b5adf3 100644 --- a/library/cpp/messagebus/all/ya.make +++ b/library/cpp/messagebus/all/ya.make @@ -1,10 +1,10 @@ OWNER(g:messagebus) RECURSE_ROOT_RELATIVE( - library/python/messagebus - library/cpp/messagebus/debug_receiver - library/cpp/messagebus/oldmodule - library/cpp/messagebus/rain_check - library/cpp/messagebus/test - library/cpp/messagebus/www + library/python/messagebus + library/cpp/messagebus/debug_receiver + library/cpp/messagebus/oldmodule + library/cpp/messagebus/rain_check + library/cpp/messagebus/test + library/cpp/messagebus/www ) diff --git a/library/cpp/messagebus/codegen.h b/library/cpp/messagebus/codegen.h index 83e969e811..d4ce217aa4 100644 --- a/library/cpp/messagebus/codegen.h +++ b/library/cpp/messagebus/codegen.h @@ -1,4 +1,4 @@ #pragma once -#include <library/cpp/messagebus/config/codegen.h> +#include <library/cpp/messagebus/config/codegen.h> diff --git a/library/cpp/messagebus/config/defs.h b/library/cpp/messagebus/config/defs.h index 92b1df9969..3fe1f2a6d0 100644 --- a/library/cpp/messagebus/config/defs.h +++ b/library/cpp/messagebus/config/defs.h @@ -1,11 +1,11 @@ #pragma once -// unique tag to fix pragma once gcc glueing: ./library/cpp/messagebus/defs.h +// unique tag to fix pragma once gcc glueing: ./library/cpp/messagebus/defs.h #include "codegen.h" #include "netaddr.h" -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <util/generic/list.h> diff --git a/library/cpp/messagebus/config/ya.make b/library/cpp/messagebus/config/ya.make index 20c7dfed19..91c555b920 100644 --- a/library/cpp/messagebus/config/ya.make +++ b/library/cpp/messagebus/config/ya.make @@ -4,7 +4,7 @@ OWNER(g:messagebus) PEERDIR( library/cpp/getopt - library/cpp/deprecated/enum_codegen + library/cpp/deprecated/enum_codegen ) SRCS( diff --git a/library/cpp/messagebus/debug_receiver/debug_receiver.cpp b/library/cpp/messagebus/debug_receiver/debug_receiver.cpp index 23b02d1003..bc1354246e 100644 --- a/library/cpp/messagebus/debug_receiver/debug_receiver.cpp +++ b/library/cpp/messagebus/debug_receiver/debug_receiver.cpp @@ -1,10 +1,10 @@ #include "debug_receiver_handler.h" #include "debug_receiver_proto.h" -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/ybus.h> #include <library/cpp/getopt/last_getopt.h> -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> using namespace NBus; diff --git a/library/cpp/messagebus/debug_receiver/debug_receiver_handler.h b/library/cpp/messagebus/debug_receiver/debug_receiver_handler.h index 0aed6b9984..3180743607 100644 --- a/library/cpp/messagebus/debug_receiver/debug_receiver_handler.h +++ b/library/cpp/messagebus/debug_receiver/debug_receiver_handler.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/ybus.h> struct TDebugReceiverHandler: public NBus::IBusServerHandler { NBus::TBusServerSession* ServerSession; diff --git a/library/cpp/messagebus/debug_receiver/debug_receiver_proto.h b/library/cpp/messagebus/debug_receiver/debug_receiver_proto.h index d34710dcf7..f71ca3279c 100644 --- a/library/cpp/messagebus/debug_receiver/debug_receiver_proto.h +++ b/library/cpp/messagebus/debug_receiver/debug_receiver_proto.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/ybus.h> struct TDebugReceiverMessage: public NBus::TBusMessage { /// constructor to create messages on sending end diff --git a/library/cpp/messagebus/debug_receiver/ya.make b/library/cpp/messagebus/debug_receiver/ya.make index f1b14d35bb..ce1ad26518 100644 --- a/library/cpp/messagebus/debug_receiver/ya.make +++ b/library/cpp/messagebus/debug_receiver/ya.make @@ -10,8 +10,8 @@ SRCS( PEERDIR( library/cpp/getopt - library/cpp/lwtrace - library/cpp/messagebus + library/cpp/lwtrace + library/cpp/messagebus ) END() diff --git a/library/cpp/messagebus/defs.h b/library/cpp/messagebus/defs.h index cb553acc45..bcf3faa32a 100644 --- a/library/cpp/messagebus/defs.h +++ b/library/cpp/messagebus/defs.h @@ -1,4 +1,4 @@ #pragma once -#include <library/cpp/messagebus/config/defs.h> +#include <library/cpp/messagebus/config/defs.h> diff --git a/library/cpp/messagebus/lfqueue_batch.h b/library/cpp/messagebus/lfqueue_batch.h index 8128d3154d..986f82c4e4 100644 --- a/library/cpp/messagebus/lfqueue_batch.h +++ b/library/cpp/messagebus/lfqueue_batch.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/messagebus/actor/temp_tls_vector.h> +#include <library/cpp/messagebus/actor/temp_tls_vector.h> #include <util/generic/vector.h> #include <util/thread/lfstack.h> diff --git a/library/cpp/messagebus/local_flags.h b/library/cpp/messagebus/local_flags.h index f589283188..b9e047de18 100644 --- a/library/cpp/messagebus/local_flags.h +++ b/library/cpp/messagebus/local_flags.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <util/generic/string.h> #include <util/stream/output.h> diff --git a/library/cpp/messagebus/mb_lwtrace.cpp b/library/cpp/messagebus/mb_lwtrace.cpp index c54cd5ab71..f0929485a5 100644 --- a/library/cpp/messagebus/mb_lwtrace.cpp +++ b/library/cpp/messagebus/mb_lwtrace.cpp @@ -1,6 +1,6 @@ #include "mb_lwtrace.h" -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #include <util/generic/singleton.h> diff --git a/library/cpp/messagebus/mb_lwtrace.h b/library/cpp/messagebus/mb_lwtrace.h index e62728b265..ec817ea626 100644 --- a/library/cpp/messagebus/mb_lwtrace.h +++ b/library/cpp/messagebus/mb_lwtrace.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #include <util/generic/string.h> diff --git a/library/cpp/messagebus/message_status.h b/library/cpp/messagebus/message_status.h index e1878960b3..98273a5a5c 100644 --- a/library/cpp/messagebus/message_status.h +++ b/library/cpp/messagebus/message_status.h @@ -3,7 +3,7 @@ #include "codegen.h" #include "defs.h" -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> namespace NBus { //////////////////////////////////////////////////////////////// diff --git a/library/cpp/messagebus/message_status_counter.cpp b/library/cpp/messagebus/message_status_counter.cpp index 891c8f5bb2..d1446bdb95 100644 --- a/library/cpp/messagebus/message_status_counter.cpp +++ b/library/cpp/messagebus/message_status_counter.cpp @@ -3,7 +3,7 @@ #include "key_value_printer.h" #include "text_utils.h" -#include <library/cpp/messagebus/monitoring/mon_proto.pb.h> +#include <library/cpp/messagebus/monitoring/mon_proto.pb.h> #include <util/stream/str.h> diff --git a/library/cpp/messagebus/message_status_counter.h b/library/cpp/messagebus/message_status_counter.h index e8ba2fdd31..94a0f3e8ac 100644 --- a/library/cpp/messagebus/message_status_counter.h +++ b/library/cpp/messagebus/message_status_counter.h @@ -2,7 +2,7 @@ #include "message_status.h" -#include <library/cpp/messagebus/monitoring/mon_proto.pb.h> +#include <library/cpp/messagebus/monitoring/mon_proto.pb.h> #include <util/generic/string.h> diff --git a/library/cpp/messagebus/message_status_counter_ut.cpp b/library/cpp/messagebus/message_status_counter_ut.cpp index 9598651329..5bdfeff5b0 100644 --- a/library/cpp/messagebus/message_status_counter_ut.cpp +++ b/library/cpp/messagebus/message_status_counter_ut.cpp @@ -2,7 +2,7 @@ #include "message_status_counter.h" -#include <library/cpp/messagebus/monitoring/mon_proto.pb.h> +#include <library/cpp/messagebus/monitoring/mon_proto.pb.h> using namespace NBus; using namespace NBus::NPrivate; diff --git a/library/cpp/messagebus/netaddr.h b/library/cpp/messagebus/netaddr.h index f915c8c574..af07a72ad0 100644 --- a/library/cpp/messagebus/netaddr.h +++ b/library/cpp/messagebus/netaddr.h @@ -1,4 +1,4 @@ #pragma once -#include <library/cpp/messagebus/config/netaddr.h> +#include <library/cpp/messagebus/config/netaddr.h> diff --git a/library/cpp/messagebus/network_ut.cpp b/library/cpp/messagebus/network_ut.cpp index f1798419db..ebca2497f1 100644 --- a/library/cpp/messagebus/network_ut.cpp +++ b/library/cpp/messagebus/network_ut.cpp @@ -2,7 +2,7 @@ #include "network.h" -#include <library/cpp/messagebus/test/helper/fixed_port.h> +#include <library/cpp/messagebus/test/helper/fixed_port.h> using namespace NBus; using namespace NBus::NPrivate; diff --git a/library/cpp/messagebus/oldmodule/module.cpp b/library/cpp/messagebus/oldmodule/module.cpp index 24bd778799..f5f559c8b1 100644 --- a/library/cpp/messagebus/oldmodule/module.cpp +++ b/library/cpp/messagebus/oldmodule/module.cpp @@ -1,11 +1,11 @@ #include "module.h" -#include <library/cpp/messagebus/scheduler_actor.h> -#include <library/cpp/messagebus/thread_extra.h> -#include <library/cpp/messagebus/actor/actor.h> -#include <library/cpp/messagebus/actor/queue_in_actor.h> -#include <library/cpp/messagebus/actor/what_thread_does.h> -#include <library/cpp/messagebus/actor/what_thread_does_guard.h> +#include <library/cpp/messagebus/scheduler_actor.h> +#include <library/cpp/messagebus/thread_extra.h> +#include <library/cpp/messagebus/actor/actor.h> +#include <library/cpp/messagebus/actor/queue_in_actor.h> +#include <library/cpp/messagebus/actor/what_thread_does.h> +#include <library/cpp/messagebus/actor/what_thread_does_guard.h> #include <util/generic/singleton.h> #include <util/string/printf.h> diff --git a/library/cpp/messagebus/oldmodule/module.h b/library/cpp/messagebus/oldmodule/module.h index 8d1c4a5d52..1f0f562136 100644 --- a/library/cpp/messagebus/oldmodule/module.h +++ b/library/cpp/messagebus/oldmodule/module.h @@ -41,7 +41,7 @@ #include "startsession.h" -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/ybus.h> #include <util/generic/noncopyable.h> #include <util/generic/object_counter.h> diff --git a/library/cpp/messagebus/oldmodule/startsession.cpp b/library/cpp/messagebus/oldmodule/startsession.cpp index 7c38801d62..b6c266d17d 100644 --- a/library/cpp/messagebus/oldmodule/startsession.cpp +++ b/library/cpp/messagebus/oldmodule/startsession.cpp @@ -16,7 +16,7 @@ #include "module.h" -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/ybus.h> namespace NBus { void* TBusStarter::_starter(void* data) { diff --git a/library/cpp/messagebus/oldmodule/startsession.h b/library/cpp/messagebus/oldmodule/startsession.h index 5e26e7e1e5..6d041edcb8 100644 --- a/library/cpp/messagebus/oldmodule/startsession.h +++ b/library/cpp/messagebus/oldmodule/startsession.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/ybus.h> #include <util/system/thread.h> diff --git a/library/cpp/messagebus/oldmodule/ya.make b/library/cpp/messagebus/oldmodule/ya.make index ca5eae74f0..e04a65f9e8 100644 --- a/library/cpp/messagebus/oldmodule/ya.make +++ b/library/cpp/messagebus/oldmodule/ya.make @@ -3,8 +3,8 @@ LIBRARY() OWNER(g:messagebus) PEERDIR( - library/cpp/messagebus - library/cpp/messagebus/actor + library/cpp/messagebus + library/cpp/messagebus/actor ) SRCS( diff --git a/library/cpp/messagebus/protobuf/ya.make b/library/cpp/messagebus/protobuf/ya.make index 64ff240b51..e438d9f5b9 100644 --- a/library/cpp/messagebus/protobuf/ya.make +++ b/library/cpp/messagebus/protobuf/ya.make @@ -8,8 +8,8 @@ SRCS( PEERDIR( contrib/libs/protobuf - library/cpp/messagebus - library/cpp/messagebus/actor + library/cpp/messagebus + library/cpp/messagebus/actor ) END() diff --git a/library/cpp/messagebus/protobuf/ybusbuf.cpp b/library/cpp/messagebus/protobuf/ybusbuf.cpp index 63415b3737..45bc9a1cce 100644 --- a/library/cpp/messagebus/protobuf/ybusbuf.cpp +++ b/library/cpp/messagebus/protobuf/ybusbuf.cpp @@ -1,6 +1,6 @@ #include "ybusbuf.h" -#include <library/cpp/messagebus/actor/what_thread_does.h> +#include <library/cpp/messagebus/actor/what_thread_does.h> #include <google/protobuf/io/coded_stream.h> diff --git a/library/cpp/messagebus/protobuf/ybusbuf.h b/library/cpp/messagebus/protobuf/ybusbuf.h index 57b4267ea5..92b5e286b8 100644 --- a/library/cpp/messagebus/protobuf/ybusbuf.h +++ b/library/cpp/messagebus/protobuf/ybusbuf.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/ybus.h> #include <google/protobuf/descriptor.h> #include <google/protobuf/message.h> diff --git a/library/cpp/messagebus/rain_check/core/coro_ut.cpp b/library/cpp/messagebus/rain_check/core/coro_ut.cpp index 61a33584a5..bf7124e871 100644 --- a/library/cpp/messagebus/rain_check/core/coro_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/coro_ut.cpp @@ -3,7 +3,7 @@ #include "coro.h" #include "spawn.h" -#include <library/cpp/messagebus/rain_check/test/ut/test.h> +#include <library/cpp/messagebus/rain_check/test/ut/test.h> using namespace NRainCheck; diff --git a/library/cpp/messagebus/rain_check/core/env.h b/library/cpp/messagebus/rain_check/core/env.h index f6dd7fceb6..b53fd59200 100644 --- a/library/cpp/messagebus/rain_check/core/env.h +++ b/library/cpp/messagebus/rain_check/core/env.h @@ -3,7 +3,7 @@ #include "sleep.h" #include "spawn.h" -#include <library/cpp/messagebus/actor/executor.h> +#include <library/cpp/messagebus/actor/executor.h> #include <util/generic/ptr.h> diff --git a/library/cpp/messagebus/rain_check/core/simple_ut.cpp b/library/cpp/messagebus/rain_check/core/simple_ut.cpp index d4545e05aa..e25dfdf779 100644 --- a/library/cpp/messagebus/rain_check/core/simple_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/simple_ut.cpp @@ -1,8 +1,8 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/messagebus/rain_check/test/ut/test.h> +#include <library/cpp/messagebus/rain_check/test/ut/test.h> -#include <library/cpp/messagebus/latch.h> +#include <library/cpp/messagebus/latch.h> #include <util/system/event.h> diff --git a/library/cpp/messagebus/rain_check/core/sleep.h b/library/cpp/messagebus/rain_check/core/sleep.h index 1a7a1f8674..a39d1c4317 100644 --- a/library/cpp/messagebus/rain_check/core/sleep.h +++ b/library/cpp/messagebus/rain_check/core/sleep.h @@ -2,7 +2,7 @@ #include "fwd.h" -#include <library/cpp/messagebus/scheduler/scheduler.h> +#include <library/cpp/messagebus/scheduler/scheduler.h> #include <util/datetime/base.h> diff --git a/library/cpp/messagebus/rain_check/core/sleep_ut.cpp b/library/cpp/messagebus/rain_check/core/sleep_ut.cpp index 2ae85a87b1..fdc551d333 100644 --- a/library/cpp/messagebus/rain_check/core/sleep_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/sleep_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/messagebus/rain_check/test/ut/test.h> +#include <library/cpp/messagebus/rain_check/test/ut/test.h> #include <util/system/event.h> diff --git a/library/cpp/messagebus/rain_check/core/spawn_ut.cpp b/library/cpp/messagebus/rain_check/core/spawn_ut.cpp index ba5a5e41cf..122f057004 100644 --- a/library/cpp/messagebus/rain_check/core/spawn_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/spawn_ut.cpp @@ -1,9 +1,9 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/messagebus/rain_check/test/helper/misc.h> -#include <library/cpp/messagebus/rain_check/test/ut/test.h> +#include <library/cpp/messagebus/rain_check/test/helper/misc.h> +#include <library/cpp/messagebus/rain_check/test/ut/test.h> -#include <library/cpp/messagebus/latch.h> +#include <library/cpp/messagebus/latch.h> #include <util/system/event.h> diff --git a/library/cpp/messagebus/rain_check/core/task.cpp b/library/cpp/messagebus/rain_check/core/task.cpp index a098437d53..f9acf1e0f7 100644 --- a/library/cpp/messagebus/rain_check/core/task.cpp +++ b/library/cpp/messagebus/rain_check/core/task.cpp @@ -1,6 +1,6 @@ #include "rain_check.h" -#include <library/cpp/messagebus/actor/temp_tls_vector.h> +#include <library/cpp/messagebus/actor/temp_tls_vector.h> #include <util/system/type_name.h> #include <util/system/tls.h> diff --git a/library/cpp/messagebus/rain_check/core/task.h b/library/cpp/messagebus/rain_check/core/task.h index 7d8778bcda..12b55d347c 100644 --- a/library/cpp/messagebus/rain_check/core/task.h +++ b/library/cpp/messagebus/rain_check/core/task.h @@ -2,10 +2,10 @@ #include "fwd.h" -#include <library/cpp/messagebus/actor/actor.h> -#include <library/cpp/messagebus/misc/atomic_box.h> +#include <library/cpp/messagebus/actor/actor.h> +#include <library/cpp/messagebus/misc/atomic_box.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <util/generic/noncopyable.h> #include <util/generic/ptr.h> diff --git a/library/cpp/messagebus/rain_check/core/track.h b/library/cpp/messagebus/rain_check/core/track.h index d387de7574..094bee1506 100644 --- a/library/cpp/messagebus/rain_check/core/track.h +++ b/library/cpp/messagebus/rain_check/core/track.h @@ -3,9 +3,9 @@ #include "spawn.h" #include "task.h" -#include <library/cpp/messagebus/async_result.h> -#include <library/cpp/messagebus/actor/queue_in_actor.h> -#include <library/cpp/messagebus/misc/atomic_box.h> +#include <library/cpp/messagebus/async_result.h> +#include <library/cpp/messagebus/actor/queue_in_actor.h> +#include <library/cpp/messagebus/misc/atomic_box.h> #include <util/generic/intrlist.h> #include <util/system/event.h> diff --git a/library/cpp/messagebus/rain_check/core/track_ut.cpp b/library/cpp/messagebus/rain_check/core/track_ut.cpp index 05f7de1319..7762e7770d 100644 --- a/library/cpp/messagebus/rain_check/core/track_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/track_ut.cpp @@ -2,8 +2,8 @@ #include "track.h" -#include <library/cpp/messagebus/rain_check/test/helper/misc.h> -#include <library/cpp/messagebus/rain_check/test/ut/test.h> +#include <library/cpp/messagebus/rain_check/test/helper/misc.h> +#include <library/cpp/messagebus/rain_check/test/ut/test.h> using namespace NRainCheck; diff --git a/library/cpp/messagebus/rain_check/core/ya.make b/library/cpp/messagebus/rain_check/core/ya.make index c6fb5640d4..307ca2192d 100644 --- a/library/cpp/messagebus/rain_check/core/ya.make +++ b/library/cpp/messagebus/rain_check/core/ya.make @@ -3,11 +3,11 @@ LIBRARY() OWNER(g:messagebus) PEERDIR( - library/cpp/coroutine/engine - library/cpp/deprecated/enum_codegen - library/cpp/messagebus - library/cpp/messagebus/actor - library/cpp/messagebus/scheduler + library/cpp/coroutine/engine + library/cpp/deprecated/enum_codegen + library/cpp/messagebus + library/cpp/messagebus/actor + library/cpp/messagebus/scheduler ) SRCS( diff --git a/library/cpp/messagebus/rain_check/http/client.cpp b/library/cpp/messagebus/rain_check/http/client.cpp index 5ef5ceeece..22deca3827 100644 --- a/library/cpp/messagebus/rain_check/http/client.cpp +++ b/library/cpp/messagebus/rain_check/http/client.cpp @@ -2,11 +2,11 @@ #include "http_code_extractor.h" -#include <library/cpp/http/io/stream.h> -#include <library/cpp/neh/factory.h> -#include <library/cpp/neh/http_common.h> -#include <library/cpp/neh/location.h> -#include <library/cpp/neh/neh.h> +#include <library/cpp/http/io/stream.h> +#include <library/cpp/neh/factory.h> +#include <library/cpp/neh/http_common.h> +#include <library/cpp/neh/location.h> +#include <library/cpp/neh/neh.h> #include <util/generic/ptr.h> #include <util/generic/strbuf.h> diff --git a/library/cpp/messagebus/rain_check/http/client.h b/library/cpp/messagebus/rain_check/http/client.h index d4199c4c98..d16b1db304 100644 --- a/library/cpp/messagebus/rain_check/http/client.h +++ b/library/cpp/messagebus/rain_check/http/client.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/messagebus/rain_check/core/task.h> +#include <library/cpp/messagebus/rain_check/core/task.h> -#include <library/cpp/http/misc/httpcodes.h> +#include <library/cpp/http/misc/httpcodes.h> #include <util/generic/maybe.h> #include <util/generic/ptr.h> diff --git a/library/cpp/messagebus/rain_check/http/client_ut.cpp b/library/cpp/messagebus/rain_check/http/client_ut.cpp index 1628114391..7a0d57e64c 100644 --- a/library/cpp/messagebus/rain_check/http/client_ut.cpp +++ b/library/cpp/messagebus/rain_check/http/client_ut.cpp @@ -3,12 +3,12 @@ #include "client.h" #include "http_code_extractor.h" -#include <library/cpp/messagebus/rain_check/test/ut/test.h> +#include <library/cpp/messagebus/rain_check/test/ut/test.h> -#include <library/cpp/messagebus/test/helper/fixed_port.h> +#include <library/cpp/messagebus/test/helper/fixed_port.h> -#include <library/cpp/http/io/stream.h> -#include <library/cpp/neh/rpc.h> +#include <library/cpp/http/io/stream.h> +#include <library/cpp/neh/rpc.h> #include <util/generic/cast.h> #include <util/generic/ptr.h> diff --git a/library/cpp/messagebus/rain_check/http/http_code_extractor.cpp b/library/cpp/messagebus/rain_check/http/http_code_extractor.cpp index 51d75762f6..71e70d454e 100644 --- a/library/cpp/messagebus/rain_check/http/http_code_extractor.cpp +++ b/library/cpp/messagebus/rain_check/http/http_code_extractor.cpp @@ -1,7 +1,7 @@ #include "http_code_extractor.h" -#include <library/cpp/http/io/stream.h> -#include <library/cpp/http/misc/httpcodes.h> +#include <library/cpp/http/io/stream.h> +#include <library/cpp/http/misc/httpcodes.h> #include <util/generic/maybe.h> #include <util/generic/strbuf.h> @@ -9,10 +9,10 @@ namespace NRainCheck { TMaybe<HttpCodes> TryGetHttpCodeFromErrorDescription(const TStringBuf& errorMessage) { - // Try to get HttpCode from library/cpp/neh response. - // If response has HttpCode and it is not 200 OK, library/cpp/neh will send a message - // "library/cpp/neh/http.cpp:<LINE>: request failed(<FIRST-HTTP-RESPONSE-LINE>)" - // (see library/cpp/neh/http.cpp:625). So, we will try to parse this message and + // Try to get HttpCode from library/cpp/neh response. + // If response has HttpCode and it is not 200 OK, library/cpp/neh will send a message + // "library/cpp/neh/http.cpp:<LINE>: request failed(<FIRST-HTTP-RESPONSE-LINE>)" + // (see library/cpp/neh/http.cpp:625). So, we will try to parse this message and // find out HttpCode in it. It is bad temporary solution, but we have no choice. const TStringBuf SUBSTR = "request failed("; const size_t SUBSTR_LEN = SUBSTR.size(); diff --git a/library/cpp/messagebus/rain_check/http/http_code_extractor.h b/library/cpp/messagebus/rain_check/http/http_code_extractor.h index 33b565fa1c..727ebcbd61 100644 --- a/library/cpp/messagebus/rain_check/http/http_code_extractor.h +++ b/library/cpp/messagebus/rain_check/http/http_code_extractor.h @@ -1,15 +1,15 @@ #pragma once -#include <library/cpp/http/misc/httpcodes.h> +#include <library/cpp/http/misc/httpcodes.h> #include <util/generic/maybe.h> #include <util/generic/strbuf.h> namespace NRainCheck { - // Try to get HttpCode from library/cpp/neh response. - // If response has HttpCode and it is not 200 OK, library/cpp/neh will send a message - // "library/cpp/neh/http.cpp:<LINE>: request failed(<FIRST-HTTP-RESPONSE-LINE>)" - // (see library/cpp/neh/http.cpp:625). So, we will try to parse this message and + // Try to get HttpCode from library/cpp/neh response. + // If response has HttpCode and it is not 200 OK, library/cpp/neh will send a message + // "library/cpp/neh/http.cpp:<LINE>: request failed(<FIRST-HTTP-RESPONSE-LINE>)" + // (see library/cpp/neh/http.cpp:625). So, we will try to parse this message and // find out HttpCode in it. It is bad temporary solution, but we have no choice. TMaybe<HttpCodes> TryGetHttpCodeFromErrorDescription(const TStringBuf& errorMessage); diff --git a/library/cpp/messagebus/rain_check/http/ya.make b/library/cpp/messagebus/rain_check/http/ya.make index ef13329df3..59f7b3b2f2 100644 --- a/library/cpp/messagebus/rain_check/http/ya.make +++ b/library/cpp/messagebus/rain_check/http/ya.make @@ -8,10 +8,10 @@ SRCS( ) PEERDIR( - library/cpp/messagebus/rain_check/core - library/cpp/neh - library/cpp/http/misc - library/cpp/http/io + library/cpp/messagebus/rain_check/core + library/cpp/neh + library/cpp/http/misc + library/cpp/http/io ) END() diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h index 0a291cdea6..5439c0c9a3 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/messagebus/rain_check/core/task.h> +#include <library/cpp/messagebus/rain_check/core/task.h> -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/ybus.h> namespace NRainCheck { class TBusFuture: public TSubtaskCompletion { diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp b/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp index 1b3618558b..0ed2b6e8d0 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp @@ -2,10 +2,10 @@ #include "messagebus_client.h" -#include <library/cpp/messagebus/rain_check/test/ut/test.h> +#include <library/cpp/messagebus/rain_check/test/ut/test.h> -#include <library/cpp/messagebus/test/helper/example.h> -#include <library/cpp/messagebus/test/helper/object_count_check.h> +#include <library/cpp/messagebus/test/helper/example.h> +#include <library/cpp/messagebus/test/helper/object_count_check.h> #include <util/generic/cast.h> diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_server.cpp b/library/cpp/messagebus/rain_check/messagebus/messagebus_server.cpp index 5d4b13d664..bcc31eeb92 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_server.cpp +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_server.cpp @@ -1,6 +1,6 @@ #include "messagebus_server.h" -#include <library/cpp/messagebus/rain_check/core/spawn.h> +#include <library/cpp/messagebus/rain_check/core/spawn.h> using namespace NRainCheck; diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_server.h b/library/cpp/messagebus/rain_check/messagebus/messagebus_server.h index 1334f05fe4..f22b496f19 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_server.h +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_server.h @@ -1,9 +1,9 @@ #pragma once -#include <library/cpp/messagebus/rain_check/core/spawn.h> -#include <library/cpp/messagebus/rain_check/core/task.h> +#include <library/cpp/messagebus/rain_check/core/spawn.h> +#include <library/cpp/messagebus/rain_check/core/task.h> -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/ybus.h> #include <util/system/yassert.h> diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp b/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp index 7c11399f1b..fcd23c4961 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp @@ -2,9 +2,9 @@ #include "messagebus_server.h" -#include <library/cpp/messagebus/rain_check/test/ut/test.h> +#include <library/cpp/messagebus/rain_check/test/ut/test.h> -#include <library/cpp/messagebus/test/helper/example.h> +#include <library/cpp/messagebus/test/helper/example.h> using namespace NBus; using namespace NBus::NTest; diff --git a/library/cpp/messagebus/rain_check/messagebus/ya.make b/library/cpp/messagebus/rain_check/messagebus/ya.make index defdac9a61..e5f7c016b1 100644 --- a/library/cpp/messagebus/rain_check/messagebus/ya.make +++ b/library/cpp/messagebus/rain_check/messagebus/ya.make @@ -3,8 +3,8 @@ LIBRARY() OWNER(g:messagebus) PEERDIR( - library/cpp/messagebus - library/cpp/messagebus/rain_check/core + library/cpp/messagebus + library/cpp/messagebus/rain_check/core ) SRCS( diff --git a/library/cpp/messagebus/rain_check/test/helper/misc.h b/library/cpp/messagebus/rain_check/test/helper/misc.h index 9150be4d2f..8800c05f6d 100644 --- a/library/cpp/messagebus/rain_check/test/helper/misc.h +++ b/library/cpp/messagebus/rain_check/test/helper/misc.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/messagebus/rain_check/core/rain_check.h> +#include <library/cpp/messagebus/rain_check/core/rain_check.h> #include <array> diff --git a/library/cpp/messagebus/rain_check/test/helper/ya.make b/library/cpp/messagebus/rain_check/test/helper/ya.make index aa9e4e6d81..a5dc1e9b6c 100644 --- a/library/cpp/messagebus/rain_check/test/helper/ya.make +++ b/library/cpp/messagebus/rain_check/test/helper/ya.make @@ -3,7 +3,7 @@ LIBRARY(messagebus-rain_check-test-helper) OWNER(g:messagebus) PEERDIR( - library/cpp/messagebus/rain_check/core + library/cpp/messagebus/rain_check/core ) SRCS( diff --git a/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp b/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp index 22edbd8c6b..14107a407b 100644 --- a/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp +++ b/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/messagebus/rain_check/test/helper/misc.h> +#include <library/cpp/messagebus/rain_check/test/helper/misc.h> -#include <library/cpp/messagebus/rain_check/core/rain_check.h> +#include <library/cpp/messagebus/rain_check/core/rain_check.h> #include <util/datetime/base.h> diff --git a/library/cpp/messagebus/rain_check/test/perftest/ya.make b/library/cpp/messagebus/rain_check/test/perftest/ya.make index 7330a71700..04684be5d2 100644 --- a/library/cpp/messagebus/rain_check/test/perftest/ya.make +++ b/library/cpp/messagebus/rain_check/test/perftest/ya.make @@ -3,8 +3,8 @@ PROGRAM(messagebus_rain_check_perftest) OWNER(g:messagebus) PEERDIR( - library/cpp/messagebus/rain_check/core - library/cpp/messagebus/rain_check/test/helper + library/cpp/messagebus/rain_check/core + library/cpp/messagebus/rain_check/test/helper ) SRCS( diff --git a/library/cpp/messagebus/rain_check/test/ut/test.h b/library/cpp/messagebus/rain_check/test/ut/test.h index 724f6b7530..91e09d353a 100644 --- a/library/cpp/messagebus/rain_check/test/ut/test.h +++ b/library/cpp/messagebus/rain_check/test/ut/test.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/messagebus/rain_check/core/rain_check.h> +#include <library/cpp/messagebus/rain_check/core/rain_check.h> -#include <library/cpp/messagebus/misc/test_sync.h> +#include <library/cpp/messagebus/misc/test_sync.h> template <typename TSelf> struct TTestEnvTemplate: public NRainCheck::TSimpleEnvTemplate<TSelf> { diff --git a/library/cpp/messagebus/rain_check/test/ut/ya.make b/library/cpp/messagebus/rain_check/test/ut/ya.make index 9f7a93417a..823b680749 100644 --- a/library/cpp/messagebus/rain_check/test/ut/ya.make +++ b/library/cpp/messagebus/rain_check/test/ut/ya.make @@ -4,10 +4,10 @@ OWNER(g:messagebus) PEERDIR( library/cpp/testing/unittest_main - library/cpp/messagebus/rain_check/core - library/cpp/messagebus/rain_check/http - library/cpp/messagebus/rain_check/messagebus - library/cpp/messagebus/test/helper + library/cpp/messagebus/rain_check/core + library/cpp/messagebus/rain_check/http + library/cpp/messagebus/rain_check/messagebus + library/cpp/messagebus/test/helper ) SRCS( diff --git a/library/cpp/messagebus/remote_client_connection.cpp b/library/cpp/messagebus/remote_client_connection.cpp index 8c7a6db3a8..2113e294a7 100644 --- a/library/cpp/messagebus/remote_client_connection.cpp +++ b/library/cpp/messagebus/remote_client_connection.cpp @@ -4,8 +4,8 @@ #include "network.h" #include "remote_client_session.h" -#include <library/cpp/messagebus/actor/executor.h> -#include <library/cpp/messagebus/actor/temp_tls_vector.h> +#include <library/cpp/messagebus/actor/executor.h> +#include <library/cpp/messagebus/actor/temp_tls_vector.h> #include <util/generic/cast.h> #include <util/thread/singleton.h> diff --git a/library/cpp/messagebus/remote_client_session.cpp b/library/cpp/messagebus/remote_client_session.cpp index 3bc421944f..89bffae8f8 100644 --- a/library/cpp/messagebus/remote_client_session.cpp +++ b/library/cpp/messagebus/remote_client_session.cpp @@ -3,7 +3,7 @@ #include "mb_lwtrace.h" #include "remote_client_connection.h" -#include <library/cpp/messagebus/scheduler/scheduler.h> +#include <library/cpp/messagebus/scheduler/scheduler.h> #include <util/generic/cast.h> #include <util/system/defaults.h> diff --git a/library/cpp/messagebus/remote_connection.cpp b/library/cpp/messagebus/remote_connection.cpp index 22932569db..f9db43291c 100644 --- a/library/cpp/messagebus/remote_connection.cpp +++ b/library/cpp/messagebus/remote_connection.cpp @@ -8,7 +8,7 @@ #include "remote_server_session.h" #include "session_impl.h" -#include <library/cpp/messagebus/actor/what_thread_does.h> +#include <library/cpp/messagebus/actor/what_thread_does.h> #include <util/generic/cast.h> #include <util/network/init.h> diff --git a/library/cpp/messagebus/remote_connection.h b/library/cpp/messagebus/remote_connection.h index 4538947368..68783857d8 100644 --- a/library/cpp/messagebus/remote_connection.h +++ b/library/cpp/messagebus/remote_connection.h @@ -16,11 +16,11 @@ #include "misc/granup.h" #include "misc/tokenquota.h" -#include <library/cpp/messagebus/actor/actor.h> -#include <library/cpp/messagebus/actor/executor.h> -#include <library/cpp/messagebus/actor/queue_for_actor.h> -#include <library/cpp/messagebus/actor/queue_in_actor.h> -#include <library/cpp/messagebus/scheduler/scheduler.h> +#include <library/cpp/messagebus/actor/actor.h> +#include <library/cpp/messagebus/actor/executor.h> +#include <library/cpp/messagebus/actor/queue_for_actor.h> +#include <library/cpp/messagebus/actor/queue_in_actor.h> +#include <library/cpp/messagebus/scheduler/scheduler.h> #include <util/system/atomic.h> #include <util/system/event.h> diff --git a/library/cpp/messagebus/remote_connection_status.cpp b/library/cpp/messagebus/remote_connection_status.cpp index 2c48b2a287..b87d532714 100644 --- a/library/cpp/messagebus/remote_connection_status.cpp +++ b/library/cpp/messagebus/remote_connection_status.cpp @@ -2,7 +2,7 @@ #include "key_value_printer.h" -#include <library/cpp/messagebus/monitoring/mon_proto.pb.h> +#include <library/cpp/messagebus/monitoring/mon_proto.pb.h> #include <util/stream/format.h> #include <util/stream/output.h> diff --git a/library/cpp/messagebus/remote_connection_status.h b/library/cpp/messagebus/remote_connection_status.h index 5db10e51ea..ca55fc91de 100644 --- a/library/cpp/messagebus/remote_connection_status.h +++ b/library/cpp/messagebus/remote_connection_status.h @@ -7,9 +7,9 @@ #include "queue_config.h" #include "session_config.h" -#include <library/cpp/messagebus/actor/executor.h> +#include <library/cpp/messagebus/actor/executor.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> namespace NBus { class TConnectionStatusMonRecord; diff --git a/library/cpp/messagebus/remote_server_session.cpp b/library/cpp/messagebus/remote_server_session.cpp index 6abbf88a60..947a9dbfaf 100644 --- a/library/cpp/messagebus/remote_server_session.cpp +++ b/library/cpp/messagebus/remote_server_session.cpp @@ -3,7 +3,7 @@ #include "remote_connection.h" #include "remote_server_connection.h" -#include <library/cpp/messagebus/actor/temp_tls_vector.h> +#include <library/cpp/messagebus/actor/temp_tls_vector.h> #include <util/generic/cast.h> #include <util/stream/output.h> diff --git a/library/cpp/messagebus/scheduler/scheduler_ut.cpp b/library/cpp/messagebus/scheduler/scheduler_ut.cpp index a5ea641c10..f334b969d1 100644 --- a/library/cpp/messagebus/scheduler/scheduler_ut.cpp +++ b/library/cpp/messagebus/scheduler/scheduler_ut.cpp @@ -2,7 +2,7 @@ #include "scheduler.h" -#include <library/cpp/messagebus/misc/test_sync.h> +#include <library/cpp/messagebus/misc/test_sync.h> using namespace NBus; using namespace NBus::NPrivate; diff --git a/library/cpp/messagebus/scheduler_actor.h b/library/cpp/messagebus/scheduler_actor.h index d0c23c94c4..d2a08c7c94 100644 --- a/library/cpp/messagebus/scheduler_actor.h +++ b/library/cpp/messagebus/scheduler_actor.h @@ -2,9 +2,9 @@ #include "local_tasks.h" -#include <library/cpp/messagebus/actor/actor.h> -#include <library/cpp/messagebus/actor/what_thread_does_guard.h> -#include <library/cpp/messagebus/scheduler/scheduler.h> +#include <library/cpp/messagebus/actor/actor.h> +#include <library/cpp/messagebus/actor/what_thread_does_guard.h> +#include <library/cpp/messagebus/scheduler/scheduler.h> #include <util/system/mutex.h> diff --git a/library/cpp/messagebus/session.h b/library/cpp/messagebus/session.h index fb12ab7c22..d53daf8982 100644 --- a/library/cpp/messagebus/session.h +++ b/library/cpp/messagebus/session.h @@ -9,7 +9,7 @@ #include "session_config.h" #include "misc/weak_ptr.h" -#include <library/cpp/messagebus/monitoring/mon_proto.pb.h> +#include <library/cpp/messagebus/monitoring/mon_proto.pb.h> #include <util/generic/array_ref.h> #include <util/generic/ptr.h> diff --git a/library/cpp/messagebus/session_config.h b/library/cpp/messagebus/session_config.h index 37df97e986..daf9442c38 100644 --- a/library/cpp/messagebus/session_config.h +++ b/library/cpp/messagebus/session_config.h @@ -1,4 +1,4 @@ #pragma once -#include <library/cpp/messagebus/config/session_config.h> +#include <library/cpp/messagebus/config/session_config.h> diff --git a/library/cpp/messagebus/session_impl.h b/library/cpp/messagebus/session_impl.h index 90ef246ff8..a73b2921e5 100644 --- a/library/cpp/messagebus/session_impl.h +++ b/library/cpp/messagebus/session_impl.h @@ -10,9 +10,9 @@ #include "shutdown_state.h" #include "ybus.h" -#include <library/cpp/messagebus/actor/actor.h> -#include <library/cpp/messagebus/actor/queue_in_actor.h> -#include <library/cpp/messagebus/monitoring/mon_proto.pb.h> +#include <library/cpp/messagebus/actor/actor.h> +#include <library/cpp/messagebus/actor/queue_in_actor.h> +#include <library/cpp/messagebus/monitoring/mon_proto.pb.h> #include <library/cpp/threading/future/legacy_future.h> diff --git a/library/cpp/messagebus/test/example/client/client.cpp b/library/cpp/messagebus/test/example/client/client.cpp index 89b5f2c9be..6e84556d70 100644 --- a/library/cpp/messagebus/test/example/client/client.cpp +++ b/library/cpp/messagebus/test/example/client/client.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/messagebus/test/example/common/proto.h> +#include <library/cpp/messagebus/test/example/common/proto.h> #include <util/random/random.h> diff --git a/library/cpp/messagebus/test/example/client/ya.make b/library/cpp/messagebus/test/example/client/ya.make index a660a01698..05c3d6ca5f 100644 --- a/library/cpp/messagebus/test/example/client/ya.make +++ b/library/cpp/messagebus/test/example/client/ya.make @@ -3,7 +3,7 @@ PROGRAM(messagebus_example_client) OWNER(g:messagebus) PEERDIR( - library/cpp/messagebus/test/example/common + library/cpp/messagebus/test/example/common ) SRCS( diff --git a/library/cpp/messagebus/test/example/common/proto.h b/library/cpp/messagebus/test/example/common/proto.h index a151aac468..8716869e30 100644 --- a/library/cpp/messagebus/test/example/common/proto.h +++ b/library/cpp/messagebus/test/example/common/proto.h @@ -1,9 +1,9 @@ #pragma once -#include <library/cpp/messagebus/test/example/common/messages.pb.h> +#include <library/cpp/messagebus/test/example/common/messages.pb.h> -#include <library/cpp/messagebus/ybus.h> -#include <library/cpp/messagebus/protobuf/ybusbuf.h> +#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/protobuf/ybusbuf.h> namespace NCalculator { typedef ::NBus::TBusBufferMessage<TRequestSumRecord, 1> TRequestSum; diff --git a/library/cpp/messagebus/test/example/common/ya.make b/library/cpp/messagebus/test/example/common/ya.make index 4da16608fc..c4f09a5470 100644 --- a/library/cpp/messagebus/test/example/common/ya.make +++ b/library/cpp/messagebus/test/example/common/ya.make @@ -3,8 +3,8 @@ LIBRARY(messagebus_test_example_common) OWNER(g:messagebus) PEERDIR( - library/cpp/messagebus - library/cpp/messagebus/protobuf + library/cpp/messagebus + library/cpp/messagebus/protobuf ) SRCS( diff --git a/library/cpp/messagebus/test/example/server/server.cpp b/library/cpp/messagebus/test/example/server/server.cpp index 13e52d75f5..8bbf2a2605 100644 --- a/library/cpp/messagebus/test/example/server/server.cpp +++ b/library/cpp/messagebus/test/example/server/server.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/messagebus/test/example/common/proto.h> +#include <library/cpp/messagebus/test/example/common/proto.h> using namespace NBus; using namespace NCalculator; diff --git a/library/cpp/messagebus/test/example/server/ya.make b/library/cpp/messagebus/test/example/server/ya.make index 8cdd97cb12..c5e96c9191 100644 --- a/library/cpp/messagebus/test/example/server/ya.make +++ b/library/cpp/messagebus/test/example/server/ya.make @@ -3,7 +3,7 @@ PROGRAM(messagebus_example_server) OWNER(g:messagebus) PEERDIR( - library/cpp/messagebus/test/example/common + library/cpp/messagebus/test/example/common ) SRCS( diff --git a/library/cpp/messagebus/test/helper/example.h b/library/cpp/messagebus/test/helper/example.h index 26b7475308..402b39e652 100644 --- a/library/cpp/messagebus/test/helper/example.h +++ b/library/cpp/messagebus/test/helper/example.h @@ -5,8 +5,8 @@ #include "alloc_counter.h" #include "message_handler_error.h" -#include <library/cpp/messagebus/ybus.h> -#include <library/cpp/messagebus/misc/test_sync.h> +#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/misc/test_sync.h> #include <util/system/event.h> diff --git a/library/cpp/messagebus/test/helper/example_module.h b/library/cpp/messagebus/test/helper/example_module.h index a0b295f613..6389224028 100644 --- a/library/cpp/messagebus/test/helper/example_module.h +++ b/library/cpp/messagebus/test/helper/example_module.h @@ -2,7 +2,7 @@ #include "example.h" -#include <library/cpp/messagebus/oldmodule/module.h> +#include <library/cpp/messagebus/oldmodule/module.h> namespace NBus { namespace NTest { diff --git a/library/cpp/messagebus/test/helper/hanging_server.h b/library/cpp/messagebus/test/helper/hanging_server.h index cc9fb274d8..1816198fe9 100644 --- a/library/cpp/messagebus/test/helper/hanging_server.h +++ b/library/cpp/messagebus/test/helper/hanging_server.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/messagebus/network.h> +#include <library/cpp/messagebus/network.h> #include <util/network/sock.h> diff --git a/library/cpp/messagebus/test/helper/message_handler_error.h b/library/cpp/messagebus/test/helper/message_handler_error.h index a314b10761..1cfbd18d70 100644 --- a/library/cpp/messagebus/test/helper/message_handler_error.h +++ b/library/cpp/messagebus/test/helper/message_handler_error.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/ybus.h> namespace NBus { namespace NTest { diff --git a/library/cpp/messagebus/test/helper/object_count_check.h b/library/cpp/messagebus/test/helper/object_count_check.h index 1c4756e58c..edcfe6c312 100644 --- a/library/cpp/messagebus/test/helper/object_count_check.h +++ b/library/cpp/messagebus/test/helper/object_count_check.h @@ -2,13 +2,13 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/messagebus/remote_client_connection.h> -#include <library/cpp/messagebus/remote_client_session.h> -#include <library/cpp/messagebus/remote_server_connection.h> -#include <library/cpp/messagebus/remote_server_session.h> -#include <library/cpp/messagebus/ybus.h> -#include <library/cpp/messagebus/oldmodule/module.h> -#include <library/cpp/messagebus/scheduler/scheduler.h> +#include <library/cpp/messagebus/remote_client_connection.h> +#include <library/cpp/messagebus/remote_client_session.h> +#include <library/cpp/messagebus/remote_server_connection.h> +#include <library/cpp/messagebus/remote_server_session.h> +#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/oldmodule/module.h> +#include <library/cpp/messagebus/scheduler/scheduler.h> #include <util/generic/object_counter.h> #include <util/system/type_name.h> diff --git a/library/cpp/messagebus/test/helper/ya.make b/library/cpp/messagebus/test/helper/ya.make index 97bd45f573..567b6ded15 100644 --- a/library/cpp/messagebus/test/helper/ya.make +++ b/library/cpp/messagebus/test/helper/ya.make @@ -11,7 +11,7 @@ SRCS( ) PEERDIR( - library/cpp/messagebus/oldmodule + library/cpp/messagebus/oldmodule ) END() diff --git a/library/cpp/messagebus/test/perftest/perftest.cpp b/library/cpp/messagebus/test/perftest/perftest.cpp index 8489319278..d09d745496 100644 --- a/library/cpp/messagebus/test/perftest/perftest.cpp +++ b/library/cpp/messagebus/test/perftest/perftest.cpp @@ -1,19 +1,19 @@ #include "simple_proto.h" -#include <library/cpp/messagebus/test/perftest/messages.pb.h> +#include <library/cpp/messagebus/test/perftest/messages.pb.h> -#include <library/cpp/messagebus/text_utils.h> -#include <library/cpp/messagebus/thread_extra.h> -#include <library/cpp/messagebus/ybus.h> -#include <library/cpp/messagebus/oldmodule/module.h> -#include <library/cpp/messagebus/protobuf/ybusbuf.h> -#include <library/cpp/messagebus/www/www.h> +#include <library/cpp/messagebus/text_utils.h> +#include <library/cpp/messagebus/thread_extra.h> +#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/oldmodule/module.h> +#include <library/cpp/messagebus/protobuf/ybusbuf.h> +#include <library/cpp/messagebus/www/www.h> -#include <library/cpp/deprecated/threadable/threadable.h> -#include <library/cpp/execprofile/profile.h> +#include <library/cpp/deprecated/threadable/threadable.h> +#include <library/cpp/execprofile/profile.h> #include <library/cpp/getopt/opt.h> -#include <library/cpp/lwtrace/start.h> -#include <library/cpp/sighandler/async_signals_handler.h> +#include <library/cpp/lwtrace/start.h> +#include <library/cpp/sighandler/async_signals_handler.h> #include <library/cpp/threading/future/legacy_future.h> #include <util/generic/ptr.h> diff --git a/library/cpp/messagebus/test/perftest/simple_proto.h b/library/cpp/messagebus/test/perftest/simple_proto.h index 4a0cc08db3..fc958061b7 100644 --- a/library/cpp/messagebus/test/perftest/simple_proto.h +++ b/library/cpp/messagebus/test/perftest/simple_proto.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/ybus.h> struct TSimpleMessage: public NBus::TBusMessage { ui32 Payload; diff --git a/library/cpp/messagebus/test/perftest/stackcollect.diff b/library/cpp/messagebus/test/perftest/stackcollect.diff index 658f0141b3..0d1de3e973 100644 --- a/library/cpp/messagebus/test/perftest/stackcollect.diff +++ b/library/cpp/messagebus/test/perftest/stackcollect.diff @@ -6,8 +6,8 @@ Index: test/perftest/CMakeLists.txt OWNER(nga) PEERDIR( -- library/cpp/execprofile +- library/cpp/execprofile + junk/davenger/stackcollect - library/cpp/messagebus - library/cpp/messagebus/protobuf - library/cpp/sighandler + library/cpp/messagebus + library/cpp/messagebus/protobuf + library/cpp/sighandler diff --git a/library/cpp/messagebus/test/perftest/ya.make b/library/cpp/messagebus/test/perftest/ya.make index 24c2848ed5..929d4cf685 100644 --- a/library/cpp/messagebus/test/perftest/ya.make +++ b/library/cpp/messagebus/test/perftest/ya.make @@ -3,15 +3,15 @@ PROGRAM(messagebus_perftest) OWNER(g:messagebus) PEERDIR( - library/cpp/deprecated/threadable - library/cpp/execprofile + library/cpp/deprecated/threadable + library/cpp/execprofile library/cpp/getopt - library/cpp/lwtrace - library/cpp/messagebus - library/cpp/messagebus/oldmodule - library/cpp/messagebus/protobuf - library/cpp/messagebus/www - library/cpp/sighandler + library/cpp/lwtrace + library/cpp/messagebus + library/cpp/messagebus/oldmodule + library/cpp/messagebus/protobuf + library/cpp/messagebus/www + library/cpp/sighandler library/cpp/threading/future ) diff --git a/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp b/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp index 3fdd175d73..e282b457eb 100644 --- a/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp +++ b/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp @@ -1,7 +1,7 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/messagebus/test_utils.h> -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/test_utils.h> +#include <library/cpp/messagebus/ybus.h> class TLocatorRegisterUniqTest: public TTestBase { UNIT_TEST_SUITE(TLocatorRegisterUniqTest); diff --git a/library/cpp/messagebus/test/ut/messagebus_ut.cpp b/library/cpp/messagebus/test/ut/messagebus_ut.cpp index 040f9b7702..980d2adc6c 100644 --- a/library/cpp/messagebus/test/ut/messagebus_ut.cpp +++ b/library/cpp/messagebus/test/ut/messagebus_ut.cpp @@ -1,12 +1,12 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/messagebus/test/helper/example.h> -#include <library/cpp/messagebus/test/helper/fixed_port.h> -#include <library/cpp/messagebus/test/helper/hanging_server.h> -#include <library/cpp/messagebus/test/helper/object_count_check.h> -#include <library/cpp/messagebus/test/helper/wait_for.h> +#include <library/cpp/messagebus/test/helper/example.h> +#include <library/cpp/messagebus/test/helper/fixed_port.h> +#include <library/cpp/messagebus/test/helper/hanging_server.h> +#include <library/cpp/messagebus/test/helper/object_count_check.h> +#include <library/cpp/messagebus/test/helper/wait_for.h> -#include <library/cpp/messagebus/misc/test_sync.h> +#include <library/cpp/messagebus/misc/test_sync.h> #include <util/network/sock.h> diff --git a/library/cpp/messagebus/test/ut/module_client_one_way_ut.cpp b/library/cpp/messagebus/test/ut/module_client_one_way_ut.cpp index 4083cf3b7b..23e7d41434 100644 --- a/library/cpp/messagebus/test/ut/module_client_one_way_ut.cpp +++ b/library/cpp/messagebus/test/ut/module_client_one_way_ut.cpp @@ -1,10 +1,10 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/messagebus/test/helper/example.h> -#include <library/cpp/messagebus/test/helper/message_handler_error.h> +#include <library/cpp/messagebus/test/helper/example.h> +#include <library/cpp/messagebus/test/helper/message_handler_error.h> -#include <library/cpp/messagebus/misc/test_sync.h> -#include <library/cpp/messagebus/oldmodule/module.h> +#include <library/cpp/messagebus/misc/test_sync.h> +#include <library/cpp/messagebus/oldmodule/module.h> using namespace NBus; using namespace NBus::NTest; diff --git a/library/cpp/messagebus/test/ut/module_client_ut.cpp b/library/cpp/messagebus/test/ut/module_client_ut.cpp index ebfe185cc6..0c2b78c27e 100644 --- a/library/cpp/messagebus/test/ut/module_client_ut.cpp +++ b/library/cpp/messagebus/test/ut/module_client_ut.cpp @@ -3,13 +3,13 @@ #include "count_down_latch.h" #include "moduletest.h" -#include <library/cpp/messagebus/test/helper/example.h> -#include <library/cpp/messagebus/test/helper/example_module.h> -#include <library/cpp/messagebus/test/helper/object_count_check.h> -#include <library/cpp/messagebus/test/helper/wait_for.h> +#include <library/cpp/messagebus/test/helper/example.h> +#include <library/cpp/messagebus/test/helper/example_module.h> +#include <library/cpp/messagebus/test/helper/object_count_check.h> +#include <library/cpp/messagebus/test/helper/wait_for.h> -#include <library/cpp/messagebus/misc/test_sync.h> -#include <library/cpp/messagebus/oldmodule/module.h> +#include <library/cpp/messagebus/misc/test_sync.h> +#include <library/cpp/messagebus/oldmodule/module.h> #include <util/generic/cast.h> #include <util/system/event.h> diff --git a/library/cpp/messagebus/test/ut/module_server_ut.cpp b/library/cpp/messagebus/test/ut/module_server_ut.cpp index 88fe1dd9b6..02e7e273a6 100644 --- a/library/cpp/messagebus/test/ut/module_server_ut.cpp +++ b/library/cpp/messagebus/test/ut/module_server_ut.cpp @@ -3,12 +3,12 @@ #include "count_down_latch.h" #include "moduletest.h" -#include <library/cpp/messagebus/test/helper/example.h> -#include <library/cpp/messagebus/test/helper/example_module.h> -#include <library/cpp/messagebus/test/helper/object_count_check.h> -#include <library/cpp/messagebus/test/helper/wait_for.h> +#include <library/cpp/messagebus/test/helper/example.h> +#include <library/cpp/messagebus/test/helper/example_module.h> +#include <library/cpp/messagebus/test/helper/object_count_check.h> +#include <library/cpp/messagebus/test/helper/wait_for.h> -#include <library/cpp/messagebus/oldmodule/module.h> +#include <library/cpp/messagebus/oldmodule/module.h> #include <util/generic/cast.h> diff --git a/library/cpp/messagebus/test/ut/moduletest.h b/library/cpp/messagebus/test/ut/moduletest.h index d5da72c0cb..192032e2f4 100644 --- a/library/cpp/messagebus/test/ut/moduletest.h +++ b/library/cpp/messagebus/test/ut/moduletest.h @@ -4,12 +4,12 @@ /// \file /// \brief Example of using local session for communication. -#include <library/cpp/messagebus/test/helper/alloc_counter.h> -#include <library/cpp/messagebus/test/helper/example.h> -#include <library/cpp/messagebus/test/helper/message_handler_error.h> +#include <library/cpp/messagebus/test/helper/alloc_counter.h> +#include <library/cpp/messagebus/test/helper/example.h> +#include <library/cpp/messagebus/test/helper/message_handler_error.h> -#include <library/cpp/messagebus/ybus.h> -#include <library/cpp/messagebus/oldmodule/module.h> +#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/oldmodule/module.h> namespace NBus { namespace NTest { diff --git a/library/cpp/messagebus/test/ut/one_way_ut.cpp b/library/cpp/messagebus/test/ut/one_way_ut.cpp index 9c21227e2b..a9b7e848b5 100644 --- a/library/cpp/messagebus/test/ut/one_way_ut.cpp +++ b/library/cpp/messagebus/test/ut/one_way_ut.cpp @@ -24,14 +24,14 @@ /// See example in NBus::NullServer::OnMessage(). /// Discard identity for reply message. -#include <library/cpp/messagebus/test/helper/alloc_counter.h> -#include <library/cpp/messagebus/test/helper/example.h> -#include <library/cpp/messagebus/test/helper/hanging_server.h> -#include <library/cpp/messagebus/test/helper/message_handler_error.h> -#include <library/cpp/messagebus/test/helper/object_count_check.h> -#include <library/cpp/messagebus/test/helper/wait_for.h> - -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/test/helper/alloc_counter.h> +#include <library/cpp/messagebus/test/helper/example.h> +#include <library/cpp/messagebus/test/helper/hanging_server.h> +#include <library/cpp/messagebus/test/helper/message_handler_error.h> +#include <library/cpp/messagebus/test/helper/object_count_check.h> +#include <library/cpp/messagebus/test/helper/wait_for.h> + +#include <library/cpp/messagebus/ybus.h> using namespace std; using namespace NBus; diff --git a/library/cpp/messagebus/test/ut/starter_ut.cpp b/library/cpp/messagebus/test/ut/starter_ut.cpp index dd4d3aaa5e..647f959d1e 100644 --- a/library/cpp/messagebus/test/ut/starter_ut.cpp +++ b/library/cpp/messagebus/test/ut/starter_ut.cpp @@ -1,8 +1,8 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/messagebus/test/helper/example_module.h> -#include <library/cpp/messagebus/test/helper/object_count_check.h> -#include <library/cpp/messagebus/test/helper/wait_for.h> +#include <library/cpp/messagebus/test/helper/example_module.h> +#include <library/cpp/messagebus/test/helper/object_count_check.h> +#include <library/cpp/messagebus/test/helper/wait_for.h> using namespace NBus; using namespace NBus::NTest; diff --git a/library/cpp/messagebus/test/ut/sync_client_ut.cpp b/library/cpp/messagebus/test/ut/sync_client_ut.cpp index 400128193f..fc66955b1f 100644 --- a/library/cpp/messagebus/test/ut/sync_client_ut.cpp +++ b/library/cpp/messagebus/test/ut/sync_client_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/messagebus/test/helper/example.h> -#include <library/cpp/messagebus/test/helper/object_count_check.h> +#include <library/cpp/messagebus/test/helper/example.h> +#include <library/cpp/messagebus/test/helper/object_count_check.h> namespace NBus { namespace NTest { diff --git a/library/cpp/messagebus/test/ut/ya.make b/library/cpp/messagebus/test/ut/ya.make index fe1b4961d6..99e40a0924 100644 --- a/library/cpp/messagebus/test/ut/ya.make +++ b/library/cpp/messagebus/test/ut/ya.make @@ -1,6 +1,6 @@ OWNER(g:messagebus) -UNITTEST_FOR(library/cpp/messagebus) +UNITTEST_FOR(library/cpp/messagebus) TIMEOUT(1200) @@ -15,9 +15,9 @@ FORK_SUBTESTS() PEERDIR( library/cpp/testing/unittest_main - library/cpp/messagebus - library/cpp/messagebus/test/helper - library/cpp/messagebus/www + library/cpp/messagebus + library/cpp/messagebus/test/helper + library/cpp/messagebus/www ) SRCS( diff --git a/library/cpp/messagebus/thread_extra.h b/library/cpp/messagebus/thread_extra.h index 2c79741e88..dc78121752 100644 --- a/library/cpp/messagebus/thread_extra.h +++ b/library/cpp/messagebus/thread_extra.h @@ -1,3 +1,3 @@ #pragma once -#include <library/cpp/messagebus/actor/thread_extra.h> +#include <library/cpp/messagebus/actor/thread_extra.h> diff --git a/library/cpp/messagebus/www/html_output.h b/library/cpp/messagebus/www/html_output.h index 27e77adefa..f8563102b1 100644 --- a/library/cpp/messagebus/www/html_output.h +++ b/library/cpp/messagebus/www/html_output.h @@ -4,7 +4,7 @@ #include <util/generic/string.h> #include <util/stream/output.h> -#include <library/cpp/html/pcdata/pcdata.h> +#include <library/cpp/html/pcdata/pcdata.h> #include <util/system/tls.h> extern Y_POD_THREAD(IOutputStream*) HtmlOutputStreamPtr; diff --git a/library/cpp/messagebus/www/www.cpp b/library/cpp/messagebus/www/www.cpp index 62ec241d85..c86751f2a7 100644 --- a/library/cpp/messagebus/www/www.cpp +++ b/library/cpp/messagebus/www/www.cpp @@ -3,15 +3,15 @@ #include "concat_strings.h" #include "html_output.h" -#include <library/cpp/messagebus/remote_connection_status.h> +#include <library/cpp/messagebus/remote_connection_status.h> #include <library/cpp/monlib/deprecated/json/writer.h> -#include <library/cpp/archive/yarchive.h> -#include <library/cpp/http/fetch/httpfsm.h> -#include <library/cpp/http/fetch/httpheader.h> -#include <library/cpp/http/server/http.h> -#include <library/cpp/json/writer/json.h> -#include <library/cpp/uri/http_url.h> +#include <library/cpp/archive/yarchive.h> +#include <library/cpp/http/fetch/httpfsm.h> +#include <library/cpp/http/fetch/httpheader.h> +#include <library/cpp/http/server/http.h> +#include <library/cpp/json/writer/json.h> +#include <library/cpp/uri/http_url.h> #include <util/string/cast.h> #include <util/string/printf.h> diff --git a/library/cpp/messagebus/www/www.h b/library/cpp/messagebus/www/www.h index 6cd652b477..0e624786e4 100644 --- a/library/cpp/messagebus/www/www.h +++ b/library/cpp/messagebus/www/www.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/messagebus/ybus.h> -#include <library/cpp/messagebus/oldmodule/module.h> +#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/oldmodule/module.h> #include <util/generic/ptr.h> #include <util/generic/string.h> diff --git a/library/cpp/messagebus/www/ya.make b/library/cpp/messagebus/www/ya.make index 972390cea3..9057ece4d8 100644 --- a/library/cpp/messagebus/www/ya.make +++ b/library/cpp/messagebus/www/ya.make @@ -14,16 +14,16 @@ ARCHIVE( ) PEERDIR( - library/cpp/archive + library/cpp/archive library/cpp/cgiparam - library/cpp/html/pcdata - library/cpp/http/fetch - library/cpp/http/server - library/cpp/json/writer - library/cpp/messagebus - library/cpp/messagebus/oldmodule + library/cpp/html/pcdata + library/cpp/http/fetch + library/cpp/http/server + library/cpp/json/writer + library/cpp/messagebus + library/cpp/messagebus/oldmodule library/cpp/monlib/deprecated/json - library/cpp/uri + library/cpp/uri ) END() diff --git a/library/cpp/messagebus/ya.make b/library/cpp/messagebus/ya.make index e13cf06dea..9dd5e77297 100644 --- a/library/cpp/messagebus/ya.make +++ b/library/cpp/messagebus/ya.make @@ -53,14 +53,14 @@ SRCS( PEERDIR( contrib/libs/sparsehash - library/cpp/codecs - library/cpp/deprecated/enum_codegen + library/cpp/codecs + library/cpp/deprecated/enum_codegen library/cpp/getopt/small - library/cpp/lwtrace - library/cpp/messagebus/actor - library/cpp/messagebus/config - library/cpp/messagebus/monitoring - library/cpp/messagebus/scheduler + library/cpp/lwtrace + library/cpp/messagebus/actor + library/cpp/messagebus/config + library/cpp/messagebus/monitoring + library/cpp/messagebus/scheduler library/cpp/string_utils/indent_text library/cpp/threading/future ) diff --git a/library/cpp/messagebus/ybus.h b/library/cpp/messagebus/ybus.h index de21ad8521..810a0ec916 100644 --- a/library/cpp/messagebus/ybus.h +++ b/library/cpp/messagebus/ybus.h @@ -18,10 +18,10 @@ #include "session_config.h" #include "socket_addr.h" -#include <library/cpp/messagebus/actor/executor.h> -#include <library/cpp/messagebus/scheduler/scheduler.h> +#include <library/cpp/messagebus/actor/executor.h> +#include <library/cpp/messagebus/scheduler/scheduler.h> -#include <library/cpp/codecs/codecs.h> +#include <library/cpp/codecs/codecs.h> #include <util/generic/array_ref.h> #include <util/generic/buffer.h> diff --git a/library/cpp/monlib/counters/histogram.h b/library/cpp/monlib/counters/histogram.h index 96361b0023..f33aae885f 100644 --- a/library/cpp/monlib/counters/histogram.h +++ b/library/cpp/monlib/counters/histogram.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/histogram/hdr/histogram.h> +#include <library/cpp/histogram/hdr/histogram.h> #include <util/system/spinlock.h> #include <util/stream/output.h> diff --git a/library/cpp/monlib/counters/ya.make b/library/cpp/monlib/counters/ya.make index aa1a671bf8..cbaa349912 100644 --- a/library/cpp/monlib/counters/ya.make +++ b/library/cpp/monlib/counters/ya.make @@ -9,7 +9,7 @@ SRCS( ) PEERDIR( - library/cpp/histogram/hdr + library/cpp/histogram/hdr ) END() diff --git a/library/cpp/monlib/deprecated/json/writer.h b/library/cpp/monlib/deprecated/json/writer.h index 183288143c..b365d30e59 100644 --- a/library/cpp/monlib/deprecated/json/writer.h +++ b/library/cpp/monlib/deprecated/json/writer.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_writer.h> namespace NMonitoring { /** diff --git a/library/cpp/monlib/deprecated/json/ya.make b/library/cpp/monlib/deprecated/json/ya.make index 0ca903ee62..41c65c9cd0 100644 --- a/library/cpp/monlib/deprecated/json/ya.make +++ b/library/cpp/monlib/deprecated/json/ya.make @@ -18,7 +18,7 @@ SRCS( ) PEERDIR( - library/cpp/json + library/cpp/json ) END() diff --git a/library/cpp/monlib/encode/json/json_decoder.cpp b/library/cpp/monlib/encode/json/json_decoder.cpp index d44ff5fd28..d7156fc8a9 100644 --- a/library/cpp/monlib/encode/json/json_decoder.cpp +++ b/library/cpp/monlib/encode/json/json_decoder.cpp @@ -6,7 +6,7 @@ #include <library/cpp/monlib/metrics/labels.h> #include <library/cpp/monlib/metrics/metric_value.h> -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> #include <util/datetime/base.h> #include <util/string/cast.h> diff --git a/library/cpp/monlib/encode/json/json_encoder.cpp b/library/cpp/monlib/encode/json/json_encoder.cpp index 20d2bb6283..940535c98a 100644 --- a/library/cpp/monlib/encode/json/json_encoder.cpp +++ b/library/cpp/monlib/encode/json/json_encoder.cpp @@ -7,7 +7,7 @@ #include <library/cpp/monlib/metrics/metric_value.h> #include <library/cpp/monlib/metrics/labels.h> -#include <library/cpp/json/writer/json.h> +#include <library/cpp/json/writer/json.h> #include <util/charset/utf8.h> #include <util/generic/algorithm.h> diff --git a/library/cpp/monlib/encode/json/json_ut.cpp b/library/cpp/monlib/encode/json/json_ut.cpp index 09e7909289..d997d35f4e 100644 --- a/library/cpp/monlib/encode/json/json_ut.cpp +++ b/library/cpp/monlib/encode/json/json_ut.cpp @@ -3,8 +3,8 @@ #include <library/cpp/monlib/encode/protobuf/protobuf.h> #include <library/cpp/monlib/metrics/labels.h> -#include <library/cpp/json/json_reader.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/resource/resource.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/str.h> diff --git a/library/cpp/monlib/encode/json/ut/ya.make b/library/cpp/monlib/encode/json/ut/ya.make index e50c4f4903..1aee416309 100644 --- a/library/cpp/monlib/encode/json/ut/ya.make +++ b/library/cpp/monlib/encode/json/ut/ya.make @@ -37,10 +37,10 @@ RESOURCE( ) PEERDIR( - library/cpp/json + library/cpp/json library/cpp/monlib/consumers library/cpp/monlib/encode/protobuf - library/cpp/resource + library/cpp/resource ) END() diff --git a/library/cpp/monlib/encode/json/ya.make b/library/cpp/monlib/encode/json/ya.make index a50fc412a9..1df63238e3 100644 --- a/library/cpp/monlib/encode/json/ya.make +++ b/library/cpp/monlib/encode/json/ya.make @@ -14,8 +14,8 @@ PEERDIR( library/cpp/monlib/encode library/cpp/monlib/encode/buffered library/cpp/monlib/exception - library/cpp/json - library/cpp/json/writer + library/cpp/json + library/cpp/json/writer ) END() diff --git a/library/cpp/monlib/encode/unistat/unistat_decoder.cpp b/library/cpp/monlib/encode/unistat/unistat_decoder.cpp index b2344b0905..2198be0cd7 100644 --- a/library/cpp/monlib/encode/unistat/unistat_decoder.cpp +++ b/library/cpp/monlib/encode/unistat/unistat_decoder.cpp @@ -6,7 +6,7 @@ #include <library/cpp/monlib/metrics/metric_value.h> #include <library/cpp/monlib/metrics/metric_consumer.h> -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> #include <util/datetime/base.h> #include <util/string/split.h> diff --git a/library/cpp/monlib/encode/unistat/ya.make b/library/cpp/monlib/encode/unistat/ya.make index 4ac2edadf4..3e7d887b1e 100644 --- a/library/cpp/monlib/encode/unistat/ya.make +++ b/library/cpp/monlib/encode/unistat/ya.make @@ -7,7 +7,7 @@ OWNER( PEERDIR( contrib/libs/re2 - library/cpp/json + library/cpp/json library/cpp/monlib/metrics ) diff --git a/library/cpp/monlib/messagebus/mon_messagebus.cpp b/library/cpp/monlib/messagebus/mon_messagebus.cpp index 355b4386cd..c24a7e1d40 100644 --- a/library/cpp/monlib/messagebus/mon_messagebus.cpp +++ b/library/cpp/monlib/messagebus/mon_messagebus.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/messagebus/www/www.h> +#include <library/cpp/messagebus/www/www.h> #include "mon_messagebus.h" diff --git a/library/cpp/monlib/messagebus/mon_messagebus.h b/library/cpp/monlib/messagebus/mon_messagebus.h index e1fa73c69f..65b59cfb01 100644 --- a/library/cpp/monlib/messagebus/mon_messagebus.h +++ b/library/cpp/monlib/messagebus/mon_messagebus.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/messagebus/ybus.h> -#include <library/cpp/messagebus/www/www.h> +#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/www/www.h> #include <library/cpp/monlib/service/pages/mon_page.h> diff --git a/library/cpp/monlib/messagebus/ya.make b/library/cpp/monlib/messagebus/ya.make index a0b5362296..bd68afd8d0 100644 --- a/library/cpp/monlib/messagebus/ya.make +++ b/library/cpp/monlib/messagebus/ya.make @@ -8,8 +8,8 @@ SRCS( ) PEERDIR( - library/cpp/messagebus - library/cpp/messagebus/www + library/cpp/messagebus + library/cpp/messagebus/www library/cpp/monlib/dynamic_counters ) diff --git a/library/cpp/monlib/metrics/metric_registry_ut.cpp b/library/cpp/monlib/metrics/metric_registry_ut.cpp index 86d9a52ec0..95e9c028d4 100644 --- a/library/cpp/monlib/metrics/metric_registry_ut.cpp +++ b/library/cpp/monlib/metrics/metric_registry_ut.cpp @@ -2,7 +2,7 @@ #include <library/cpp/monlib/encode/protobuf/protobuf.h> #include <library/cpp/monlib/encode/json/json.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/monlib/metrics/ut/ya.make b/library/cpp/monlib/metrics/ut/ya.make index aec9974fbd..fe622cd1e7 100644 --- a/library/cpp/monlib/metrics/ut/ya.make +++ b/library/cpp/monlib/metrics/ut/ya.make @@ -23,7 +23,7 @@ RESOURCE( ) PEERDIR( - library/cpp/resource + library/cpp/resource library/cpp/monlib/encode/protobuf library/cpp/monlib/encode/json library/cpp/threading/future diff --git a/library/cpp/monlib/service/monservice.cpp b/library/cpp/monlib/service/monservice.cpp index d1b9cda1d2..e8d29f1ac0 100644 --- a/library/cpp/monlib/service/monservice.cpp +++ b/library/cpp/monlib/service/monservice.cpp @@ -1,8 +1,8 @@ #include "monservice.h" -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/malloc/api/malloc.h> #include <library/cpp/string_utils/base64/base64.h> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/svnversion/svnversion.h> #include <util/generic/map.h> #include <util/generic/ptr.h> diff --git a/library/cpp/monlib/service/pages/resource_mon_page.h b/library/cpp/monlib/service/pages/resource_mon_page.h index f6ab67200e..0b32f20deb 100644 --- a/library/cpp/monlib/service/pages/resource_mon_page.h +++ b/library/cpp/monlib/service/pages/resource_mon_page.h @@ -2,7 +2,7 @@ #include "mon_page.h" -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> namespace NMonitoring { struct TResourceMonPage: public IMonPage { diff --git a/library/cpp/monlib/service/pages/version_mon_page.cpp b/library/cpp/monlib/service/pages/version_mon_page.cpp index 41e29417da..85d8ba87d7 100644 --- a/library/cpp/monlib/service/pages/version_mon_page.cpp +++ b/library/cpp/monlib/service/pages/version_mon_page.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/svnversion/svnversion.h> -#include <library/cpp/build_info/build_info.h> -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/build_info/build_info.h> +#include <library/cpp/malloc/api/malloc.h> #include "version_mon_page.h" diff --git a/library/cpp/monlib/service/pages/ya.make b/library/cpp/monlib/service/pages/ya.make index 48d44a0838..8b11f9e698 100644 --- a/library/cpp/monlib/service/pages/ya.make +++ b/library/cpp/monlib/service/pages/ya.make @@ -17,10 +17,10 @@ SRCS( ) PEERDIR( - library/cpp/build_info - library/cpp/malloc/api - library/cpp/svnversion - library/cpp/resource + library/cpp/build_info + library/cpp/malloc/api + library/cpp/svnversion + library/cpp/resource library/cpp/monlib/service library/cpp/monlib/encode/json library/cpp/monlib/encode/text diff --git a/library/cpp/monlib/service/service.cpp b/library/cpp/monlib/service/service.cpp index 929efbf816..3d257646af 100644 --- a/library/cpp/monlib/service/service.cpp +++ b/library/cpp/monlib/service/service.cpp @@ -1,10 +1,10 @@ #include "service.h" -#include <library/cpp/coroutine/engine/sockpool.h> -#include <library/cpp/http/io/stream.h> -#include <library/cpp/http/fetch/httpheader.h> -#include <library/cpp/http/fetch/httpfsm.h> -#include <library/cpp/uri/http_url.h> +#include <library/cpp/coroutine/engine/sockpool.h> +#include <library/cpp/http/io/stream.h> +#include <library/cpp/http/fetch/httpheader.h> +#include <library/cpp/http/fetch/httpfsm.h> +#include <library/cpp/uri/http_url.h> #include <util/generic/buffer.h> #include <util/stream/str.h> diff --git a/library/cpp/monlib/service/service.h b/library/cpp/monlib/service/service.h index 2f66dddaf8..955bb714f8 100644 --- a/library/cpp/monlib/service/service.h +++ b/library/cpp/monlib/service/service.h @@ -1,10 +1,10 @@ #pragma once -#include <library/cpp/coroutine/engine/impl.h> -#include <library/cpp/coroutine/listener/listen.h> -#include <library/cpp/http/fetch/httpheader.h> -#include <library/cpp/http/server/http.h> -#include <library/cpp/logger/all.h> +#include <library/cpp/coroutine/engine/impl.h> +#include <library/cpp/coroutine/listener/listen.h> +#include <library/cpp/http/fetch/httpheader.h> +#include <library/cpp/http/server/http.h> +#include <library/cpp/logger/all.h> #include <util/network/ip.h> #include <library/cpp/cgiparam/cgiparam.h> diff --git a/library/cpp/monlib/service/ya.make b/library/cpp/monlib/service/ya.make index ad088fc2c6..314eae87a6 100644 --- a/library/cpp/monlib/service/ya.make +++ b/library/cpp/monlib/service/ya.make @@ -13,15 +13,15 @@ SRCS( PEERDIR( library/cpp/string_utils/base64 contrib/libs/protobuf - library/cpp/coroutine/engine - library/cpp/coroutine/listener - library/cpp/http/fetch - library/cpp/http/server - library/cpp/http/io - library/cpp/logger - library/cpp/malloc/api - library/cpp/svnversion - library/cpp/uri + library/cpp/coroutine/engine + library/cpp/coroutine/listener + library/cpp/http/fetch + library/cpp/http/server + library/cpp/http/io + library/cpp/logger + library/cpp/malloc/api + library/cpp/svnversion + library/cpp/uri library/cpp/cgiparam ) diff --git a/library/cpp/object_factory/object_factory_ut.cpp b/library/cpp/object_factory/object_factory_ut.cpp index 06fb0739ff..00dbce15e6 100644 --- a/library/cpp/object_factory/object_factory_ut.cpp +++ b/library/cpp/object_factory/object_factory_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/object_factory/object_factory.h> +#include <library/cpp/object_factory/object_factory.h> #include <library/cpp/testing/unittest/registar.h> #include <util/generic/noncopyable.h> diff --git a/library/cpp/object_factory/ut/ya.make b/library/cpp/object_factory/ut/ya.make index 5a870072fc..287b5ec523 100644 --- a/library/cpp/object_factory/ut/ya.make +++ b/library/cpp/object_factory/ut/ya.make @@ -3,10 +3,10 @@ UNITTEST() OWNER(svshevtsov) PEERDIR( - ADDINCL library/cpp/object_factory + ADDINCL library/cpp/object_factory ) -SRCDIR(library/cpp/object_factory) +SRCDIR(library/cpp/object_factory) SRCS( object_factory_ut.cpp diff --git a/library/cpp/on_disk/chunks/ut/ya.make b/library/cpp/on_disk/chunks/ut/ya.make index 0190905cbe..8529478d77 100644 --- a/library/cpp/on_disk/chunks/ut/ya.make +++ b/library/cpp/on_disk/chunks/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/on_disk/chunks) +UNITTEST_FOR(library/cpp/on_disk/chunks) OWNER(g:util) diff --git a/library/cpp/on_disk/ya.make b/library/cpp/on_disk/ya.make index 42a79d37bd..a8c7366fe8 100644 --- a/library/cpp/on_disk/ya.make +++ b/library/cpp/on_disk/ya.make @@ -1,31 +1,31 @@ RECURSE( - 2d_array - 2d_array/ut - 4d_array - 4d_array/ut - aho_corasick - aho_corasick/tool - aho_corasick/ut - chunks - chunks/ut - codec_trie - codec_trie/ut - coded_blob - coded_blob/common - coded_blob/keys - coded_blob/ut + 2d_array + 2d_array/ut + 4d_array + 4d_array/ut + aho_corasick + aho_corasick/tool + aho_corasick/ut + chunks + chunks/ut + codec_trie + codec_trie/ut + coded_blob + coded_blob/common + coded_blob/keys + coded_blob/ut file_with_header file_with_header/ut - fried_trie - head_ar - head_ar/ut - meta_trie - meta_trie/ut - mms - mms/ut - multi_blob + fried_trie + head_ar + head_ar/ut + meta_trie + meta_trie/ut + mms + mms/ut + multi_blob tar_archive tar_archive/ut - st_hash - st_hash/ut + st_hash + st_hash/ut ) diff --git a/library/cpp/openssl/holders/bio.h b/library/cpp/openssl/holders/bio.h index bcd6a7a9d6..f1d8df6ed7 100644 --- a/library/cpp/openssl/holders/bio.h +++ b/library/cpp/openssl/holders/bio.h @@ -2,7 +2,7 @@ #include <contrib/libs/openssl/include/openssl/bio.h> -#include <library/cpp/openssl/holders/holder.h> +#include <library/cpp/openssl/holders/holder.h> namespace NOpenSSL { diff --git a/library/cpp/openssl/holders/ut/ya.make b/library/cpp/openssl/holders/ut/ya.make index 045cdc3566..c303d63c6c 100644 --- a/library/cpp/openssl/holders/ut/ya.make +++ b/library/cpp/openssl/holders/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/openssl/holders) +UNITTEST_FOR(library/cpp/openssl/holders) OWNER(somov deshevoy) diff --git a/library/cpp/openssl/holders/x509_vfy.h b/library/cpp/openssl/holders/x509_vfy.h index b735d8a042..6d472ae93d 100644 --- a/library/cpp/openssl/holders/x509_vfy.h +++ b/library/cpp/openssl/holders/x509_vfy.h @@ -2,7 +2,7 @@ #include <contrib/libs/openssl/include/openssl/x509_vfy.h> -#include <library/cpp/openssl/holders/holder.h> +#include <library/cpp/openssl/holders/holder.h> namespace NOpenSSL { diff --git a/library/cpp/openssl/io/stream.cpp b/library/cpp/openssl/io/stream.cpp index 0b4be38c0e..65a326c27f 100644 --- a/library/cpp/openssl/io/stream.cpp +++ b/library/cpp/openssl/io/stream.cpp @@ -1,18 +1,18 @@ #include "stream.h" -#include <util/generic/deque.h> +#include <util/generic/deque.h> #include <util/generic/singleton.h> #include <util/generic/yexception.h> -#include <library/cpp/openssl/init/init.h> -#include <library/cpp/openssl/method/io.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/openssl/init/init.h> +#include <library/cpp/openssl/method/io.h> +#include <library/cpp/resource/resource.h> #include <openssl/bio.h> #include <openssl/ssl.h> #include <openssl/err.h> -#include <openssl/tls1.h> -#include <openssl/x509v3.h> +#include <openssl/tls1.h> +#include <openssl/x509v3.h> using TOptions = TOpenSslClientIO::TOptions; @@ -55,19 +55,19 @@ namespace { static inline void Destroy(bio_st* bio) noexcept { BIO_free(bio); } - - static inline void Destroy(x509_st* x509) noexcept { - X509_free(x509); - } + + static inline void Destroy(x509_st* x509) noexcept { + X509_free(x509); + } }; template <class T> - using TSslHolderPtr = THolder<T, TSslDestroy>; + using TSslHolderPtr = THolder<T, TSslDestroy>; - using TSslContextPtr = TSslHolderPtr<ssl_ctx_st>; - using TSslPtr = TSslHolderPtr<ssl_st>; - using TBioPtr = TSslHolderPtr<bio_st>; - using TX509Ptr = TSslHolderPtr<x509_st>; + using TSslContextPtr = TSslHolderPtr<ssl_ctx_st>; + using TSslPtr = TSslHolderPtr<ssl_st>; + using TBioPtr = TSslHolderPtr<bio_st>; + using TX509Ptr = TSslHolderPtr<x509_st>; inline TSslContextPtr CreateSslCtx(const ssl_method_st* method) { TSslContextPtr ctx(SSL_CTX_new(method)); @@ -77,7 +77,7 @@ namespace { } SSL_CTX_set_options(ctx.Get(), SSL_OP_NO_SSLv2); - SSL_CTX_set_options(ctx.Get(), SSL_OP_NO_SSLv3); + SSL_CTX_set_options(ctx.Get(), SSL_OP_NO_SSLv3); SSL_CTX_set_options(ctx.Get(), SSL_OP_MICROSOFT_SESS_ID_BUG); SSL_CTX_set_options(ctx.Get(), SSL_OP_NETSCAPE_CHALLENGE_BUG); @@ -171,35 +171,35 @@ namespace { ythrow TSslError() << "SSL_new"; } - if (VerifyCert_) { - InitVerification(ssl.Get()); - } - + if (VerifyCert_) { + InitVerification(ssl.Get()); + } + BIO_up_ref(Io); // SSL_set_bio consumes only one reference if rbio and wbio are the same SSL_set_bio(ssl.Get(), Io, Io); return ssl; } - inline void InitVerification(ssl_st* ssl) { - X509_VERIFY_PARAM* param = SSL_get0_param(ssl); - X509_VERIFY_PARAM_set_hostflags(param, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS); + inline void InitVerification(ssl_st* ssl) { + X509_VERIFY_PARAM* param = SSL_get0_param(ssl); + X509_VERIFY_PARAM_set_hostflags(param, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS); Y_ENSURE(X509_VERIFY_PARAM_set1_host(param, VerifyCert_->Hostname_.data(), VerifyCert_->Hostname_.size())); SSL_set_tlsext_host_name(ssl, VerifyCert_->Hostname_.data()); // TLS extenstion: SNI - - SSL_CTX_set_cert_store(Ctx.Get(), GetBuiltinOpenSslX509Store().Release()); - - Y_ENSURE_EX(1 == SSL_CTX_set_default_verify_paths(Ctx.Get()), - TSslError()); - // it is OK to ignore result of SSL_CTX_load_verify_locations(): - // Dir "/etc/ssl/certs/" may be missing - SSL_CTX_load_verify_locations(Ctx.Get(), - "/etc/ssl/certs/ca-certificates.crt", - "/etc/ssl/certs/"); - - SSL_set_verify(ssl, SSL_VERIFY_PEER, nullptr); - } - + + SSL_CTX_set_cert_store(Ctx.Get(), GetBuiltinOpenSslX509Store().Release()); + + Y_ENSURE_EX(1 == SSL_CTX_set_default_verify_paths(Ctx.Get()), + TSslError()); + // it is OK to ignore result of SSL_CTX_load_verify_locations(): + // Dir "/etc/ssl/certs/" may be missing + SSL_CTX_load_verify_locations(Ctx.Get(), + "/etc/ssl/certs/ca-certificates.crt", + "/etc/ssl/certs/"); + + SSL_set_verify(ssl, SSL_VERIFY_PEER, nullptr); + } + inline void Connect() { if (SSL_connect(Ssl.Get()) != 1) { ythrow TSslError() << "SSL_connect"; @@ -270,60 +270,60 @@ void TOpenSslClientIO::DoWrite(const void* buf, size_t len) { size_t TOpenSslClientIO::DoRead(void* buf, size_t len) { return Impl_->Read(buf, len); } - -namespace NPrivate { - void TSslDestroy::Destroy(x509_store_st* x509) noexcept { - X509_STORE_free(x509); - } -} - -class TBuiltinCerts { -public: - TBuiltinCerts() { - TString c = NResource::Find("/builtin/cacert"); - + +namespace NPrivate { + void TSslDestroy::Destroy(x509_store_st* x509) noexcept { + X509_STORE_free(x509); + } +} + +class TBuiltinCerts { +public: + TBuiltinCerts() { + TString c = NResource::Find("/builtin/cacert"); + TBioPtr cbio(BIO_new_mem_buf(c.data(), c.size())); - Y_ENSURE_EX(cbio, TSslError() << "BIO_new_mem_buf"); - - while (true) { + Y_ENSURE_EX(cbio, TSslError() << "BIO_new_mem_buf"); + + while (true) { TX509Ptr cert(PEM_read_bio_X509(cbio.Get(), nullptr, nullptr, nullptr)); - if (!cert) { - break; - } - Certs.push_back(std::move(cert)); - } - - int err = GetLastSslError(); - if (!Certs.empty() && ERR_GET_LIB(err) == ERR_LIB_PEM && ERR_GET_REASON(err) == PEM_R_NO_START_LINE) { - ERR_clear_error(); - } else { - ythrow TSslError() << "can't load provided bundle: " << ERR_reason_error_string(err); - } - - Y_ENSURE_EX(!Certs.empty(), TSslError()); - } - - TOpenSslX509StorePtr GetX509Store() const { + if (!cert) { + break; + } + Certs.push_back(std::move(cert)); + } + + int err = GetLastSslError(); + if (!Certs.empty() && ERR_GET_LIB(err) == ERR_LIB_PEM && ERR_GET_REASON(err) == PEM_R_NO_START_LINE) { + ERR_clear_error(); + } else { + ythrow TSslError() << "can't load provided bundle: " << ERR_reason_error_string(err); + } + + Y_ENSURE_EX(!Certs.empty(), TSslError()); + } + + TOpenSslX509StorePtr GetX509Store() const { TOpenSslX509StorePtr store(X509_STORE_new()); - - for (const TX509Ptr& c : Certs) { - if (0 == X509_STORE_add_cert(store.Get(), c.Get())) { - int err = GetLastSslError(); - if (ERR_GET_LIB(err) == ERR_LIB_X509 && ERR_GET_REASON(err) == X509_R_CERT_ALREADY_IN_HASH_TABLE) { - ERR_clear_error(); - } else { - ythrow TSslError() << "can't load provided bundle: " << ERR_reason_error_string(err); - } - } - } - - return store; - } - -private: - TDeque<TX509Ptr> Certs; -}; - -TOpenSslX509StorePtr GetBuiltinOpenSslX509Store() { - return Singleton<TBuiltinCerts>()->GetX509Store(); -} + + for (const TX509Ptr& c : Certs) { + if (0 == X509_STORE_add_cert(store.Get(), c.Get())) { + int err = GetLastSslError(); + if (ERR_GET_LIB(err) == ERR_LIB_X509 && ERR_GET_REASON(err) == X509_R_CERT_ALREADY_IN_HASH_TABLE) { + ERR_clear_error(); + } else { + ythrow TSslError() << "can't load provided bundle: " << ERR_reason_error_string(err); + } + } + } + + return store; + } + +private: + TDeque<TX509Ptr> Certs; +}; + +TOpenSslX509StorePtr GetBuiltinOpenSslX509Store() { + return Singleton<TBuiltinCerts>()->GetX509Store(); +} diff --git a/library/cpp/openssl/io/stream.h b/library/cpp/openssl/io/stream.h index 7bca8f80ef..5984bfbbc0 100644 --- a/library/cpp/openssl/io/stream.h +++ b/library/cpp/openssl/io/stream.h @@ -1,6 +1,6 @@ #pragma once -#include <util/generic/maybe.h> +#include <util/generic/maybe.h> #include <util/generic/ptr.h> #include <util/stream/input.h> #include <util/stream/output.h> @@ -8,19 +8,19 @@ class TOpenSslClientIO: public IInputStream, public IOutputStream { public: struct TOptions { - struct TVerifyCert { - // Uses builtin certs. - // Also uses default CA path /etc/ssl/certs/ - can be provided with debian package: ca-certificates.deb. - // It can be expanded with ENV: SSL_CERT_DIR. - TString Hostname_; - }; + struct TVerifyCert { + // Uses builtin certs. + // Also uses default CA path /etc/ssl/certs/ - can be provided with debian package: ca-certificates.deb. + // It can be expanded with ENV: SSL_CERT_DIR. + TString Hostname_; + }; struct TClientCert { TString CertificateFile_; TString PrivateKeyFile_; TString PrivateKeyPassword_; }; - - TMaybe<TVerifyCert> VerifyCert_; + + TMaybe<TVerifyCert> VerifyCert_; TMaybe<TClientCert> ClientCert_; // TODO - keys, cyphers, etc }; @@ -37,14 +37,14 @@ private: struct TImpl; THolder<TImpl> Impl_; }; - -struct x509_store_st; - -namespace NPrivate { - struct TSslDestroy { - static void Destroy(x509_store_st* x509) noexcept; - }; -} - -using TOpenSslX509StorePtr = THolder<x509_store_st, NPrivate::TSslDestroy>; -TOpenSslX509StorePtr GetBuiltinOpenSslX509Store(); + +struct x509_store_st; + +namespace NPrivate { + struct TSslDestroy { + static void Destroy(x509_store_st* x509) noexcept; + }; +} + +using TOpenSslX509StorePtr = THolder<x509_store_st, NPrivate::TSslDestroy>; +TOpenSslX509StorePtr GetBuiltinOpenSslX509Store(); diff --git a/library/cpp/openssl/io/ut/builtin_ut.cpp b/library/cpp/openssl/io/ut/builtin_ut.cpp index 987cd08492..8254f8148a 100644 --- a/library/cpp/openssl/io/ut/builtin_ut.cpp +++ b/library/cpp/openssl/io/ut/builtin_ut.cpp @@ -1,9 +1,9 @@ -#include <library/cpp/openssl/io/stream.h> +#include <library/cpp/openssl/io/stream.h> #include <library/cpp/testing/unittest/registar.h> - -Y_UNIT_TEST_SUITE(Builtin) { - Y_UNIT_TEST(Init) { - UNIT_ASSERT_NO_EXCEPTION(GetBuiltinOpenSslX509Store()); - UNIT_ASSERT_NO_EXCEPTION(GetBuiltinOpenSslX509Store()); - } -} + +Y_UNIT_TEST_SUITE(Builtin) { + Y_UNIT_TEST(Init) { + UNIT_ASSERT_NO_EXCEPTION(GetBuiltinOpenSslX509Store()); + UNIT_ASSERT_NO_EXCEPTION(GetBuiltinOpenSslX509Store()); + } +} diff --git a/library/cpp/openssl/io/ut/ya.make b/library/cpp/openssl/io/ut/ya.make index b978a6c046..eab282b4e9 100644 --- a/library/cpp/openssl/io/ut/ya.make +++ b/library/cpp/openssl/io/ut/ya.make @@ -1,12 +1,12 @@ -UNITTEST_FOR(library/cpp/openssl/io) - +UNITTEST_FOR(library/cpp/openssl/io) + OWNER( pg cerevra ) - -SRCS( - builtin_ut.cpp -) - -END() + +SRCS( + builtin_ut.cpp +) + +END() diff --git a/library/cpp/openssl/io/ya.make b/library/cpp/openssl/io/ya.make index aaebba4011..885d490b1c 100644 --- a/library/cpp/openssl/io/ya.make +++ b/library/cpp/openssl/io/ya.make @@ -3,10 +3,10 @@ LIBRARY() OWNER(pg) PEERDIR( - certs + certs contrib/libs/openssl - library/cpp/openssl/init - library/cpp/openssl/method + library/cpp/openssl/init + library/cpp/openssl/method ) SRCS( diff --git a/library/cpp/openssl/method/io.h b/library/cpp/openssl/method/io.h index f1d3df978d..7d055d8feb 100644 --- a/library/cpp/openssl/method/io.h +++ b/library/cpp/openssl/method/io.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/openssl/holders/bio.h> +#include <library/cpp/openssl/holders/bio.h> namespace NOpenSSL { diff --git a/library/cpp/openssl/method/ut/io_ut.cpp b/library/cpp/openssl/method/ut/io_ut.cpp index bff2b23d31..04e193273f 100644 --- a/library/cpp/openssl/method/ut/io_ut.cpp +++ b/library/cpp/openssl/method/ut/io_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/openssl/method/io.h> +#include <library/cpp/openssl/method/io.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/openssl/method/ut/ya.make b/library/cpp/openssl/method/ut/ya.make index 3645ad17e6..347aa9cb05 100644 --- a/library/cpp/openssl/method/ut/ya.make +++ b/library/cpp/openssl/method/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/openssl/method) +UNITTEST_FOR(library/cpp/openssl/method) OWNER(somov deshevoy) diff --git a/library/cpp/openssl/method/ya.make b/library/cpp/openssl/method/ya.make index c8f6f18b6b..c8c8946dcd 100644 --- a/library/cpp/openssl/method/ya.make +++ b/library/cpp/openssl/method/ya.make @@ -4,7 +4,7 @@ OWNER(somov deshevoy) PEERDIR( contrib/libs/openssl - library/cpp/openssl/holders + library/cpp/openssl/holders ) SRCS( diff --git a/library/cpp/openssl/ya.make b/library/cpp/openssl/ya.make index 7c10963e26..2bdb9a60ce 100644 --- a/library/cpp/openssl/ya.make +++ b/library/cpp/openssl/ya.make @@ -6,7 +6,7 @@ RECURSE( holders holders/ut io - io/ut + io/ut method method/ut init diff --git a/library/cpp/packedtypes/longs_ut.cpp b/library/cpp/packedtypes/longs_ut.cpp index 8b06c934d2..450326449a 100644 --- a/library/cpp/packedtypes/longs_ut.cpp +++ b/library/cpp/packedtypes/longs_ut.cpp @@ -2,7 +2,7 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/digest/old_crc/crc.h> +#include <library/cpp/digest/old_crc/crc.h> #include <util/string/util.h> #include <util/stream/output.h> #include <util/system/hi_lo.h> diff --git a/library/cpp/packedtypes/packed.h b/library/cpp/packedtypes/packed.h index 88cff26ae2..d569820c38 100644 --- a/library/cpp/packedtypes/packed.h +++ b/library/cpp/packedtypes/packed.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/streams/zc_memory_input/zc_memory_input.h> +#include <library/cpp/streams/zc_memory_input/zc_memory_input.h> #include <util/stream/output.h> #include <util/ysaveload.h> diff --git a/library/cpp/packedtypes/ut/ya.make b/library/cpp/packedtypes/ut/ya.make index a203115e71..67ca44ccb5 100644 --- a/library/cpp/packedtypes/ut/ya.make +++ b/library/cpp/packedtypes/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/packedtypes) +UNITTEST_FOR(library/cpp/packedtypes) OWNER( akhropov @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/digest/old_crc + library/cpp/digest/old_crc ) SRCS( diff --git a/library/cpp/packedtypes/ya.make b/library/cpp/packedtypes/ya.make index 4c2c950619..a415949528 100644 --- a/library/cpp/packedtypes/ya.make +++ b/library/cpp/packedtypes/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/streams/zc_memory_input + library/cpp/streams/zc_memory_input ) SRCS( diff --git a/library/cpp/packers/ut/proto_packer_ut.cpp b/library/cpp/packers/ut/proto_packer_ut.cpp index e4151ba68c..1aaec07493 100644 --- a/library/cpp/packers/ut/proto_packer_ut.cpp +++ b/library/cpp/packers/ut/proto_packer_ut.cpp @@ -1,6 +1,6 @@ #include "proto_packer.h" -#include <library/cpp/packers/ut/test.pb.h> +#include <library/cpp/packers/ut/test.pb.h> #include <library/cpp/testing/unittest/registar.h> #include <util/generic/string.h> diff --git a/library/cpp/packers/ut/ya.make b/library/cpp/packers/ut/ya.make index 1c024ffd94..2f4a887ebc 100644 --- a/library/cpp/packers/ut/ya.make +++ b/library/cpp/packers/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/packers) +UNITTEST_FOR(library/cpp/packers) OWNER(velavokr) diff --git a/library/cpp/protobuf/interop/cast.cpp b/library/cpp/protobuf/interop/cast.cpp index c4cd59b417..6036eb503b 100644 --- a/library/cpp/protobuf/interop/cast.cpp +++ b/library/cpp/protobuf/interop/cast.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/protobuf/interop/cast.h> +#include <library/cpp/protobuf/interop/cast.h> #include <google/protobuf/duration.pb.h> #include <google/protobuf/timestamp.pb.h> diff --git a/library/cpp/protobuf/interop/ut/cast_ut.cpp b/library/cpp/protobuf/interop/ut/cast_ut.cpp index 6ef055b651..bab31ff3d3 100644 --- a/library/cpp/protobuf/interop/ut/cast_ut.cpp +++ b/library/cpp/protobuf/interop/ut/cast_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/protobuf/interop/cast.h> +#include <library/cpp/protobuf/interop/cast.h> #include <library/cpp/testing/unittest/registar.h> #include <google/protobuf/duration.pb.h> diff --git a/library/cpp/protobuf/interop/ut/ya.make b/library/cpp/protobuf/interop/ut/ya.make index b9c634cb6b..49b2a34640 100644 --- a/library/cpp/protobuf/interop/ut/ya.make +++ b/library/cpp/protobuf/interop/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/protobuf/interop) +UNITTEST_FOR(library/cpp/protobuf/interop) OWNER( paxakor @@ -9,7 +9,7 @@ SRCS( ) PEERDIR( - library/cpp/protobuf/interop + library/cpp/protobuf/interop ) END() diff --git a/library/cpp/protobuf/json/inline.h b/library/cpp/protobuf/json/inline.h index e2d7bb6ef0..bd62bb9635 100644 --- a/library/cpp/protobuf/json/inline.h +++ b/library/cpp/protobuf/json/inline.h @@ -39,7 +39,7 @@ #include "proto2json_printer.h" #include "json_output_create.h" -#include <library/cpp/protobuf/util/simple_reflection.h> +#include <library/cpp/protobuf/util/simple_reflection.h> #include <util/generic/maybe.h> #include <util/generic/yexception.h> diff --git a/library/cpp/protobuf/json/json2proto.cpp b/library/cpp/protobuf/json/json2proto.cpp index 640c10f5a5..2284b6fb12 100644 --- a/library/cpp/protobuf/json/json2proto.cpp +++ b/library/cpp/protobuf/json/json2proto.cpp @@ -1,7 +1,7 @@ #include "json2proto.h" #include "util.h" -#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_value.h> #include <google/protobuf/message.h> #include <google/protobuf/descriptor.h> diff --git a/library/cpp/protobuf/json/json2proto.h b/library/cpp/protobuf/json/json2proto.h index 4c33498dfa..90f09eb53a 100644 --- a/library/cpp/protobuf/json/json2proto.h +++ b/library/cpp/protobuf/json/json2proto.h @@ -3,8 +3,8 @@ #include "string_transform.h" #include "name_generator.h" -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_value.h> #include <util/stream/input.h> #include <util/stream/str.h> diff --git a/library/cpp/protobuf/json/json_value_output.cpp b/library/cpp/protobuf/json/json_value_output.cpp index d845cc1c74..b74b37bb4f 100644 --- a/library/cpp/protobuf/json/json_value_output.cpp +++ b/library/cpp/protobuf/json/json_value_output.cpp @@ -1,6 +1,6 @@ #include "json_value_output.h" -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> namespace NProtobufJson { template <typename T> diff --git a/library/cpp/protobuf/json/json_value_output.h b/library/cpp/protobuf/json/json_value_output.h index 3fc6ff2ab0..73fe502ba8 100644 --- a/library/cpp/protobuf/json/json_value_output.h +++ b/library/cpp/protobuf/json/json_value_output.h @@ -2,7 +2,7 @@ #include "json_output.h" -#include <library/cpp/json/writer/json_value.h> +#include <library/cpp/json/writer/json_value.h> #include <util/generic/stack.h> diff --git a/library/cpp/protobuf/json/json_writer_output.h b/library/cpp/protobuf/json/json_writer_output.h index 3d8a2daa56..d36fcb987d 100644 --- a/library/cpp/protobuf/json/json_writer_output.h +++ b/library/cpp/protobuf/json/json_writer_output.h @@ -3,7 +3,7 @@ #include "json_output.h" #include "config.h" -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_writer.h> #include <util/string/builder.h> #include <util/generic/store_policy.h> diff --git a/library/cpp/protobuf/json/proto2json.cpp b/library/cpp/protobuf/json/proto2json.cpp index 3d76a91686..4254968fea 100644 --- a/library/cpp/protobuf/json/proto2json.cpp +++ b/library/cpp/protobuf/json/proto2json.cpp @@ -3,9 +3,9 @@ #include "json_output_create.h" #include "proto2json_printer.h" -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_value.h> -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_writer.h> #include <util/generic/ptr.h> #include <util/generic/strbuf.h> diff --git a/library/cpp/protobuf/json/ut/filter_ut.cpp b/library/cpp/protobuf/json/ut/filter_ut.cpp index 95c227666f..9c8893dfae 100644 --- a/library/cpp/protobuf/json/ut/filter_ut.cpp +++ b/library/cpp/protobuf/json/ut/filter_ut.cpp @@ -1,8 +1,8 @@ -#include <library/cpp/protobuf/json/ut/filter_ut.pb.h> +#include <library/cpp/protobuf/json/ut/filter_ut.pb.h> -#include <library/cpp/protobuf/json/filter.h> -#include <library/cpp/protobuf/json/field_option.h> -#include <library/cpp/protobuf/json/proto2json.h> +#include <library/cpp/protobuf/json/filter.h> +#include <library/cpp/protobuf/json/field_option.h> +#include <library/cpp/protobuf/json/proto2json.h> #include <library/cpp/testing/unittest/registar.h> using namespace NProtobufJson; diff --git a/library/cpp/protobuf/json/ut/inline_ut.cpp b/library/cpp/protobuf/json/ut/inline_ut.cpp index c29ad32e7d..aabf79451d 100644 --- a/library/cpp/protobuf/json/ut/inline_ut.cpp +++ b/library/cpp/protobuf/json/ut/inline_ut.cpp @@ -1,8 +1,8 @@ -#include <library/cpp/protobuf/json/ut/inline_ut.pb.h> +#include <library/cpp/protobuf/json/ut/inline_ut.pb.h> -#include <library/cpp/protobuf/json/inline.h> -#include <library/cpp/protobuf/json/field_option.h> -#include <library/cpp/protobuf/json/proto2json.h> +#include <library/cpp/protobuf/json/inline.h> +#include <library/cpp/protobuf/json/field_option.h> +#include <library/cpp/protobuf/json/proto2json.h> #include <library/cpp/testing/unittest/registar.h> #include <util/generic/string.h> diff --git a/library/cpp/protobuf/json/ut/json.h b/library/cpp/protobuf/json/ut/json.h index c1f108e6e4..fe54840999 100644 --- a/library/cpp/protobuf/json/ut/json.h +++ b/library/cpp/protobuf/json/ut/json.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/protobuf/json/ut/test.pb.h> +#include <library/cpp/protobuf/json/ut/test.pb.h> -#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_value.h> #include <cstdarg> diff --git a/library/cpp/protobuf/json/ut/json2proto_ut.cpp b/library/cpp/protobuf/json/ut/json2proto_ut.cpp index 0dfe57bc7a..6fdbba4245 100644 --- a/library/cpp/protobuf/json/ut/json2proto_ut.cpp +++ b/library/cpp/protobuf/json/ut/json2proto_ut.cpp @@ -2,13 +2,13 @@ #include "proto.h" #include "proto2json.h" -#include <library/cpp/protobuf/json/ut/test.pb.h> +#include <library/cpp/protobuf/json/ut/test.pb.h> -#include <library/cpp/json/json_value.h> -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_writer.h> -#include <library/cpp/protobuf/json/json2proto.h> +#include <library/cpp/protobuf/json/json2proto.h> #include <library/cpp/testing/unittest/registar.h> @@ -92,7 +92,7 @@ Y_UNIT_TEST_SUITE(TJson2ProtoTest) { FillFlatProto(&modelProto, skippedField); \ UNIT_ASSERT_PROTOS_EQUAL(proto, modelProto); \ } -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD } // TestFlatOptional @@ -114,7 +114,7 @@ UNIT_ASSERT_PROTOS_EQUAL(proto, modelProto); TFlatRequired proto; \ UNIT_ASSERT_EXCEPTION(Json2Proto(json, proto), yexception); \ } -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD } // TestFlatRequired @@ -153,7 +153,7 @@ Y_UNIT_TEST(TestFlatNoCheckRequired) { TFlatRequired proto; \ UNIT_ASSERT_NO_EXCEPTION(Json2Proto(json, proto, cfg)); \ } -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD } // TestFlatNoCheckRequired @@ -178,7 +178,7 @@ UNIT_ASSERT_PROTOS_EQUAL(proto, modelProto); FillRepeatedProto(&modelProto, skippedField); \ UNIT_ASSERT_PROTOS_EQUAL(proto, modelProto); \ } -#include <library/cpp/protobuf/json/ut/repeated_fields.incl> +#include <library/cpp/protobuf/json/ut/repeated_fields.incl> #undef DEFINE_REPEATED_FIELD } // TestFlatRepeated @@ -203,7 +203,7 @@ UNIT_ASSERT_PROTOS_EQUAL(proto, modelProto); FillCompositeProto(&modelProto, skippedField); \ UNIT_ASSERT_PROTOS_EQUAL(proto, modelProto); \ } -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD } // TestCompositeOptional @@ -236,7 +236,7 @@ UNIT_ASSERT_PROTOS_EQUAL(proto, modelProto); } \ UNIT_ASSERT_PROTOS_EQUAL(proto, modelProto); \ } -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD } // TestCompositeOptionalStringBuf @@ -289,7 +289,7 @@ Y_UNIT_TEST(TestCompositeRepeated) { modelProto.AddPart()->CopyFrom(partModelProto); \ array.AppendValue(CreateFlatJson(skippedField)); \ } -#include <library/cpp/protobuf/json/ut/repeated_fields.incl> +#include <library/cpp/protobuf/json/ut/repeated_fields.incl> #undef DEFINE_REPEATED_FIELD NJson::TJsonValue json; @@ -462,7 +462,7 @@ Y_UNIT_TEST(TestFieldNameMode) { { // FIXME(CONTRIB-139): since protobuf 3.1, Def_upper json name is // "DefUpper", but until kernel/ugc/schema and yweb/yasap/pdb are - // updated, library/cpp/protobuf/json preserves compatibility with + // updated, library/cpp/protobuf/json preserves compatibility with // protobuf 3.0 by lowercasing default names, making it "defUpper". TString modelStr(R"_({"My-Upper":1,"my-lower":2,"defUpper":3,"defLower":4})_"); @@ -591,7 +591,7 @@ Y_UNIT_TEST(TestCastFromString) { NJson::TJsonValue json; #define DEFINE_FIELD(name, value) \ json.InsertValue(#name, ConvertToString(value)); -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD TFlatOptional proto; @@ -618,7 +618,7 @@ Y_UNIT_TEST(TestCastFromString) { } \ json.InsertValue(#name, array); \ } -#include <library/cpp/protobuf/json/ut/repeated_fields.incl> +#include <library/cpp/protobuf/json/ut/repeated_fields.incl> #undef DEFINE_REPEATED_FIELD TFlatRepeated proto; @@ -676,7 +676,7 @@ Y_UNIT_TEST(TestVectorizeScalars) { NJson::TJsonValue json; #define DEFINE_FIELD(name, value) \ json.InsertValue(#name, value); -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD TFlatRepeated proto; @@ -686,7 +686,7 @@ Y_UNIT_TEST(TestVectorizeScalars) { #define DEFINE_FIELD(name, value) \ UNIT_ASSERT_VALUES_EQUAL(proto.Get ## name(0), value); -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD } diff --git a/library/cpp/protobuf/json/ut/proto.h b/library/cpp/protobuf/json/ut/proto.h index 8183bfc8e1..715a51116c 100644 --- a/library/cpp/protobuf/json/ut/proto.h +++ b/library/cpp/protobuf/json/ut/proto.h @@ -13,7 +13,7 @@ namespace NProtobufJsonTest { #define DEFINE_FIELD(name, value) \ if (skippedFields.find(#name) == skippedFields.end()) \ proto->Set##name(value); -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD } @@ -38,7 +38,7 @@ namespace NProtobufJsonTest { AddValue(proto->Mutable##name(), values[i]); \ } \ } -#include <library/cpp/protobuf/json/ut/repeated_fields.incl> +#include <library/cpp/protobuf/json/ut/repeated_fields.incl> #undef DEFINE_REPEATED_FIELD } diff --git a/library/cpp/protobuf/json/ut/proto2json_ut.cpp b/library/cpp/protobuf/json/ut/proto2json_ut.cpp index 07e52d7f2f..2fb81cf184 100644 --- a/library/cpp/protobuf/json/ut/proto2json_ut.cpp +++ b/library/cpp/protobuf/json/ut/proto2json_ut.cpp @@ -1,13 +1,13 @@ #include "json.h" #include "proto.h" -#include <library/cpp/protobuf/json/ut/test.pb.h> +#include <library/cpp/protobuf/json/ut/test.pb.h> -#include <library/cpp/json/json_value.h> -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_writer.h> -#include <library/cpp/protobuf/json/proto2json.h> +#include <library/cpp/protobuf/json/proto2json.h> #include <library/cpp/testing/unittest/registar.h> @@ -70,7 +70,7 @@ Y_UNIT_TEST_SUITE(TProto2JsonFlatTest) { break; \ } \ } -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD } @@ -137,7 +137,7 @@ Y_UNIT_TEST_SUITE(TProto2JsonFlatTest) { UNIT_ASSERT_JSONS_EQUAL(json, modelJson); \ } \ } -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD } // TestFlatOptional @@ -178,7 +178,7 @@ const NJson::TJsonValue& modelJson = CreateFlatJson(); UNIT_ASSERT_JSONS_EQUAL(json, modelJson); \ } \ } -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD } // TestFlatRequired @@ -223,7 +223,7 @@ Y_UNIT_TEST(TestFlatRepeated) { UNIT_ASSERT_JSONS_EQUAL(json, modelJson); \ } \ } -#include <library/cpp/protobuf/json/ut/repeated_fields.incl> +#include <library/cpp/protobuf/json/ut/repeated_fields.incl> #undef DEFINE_REPEATED_FIELD } // TestFlatRepeated @@ -264,7 +264,7 @@ const NJson::TJsonValue& modelJson = CreateCompositeJson(); UNIT_ASSERT_JSONS_EQUAL(json, modelJson); \ } \ } -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD } // TestCompositeOptional @@ -305,7 +305,7 @@ const NJson::TJsonValue& modelJson = CreateCompositeJson(); UNIT_ASSERT_JSONS_EQUAL(json, modelJson); \ } \ } -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD } // TestCompositeRequired @@ -349,7 +349,7 @@ Y_UNIT_TEST(TestCompositeRepeated) { proto.AddPart()->CopyFrom(partProto); \ modelArray.AppendValue(CreateFlatJson(skippedField)); \ } -#include <library/cpp/protobuf/json/ut/repeated_fields.incl> +#include <library/cpp/protobuf/json/ut/repeated_fields.incl> #undef DEFINE_REPEATED_FIELD NJson::TJsonValue modelJson; @@ -454,7 +454,7 @@ Y_UNIT_TEST(TestMissingSingleKeyConfig) { NJson::TJsonValue modelJson; #define DEFINE_FIELD(name, value) \ modelJson.InsertValue(#name, NJson::TJsonValue(NJson::JSON_NULL)); -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD TFlatOptional proto; @@ -540,7 +540,7 @@ Y_UNIT_TEST(TestMissingRepeatedKeyConfig) { NJson::TJsonValue modelJson; #define DEFINE_FIELD(name, value) \ modelJson.InsertValue(#name, NJson::TJsonValue(NJson::JSON_NULL)); -#include <library/cpp/protobuf/json/ut/fields.incl> +#include <library/cpp/protobuf/json/ut/fields.incl> #undef DEFINE_FIELD TFlatRepeated proto; diff --git a/library/cpp/protobuf/json/ut/string_transform_ut.cpp b/library/cpp/protobuf/json/ut/string_transform_ut.cpp index a31dabcb0f..64e2f71bb4 100644 --- a/library/cpp/protobuf/json/ut/string_transform_ut.cpp +++ b/library/cpp/protobuf/json/ut/string_transform_ut.cpp @@ -1,7 +1,7 @@ #include "json.h" #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/protobuf/json/proto2json.h> +#include <library/cpp/protobuf/json/proto2json.h> Y_UNIT_TEST_SUITE(TDoubleEscapeTransform) { Y_UNIT_TEST(TestEmptyString) { diff --git a/library/cpp/protobuf/json/ut/ya.make b/library/cpp/protobuf/json/ut/ya.make index b60a6d3c17..8b9c9fd3bc 100644 --- a/library/cpp/protobuf/json/ut/ya.make +++ b/library/cpp/protobuf/json/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/protobuf/json) +UNITTEST_FOR(library/cpp/protobuf/json) OWNER(avitella) @@ -17,7 +17,7 @@ SRCS( GENERATE_ENUM_SERIALIZATION(test.pb.h) PEERDIR( - library/cpp/protobuf/json + library/cpp/protobuf/json ) END() diff --git a/library/cpp/protobuf/json/ya.make b/library/cpp/protobuf/json/ya.make index 2f2c75cfdb..8b7104cf2a 100644 --- a/library/cpp/protobuf/json/ya.make +++ b/library/cpp/protobuf/json/ya.make @@ -17,8 +17,8 @@ SRCS( PEERDIR( contrib/libs/protobuf - library/cpp/json - library/cpp/protobuf/util + library/cpp/json + library/cpp/protobuf/util library/cpp/string_utils/relaxed_escaper ) diff --git a/library/cpp/protobuf/util/is_equal_ut.cpp b/library/cpp/protobuf/util/is_equal_ut.cpp index 3ca4c90dd5..f8c8c28b45 100644 --- a/library/cpp/protobuf/util/is_equal_ut.cpp +++ b/library/cpp/protobuf/util/is_equal_ut.cpp @@ -1,5 +1,5 @@ #include "is_equal.h" -#include <library/cpp/protobuf/util/ut/sample_for_is_equal.pb.h> +#include <library/cpp/protobuf/util/ut/sample_for_is_equal.pb.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/protobuf/util/iterators_ut.cpp b/library/cpp/protobuf/util/iterators_ut.cpp index 9ebcff2963..0b15f1f276 100644 --- a/library/cpp/protobuf/util/iterators_ut.cpp +++ b/library/cpp/protobuf/util/iterators_ut.cpp @@ -1,6 +1,6 @@ #include "iterators.h" #include "simple_reflection.h" -#include <library/cpp/protobuf/util/ut/common_ut.pb.h> +#include <library/cpp/protobuf/util/ut/common_ut.pb.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/protobuf/util/merge.cpp b/library/cpp/protobuf/util/merge.cpp index dc2b9cc806..e2c8ab8e53 100644 --- a/library/cpp/protobuf/util/merge.cpp +++ b/library/cpp/protobuf/util/merge.cpp @@ -3,7 +3,7 @@ #include <google/protobuf/message.h> -#include <library/cpp/protobuf/util/proto/merge.pb.h> +#include <library/cpp/protobuf/util/proto/merge.pb.h> namespace NProtoBuf { void RewriteMerge(const Message& src, Message& dst) { diff --git a/library/cpp/protobuf/util/merge_ut.cpp b/library/cpp/protobuf/util/merge_ut.cpp index 22217db183..a1d9b6b50a 100644 --- a/library/cpp/protobuf/util/merge_ut.cpp +++ b/library/cpp/protobuf/util/merge_ut.cpp @@ -1,5 +1,5 @@ #include "merge.h" -#include <library/cpp/protobuf/util/ut/common_ut.pb.h> +#include <library/cpp/protobuf/util/ut/common_ut.pb.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/protobuf/util/pb_io.cpp b/library/cpp/protobuf/util/pb_io.cpp index 6270ee0624..6e15748ca5 100644 --- a/library/cpp/protobuf/util/pb_io.cpp +++ b/library/cpp/protobuf/util/pb_io.cpp @@ -1,6 +1,6 @@ #include "pb_io.h" -#include <library/cpp/binsaver/bin_saver.h> +#include <library/cpp/binsaver/bin_saver.h> #include <library/cpp/string_utils/base64/base64.h> #include <google/protobuf/message.h> diff --git a/library/cpp/protobuf/util/pb_io_ut.cpp b/library/cpp/protobuf/util/pb_io_ut.cpp index 875d6dc602..baade8a6ea 100644 --- a/library/cpp/protobuf/util/pb_io_ut.cpp +++ b/library/cpp/protobuf/util/pb_io_ut.cpp @@ -2,7 +2,7 @@ #include "is_equal.h" -#include <library/cpp/protobuf/util/ut/common_ut.pb.h> +#include <library/cpp/protobuf/util/ut/common_ut.pb.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/protobuf/util/repeated_field_utils_ut.cpp b/library/cpp/protobuf/util/repeated_field_utils_ut.cpp index 58aaaa9e12..1c9b717753 100644 --- a/library/cpp/protobuf/util/repeated_field_utils_ut.cpp +++ b/library/cpp/protobuf/util/repeated_field_utils_ut.cpp @@ -1,5 +1,5 @@ #include "repeated_field_utils.h" -#include <library/cpp/protobuf/util/ut/common_ut.pb.h> +#include <library/cpp/protobuf/util/ut/common_ut.pb.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/protobuf/util/simple_reflection_ut.cpp b/library/cpp/protobuf/util/simple_reflection_ut.cpp index 169d4703c9..ee41e0adb6 100644 --- a/library/cpp/protobuf/util/simple_reflection_ut.cpp +++ b/library/cpp/protobuf/util/simple_reflection_ut.cpp @@ -1,6 +1,6 @@ #include "simple_reflection.h" -#include <library/cpp/protobuf/util/ut/sample_for_simple_reflection.pb.h> -#include <library/cpp/protobuf/util/ut/extensions.pb.h> +#include <library/cpp/protobuf/util/ut/sample_for_simple_reflection.pb.h> +#include <library/cpp/protobuf/util/ut/extensions.pb.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/protobuf/util/ut/common_ut.proto b/library/cpp/protobuf/util/ut/common_ut.proto index 9cf803ffbf..c1cf48b362 100644 --- a/library/cpp/protobuf/util/ut/common_ut.proto +++ b/library/cpp/protobuf/util/ut/common_ut.proto @@ -1,5 +1,5 @@ import "google/protobuf/descriptor.proto"; -import "library/cpp/protobuf/util/proto/merge.proto"; +import "library/cpp/protobuf/util/proto/merge.proto"; package NProtobufUtilUt; diff --git a/library/cpp/protobuf/util/ut/extensions.proto b/library/cpp/protobuf/util/ut/extensions.proto index 4944f0f5ca..6b2899370f 100644 --- a/library/cpp/protobuf/util/ut/extensions.proto +++ b/library/cpp/protobuf/util/ut/extensions.proto @@ -1,6 +1,6 @@ package NExt; -import "library/cpp/protobuf/util/ut/sample_for_simple_reflection.proto"; +import "library/cpp/protobuf/util/ut/sample_for_simple_reflection.proto"; message TTestExt { extend TSample { diff --git a/library/cpp/protobuf/util/ut/ya.make b/library/cpp/protobuf/util/ut/ya.make index 701ba9a8c8..0118af31ac 100644 --- a/library/cpp/protobuf/util/ut/ya.make +++ b/library/cpp/protobuf/util/ut/ya.make @@ -1,6 +1,6 @@ OWNER(nga) -UNITTEST_FOR(library/cpp/protobuf/util) +UNITTEST_FOR(library/cpp/protobuf/util) SRCS( extensions.proto diff --git a/library/cpp/protobuf/util/walk_ut.cpp b/library/cpp/protobuf/util/walk_ut.cpp index 2ea6071b17..68738ad8e4 100644 --- a/library/cpp/protobuf/util/walk_ut.cpp +++ b/library/cpp/protobuf/util/walk_ut.cpp @@ -1,6 +1,6 @@ #include "walk.h" #include "simple_reflection.h" -#include <library/cpp/protobuf/util/ut/common_ut.pb.h> +#include <library/cpp/protobuf/util/ut/common_ut.pb.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/protobuf/util/ya.make b/library/cpp/protobuf/util/ya.make index b62028af58..cdeb3849ce 100644 --- a/library/cpp/protobuf/util/ya.make +++ b/library/cpp/protobuf/util/ya.make @@ -4,8 +4,8 @@ OWNER(mowgli) PEERDIR( contrib/libs/protobuf - library/cpp/binsaver - library/cpp/protobuf/util/proto + library/cpp/binsaver + library/cpp/protobuf/util/proto library/cpp/string_utils/base64 ) diff --git a/library/cpp/protobuf/ya.make b/library/cpp/protobuf/ya.make index 618b542b4f..69c715c57a 100644 --- a/library/cpp/protobuf/ya.make +++ b/library/cpp/protobuf/ya.make @@ -1,19 +1,19 @@ RECURSE( dynamic_prototype - from_xml - from_xml/ut - interop - interop/ut - json - json/ut - parser - parser/ut - protofile - protofile/ut - util - util/proto - yql - yql/ut + from_xml + from_xml/ut + interop + interop/ut + json + json/ut + parser + parser/ut + protofile + protofile/ut + util + util/proto + yql + yql/ut yandex_patches_ut - yt + yt ) diff --git a/library/cpp/regex/hyperscan/ut/hyperscan_ut.cpp b/library/cpp/regex/hyperscan/ut/hyperscan_ut.cpp index 9caa53f2e7..5dba5c0c87 100644 --- a/library/cpp/regex/hyperscan/ut/hyperscan_ut.cpp +++ b/library/cpp/regex/hyperscan/ut/hyperscan_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/regex/hyperscan/hyperscan.h> +#include <library/cpp/regex/hyperscan/hyperscan.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/regex/pcre/regexp_ut.cpp b/library/cpp/regex/pcre/regexp_ut.cpp index 5184e801cc..0e4b059bc4 100644 --- a/library/cpp/regex/pcre/regexp_ut.cpp +++ b/library/cpp/regex/pcre/regexp_ut.cpp @@ -1,7 +1,7 @@ #include <library/cpp/testing/unittest/registar.h> #include <util/string/strip.h> -#include <library/cpp/regex/pcre/regexp.h> +#include <library/cpp/regex/pcre/regexp.h> #include <util/stream/output.h> struct TRegTest { diff --git a/library/cpp/regex/pcre/ut/ya.make b/library/cpp/regex/pcre/ut/ya.make index 0721ef87c2..8ae340546f 100644 --- a/library/cpp/regex/pcre/ut/ya.make +++ b/library/cpp/regex/pcre/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/regex/pcre) +UNITTEST_FOR(library/cpp/regex/pcre) OWNER(g:util) diff --git a/library/cpp/regex/pire/extraencodings.cpp b/library/cpp/regex/pire/extraencodings.cpp index 2e507e4b67..5bc198651d 100644 --- a/library/cpp/regex/pire/extraencodings.cpp +++ b/library/cpp/regex/pire/extraencodings.cpp @@ -1,9 +1,9 @@ #include <util/system/defaults.h> #include <util/system/yassert.h> -#include <library/cpp/charset/codepage.h> +#include <library/cpp/charset/codepage.h> #include <util/generic/singleton.h> #include <util/generic/yexception.h> -#include <library/cpp/charset/doccodes.h> +#include <library/cpp/charset/doccodes.h> #include "pire.h" diff --git a/library/cpp/regex/pire/inline/ya.make b/library/cpp/regex/pire/inline/ya.make index d4850f7b45..5b4db7405c 100644 --- a/library/cpp/regex/pire/inline/ya.make +++ b/library/cpp/regex/pire/inline/ya.make @@ -8,7 +8,7 @@ OWNER( ) PEERDIR( - ADDINCL library/cpp/regex/pire + ADDINCL library/cpp/regex/pire ) SRCDIR( diff --git a/library/cpp/regex/pire/pire.h b/library/cpp/regex/pire/pire.h index 286fecd693..c64d812bd0 100644 --- a/library/cpp/regex/pire/pire.h +++ b/library/cpp/regex/pire/pire.h @@ -7,7 +7,7 @@ #include <contrib/libs/pire/pire/pire.h> #include <contrib/libs/pire/pire/extra.h> -#include <library/cpp/charset/doccodes.h> +#include <library/cpp/charset/doccodes.h> namespace NPire { using TChar = Pire::Char; diff --git a/library/cpp/regex/pire/regexp.h b/library/cpp/regex/pire/regexp.h index 94bba4064b..3c4b3fe71c 100644 --- a/library/cpp/regex/pire/regexp.h +++ b/library/cpp/regex/pire/regexp.h @@ -2,8 +2,8 @@ #include "pire.h" -#include <library/cpp/charset/doccodes.h> -#include <library/cpp/charset/recyr.hh> +#include <library/cpp/charset/doccodes.h> +#include <library/cpp/charset/recyr.hh> #include <util/generic/maybe.h> #include <util/generic/strbuf.h> #include <util/generic/string.h> diff --git a/library/cpp/regex/pire/ut/regexp_ut.cpp b/library/cpp/regex/pire/ut/regexp_ut.cpp index e7206de9ad..3f163f9b61 100644 --- a/library/cpp/regex/pire/ut/regexp_ut.cpp +++ b/library/cpp/regex/pire/ut/regexp_ut.cpp @@ -1,7 +1,7 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/regex/pire/regexp.h> -#include <library/cpp/regex/pire/pcre2pire.h> +#include <library/cpp/regex/pire/regexp.h> +#include <library/cpp/regex/pire/pcre2pire.h> Y_UNIT_TEST_SUITE(TRegExp) { using namespace NRegExp; diff --git a/library/cpp/regex/pire/ut/ya.make b/library/cpp/regex/pire/ut/ya.make index 8776695f40..86e4d5d2ce 100644 --- a/library/cpp/regex/pire/ut/ya.make +++ b/library/cpp/regex/pire/ut/ya.make @@ -12,7 +12,7 @@ SET(PIRETESTSDIR contrib/libs/pire/ut) CFLAGS(-DPIRE_NO_CONFIG) PEERDIR( - library/cpp/regex/pire + library/cpp/regex/pire ) SRCDIR( diff --git a/library/cpp/regex/pire/ya.make b/library/cpp/regex/pire/ya.make index c857e6d18b..e08af8eaf7 100644 --- a/library/cpp/regex/pire/ya.make +++ b/library/cpp/regex/pire/ya.make @@ -32,7 +32,7 @@ SRCS( ) PEERDIR( - library/cpp/charset + library/cpp/charset ) END() diff --git a/library/cpp/resource/README.md b/library/cpp/resource/README.md index b1e4961c1f..3878ad8402 100644 --- a/library/cpp/resource/README.md +++ b/library/cpp/resource/README.md @@ -16,7 +16,7 @@ END() ### Example - access to a file content by a key: ```cpp -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> int main() { Cout << NResource::Find("/key/in/program/1") << Endl; Cout << NResource::Find("/key2") << Endl; diff --git a/library/cpp/resource/registry.cpp b/library/cpp/resource/registry.cpp index 66001c4769..13a996bfdb 100644 --- a/library/cpp/resource/registry.cpp +++ b/library/cpp/resource/registry.cpp @@ -1,6 +1,6 @@ #include "registry.h" -#include <library/cpp/blockcodecs/codecs.h> +#include <library/cpp/blockcodecs/codecs.h> #include <util/system/yassert.h> #include <util/generic/hash.h> diff --git a/library/cpp/resource/ut/resource_ut.cpp b/library/cpp/resource/ut/resource_ut.cpp index b6fa8e4df3..8444444c8b 100644 --- a/library/cpp/resource/ut/resource_ut.cpp +++ b/library/cpp/resource/ut/resource_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> #include <library/cpp/testing/unittest/registar.h> Y_UNIT_TEST_SUITE(TestResource) { diff --git a/library/cpp/resource/ut/ya.make b/library/cpp/resource/ut/ya.make index d1ac9ed2ed..e95d69217c 100644 --- a/library/cpp/resource/ut/ya.make +++ b/library/cpp/resource/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/resource/ut/lib) +UNITTEST_FOR(library/cpp/resource/ut/lib) OWNER(pg) diff --git a/library/cpp/resource/ya.make b/library/cpp/resource/ya.make index 9c06df514f..ac79137337 100644 --- a/library/cpp/resource/ya.make +++ b/library/cpp/resource/ya.make @@ -3,8 +3,8 @@ LIBRARY() OWNER(pg) PEERDIR( - library/cpp/blockcodecs/core - library/cpp/blockcodecs/codecs/zstd + library/cpp/blockcodecs/core + library/cpp/blockcodecs/codecs/zstd ) SRCS( diff --git a/library/cpp/retry/retry.h b/library/cpp/retry/retry.h index c47ff5070f..d6ce9515c4 100644 --- a/library/cpp/retry/retry.h +++ b/library/cpp/retry/retry.h @@ -2,7 +2,7 @@ #include "utils.h" -#include <library/cpp/retry/protos/retry_options.pb.h> +#include <library/cpp/retry/protos/retry_options.pb.h> #include <util/datetime/base.h> #include <util/generic/maybe.h> diff --git a/library/cpp/retry/ut/ya.make b/library/cpp/retry/ut/ya.make index ff8259bfdb..38c3ef348d 100644 --- a/library/cpp/retry/ut/ya.make +++ b/library/cpp/retry/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/retry) +UNITTEST_FOR(library/cpp/retry) OWNER( salmin diff --git a/library/cpp/retry/ya.make b/library/cpp/retry/ya.make index 31e0c6a259..fa8d964354 100644 --- a/library/cpp/retry/ya.make +++ b/library/cpp/retry/ya.make @@ -11,7 +11,7 @@ SRCS( ) PEERDIR( - library/cpp/retry/protos + library/cpp/retry/protos ) END() diff --git a/library/cpp/scheme/scimpl_defs.h b/library/cpp/scheme/scimpl_defs.h index f3dd66b437..2b25e76d4c 100644 --- a/library/cpp/scheme/scimpl_defs.h +++ b/library/cpp/scheme/scimpl_defs.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_value.h> #include <util/system/types.h> #include <util/memory/pool.h> diff --git a/library/cpp/scheme/scimpl_json_read.cpp b/library/cpp/scheme/scimpl_json_read.cpp index 8a29cc7739..c7d2f297d4 100644 --- a/library/cpp/scheme/scimpl_json_read.cpp +++ b/library/cpp/scheme/scimpl_json_read.cpp @@ -1,6 +1,6 @@ #include "scimpl.h" -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> #include <util/stream/output.h> #include <util/generic/maybe.h> diff --git a/library/cpp/scheme/scimpl_json_write.cpp b/library/cpp/scheme/scimpl_json_write.cpp index aadd7e6cd5..7553544845 100644 --- a/library/cpp/scheme/scimpl_json_write.cpp +++ b/library/cpp/scheme/scimpl_json_write.cpp @@ -1,7 +1,7 @@ #include "scimpl.h" #include "scimpl_private.h" -#include <library/cpp/json/json_prettifier.h> +#include <library/cpp/json/json_prettifier.h> #include <library/cpp/string_utils/relaxed_escaper/relaxed_escaper.h> #include <util/charset/utf8.h> diff --git a/library/cpp/scheme/scimpl_select.rl6 b/library/cpp/scheme/scimpl_select.rl6 index 11aa549b78..d9309fcfd8 100644 --- a/library/cpp/scheme/scimpl_select.rl6 +++ b/library/cpp/scheme/scimpl_select.rl6 @@ -1,4 +1,4 @@ -#include <library/cpp/scheme/scimpl.h> +#include <library/cpp/scheme/scimpl.h> #include <util/string/cast.h> #include <util/string/escape.h> diff --git a/library/cpp/scheme/tests/fuzz_json/fuzz_json.cpp b/library/cpp/scheme/tests/fuzz_json/fuzz_json.cpp index 8d4c0fa8a0..f16d28a340 100644 --- a/library/cpp/scheme/tests/fuzz_json/fuzz_json.cpp +++ b/library/cpp/scheme/tests/fuzz_json/fuzz_json.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.h> +#include <library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.h> extern "C" int LLVMFuzzerTestOneInput(const ui8* wireData, const size_t wireSize) { NSc::NUt::FuzzJson({(const char*)wireData, wireSize}); diff --git a/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp b/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp index 7c16527c23..72d294ce96 100644 --- a/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp +++ b/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp @@ -1,7 +1,7 @@ #include "fuzz_json.h" #include "util/generic/fwd.h" -#include <library/cpp/scheme/scheme.h> +#include <library/cpp/scheme/scheme.h> #include <util/stream/null.h> namespace { diff --git a/library/cpp/scheme/tests/fuzz_json/lib/ya.make b/library/cpp/scheme/tests/fuzz_json/lib/ya.make index b30a6c9350..f0ff66a3aa 100644 --- a/library/cpp/scheme/tests/fuzz_json/lib/ya.make +++ b/library/cpp/scheme/tests/fuzz_json/lib/ya.make @@ -12,7 +12,7 @@ SRCS( ) PEERDIR( - library/cpp/scheme + library/cpp/scheme ) END() diff --git a/library/cpp/scheme/tests/fuzz_json/ya.make b/library/cpp/scheme/tests/fuzz_json/ya.make index 0d91c70585..38a1bac3d2 100644 --- a/library/cpp/scheme/tests/fuzz_json/ya.make +++ b/library/cpp/scheme/tests/fuzz_json/ya.make @@ -14,7 +14,7 @@ SRCS( ) PEERDIR( - library/cpp/scheme/tests/fuzz_json/lib + library/cpp/scheme/tests/fuzz_json/lib ) END() diff --git a/library/cpp/scheme/tests/fuzz_ops/fuzz_ops.cpp b/library/cpp/scheme/tests/fuzz_ops/fuzz_ops.cpp index facde50f5a..3b9b2ba8f9 100644 --- a/library/cpp/scheme/tests/fuzz_ops/fuzz_ops.cpp +++ b/library/cpp/scheme/tests/fuzz_ops/fuzz_ops.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/scheme/tests/fuzz_ops/lib/fuzz_ops.h> +#include <library/cpp/scheme/tests/fuzz_ops/lib/fuzz_ops.h> extern "C" int LLVMFuzzerTestOneInput(const ui8* wireData, const size_t wireSize) { NSc::NUt::FuzzOps({(const char*)wireData, wireSize}, false); diff --git a/library/cpp/scheme/tests/fuzz_ops/lib/fuzz_ops.cpp b/library/cpp/scheme/tests/fuzz_ops/lib/fuzz_ops.cpp index 8a7facba24..3766b3fdef 100644 --- a/library/cpp/scheme/tests/fuzz_ops/lib/fuzz_ops.cpp +++ b/library/cpp/scheme/tests/fuzz_ops/lib/fuzz_ops.cpp @@ -3,10 +3,10 @@ #include "vm_defs.h" #include "vm_parse.h" -#include <library/cpp/bit_io/bitinput.h> +#include <library/cpp/bit_io/bitinput.h> -#include <library/cpp/scheme/scheme.h> -#include <library/cpp/scheme/scimpl_private.h> +#include <library/cpp/scheme/scheme.h> +#include <library/cpp/scheme/scimpl_private.h> #include <util/generic/maybe.h> diff --git a/library/cpp/scheme/tests/fuzz_ops/lib/vm_defs.h b/library/cpp/scheme/tests/fuzz_ops/lib/vm_defs.h index 9a0ddf7351..9019281895 100644 --- a/library/cpp/scheme/tests/fuzz_ops/lib/vm_defs.h +++ b/library/cpp/scheme/tests/fuzz_ops/lib/vm_defs.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/bit_io/bitinput.h> -#include <library/cpp/scheme/scheme.h> +#include <library/cpp/bit_io/bitinput.h> +#include <library/cpp/scheme/scheme.h> #include <util/generic/deque.h> #include <util/generic/maybe.h> diff --git a/library/cpp/scheme/tests/fuzz_ops/lib/ya.make b/library/cpp/scheme/tests/fuzz_ops/lib/ya.make index 279a2ca2d4..a31d919acf 100644 --- a/library/cpp/scheme/tests/fuzz_ops/lib/ya.make +++ b/library/cpp/scheme/tests/fuzz_ops/lib/ya.make @@ -17,7 +17,7 @@ SRCS( ) PEERDIR( - library/cpp/scheme + library/cpp/scheme ) END() diff --git a/library/cpp/scheme/tests/fuzz_ops/ut/vm_parse_ut.cpp b/library/cpp/scheme/tests/fuzz_ops/ut/vm_parse_ut.cpp index ce3786a671..f34df2535c 100644 --- a/library/cpp/scheme/tests/fuzz_ops/ut/vm_parse_ut.cpp +++ b/library/cpp/scheme/tests/fuzz_ops/ut/vm_parse_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/scheme/tests/fuzz_ops/lib/vm_parse.h> +#include <library/cpp/scheme/tests/fuzz_ops/lib/vm_parse.h> #include <library/cpp/testing/unittest/registar.h> Y_UNIT_TEST_SUITE(TestParseNextAction) { diff --git a/library/cpp/scheme/tests/fuzz_ops/ut/ya.make b/library/cpp/scheme/tests/fuzz_ops/ut/ya.make index 5c933518ea..1f6bf257aa 100644 --- a/library/cpp/scheme/tests/fuzz_ops/ut/ya.make +++ b/library/cpp/scheme/tests/fuzz_ops/ut/ya.make @@ -4,8 +4,8 @@ OWNER(velavokr) PEERDIR( library/cpp/testing/unittest - library/cpp/scheme - library/cpp/scheme/tests/fuzz_ops/lib + library/cpp/scheme + library/cpp/scheme/tests/fuzz_ops/lib ) SRCS( diff --git a/library/cpp/scheme/tests/fuzz_ops/ya.make b/library/cpp/scheme/tests/fuzz_ops/ya.make index 025241ef20..e7f3238c5f 100644 --- a/library/cpp/scheme/tests/fuzz_ops/ya.make +++ b/library/cpp/scheme/tests/fuzz_ops/ya.make @@ -12,7 +12,7 @@ SRCS( ) PEERDIR( - library/cpp/scheme/tests/fuzz_ops/lib + library/cpp/scheme/tests/fuzz_ops/lib ) END() diff --git a/library/cpp/scheme/tests/ut/fuzz_ops_found_bugs_ut.cpp b/library/cpp/scheme/tests/ut/fuzz_ops_found_bugs_ut.cpp index a445b0f87c..9217615d3e 100644 --- a/library/cpp/scheme/tests/ut/fuzz_ops_found_bugs_ut.cpp +++ b/library/cpp/scheme/tests/ut/fuzz_ops_found_bugs_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/scheme/scheme.h> -#include <library/cpp/scheme/tests/fuzz_ops/lib/fuzz_ops.h> +#include <library/cpp/scheme/scheme.h> +#include <library/cpp/scheme/tests/fuzz_ops/lib/fuzz_ops.h> #include <library/cpp/testing/unittest/registar.h> #include <util/string/hex.h> diff --git a/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp b/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp index 4f907157e9..a4e0f09189 100644 --- a/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp +++ b/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/scheme/scheme.h> -#include <library/cpp/scheme/scheme_cast.h> +#include <library/cpp/scheme/scheme.h> +#include <library/cpp/scheme/scheme_cast.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/scheme/tests/ut/scheme_json_ut.cpp b/library/cpp/scheme/tests/ut/scheme_json_ut.cpp index daeb2654f9..cbd1840fd7 100644 --- a/library/cpp/scheme/tests/ut/scheme_json_ut.cpp +++ b/library/cpp/scheme/tests/ut/scheme_json_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/scheme/scimpl_private.h> -#include <library/cpp/scheme/ut_utils/scheme_ut_utils.h> +#include <library/cpp/scheme/scimpl_private.h> +#include <library/cpp/scheme/ut_utils/scheme_ut_utils.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/null.h> diff --git a/library/cpp/scheme/tests/ut/scheme_merge_ut.cpp b/library/cpp/scheme/tests/ut/scheme_merge_ut.cpp index 2a06cf110d..e7c59e1edc 100644 --- a/library/cpp/scheme/tests/ut/scheme_merge_ut.cpp +++ b/library/cpp/scheme/tests/ut/scheme_merge_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/scheme/scimpl_private.h> -#include <library/cpp/scheme/ut_utils/scheme_ut_utils.h> +#include <library/cpp/scheme/scimpl_private.h> +#include <library/cpp/scheme/ut_utils/scheme_ut_utils.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/null.h> diff --git a/library/cpp/scheme/tests/ut/scheme_path_ut.cpp b/library/cpp/scheme/tests/ut/scheme_path_ut.cpp index 0d4d79d483..743c0c7de8 100644 --- a/library/cpp/scheme/tests/ut/scheme_path_ut.cpp +++ b/library/cpp/scheme/tests/ut/scheme_path_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/scheme/scimpl_private.h> -#include <library/cpp/scheme/ut_utils/scheme_ut_utils.h> +#include <library/cpp/scheme/scimpl_private.h> +#include <library/cpp/scheme/ut_utils/scheme_ut_utils.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/null.h> diff --git a/library/cpp/scheme/tests/ut/scheme_proto_ut.cpp b/library/cpp/scheme/tests/ut/scheme_proto_ut.cpp index e711a0d092..abeda9d648 100644 --- a/library/cpp/scheme/tests/ut/scheme_proto_ut.cpp +++ b/library/cpp/scheme/tests/ut/scheme_proto_ut.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/protobuf/util/is_equal.h> -#include <library/cpp/scheme/scheme.h> -#include <library/cpp/scheme/tests/ut/scheme_ut.pb.h> +#include <library/cpp/protobuf/util/is_equal.h> +#include <library/cpp/scheme/scheme.h> +#include <library/cpp/scheme/tests/ut/scheme_ut.pb.h> #include <library/cpp/testing/unittest/registar.h> Y_UNIT_TEST_SUITE(TSchemeProtoTest) { diff --git a/library/cpp/scheme/tests/ut/scheme_ut.cpp b/library/cpp/scheme/tests/ut/scheme_ut.cpp index 1a5d07c31b..93ba3207cd 100644 --- a/library/cpp/scheme/tests/ut/scheme_ut.cpp +++ b/library/cpp/scheme/tests/ut/scheme_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/scheme/scimpl_private.h> -#include <library/cpp/scheme/ut_utils/scheme_ut_utils.h> +#include <library/cpp/scheme/scimpl_private.h> +#include <library/cpp/scheme/ut_utils/scheme_ut_utils.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/null.h> diff --git a/library/cpp/scheme/tests/ut/ya.make b/library/cpp/scheme/tests/ut/ya.make index 9f54791414..5612fe1869 100644 --- a/library/cpp/scheme/tests/ut/ya.make +++ b/library/cpp/scheme/tests/ut/ya.make @@ -3,9 +3,9 @@ UNITTEST() OWNER(velavokr) PEERDIR( - library/cpp/protobuf/util - library/cpp/scheme/tests/fuzz_ops/lib - library/cpp/scheme/ut_utils + library/cpp/protobuf/util + library/cpp/scheme/tests/fuzz_ops/lib + library/cpp/scheme/ut_utils library/cpp/string_utils/quote library/cpp/testing/unittest ) diff --git a/library/cpp/scheme/ut_utils/scheme_ut_utils.cpp b/library/cpp/scheme/ut_utils/scheme_ut_utils.cpp index 0bbdab10e8..22f2e99f26 100644 --- a/library/cpp/scheme/ut_utils/scheme_ut_utils.cpp +++ b/library/cpp/scheme/ut_utils/scheme_ut_utils.cpp @@ -1,6 +1,6 @@ #include "scheme_ut_utils.h" -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> #include <util/stream/str.h> diff --git a/library/cpp/scheme/ut_utils/scheme_ut_utils.h b/library/cpp/scheme/ut_utils/scheme_ut_utils.h index eb3ea15b2a..025e69d54e 100644 --- a/library/cpp/scheme/ut_utils/scheme_ut_utils.h +++ b/library/cpp/scheme/ut_utils/scheme_ut_utils.h @@ -1,9 +1,9 @@ #pragma once -#include <library/cpp/json/json_prettifier.h> -#include <library/cpp/scheme/scheme.h> -#include <library/cpp/json/json_value.h> -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_prettifier.h> +#include <library/cpp/scheme/scheme.h> +#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_writer.h> #include <library/cpp/testing/unittest/registar.h> #include <util/string/cast.h> diff --git a/library/cpp/scheme/ut_utils/ya.make b/library/cpp/scheme/ut_utils/ya.make index 7661262e1b..abb5dad24b 100644 --- a/library/cpp/scheme/ut_utils/ya.make +++ b/library/cpp/scheme/ut_utils/ya.make @@ -7,9 +7,9 @@ SRCS( ) PEERDIR( - library/cpp/colorizer - library/cpp/json - library/cpp/scheme + library/cpp/colorizer + library/cpp/json + library/cpp/scheme library/cpp/testing/unittest ) diff --git a/library/cpp/scheme/util/scheme_holder.h b/library/cpp/scheme/util/scheme_holder.h index f2fa16d1cd..61006ede10 100644 --- a/library/cpp/scheme/util/scheme_holder.h +++ b/library/cpp/scheme/util/scheme_holder.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/scheme/scheme.h> +#include <library/cpp/scheme/scheme.h> // Scheme adapter that holds referenced value diff --git a/library/cpp/scheme/util/utils.h b/library/cpp/scheme/util/utils.h index f7d666f67a..6d38164dec 100644 --- a/library/cpp/scheme/util/utils.h +++ b/library/cpp/scheme/util/utils.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/scheme/scheme.h> +#include <library/cpp/scheme/scheme.h> #include <util/generic/strbuf.h> #include <util/ysaveload.h> diff --git a/library/cpp/scheme/ya.make b/library/cpp/scheme/ya.make index bac08ba5a4..54fcad05f4 100644 --- a/library/cpp/scheme/ya.make +++ b/library/cpp/scheme/ya.make @@ -16,7 +16,7 @@ SRCS( PEERDIR( contrib/libs/protobuf - library/cpp/json + library/cpp/json library/cpp/string_utils/relaxed_escaper ) diff --git a/library/cpp/sliding_window/README.md b/library/cpp/sliding_window/README.md index 47692da7d5..fdf1e29425 100644 --- a/library/cpp/sliding_window/README.md +++ b/library/cpp/sliding_window/README.md @@ -1,6 +1,6 @@ # TSlidingWindow - скользящее окно -[TSlidingWindow](/arc/trunk/arcadia/library/cpp/sliding_window/sliding_window.h) - класс скользящего окна, позволяющий поддерживать и обновлять определённое значение (максимум, сумму) в промежутке времени определённой длины. Разбивает общий временной промежуток на маленькие бакеты (число задаётся в конструкторе) и ротирует их, поддерживая значение за окно. Есть возможность также указать мьютекс или спинлок для синхронизации (по умолчанию TFakeMutex). Использование: +[TSlidingWindow](/arc/trunk/arcadia/library/cpp/sliding_window/sliding_window.h) - класс скользящего окна, позволяющий поддерживать и обновлять определённое значение (максимум, сумму) в промежутке времени определённой длины. Разбивает общий временной промежуток на маленькие бакеты (число задаётся в конструкторе) и ротирует их, поддерживая значение за окно. Есть возможность также указать мьютекс или спинлок для синхронизации (по умолчанию TFakeMutex). Использование: ``` // Создаём окно, вычисляющее максимум за последние пять минут, поддерживая 50 бакетов со значениями. diff --git a/library/cpp/sliding_window/ut/ya.make b/library/cpp/sliding_window/ut/ya.make index 3839a8dadc..9f280310c0 100644 --- a/library/cpp/sliding_window/ut/ya.make +++ b/library/cpp/sliding_window/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/sliding_window) +UNITTEST_FOR(library/cpp/sliding_window) OWNER(g:kikimr) diff --git a/library/cpp/streams/brotli/ut/ya.make b/library/cpp/streams/brotli/ut/ya.make index 243462f1b2..5399b0d994 100644 --- a/library/cpp/streams/brotli/ut/ya.make +++ b/library/cpp/streams/brotli/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/streams/brotli) +UNITTEST_FOR(library/cpp/streams/brotli) OWNER( levysotsky diff --git a/library/cpp/streams/bzip2/ut/ya.make b/library/cpp/streams/bzip2/ut/ya.make index 5ef91498ca..6fb70e3106 100644 --- a/library/cpp/streams/bzip2/ut/ya.make +++ b/library/cpp/streams/bzip2/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/streams/bzip2) +UNITTEST_FOR(library/cpp/streams/bzip2) OWNER( pg diff --git a/library/cpp/streams/lz/lz_ut.cpp b/library/cpp/streams/lz/lz_ut.cpp index 6876f070fc..3c79bd1e10 100644 --- a/library/cpp/streams/lz/lz_ut.cpp +++ b/library/cpp/streams/lz/lz_ut.cpp @@ -1,7 +1,7 @@ #include "lz.h" #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> #include <util/stream/file.h> #include <util/generic/vector.h> diff --git a/library/cpp/streams/lz/ut/ya.make b/library/cpp/streams/lz/ut/ya.make index 18288c8ac9..aa004a021f 100644 --- a/library/cpp/streams/lz/ut/ya.make +++ b/library/cpp/streams/lz/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/streams/lz) +UNITTEST_FOR(library/cpp/streams/lz) OWNER( pg diff --git a/library/cpp/streams/lzma/ut/ya.make b/library/cpp/streams/lzma/ut/ya.make index 01624f0259..23b9df470f 100644 --- a/library/cpp/streams/lzma/ut/ya.make +++ b/library/cpp/streams/lzma/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/streams/lzma) +UNITTEST_FOR(library/cpp/streams/lzma) OWNER( pg diff --git a/library/cpp/streams/ya.make b/library/cpp/streams/ya.make index 7426a874ee..dfbc521940 100644 --- a/library/cpp/streams/ya.make +++ b/library/cpp/streams/ya.make @@ -19,7 +19,7 @@ RECURSE( lzop/ut special special/ut - xz + xz zc_memory_input zstd zstd/ut diff --git a/library/cpp/streams/zstd/ut/ya.make b/library/cpp/streams/zstd/ut/ya.make index 1b98f0ad5e..5a311c3aaf 100644 --- a/library/cpp/streams/zstd/ut/ya.make +++ b/library/cpp/streams/zstd/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/streams/zstd) +UNITTEST_FOR(library/cpp/streams/zstd) OWNER( bulatman diff --git a/library/cpp/string_utils/ya.make b/library/cpp/string_utils/ya.make index cd731bda95..d8c74c63ca 100644 --- a/library/cpp/string_utils/ya.make +++ b/library/cpp/string_utils/ya.make @@ -20,7 +20,7 @@ RECURSE( parse_size/ut parse_vector parse_vector/ut - secret_string + secret_string quote quote/ut relaxed_escaper diff --git a/library/cpp/svnversion/test/main.cpp b/library/cpp/svnversion/test/main.cpp index 3c8209047f..9c3304ed2b 100644 --- a/library/cpp/svnversion/test/main.cpp +++ b/library/cpp/svnversion/test/main.cpp @@ -3,7 +3,7 @@ #include <util/system/compiler.h> #include <util/stream/output.h> -// ya make -DFORCE_VCS_INFO_UPDATE --vcs-file=<vcs.json> library/cpp/svnversion/test/ +// ya make -DFORCE_VCS_INFO_UPDATE --vcs-file=<vcs.json> library/cpp/svnversion/test/ // ./library/svnversion/test/test[.exe] int main() { Cout << "GetProgramSvnVersion(): " << GetProgramSvnVersion() << Endl; diff --git a/library/cpp/svnversion/test/ya.make b/library/cpp/svnversion/test/ya.make index 59c0a2d970..2a97a68598 100644 --- a/library/cpp/svnversion/test/ya.make +++ b/library/cpp/svnversion/test/ya.make @@ -1,6 +1,6 @@ OWNER(g:cpp-contrib) PROGRAM() -PEERDIR(library/cpp/svnversion) +PEERDIR(library/cpp/svnversion) SRCS(main.cpp) END() diff --git a/library/cpp/testing/benchmark/bench.cpp b/library/cpp/testing/benchmark/bench.cpp index 08d8708005..83f3a9b965 100644 --- a/library/cpp/testing/benchmark/bench.cpp +++ b/library/cpp/testing/benchmark/bench.cpp @@ -2,10 +2,10 @@ #include <contrib/libs/re2/re2/re2.h> -#include <library/cpp/colorizer/output.h> +#include <library/cpp/colorizer/output.h> #include <library/cpp/getopt/small/last_getopt.h> -#include <library/cpp/json/json_value.h> -#include <library/cpp/linear_regression/linear_regression.h> +#include <library/cpp/json/json_value.h> +#include <library/cpp/linear_regression/linear_regression.h> #include <library/cpp/threading/poor_man_openmp/thread_helper.h> #include <util/system/hp_timer.h> diff --git a/library/cpp/testing/benchmark/ya.make b/library/cpp/testing/benchmark/ya.make index f42be80698..14b3592a22 100644 --- a/library/cpp/testing/benchmark/ya.make +++ b/library/cpp/testing/benchmark/ya.make @@ -12,10 +12,10 @@ SRCS( PEERDIR( contrib/libs/re2 - library/cpp/colorizer + library/cpp/colorizer library/cpp/getopt/small - library/cpp/json - library/cpp/linear_regression + library/cpp/json + library/cpp/linear_regression library/cpp/threading/poor_man_openmp ) diff --git a/library/cpp/testing/gmock_in_unittest/example_ut/example_ut.cpp b/library/cpp/testing/gmock_in_unittest/example_ut/example_ut.cpp index 97f19050e4..072093ff01 100644 --- a/library/cpp/testing/gmock_in_unittest/example_ut/example_ut.cpp +++ b/library/cpp/testing/gmock_in_unittest/example_ut/example_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/testing/gmock_in_unittest/gmock.h> +#include <library/cpp/testing/gmock_in_unittest/gmock.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/testing/gmock_in_unittest/example_ut/ya.make b/library/cpp/testing/gmock_in_unittest/example_ut/ya.make index d2e5ee5d2a..21e880565f 100644 --- a/library/cpp/testing/gmock_in_unittest/example_ut/ya.make +++ b/library/cpp/testing/gmock_in_unittest/example_ut/ya.make @@ -3,7 +3,7 @@ UNITTEST() OWNER(galaxycrab) PEERDIR( - library/cpp/testing/gmock_in_unittest + library/cpp/testing/gmock_in_unittest ) SRCS( diff --git a/library/cpp/testing/unittest/registar.cpp b/library/cpp/testing/unittest/registar.cpp index 3679b768ed..7c1c471e37 100644 --- a/library/cpp/testing/unittest/registar.cpp +++ b/library/cpp/testing/unittest/registar.cpp @@ -1,7 +1,7 @@ #include "registar.h" #include <library/cpp/diff/diff.h> -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> #include <util/generic/bt_exception.h> #include <util/random/fast.h> diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h index 44517a0092..da68f91963 100644 --- a/library/cpp/testing/unittest/registar.h +++ b/library/cpp/testing/unittest/registar.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/dbg_output/dump.h> +#include <library/cpp/dbg_output/dump.h> #include <util/generic/bt_exception.h> #include <util/generic/hash.h> diff --git a/library/cpp/testing/unittest/utmain.cpp b/library/cpp/testing/unittest/utmain.cpp index 305bc6b40f..31dd23cb0b 100644 --- a/library/cpp/testing/unittest/utmain.cpp +++ b/library/cpp/testing/unittest/utmain.cpp @@ -2,10 +2,10 @@ #include "registar.h" #include "utmain.h" -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> -#include <library/cpp/json/writer/json.h> -#include <library/cpp/json/writer/json_value.h> +#include <library/cpp/json/writer/json.h> +#include <library/cpp/json/writer/json_value.h> #include <library/cpp/testing/common/env.h> #include <library/cpp/testing/hook/hook.h> diff --git a/library/cpp/testing/unittest/ya.make b/library/cpp/testing/unittest/ya.make index aaa4f2ba85..965e601e9c 100644 --- a/library/cpp/testing/unittest/ya.make +++ b/library/cpp/testing/unittest/ya.make @@ -8,10 +8,10 @@ OWNER( ) PEERDIR( - library/cpp/colorizer - library/cpp/dbg_output + library/cpp/colorizer + library/cpp/dbg_output library/cpp/diff - library/cpp/json/writer + library/cpp/json/writer library/cpp/testing/common library/cpp/testing/hook ) diff --git a/library/cpp/testing/ya.make b/library/cpp/testing/ya.make index 6a57ac2ee6..313de61ef7 100644 --- a/library/cpp/testing/ya.make +++ b/library/cpp/testing/ya.make @@ -1,4 +1,4 @@ -RECURSE( +RECURSE( common benchmark benchmark/examples @@ -9,16 +9,16 @@ RECURSE( dump_clang_coverage gbenchmark_main gmock - gmock_in_unittest - gmock_in_unittest/example_ut + gmock_in_unittest + gmock_in_unittest/example_ut gtest gtest_boost_extensions gtest_extensions gtest_main gtest_protobuf hook - mock_server + mock_server unittest unittest_main - urlnorm -) + urlnorm +) diff --git a/library/cpp/threading/light_rw_lock/bench/lightrwlock_test.cpp b/library/cpp/threading/light_rw_lock/bench/lightrwlock_test.cpp index c3027ea544..8255a6e7fb 100644 --- a/library/cpp/threading/light_rw_lock/bench/lightrwlock_test.cpp +++ b/library/cpp/threading/light_rw_lock/bench/lightrwlock_test.cpp @@ -13,7 +13,7 @@ using namespace NS_LightRWLock; #define LIGHT #ifdef RWSPINLOCK -#include <library/cpp/lwtrace/rwspinlock.h> +#include <library/cpp/lwtrace/rwspinlock.h> #endif #define CHECK_LOGIC 1 diff --git a/library/cpp/threading/skip_list/perf/main.cpp b/library/cpp/threading/skip_list/perf/main.cpp index 4ad52049e7..b5f8a1a61a 100644 --- a/library/cpp/threading/skip_list/perf/main.cpp +++ b/library/cpp/threading/skip_list/perf/main.cpp @@ -2,7 +2,7 @@ #include <library/cpp/getopt/small/last_getopt.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <util/datetime/base.h> #include <util/generic/map.h> #include <util/generic/vector.h> diff --git a/library/cpp/threading/skip_list/perf/ya.make b/library/cpp/threading/skip_list/perf/ya.make index 01bfafa404..2dd32a882c 100644 --- a/library/cpp/threading/skip_list/perf/ya.make +++ b/library/cpp/threading/skip_list/perf/ya.make @@ -3,7 +3,7 @@ PROGRAM(skiplist-perf) OWNER(g:rtmr) PEERDIR( - library/cpp/charset + library/cpp/charset library/cpp/getopt/small library/cpp/threading/skip_list ) diff --git a/library/cpp/timezone_conversion/README.md b/library/cpp/timezone_conversion/README.md index 828f1880bc..6b7950a29c 100644 --- a/library/cpp/timezone_conversion/README.md +++ b/library/cpp/timezone_conversion/README.md @@ -11,7 +11,7 @@ See [contrib/libs/cctz/README][update] if you think zone database is outdated. Quick start: ============ ``` -#include <library/cpp/timezone_conversion/convert.h> +#include <library/cpp/timezone_conversion/convert.h> // NDatetime::{GetLocalTimeZone(),GetUtcTimeZone()} are also available. NDatetime::TTimeZone msk = NDatetime::GetTimeZone("Europe/Moscow"); diff --git a/library/cpp/timezone_conversion/ut/civil_ut.cpp b/library/cpp/timezone_conversion/ut/civil_ut.cpp index a21bd4bd7d..0a4d9a56d6 100644 --- a/library/cpp/timezone_conversion/ut/civil_ut.cpp +++ b/library/cpp/timezone_conversion/ut/civil_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/timezone_conversion/civil.h> +#include <library/cpp/timezone_conversion/civil.h> #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/tests_data.h> diff --git a/library/cpp/timezone_conversion/ut/convert_ut.cpp b/library/cpp/timezone_conversion/ut/convert_ut.cpp index bbf9e9b826..086cafea29 100644 --- a/library/cpp/timezone_conversion/ut/convert_ut.cpp +++ b/library/cpp/timezone_conversion/ut/convert_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/timezone_conversion/convert.h> +#include <library/cpp/timezone_conversion/convert.h> #include <library/cpp/testing/unittest/gtest.h> using namespace NDatetime; diff --git a/library/cpp/timezone_conversion/ut/ya.make b/library/cpp/timezone_conversion/ut/ya.make index 781a57da9f..0b25e58ea7 100644 --- a/library/cpp/timezone_conversion/ut/ya.make +++ b/library/cpp/timezone_conversion/ut/ya.make @@ -4,7 +4,7 @@ OWNER(dfyz) PEERDIR( library/cpp/testing/unittest - library/cpp/timezone_conversion + library/cpp/timezone_conversion ) SRCS( diff --git a/library/cpp/tld/tld.cpp b/library/cpp/tld/tld.cpp index e31f3f0322..a5c7715584 100644 --- a/library/cpp/tld/tld.cpp +++ b/library/cpp/tld/tld.cpp @@ -1,13 +1,13 @@ #include "tld.h" -#include <library/cpp/digest/lower_case/hash_ops.h> +#include <library/cpp/digest/lower_case/hash_ops.h> #include <util/generic/hash_set.h> #include <util/generic/singleton.h> namespace NTld { namespace { -#include <library/cpp/tld/tld.inc> +#include <library/cpp/tld/tld.inc> using TCiHash = THashSet<TStringBuf, TCIOps, TCIOps>; diff --git a/library/cpp/tld/tld_ut.cpp b/library/cpp/tld/tld_ut.cpp index 733200f2b5..6ff1d74f24 100644 --- a/library/cpp/tld/tld_ut.cpp +++ b/library/cpp/tld/tld_ut.cpp @@ -2,7 +2,7 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/charset/doccodes.h> +#include <library/cpp/charset/doccodes.h> using namespace NTld; diff --git a/library/cpp/tld/ut/ya.make b/library/cpp/tld/ut/ya.make index 0bc5b40b2f..749d3f1f8b 100644 --- a/library/cpp/tld/ut/ya.make +++ b/library/cpp/tld/ut/ya.make @@ -3,10 +3,10 @@ UNITTEST() OWNER(abolkhovityanov) PEERDIR( - ADDINCL library/cpp/tld + ADDINCL library/cpp/tld ) -SRCDIR(library/cpp/tld) +SRCDIR(library/cpp/tld) SRCS( tld_ut.cpp diff --git a/library/cpp/tld/ya.make b/library/cpp/tld/ya.make index aeabbfeebf..abd230d4c2 100644 --- a/library/cpp/tld/ya.make +++ b/library/cpp/tld/ya.make @@ -13,7 +13,7 @@ SRCS( ) PEERDIR( - library/cpp/digest/lower_case + library/cpp/digest/lower_case ) END() diff --git a/library/cpp/tvmauth/README.md b/library/cpp/tvmauth/README.md index ec64bbbcdb..85aec480d9 100644 --- a/library/cpp/tvmauth/README.md +++ b/library/cpp/tvmauth/README.md @@ -1,2 +1,2 @@ -This part of library contains primitives for TVM operation. -Please use high-level [TTvmClient](https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/tvmauth/client/README.md). +This part of library contains primitives for TVM operation. +Please use high-level [TTvmClient](https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/tvmauth/client/README.md). diff --git a/library/cpp/tvmauth/a.yaml b/library/cpp/tvmauth/a.yaml index 7f1e1b8fd8..3d5d4b06fa 100644 --- a/library/cpp/tvmauth/a.yaml +++ b/library/cpp/tvmauth/a.yaml @@ -1,23 +1,23 @@ -service: passport_infra -title: tvmauth (c++) - -ci: +service: passport_infra +title: tvmauth (c++) + +ci: release-title-source: flow - autocheck: - fast-targets: - - library/c/tvmauth - - library/cpp/tvmauth - - library/go/yandex/ticket_parser2 - - library/java/ticket_parser2 - - library/java/tvmauth - - library/python/deprecated/ticket_parser2 - - library/python/tvmauth - - passport - strong: true - -arcanum: - auto_merge: - enabled: true - requirements: - - system: arcanum - type: comment_issues_closed + autocheck: + fast-targets: + - library/c/tvmauth + - library/cpp/tvmauth + - library/go/yandex/ticket_parser2 + - library/java/ticket_parser2 + - library/java/tvmauth + - library/python/deprecated/ticket_parser2 + - library/python/tvmauth + - passport + strong: true + +arcanum: + auto_merge: + enabled: true + requirements: + - system: arcanum + type: comment_issues_closed diff --git a/library/cpp/tvmauth/checked_service_ticket.h b/library/cpp/tvmauth/checked_service_ticket.h index cf4c5c43e3..30e42e7190 100644 --- a/library/cpp/tvmauth/checked_service_ticket.h +++ b/library/cpp/tvmauth/checked_service_ticket.h @@ -1,71 +1,71 @@ -#pragma once - -#include "ticket_status.h" -#include "type.h" -#include "utils.h" - -#include <util/generic/ptr.h> - -namespace NTvmAuth::NInternal { - class TCanningKnife; -} - -namespace NTvmAuth { - class TCheckedServiceTicket { - public: - class TImpl; - - TCheckedServiceTicket(THolder<TImpl> impl); - TCheckedServiceTicket(TCheckedServiceTicket&& o); - ~TCheckedServiceTicket(); - - TCheckedServiceTicket& operator=(TCheckedServiceTicket&&); - - /*! - * @return True value if ticket parsed and checked successfully - */ - explicit operator bool() const; - - /*! - * You should check src with your ACL - * @return TvmId of request source - */ - TTvmId GetSrc() const; - - /*! - * @return Ticket check status - */ - ETicketStatus GetStatus() const; - - /*! - * DebugInfo is human readable data for debug purposes - * @return Serialized ticket - */ - TString DebugInfo() const; - - /*! - * IssuerUID is UID of developer who is debuging something, - * so he(she) issued ServiceTicket with his(her) ssh-sign: - * it is grant_type=sshkey in tvm-api. - * https://wiki.yandex-team.ru/passport/tvm2/debug/#sxoditvapizakrytoeserviceticketami - * @return uid - */ - TMaybe<TUid> GetIssuerUid() const; - - public: // for python binding - TCheckedServiceTicket() = default; - - private: - THolder<TImpl> Impl_; - friend class NInternal::TCanningKnife; - }; - - namespace NBlackboxTvmId { - const TStringBuf Prod = "222"; - const TStringBuf Test = "224"; - const TStringBuf ProdYateam = "223"; - const TStringBuf TestYateam = "225"; - const TStringBuf Stress = "226"; - const TStringBuf Mimino = "239"; - } -} +#pragma once + +#include "ticket_status.h" +#include "type.h" +#include "utils.h" + +#include <util/generic/ptr.h> + +namespace NTvmAuth::NInternal { + class TCanningKnife; +} + +namespace NTvmAuth { + class TCheckedServiceTicket { + public: + class TImpl; + + TCheckedServiceTicket(THolder<TImpl> impl); + TCheckedServiceTicket(TCheckedServiceTicket&& o); + ~TCheckedServiceTicket(); + + TCheckedServiceTicket& operator=(TCheckedServiceTicket&&); + + /*! + * @return True value if ticket parsed and checked successfully + */ + explicit operator bool() const; + + /*! + * You should check src with your ACL + * @return TvmId of request source + */ + TTvmId GetSrc() const; + + /*! + * @return Ticket check status + */ + ETicketStatus GetStatus() const; + + /*! + * DebugInfo is human readable data for debug purposes + * @return Serialized ticket + */ + TString DebugInfo() const; + + /*! + * IssuerUID is UID of developer who is debuging something, + * so he(she) issued ServiceTicket with his(her) ssh-sign: + * it is grant_type=sshkey in tvm-api. + * https://wiki.yandex-team.ru/passport/tvm2/debug/#sxoditvapizakrytoeserviceticketami + * @return uid + */ + TMaybe<TUid> GetIssuerUid() const; + + public: // for python binding + TCheckedServiceTicket() = default; + + private: + THolder<TImpl> Impl_; + friend class NInternal::TCanningKnife; + }; + + namespace NBlackboxTvmId { + const TStringBuf Prod = "222"; + const TStringBuf Test = "224"; + const TStringBuf ProdYateam = "223"; + const TStringBuf TestYateam = "225"; + const TStringBuf Stress = "226"; + const TStringBuf Mimino = "239"; + } +} diff --git a/library/cpp/tvmauth/checked_user_ticket.h b/library/cpp/tvmauth/checked_user_ticket.h index 16a2a6dc30..2c3d712e27 100644 --- a/library/cpp/tvmauth/checked_user_ticket.h +++ b/library/cpp/tvmauth/checked_user_ticket.h @@ -1,91 +1,91 @@ -#pragma once - -#include "ticket_status.h" -#include "type.h" -#include "utils.h" - -#include <util/generic/ptr.h> - -namespace NTvmAuth::NInternal { - class TCanningKnife; -} - -namespace NTvmAuth { - /*! - * BlackboxEnv describes environment of Passport: - * https://wiki.yandex-team.ru/passport/tvm2/user-ticket/#0-opredeljaemsjasokruzhenijami - */ - enum class EBlackboxEnv: ui8 { - Prod, - Test, - ProdYateam, - TestYateam, - Stress - }; - - /*! - * UserTicket contains only valid users. - * Details: https://wiki.yandex-team.ru/passport/tvm2/user-ticket/#chtoestvusertickete - */ - class TCheckedUserTicket { - public: - class TImpl; - - TCheckedUserTicket(THolder<TImpl> impl); - TCheckedUserTicket(TCheckedUserTicket&&); - ~TCheckedUserTicket(); - - TCheckedUserTicket& operator=(TCheckedUserTicket&&); - - /*! - * @return True value if ticket parsed and checked successfully - */ - explicit operator bool() const; - - /*! - * Never empty - * @return UIDs of users listed in ticket - */ - const TUids& GetUids() const; - - /*! - * Maybe 0 - * @return Default user in ticket - */ - TUid GetDefaultUid() const; - - /*! - * Scopes inherited from credential - never empty - * @return Newly constructed vector of scopes - */ - const TScopes& GetScopes() const; - - /*! - * Check if scope presented in ticket - */ - bool HasScope(TStringBuf scopeName) const; - - /*! - * @return Ticket check status - */ - ETicketStatus GetStatus() const; - - /*! - * DebugInfo is human readable data for debug purposes - * @return Serialized ticket - */ - TString DebugInfo() const; - - /*! - * Env of user - */ - EBlackboxEnv GetEnv() const; - - public: // for python binding - TCheckedUserTicket() = default; - - private: - THolder<TImpl> Impl_; - friend class NInternal::TCanningKnife; - }; -} +#pragma once + +#include "ticket_status.h" +#include "type.h" +#include "utils.h" + +#include <util/generic/ptr.h> + +namespace NTvmAuth::NInternal { + class TCanningKnife; +} + +namespace NTvmAuth { + /*! + * BlackboxEnv describes environment of Passport: + * https://wiki.yandex-team.ru/passport/tvm2/user-ticket/#0-opredeljaemsjasokruzhenijami + */ + enum class EBlackboxEnv: ui8 { + Prod, + Test, + ProdYateam, + TestYateam, + Stress + }; + + /*! + * UserTicket contains only valid users. + * Details: https://wiki.yandex-team.ru/passport/tvm2/user-ticket/#chtoestvusertickete + */ + class TCheckedUserTicket { + public: + class TImpl; + + TCheckedUserTicket(THolder<TImpl> impl); + TCheckedUserTicket(TCheckedUserTicket&&); + ~TCheckedUserTicket(); + + TCheckedUserTicket& operator=(TCheckedUserTicket&&); + + /*! + * @return True value if ticket parsed and checked successfully + */ + explicit operator bool() const; + + /*! + * Never empty + * @return UIDs of users listed in ticket + */ + const TUids& GetUids() const; + + /*! + * Maybe 0 + * @return Default user in ticket + */ + TUid GetDefaultUid() const; + + /*! + * Scopes inherited from credential - never empty + * @return Newly constructed vector of scopes + */ + const TScopes& GetScopes() const; + + /*! + * Check if scope presented in ticket + */ + bool HasScope(TStringBuf scopeName) const; + + /*! + * @return Ticket check status + */ + ETicketStatus GetStatus() const; + + /*! + * DebugInfo is human readable data for debug purposes + * @return Serialized ticket + */ + TString DebugInfo() const; + + /*! + * Env of user + */ + EBlackboxEnv GetEnv() const; + + public: // for python binding + TCheckedUserTicket() = default; + + private: + THolder<TImpl> Impl_; + friend class NInternal::TCanningKnife; + }; +} diff --git a/library/cpp/tvmauth/client/README.md b/library/cpp/tvmauth/client/README.md index 239f55de7a..5686eb5c07 100644 --- a/library/cpp/tvmauth/client/README.md +++ b/library/cpp/tvmauth/client/README.md @@ -1,56 +1,56 @@ -Overview -=== -This library provides ability to operate with TVM. Library is fast enough to get or check tickets for every request without burning CPU. - -[Home page of project](https://wiki.yandex-team.ru/passport/tvm2/) -You can find some examples in [here](https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/tvmauth/client/examples). - -You can ask questions: [PASSPORTDUTY](https://st.yandex-team.ru/createTicket?queue=PASSPORTDUTY&_form=77618) - -TvmClient -=== -Don't forget to collect logs from client. -___ -`TvmClient` allowes: -1. `GetServiceTicketFor()` - to fetch ServiceTicket for outgoing request -2. `CheckServiceTicket()` - to check ServiceTicket from incoming request -3. `CheckUserTicket()` - to check UserTicket from incoming request - -All methods are thread-safe. - -You should check status of `CheckedServiceTicket` or `CheckedUserTicket` for equality 'Ok'. You can get ticket fields (src/uids/scopes) only for correct ticket. Otherwise exception will be thrown. -___ -You should check status of client with `GetStatus()`: -* `OK` - nothing to do here -* `Warning` - **you should trigger your monitoring alert** - - Normal operation of TvmClient is still possible but there are problems with refreshing cache, so it is expiring. - Is tvm-api.yandex.net accessible? - Have you changed your TVM-secret or your backend (dst) deleted its TVM-client? - -* `Error` - **you should trigger your monitoring alert and close this instance for user-traffic** - - TvmClient's cache is already invalid (expired) or soon will be: you can't check valid ServiceTicket or be authenticated by your backends (dsts) - -___ -Constructor creates system thread for refreshing cache - so do not fork your proccess after creating `TTvmClient` instance. Constructor leads to network I/O. Other methods always use memory. - -Exceptions maybe thrown from constructor: -* `TRetriableException` - maybe some network trouble: you can try to create client one more time. -* `TNonRetriableException` - settings are bad: fix them. -___ -You can choose way for fetching data for your service operation: -* http://localhost:{port}/tvm - recomended way -* https://tvm-api.yandex.net - -TvmTool ------------- -`TTvmClient` uses local http-interface to get state. This interface can be provided with tvmtool (local daemon) or Qloud/YP (local http api in container). -See more: https://wiki.yandex-team.ru/passport/tvm2/tvm-daemon/. - -`TTvmClient` fetches configuration from tvmtool, so you need only to tell client how to connect to it and tell which alias of tvm id should be used for this `TvmClient` instance. - -TvmApi ------------- -First of all: please use `SetDiskCacheDir()` - it provides reliability for your service and for tvm-api. -Please check restrictions of this method. +Overview +=== +This library provides ability to operate with TVM. Library is fast enough to get or check tickets for every request without burning CPU. + +[Home page of project](https://wiki.yandex-team.ru/passport/tvm2/) +You can find some examples in [here](https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/tvmauth/client/examples). + +You can ask questions: [PASSPORTDUTY](https://st.yandex-team.ru/createTicket?queue=PASSPORTDUTY&_form=77618) + +TvmClient +=== +Don't forget to collect logs from client. +___ +`TvmClient` allowes: +1. `GetServiceTicketFor()` - to fetch ServiceTicket for outgoing request +2. `CheckServiceTicket()` - to check ServiceTicket from incoming request +3. `CheckUserTicket()` - to check UserTicket from incoming request + +All methods are thread-safe. + +You should check status of `CheckedServiceTicket` or `CheckedUserTicket` for equality 'Ok'. You can get ticket fields (src/uids/scopes) only for correct ticket. Otherwise exception will be thrown. +___ +You should check status of client with `GetStatus()`: +* `OK` - nothing to do here +* `Warning` - **you should trigger your monitoring alert** + + Normal operation of TvmClient is still possible but there are problems with refreshing cache, so it is expiring. + Is tvm-api.yandex.net accessible? + Have you changed your TVM-secret or your backend (dst) deleted its TVM-client? + +* `Error` - **you should trigger your monitoring alert and close this instance for user-traffic** + + TvmClient's cache is already invalid (expired) or soon will be: you can't check valid ServiceTicket or be authenticated by your backends (dsts) + +___ +Constructor creates system thread for refreshing cache - so do not fork your proccess after creating `TTvmClient` instance. Constructor leads to network I/O. Other methods always use memory. + +Exceptions maybe thrown from constructor: +* `TRetriableException` - maybe some network trouble: you can try to create client one more time. +* `TNonRetriableException` - settings are bad: fix them. +___ +You can choose way for fetching data for your service operation: +* http://localhost:{port}/tvm - recomended way +* https://tvm-api.yandex.net + +TvmTool +------------ +`TTvmClient` uses local http-interface to get state. This interface can be provided with tvmtool (local daemon) or Qloud/YP (local http api in container). +See more: https://wiki.yandex-team.ru/passport/tvm2/tvm-daemon/. + +`TTvmClient` fetches configuration from tvmtool, so you need only to tell client how to connect to it and tell which alias of tvm id should be used for this `TvmClient` instance. + +TvmApi +------------ +First of all: please use `SetDiskCacheDir()` - it provides reliability for your service and for tvm-api. +Please check restrictions of this method. diff --git a/library/cpp/tvmauth/client/client_status.cpp b/library/cpp/tvmauth/client/client_status.cpp index eca35ba22b..861dfb9737 100644 --- a/library/cpp/tvmauth/client/client_status.cpp +++ b/library/cpp/tvmauth/client/client_status.cpp @@ -1,6 +1,6 @@ -#include "client_status.h" - -template <> -void Out<NTvmAuth::TClientStatus>(IOutputStream& out, const NTvmAuth::TClientStatus& s) { - out << s.GetCode() << ": " << s.GetLastError(); -} +#include "client_status.h" + +template <> +void Out<NTvmAuth::TClientStatus>(IOutputStream& out, const NTvmAuth::TClientStatus& s) { + out << s.GetCode() << ": " << s.GetLastError(); +} diff --git a/library/cpp/tvmauth/client/client_status.h b/library/cpp/tvmauth/client/client_status.h index bbaf29d289..139fb109f6 100644 --- a/library/cpp/tvmauth/client/client_status.h +++ b/library/cpp/tvmauth/client/client_status.h @@ -1,82 +1,82 @@ -#pragma once - -#include <util/generic/string.h> -#include <util/string/builder.h> - -namespace NTvmAuth { - class TClientStatus { - public: - enum ECode { - Ok, - Warning, - Error, +#pragma once + +#include <util/generic/string.h> +#include <util/string/builder.h> + +namespace NTvmAuth { + class TClientStatus { + public: + enum ECode { + Ok, + Warning, + Error, IncompleteTicketsSet, - }; - - TClientStatus(ECode state, TString&& lastError) - : Code_(state) - , LastError_(std::move(lastError)) - { - } - - TClientStatus() = default; - TClientStatus(const TClientStatus&) = default; - TClientStatus(TClientStatus&&) = default; - - TClientStatus& operator=(const TClientStatus&) = default; - TClientStatus& operator=(TClientStatus&&) = default; - - ECode GetCode() const { - return Code_; - } - - const TString& GetLastError() const { - return LastError_; - } - - TString CreateJugglerMessage() const { + }; + + TClientStatus(ECode state, TString&& lastError) + : Code_(state) + , LastError_(std::move(lastError)) + { + } + + TClientStatus() = default; + TClientStatus(const TClientStatus&) = default; + TClientStatus(TClientStatus&&) = default; + + TClientStatus& operator=(const TClientStatus&) = default; + TClientStatus& operator=(TClientStatus&&) = default; + + ECode GetCode() const { + return Code_; + } + + const TString& GetLastError() const { + return LastError_; + } + + TString CreateJugglerMessage() const { return TStringBuilder() << GetJugglerCode() << ";TvmClient: " << LastError_ << "\n"; - } - - private: + } + + private: int32_t GetJugglerCode() const { switch (Code_) { case ECode::Ok: - return 0; // OK juggler check state + return 0; // OK juggler check state case ECode::Warning: case ECode::IncompleteTicketsSet: - return 1; // WARN juggler check state + return 1; // WARN juggler check state case ECode::Error: - return 2; // CRIT juggler check state + return 2; // CRIT juggler check state } return 2; // This should not happen, so set check state as CRIT. } - ECode Code_ = Ok; - TString LastError_; - }; - - static inline bool operator==(const TClientStatus& l, const TClientStatus& r) noexcept { - return l.GetCode() == r.GetCode() && l.GetLastError() == r.GetLastError(); - } - - static inline bool operator==(const TClientStatus& l, const TClientStatus::ECode r) noexcept { - return l.GetCode() == r; - } - - static inline bool operator==(const TClientStatus::ECode l, const TClientStatus& r) noexcept { - return r.GetCode() == l; - } - - static inline bool operator!=(const TClientStatus& l, const TClientStatus& r) noexcept { - return !(l == r); - } - - static inline bool operator!=(const TClientStatus& l, const TClientStatus::ECode r) noexcept { - return !(l == r); - } - - static inline bool operator!=(const TClientStatus::ECode l, const TClientStatus& r) noexcept { - return !(l == r); - } -} + ECode Code_ = Ok; + TString LastError_; + }; + + static inline bool operator==(const TClientStatus& l, const TClientStatus& r) noexcept { + return l.GetCode() == r.GetCode() && l.GetLastError() == r.GetLastError(); + } + + static inline bool operator==(const TClientStatus& l, const TClientStatus::ECode r) noexcept { + return l.GetCode() == r; + } + + static inline bool operator==(const TClientStatus::ECode l, const TClientStatus& r) noexcept { + return r.GetCode() == l; + } + + static inline bool operator!=(const TClientStatus& l, const TClientStatus& r) noexcept { + return !(l == r); + } + + static inline bool operator!=(const TClientStatus& l, const TClientStatus::ECode r) noexcept { + return !(l == r); + } + + static inline bool operator!=(const TClientStatus::ECode l, const TClientStatus& r) noexcept { + return !(l == r); + } +} diff --git a/library/cpp/tvmauth/client/examples/create_with_tvmapi/create.cpp b/library/cpp/tvmauth/client/examples/create_with_tvmapi/create.cpp index c03a7a032f..dfcd81377b 100644 --- a/library/cpp/tvmauth/client/examples/create_with_tvmapi/create.cpp +++ b/library/cpp/tvmauth/client/examples/create_with_tvmapi/create.cpp @@ -1,102 +1,102 @@ -#include <library/cpp/tvmauth/client/facade.h> - -namespace NExample { - NTvmAuth::TTvmClient CreateClientForCheckingAllTicketsAndFetchingServiceTickets() { - NTvmAuth::NTvmApi::TClientSettings setts{ - .DiskCacheDir = "/var/cache/my_service/tvm/", - .SelfTvmId = 11, - .Secret = (TStringBuf) "AAAAAAAAAAAAAAAAAAAAAA", - .FetchServiceTicketsForDstsWithAliases = { - {"bb", 224}, - {"datasync", 2000060}, - }, - .CheckServiceTickets = true, - .CheckUserTicketsWithBbEnv = NTvmAuth::EBlackboxEnv::Test, - }; - - NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); - - NTvmAuth::TTvmClient c(setts, log); - - // c.CheckServiceTicket("some service ticket") - // c.CheckUserTicket("some user ticket") - // c.GetServiceTicketFor("bb") - // c.GetServiceTicketFor(224) - - return c; - } - - NTvmAuth::TTvmClient CreateClientForCheckingAllTickets() { - NTvmAuth::NTvmApi::TClientSettings setts{ - .DiskCacheDir = "/var/cache/my_service/tvm/", - .SelfTvmId = 11, - .CheckServiceTickets = true, - .CheckUserTicketsWithBbEnv = NTvmAuth::EBlackboxEnv::Test, - }; - - NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); - - NTvmAuth::TTvmClient c(setts, log); - - // c.CheckServiceTicket("some service ticket") - // c.CheckUserTicket("some user ticket") - - return c; - } - - NTvmAuth::TTvmClient CreateClientForFetchingServiceTickets() { - NTvmAuth::NTvmApi::TClientSettings setts{ - .DiskCacheDir = "/var/cache/my_service/tvm/", - .SelfTvmId = 11, - .Secret = (TStringBuf) "AAAAAAAAAAAAAAAAAAAAAA", - .FetchServiceTicketsForDstsWithAliases = { - {"bb", 224}, - {"datasync", 2000060}, - }, - }; - - NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); - - NTvmAuth::TTvmClient c(setts, log); - - // c.GetServiceTicketFor("bb") - // c.GetServiceTicketFor(224) - - return c; - } - - NTvmAuth::TTvmClient CreateClientForCheckingServiceTickets() { - NTvmAuth::NTvmApi::TClientSettings setts{ - .DiskCacheDir = "/var/cache/my_service/tvm/", - .SelfTvmId = 11, - .CheckServiceTickets = true, - }; - - NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); - - NTvmAuth::TTvmClient c(setts, log); - - // c.CheckServiceTicket("some service ticket") - - return c; - } - - NTvmAuth::TTvmClient CreateClientForCheckingServiceTicketsWithRoles() { - NTvmAuth::NTvmApi::TClientSettings setts{ - .DiskCacheDir = "/var/cache/my_service/tvm/", - .SelfTvmId = 11, - .Secret = (TStringBuf) "AAAAAAAAAAAAAAAAAAAAAA", - .CheckServiceTickets = true, - .FetchRolesForIdmSystemSlug = "passporttestservice", - }; - - NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); - - NTvmAuth::TTvmClient c(setts, log); - - // auto t = c.CheckServiceTicket("some service ticket") - // c.GetRoles()->CheckServiceRole(t, "some role"); - - return c; - } -} +#include <library/cpp/tvmauth/client/facade.h> + +namespace NExample { + NTvmAuth::TTvmClient CreateClientForCheckingAllTicketsAndFetchingServiceTickets() { + NTvmAuth::NTvmApi::TClientSettings setts{ + .DiskCacheDir = "/var/cache/my_service/tvm/", + .SelfTvmId = 11, + .Secret = (TStringBuf) "AAAAAAAAAAAAAAAAAAAAAA", + .FetchServiceTicketsForDstsWithAliases = { + {"bb", 224}, + {"datasync", 2000060}, + }, + .CheckServiceTickets = true, + .CheckUserTicketsWithBbEnv = NTvmAuth::EBlackboxEnv::Test, + }; + + NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); + + NTvmAuth::TTvmClient c(setts, log); + + // c.CheckServiceTicket("some service ticket") + // c.CheckUserTicket("some user ticket") + // c.GetServiceTicketFor("bb") + // c.GetServiceTicketFor(224) + + return c; + } + + NTvmAuth::TTvmClient CreateClientForCheckingAllTickets() { + NTvmAuth::NTvmApi::TClientSettings setts{ + .DiskCacheDir = "/var/cache/my_service/tvm/", + .SelfTvmId = 11, + .CheckServiceTickets = true, + .CheckUserTicketsWithBbEnv = NTvmAuth::EBlackboxEnv::Test, + }; + + NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); + + NTvmAuth::TTvmClient c(setts, log); + + // c.CheckServiceTicket("some service ticket") + // c.CheckUserTicket("some user ticket") + + return c; + } + + NTvmAuth::TTvmClient CreateClientForFetchingServiceTickets() { + NTvmAuth::NTvmApi::TClientSettings setts{ + .DiskCacheDir = "/var/cache/my_service/tvm/", + .SelfTvmId = 11, + .Secret = (TStringBuf) "AAAAAAAAAAAAAAAAAAAAAA", + .FetchServiceTicketsForDstsWithAliases = { + {"bb", 224}, + {"datasync", 2000060}, + }, + }; + + NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); + + NTvmAuth::TTvmClient c(setts, log); + + // c.GetServiceTicketFor("bb") + // c.GetServiceTicketFor(224) + + return c; + } + + NTvmAuth::TTvmClient CreateClientForCheckingServiceTickets() { + NTvmAuth::NTvmApi::TClientSettings setts{ + .DiskCacheDir = "/var/cache/my_service/tvm/", + .SelfTvmId = 11, + .CheckServiceTickets = true, + }; + + NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); + + NTvmAuth::TTvmClient c(setts, log); + + // c.CheckServiceTicket("some service ticket") + + return c; + } + + NTvmAuth::TTvmClient CreateClientForCheckingServiceTicketsWithRoles() { + NTvmAuth::NTvmApi::TClientSettings setts{ + .DiskCacheDir = "/var/cache/my_service/tvm/", + .SelfTvmId = 11, + .Secret = (TStringBuf) "AAAAAAAAAAAAAAAAAAAAAA", + .CheckServiceTickets = true, + .FetchRolesForIdmSystemSlug = "passporttestservice", + }; + + NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); + + NTvmAuth::TTvmClient c(setts, log); + + // auto t = c.CheckServiceTicket("some service ticket") + // c.GetRoles()->CheckServiceRole(t, "some role"); + + return c; + } +} diff --git a/library/cpp/tvmauth/client/examples/create_with_tvmapi/ya.make b/library/cpp/tvmauth/client/examples/create_with_tvmapi/ya.make index fc69a06dbd..497094e0d0 100644 --- a/library/cpp/tvmauth/client/examples/create_with_tvmapi/ya.make +++ b/library/cpp/tvmauth/client/examples/create_with_tvmapi/ya.make @@ -1,13 +1,13 @@ -LIBRARY() - -OWNER(g:passport_infra) - -PEERDIR( - library/cpp/tvmauth/client -) - -SRCS( - create.cpp -) - -END() +LIBRARY() + +OWNER(g:passport_infra) + +PEERDIR( + library/cpp/tvmauth/client +) + +SRCS( + create.cpp +) + +END() diff --git a/library/cpp/tvmauth/client/examples/create_with_tvmtool/create.cpp b/library/cpp/tvmauth/client/examples/create_with_tvmtool/create.cpp index a87d3e705d..606c165be5 100644 --- a/library/cpp/tvmauth/client/examples/create_with_tvmtool/create.cpp +++ b/library/cpp/tvmauth/client/examples/create_with_tvmtool/create.cpp @@ -1,34 +1,34 @@ -#include <library/cpp/tvmauth/client/facade.h> - -namespace NExample { - // Possibility of using functions depends on config of tvmtool - // CheckServiceTicket - // CheckUserTicket - // GetServiceTicketFor - - NTvmAuth::TTvmClient CreateClientInQloudOrYandexDeploy() { - NTvmAuth::NTvmTool::TClientSettings setts( - "my_service" // specified in Qloud/YP/tvmtool interface - ); - - NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); - - NTvmAuth::TTvmClient c(setts, log); - - return c; - } - - NTvmAuth::TTvmClient CreateClientForDevOrTests() { - NTvmAuth::NTvmTool::TClientSettings setts( - "my_service" // specified in Qloud/YP/tvmtool interface - ); - setts.SetPort(18080); - setts.SetAuthToken("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); - - NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); - - NTvmAuth::TTvmClient c(setts, log); - - return c; - } -} +#include <library/cpp/tvmauth/client/facade.h> + +namespace NExample { + // Possibility of using functions depends on config of tvmtool + // CheckServiceTicket + // CheckUserTicket + // GetServiceTicketFor + + NTvmAuth::TTvmClient CreateClientInQloudOrYandexDeploy() { + NTvmAuth::NTvmTool::TClientSettings setts( + "my_service" // specified in Qloud/YP/tvmtool interface + ); + + NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); + + NTvmAuth::TTvmClient c(setts, log); + + return c; + } + + NTvmAuth::TTvmClient CreateClientForDevOrTests() { + NTvmAuth::NTvmTool::TClientSettings setts( + "my_service" // specified in Qloud/YP/tvmtool interface + ); + setts.SetPort(18080); + setts.SetAuthToken("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); + + NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); + + NTvmAuth::TTvmClient c(setts, log); + + return c; + } +} diff --git a/library/cpp/tvmauth/client/examples/create_with_tvmtool/ya.make b/library/cpp/tvmauth/client/examples/create_with_tvmtool/ya.make index fc69a06dbd..497094e0d0 100644 --- a/library/cpp/tvmauth/client/examples/create_with_tvmtool/ya.make +++ b/library/cpp/tvmauth/client/examples/create_with_tvmtool/ya.make @@ -1,13 +1,13 @@ -LIBRARY() - -OWNER(g:passport_infra) - -PEERDIR( - library/cpp/tvmauth/client -) - -SRCS( - create.cpp -) - -END() +LIBRARY() + +OWNER(g:passport_infra) + +PEERDIR( + library/cpp/tvmauth/client +) + +SRCS( + create.cpp +) + +END() diff --git a/library/cpp/tvmauth/client/examples/service_using_tvmtool_client/service.cpp b/library/cpp/tvmauth/client/examples/service_using_tvmtool_client/service.cpp index 075bf0bded..f471f7068a 100644 --- a/library/cpp/tvmauth/client/examples/service_using_tvmtool_client/service.cpp +++ b/library/cpp/tvmauth/client/examples/service_using_tvmtool_client/service.cpp @@ -1,84 +1,84 @@ -#include "service.h" - -#include <library/cpp/tvmauth/client/facade.h> - +#include "service.h" + +#include <library/cpp/tvmauth/client/facade.h> + #include <library/cpp/cgiparam/cgiparam.h> -#include <library/cpp/http/server/response.h> -#include <library/cpp/http/simple/http_client.h> -#include <library/cpp/json/json_reader.h> - -namespace NExample { - static const TString BACK_C = "BACK_C"; - - TSomeService::TSomeService(const TConfig& cfg) - : Config_(cfg) - { - NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); - - Tvm_ = MakeHolder<NTvmAuth::TTvmClient>( - NTvmAuth::NTvmTool::TClientSettings( - "my_service" // specified in Qloud/YP/tvmtool interface - ), - log); - } - - TSomeService::~TSomeService() { - } - - void TSomeService::HandleRequest(THttpInput& in, THttpOutput& out) { - auto servIt = std::find_if(in.Headers().Begin(), - in.Headers().End(), - [](const auto& h) { return h.Name() == "X-Ya-Service-Ticket"; }); - auto userIt = std::find_if(in.Headers().Begin(), - in.Headers().End(), - [](const auto& h) { return h.Name() == "X-Ya-User-Ticket"; }); - try { - if (servIt == in.Headers().End() || userIt == in.Headers().End()) { - ythrow yexception() << "Need tickets"; - } - - // WARNING: См. Здесь - NTvmAuth::TCheckedServiceTicket st = Tvm_->CheckServiceTicket(servIt->Value()); - NTvmAuth::TCheckedUserTicket ut = Tvm_->CheckUserTicket(userIt->Value()); - if (!st || !ut) { - ythrow yexception() << "Invalid tickets"; - } - - // WARNING: См. Здесь - // Ждём ABC - после их релиза эти три строки можно будет удалить - if (Config_.AllowedTvmIds.find(st.GetSrc()) == Config_.AllowedTvmIds.end()) { - ythrow yexception() << "Consumer is not allowed"; - } - - // WARNING: См. Здесь - if (!ut.HasScope("some_service:allow_secret_data")) { - ythrow yexception() << "UserTicket does not have scopes for secret data"; - } - - // Access-log - Cout << "Data fetched for: " << ut.GetDefaultUid() << Endl; - - THttpResponse resp(HTTP_OK); - resp.SetContent(GetDataFromBackendC(userIt->Value()), "text/plain"); - resp.OutTo(out); - } catch (...) { - THttpResponse resp(HTTP_BAD_REQUEST); - resp.SetContent("Request can not be performed", "text/plain"); - resp.OutTo(out); - } - - out.Finish(); - } - - TString TSomeService::GetDataFromBackendC(const TString& userTicket) { - TSimpleHttpClient cl("my_backend", // specified in Qloud/YP/tvmtool interface - 80); - TStringStream s; - cl.DoGet("/api?", - &s, - // WARNING: См. Здесь - {{"X-Ya-Service-Ticket", Tvm_->GetServiceTicketFor(BACK_C)}, - {"X-Ya-User-Ticket", userTicket}}); - return s.Str(); - } -} +#include <library/cpp/http/server/response.h> +#include <library/cpp/http/simple/http_client.h> +#include <library/cpp/json/json_reader.h> + +namespace NExample { + static const TString BACK_C = "BACK_C"; + + TSomeService::TSomeService(const TConfig& cfg) + : Config_(cfg) + { + NTvmAuth::TLoggerPtr log = MakeIntrusive<NTvmAuth::TCerrLogger>(7); + + Tvm_ = MakeHolder<NTvmAuth::TTvmClient>( + NTvmAuth::NTvmTool::TClientSettings( + "my_service" // specified in Qloud/YP/tvmtool interface + ), + log); + } + + TSomeService::~TSomeService() { + } + + void TSomeService::HandleRequest(THttpInput& in, THttpOutput& out) { + auto servIt = std::find_if(in.Headers().Begin(), + in.Headers().End(), + [](const auto& h) { return h.Name() == "X-Ya-Service-Ticket"; }); + auto userIt = std::find_if(in.Headers().Begin(), + in.Headers().End(), + [](const auto& h) { return h.Name() == "X-Ya-User-Ticket"; }); + try { + if (servIt == in.Headers().End() || userIt == in.Headers().End()) { + ythrow yexception() << "Need tickets"; + } + + // WARNING: См. Здесь + NTvmAuth::TCheckedServiceTicket st = Tvm_->CheckServiceTicket(servIt->Value()); + NTvmAuth::TCheckedUserTicket ut = Tvm_->CheckUserTicket(userIt->Value()); + if (!st || !ut) { + ythrow yexception() << "Invalid tickets"; + } + + // WARNING: См. Здесь + // Ждём ABC - после их релиза эти три строки можно будет удалить + if (Config_.AllowedTvmIds.find(st.GetSrc()) == Config_.AllowedTvmIds.end()) { + ythrow yexception() << "Consumer is not allowed"; + } + + // WARNING: См. Здесь + if (!ut.HasScope("some_service:allow_secret_data")) { + ythrow yexception() << "UserTicket does not have scopes for secret data"; + } + + // Access-log + Cout << "Data fetched for: " << ut.GetDefaultUid() << Endl; + + THttpResponse resp(HTTP_OK); + resp.SetContent(GetDataFromBackendC(userIt->Value()), "text/plain"); + resp.OutTo(out); + } catch (...) { + THttpResponse resp(HTTP_BAD_REQUEST); + resp.SetContent("Request can not be performed", "text/plain"); + resp.OutTo(out); + } + + out.Finish(); + } + + TString TSomeService::GetDataFromBackendC(const TString& userTicket) { + TSimpleHttpClient cl("my_backend", // specified in Qloud/YP/tvmtool interface + 80); + TStringStream s; + cl.DoGet("/api?", + &s, + // WARNING: См. Здесь + {{"X-Ya-Service-Ticket", Tvm_->GetServiceTicketFor(BACK_C)}, + {"X-Ya-User-Ticket", userTicket}}); + return s.Str(); + } +} diff --git a/library/cpp/tvmauth/client/examples/service_using_tvmtool_client/service.h b/library/cpp/tvmauth/client/examples/service_using_tvmtool_client/service.h index 8ff948334e..761fd0f248 100644 --- a/library/cpp/tvmauth/client/examples/service_using_tvmtool_client/service.h +++ b/library/cpp/tvmauth/client/examples/service_using_tvmtool_client/service.h @@ -1,35 +1,35 @@ -#pragma once - -#include <library/cpp/http/io/stream.h> - -#include <util/generic/ptr.h> - -#include <unordered_set> - -namespace NTvmAuth { - class TTvmClient; -} - -namespace NExample { - struct TConfig { - using TAllowedTvmIds = std::unordered_set<ui32>; - - TAllowedTvmIds AllowedTvmIds; - }; - - class TSomeService { - public: - TSomeService(const TConfig& cfg); - ~TSomeService(); - - void HandleRequest(THttpInput& in, THttpOutput& out); - - private: - TString GetDataFromBackendC(const TString& userTicket); - - private: - // WARNING: См. Здесь - TConfig Config_; - THolder<NTvmAuth::TTvmClient> Tvm_; - }; -} +#pragma once + +#include <library/cpp/http/io/stream.h> + +#include <util/generic/ptr.h> + +#include <unordered_set> + +namespace NTvmAuth { + class TTvmClient; +} + +namespace NExample { + struct TConfig { + using TAllowedTvmIds = std::unordered_set<ui32>; + + TAllowedTvmIds AllowedTvmIds; + }; + + class TSomeService { + public: + TSomeService(const TConfig& cfg); + ~TSomeService(); + + void HandleRequest(THttpInput& in, THttpOutput& out); + + private: + TString GetDataFromBackendC(const TString& userTicket); + + private: + // WARNING: См. Здесь + TConfig Config_; + THolder<NTvmAuth::TTvmClient> Tvm_; + }; +} diff --git a/library/cpp/tvmauth/client/examples/service_using_tvmtool_client/ya.make b/library/cpp/tvmauth/client/examples/service_using_tvmtool_client/ya.make index dde9e7a00d..8d82901738 100644 --- a/library/cpp/tvmauth/client/examples/service_using_tvmtool_client/ya.make +++ b/library/cpp/tvmauth/client/examples/service_using_tvmtool_client/ya.make @@ -1,15 +1,15 @@ -LIBRARY() - -OWNER(g:passport_infra) - -PEERDIR( +LIBRARY() + +OWNER(g:passport_infra) + +PEERDIR( library/cpp/cgiparam - library/cpp/http/simple - library/cpp/tvmauth/client -) - -SRCS( - service.cpp -) - -END() + library/cpp/http/simple + library/cpp/tvmauth/client +) + +SRCS( + service.cpp +) + +END() diff --git a/library/cpp/tvmauth/client/examples/ya.make b/library/cpp/tvmauth/client/examples/ya.make index cd17e550a6..2bd58586d1 100644 --- a/library/cpp/tvmauth/client/examples/ya.make +++ b/library/cpp/tvmauth/client/examples/ya.make @@ -1,5 +1,5 @@ -RECURSE( - create_with_tvmapi - create_with_tvmtool - service_using_tvmtool_client -) +RECURSE( + create_with_tvmapi + create_with_tvmtool + service_using_tvmtool_client +) diff --git a/library/cpp/tvmauth/client/exception.h b/library/cpp/tvmauth/client/exception.h index 7639467671..aaa5827752 100644 --- a/library/cpp/tvmauth/client/exception.h +++ b/library/cpp/tvmauth/client/exception.h @@ -1,23 +1,23 @@ -#pragma once - -#include <library/cpp/tvmauth/exception.h> - -namespace NTvmAuth { - class TClientException: public TTvmException { - }; - - class TRetriableException: public TClientException { - }; - class TNonRetriableException: public TClientException { - }; - - class TIllegalUsage: public TNonRetriableException { - }; - - class TBrokenTvmClientSettings: public TIllegalUsage { - }; - class TMissingServiceTicket: public TNonRetriableException { - }; - class TPermissionDenied: public TNonRetriableException { - }; -} +#pragma once + +#include <library/cpp/tvmauth/exception.h> + +namespace NTvmAuth { + class TClientException: public TTvmException { + }; + + class TRetriableException: public TClientException { + }; + class TNonRetriableException: public TClientException { + }; + + class TIllegalUsage: public TNonRetriableException { + }; + + class TBrokenTvmClientSettings: public TIllegalUsage { + }; + class TMissingServiceTicket: public TNonRetriableException { + }; + class TPermissionDenied: public TNonRetriableException { + }; +} diff --git a/library/cpp/tvmauth/client/facade.cpp b/library/cpp/tvmauth/client/facade.cpp index 6e77569441..786bab493c 100644 --- a/library/cpp/tvmauth/client/facade.cpp +++ b/library/cpp/tvmauth/client/facade.cpp @@ -1,131 +1,131 @@ -#include "facade.h" - -#include "misc/checker.h" -#include "misc/default_uid_checker.h" -#include "misc/getter.h" -#include "misc/src_checker.h" -#include "misc/api/threaded_updater.h" -#include "misc/tool/threaded_updater.h" - -namespace NTvmAuth { - TTvmClient::TTvmClient(const NTvmTool::TClientSettings& settings, TLoggerPtr logger) - : Updater_(NTvmTool::TThreadedUpdater::Create(settings, std::move(logger))) - , Service_(MakeHolder<TServiceTicketChecker>(Updater_)) - , User_(MakeHolder<TUserTicketChecker>(Updater_)) - { - if (Updater_->GetCachedServiceTickets()) { - Tickets_ = MakeHolder<TServiceTicketGetter>(Updater_); - } - } - - TTvmClient::TTvmClient(const NTvmApi::TClientSettings& settings, TLoggerPtr logger) - : Updater_(NTvmApi::TThreadedUpdater::Create(settings, std::move(logger))) - { - if (settings.IsServiceTicketFetchingRequired()) { - Tickets_ = MakeHolder<TServiceTicketGetter>(Updater_); - } - if (settings.IsServiceTicketCheckingRequired()) { - Service_ = MakeHolder<TServiceTicketChecker>(Updater_); - } - if (settings.IsUserTicketCheckingRequired()) { - User_ = MakeHolder<TUserTicketChecker>(Updater_); - } - if (settings.IsRolesFetchingEnabled() && settings.ShouldCheckSrc) { - SrcChecker_ = MakeHolder<TSrcChecker>(Updater_); - } - if (settings.IsRolesFetchingEnabled() && settings.ShouldCheckDefaultUid) { - DefaultUidChecker_ = MakeHolder<TDefaultUidChecker>(Updater_); - } - } - - TTvmClient::TTvmClient(TAsyncUpdaterPtr updater) - : Updater_(std::move(updater)) - { - if (Updater_->GetCachedServiceTickets()) { - Tickets_ = MakeHolder<TServiceTicketGetter>(Updater_); - } - if (Updater_->GetCachedServiceContext()) { - Service_ = MakeHolder<TServiceTicketChecker>(Updater_); - } - if (Updater_->GetCachedUserContext()) { - User_ = MakeHolder<TUserTicketChecker>(Updater_); - } - - try { - if (Updater_->GetRoles()) { - SrcChecker_ = MakeHolder<TSrcChecker>(Updater_); - DefaultUidChecker_ = MakeHolder<TDefaultUidChecker>(Updater_); - } - } catch (const TIllegalUsage&) { - // it is a test probably - } - } - - TTvmClient::TTvmClient(TTvmClient&& o) = default; - TTvmClient::~TTvmClient() = default; - TTvmClient& TTvmClient::operator=(TTvmClient&& o) = default; - - TClientStatus TTvmClient::GetStatus() const { - Y_ENSURE(Updater_); - return Updater_->GetStatus(); - } - - TInstant TTvmClient::GetUpdateTimeOfPublicKeys() const { - Y_ENSURE(Updater_); - return Updater_->GetUpdateTimeOfPublicKeys(); - } - - TInstant TTvmClient::GetUpdateTimeOfServiceTickets() const { - Y_ENSURE(Updater_); - return Updater_->GetUpdateTimeOfServiceTickets(); - } - - TInstant TTvmClient::GetInvalidationTimeOfPublicKeys() const { - Y_ENSURE(Updater_); - return Updater_->GetInvalidationTimeOfPublicKeys(); - } - - TInstant TTvmClient::GetInvalidationTimeOfServiceTickets() const { - Y_ENSURE(Updater_); - return Updater_->GetInvalidationTimeOfServiceTickets(); - } - - TString TTvmClient::GetServiceTicketFor(const TClientSettings::TAlias& dst) const { - Y_ENSURE_EX(Tickets_, TBrokenTvmClientSettings() - << "Need to enable ServiceTickets fetching"); - return Tickets_->GetTicket(dst); - } - - TString TTvmClient::GetServiceTicketFor(const TTvmId dst) const { - Y_ENSURE_EX(Tickets_, TBrokenTvmClientSettings() - << "Need to enable ServiceTickets fetching"); - return Tickets_->GetTicket(dst); - } - - TCheckedServiceTicket TTvmClient::CheckServiceTicket(TStringBuf ticket) const { - Y_ENSURE_EX(Service_, TBrokenTvmClientSettings() - << "Need to use TClientSettings::EnableServiceTicketChecking()"); - - TCheckedServiceTicket res = Service_->Check(ticket); - if (SrcChecker_ && res) { - return SrcChecker_->Check(std::move(res)); - } - return res; - } - - TCheckedUserTicket TTvmClient::CheckUserTicket(TStringBuf ticket, TMaybe<EBlackboxEnv> overrideEnv) const { - Y_ENSURE_EX(User_, TBrokenTvmClientSettings() - << "Need to use TClientSettings::EnableUserTicketChecking()"); - - TCheckedUserTicket res = User_->Check(ticket, overrideEnv); - if (DefaultUidChecker_ && res) { - return DefaultUidChecker_->Check(std::move(res)); - } - return User_->Check(ticket, overrideEnv); - } - - NRoles::TRolesPtr TTvmClient::GetRoles() const { - Y_ENSURE(Updater_); - return Updater_->GetRoles(); - } -} +#include "facade.h" + +#include "misc/checker.h" +#include "misc/default_uid_checker.h" +#include "misc/getter.h" +#include "misc/src_checker.h" +#include "misc/api/threaded_updater.h" +#include "misc/tool/threaded_updater.h" + +namespace NTvmAuth { + TTvmClient::TTvmClient(const NTvmTool::TClientSettings& settings, TLoggerPtr logger) + : Updater_(NTvmTool::TThreadedUpdater::Create(settings, std::move(logger))) + , Service_(MakeHolder<TServiceTicketChecker>(Updater_)) + , User_(MakeHolder<TUserTicketChecker>(Updater_)) + { + if (Updater_->GetCachedServiceTickets()) { + Tickets_ = MakeHolder<TServiceTicketGetter>(Updater_); + } + } + + TTvmClient::TTvmClient(const NTvmApi::TClientSettings& settings, TLoggerPtr logger) + : Updater_(NTvmApi::TThreadedUpdater::Create(settings, std::move(logger))) + { + if (settings.IsServiceTicketFetchingRequired()) { + Tickets_ = MakeHolder<TServiceTicketGetter>(Updater_); + } + if (settings.IsServiceTicketCheckingRequired()) { + Service_ = MakeHolder<TServiceTicketChecker>(Updater_); + } + if (settings.IsUserTicketCheckingRequired()) { + User_ = MakeHolder<TUserTicketChecker>(Updater_); + } + if (settings.IsRolesFetchingEnabled() && settings.ShouldCheckSrc) { + SrcChecker_ = MakeHolder<TSrcChecker>(Updater_); + } + if (settings.IsRolesFetchingEnabled() && settings.ShouldCheckDefaultUid) { + DefaultUidChecker_ = MakeHolder<TDefaultUidChecker>(Updater_); + } + } + + TTvmClient::TTvmClient(TAsyncUpdaterPtr updater) + : Updater_(std::move(updater)) + { + if (Updater_->GetCachedServiceTickets()) { + Tickets_ = MakeHolder<TServiceTicketGetter>(Updater_); + } + if (Updater_->GetCachedServiceContext()) { + Service_ = MakeHolder<TServiceTicketChecker>(Updater_); + } + if (Updater_->GetCachedUserContext()) { + User_ = MakeHolder<TUserTicketChecker>(Updater_); + } + + try { + if (Updater_->GetRoles()) { + SrcChecker_ = MakeHolder<TSrcChecker>(Updater_); + DefaultUidChecker_ = MakeHolder<TDefaultUidChecker>(Updater_); + } + } catch (const TIllegalUsage&) { + // it is a test probably + } + } + + TTvmClient::TTvmClient(TTvmClient&& o) = default; + TTvmClient::~TTvmClient() = default; + TTvmClient& TTvmClient::operator=(TTvmClient&& o) = default; + + TClientStatus TTvmClient::GetStatus() const { + Y_ENSURE(Updater_); + return Updater_->GetStatus(); + } + + TInstant TTvmClient::GetUpdateTimeOfPublicKeys() const { + Y_ENSURE(Updater_); + return Updater_->GetUpdateTimeOfPublicKeys(); + } + + TInstant TTvmClient::GetUpdateTimeOfServiceTickets() const { + Y_ENSURE(Updater_); + return Updater_->GetUpdateTimeOfServiceTickets(); + } + + TInstant TTvmClient::GetInvalidationTimeOfPublicKeys() const { + Y_ENSURE(Updater_); + return Updater_->GetInvalidationTimeOfPublicKeys(); + } + + TInstant TTvmClient::GetInvalidationTimeOfServiceTickets() const { + Y_ENSURE(Updater_); + return Updater_->GetInvalidationTimeOfServiceTickets(); + } + + TString TTvmClient::GetServiceTicketFor(const TClientSettings::TAlias& dst) const { + Y_ENSURE_EX(Tickets_, TBrokenTvmClientSettings() + << "Need to enable ServiceTickets fetching"); + return Tickets_->GetTicket(dst); + } + + TString TTvmClient::GetServiceTicketFor(const TTvmId dst) const { + Y_ENSURE_EX(Tickets_, TBrokenTvmClientSettings() + << "Need to enable ServiceTickets fetching"); + return Tickets_->GetTicket(dst); + } + + TCheckedServiceTicket TTvmClient::CheckServiceTicket(TStringBuf ticket) const { + Y_ENSURE_EX(Service_, TBrokenTvmClientSettings() + << "Need to use TClientSettings::EnableServiceTicketChecking()"); + + TCheckedServiceTicket res = Service_->Check(ticket); + if (SrcChecker_ && res) { + return SrcChecker_->Check(std::move(res)); + } + return res; + } + + TCheckedUserTicket TTvmClient::CheckUserTicket(TStringBuf ticket, TMaybe<EBlackboxEnv> overrideEnv) const { + Y_ENSURE_EX(User_, TBrokenTvmClientSettings() + << "Need to use TClientSettings::EnableUserTicketChecking()"); + + TCheckedUserTicket res = User_->Check(ticket, overrideEnv); + if (DefaultUidChecker_ && res) { + return DefaultUidChecker_->Check(std::move(res)); + } + return User_->Check(ticket, overrideEnv); + } + + NRoles::TRolesPtr TTvmClient::GetRoles() const { + Y_ENSURE(Updater_); + return Updater_->GetRoles(); + } +} diff --git a/library/cpp/tvmauth/client/facade.h b/library/cpp/tvmauth/client/facade.h index 34d4b11a00..be606d4953 100644 --- a/library/cpp/tvmauth/client/facade.h +++ b/library/cpp/tvmauth/client/facade.h @@ -1,119 +1,119 @@ -#pragma once - -#include "misc/async_updater.h" -#include "misc/api/settings.h" -#include "misc/tool/settings.h" - -#include <library/cpp/tvmauth/checked_service_ticket.h> -#include <library/cpp/tvmauth/checked_user_ticket.h> - -namespace NTvmAuth::NInternal { - class TClientCaningKnife; -} - -namespace NTvmAuth { - class TDefaultUidChecker; - class TServiceTicketGetter; - class TServiceTicketChecker; - class TSrcChecker; - class TUserTicketChecker; - - /*! - * Long lived thread-safe object for interacting with TVM. - * In 99% cases TvmClient shoud be created at service startup and live for the whole process lifetime. - */ - class TTvmClient { - public: - /*! - * Uses local http-interface to get state: http://localhost/tvm/. - * This interface can be provided with tvmtool (local daemon) or Qloud/YP (local http api in container). - * See more: https://wiki.yandex-team.ru/passport/tvm2/tvm-daemon/. - * - * Starts thread for updating of in-memory cache in background - * @param settings - * @param logger is usefull for monitoring and debuging - */ - TTvmClient(const NTvmTool::TClientSettings& settings, TLoggerPtr logger); - - /*! - * Uses general way to get state: https://tvm-api.yandex.net. - * It is not recomended for Qloud/YP. - * - * Starts thread for updating of in-memory cache in background - * Reads cache from disk if specified - * @param settings - * @param logger is usefull for monitoring and debuging - */ - TTvmClient(const NTvmApi::TClientSettings& settings, TLoggerPtr logger); - - /*! - * Feel free to use custom updating logic in tests - */ - TTvmClient(TAsyncUpdaterPtr updater); - - TTvmClient(TTvmClient&&); - ~TTvmClient(); - TTvmClient& operator=(TTvmClient&&); - - /*! - * You should trigger your monitoring if status is not Ok. - * It will be unable to operate if status is Error. - * Description: https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/tvmauth/client/README.md#high-level-interface - * @return Current status of client. - */ - TClientStatus GetStatus() const; - - /*! - * Some tools for monitoring - */ - - TInstant GetUpdateTimeOfPublicKeys() const; - TInstant GetUpdateTimeOfServiceTickets() const; - TInstant GetInvalidationTimeOfPublicKeys() const; - TInstant GetInvalidationTimeOfServiceTickets() const; - - /*! - * Requires fetchinig options (from TClientSettings or Qloud/YP/tvmtool settings) - * Can throw exception if cache is invalid or wrong config - * - * Alias is local label for TvmID - * which can be used to avoid this number in every checking case in code. - * @param dst - */ - TString GetServiceTicketFor(const TClientSettings::TAlias& dst) const; - TString GetServiceTicketFor(const TTvmId dst) const; - - /*! - * For TTvmApi::TClientSettings: checking must be enabled in TClientSettings - * Can throw exception if checking was not enabled in settings - * - * ServiceTicket contains src: you should check it by yourself with ACL - * @param ticket - */ - TCheckedServiceTicket CheckServiceTicket(TStringBuf ticket) const; - - /*! - * Requires blackbox enviroment (from TClientSettings or Qloud/YP/tvmtool settings) - * Can throw exception if checking was not enabled in settings - * @param ticket - * @param overrideEnv allowes you to override env from settings - */ - TCheckedUserTicket CheckUserTicket(TStringBuf ticket, TMaybe<EBlackboxEnv> overrideEnv = {}) const; - - /*! - * Under construction now. It is unusable. - * PASSP-30283 - */ - NRoles::TRolesPtr GetRoles() const; - - private: - TAsyncUpdaterPtr Updater_; - THolder<TServiceTicketGetter> Tickets_; - THolder<TServiceTicketChecker> Service_; - THolder<TUserTicketChecker> User_; - THolder<TSrcChecker> SrcChecker_; - THolder<TDefaultUidChecker> DefaultUidChecker_; - - friend class NInternal::TClientCaningKnife; - }; -} +#pragma once + +#include "misc/async_updater.h" +#include "misc/api/settings.h" +#include "misc/tool/settings.h" + +#include <library/cpp/tvmauth/checked_service_ticket.h> +#include <library/cpp/tvmauth/checked_user_ticket.h> + +namespace NTvmAuth::NInternal { + class TClientCaningKnife; +} + +namespace NTvmAuth { + class TDefaultUidChecker; + class TServiceTicketGetter; + class TServiceTicketChecker; + class TSrcChecker; + class TUserTicketChecker; + + /*! + * Long lived thread-safe object for interacting with TVM. + * In 99% cases TvmClient shoud be created at service startup and live for the whole process lifetime. + */ + class TTvmClient { + public: + /*! + * Uses local http-interface to get state: http://localhost/tvm/. + * This interface can be provided with tvmtool (local daemon) or Qloud/YP (local http api in container). + * See more: https://wiki.yandex-team.ru/passport/tvm2/tvm-daemon/. + * + * Starts thread for updating of in-memory cache in background + * @param settings + * @param logger is usefull for monitoring and debuging + */ + TTvmClient(const NTvmTool::TClientSettings& settings, TLoggerPtr logger); + + /*! + * Uses general way to get state: https://tvm-api.yandex.net. + * It is not recomended for Qloud/YP. + * + * Starts thread for updating of in-memory cache in background + * Reads cache from disk if specified + * @param settings + * @param logger is usefull for monitoring and debuging + */ + TTvmClient(const NTvmApi::TClientSettings& settings, TLoggerPtr logger); + + /*! + * Feel free to use custom updating logic in tests + */ + TTvmClient(TAsyncUpdaterPtr updater); + + TTvmClient(TTvmClient&&); + ~TTvmClient(); + TTvmClient& operator=(TTvmClient&&); + + /*! + * You should trigger your monitoring if status is not Ok. + * It will be unable to operate if status is Error. + * Description: https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/tvmauth/client/README.md#high-level-interface + * @return Current status of client. + */ + TClientStatus GetStatus() const; + + /*! + * Some tools for monitoring + */ + + TInstant GetUpdateTimeOfPublicKeys() const; + TInstant GetUpdateTimeOfServiceTickets() const; + TInstant GetInvalidationTimeOfPublicKeys() const; + TInstant GetInvalidationTimeOfServiceTickets() const; + + /*! + * Requires fetchinig options (from TClientSettings or Qloud/YP/tvmtool settings) + * Can throw exception if cache is invalid or wrong config + * + * Alias is local label for TvmID + * which can be used to avoid this number in every checking case in code. + * @param dst + */ + TString GetServiceTicketFor(const TClientSettings::TAlias& dst) const; + TString GetServiceTicketFor(const TTvmId dst) const; + + /*! + * For TTvmApi::TClientSettings: checking must be enabled in TClientSettings + * Can throw exception if checking was not enabled in settings + * + * ServiceTicket contains src: you should check it by yourself with ACL + * @param ticket + */ + TCheckedServiceTicket CheckServiceTicket(TStringBuf ticket) const; + + /*! + * Requires blackbox enviroment (from TClientSettings or Qloud/YP/tvmtool settings) + * Can throw exception if checking was not enabled in settings + * @param ticket + * @param overrideEnv allowes you to override env from settings + */ + TCheckedUserTicket CheckUserTicket(TStringBuf ticket, TMaybe<EBlackboxEnv> overrideEnv = {}) const; + + /*! + * Under construction now. It is unusable. + * PASSP-30283 + */ + NRoles::TRolesPtr GetRoles() const; + + private: + TAsyncUpdaterPtr Updater_; + THolder<TServiceTicketGetter> Tickets_; + THolder<TServiceTicketChecker> Service_; + THolder<TUserTicketChecker> User_; + THolder<TSrcChecker> SrcChecker_; + THolder<TDefaultUidChecker> DefaultUidChecker_; + + friend class NInternal::TClientCaningKnife; + }; +} diff --git a/library/cpp/tvmauth/client/logger.cpp b/library/cpp/tvmauth/client/logger.cpp index bd63773cdf..007f696433 100644 --- a/library/cpp/tvmauth/client/logger.cpp +++ b/library/cpp/tvmauth/client/logger.cpp @@ -1,12 +1,12 @@ -#include "logger.h" - -#include <util/datetime/base.h> -#include <util/generic/string.h> - -namespace NTvmAuth { - void TCerrLogger::Log(int lvl, const TString& msg) { - if (lvl > Level_) - return; - Cerr << TInstant::Now().ToStringLocal() << " lvl=" << lvl << " msg: " << msg << "\n"; - } -} +#include "logger.h" + +#include <util/datetime/base.h> +#include <util/generic/string.h> + +namespace NTvmAuth { + void TCerrLogger::Log(int lvl, const TString& msg) { + if (lvl > Level_) + return; + Cerr << TInstant::Now().ToStringLocal() << " lvl=" << lvl << " msg: " << msg << "\n"; + } +} diff --git a/library/cpp/tvmauth/client/logger.h b/library/cpp/tvmauth/client/logger.h index 6f3718a2aa..5d095d6b19 100644 --- a/library/cpp/tvmauth/client/logger.h +++ b/library/cpp/tvmauth/client/logger.h @@ -1,59 +1,59 @@ -#pragma once - -#include <util/generic/ptr.h> - -namespace NTvmAuth { - class ILogger: public TAtomicRefCount<ILogger> { - public: - virtual ~ILogger() = default; - - void Debug(const TString& msg) { - Log(7, msg); - } - - void Info(const TString& msg) { - Log(6, msg); - } - - void Warning(const TString& msg) { - Log(4, msg); - } - - void Error(const TString& msg) { - Log(3, msg); - } - - protected: - /*! - * Log event - * @param lvl is syslog level: 0(Emergency) ... 7(Debug) - * @param msg - */ - virtual void Log(int lvl, const TString& msg) = 0; - }; - - class TCerrLogger: public ILogger { - public: - TCerrLogger(int level) - : Level_(level) - { - } - - void Log(int lvl, const TString& msg) override; - - private: - const int Level_; - }; - - using TLoggerPtr = TIntrusivePtr<ILogger>; - - class TDevNullLogger: public ILogger { - public: - static TLoggerPtr IAmBrave() { - return MakeIntrusive<TDevNullLogger>(); - } - - void Log(int, const TString&) override { - } - }; -} +#pragma once + +#include <util/generic/ptr.h> + +namespace NTvmAuth { + class ILogger: public TAtomicRefCount<ILogger> { + public: + virtual ~ILogger() = default; + + void Debug(const TString& msg) { + Log(7, msg); + } + + void Info(const TString& msg) { + Log(6, msg); + } + + void Warning(const TString& msg) { + Log(4, msg); + } + + void Error(const TString& msg) { + Log(3, msg); + } + + protected: + /*! + * Log event + * @param lvl is syslog level: 0(Emergency) ... 7(Debug) + * @param msg + */ + virtual void Log(int lvl, const TString& msg) = 0; + }; + + class TCerrLogger: public ILogger { + public: + TCerrLogger(int level) + : Level_(level) + { + } + + void Log(int lvl, const TString& msg) override; + + private: + const int Level_; + }; + + using TLoggerPtr = TIntrusivePtr<ILogger>; + + class TDevNullLogger: public ILogger { + public: + static TLoggerPtr IAmBrave() { + return MakeIntrusive<TDevNullLogger>(); + } + + void Log(int, const TString&) override { + } + }; +} diff --git a/library/cpp/tvmauth/client/misc/api/dynamic_dst/tvm_client.cpp b/library/cpp/tvmauth/client/misc/api/dynamic_dst/tvm_client.cpp index 6ec15c0e88..dee9b05d1f 100644 --- a/library/cpp/tvmauth/client/misc/api/dynamic_dst/tvm_client.cpp +++ b/library/cpp/tvmauth/client/misc/api/dynamic_dst/tvm_client.cpp @@ -1,126 +1,126 @@ -#include "tvm_client.h" - -#include <util/string/builder.h> - -namespace NTvmAuth::NDynamicClient { - TAsyncUpdaterPtr TTvmClient::Create(const NTvmApi::TClientSettings& settings, TLoggerPtr logger) { - Y_ENSURE_EX(logger, TNonRetriableException() << "Logger is required"); - THolder<TTvmClient> p(new TTvmClient(settings, std::move(logger))); - p->Init(); - p->StartWorker(); - return p.Release(); - } - - NThreading::TFuture<TAddResponse> TTvmClient::Add(TDsts&& dsts) { - if (dsts.empty()) { - LogDebug("Adding dst: got empty task"); - return NThreading::MakeFuture<TAddResponse>(TAddResponse{}); - } - - const size_t size = dsts.size(); - const ui64 id = ++TaskIds_; - NThreading::TPromise<TAddResponse> promise = NThreading::NewPromise<TAddResponse>(); - - TaskQueue_.Enqueue(TTask{id, promise, std::move(dsts)}); - - LogDebug(TStringBuilder() << "Adding dst: got task #" << id << " with " << size << " dsts"); - return promise.GetFuture(); - } - - std::optional<TString> TTvmClient::GetOptionalServiceTicketFor(const TTvmId dst) { - TServiceTicketsPtr tickets = GetCachedServiceTickets(); - Y_ENSURE_EX(tickets, - TBrokenTvmClientSettings() - << "Need to enable fetching of service tickets in settings"); - - auto it = tickets->TicketsById.find(dst); - if (it != tickets->TicketsById.end()) { - return it->second; - } - - it = tickets->ErrorsById.find(dst); - if (it != tickets->ErrorsById.end()) { - ythrow TMissingServiceTicket() - << "Failed to get ticket for '" << dst << "': " - << it->second; - } - - return {}; - } - - TTvmClient::TTvmClient(const NTvmApi::TClientSettings& settings, TLoggerPtr logger) - : TBase(settings, logger) - { - } - +#include "tvm_client.h" + +#include <util/string/builder.h> + +namespace NTvmAuth::NDynamicClient { + TAsyncUpdaterPtr TTvmClient::Create(const NTvmApi::TClientSettings& settings, TLoggerPtr logger) { + Y_ENSURE_EX(logger, TNonRetriableException() << "Logger is required"); + THolder<TTvmClient> p(new TTvmClient(settings, std::move(logger))); + p->Init(); + p->StartWorker(); + return p.Release(); + } + + NThreading::TFuture<TAddResponse> TTvmClient::Add(TDsts&& dsts) { + if (dsts.empty()) { + LogDebug("Adding dst: got empty task"); + return NThreading::MakeFuture<TAddResponse>(TAddResponse{}); + } + + const size_t size = dsts.size(); + const ui64 id = ++TaskIds_; + NThreading::TPromise<TAddResponse> promise = NThreading::NewPromise<TAddResponse>(); + + TaskQueue_.Enqueue(TTask{id, promise, std::move(dsts)}); + + LogDebug(TStringBuilder() << "Adding dst: got task #" << id << " with " << size << " dsts"); + return promise.GetFuture(); + } + + std::optional<TString> TTvmClient::GetOptionalServiceTicketFor(const TTvmId dst) { + TServiceTicketsPtr tickets = GetCachedServiceTickets(); + Y_ENSURE_EX(tickets, + TBrokenTvmClientSettings() + << "Need to enable fetching of service tickets in settings"); + + auto it = tickets->TicketsById.find(dst); + if (it != tickets->TicketsById.end()) { + return it->second; + } + + it = tickets->ErrorsById.find(dst); + if (it != tickets->ErrorsById.end()) { + ythrow TMissingServiceTicket() + << "Failed to get ticket for '" << dst << "': " + << it->second; + } + + return {}; + } + + TTvmClient::TTvmClient(const NTvmApi::TClientSettings& settings, TLoggerPtr logger) + : TBase(settings, logger) + { + } + TTvmClient::~TTvmClient() { TBase::StopWorker(); } - void TTvmClient::Worker() { - TBase::Worker(); - ProcessTasks(); - } - - void TTvmClient::ProcessTasks() { - TaskQueue_.DequeueAll(&Tasks_); - if (Tasks_.empty()) { - return; - } - - TDsts required; - for (const TTask& task : Tasks_) { - for (const auto& dst : task.Dsts) { - required.insert(dst); - } - } - - TServiceTicketsPtr cache = UpdateMissingServiceTickets(required); - - for (TTask& task : Tasks_) { - try { - SetResponseForTask(task, *cache); - } catch (const std::exception& e) { - LogError(TStringBuilder() - << "Adding dst: task #" << task.Id << ": exception: " << e.what()); - } catch (...) { - LogError(TStringBuilder() - << "Adding dst: task #" << task.Id << ": exception: " << CurrentExceptionMessage()); - } - } - - Tasks_.clear(); - } - - static const TString UNKNOWN = "Unknown reason"; - void TTvmClient::SetResponseForTask(TTvmClient::TTask& task, const TServiceTickets& cache) { - if (task.Promise.HasValue()) { - LogWarning(TStringBuilder() << "Adding dst: task #" << task.Id << " already has value"); - return; - } - - TAddResponse response; - - for (const auto& dst : task.Dsts) { - if (cache.TicketsById.contains(dst.Id)) { - AddDstToSettings(dst); - response.emplace(dst, TDstResponse{EDstStatus::Success, TString()}); - - LogDebug(TStringBuilder() << "Adding dst: task #" << task.Id - << ": dst=" << dst.Id << " got ticket"); - continue; - } - - auto it = cache.ErrorsById.find(dst.Id); - const TString& error = it == cache.ErrorsById.end() ? UNKNOWN : it->second; - response.emplace(dst, TDstResponse{EDstStatus::Fail, error}); - - LogWarning(TStringBuilder() << "Adding dst: task #" << task.Id - << ": dst=" << dst.Id - << " failed to get ticket: " << error); - } - - LogDebug(TStringBuilder() << "Adding dst: task #" << task.Id << ": set value"); - task.Promise.SetValue(std::move(response)); - } -} + void TTvmClient::Worker() { + TBase::Worker(); + ProcessTasks(); + } + + void TTvmClient::ProcessTasks() { + TaskQueue_.DequeueAll(&Tasks_); + if (Tasks_.empty()) { + return; + } + + TDsts required; + for (const TTask& task : Tasks_) { + for (const auto& dst : task.Dsts) { + required.insert(dst); + } + } + + TServiceTicketsPtr cache = UpdateMissingServiceTickets(required); + + for (TTask& task : Tasks_) { + try { + SetResponseForTask(task, *cache); + } catch (const std::exception& e) { + LogError(TStringBuilder() + << "Adding dst: task #" << task.Id << ": exception: " << e.what()); + } catch (...) { + LogError(TStringBuilder() + << "Adding dst: task #" << task.Id << ": exception: " << CurrentExceptionMessage()); + } + } + + Tasks_.clear(); + } + + static const TString UNKNOWN = "Unknown reason"; + void TTvmClient::SetResponseForTask(TTvmClient::TTask& task, const TServiceTickets& cache) { + if (task.Promise.HasValue()) { + LogWarning(TStringBuilder() << "Adding dst: task #" << task.Id << " already has value"); + return; + } + + TAddResponse response; + + for (const auto& dst : task.Dsts) { + if (cache.TicketsById.contains(dst.Id)) { + AddDstToSettings(dst); + response.emplace(dst, TDstResponse{EDstStatus::Success, TString()}); + + LogDebug(TStringBuilder() << "Adding dst: task #" << task.Id + << ": dst=" << dst.Id << " got ticket"); + continue; + } + + auto it = cache.ErrorsById.find(dst.Id); + const TString& error = it == cache.ErrorsById.end() ? UNKNOWN : it->second; + response.emplace(dst, TDstResponse{EDstStatus::Fail, error}); + + LogWarning(TStringBuilder() << "Adding dst: task #" << task.Id + << ": dst=" << dst.Id + << " failed to get ticket: " << error); + } + + LogDebug(TStringBuilder() << "Adding dst: task #" << task.Id << ": set value"); + task.Promise.SetValue(std::move(response)); + } +} diff --git a/library/cpp/tvmauth/client/misc/api/dynamic_dst/tvm_client.h b/library/cpp/tvmauth/client/misc/api/dynamic_dst/tvm_client.h index 58ed953b63..a3aed7210a 100644 --- a/library/cpp/tvmauth/client/misc/api/dynamic_dst/tvm_client.h +++ b/library/cpp/tvmauth/client/misc/api/dynamic_dst/tvm_client.h @@ -1,60 +1,60 @@ -#pragma once - -#include <library/cpp/tvmauth/client/misc/api/threaded_updater.h> - +#pragma once + +#include <library/cpp/tvmauth/client/misc/api/threaded_updater.h> + #include <library/cpp/threading/future/future.h> - -#include <util/generic/map.h> -#include <util/thread/lfqueue.h> - -#include <optional> - -namespace NTvmAuth::NDynamicClient { - enum class EDstStatus { - Success, - Fail, - }; - - struct TDstResponse { - EDstStatus Status = EDstStatus::Fail; - TString Error; - - bool operator==(const TDstResponse& o) const { - return Status == o.Status && Error == o.Error; - } - }; - - using TDsts = NTvmApi::TDstSet; - using TAddResponse = TMap<NTvmApi::TClientSettings::TDst, TDstResponse>; - - class TTvmClient: public NTvmApi::TThreadedUpdater { - public: - static TAsyncUpdaterPtr Create(const NTvmApi::TClientSettings& settings, TLoggerPtr logger); + +#include <util/generic/map.h> +#include <util/thread/lfqueue.h> + +#include <optional> + +namespace NTvmAuth::NDynamicClient { + enum class EDstStatus { + Success, + Fail, + }; + + struct TDstResponse { + EDstStatus Status = EDstStatus::Fail; + TString Error; + + bool operator==(const TDstResponse& o) const { + return Status == o.Status && Error == o.Error; + } + }; + + using TDsts = NTvmApi::TDstSet; + using TAddResponse = TMap<NTvmApi::TClientSettings::TDst, TDstResponse>; + + class TTvmClient: public NTvmApi::TThreadedUpdater { + public: + static TAsyncUpdaterPtr Create(const NTvmApi::TClientSettings& settings, TLoggerPtr logger); virtual ~TTvmClient(); - - NThreading::TFuture<TAddResponse> Add(TDsts&& dsts); - std::optional<TString> GetOptionalServiceTicketFor(const TTvmId dst); - - protected: // for tests - struct TTask { - ui64 Id = 0; - NThreading::TPromise<TAddResponse> Promise; - TDsts Dsts; - }; - - using TBase = NTvmApi::TThreadedUpdater; - - protected: // for tests - TTvmClient(const NTvmApi::TClientSettings& settings, TLoggerPtr logger); - - void Worker() override; - void ProcessTasks(); - - void SetResponseForTask(TTask& task, const TServiceTickets& cache); - - private: - std::atomic<ui64> TaskIds_ = {0}; - TLockFreeQueue<TTask> TaskQueue_; - TVector<TTask> Tasks_; - }; -} + + NThreading::TFuture<TAddResponse> Add(TDsts&& dsts); + std::optional<TString> GetOptionalServiceTicketFor(const TTvmId dst); + + protected: // for tests + struct TTask { + ui64 Id = 0; + NThreading::TPromise<TAddResponse> Promise; + TDsts Dsts; + }; + + using TBase = NTvmApi::TThreadedUpdater; + + protected: // for tests + TTvmClient(const NTvmApi::TClientSettings& settings, TLoggerPtr logger); + + void Worker() override; + void ProcessTasks(); + + void SetResponseForTask(TTask& task, const TServiceTickets& cache); + + private: + std::atomic<ui64> TaskIds_ = {0}; + TLockFreeQueue<TTask> TaskQueue_; + TVector<TTask> Tasks_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/api/dynamic_dst/ut/tvm_client_ut.cpp b/library/cpp/tvmauth/client/misc/api/dynamic_dst/ut/tvm_client_ut.cpp index 89403c15e4..e0b4562a31 100644 --- a/library/cpp/tvmauth/client/misc/api/dynamic_dst/ut/tvm_client_ut.cpp +++ b/library/cpp/tvmauth/client/misc/api/dynamic_dst/ut/tvm_client_ut.cpp @@ -1,119 +1,119 @@ -#include <library/cpp/tvmauth/client/misc/api/dynamic_dst/tvm_client.h> - -#include <library/cpp/tvmauth/client/misc/disk_cache.h> - -#include <library/cpp/tvmauth/unittest.h> - +#include <library/cpp/tvmauth/client/misc/api/dynamic_dst/tvm_client.h> + +#include <library/cpp/tvmauth/client/misc/disk_cache.h> + +#include <library/cpp/tvmauth/unittest.h> + #include <library/cpp/testing/unittest/registar.h> - -#include <util/stream/file.h> -#include <util/system/fs.h> - -#include <regex> - -using namespace NTvmAuth; -using namespace NTvmAuth::NDynamicClient; - -Y_UNIT_TEST_SUITE(DynamicClient) { - static const std::regex TIME_REGEX(R"(\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d.\d{6}Z)"); - static const TString CACHE_DIR = "./tmp/"; - - static void WriteFile(TString name, TStringBuf body, TInstant time) { - NFs::Remove(CACHE_DIR + name); - TFileOutput f(CACHE_DIR + name); - f << TDiskWriter::PrepareData(time, body); - } - - static void CleanCache() { - NFs::RemoveRecursive(CACHE_DIR); - NFs::MakeDirectoryRecursive(CACHE_DIR); - } - - class TLogger: public NTvmAuth::ILogger { - public: - void Log(int lvl, const TString& msg) override { - Cout << TInstant::Now() << " lvl=" << lvl << " msg: " << msg << "\n"; - Stream << lvl << ": " << msg << Endl; - } - - TStringStream Stream; - }; - - class TOfflineUpdater: public NDynamicClient::TTvmClient { - public: - TOfflineUpdater(const NTvmApi::TClientSettings& settings, - TIntrusivePtr<TLogger> l, - bool fail = true, - std::vector<TString> tickets = {}) - : TTvmClient(settings, l) - , Fail(fail) - , Tickets(std::move(tickets)) - { - Init(); - ExpBackoff_.SetEnabled(false); - } - - NUtils::TFetchResult FetchServiceTicketsFromHttp(const TString& req) const override { - if (Fail) { - throw yexception() << "tickets: alarm"; - } - - TString response; - if (!Tickets.empty()) { - response = Tickets.front(); - Tickets.erase(Tickets.begin()); - } - - Cout << "*** FetchServiceTicketsFromHttp. request: " << req << ". response: " << response << Endl; - return {200, {}, "/2/ticket", response, ""}; - } - - NUtils::TFetchResult FetchPublicKeysFromHttp() const override { - if (Fail) { - throw yexception() << "keysalarm"; - } - Cout << "*** FetchPublicKeysFromHttp" << Endl; - return {200, {}, "/2/keys", PublicKeys, ""}; - } - - using TTvmClient::GetDsts; - using TTvmClient::ProcessTasks; - using TTvmClient::SetResponseForTask; - using TTvmClient::Worker; - - bool Fail = true; - TString PublicKeys = NUnittest::TVMKNIFE_PUBLIC_KEYS; - mutable std::vector<TString> Tickets; - }; - + +#include <util/stream/file.h> +#include <util/system/fs.h> + +#include <regex> + +using namespace NTvmAuth; +using namespace NTvmAuth::NDynamicClient; + +Y_UNIT_TEST_SUITE(DynamicClient) { + static const std::regex TIME_REGEX(R"(\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d.\d{6}Z)"); + static const TString CACHE_DIR = "./tmp/"; + + static void WriteFile(TString name, TStringBuf body, TInstant time) { + NFs::Remove(CACHE_DIR + name); + TFileOutput f(CACHE_DIR + name); + f << TDiskWriter::PrepareData(time, body); + } + + static void CleanCache() { + NFs::RemoveRecursive(CACHE_DIR); + NFs::MakeDirectoryRecursive(CACHE_DIR); + } + + class TLogger: public NTvmAuth::ILogger { + public: + void Log(int lvl, const TString& msg) override { + Cout << TInstant::Now() << " lvl=" << lvl << " msg: " << msg << "\n"; + Stream << lvl << ": " << msg << Endl; + } + + TStringStream Stream; + }; + + class TOfflineUpdater: public NDynamicClient::TTvmClient { + public: + TOfflineUpdater(const NTvmApi::TClientSettings& settings, + TIntrusivePtr<TLogger> l, + bool fail = true, + std::vector<TString> tickets = {}) + : TTvmClient(settings, l) + , Fail(fail) + , Tickets(std::move(tickets)) + { + Init(); + ExpBackoff_.SetEnabled(false); + } + + NUtils::TFetchResult FetchServiceTicketsFromHttp(const TString& req) const override { + if (Fail) { + throw yexception() << "tickets: alarm"; + } + + TString response; + if (!Tickets.empty()) { + response = Tickets.front(); + Tickets.erase(Tickets.begin()); + } + + Cout << "*** FetchServiceTicketsFromHttp. request: " << req << ". response: " << response << Endl; + return {200, {}, "/2/ticket", response, ""}; + } + + NUtils::TFetchResult FetchPublicKeysFromHttp() const override { + if (Fail) { + throw yexception() << "keysalarm"; + } + Cout << "*** FetchPublicKeysFromHttp" << Endl; + return {200, {}, "/2/keys", PublicKeys, ""}; + } + + using TTvmClient::GetDsts; + using TTvmClient::ProcessTasks; + using TTvmClient::SetResponseForTask; + using TTvmClient::Worker; + + bool Fail = true; + TString PublicKeys = NUnittest::TVMKNIFE_PUBLIC_KEYS; + mutable std::vector<TString> Tickets; + }; + Y_UNIT_TEST(StartWithIncompleteTicketsSet) { - TInstant now = TInstant::Now(); - CleanCache(); - WriteFile("./service_tickets", - R"({"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})" - "\t100500", - now); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); + TInstant now = TInstant::Now(); + CleanCache(); + WriteFile("./service_tickets", + R"({"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})" + "\t100500", + now); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}, false); s.SetDiskCacheDir(CACHE_DIR); auto l = MakeIntrusive<TLogger>(); { - TOfflineUpdater client(s, - l, - false, - { - R"({"213" : { "error" : "some error"}})", - R"({"123" : { "ticket" : "service_ticket_3"}})", - }); + TOfflineUpdater client(s, + l, + false, + { + R"({"213" : { "error" : "some error"}})", + R"({"123" : { "ticket" : "service_ticket_3"}})", + }); UNIT_ASSERT_VALUES_EQUAL(TClientStatus::IncompleteTicketsSet, client.GetStatus()); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->TicketsById.contains(213)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); - UNIT_ASSERT(client.GetCachedServiceTickets()->ErrorsById.contains(213)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->TicketsById.contains(213)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); + UNIT_ASSERT(client.GetCachedServiceTickets()->ErrorsById.contains(213)); NThreading::TFuture<TAddResponse> fut = client.Add({123}); UNIT_ASSERT_VALUES_EQUAL(TClientStatus::IncompleteTicketsSet, client.GetStatus()); @@ -121,12 +121,12 @@ Y_UNIT_TEST_SUITE(DynamicClient) { client.Worker(); UNIT_ASSERT_VALUES_EQUAL(TClientStatus::IncompleteTicketsSet, client.GetStatus()); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->TicketsById.contains(213)); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); - UNIT_ASSERT(client.GetCachedServiceTickets()->ErrorsById.contains(213)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->TicketsById.contains(213)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); + UNIT_ASSERT(client.GetCachedServiceTickets()->ErrorsById.contains(213)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); UNIT_ASSERT(fut.HasValue()); TAddResponse resp{ @@ -134,7 +134,7 @@ Y_UNIT_TEST_SUITE(DynamicClient) { }; UNIT_ASSERT_VALUES_EQUAL(resp, fut.GetValue()); - UNIT_ASSERT(client.Tickets.empty()); + UNIT_ASSERT(client.Tickets.empty()); TDsts dsts{19, 123, 213}; UNIT_ASSERT_VALUES_EQUAL(dsts, client.GetDsts()); @@ -144,7 +144,7 @@ Y_UNIT_TEST_SUITE(DynamicClient) { } Y_UNIT_TEST(StartWithEmptyTicketsSet) { - CleanCache(); + CleanCache(); NTvmApi::TClientSettings s; s.SetSelfTvmId(100500); @@ -154,16 +154,16 @@ Y_UNIT_TEST_SUITE(DynamicClient) { auto l = MakeIntrusive<TLogger>(); { - TOfflineUpdater client(s, - l, - false, - { - R"({"213" : { "error" : "some error"}})", - R"({"123" : { "ticket" : "3:serv:CBAQ__________9_IgYIlJEGEHs:CcafYQH-FF5XaXMuJrgLZj98bIC54cs1ZkcFS9VV_9YM9iOM_0PXCtMkdg85rFjxE_BMpg7bE8ZuoqNfdw0FPt0BAKNeISwlydj4o0IjY82--LZBpP8CRn-EpAnkRaDShdlfrcF2pk1SSmEX8xdyZVQEnkUPY0cHGlFnu231vnE"}})", - }); + TOfflineUpdater client(s, + l, + false, + { + R"({"213" : { "error" : "some error"}})", + R"({"123" : { "ticket" : "3:serv:CBAQ__________9_IgYIlJEGEHs:CcafYQH-FF5XaXMuJrgLZj98bIC54cs1ZkcFS9VV_9YM9iOM_0PXCtMkdg85rFjxE_BMpg7bE8ZuoqNfdw0FPt0BAKNeISwlydj4o0IjY82--LZBpP8CRn-EpAnkRaDShdlfrcF2pk1SSmEX8xdyZVQEnkUPY0cHGlFnu231vnE"}})", + }); UNIT_ASSERT_VALUES_EQUAL(TClientStatus::IncompleteTicketsSet, client.GetStatus()); - UNIT_ASSERT(!client.GetCachedServiceTickets()->TicketsById.contains(213)); - UNIT_ASSERT(client.GetCachedServiceTickets()->ErrorsById.contains(213)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->TicketsById.contains(213)); + UNIT_ASSERT(client.GetCachedServiceTickets()->ErrorsById.contains(213)); UNIT_ASSERT_EXCEPTION_CONTAINS(client.GetOptionalServiceTicketFor(213), TMissingServiceTicket, "some error"); NThreading::TFuture<TAddResponse> fut = client.Add({123}); @@ -172,10 +172,10 @@ Y_UNIT_TEST_SUITE(DynamicClient) { client.Worker(); UNIT_ASSERT_VALUES_EQUAL(TClientStatus::IncompleteTicketsSet, client.GetStatus()); - UNIT_ASSERT(!client.GetCachedServiceTickets()->TicketsById.contains(213)); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); - UNIT_ASSERT(client.GetCachedServiceTickets()->ErrorsById.contains(213)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->TicketsById.contains(213)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); + UNIT_ASSERT(client.GetCachedServiceTickets()->ErrorsById.contains(213)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); UNIT_ASSERT(fut.HasValue()); TAddResponse resp{ @@ -183,7 +183,7 @@ Y_UNIT_TEST_SUITE(DynamicClient) { }; UNIT_ASSERT_VALUES_EQUAL(resp, fut.GetValue()); - UNIT_ASSERT(client.Tickets.empty()); + UNIT_ASSERT(client.Tickets.empty()); TDsts dsts{123, 213}; UNIT_ASSERT_VALUES_EQUAL(dsts, client.GetDsts()); @@ -193,443 +193,443 @@ Y_UNIT_TEST_SUITE(DynamicClient) { }; Y_UNIT_TEST(StartWithIncompleteCacheAndAdd) { TInstant now = TInstant::Now(); - CleanCache(); - WriteFile("./service_tickets", + CleanCache(); + WriteFile("./service_tickets", R"({"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})" "\t100500", now); NTvmApi::TClientSettings s; s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - - UNIT_ASSERT_EXCEPTION_CONTAINS(TOfflineUpdater(s, l), - TRetriableException, - "Failed to start TvmClient. You can retry: ServiceTickets: tickets: alarm"); - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/service_tickets' was successfully read\n" - << "6: Got 1 service ticket(s) from disk\n" - << "6: Cache was updated with 1 service ticket(s): XXXXXXXXXXX\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "4: Failed to get ServiceTickets: tickets: alarm\n" - << "4: Failed to get ServiceTickets: tickets: alarm\n" - << "4: Failed to get ServiceTickets: tickets: alarm\n" - << "4: Failed to update service tickets: tickets: alarm\n", - std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); - l->Stream.Str().clear(); - - { - TOfflineUpdater client(s, - l, - false, - { - R"({"213" : { "ticket" : "service_ticket_2"}})", - R"({"123" : { "ticket" : "service_ticket_3"}})", - }); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(213)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(213)); - - NThreading::TFuture<TAddResponse> fut = client.Add({123}); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); - - client.Worker(); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); - - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(213)); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(213)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); - - UNIT_ASSERT(fut.HasValue()); - TAddResponse resp{ - {123, {EDstStatus::Success, ""}}, - }; - UNIT_ASSERT_VALUES_EQUAL(resp, fut.GetValue()); - - UNIT_ASSERT(client.Tickets.empty()); - - TDsts dsts{19, 123, 213}; - UNIT_ASSERT_VALUES_EQUAL(dsts, client.GetDsts()); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/service_tickets' was successfully read\n" - << "6: Got 1 service ticket(s) from disk\n" - << "6: Cache was updated with 1 service ticket(s): " << TInstant::Seconds(now.Seconds()) << "\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Response with service tickets for 1 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" - << "7: Got responses with service tickets with 1 pages for 1 destination(s)\n" - << "6: Cache was partly updated with 1 service ticket(s). total: 2\n" - << "6: File './tmp/service_tickets' was successfully written\n" - << "7: Adding dst: got task #1 with 1 dsts\n" - << "7: Response with service tickets for 1 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" - << "7: Got responses with service tickets with 1 pages for 1 destination(s)\n" - << "6: Cache was partly updated with 1 service ticket(s). total: 3\n" - << "6: File './tmp/service_tickets' was successfully written\n" - << "7: Adding dst: task #1: dst=123 got ticket\n" - << "7: Adding dst: task #1: set value\n", - l->Stream.Str()); - } - - Y_UNIT_TEST(StartWithCacheAndAdd) { - TInstant now = TInstant::Now(); - CleanCache(); - WriteFile("./service_tickets", - R"({"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})" - "\t100500", - now); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - { - TOfflineUpdater client(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); - - client.Fail = false; - client.Tickets = { - R"({"123" : { "ticket" : "service_ticket_3"}, "213" : { "ticket" : "service_ticket_2"}})", - }; - NThreading::TFuture<TAddResponse> fut = client.Add({123, 213}); - - client.Worker(); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); - - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(213)); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(213)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); - - UNIT_ASSERT(fut.HasValue()); - TAddResponse resp{ - {123, {EDstStatus::Success, ""}}, - {213, {EDstStatus::Success, ""}}, - }; - UNIT_ASSERT_VALUES_EQUAL(resp, fut.GetValue()); - - UNIT_ASSERT(client.Tickets.empty()); - - TDsts dsts{19, 123, 213}; - UNIT_ASSERT_VALUES_EQUAL(dsts, client.GetDsts()); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/service_tickets' was successfully read\n" - << "6: Got 1 service ticket(s) from disk\n" - << "6: Cache was updated with 1 service ticket(s): " << TInstant::Seconds(now.Seconds()) << "\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Adding dst: got task #1 with 2 dsts\n" - << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" - << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" - << "6: Cache was partly updated with 2 service ticket(s). total: 3\n" - << "6: File './tmp/service_tickets' was successfully written\n" - << "7: Adding dst: task #1: dst=123 got ticket\n" - << "7: Adding dst: task #1: dst=213 got ticket\n" - << "7: Adding dst: task #1: set value\n", - l->Stream.Str()); - } - - Y_UNIT_TEST(StartWithCacheAndAddSeveral) { - TInstant now = TInstant::Now(); - CleanCache(); - WriteFile("./service_tickets", - R"({"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})" - "\t100500", - now); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - { - TOfflineUpdater client(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); - - client.Fail = false; - client.Tickets = { - R"({"123" : { "ticket" : "service_ticket_3"}, "213" : { "ticket" : "service_ticket_2"}})", - }; - NThreading::TFuture<TAddResponse> fut1 = client.Add({123}); - NThreading::TFuture<TAddResponse> fut2 = client.Add({213}); - - client.Worker(); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); - - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(213)); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(213)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); - - UNIT_ASSERT(fut1.HasValue()); - TAddResponse resp1{ - {123, {EDstStatus::Success, ""}}, - }; - UNIT_ASSERT_VALUES_EQUAL(resp1, fut1.GetValue()); - - UNIT_ASSERT(fut2.HasValue()); - TAddResponse resp2{ - {213, {EDstStatus::Success, ""}}, - }; - UNIT_ASSERT_VALUES_EQUAL(resp2, fut2.GetValue()); - - UNIT_ASSERT(client.Tickets.empty()); - - TDsts dsts{19, 123, 213}; - UNIT_ASSERT_VALUES_EQUAL(dsts, client.GetDsts()); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/service_tickets' was successfully read\n" - << "6: Got 1 service ticket(s) from disk\n" - << "6: Cache was updated with 1 service ticket(s): " << TInstant::Seconds(now.Seconds()) << "\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Adding dst: got task #1 with 1 dsts\n" - << "7: Adding dst: got task #2 with 1 dsts\n" - << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" - << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" - << "6: Cache was partly updated with 2 service ticket(s). total: 3\n" - << "6: File './tmp/service_tickets' was successfully written\n" - << "7: Adding dst: task #1: dst=123 got ticket\n" - << "7: Adding dst: task #1: set value\n" - << "7: Adding dst: task #2: dst=213 got ticket\n" - << "7: Adding dst: task #2: set value\n", - l->Stream.Str()); - } - - Y_UNIT_TEST(StartWithCacheAndAddSeveralWithErrors) { - TInstant now = TInstant::Now(); - CleanCache(); - WriteFile("./service_tickets", - R"({"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})" - "\t100500", - now); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - { - TOfflineUpdater client(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); - - UNIT_ASSERT(client.GetOptionalServiceTicketFor(19)); - UNIT_ASSERT_VALUES_EQUAL("3:serv:CBAQ__________9_IgYIKhCUkQY:CX", - *client.GetOptionalServiceTicketFor(19)); - UNIT_ASSERT(!client.GetOptionalServiceTicketFor(456)); - - client.Fail = false; - client.Tickets = { - R"({ - "123" : { "ticket" : "service_ticket_3"}, - "213" : { "ticket" : "service_ticket_2"}, - "456" : { "error" : "error_3"} - })", - }; - NThreading::TFuture<TAddResponse> fut1 = client.Add({123, 213}); - NThreading::TFuture<TAddResponse> fut2 = client.Add({213, 456}); - - client.Worker(); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); - - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(213)); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->TicketsById.contains(456)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(213)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); - UNIT_ASSERT(client.GetCachedServiceTickets()->ErrorsById.contains(456)); - - UNIT_ASSERT(client.GetOptionalServiceTicketFor(19)); - UNIT_ASSERT_VALUES_EQUAL("3:serv:CBAQ__________9_IgYIKhCUkQY:CX", - *client.GetOptionalServiceTicketFor(19)); - UNIT_ASSERT_EXCEPTION_CONTAINS(client.GetOptionalServiceTicketFor(456), - TMissingServiceTicket, - "Failed to get ticket for '456': error_3"); - - UNIT_ASSERT(fut1.HasValue()); - TAddResponse resp1{ - {123, {EDstStatus::Success, ""}}, - {213, {EDstStatus::Success, ""}}, - }; - UNIT_ASSERT_VALUES_EQUAL(resp1, fut1.GetValue()); - - UNIT_ASSERT(fut2.HasValue()); - TAddResponse resp2{ - {213, {EDstStatus::Success, ""}}, - {456, {EDstStatus::Fail, "error_3"}}, - }; - UNIT_ASSERT_VALUES_EQUAL(resp2, fut2.GetValue()); - - UNIT_ASSERT(client.Tickets.empty()); - - TDsts dsts{19, 123, 213}; - UNIT_ASSERT_VALUES_EQUAL(dsts, client.GetDsts()); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/service_tickets' was successfully read\n" - << "6: Got 1 service ticket(s) from disk\n" - << "6: Cache was updated with 1 service ticket(s): " << TInstant::Seconds(now.Seconds()) << "\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Adding dst: got task #1 with 2 dsts\n" - << "7: Adding dst: got task #2 with 2 dsts\n" - << "7: Response with service tickets for 3 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" - << "7: Got responses with service tickets with 1 pages for 3 destination(s)\n" - << "3: Failed to get service ticket for dst=456: error_3\n" - << "6: Cache was partly updated with 2 service ticket(s). total: 3\n" - << "6: File './tmp/service_tickets' was successfully written\n" - << "7: Adding dst: task #1: dst=123 got ticket\n" - << "7: Adding dst: task #1: dst=213 got ticket\n" - << "7: Adding dst: task #1: set value\n" - << "7: Adding dst: task #2: dst=213 got ticket\n" - << "4: Adding dst: task #2: dst=456 failed to get ticket: error_3\n" - << "7: Adding dst: task #2: set value\n", - l->Stream.Str()); - } - - Y_UNIT_TEST(WithException) { - TInstant now = TInstant::Now(); - CleanCache(); - WriteFile("./service_tickets", - R"({"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})" - "\t100500", - now); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - { - TOfflineUpdater client(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); - - client.Fail = false; - client.Tickets = { - R"({ - "123" : { "ticket" : "service_ticket_3"}, - "213" : { "ticket" : "service_ticket_2"}, - "456" : { "error" : "error_3"}, - "789" : { "ticket" : "service_ticket_4"} - })", - }; - NThreading::TFuture<TAddResponse> fut1 = client.Add({123, 213}); - NThreading::TFuture<TAddResponse> fut2 = client.Add({213, 456}); - NThreading::TFuture<TAddResponse> fut3 = client.Add({789}); - - fut2.Subscribe([](const auto&) { - throw yexception() << "planed exc"; - }); - fut3.Subscribe([](const auto&) { - throw 5; - }); - - UNIT_ASSERT_NO_EXCEPTION(client.Worker()); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); - - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(213)); - UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->TicketsById.contains(456)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(213)); - UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); - UNIT_ASSERT(client.GetCachedServiceTickets()->ErrorsById.contains(456)); - - UNIT_ASSERT(fut1.HasValue()); - TAddResponse resp1{ - {123, {EDstStatus::Success, ""}}, - {213, {EDstStatus::Success, ""}}, - }; - UNIT_ASSERT_VALUES_EQUAL(resp1, fut1.GetValue()); - - UNIT_ASSERT(fut2.HasValue()); - TAddResponse resp2{ - {213, {EDstStatus::Success, ""}}, - {456, {EDstStatus::Fail, "error_3"}}, - }; - UNIT_ASSERT_VALUES_EQUAL(resp2, fut2.GetValue()); - - UNIT_ASSERT(fut3.HasValue()); - TAddResponse resp3{ - {789, {EDstStatus::Success, ""}}, - }; - UNIT_ASSERT_VALUES_EQUAL(resp3, fut3.GetValue()); - - UNIT_ASSERT(client.Tickets.empty()); - - TDsts dsts{19, 123, 213, 789}; - UNIT_ASSERT_VALUES_EQUAL(dsts, client.GetDsts()); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/service_tickets' was successfully read\n" - << "6: Got 1 service ticket(s) from disk\n" - << "6: Cache was updated with 1 service ticket(s): " << TInstant::Seconds(now.Seconds()) << "\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Adding dst: got task #1 with 2 dsts\n" - << "7: Adding dst: got task #2 with 2 dsts\n" - << "7: Adding dst: got task #3 with 1 dsts\n" - << "7: Response with service tickets for 4 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" - << "7: Got responses with service tickets with 1 pages for 4 destination(s)\n" - << "3: Failed to get service ticket for dst=456: error_3\n" - << "6: Cache was partly updated with 3 service ticket(s). total: 4\n" - << "6: File './tmp/service_tickets' was successfully written\n" - << "7: Adding dst: task #1: dst=123 got ticket\n" - << "7: Adding dst: task #1: dst=213 got ticket\n" - << "7: Adding dst: task #1: set value\n" - << "7: Adding dst: task #2: dst=213 got ticket\n" - << "4: Adding dst: task #2: dst=456 failed to get ticket: error_3\n" - << "7: Adding dst: task #2: set value\n" - << "3: Adding dst: task #2: exception: planed exc\n" - << "7: Adding dst: task #3: dst=789 got ticket\n" - << "7: Adding dst: task #3: set value\n" - << "3: Adding dst: task #3: exception: unknown error\n", - l->Stream.Str()); - } -} - -template <> -void Out<NTvmAuth::NDynamicClient::TDstResponse>(IOutputStream& out, const NTvmAuth::NDynamicClient::TDstResponse& m) { - out << m.Status << " (" << m.Error << ")"; -} - -template <> -void Out<NTvmAuth::NTvmApi::TClientSettings::TDst>(IOutputStream& out, const NTvmAuth::NTvmApi::TClientSettings::TDst& m) { - out << m.Id; -} + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + + UNIT_ASSERT_EXCEPTION_CONTAINS(TOfflineUpdater(s, l), + TRetriableException, + "Failed to start TvmClient. You can retry: ServiceTickets: tickets: alarm"); + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/service_tickets' was successfully read\n" + << "6: Got 1 service ticket(s) from disk\n" + << "6: Cache was updated with 1 service ticket(s): XXXXXXXXXXX\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "4: Failed to get ServiceTickets: tickets: alarm\n" + << "4: Failed to get ServiceTickets: tickets: alarm\n" + << "4: Failed to get ServiceTickets: tickets: alarm\n" + << "4: Failed to update service tickets: tickets: alarm\n", + std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); + l->Stream.Str().clear(); + + { + TOfflineUpdater client(s, + l, + false, + { + R"({"213" : { "ticket" : "service_ticket_2"}})", + R"({"123" : { "ticket" : "service_ticket_3"}})", + }); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(213)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(213)); + + NThreading::TFuture<TAddResponse> fut = client.Add({123}); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); + + client.Worker(); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); + + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(213)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(213)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); + + UNIT_ASSERT(fut.HasValue()); + TAddResponse resp{ + {123, {EDstStatus::Success, ""}}, + }; + UNIT_ASSERT_VALUES_EQUAL(resp, fut.GetValue()); + + UNIT_ASSERT(client.Tickets.empty()); + + TDsts dsts{19, 123, 213}; + UNIT_ASSERT_VALUES_EQUAL(dsts, client.GetDsts()); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/service_tickets' was successfully read\n" + << "6: Got 1 service ticket(s) from disk\n" + << "6: Cache was updated with 1 service ticket(s): " << TInstant::Seconds(now.Seconds()) << "\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Response with service tickets for 1 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" + << "7: Got responses with service tickets with 1 pages for 1 destination(s)\n" + << "6: Cache was partly updated with 1 service ticket(s). total: 2\n" + << "6: File './tmp/service_tickets' was successfully written\n" + << "7: Adding dst: got task #1 with 1 dsts\n" + << "7: Response with service tickets for 1 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" + << "7: Got responses with service tickets with 1 pages for 1 destination(s)\n" + << "6: Cache was partly updated with 1 service ticket(s). total: 3\n" + << "6: File './tmp/service_tickets' was successfully written\n" + << "7: Adding dst: task #1: dst=123 got ticket\n" + << "7: Adding dst: task #1: set value\n", + l->Stream.Str()); + } + + Y_UNIT_TEST(StartWithCacheAndAdd) { + TInstant now = TInstant::Now(); + CleanCache(); + WriteFile("./service_tickets", + R"({"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})" + "\t100500", + now); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + { + TOfflineUpdater client(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); + + client.Fail = false; + client.Tickets = { + R"({"123" : { "ticket" : "service_ticket_3"}, "213" : { "ticket" : "service_ticket_2"}})", + }; + NThreading::TFuture<TAddResponse> fut = client.Add({123, 213}); + + client.Worker(); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); + + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(213)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(213)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); + + UNIT_ASSERT(fut.HasValue()); + TAddResponse resp{ + {123, {EDstStatus::Success, ""}}, + {213, {EDstStatus::Success, ""}}, + }; + UNIT_ASSERT_VALUES_EQUAL(resp, fut.GetValue()); + + UNIT_ASSERT(client.Tickets.empty()); + + TDsts dsts{19, 123, 213}; + UNIT_ASSERT_VALUES_EQUAL(dsts, client.GetDsts()); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/service_tickets' was successfully read\n" + << "6: Got 1 service ticket(s) from disk\n" + << "6: Cache was updated with 1 service ticket(s): " << TInstant::Seconds(now.Seconds()) << "\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Adding dst: got task #1 with 2 dsts\n" + << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" + << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" + << "6: Cache was partly updated with 2 service ticket(s). total: 3\n" + << "6: File './tmp/service_tickets' was successfully written\n" + << "7: Adding dst: task #1: dst=123 got ticket\n" + << "7: Adding dst: task #1: dst=213 got ticket\n" + << "7: Adding dst: task #1: set value\n", + l->Stream.Str()); + } + + Y_UNIT_TEST(StartWithCacheAndAddSeveral) { + TInstant now = TInstant::Now(); + CleanCache(); + WriteFile("./service_tickets", + R"({"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})" + "\t100500", + now); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + { + TOfflineUpdater client(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); + + client.Fail = false; + client.Tickets = { + R"({"123" : { "ticket" : "service_ticket_3"}, "213" : { "ticket" : "service_ticket_2"}})", + }; + NThreading::TFuture<TAddResponse> fut1 = client.Add({123}); + NThreading::TFuture<TAddResponse> fut2 = client.Add({213}); + + client.Worker(); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); + + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(213)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(213)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); + + UNIT_ASSERT(fut1.HasValue()); + TAddResponse resp1{ + {123, {EDstStatus::Success, ""}}, + }; + UNIT_ASSERT_VALUES_EQUAL(resp1, fut1.GetValue()); + + UNIT_ASSERT(fut2.HasValue()); + TAddResponse resp2{ + {213, {EDstStatus::Success, ""}}, + }; + UNIT_ASSERT_VALUES_EQUAL(resp2, fut2.GetValue()); + + UNIT_ASSERT(client.Tickets.empty()); + + TDsts dsts{19, 123, 213}; + UNIT_ASSERT_VALUES_EQUAL(dsts, client.GetDsts()); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/service_tickets' was successfully read\n" + << "6: Got 1 service ticket(s) from disk\n" + << "6: Cache was updated with 1 service ticket(s): " << TInstant::Seconds(now.Seconds()) << "\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Adding dst: got task #1 with 1 dsts\n" + << "7: Adding dst: got task #2 with 1 dsts\n" + << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" + << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" + << "6: Cache was partly updated with 2 service ticket(s). total: 3\n" + << "6: File './tmp/service_tickets' was successfully written\n" + << "7: Adding dst: task #1: dst=123 got ticket\n" + << "7: Adding dst: task #1: set value\n" + << "7: Adding dst: task #2: dst=213 got ticket\n" + << "7: Adding dst: task #2: set value\n", + l->Stream.Str()); + } + + Y_UNIT_TEST(StartWithCacheAndAddSeveralWithErrors) { + TInstant now = TInstant::Now(); + CleanCache(); + WriteFile("./service_tickets", + R"({"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})" + "\t100500", + now); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + { + TOfflineUpdater client(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); + + UNIT_ASSERT(client.GetOptionalServiceTicketFor(19)); + UNIT_ASSERT_VALUES_EQUAL("3:serv:CBAQ__________9_IgYIKhCUkQY:CX", + *client.GetOptionalServiceTicketFor(19)); + UNIT_ASSERT(!client.GetOptionalServiceTicketFor(456)); + + client.Fail = false; + client.Tickets = { + R"({ + "123" : { "ticket" : "service_ticket_3"}, + "213" : { "ticket" : "service_ticket_2"}, + "456" : { "error" : "error_3"} + })", + }; + NThreading::TFuture<TAddResponse> fut1 = client.Add({123, 213}); + NThreading::TFuture<TAddResponse> fut2 = client.Add({213, 456}); + + client.Worker(); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); + + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(213)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->TicketsById.contains(456)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(213)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); + UNIT_ASSERT(client.GetCachedServiceTickets()->ErrorsById.contains(456)); + + UNIT_ASSERT(client.GetOptionalServiceTicketFor(19)); + UNIT_ASSERT_VALUES_EQUAL("3:serv:CBAQ__________9_IgYIKhCUkQY:CX", + *client.GetOptionalServiceTicketFor(19)); + UNIT_ASSERT_EXCEPTION_CONTAINS(client.GetOptionalServiceTicketFor(456), + TMissingServiceTicket, + "Failed to get ticket for '456': error_3"); + + UNIT_ASSERT(fut1.HasValue()); + TAddResponse resp1{ + {123, {EDstStatus::Success, ""}}, + {213, {EDstStatus::Success, ""}}, + }; + UNIT_ASSERT_VALUES_EQUAL(resp1, fut1.GetValue()); + + UNIT_ASSERT(fut2.HasValue()); + TAddResponse resp2{ + {213, {EDstStatus::Success, ""}}, + {456, {EDstStatus::Fail, "error_3"}}, + }; + UNIT_ASSERT_VALUES_EQUAL(resp2, fut2.GetValue()); + + UNIT_ASSERT(client.Tickets.empty()); + + TDsts dsts{19, 123, 213}; + UNIT_ASSERT_VALUES_EQUAL(dsts, client.GetDsts()); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/service_tickets' was successfully read\n" + << "6: Got 1 service ticket(s) from disk\n" + << "6: Cache was updated with 1 service ticket(s): " << TInstant::Seconds(now.Seconds()) << "\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Adding dst: got task #1 with 2 dsts\n" + << "7: Adding dst: got task #2 with 2 dsts\n" + << "7: Response with service tickets for 3 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" + << "7: Got responses with service tickets with 1 pages for 3 destination(s)\n" + << "3: Failed to get service ticket for dst=456: error_3\n" + << "6: Cache was partly updated with 2 service ticket(s). total: 3\n" + << "6: File './tmp/service_tickets' was successfully written\n" + << "7: Adding dst: task #1: dst=123 got ticket\n" + << "7: Adding dst: task #1: dst=213 got ticket\n" + << "7: Adding dst: task #1: set value\n" + << "7: Adding dst: task #2: dst=213 got ticket\n" + << "4: Adding dst: task #2: dst=456 failed to get ticket: error_3\n" + << "7: Adding dst: task #2: set value\n", + l->Stream.Str()); + } + + Y_UNIT_TEST(WithException) { + TInstant now = TInstant::Now(); + CleanCache(); + WriteFile("./service_tickets", + R"({"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})" + "\t100500", + now); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + { + TOfflineUpdater client(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); + + client.Fail = false; + client.Tickets = { + R"({ + "123" : { "ticket" : "service_ticket_3"}, + "213" : { "ticket" : "service_ticket_2"}, + "456" : { "error" : "error_3"}, + "789" : { "ticket" : "service_ticket_4"} + })", + }; + NThreading::TFuture<TAddResponse> fut1 = client.Add({123, 213}); + NThreading::TFuture<TAddResponse> fut2 = client.Add({213, 456}); + NThreading::TFuture<TAddResponse> fut3 = client.Add({789}); + + fut2.Subscribe([](const auto&) { + throw yexception() << "planed exc"; + }); + fut3.Subscribe([](const auto&) { + throw 5; + }); + + UNIT_ASSERT_NO_EXCEPTION(client.Worker()); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, client.GetStatus()); + + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(19)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(213)); + UNIT_ASSERT(client.GetCachedServiceTickets()->TicketsById.contains(123)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->TicketsById.contains(456)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(19)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(213)); + UNIT_ASSERT(!client.GetCachedServiceTickets()->ErrorsById.contains(123)); + UNIT_ASSERT(client.GetCachedServiceTickets()->ErrorsById.contains(456)); + + UNIT_ASSERT(fut1.HasValue()); + TAddResponse resp1{ + {123, {EDstStatus::Success, ""}}, + {213, {EDstStatus::Success, ""}}, + }; + UNIT_ASSERT_VALUES_EQUAL(resp1, fut1.GetValue()); + + UNIT_ASSERT(fut2.HasValue()); + TAddResponse resp2{ + {213, {EDstStatus::Success, ""}}, + {456, {EDstStatus::Fail, "error_3"}}, + }; + UNIT_ASSERT_VALUES_EQUAL(resp2, fut2.GetValue()); + + UNIT_ASSERT(fut3.HasValue()); + TAddResponse resp3{ + {789, {EDstStatus::Success, ""}}, + }; + UNIT_ASSERT_VALUES_EQUAL(resp3, fut3.GetValue()); + + UNIT_ASSERT(client.Tickets.empty()); + + TDsts dsts{19, 123, 213, 789}; + UNIT_ASSERT_VALUES_EQUAL(dsts, client.GetDsts()); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/service_tickets' was successfully read\n" + << "6: Got 1 service ticket(s) from disk\n" + << "6: Cache was updated with 1 service ticket(s): " << TInstant::Seconds(now.Seconds()) << "\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Adding dst: got task #1 with 2 dsts\n" + << "7: Adding dst: got task #2 with 2 dsts\n" + << "7: Adding dst: got task #3 with 1 dsts\n" + << "7: Response with service tickets for 4 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" + << "7: Got responses with service tickets with 1 pages for 4 destination(s)\n" + << "3: Failed to get service ticket for dst=456: error_3\n" + << "6: Cache was partly updated with 3 service ticket(s). total: 4\n" + << "6: File './tmp/service_tickets' was successfully written\n" + << "7: Adding dst: task #1: dst=123 got ticket\n" + << "7: Adding dst: task #1: dst=213 got ticket\n" + << "7: Adding dst: task #1: set value\n" + << "7: Adding dst: task #2: dst=213 got ticket\n" + << "4: Adding dst: task #2: dst=456 failed to get ticket: error_3\n" + << "7: Adding dst: task #2: set value\n" + << "3: Adding dst: task #2: exception: planed exc\n" + << "7: Adding dst: task #3: dst=789 got ticket\n" + << "7: Adding dst: task #3: set value\n" + << "3: Adding dst: task #3: exception: unknown error\n", + l->Stream.Str()); + } +} + +template <> +void Out<NTvmAuth::NDynamicClient::TDstResponse>(IOutputStream& out, const NTvmAuth::NDynamicClient::TDstResponse& m) { + out << m.Status << " (" << m.Error << ")"; +} + +template <> +void Out<NTvmAuth::NTvmApi::TClientSettings::TDst>(IOutputStream& out, const NTvmAuth::NTvmApi::TClientSettings::TDst& m) { + out << m.Id; +} diff --git a/library/cpp/tvmauth/client/misc/api/dynamic_dst/ut/ya.make b/library/cpp/tvmauth/client/misc/api/dynamic_dst/ut/ya.make index 5d01ffaad8..12290a32bd 100644 --- a/library/cpp/tvmauth/client/misc/api/dynamic_dst/ut/ya.make +++ b/library/cpp/tvmauth/client/misc/api/dynamic_dst/ut/ya.make @@ -1,11 +1,11 @@ -UNITTEST_FOR(library/cpp/tvmauth/client/misc/api/dynamic_dst) - -OWNER(g:passport_infra) - -SRCS( - tvm_client_ut.cpp -) - +UNITTEST_FOR(library/cpp/tvmauth/client/misc/api/dynamic_dst) + +OWNER(g:passport_infra) + +SRCS( + tvm_client_ut.cpp +) + ENV(YA_TEST_SHORTEN_WINE_PATH=1) -END() +END() diff --git a/library/cpp/tvmauth/client/misc/api/dynamic_dst/ya.make b/library/cpp/tvmauth/client/misc/api/dynamic_dst/ya.make index f3858e602f..2caadae017 100644 --- a/library/cpp/tvmauth/client/misc/api/dynamic_dst/ya.make +++ b/library/cpp/tvmauth/client/misc/api/dynamic_dst/ya.make @@ -1,20 +1,20 @@ -LIBRARY() - -OWNER(g:passport_infra) - -PEERDIR( +LIBRARY() + +OWNER(g:passport_infra) + +PEERDIR( library/cpp/threading/future - library/cpp/tvmauth/client -) - -SRCS( - tvm_client.cpp -) - -GENERATE_ENUM_SERIALIZATION(tvm_client.h) - -END() - -RECURSE_FOR_TESTS( - ut -) + library/cpp/tvmauth/client +) + +SRCS( + tvm_client.cpp +) + +GENERATE_ENUM_SERIALIZATION(tvm_client.h) + +END() + +RECURSE_FOR_TESTS( + ut +) diff --git a/library/cpp/tvmauth/client/misc/api/retry_settings.h b/library/cpp/tvmauth/client/misc/api/retry_settings.h index 607b230811..8e379e9f56 100644 --- a/library/cpp/tvmauth/client/misc/api/retry_settings.h +++ b/library/cpp/tvmauth/client/misc/api/retry_settings.h @@ -1,33 +1,33 @@ -#pragma once - -#include <library/cpp/tvmauth/client/misc/exponential_backoff.h> - -namespace NTvmAuth::NTvmApi { - struct TRetrySettings { - TExponentialBackoff::TSettings BackoffSettings = { - TDuration::Seconds(0), - TDuration::Minutes(1), - 2, - 0.5, - }; - TDuration MaxRandomSleepDefault = TDuration::Seconds(5); - TDuration MaxRandomSleepWhenOk = TDuration::Minutes(1); - ui32 RetriesOnStart = 3; - ui32 RetriesInBackground = 2; - TDuration WorkerAwakingPeriod = TDuration::Seconds(10); - ui32 DstsLimit = 300; - TDuration RolesUpdatePeriod = TDuration::Minutes(10); - TDuration RolesWarnPeriod = TDuration::Minutes(20); - - bool operator==(const TRetrySettings& o) const { - return BackoffSettings == o.BackoffSettings && - MaxRandomSleepDefault == o.MaxRandomSleepDefault && - MaxRandomSleepWhenOk == o.MaxRandomSleepWhenOk && - RetriesOnStart == o.RetriesOnStart && - WorkerAwakingPeriod == o.WorkerAwakingPeriod && - DstsLimit == o.DstsLimit && - RolesUpdatePeriod == o.RolesUpdatePeriod && - RolesWarnPeriod == o.RolesWarnPeriod; - } - }; -} +#pragma once + +#include <library/cpp/tvmauth/client/misc/exponential_backoff.h> + +namespace NTvmAuth::NTvmApi { + struct TRetrySettings { + TExponentialBackoff::TSettings BackoffSettings = { + TDuration::Seconds(0), + TDuration::Minutes(1), + 2, + 0.5, + }; + TDuration MaxRandomSleepDefault = TDuration::Seconds(5); + TDuration MaxRandomSleepWhenOk = TDuration::Minutes(1); + ui32 RetriesOnStart = 3; + ui32 RetriesInBackground = 2; + TDuration WorkerAwakingPeriod = TDuration::Seconds(10); + ui32 DstsLimit = 300; + TDuration RolesUpdatePeriod = TDuration::Minutes(10); + TDuration RolesWarnPeriod = TDuration::Minutes(20); + + bool operator==(const TRetrySettings& o) const { + return BackoffSettings == o.BackoffSettings && + MaxRandomSleepDefault == o.MaxRandomSleepDefault && + MaxRandomSleepWhenOk == o.MaxRandomSleepWhenOk && + RetriesOnStart == o.RetriesOnStart && + WorkerAwakingPeriod == o.WorkerAwakingPeriod && + DstsLimit == o.DstsLimit && + RolesUpdatePeriod == o.RolesUpdatePeriod && + RolesWarnPeriod == o.RolesWarnPeriod; + } + }; +} diff --git a/library/cpp/tvmauth/client/misc/api/roles_fetcher.cpp b/library/cpp/tvmauth/client/misc/api/roles_fetcher.cpp index b46595207c..6d0afb95b4 100644 --- a/library/cpp/tvmauth/client/misc/api/roles_fetcher.cpp +++ b/library/cpp/tvmauth/client/misc/api/roles_fetcher.cpp @@ -1,163 +1,163 @@ -#include "roles_fetcher.h" - -#include <library/cpp/tvmauth/client/misc/disk_cache.h> -#include <library/cpp/tvmauth/client/misc/roles/decoder.h> -#include <library/cpp/tvmauth/client/misc/roles/parser.h> - -#include <library/cpp/string_utils/quote/quote.h> - -#include <util/string/builder.h> -#include <util/string/join.h> - -namespace NTvmAuth::NTvmApi { - static TString CreatePath(const TString& dir, const TString& file) { - return dir.EndsWith("/") - ? dir + file - : dir + "/" + file; - } - - TRolesFetcher::TRolesFetcher(const TRolesFetcherSettings& settings, TLoggerPtr logger) - : Settings_(settings) - , Logger_(logger) - , CacheFilePath_(CreatePath(Settings_.CacheDir, "roles")) - { - Client_ = std::make_unique<TKeepAliveHttpClient>( - Settings_.TiroleHost, - Settings_.TirolePort, - Settings_.Timeout, - Settings_.Timeout); - } - - TInstant TRolesFetcher::ReadFromDisk() { - TDiskReader dr(CacheFilePath_, Logger_.Get()); - if (!dr.Read()) { - return {}; - } - - std::pair<TString, TString> data = ParseDiskFormat(dr.Data()); - if (data.second != Settings_.IdmSystemSlug) { - Logger_->Warning( - TStringBuilder() << "Roles in disk cache are for another slug (" << data.second - << "). Self=" << Settings_.IdmSystemSlug); - return {}; - } - - CurrentRoles_.Set(NRoles::TParser::Parse(std::make_shared<TString>(std::move(data.first)))); - Logger_->Debug( - TStringBuilder() << "Succeed to read roles with revision " - << CurrentRoles_.Get()->GetMeta().Revision - << " from " << CacheFilePath_); - - return dr.Time(); - } - - bool TRolesFetcher::AreRolesOk() const { - return bool(GetCurrentRoles()); - } - - bool TRolesFetcher::IsTimeToUpdate(const TRetrySettings& settings, TDuration sinceUpdate) { - return settings.RolesUpdatePeriod < sinceUpdate; - } - - bool TRolesFetcher::ShouldWarn(const TRetrySettings& settings, TDuration sinceUpdate) { - return settings.RolesWarnPeriod < sinceUpdate; - } - - NUtils::TFetchResult TRolesFetcher::FetchActualRoles(const TString& serviceTicket) { - TStringStream out; - THttpHeaders outHeaders; - - TRequest req = CreateTiroleRequest(serviceTicket); - TKeepAliveHttpClient::THttpCode code = Client_->DoGet( - req.Url, - &out, - req.Headers, - &outHeaders); - - const THttpInputHeader* reqId = outHeaders.FindHeader("X-Request-Id"); - - Logger_->Debug( - TStringBuilder() << "Succeed to perform request for roles to " << Settings_.TiroleHost - << " (request_id=" << (reqId ? reqId->Value() : "") - << "). code=" << code); - - return {code, std::move(outHeaders), "/v1/get_actual_roles", out.Str(), {}}; - } - - void TRolesFetcher::Update(NUtils::TFetchResult&& fetchResult, TInstant now) { - if (fetchResult.Code == 304) { - Y_ENSURE(CurrentRoles_.Get(), - "tirole did not return any roles because current roles are actual," - " but there are no roles in memory - this should never happen"); - return; - } - - Y_ENSURE(fetchResult.Code == 200, - "Unexpected code from tirole: " << fetchResult.Code << ". " << fetchResult.Response); - - const THttpInputHeader* codec = fetchResult.Headers.FindHeader("X-Tirole-Compression"); - const TStringBuf codecBuf = codec ? codec->Value() : ""; - - NRoles::TRawPtr blob; - try { - blob = std::make_shared<TString>(NRoles::TDecoder::Decode( - codecBuf, - std::move(fetchResult.Response))); - } catch (const std::exception& e) { - throw yexception() << "Failed to decode blob with codec '" << codecBuf - << "': " << e.what(); - } - - CurrentRoles_.Set(NRoles::TParser::Parse(blob)); - - Logger_->Debug( - TStringBuilder() << "Succeed to update roles with revision " - << CurrentRoles_.Get()->GetMeta().Revision); - - TDiskWriter dw(CacheFilePath_, Logger_.Get()); - dw.Write(PrepareDiskFormat(*blob, Settings_.IdmSystemSlug), now); - } - - NTvmAuth::NRoles::TRolesPtr TRolesFetcher::GetCurrentRoles() const { - return CurrentRoles_.Get(); - } - - void TRolesFetcher::ResetConnection() { - Client_->ResetConnection(); - } - - static const char DELIMETER = '\t'; - - std::pair<TString, TString> TRolesFetcher::ParseDiskFormat(TStringBuf filebody) { - TStringBuf slug = filebody.RNextTok(DELIMETER); - return {TString(filebody), CGIUnescapeRet(slug)}; - } - - TString TRolesFetcher::PrepareDiskFormat(TStringBuf roles, TStringBuf slug) { - TStringStream res; - res.Reserve(roles.size() + 1 + slug.size()); - res << roles << DELIMETER << CGIEscapeRet(slug); - return res.Str(); - } - - TRolesFetcher::TRequest TRolesFetcher::CreateTiroleRequest(const TString& serviceTicket) const { - TRolesFetcher::TRequest res; - - TStringStream url; - url.Reserve(512); - url << "/v1/get_actual_roles?"; - url << "system_slug=" << CGIEscapeRet(Settings_.IdmSystemSlug) << "&"; - Settings_.ProcInfo.AddToRequest(url); - res.Url = std::move(url.Str()); - - res.Headers.reserve(2); - res.Headers.emplace(XYaServiceTicket_, serviceTicket); - - NRoles::TRolesPtr roles = CurrentRoles_.Get(); - if (roles) { - res.Headers.emplace(IfNoneMatch_, Join("", "\"", roles->GetMeta().Revision, "\"")); - } - - return res; - } -} +#include "roles_fetcher.h" + +#include <library/cpp/tvmauth/client/misc/disk_cache.h> +#include <library/cpp/tvmauth/client/misc/roles/decoder.h> +#include <library/cpp/tvmauth/client/misc/roles/parser.h> + +#include <library/cpp/string_utils/quote/quote.h> + +#include <util/string/builder.h> +#include <util/string/join.h> + +namespace NTvmAuth::NTvmApi { + static TString CreatePath(const TString& dir, const TString& file) { + return dir.EndsWith("/") + ? dir + file + : dir + "/" + file; + } + + TRolesFetcher::TRolesFetcher(const TRolesFetcherSettings& settings, TLoggerPtr logger) + : Settings_(settings) + , Logger_(logger) + , CacheFilePath_(CreatePath(Settings_.CacheDir, "roles")) + { + Client_ = std::make_unique<TKeepAliveHttpClient>( + Settings_.TiroleHost, + Settings_.TirolePort, + Settings_.Timeout, + Settings_.Timeout); + } + + TInstant TRolesFetcher::ReadFromDisk() { + TDiskReader dr(CacheFilePath_, Logger_.Get()); + if (!dr.Read()) { + return {}; + } + + std::pair<TString, TString> data = ParseDiskFormat(dr.Data()); + if (data.second != Settings_.IdmSystemSlug) { + Logger_->Warning( + TStringBuilder() << "Roles in disk cache are for another slug (" << data.second + << "). Self=" << Settings_.IdmSystemSlug); + return {}; + } + + CurrentRoles_.Set(NRoles::TParser::Parse(std::make_shared<TString>(std::move(data.first)))); + Logger_->Debug( + TStringBuilder() << "Succeed to read roles with revision " + << CurrentRoles_.Get()->GetMeta().Revision + << " from " << CacheFilePath_); + + return dr.Time(); + } + + bool TRolesFetcher::AreRolesOk() const { + return bool(GetCurrentRoles()); + } + + bool TRolesFetcher::IsTimeToUpdate(const TRetrySettings& settings, TDuration sinceUpdate) { + return settings.RolesUpdatePeriod < sinceUpdate; + } + + bool TRolesFetcher::ShouldWarn(const TRetrySettings& settings, TDuration sinceUpdate) { + return settings.RolesWarnPeriod < sinceUpdate; + } + + NUtils::TFetchResult TRolesFetcher::FetchActualRoles(const TString& serviceTicket) { + TStringStream out; + THttpHeaders outHeaders; + + TRequest req = CreateTiroleRequest(serviceTicket); + TKeepAliveHttpClient::THttpCode code = Client_->DoGet( + req.Url, + &out, + req.Headers, + &outHeaders); + + const THttpInputHeader* reqId = outHeaders.FindHeader("X-Request-Id"); + + Logger_->Debug( + TStringBuilder() << "Succeed to perform request for roles to " << Settings_.TiroleHost + << " (request_id=" << (reqId ? reqId->Value() : "") + << "). code=" << code); + + return {code, std::move(outHeaders), "/v1/get_actual_roles", out.Str(), {}}; + } + + void TRolesFetcher::Update(NUtils::TFetchResult&& fetchResult, TInstant now) { + if (fetchResult.Code == 304) { + Y_ENSURE(CurrentRoles_.Get(), + "tirole did not return any roles because current roles are actual," + " but there are no roles in memory - this should never happen"); + return; + } + + Y_ENSURE(fetchResult.Code == 200, + "Unexpected code from tirole: " << fetchResult.Code << ". " << fetchResult.Response); + + const THttpInputHeader* codec = fetchResult.Headers.FindHeader("X-Tirole-Compression"); + const TStringBuf codecBuf = codec ? codec->Value() : ""; + + NRoles::TRawPtr blob; + try { + blob = std::make_shared<TString>(NRoles::TDecoder::Decode( + codecBuf, + std::move(fetchResult.Response))); + } catch (const std::exception& e) { + throw yexception() << "Failed to decode blob with codec '" << codecBuf + << "': " << e.what(); + } + + CurrentRoles_.Set(NRoles::TParser::Parse(blob)); + + Logger_->Debug( + TStringBuilder() << "Succeed to update roles with revision " + << CurrentRoles_.Get()->GetMeta().Revision); + + TDiskWriter dw(CacheFilePath_, Logger_.Get()); + dw.Write(PrepareDiskFormat(*blob, Settings_.IdmSystemSlug), now); + } + + NTvmAuth::NRoles::TRolesPtr TRolesFetcher::GetCurrentRoles() const { + return CurrentRoles_.Get(); + } + + void TRolesFetcher::ResetConnection() { + Client_->ResetConnection(); + } + + static const char DELIMETER = '\t'; + + std::pair<TString, TString> TRolesFetcher::ParseDiskFormat(TStringBuf filebody) { + TStringBuf slug = filebody.RNextTok(DELIMETER); + return {TString(filebody), CGIUnescapeRet(slug)}; + } + + TString TRolesFetcher::PrepareDiskFormat(TStringBuf roles, TStringBuf slug) { + TStringStream res; + res.Reserve(roles.size() + 1 + slug.size()); + res << roles << DELIMETER << CGIEscapeRet(slug); + return res.Str(); + } + + TRolesFetcher::TRequest TRolesFetcher::CreateTiroleRequest(const TString& serviceTicket) const { + TRolesFetcher::TRequest res; + + TStringStream url; + url.Reserve(512); + url << "/v1/get_actual_roles?"; + url << "system_slug=" << CGIEscapeRet(Settings_.IdmSystemSlug) << "&"; + Settings_.ProcInfo.AddToRequest(url); + res.Url = std::move(url.Str()); + + res.Headers.reserve(2); + res.Headers.emplace(XYaServiceTicket_, serviceTicket); + + NRoles::TRolesPtr roles = CurrentRoles_.Get(); + if (roles) { + res.Headers.emplace(IfNoneMatch_, Join("", "\"", roles->GetMeta().Revision, "\"")); + } + + return res; + } +} diff --git a/library/cpp/tvmauth/client/misc/api/roles_fetcher.h b/library/cpp/tvmauth/client/misc/api/roles_fetcher.h index 63691223b5..36655a8fcf 100644 --- a/library/cpp/tvmauth/client/misc/api/roles_fetcher.h +++ b/library/cpp/tvmauth/client/misc/api/roles_fetcher.h @@ -1,63 +1,63 @@ -#pragma once - -#include "retry_settings.h" - -#include <library/cpp/tvmauth/client/misc/fetch_result.h> -#include <library/cpp/tvmauth/client/misc/proc_info.h> -#include <library/cpp/tvmauth/client/misc/utils.h> -#include <library/cpp/tvmauth/client/misc/roles/roles.h> - -#include <library/cpp/tvmauth/client/logger.h> - -#include <library/cpp/http/simple/http_client.h> - -namespace NTvmAuth::NTvmApi { - struct TRolesFetcherSettings { - TString TiroleHost; - ui16 TirolePort = 0; - TString CacheDir; - NUtils::TProcInfo ProcInfo; - TTvmId SelfTvmId = 0; - TString IdmSystemSlug; - TDuration Timeout = TDuration::Seconds(30); - }; - - class TRolesFetcher { - public: - TRolesFetcher(const TRolesFetcherSettings& settings, TLoggerPtr logger); - - TInstant ReadFromDisk(); - - bool AreRolesOk() const; - static bool IsTimeToUpdate(const TRetrySettings& settings, TDuration sinceUpdate); - static bool ShouldWarn(const TRetrySettings& settings, TDuration sinceUpdate); - - NUtils::TFetchResult FetchActualRoles(const TString& serviceTicket); - void Update(NUtils::TFetchResult&& fetchResult, TInstant now = TInstant::Now()); - - NTvmAuth::NRoles::TRolesPtr GetCurrentRoles() const; - - void ResetConnection(); - - public: - static std::pair<TString, TString> ParseDiskFormat(TStringBuf filebody); - static TString PrepareDiskFormat(TStringBuf roles, TStringBuf slug); - - struct TRequest { - TString Url; - TKeepAliveHttpClient::THeaders Headers; - }; - TRequest CreateTiroleRequest(const TString& serviceTicket) const; - - private: - const TRolesFetcherSettings Settings_; - const TLoggerPtr Logger_; - const TString CacheFilePath_; - const TString XYaServiceTicket_ = "X-Ya-Service-Ticket"; - const TString IfNoneMatch_ = "If-None-Match"; - - NUtils::TProtectedValue<NTvmAuth::NRoles::TRolesPtr> CurrentRoles_; - - std::unique_ptr<TKeepAliveHttpClient> Client_; - }; -} +#pragma once + +#include "retry_settings.h" + +#include <library/cpp/tvmauth/client/misc/fetch_result.h> +#include <library/cpp/tvmauth/client/misc/proc_info.h> +#include <library/cpp/tvmauth/client/misc/utils.h> +#include <library/cpp/tvmauth/client/misc/roles/roles.h> + +#include <library/cpp/tvmauth/client/logger.h> + +#include <library/cpp/http/simple/http_client.h> + +namespace NTvmAuth::NTvmApi { + struct TRolesFetcherSettings { + TString TiroleHost; + ui16 TirolePort = 0; + TString CacheDir; + NUtils::TProcInfo ProcInfo; + TTvmId SelfTvmId = 0; + TString IdmSystemSlug; + TDuration Timeout = TDuration::Seconds(30); + }; + + class TRolesFetcher { + public: + TRolesFetcher(const TRolesFetcherSettings& settings, TLoggerPtr logger); + + TInstant ReadFromDisk(); + + bool AreRolesOk() const; + static bool IsTimeToUpdate(const TRetrySettings& settings, TDuration sinceUpdate); + static bool ShouldWarn(const TRetrySettings& settings, TDuration sinceUpdate); + + NUtils::TFetchResult FetchActualRoles(const TString& serviceTicket); + void Update(NUtils::TFetchResult&& fetchResult, TInstant now = TInstant::Now()); + + NTvmAuth::NRoles::TRolesPtr GetCurrentRoles() const; + + void ResetConnection(); + + public: + static std::pair<TString, TString> ParseDiskFormat(TStringBuf filebody); + static TString PrepareDiskFormat(TStringBuf roles, TStringBuf slug); + + struct TRequest { + TString Url; + TKeepAliveHttpClient::THeaders Headers; + }; + TRequest CreateTiroleRequest(const TString& serviceTicket) const; + + private: + const TRolesFetcherSettings Settings_; + const TLoggerPtr Logger_; + const TString CacheFilePath_; + const TString XYaServiceTicket_ = "X-Ya-Service-Ticket"; + const TString IfNoneMatch_ = "If-None-Match"; + + NUtils::TProtectedValue<NTvmAuth::NRoles::TRolesPtr> CurrentRoles_; + + std::unique_ptr<TKeepAliveHttpClient> Client_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/api/settings.cpp b/library/cpp/tvmauth/client/misc/api/settings.cpp index 71aad75998..2a54834a5a 100644 --- a/library/cpp/tvmauth/client/misc/api/settings.cpp +++ b/library/cpp/tvmauth/client/misc/api/settings.cpp @@ -1,89 +1,89 @@ -#include "settings.h" - -#include <util/datetime/base.h> -#include <util/stream/file.h> -#include <util/system/fs.h> - -#include <set> - -namespace NTvmAuth::NTvmApi { - void TClientSettings::CheckPermissions(const TString& dir) { - const TString name = dir + "/check.tmp"; - - try { - NFs::EnsureExists(dir); - - TFile file(name, CreateAlways | RdWr); - - NFs::Remove(name); - } catch (const std::exception& e) { - NFs::Remove(name); - ythrow TPermissionDenied() << "Permission denied to disk cache directory: " << e.what(); - } - } - - void TClientSettings::CheckValid() const { - if (DiskCacheDir) { - CheckPermissions(DiskCacheDir); - } - - if (TStringBuf(Secret)) { - Y_ENSURE_EX(NeedServiceTicketsFetching(), - TBrokenTvmClientSettings() << "Secret is present but destinations list is empty. It makes no sense"); - } - if (NeedServiceTicketsFetching()) { - Y_ENSURE_EX(SelfTvmId != 0, - TBrokenTvmClientSettings() << "SelfTvmId cannot be 0 if fetching of Service Tickets required"); - Y_ENSURE_EX((TStringBuf)Secret, - TBrokenTvmClientSettings() << "Secret is required for fetching of Service Tickets"); - } - - if (CheckServiceTickets) { - Y_ENSURE_EX(SelfTvmId != 0, - TBrokenTvmClientSettings() << "SelfTvmId cannot be 0 if checking of Service Tickets required"); - } - - if (FetchRolesForIdmSystemSlug) { - Y_ENSURE_EX(DiskCacheDir, - TBrokenTvmClientSettings() << "Disk cache must be enabled to use roles: " - "they can be heavy"); - } - - bool needSmth = NeedServiceTicketsFetching() || - IsServiceTicketCheckingRequired() || - IsUserTicketCheckingRequired(); - Y_ENSURE_EX(needSmth, TBrokenTvmClientSettings() << "Invalid settings: nothing to do"); - - // Useless now: keep it here to avoid forgetting check from TDst. TODO: PASSP-35377 - for (const auto& dst : FetchServiceTicketsForDsts) { - Y_ENSURE_EX(dst.Id != 0, TBrokenTvmClientSettings() << "TvmId cannot be 0"); - } - // TODO: check only FetchServiceTicketsForDsts_ - // Python binding checks settings before normalization - for (const auto& [alias, dst] : FetchServiceTicketsForDstsWithAliases) { - Y_ENSURE_EX(dst.Id != 0, TBrokenTvmClientSettings() << "TvmId cannot be 0"); - } - Y_ENSURE_EX(TiroleTvmId != 0, TBrokenTvmClientSettings() << "TiroleTvmId cannot be 0"); - } - - TClientSettings TClientSettings::CloneNormalized() const { - TClientSettings res = *this; - - std::set<TTvmId> allDsts; - for (const auto& tvmid : res.FetchServiceTicketsForDsts) { - allDsts.insert(tvmid.Id); - } - for (const auto& [alias, tvmid] : res.FetchServiceTicketsForDstsWithAliases) { - allDsts.insert(tvmid.Id); - } - if (FetchRolesForIdmSystemSlug) { - allDsts.insert(res.TiroleTvmId); - } - - res.FetchServiceTicketsForDsts = {allDsts.begin(), allDsts.end()}; - - res.CheckValid(); - - return res; - } -} +#include "settings.h" + +#include <util/datetime/base.h> +#include <util/stream/file.h> +#include <util/system/fs.h> + +#include <set> + +namespace NTvmAuth::NTvmApi { + void TClientSettings::CheckPermissions(const TString& dir) { + const TString name = dir + "/check.tmp"; + + try { + NFs::EnsureExists(dir); + + TFile file(name, CreateAlways | RdWr); + + NFs::Remove(name); + } catch (const std::exception& e) { + NFs::Remove(name); + ythrow TPermissionDenied() << "Permission denied to disk cache directory: " << e.what(); + } + } + + void TClientSettings::CheckValid() const { + if (DiskCacheDir) { + CheckPermissions(DiskCacheDir); + } + + if (TStringBuf(Secret)) { + Y_ENSURE_EX(NeedServiceTicketsFetching(), + TBrokenTvmClientSettings() << "Secret is present but destinations list is empty. It makes no sense"); + } + if (NeedServiceTicketsFetching()) { + Y_ENSURE_EX(SelfTvmId != 0, + TBrokenTvmClientSettings() << "SelfTvmId cannot be 0 if fetching of Service Tickets required"); + Y_ENSURE_EX((TStringBuf)Secret, + TBrokenTvmClientSettings() << "Secret is required for fetching of Service Tickets"); + } + + if (CheckServiceTickets) { + Y_ENSURE_EX(SelfTvmId != 0, + TBrokenTvmClientSettings() << "SelfTvmId cannot be 0 if checking of Service Tickets required"); + } + + if (FetchRolesForIdmSystemSlug) { + Y_ENSURE_EX(DiskCacheDir, + TBrokenTvmClientSettings() << "Disk cache must be enabled to use roles: " + "they can be heavy"); + } + + bool needSmth = NeedServiceTicketsFetching() || + IsServiceTicketCheckingRequired() || + IsUserTicketCheckingRequired(); + Y_ENSURE_EX(needSmth, TBrokenTvmClientSettings() << "Invalid settings: nothing to do"); + + // Useless now: keep it here to avoid forgetting check from TDst. TODO: PASSP-35377 + for (const auto& dst : FetchServiceTicketsForDsts) { + Y_ENSURE_EX(dst.Id != 0, TBrokenTvmClientSettings() << "TvmId cannot be 0"); + } + // TODO: check only FetchServiceTicketsForDsts_ + // Python binding checks settings before normalization + for (const auto& [alias, dst] : FetchServiceTicketsForDstsWithAliases) { + Y_ENSURE_EX(dst.Id != 0, TBrokenTvmClientSettings() << "TvmId cannot be 0"); + } + Y_ENSURE_EX(TiroleTvmId != 0, TBrokenTvmClientSettings() << "TiroleTvmId cannot be 0"); + } + + TClientSettings TClientSettings::CloneNormalized() const { + TClientSettings res = *this; + + std::set<TTvmId> allDsts; + for (const auto& tvmid : res.FetchServiceTicketsForDsts) { + allDsts.insert(tvmid.Id); + } + for (const auto& [alias, tvmid] : res.FetchServiceTicketsForDstsWithAliases) { + allDsts.insert(tvmid.Id); + } + if (FetchRolesForIdmSystemSlug) { + allDsts.insert(res.TiroleTvmId); + } + + res.FetchServiceTicketsForDsts = {allDsts.begin(), allDsts.end()}; + + res.CheckValid(); + + return res; + } +} diff --git a/library/cpp/tvmauth/client/misc/api/settings.h b/library/cpp/tvmauth/client/misc/api/settings.h index 715ab3e02c..9f254859bf 100644 --- a/library/cpp/tvmauth/client/misc/api/settings.h +++ b/library/cpp/tvmauth/client/misc/api/settings.h @@ -1,302 +1,302 @@ -#pragma once - -#include <library/cpp/tvmauth/client/misc/settings.h> - -#include <library/cpp/tvmauth/client/exception.h> - -#include <library/cpp/tvmauth/checked_user_ticket.h> -#include <library/cpp/tvmauth/type.h> - -#include <library/cpp/string_utils/secret_string/secret_string.h> - +#pragma once + +#include <library/cpp/tvmauth/client/misc/settings.h> + +#include <library/cpp/tvmauth/client/exception.h> + +#include <library/cpp/tvmauth/checked_user_ticket.h> +#include <library/cpp/tvmauth/type.h> + +#include <library/cpp/string_utils/secret_string/secret_string.h> + #include <util/datetime/base.h> -#include <util/generic/hash.h> -#include <util/generic/maybe.h> - -namespace NTvmAuth::NTvmApi { - /** - * Settings for TVM client. Uses https://tvm-api.yandex.net to get state. - * At least one of them is required: - * FetchServiceTicketsForDsts_/FetchServiceTicketsForDstsWithAliases_ - * CheckServiceTickets_ - * CheckUserTicketsWithBbEnv_ - */ - class TClientSettings: public NTvmAuth::TClientSettings { - public: - class TDst; - - /** - * Alias is an internal name for destinations within your code. - * You can associate a name with an tvm_id once in your code and use the name as an alias for - * tvm_id to each calling point. Useful for several environments: prod/test/etc. - * @example: - * // init - * static const TString MY_BACKEND = "my backend"; - * TDstMap map = {{MY_BACKEND, TDst(config.get("my_back_tvm_id"))}}; - * ... - * // per request - * TString t = tvmClient.GetServiceTicket(MY_BACKEND); - */ - using TDstMap = THashMap<TAlias, TDst>; - using TDstVector = TVector<TDst>; - - public: - /*! - * NOTE: Please use this option: it provides the best reliability - * NOTE: Client requires read/write permissions - * WARNING: The same directory can be used only: - * - for TVM clients with the same settings - * OR - * - for new client replacing previous - with another config. - * System user must be the same for processes with these clients inside. - * Implementation doesn't provide other scenarios. - */ - TString DiskCacheDir; - - // Required for Service Ticket fetching or checking - TTvmId SelfTvmId = 0; - - // Options for Service Tickets fetching - NSecretString::TSecretString Secret; - /*! - * Client will process both attrs: - * FetchServiceTicketsForDsts_, FetchServiceTicketsForDstsWithAliases_ - * WARNING: It is not way to provide authorization for incoming ServiceTickets! - * It is way only to send your ServiceTickets to your backend! - */ - TDstVector FetchServiceTicketsForDsts; - TDstMap FetchServiceTicketsForDstsWithAliases; - bool IsIncompleteTicketsSetAnError = true; - - // Options for Service Tickets checking - bool CheckServiceTickets = false; - - // Options for User Tickets checking - TMaybe<EBlackboxEnv> CheckUserTicketsWithBbEnv; - - // Options for roles fetching - TString FetchRolesForIdmSystemSlug; - /*! - * By default client checks src from ServiceTicket or default uid from UserTicket - - * to prevent you from forgetting to check it yourself. - * It does binary checks only: - * ticket gets status NoRoles, if there is no role for src or default uid. - * You need to check roles on your own if you have a non-binary role system or - * you have disabled ShouldCheckSrc/ShouldCheckDefaultUid - * - * You may need to disable this check in the following cases: - * - You use GetRoles() to provide verbose message (with revision). - * Double check may be inconsistent: - * binary check inside client uses revision of roles X - i.e. src 100500 has no role, - * exact check in your code uses revision of roles Y - i.e. src 100500 has some roles. - */ - bool ShouldCheckSrc = true; - bool ShouldCheckDefaultUid = true; - - // Options for tests - TString TvmHost = "https://tvm-api.yandex.net"; - ui16 TvmPort = 443; - TString TiroleHost = "https://tirole-api.yandex.net"; - TDuration TvmSocketTimeout = TDuration::Seconds(5); - TDuration TvmConnectTimeout = TDuration::Seconds(30); - ui16 TirolePort = 443; - TTvmId TiroleTvmId = TIROLE_TVMID; - - // for debug purposes - TString LibVersionPrefix; - - void CheckValid() const; - TClientSettings CloneNormalized() const; - - static inline const TTvmId TIROLE_TVMID = 2028120; - static inline const TTvmId TIROLE_TVMID_TEST = 2026536; - - // DEPRECATED API - // TODO: get rid of it: PASSP-35377 - public: - // Deprecated: set attributes directly - void SetSelfTvmId(TTvmId selfTvmId) { - SelfTvmId = selfTvmId; +#include <util/generic/hash.h> +#include <util/generic/maybe.h> + +namespace NTvmAuth::NTvmApi { + /** + * Settings for TVM client. Uses https://tvm-api.yandex.net to get state. + * At least one of them is required: + * FetchServiceTicketsForDsts_/FetchServiceTicketsForDstsWithAliases_ + * CheckServiceTickets_ + * CheckUserTicketsWithBbEnv_ + */ + class TClientSettings: public NTvmAuth::TClientSettings { + public: + class TDst; + + /** + * Alias is an internal name for destinations within your code. + * You can associate a name with an tvm_id once in your code and use the name as an alias for + * tvm_id to each calling point. Useful for several environments: prod/test/etc. + * @example: + * // init + * static const TString MY_BACKEND = "my backend"; + * TDstMap map = {{MY_BACKEND, TDst(config.get("my_back_tvm_id"))}}; + * ... + * // per request + * TString t = tvmClient.GetServiceTicket(MY_BACKEND); + */ + using TDstMap = THashMap<TAlias, TDst>; + using TDstVector = TVector<TDst>; + + public: + /*! + * NOTE: Please use this option: it provides the best reliability + * NOTE: Client requires read/write permissions + * WARNING: The same directory can be used only: + * - for TVM clients with the same settings + * OR + * - for new client replacing previous - with another config. + * System user must be the same for processes with these clients inside. + * Implementation doesn't provide other scenarios. + */ + TString DiskCacheDir; + + // Required for Service Ticket fetching or checking + TTvmId SelfTvmId = 0; + + // Options for Service Tickets fetching + NSecretString::TSecretString Secret; + /*! + * Client will process both attrs: + * FetchServiceTicketsForDsts_, FetchServiceTicketsForDstsWithAliases_ + * WARNING: It is not way to provide authorization for incoming ServiceTickets! + * It is way only to send your ServiceTickets to your backend! + */ + TDstVector FetchServiceTicketsForDsts; + TDstMap FetchServiceTicketsForDstsWithAliases; + bool IsIncompleteTicketsSetAnError = true; + + // Options for Service Tickets checking + bool CheckServiceTickets = false; + + // Options for User Tickets checking + TMaybe<EBlackboxEnv> CheckUserTicketsWithBbEnv; + + // Options for roles fetching + TString FetchRolesForIdmSystemSlug; + /*! + * By default client checks src from ServiceTicket or default uid from UserTicket - + * to prevent you from forgetting to check it yourself. + * It does binary checks only: + * ticket gets status NoRoles, if there is no role for src or default uid. + * You need to check roles on your own if you have a non-binary role system or + * you have disabled ShouldCheckSrc/ShouldCheckDefaultUid + * + * You may need to disable this check in the following cases: + * - You use GetRoles() to provide verbose message (with revision). + * Double check may be inconsistent: + * binary check inside client uses revision of roles X - i.e. src 100500 has no role, + * exact check in your code uses revision of roles Y - i.e. src 100500 has some roles. + */ + bool ShouldCheckSrc = true; + bool ShouldCheckDefaultUid = true; + + // Options for tests + TString TvmHost = "https://tvm-api.yandex.net"; + ui16 TvmPort = 443; + TString TiroleHost = "https://tirole-api.yandex.net"; + TDuration TvmSocketTimeout = TDuration::Seconds(5); + TDuration TvmConnectTimeout = TDuration::Seconds(30); + ui16 TirolePort = 443; + TTvmId TiroleTvmId = TIROLE_TVMID; + + // for debug purposes + TString LibVersionPrefix; + + void CheckValid() const; + TClientSettings CloneNormalized() const; + + static inline const TTvmId TIROLE_TVMID = 2028120; + static inline const TTvmId TIROLE_TVMID_TEST = 2026536; + + // DEPRECATED API + // TODO: get rid of it: PASSP-35377 + public: + // Deprecated: set attributes directly + void SetSelfTvmId(TTvmId selfTvmId) { + SelfTvmId = selfTvmId; + } + + // Deprecated: set attributes directly + void EnableServiceTicketChecking() { + CheckServiceTickets = true; + } + + // Deprecated: set attributes directly + void EnableUserTicketChecking(EBlackboxEnv env) { + CheckUserTicketsWithBbEnv = env; + } + + // Deprecated: set attributes directly + void SetTvmHostPort(const TString& host, ui16 port) { + TvmHost = host; + TvmPort = port; } - // Deprecated: set attributes directly - void EnableServiceTicketChecking() { - CheckServiceTickets = true; - } - - // Deprecated: set attributes directly - void EnableUserTicketChecking(EBlackboxEnv env) { - CheckUserTicketsWithBbEnv = env; - } - - // Deprecated: set attributes directly - void SetTvmHostPort(const TString& host, ui16 port) { - TvmHost = host; - TvmPort = port; - } - - // Deprecated: set attributes directly - void SetTiroleHostPort(const TString& host, ui16 port) { - TiroleHost = host; - TirolePort = port; - } - - // Deprecated: set attributes directly - void EnableRolesFetching(const TString& systemSlug, TTvmId tiroleTvmId = TIROLE_TVMID) { - TiroleTvmId = tiroleTvmId; - FetchRolesForIdmSystemSlug = systemSlug; - } - - // Deprecated: set attributes directly - void DoNotCheckSrcByDefault() { - ShouldCheckSrc = false; - } - - // Deprecated: set attributes directly - void DoNotCheckDefaultUidByDefault() { - ShouldCheckDefaultUid = false; - } - - // Deprecated: set attributes directly - void SetDiskCacheDir(const TString& dir) { - DiskCacheDir = dir; - } - - // Deprecated: set attributes directly + // Deprecated: set attributes directly + void SetTiroleHostPort(const TString& host, ui16 port) { + TiroleHost = host; + TirolePort = port; + } + + // Deprecated: set attributes directly + void EnableRolesFetching(const TString& systemSlug, TTvmId tiroleTvmId = TIROLE_TVMID) { + TiroleTvmId = tiroleTvmId; + FetchRolesForIdmSystemSlug = systemSlug; + } + + // Deprecated: set attributes directly + void DoNotCheckSrcByDefault() { + ShouldCheckSrc = false; + } + + // Deprecated: set attributes directly + void DoNotCheckDefaultUidByDefault() { + ShouldCheckDefaultUid = false; + } + + // Deprecated: set attributes directly + void SetDiskCacheDir(const TString& dir) { + DiskCacheDir = dir; + } + + // Deprecated: set attributes directly void EnableServiceTicketsFetchOptions(const TStringBuf selfSecret, TDstMap&& dsts, const bool considerIncompleteTicketsSetAsError = true) { - IsIncompleteTicketsSetAnError = considerIncompleteTicketsSetAsError; - Secret = selfSecret; - - FetchServiceTicketsForDsts = TDstVector{}; - FetchServiceTicketsForDsts.reserve(dsts.size()); - for (const auto& pair : dsts) { - FetchServiceTicketsForDsts.push_back(pair.second); - } - - FetchServiceTicketsForDstsWithAliases = std::move(dsts); - } - - // Deprecated: set attributes directly + IsIncompleteTicketsSetAnError = considerIncompleteTicketsSetAsError; + Secret = selfSecret; + + FetchServiceTicketsForDsts = TDstVector{}; + FetchServiceTicketsForDsts.reserve(dsts.size()); + for (const auto& pair : dsts) { + FetchServiceTicketsForDsts.push_back(pair.second); + } + + FetchServiceTicketsForDstsWithAliases = std::move(dsts); + } + + // Deprecated: set attributes directly void EnableServiceTicketsFetchOptions(const TStringBuf selfSecret, TDstVector&& dsts, const bool considerIncompleteTicketsSetAsError = true) { - IsIncompleteTicketsSetAnError = considerIncompleteTicketsSetAsError; - Secret = selfSecret; - FetchServiceTicketsForDsts = std::move(dsts); + IsIncompleteTicketsSetAnError = considerIncompleteTicketsSetAsError; + Secret = selfSecret; + FetchServiceTicketsForDsts = std::move(dsts); + } + + public: + bool IsServiceTicketFetchingRequired() const { + return bool(Secret.Value()); + } + + const TStringBuf GetSelfSecret() const { + return Secret; + } + + bool HasDstAliases() const { + return !FetchServiceTicketsForDstsWithAliases.empty(); + } + + const TDstMap& GetDstAliases() const { + return FetchServiceTicketsForDstsWithAliases; + } + + const TDstVector& GetDestinations() const { + return FetchServiceTicketsForDsts; + } + + bool IsUserTicketCheckingRequired() const { + return bool(CheckUserTicketsWithBbEnv); + } + + EBlackboxEnv GetEnvForUserTickets() const { + return *CheckUserTicketsWithBbEnv; + } + + bool IsServiceTicketCheckingRequired() const { + return CheckServiceTickets; + } + + bool IsDiskCacheUsed() const { + return bool(DiskCacheDir); + } + + TString GetDiskCacheDir() const { + return DiskCacheDir; + } + + TTvmId GetSelfTvmId() const { + return SelfTvmId; + } + + const TString& GetLibVersionPrefix() const { + return LibVersionPrefix; + } + + const TString& GetTvmHost() const { + return TvmHost; } - public: - bool IsServiceTicketFetchingRequired() const { - return bool(Secret.Value()); + ui16 GetTvmPort() const { + return TvmPort; } - const TStringBuf GetSelfSecret() const { - return Secret; - } - - bool HasDstAliases() const { - return !FetchServiceTicketsForDstsWithAliases.empty(); - } - - const TDstMap& GetDstAliases() const { - return FetchServiceTicketsForDstsWithAliases; - } - - const TDstVector& GetDestinations() const { - return FetchServiceTicketsForDsts; - } - - bool IsUserTicketCheckingRequired() const { - return bool(CheckUserTicketsWithBbEnv); - } - - EBlackboxEnv GetEnvForUserTickets() const { - return *CheckUserTicketsWithBbEnv; - } - - bool IsServiceTicketCheckingRequired() const { - return CheckServiceTickets; - } - - bool IsDiskCacheUsed() const { - return bool(DiskCacheDir); - } - - TString GetDiskCacheDir() const { - return DiskCacheDir; - } - - TTvmId GetSelfTvmId() const { - return SelfTvmId; - } - - const TString& GetLibVersionPrefix() const { - return LibVersionPrefix; - } - - const TString& GetTvmHost() const { - return TvmHost; - } - - ui16 GetTvmPort() const { - return TvmPort; - } - - bool IsRolesFetchingEnabled() const { - return bool(FetchRolesForIdmSystemSlug); - } - - TTvmId GetTiroleTvmId() const { - return TiroleTvmId; - } - - const TString& GetIdmSystemSlug() const { - return FetchRolesForIdmSystemSlug; - } - - const TString& GetTiroleHost() const { - return TiroleHost; - } - - ui16 GetTirolePort() const { - return TirolePort; - } - - bool NeedServiceTicketsFetching() const { - return !FetchServiceTicketsForDsts.empty() || - !FetchServiceTicketsForDstsWithAliases.empty() || - FetchRolesForIdmSystemSlug; - } - - // TODO: get rid of TDst: PASSP-35377 - class TDst { - public: - TDst(TTvmId id) - : Id(id) - { - Y_ENSURE_EX(id != 0, TBrokenTvmClientSettings() << "TvmId cannot be 0"); - } - - TTvmId Id; - - bool operator==(const TDst& o) const { - return Id == o.Id; - } - - bool operator<(const TDst& o) const { - return Id < o.Id; - } - - public: // for python binding - TDst() - : Id(0) - { - } - }; - - public: - static void CheckPermissions(const TString& dir); - }; -} + bool IsRolesFetchingEnabled() const { + return bool(FetchRolesForIdmSystemSlug); + } + + TTvmId GetTiroleTvmId() const { + return TiroleTvmId; + } + + const TString& GetIdmSystemSlug() const { + return FetchRolesForIdmSystemSlug; + } + + const TString& GetTiroleHost() const { + return TiroleHost; + } + + ui16 GetTirolePort() const { + return TirolePort; + } + + bool NeedServiceTicketsFetching() const { + return !FetchServiceTicketsForDsts.empty() || + !FetchServiceTicketsForDstsWithAliases.empty() || + FetchRolesForIdmSystemSlug; + } + + // TODO: get rid of TDst: PASSP-35377 + class TDst { + public: + TDst(TTvmId id) + : Id(id) + { + Y_ENSURE_EX(id != 0, TBrokenTvmClientSettings() << "TvmId cannot be 0"); + } + + TTvmId Id; + + bool operator==(const TDst& o) const { + return Id == o.Id; + } + + bool operator<(const TDst& o) const { + return Id < o.Id; + } + + public: // for python binding + TDst() + : Id(0) + { + } + }; + + public: + static void CheckPermissions(const TString& dir); + }; +} diff --git a/library/cpp/tvmauth/client/misc/api/threaded_updater.cpp b/library/cpp/tvmauth/client/misc/api/threaded_updater.cpp index a7df49c05d..c437e892dc 100644 --- a/library/cpp/tvmauth/client/misc/api/threaded_updater.cpp +++ b/library/cpp/tvmauth/client/misc/api/threaded_updater.cpp @@ -1,954 +1,954 @@ -#include "threaded_updater.h" - -#include <library/cpp/tvmauth/client/misc/disk_cache.h> -#include <library/cpp/tvmauth/client/misc/utils.h> -#include <library/cpp/tvmauth/client/misc/retry_settings/v1/settings.pb.h> - -#include <library/cpp/tvmauth/client/logger.h> - -#include <library/cpp/json/json_reader.h> - -#include <util/stream/str.h> -#include <util/string/builder.h> -#include <util/string/cast.h> -#include <util/system/thread.h> - -namespace NTvmAuth::NTvmApi { - static TString CreatePublicKeysUrl(const TClientSettings& settings, - const NUtils::TProcInfo& procInfo) { - TStringStream s; - s << "/2/keys"; - s << "?"; - procInfo.AddToRequest(s); - - s << "&get_retry_settings=yes"; - - if (settings.GetSelfTvmId() != 0) { - s << "&src=" << settings.GetSelfTvmId(); - } - - if (settings.IsUserTicketCheckingRequired()) { - s << "&env=" << static_cast<int>(settings.GetEnvForUserTickets()); - } - - return s.Str(); - } - - TAsyncUpdaterPtr TThreadedUpdater::Create(const TClientSettings& settings, TLoggerPtr logger) { - Y_ENSURE_EX(logger, TNonRetriableException() << "Logger is required"); - THolder<TThreadedUpdater> p(new TThreadedUpdater(settings, std::move(logger))); - p->Init(); - p->StartWorker(); - return p.Release(); - } - - TThreadedUpdater::~TThreadedUpdater() { - ExpBackoff_.SetEnabled(false); - ExpBackoff_.Interrupt(); - StopWorker(); // Required here to avoid using of deleted members - } - - TClientStatus TThreadedUpdater::GetStatus() const { - const TClientStatus::ECode state = GetState(); +#include "threaded_updater.h" + +#include <library/cpp/tvmauth/client/misc/disk_cache.h> +#include <library/cpp/tvmauth/client/misc/utils.h> +#include <library/cpp/tvmauth/client/misc/retry_settings/v1/settings.pb.h> + +#include <library/cpp/tvmauth/client/logger.h> + +#include <library/cpp/json/json_reader.h> + +#include <util/stream/str.h> +#include <util/string/builder.h> +#include <util/string/cast.h> +#include <util/system/thread.h> + +namespace NTvmAuth::NTvmApi { + static TString CreatePublicKeysUrl(const TClientSettings& settings, + const NUtils::TProcInfo& procInfo) { + TStringStream s; + s << "/2/keys"; + s << "?"; + procInfo.AddToRequest(s); + + s << "&get_retry_settings=yes"; + + if (settings.GetSelfTvmId() != 0) { + s << "&src=" << settings.GetSelfTvmId(); + } + + if (settings.IsUserTicketCheckingRequired()) { + s << "&env=" << static_cast<int>(settings.GetEnvForUserTickets()); + } + + return s.Str(); + } + + TAsyncUpdaterPtr TThreadedUpdater::Create(const TClientSettings& settings, TLoggerPtr logger) { + Y_ENSURE_EX(logger, TNonRetriableException() << "Logger is required"); + THolder<TThreadedUpdater> p(new TThreadedUpdater(settings, std::move(logger))); + p->Init(); + p->StartWorker(); + return p.Release(); + } + + TThreadedUpdater::~TThreadedUpdater() { + ExpBackoff_.SetEnabled(false); + ExpBackoff_.Interrupt(); + StopWorker(); // Required here to avoid using of deleted members + } + + TClientStatus TThreadedUpdater::GetStatus() const { + const TClientStatus::ECode state = GetState(); return TClientStatus(state, GetLastError(state == TClientStatus::Ok || state == TClientStatus::IncompleteTicketsSet)); - } - - NRoles::TRolesPtr TThreadedUpdater::GetRoles() const { - Y_ENSURE_EX(RolesFetcher_, - TBrokenTvmClientSettings() << "Roles were not configured in settings"); - return RolesFetcher_->GetCurrentRoles(); - } - - TClientStatus::ECode TThreadedUpdater::GetState() const { - const TInstant now = TInstant::Now(); - - if (Settings_.IsServiceTicketFetchingRequired()) { - if (AreServiceTicketsInvalid(now)) { - return TClientStatus::Error; - } - auto tickets = GetCachedServiceTickets(); - if (!tickets) { - return TClientStatus::Error; - } - if (tickets->TicketsById.size() < Destinations_.size()) { - if (Settings_.IsIncompleteTicketsSetAnError) { + } + + NRoles::TRolesPtr TThreadedUpdater::GetRoles() const { + Y_ENSURE_EX(RolesFetcher_, + TBrokenTvmClientSettings() << "Roles were not configured in settings"); + return RolesFetcher_->GetCurrentRoles(); + } + + TClientStatus::ECode TThreadedUpdater::GetState() const { + const TInstant now = TInstant::Now(); + + if (Settings_.IsServiceTicketFetchingRequired()) { + if (AreServiceTicketsInvalid(now)) { + return TClientStatus::Error; + } + auto tickets = GetCachedServiceTickets(); + if (!tickets) { + return TClientStatus::Error; + } + if (tickets->TicketsById.size() < Destinations_.size()) { + if (Settings_.IsIncompleteTicketsSetAnError) { return TClientStatus::Error; } else { return TClientStatus::IncompleteTicketsSet; } - } - } - if ((Settings_.IsServiceTicketCheckingRequired() || Settings_.IsUserTicketCheckingRequired()) && ArePublicKeysInvalid(now)) { - return TClientStatus::Error; - } - - const TDuration sincePublicKeysUpdate = now - GetUpdateTimeOfPublicKeys(); - const TDuration sinceServiceTicketsUpdate = now - GetUpdateTimeOfServiceTickets(); - const TDuration sinceRolesUpdate = now - GetUpdateTimeOfRoles(); - - if (Settings_.IsServiceTicketFetchingRequired() && sinceServiceTicketsUpdate > ServiceTicketsDurations_.Expiring) { - return TClientStatus::Warning; - } - if ((Settings_.IsServiceTicketCheckingRequired() || Settings_.IsUserTicketCheckingRequired()) && - sincePublicKeysUpdate > PublicKeysDurations_.Expiring) - { - return TClientStatus::Warning; - } - if (RolesFetcher_ && TRolesFetcher::ShouldWarn(RetrySettings_, sinceRolesUpdate)) { - return TClientStatus::Warning; - } - - return TClientStatus::Ok; - } - - TThreadedUpdater::TThreadedUpdater(const TClientSettings& settings, TLoggerPtr logger) + } + } + if ((Settings_.IsServiceTicketCheckingRequired() || Settings_.IsUserTicketCheckingRequired()) && ArePublicKeysInvalid(now)) { + return TClientStatus::Error; + } + + const TDuration sincePublicKeysUpdate = now - GetUpdateTimeOfPublicKeys(); + const TDuration sinceServiceTicketsUpdate = now - GetUpdateTimeOfServiceTickets(); + const TDuration sinceRolesUpdate = now - GetUpdateTimeOfRoles(); + + if (Settings_.IsServiceTicketFetchingRequired() && sinceServiceTicketsUpdate > ServiceTicketsDurations_.Expiring) { + return TClientStatus::Warning; + } + if ((Settings_.IsServiceTicketCheckingRequired() || Settings_.IsUserTicketCheckingRequired()) && + sincePublicKeysUpdate > PublicKeysDurations_.Expiring) + { + return TClientStatus::Warning; + } + if (RolesFetcher_ && TRolesFetcher::ShouldWarn(RetrySettings_, sinceRolesUpdate)) { + return TClientStatus::Warning; + } + + return TClientStatus::Ok; + } + + TThreadedUpdater::TThreadedUpdater(const TClientSettings& settings, TLoggerPtr logger) : TThreadedUpdaterBase( - TRetrySettings{}.WorkerAwakingPeriod, - std::move(logger), - settings.GetTvmHost(), - settings.GetTvmPort(), - settings.TvmSocketTimeout, - settings.TvmConnectTimeout) - , ExpBackoff_(RetrySettings_.BackoffSettings) - , Settings_(settings.CloneNormalized()) - , ProcInfo_(NUtils::TProcInfo::Create(Settings_.GetLibVersionPrefix())) - , PublicKeysUrl_(CreatePublicKeysUrl(Settings_, ProcInfo_)) - , DstAliases_(MakeAliasMap(Settings_)) - , Headers_({{"Content-Type", "application/x-www-form-urlencoded"}}) - , Random_(TInstant::Now().MicroSeconds()) - { - if (Settings_.IsServiceTicketFetchingRequired()) { - SigningContext_ = TServiceContext::SigningFactory(Settings_.GetSelfSecret()); - } - - if (Settings_.IsServiceTicketFetchingRequired()) { - Destinations_ = {Settings_.GetDestinations().begin(), Settings_.GetDestinations().end()}; - } - - PublicKeysDurations_.RefreshPeriod = TDuration::Days(1); - ServiceTicketsDurations_.RefreshPeriod = TDuration::Hours(1); - - if (Settings_.IsUserTicketCheckingRequired()) { - SetBbEnv(Settings_.GetEnvForUserTickets()); - } - - if (Settings_.IsRolesFetchingEnabled()) { - RolesFetcher_ = std::make_unique<TRolesFetcher>( - TRolesFetcherSettings{ - Settings_.GetTiroleHost(), - Settings_.GetTirolePort(), - Settings_.GetDiskCacheDir(), - ProcInfo_, - Settings_.GetSelfTvmId(), - Settings_.GetIdmSystemSlug(), - }, - Logger_); - } - - if (Settings_.IsDiskCacheUsed()) { - TString path = Settings_.GetDiskCacheDir(); - if (path.back() != '/') { - path.push_back('/'); - } - - if (Settings_.IsServiceTicketFetchingRequired()) { - ServiceTicketsFilepath_ = path; - ServiceTicketsFilepath_.append("service_tickets"); - } - - if (Settings_.IsServiceTicketCheckingRequired() || Settings_.IsUserTicketCheckingRequired()) { - PublicKeysFilepath_ = path; - PublicKeysFilepath_.append("public_keys"); - } - - RetrySettingsFilepath_ = path + "retry_settings"; + TRetrySettings{}.WorkerAwakingPeriod, + std::move(logger), + settings.GetTvmHost(), + settings.GetTvmPort(), + settings.TvmSocketTimeout, + settings.TvmConnectTimeout) + , ExpBackoff_(RetrySettings_.BackoffSettings) + , Settings_(settings.CloneNormalized()) + , ProcInfo_(NUtils::TProcInfo::Create(Settings_.GetLibVersionPrefix())) + , PublicKeysUrl_(CreatePublicKeysUrl(Settings_, ProcInfo_)) + , DstAliases_(MakeAliasMap(Settings_)) + , Headers_({{"Content-Type", "application/x-www-form-urlencoded"}}) + , Random_(TInstant::Now().MicroSeconds()) + { + if (Settings_.IsServiceTicketFetchingRequired()) { + SigningContext_ = TServiceContext::SigningFactory(Settings_.GetSelfSecret()); + } + + if (Settings_.IsServiceTicketFetchingRequired()) { + Destinations_ = {Settings_.GetDestinations().begin(), Settings_.GetDestinations().end()}; + } + + PublicKeysDurations_.RefreshPeriod = TDuration::Days(1); + ServiceTicketsDurations_.RefreshPeriod = TDuration::Hours(1); + + if (Settings_.IsUserTicketCheckingRequired()) { + SetBbEnv(Settings_.GetEnvForUserTickets()); + } + + if (Settings_.IsRolesFetchingEnabled()) { + RolesFetcher_ = std::make_unique<TRolesFetcher>( + TRolesFetcherSettings{ + Settings_.GetTiroleHost(), + Settings_.GetTirolePort(), + Settings_.GetDiskCacheDir(), + ProcInfo_, + Settings_.GetSelfTvmId(), + Settings_.GetIdmSystemSlug(), + }, + Logger_); + } + + if (Settings_.IsDiskCacheUsed()) { + TString path = Settings_.GetDiskCacheDir(); + if (path.back() != '/') { + path.push_back('/'); + } + + if (Settings_.IsServiceTicketFetchingRequired()) { + ServiceTicketsFilepath_ = path; + ServiceTicketsFilepath_.append("service_tickets"); + } + + if (Settings_.IsServiceTicketCheckingRequired() || Settings_.IsUserTicketCheckingRequired()) { + PublicKeysFilepath_ = path; + PublicKeysFilepath_.append("public_keys"); + } + + RetrySettingsFilepath_ = path + "retry_settings"; } else { LogInfo("Disk cache disabled. Please set disk cache directory in settings for best reliability"); - } - } - - void TThreadedUpdater::Init() { - ReadStateFromDisk(); - ClearErrors(); - ExpBackoff_.SetEnabled(false); - - // First of all try to get tickets: there are a lot of reasons to fail this request. - // As far as disk cache usually disabled, client will not fetch keys before fail on every ctor call. - UpdateServiceTickets(); - if (!AreServicesTicketsOk()) { - ThrowLastError(); - } - - UpdatePublicKeys(); - if (!IsServiceContextOk() || !IsUserContextOk()) { - ThrowLastError(); - } - - UpdateRoles(); - if (RolesFetcher_ && !RolesFetcher_->AreRolesOk()) { - ThrowLastError(); - } - - Inited_ = true; - ExpBackoff_.SetEnabled(true); - } - - void TThreadedUpdater::UpdateServiceTickets() { - if (!Settings_.IsServiceTicketFetchingRequired()) { - return; - } - - TInstant stut = GetUpdateTimeOfServiceTickets(); - try { - if (IsTimeToUpdateServiceTickets(stut)) { - UpdateAllServiceTickets(); - NeedFetchMissingServiceTickets_ = false; - } else if (NeedFetchMissingServiceTickets_ && GetCachedServiceTickets()->TicketsById.size() < Destinations_.size()) { - UpdateMissingServiceTickets(Destinations_); - NeedFetchMissingServiceTickets_ = false; - } - if (AreServicesTicketsOk()) { - ClearError(EScope::ServiceTickets); - } - } catch (const std::exception& e) { - ProcessError(EType::Retriable, EScope::ServiceTickets, e.what()); - LogWarning(TStringBuilder() << "Failed to update service tickets: " << e.what()); - if (TInstant::Now() - stut > ServiceTicketsDurations_.Expiring) { - LogError("Service tickets have not been refreshed for too long period"); - } - } - } - - void TThreadedUpdater::UpdateAllServiceTickets() { - THttpResult st = GetServiceTicketsFromHttp(Destinations_, RetrySettings_.DstsLimit); - - auto oldCache = GetCachedServiceTickets(); - if (oldCache) { - for (const auto& pair : oldCache->ErrorsById) { - st.TicketsWithErrors.Errors.insert(pair); - } - } - - UpdateServiceTicketsCache(std::move(st.TicketsWithErrors), TInstant::Now()); - if (ServiceTicketsFilepath_) { - DiskCacheServiceTickets_ = CreateJsonArray(st.Responses); - TDiskWriter w(ServiceTicketsFilepath_, Logger_.Get()); - w.Write(PrepareTicketsForDisk(DiskCacheServiceTickets_, Settings_.GetSelfTvmId())); - } - } - - TServiceTicketsPtr TThreadedUpdater::UpdateMissingServiceTickets(const TDstSet& required) { - TServiceTicketsPtr cache = GetCachedServiceTickets(); - TClientSettings::TDstVector dsts = FindMissingDsts(cache, required); - - if (dsts.empty()) { - return cache; - } - - THttpResult st = GetServiceTicketsFromHttp(dsts, RetrySettings_.DstsLimit); - - size_t gotTickets = st.TicketsWithErrors.Tickets.size(); - - for (const auto& pair : cache->TicketsById) { - st.TicketsWithErrors.Tickets.insert(pair); - } - for (const auto& pair : cache->ErrorsById) { - st.TicketsWithErrors.Errors.insert(pair); - } - for (const auto& pair : st.TicketsWithErrors.Tickets) { - st.TicketsWithErrors.Errors.erase(pair.first); - } - - TServiceTicketsPtr c = UpdateServiceTicketsCachePartly( - std::move(st.TicketsWithErrors), - gotTickets); - if (!c) { - LogWarning("UpdateMissingServiceTickets: new cache is NULL. BUG?"); - c = cache; - } - - if (!ServiceTicketsFilepath_) { - return c; - } - - DiskCacheServiceTickets_ = AppendToJsonArray(DiskCacheServiceTickets_, st.Responses); - - TDiskWriter w(ServiceTicketsFilepath_, Logger_.Get()); - w.Write(PrepareTicketsForDisk(DiskCacheServiceTickets_, Settings_.GetSelfTvmId())); - - return c; - } - - void TThreadedUpdater::UpdatePublicKeys() { - if (!Settings_.IsServiceTicketCheckingRequired() && !Settings_.IsUserTicketCheckingRequired()) { - return; - } - - TInstant pkut = GetUpdateTimeOfPublicKeys(); - if (!IsTimeToUpdatePublicKeys(pkut)) { - return; - } - - try { - TString publicKeys = GetPublicKeysFromHttp(); - - UpdatePublicKeysCache(publicKeys, TInstant::Now()); - if (PublicKeysFilepath_) { - TDiskWriter w(PublicKeysFilepath_, Logger_.Get()); - w.Write(publicKeys); - } - if (IsServiceContextOk() && IsUserContextOk()) { - ClearError(EScope::PublicKeys); - } - } catch (const std::exception& e) { - ProcessError(EType::Retriable, EScope::PublicKeys, e.what()); - LogWarning(TStringBuilder() << "Failed to update public keys: " << e.what()); - if (TInstant::Now() - pkut > PublicKeysDurations_.Expiring) { - LogError("Public keys have not been refreshed for too long period"); - } - } - } - - void TThreadedUpdater::UpdateRoles() { - if (!RolesFetcher_) { - return; - } - - TInstant rut = GetUpdateTimeOfRoles(); - if (!TRolesFetcher::IsTimeToUpdate(RetrySettings_, TInstant::Now() - rut)) { - return; - } - - struct TCloser { - TRolesFetcher* Fetcher; - ~TCloser() { - Fetcher->ResetConnection(); - } - } closer{RolesFetcher_.get()}; - - try { - TServiceTicketsPtr st = GetCachedServiceTickets(); - Y_ENSURE(st, "No one service ticket in memory: how it possible?"); - auto it = st->TicketsById.find(Settings_.GetTiroleTvmId()); - Y_ENSURE(it != st->TicketsById.end(), - "Missing tvmid for tirole in cache: " << Settings_.GetTiroleTvmId()); - - RolesFetcher_->Update( - FetchWithRetries( - [&]() { return RolesFetcher_->FetchActualRoles(it->second); }, - EScope::Roles)); - SetUpdateTimeOfRoles(TInstant::Now()); - - if (RolesFetcher_->AreRolesOk()) { - ClearError(EScope::Roles); - } - } catch (const std::exception& e) { - ProcessError(EType::Retriable, EScope::Roles, e.what()); - LogWarning(TStringBuilder() << "Failed to update roles: " << e.what()); - if (TRolesFetcher::ShouldWarn(RetrySettings_, TInstant::Now() - rut)) { - LogError("Roles have not been refreshed for too long period"); - } - } - } - - TServiceTicketsPtr TThreadedUpdater::UpdateServiceTicketsCachePartly( - TAsyncUpdaterBase::TPairTicketsErrors&& tickets, - size_t got) { - size_t count = tickets.Tickets.size(); - TServiceTicketsPtr c = MakeIntrusiveConst<TServiceTickets>(std::move(tickets.Tickets), - std::move(tickets.Errors), - DstAliases_); - SetServiceTickets(c); - - LogInfo(TStringBuilder() - << "Cache was partly updated with " << got - << " service ticket(s). total: " << count); - - return c; - } - - void TThreadedUpdater::UpdateServiceTicketsCache(TPairTicketsErrors&& tickets, TInstant time) { - size_t count = tickets.Tickets.size(); - SetServiceTickets(MakeIntrusiveConst<TServiceTickets>(std::move(tickets.Tickets), - std::move(tickets.Errors), - DstAliases_)); - - SetUpdateTimeOfServiceTickets(time); - + } + } + + void TThreadedUpdater::Init() { + ReadStateFromDisk(); + ClearErrors(); + ExpBackoff_.SetEnabled(false); + + // First of all try to get tickets: there are a lot of reasons to fail this request. + // As far as disk cache usually disabled, client will not fetch keys before fail on every ctor call. + UpdateServiceTickets(); + if (!AreServicesTicketsOk()) { + ThrowLastError(); + } + + UpdatePublicKeys(); + if (!IsServiceContextOk() || !IsUserContextOk()) { + ThrowLastError(); + } + + UpdateRoles(); + if (RolesFetcher_ && !RolesFetcher_->AreRolesOk()) { + ThrowLastError(); + } + + Inited_ = true; + ExpBackoff_.SetEnabled(true); + } + + void TThreadedUpdater::UpdateServiceTickets() { + if (!Settings_.IsServiceTicketFetchingRequired()) { + return; + } + + TInstant stut = GetUpdateTimeOfServiceTickets(); + try { + if (IsTimeToUpdateServiceTickets(stut)) { + UpdateAllServiceTickets(); + NeedFetchMissingServiceTickets_ = false; + } else if (NeedFetchMissingServiceTickets_ && GetCachedServiceTickets()->TicketsById.size() < Destinations_.size()) { + UpdateMissingServiceTickets(Destinations_); + NeedFetchMissingServiceTickets_ = false; + } + if (AreServicesTicketsOk()) { + ClearError(EScope::ServiceTickets); + } + } catch (const std::exception& e) { + ProcessError(EType::Retriable, EScope::ServiceTickets, e.what()); + LogWarning(TStringBuilder() << "Failed to update service tickets: " << e.what()); + if (TInstant::Now() - stut > ServiceTicketsDurations_.Expiring) { + LogError("Service tickets have not been refreshed for too long period"); + } + } + } + + void TThreadedUpdater::UpdateAllServiceTickets() { + THttpResult st = GetServiceTicketsFromHttp(Destinations_, RetrySettings_.DstsLimit); + + auto oldCache = GetCachedServiceTickets(); + if (oldCache) { + for (const auto& pair : oldCache->ErrorsById) { + st.TicketsWithErrors.Errors.insert(pair); + } + } + + UpdateServiceTicketsCache(std::move(st.TicketsWithErrors), TInstant::Now()); + if (ServiceTicketsFilepath_) { + DiskCacheServiceTickets_ = CreateJsonArray(st.Responses); + TDiskWriter w(ServiceTicketsFilepath_, Logger_.Get()); + w.Write(PrepareTicketsForDisk(DiskCacheServiceTickets_, Settings_.GetSelfTvmId())); + } + } + + TServiceTicketsPtr TThreadedUpdater::UpdateMissingServiceTickets(const TDstSet& required) { + TServiceTicketsPtr cache = GetCachedServiceTickets(); + TClientSettings::TDstVector dsts = FindMissingDsts(cache, required); + + if (dsts.empty()) { + return cache; + } + + THttpResult st = GetServiceTicketsFromHttp(dsts, RetrySettings_.DstsLimit); + + size_t gotTickets = st.TicketsWithErrors.Tickets.size(); + + for (const auto& pair : cache->TicketsById) { + st.TicketsWithErrors.Tickets.insert(pair); + } + for (const auto& pair : cache->ErrorsById) { + st.TicketsWithErrors.Errors.insert(pair); + } + for (const auto& pair : st.TicketsWithErrors.Tickets) { + st.TicketsWithErrors.Errors.erase(pair.first); + } + + TServiceTicketsPtr c = UpdateServiceTicketsCachePartly( + std::move(st.TicketsWithErrors), + gotTickets); + if (!c) { + LogWarning("UpdateMissingServiceTickets: new cache is NULL. BUG?"); + c = cache; + } + + if (!ServiceTicketsFilepath_) { + return c; + } + + DiskCacheServiceTickets_ = AppendToJsonArray(DiskCacheServiceTickets_, st.Responses); + + TDiskWriter w(ServiceTicketsFilepath_, Logger_.Get()); + w.Write(PrepareTicketsForDisk(DiskCacheServiceTickets_, Settings_.GetSelfTvmId())); + + return c; + } + + void TThreadedUpdater::UpdatePublicKeys() { + if (!Settings_.IsServiceTicketCheckingRequired() && !Settings_.IsUserTicketCheckingRequired()) { + return; + } + + TInstant pkut = GetUpdateTimeOfPublicKeys(); + if (!IsTimeToUpdatePublicKeys(pkut)) { + return; + } + + try { + TString publicKeys = GetPublicKeysFromHttp(); + + UpdatePublicKeysCache(publicKeys, TInstant::Now()); + if (PublicKeysFilepath_) { + TDiskWriter w(PublicKeysFilepath_, Logger_.Get()); + w.Write(publicKeys); + } + if (IsServiceContextOk() && IsUserContextOk()) { + ClearError(EScope::PublicKeys); + } + } catch (const std::exception& e) { + ProcessError(EType::Retriable, EScope::PublicKeys, e.what()); + LogWarning(TStringBuilder() << "Failed to update public keys: " << e.what()); + if (TInstant::Now() - pkut > PublicKeysDurations_.Expiring) { + LogError("Public keys have not been refreshed for too long period"); + } + } + } + + void TThreadedUpdater::UpdateRoles() { + if (!RolesFetcher_) { + return; + } + + TInstant rut = GetUpdateTimeOfRoles(); + if (!TRolesFetcher::IsTimeToUpdate(RetrySettings_, TInstant::Now() - rut)) { + return; + } + + struct TCloser { + TRolesFetcher* Fetcher; + ~TCloser() { + Fetcher->ResetConnection(); + } + } closer{RolesFetcher_.get()}; + + try { + TServiceTicketsPtr st = GetCachedServiceTickets(); + Y_ENSURE(st, "No one service ticket in memory: how it possible?"); + auto it = st->TicketsById.find(Settings_.GetTiroleTvmId()); + Y_ENSURE(it != st->TicketsById.end(), + "Missing tvmid for tirole in cache: " << Settings_.GetTiroleTvmId()); + + RolesFetcher_->Update( + FetchWithRetries( + [&]() { return RolesFetcher_->FetchActualRoles(it->second); }, + EScope::Roles)); + SetUpdateTimeOfRoles(TInstant::Now()); + + if (RolesFetcher_->AreRolesOk()) { + ClearError(EScope::Roles); + } + } catch (const std::exception& e) { + ProcessError(EType::Retriable, EScope::Roles, e.what()); + LogWarning(TStringBuilder() << "Failed to update roles: " << e.what()); + if (TRolesFetcher::ShouldWarn(RetrySettings_, TInstant::Now() - rut)) { + LogError("Roles have not been refreshed for too long period"); + } + } + } + + TServiceTicketsPtr TThreadedUpdater::UpdateServiceTicketsCachePartly( + TAsyncUpdaterBase::TPairTicketsErrors&& tickets, + size_t got) { + size_t count = tickets.Tickets.size(); + TServiceTicketsPtr c = MakeIntrusiveConst<TServiceTickets>(std::move(tickets.Tickets), + std::move(tickets.Errors), + DstAliases_); + SetServiceTickets(c); + + LogInfo(TStringBuilder() + << "Cache was partly updated with " << got + << " service ticket(s). total: " << count); + + return c; + } + + void TThreadedUpdater::UpdateServiceTicketsCache(TPairTicketsErrors&& tickets, TInstant time) { + size_t count = tickets.Tickets.size(); + SetServiceTickets(MakeIntrusiveConst<TServiceTickets>(std::move(tickets.Tickets), + std::move(tickets.Errors), + DstAliases_)); + + SetUpdateTimeOfServiceTickets(time); + if (count > 0) { LogInfo(TStringBuilder() << "Cache was updated with " << count << " service ticket(s): " << time); } - } - - void TThreadedUpdater::UpdatePublicKeysCache(const TString& publicKeys, TInstant time) { - if (publicKeys.empty()) { - return; - } - - if (Settings_.IsServiceTicketCheckingRequired()) { - SetServiceContext(MakeIntrusiveConst<TServiceContext>( - TServiceContext::CheckingFactory(Settings_.GetSelfTvmId(), - publicKeys))); - } - - if (Settings_.IsUserTicketCheckingRequired()) { - SetUserContext(publicKeys); - } - - SetUpdateTimeOfPublicKeys(time); - - LogInfo(TStringBuilder() << "Cache was updated with public keys: " << time); - } - - void TThreadedUpdater::ReadStateFromDisk() { - try { - TServiceTicketsFromDisk st = ReadServiceTicketsFromDisk(); - UpdateServiceTicketsCache(std::move(st.TicketsWithErrors), st.BornDate); - DiskCacheServiceTickets_ = st.FileBody; - } catch (const std::exception& e) { - LogWarning(TStringBuilder() << "Failed to read service tickets from disk: " << e.what()); - } - - try { - std::pair<TString, TInstant> pk = ReadPublicKeysFromDisk(); - UpdatePublicKeysCache(pk.first, pk.second); - } catch (const std::exception& e) { - LogWarning(TStringBuilder() << "Failed to read public keys from disk: " << e.what()); - } - - try { - TString rs = ReadRetrySettingsFromDisk(); - UpdateRetrySettings(rs); - } catch (const std::exception& e) { - LogWarning(TStringBuilder() << "Failed to read retry settings from disk: " << e.what()); - } - - try { - if (RolesFetcher_) { - SetUpdateTimeOfRoles(RolesFetcher_->ReadFromDisk()); - } - } catch (const std::exception& e) { - LogWarning(TStringBuilder() << "Failed to read roles from disk: " << e.what()); - } - } - - TThreadedUpdater::TServiceTicketsFromDisk TThreadedUpdater::ReadServiceTicketsFromDisk() const { - if (!ServiceTicketsFilepath_) { - return {}; - } - - TDiskReader r(ServiceTicketsFilepath_, Logger_.Get()); - if (!r.Read()) { - return {}; - } - - std::pair<TStringBuf, TTvmId> data = ParseTicketsFromDisk(r.Data()); - if (data.second != Settings_.GetSelfTvmId()) { - TStringStream s; - s << "Disk cache is for another tvmId (" << data.second << "). "; - s << "Self=" << Settings_.GetSelfTvmId(); - LogWarning(s.Str()); - return {}; - } - - TPairTicketsErrors res; - ParseTicketsFromResponse(data.first, Destinations_, res); - if (IsInvalid(TServiceTickets::GetInvalidationTime(res.Tickets), TInstant::Now())) { - LogWarning("Disk cache (service tickets) is too old"); - return {}; - } - - LogInfo(TStringBuilder() << "Got " << res.Tickets.size() << " service ticket(s) from disk"); - return {std::move(res), r.Time(), TString(data.first)}; - } - - std::pair<TString, TInstant> TThreadedUpdater::ReadPublicKeysFromDisk() const { - if (!PublicKeysFilepath_) { - return {}; - } - - TDiskReader r(PublicKeysFilepath_, Logger_.Get()); - if (!r.Read()) { - return {}; - } - - if (TInstant::Now() - r.Time() > PublicKeysDurations_.Invalid) { - LogWarning("Disk cache (public keys) is too old"); - return {}; - } - - return {r.Data(), r.Time()}; - } - - TString TThreadedUpdater::ReadRetrySettingsFromDisk() const { - if (!RetrySettingsFilepath_) { - return {}; - } - - TDiskReader r(RetrySettingsFilepath_, Logger_.Get()); - if (!r.Read()) { - return {}; - } - - return r.Data(); - } - - template <class Dsts> - TThreadedUpdater::THttpResult TThreadedUpdater::GetServiceTicketsFromHttp(const Dsts& dsts, const size_t dstLimit) const { - Y_ENSURE(SigningContext_, "Internal error"); - - TClientSettings::TDstVector part; - part.reserve(dstLimit); - THttpResult res; - res.TicketsWithErrors.Tickets.reserve(dsts.size()); - res.Responses.reserve(dsts.size() / dstLimit + 1); - - for (auto it = dsts.begin(); it != dsts.end();) { - part.clear(); - for (size_t count = 0; it != dsts.end() && count < dstLimit; ++count, ++it) { - part.push_back(*it); - } - - TString response = - FetchWithRetries( - [this, &part]() { - // create request here to keep 'ts' actual - return FetchServiceTicketsFromHttp(PrepareRequestForServiceTickets( - Settings_.GetSelfTvmId(), - *SigningContext_, - part, - ProcInfo_)); - }, - EScope::ServiceTickets) - .Response; - ParseTicketsFromResponse(response, part, res.TicketsWithErrors); - LogDebug(TStringBuilder() - << "Response with service tickets for " << part.size() - << " destination(s) was successfully fetched from " << TvmUrl_); - - res.Responses.push_back(response); - } - - LogDebug(TStringBuilder() - << "Got responses with service tickets with " << res.Responses.size() << " pages for " - << dsts.size() << " destination(s)"); - for (const auto& p : res.TicketsWithErrors.Errors) { - LogError(TStringBuilder() - << "Failed to get service ticket for dst=" << p.first << ": " << p.second); - } - - return res; - } - - TString TThreadedUpdater::GetPublicKeysFromHttp() const { - TString publicKeys = - FetchWithRetries( - [this]() { return FetchPublicKeysFromHttp(); }, - EScope::PublicKeys) - .Response; - - LogDebug("Public keys were successfully fetched from " + TvmUrl_); - - return publicKeys; - } - - NUtils::TFetchResult TThreadedUpdater::FetchServiceTicketsFromHttp(const TString& body) const { - TStringStream s; - - THttpHeaders outHeaders; - TKeepAliveHttpClient::THttpCode code = GetClient().DoPost("/2/ticket", body, &s, Headers_, &outHeaders); - - const THttpInputHeader* settings = outHeaders.FindHeader("X-Ya-Retry-Settings"); - - return {code, {}, "/2/ticket", s.Str(), settings ? settings->Value() : ""}; - } - - NUtils::TFetchResult TThreadedUpdater::FetchPublicKeysFromHttp() const { - TStringStream s; - - THttpHeaders outHeaders; - TKeepAliveHttpClient::THttpCode code = GetClient().DoGet(PublicKeysUrl_, &s, {}, &outHeaders); - - const THttpInputHeader* settings = outHeaders.FindHeader("X-Ya-Retry-Settings"); - - return {code, {}, "/2/keys", s.Str(), settings ? settings->Value() : ""}; - } - - bool TThreadedUpdater::UpdateRetrySettings(const TString& header) const { - if (header.empty()) { - // Probably it is some kind of test? - return false; - } - - try { - TString raw = NUtils::Base64url2bin(header); - Y_ENSURE(raw, "Invalid base64url in settings"); - - retry_settings::v1::Settings proto; - Y_ENSURE(proto.ParseFromString(raw), "Invalid proto"); - - // This ugly hack helps to process these settings in any case - TThreadedUpdater& this_ = *const_cast<TThreadedUpdater*>(this); - TRetrySettings& res = this_.RetrySettings_; - - TStringStream diff; - auto update = [&diff](auto& l, const auto& r, TStringBuf desc) { - if (l != r) { - diff << desc << ":" << l << "->" << r << ";"; - l = r; - } - }; - - if (proto.has_exponential_backoff_min_sec()) { - update(res.BackoffSettings.Min, - TDuration::Seconds(proto.exponential_backoff_min_sec()), - "exponential_backoff_min"); - } - if (proto.has_exponential_backoff_max_sec()) { - update(res.BackoffSettings.Max, - TDuration::Seconds(proto.exponential_backoff_max_sec()), - "exponential_backoff_max"); - } - if (proto.has_exponential_backoff_factor()) { - update(res.BackoffSettings.Factor, - proto.exponential_backoff_factor(), - "exponential_backoff_factor"); - } - if (proto.has_exponential_backoff_jitter()) { - update(res.BackoffSettings.Jitter, - proto.exponential_backoff_jitter(), - "exponential_backoff_jitter"); - } - this_.ExpBackoff_.UpdateSettings(res.BackoffSettings); - - if (proto.has_max_random_sleep_default()) { - update(res.MaxRandomSleepDefault, - TDuration::MilliSeconds(proto.max_random_sleep_default()), - "max_random_sleep_default"); - } - if (proto.has_max_random_sleep_when_ok()) { - update(res.MaxRandomSleepWhenOk, - TDuration::MilliSeconds(proto.max_random_sleep_when_ok()), - "max_random_sleep_when_ok"); - } - if (proto.has_retries_on_start()) { - Y_ENSURE(proto.retries_on_start(), "retries_on_start==0"); - update(res.RetriesOnStart, - proto.retries_on_start(), - "retries_on_start"); - } - if (proto.has_retries_in_background()) { - Y_ENSURE(proto.retries_in_background(), "retries_in_background==0"); - update(res.RetriesInBackground, - proto.retries_in_background(), - "retries_in_background"); - } - if (proto.has_worker_awaking_period_sec()) { - update(res.WorkerAwakingPeriod, - TDuration::Seconds(proto.worker_awaking_period_sec()), - "worker_awaking_period"); - this_.WorkerAwakingPeriod_ = res.WorkerAwakingPeriod; - } - if (proto.has_dsts_limit()) { - Y_ENSURE(proto.dsts_limit(), "dsts_limit==0"); - update(res.DstsLimit, - proto.dsts_limit(), - "dsts_limit"); - } - - if (proto.has_roles_update_period_sec()) { - Y_ENSURE(proto.roles_update_period_sec(), "roles_update_period==0"); - update(res.RolesUpdatePeriod, - TDuration::Seconds(proto.roles_update_period_sec()), - "roles_update_period_sec"); - } - if (proto.has_roles_warn_period_sec()) { - Y_ENSURE(proto.roles_warn_period_sec(), "roles_warn_period_sec==0"); - update(res.RolesWarnPeriod, - TDuration::Seconds(proto.roles_warn_period_sec()), - "roles_warn_period_sec"); - } - - if (diff.empty()) { - return false; - } - - LogDebug("Retry settings were updated: " + diff.Str()); - return true; - } catch (const std::exception& e) { - LogWarning(TStringBuilder() - << "Failed to update retry settings from server, header '" - << header << "': " - << e.what()); - } - - return false; - } - - template <typename Func> - NUtils::TFetchResult TThreadedUpdater::FetchWithRetries(Func func, EScope scope) const { - const ui32 tries = Inited_ ? RetrySettings_.RetriesInBackground - : RetrySettings_.RetriesOnStart; - - for (size_t idx = 1;; ++idx) { - RandomSleep(); - - try { - NUtils::TFetchResult result = func(); - - if (UpdateRetrySettings(result.RetrySettings) && RetrySettingsFilepath_) { - TDiskWriter w(RetrySettingsFilepath_, Logger_.Get()); - w.Write(result.RetrySettings); - } - - if (400 <= result.Code && result.Code <= 499) { - throw TNonRetriableException() << ProcessHttpError(scope, result.Path, result.Code, result.Response); - } - if (result.Code < 200 || result.Code >= 399) { - throw yexception() << ProcessHttpError(scope, result.Path, result.Code, result.Response); - } - - ExpBackoff_.Decrease(); - return result; - } catch (const TNonRetriableException& e) { - LogWarning(TStringBuilder() << "Failed to get " << scope << ": " << e.what()); - ExpBackoff_.Increase(); - throw; - } catch (const std::exception& e) { - LogWarning(TStringBuilder() << "Failed to get " << scope << ": " << e.what()); - ExpBackoff_.Increase(); - if (idx >= tries) { - throw; - } - } - } - - throw yexception() << "unreachable"; - } - - void TThreadedUpdater::RandomSleep() const { - const TDuration maxSleep = TClientStatus::ECode::Ok == GetState() - ? RetrySettings_.MaxRandomSleepWhenOk - : RetrySettings_.MaxRandomSleepDefault; - - if (maxSleep) { - ui32 toSleep = Random_.GenRand() % maxSleep.MilliSeconds(); - ExpBackoff_.Sleep(TDuration::MilliSeconds(toSleep)); - } - } - - TString TThreadedUpdater::PrepareRequestForServiceTickets(TTvmId src, - const TServiceContext& ctx, - const TClientSettings::TDstVector& dsts, - const NUtils::TProcInfo& procInfo, - time_t now) { - TStringStream s; - - const TString ts = IntToString<10>(now); - TStringStream dst; - dst.Reserve(10 * dsts.size()); - for (const TClientSettings::TDst& d : dsts) { - if (dst.Str()) { - dst << ','; - } - dst << d.Id; - } - - s << "grant_type=client_credentials"; - s << "&src=" << src; - s << "&dst=" << dst.Str(); - s << "&ts=" << ts; - s << "&sign=" << ctx.SignCgiParamsForTvm(ts, dst.Str()); - s << "&get_retry_settings=yes"; - - s << "&"; - procInfo.AddToRequest(s); - - return s.Str(); - } - - template <class Dsts> - void TThreadedUpdater::ParseTicketsFromResponse(TStringBuf resp, - const Dsts& dsts, - TPairTicketsErrors& out) const { - NJson::TJsonValue doc; - Y_ENSURE(NJson::ReadJsonTree(resp, &doc), "Invalid json from tvm-api: " << resp); - - const NJson::TJsonValue* currentResp = doc.IsMap() ? &doc : nullptr; - auto find = [¤tResp, &doc](TTvmId id, NJson::TJsonValue& obj) -> bool { - const TString idStr = IntToString<10>(id); - if (currentResp && currentResp->GetValue(idStr, &obj)) { - return true; - } - - for (const NJson::TJsonValue& val : doc.GetArray()) { - currentResp = &val; - if (currentResp->GetValue(idStr, &obj)) { - return true; - } - } - - return false; - }; - - for (const TClientSettings::TDst& d : dsts) { - NJson::TJsonValue obj; - NJson::TJsonValue val; - - if (!find(d.Id, obj) || !obj.GetValue("ticket", &val)) { - TString err; - if (obj.GetValue("error", &val)) { - err = val.GetString(); - } else { - err = "Missing tvm_id in response, should never happend: " + IntToString<10>(d.Id); - } - - TStringStream s; - s << "Failed to get ServiceTicket for " << d.Id << ": " << err; - ProcessError(EType::NonRetriable, EScope::ServiceTickets, s.Str()); - - out.Errors.insert({d.Id, std::move(err)}); - continue; - } - - out.Tickets.insert({d.Id, val.GetString()}); - } - } - - static const char DELIMETER = '\t'; - TString TThreadedUpdater::PrepareTicketsForDisk(TStringBuf tvmResponse, TTvmId selfId) { - TStringStream s; - s << tvmResponse << DELIMETER << selfId; - return s.Str(); - } - - std::pair<TStringBuf, TTvmId> TThreadedUpdater::ParseTicketsFromDisk(TStringBuf data) { - TStringBuf tvmId = data.RNextTok(DELIMETER); - return {data, IntFromString<TTvmId, 10>(tvmId)}; - } - - const TDstSet& TThreadedUpdater::GetDsts() const { - return Destinations_; - } - - void TThreadedUpdater::AddDstToSettings(const TClientSettings::TDst& dst) { - Destinations_.insert(dst); - } - - bool TThreadedUpdater::IsTimeToUpdateServiceTickets(TInstant lastUpdate) const { - return TInstant::Now() - lastUpdate > ServiceTicketsDurations_.RefreshPeriod; - } - - bool TThreadedUpdater::IsTimeToUpdatePublicKeys(TInstant lastUpdate) const { - return TInstant::Now() - lastUpdate > PublicKeysDurations_.RefreshPeriod; - } - - bool TThreadedUpdater::AreServicesTicketsOk() const { - if (!Settings_.IsServiceTicketFetchingRequired()) { - return true; - } - auto c = GetCachedServiceTickets(); - return c && (!Settings_.IsIncompleteTicketsSetAnError || c->TicketsById.size() == Destinations_.size()); - } - - bool TThreadedUpdater::IsServiceContextOk() const { - if (!Settings_.IsServiceTicketCheckingRequired()) { - return true; - } - - return bool(GetCachedServiceContext()); - } - - bool TThreadedUpdater::IsUserContextOk() const { - if (!Settings_.IsUserTicketCheckingRequired()) { - return true; - } - return bool(GetCachedUserContext()); - } - - void TThreadedUpdater::Worker() { - UpdateServiceTickets(); - UpdatePublicKeys(); - UpdateRoles(); - } - - TServiceTickets::TMapAliasId TThreadedUpdater::MakeAliasMap(const TClientSettings& settings) { - TServiceTickets::TMapAliasId res; - - if (settings.HasDstAliases()) { - for (const auto& pair : settings.GetDstAliases()) { - res.insert({pair.first, pair.second.Id}); - } - } - - return res; - } - - TClientSettings::TDstVector TThreadedUpdater::FindMissingDsts(TServiceTicketsPtr available, const TDstSet& required) { - Y_ENSURE(available); - TDstSet set; - // available->TicketsById is not sorted - for (const auto& pair : available->TicketsById) { - set.insert(pair.first); - } - return FindMissingDsts(set, required); - } - - TClientSettings::TDstVector TThreadedUpdater::FindMissingDsts(const TDstSet& available, const TDstSet& required) { - TClientSettings::TDstVector res; - std::set_difference(required.begin(), required.end(), - available.begin(), available.end(), - std::inserter(res, res.begin())); - return res; - } - - TString TThreadedUpdater::CreateJsonArray(const TSmallVec<TString>& responses) { - if (responses.empty()) { - return "[]"; - } - - size_t size = 0; - for (const TString& r : responses) { - size += r.size() + 1; - } - - TString res; - res.reserve(size + 2); - - res.push_back('['); - for (const TString& r : responses) { - res.append(r).push_back(','); - } - res.back() = ']'; - - return res; - } - - TString TThreadedUpdater::AppendToJsonArray(const TString& json, const TSmallVec<TString>& responses) { - Y_ENSURE(json, "previous body required"); - - size_t size = 0; - for (const TString& r : responses) { - size += r.size() + 1; - } - - TString res; - res.reserve(size + 2 + json.size()); - - res.push_back('['); - if (json.StartsWith('[')) { - Y_ENSURE(json.EndsWith(']'), "array is broken:" << json); - res.append(TStringBuf(json).Chop(1).Skip(1)); - } else { - res.append(json); - } - - res.push_back(','); - for (const TString& r : responses) { - res.append(r).push_back(','); - } - res.back() = ']'; - - return res; - } -} + } + + void TThreadedUpdater::UpdatePublicKeysCache(const TString& publicKeys, TInstant time) { + if (publicKeys.empty()) { + return; + } + + if (Settings_.IsServiceTicketCheckingRequired()) { + SetServiceContext(MakeIntrusiveConst<TServiceContext>( + TServiceContext::CheckingFactory(Settings_.GetSelfTvmId(), + publicKeys))); + } + + if (Settings_.IsUserTicketCheckingRequired()) { + SetUserContext(publicKeys); + } + + SetUpdateTimeOfPublicKeys(time); + + LogInfo(TStringBuilder() << "Cache was updated with public keys: " << time); + } + + void TThreadedUpdater::ReadStateFromDisk() { + try { + TServiceTicketsFromDisk st = ReadServiceTicketsFromDisk(); + UpdateServiceTicketsCache(std::move(st.TicketsWithErrors), st.BornDate); + DiskCacheServiceTickets_ = st.FileBody; + } catch (const std::exception& e) { + LogWarning(TStringBuilder() << "Failed to read service tickets from disk: " << e.what()); + } + + try { + std::pair<TString, TInstant> pk = ReadPublicKeysFromDisk(); + UpdatePublicKeysCache(pk.first, pk.second); + } catch (const std::exception& e) { + LogWarning(TStringBuilder() << "Failed to read public keys from disk: " << e.what()); + } + + try { + TString rs = ReadRetrySettingsFromDisk(); + UpdateRetrySettings(rs); + } catch (const std::exception& e) { + LogWarning(TStringBuilder() << "Failed to read retry settings from disk: " << e.what()); + } + + try { + if (RolesFetcher_) { + SetUpdateTimeOfRoles(RolesFetcher_->ReadFromDisk()); + } + } catch (const std::exception& e) { + LogWarning(TStringBuilder() << "Failed to read roles from disk: " << e.what()); + } + } + + TThreadedUpdater::TServiceTicketsFromDisk TThreadedUpdater::ReadServiceTicketsFromDisk() const { + if (!ServiceTicketsFilepath_) { + return {}; + } + + TDiskReader r(ServiceTicketsFilepath_, Logger_.Get()); + if (!r.Read()) { + return {}; + } + + std::pair<TStringBuf, TTvmId> data = ParseTicketsFromDisk(r.Data()); + if (data.second != Settings_.GetSelfTvmId()) { + TStringStream s; + s << "Disk cache is for another tvmId (" << data.second << "). "; + s << "Self=" << Settings_.GetSelfTvmId(); + LogWarning(s.Str()); + return {}; + } + + TPairTicketsErrors res; + ParseTicketsFromResponse(data.first, Destinations_, res); + if (IsInvalid(TServiceTickets::GetInvalidationTime(res.Tickets), TInstant::Now())) { + LogWarning("Disk cache (service tickets) is too old"); + return {}; + } + + LogInfo(TStringBuilder() << "Got " << res.Tickets.size() << " service ticket(s) from disk"); + return {std::move(res), r.Time(), TString(data.first)}; + } + + std::pair<TString, TInstant> TThreadedUpdater::ReadPublicKeysFromDisk() const { + if (!PublicKeysFilepath_) { + return {}; + } + + TDiskReader r(PublicKeysFilepath_, Logger_.Get()); + if (!r.Read()) { + return {}; + } + + if (TInstant::Now() - r.Time() > PublicKeysDurations_.Invalid) { + LogWarning("Disk cache (public keys) is too old"); + return {}; + } + + return {r.Data(), r.Time()}; + } + + TString TThreadedUpdater::ReadRetrySettingsFromDisk() const { + if (!RetrySettingsFilepath_) { + return {}; + } + + TDiskReader r(RetrySettingsFilepath_, Logger_.Get()); + if (!r.Read()) { + return {}; + } + + return r.Data(); + } + + template <class Dsts> + TThreadedUpdater::THttpResult TThreadedUpdater::GetServiceTicketsFromHttp(const Dsts& dsts, const size_t dstLimit) const { + Y_ENSURE(SigningContext_, "Internal error"); + + TClientSettings::TDstVector part; + part.reserve(dstLimit); + THttpResult res; + res.TicketsWithErrors.Tickets.reserve(dsts.size()); + res.Responses.reserve(dsts.size() / dstLimit + 1); + + for (auto it = dsts.begin(); it != dsts.end();) { + part.clear(); + for (size_t count = 0; it != dsts.end() && count < dstLimit; ++count, ++it) { + part.push_back(*it); + } + + TString response = + FetchWithRetries( + [this, &part]() { + // create request here to keep 'ts' actual + return FetchServiceTicketsFromHttp(PrepareRequestForServiceTickets( + Settings_.GetSelfTvmId(), + *SigningContext_, + part, + ProcInfo_)); + }, + EScope::ServiceTickets) + .Response; + ParseTicketsFromResponse(response, part, res.TicketsWithErrors); + LogDebug(TStringBuilder() + << "Response with service tickets for " << part.size() + << " destination(s) was successfully fetched from " << TvmUrl_); + + res.Responses.push_back(response); + } + + LogDebug(TStringBuilder() + << "Got responses with service tickets with " << res.Responses.size() << " pages for " + << dsts.size() << " destination(s)"); + for (const auto& p : res.TicketsWithErrors.Errors) { + LogError(TStringBuilder() + << "Failed to get service ticket for dst=" << p.first << ": " << p.second); + } + + return res; + } + + TString TThreadedUpdater::GetPublicKeysFromHttp() const { + TString publicKeys = + FetchWithRetries( + [this]() { return FetchPublicKeysFromHttp(); }, + EScope::PublicKeys) + .Response; + + LogDebug("Public keys were successfully fetched from " + TvmUrl_); + + return publicKeys; + } + + NUtils::TFetchResult TThreadedUpdater::FetchServiceTicketsFromHttp(const TString& body) const { + TStringStream s; + + THttpHeaders outHeaders; + TKeepAliveHttpClient::THttpCode code = GetClient().DoPost("/2/ticket", body, &s, Headers_, &outHeaders); + + const THttpInputHeader* settings = outHeaders.FindHeader("X-Ya-Retry-Settings"); + + return {code, {}, "/2/ticket", s.Str(), settings ? settings->Value() : ""}; + } + + NUtils::TFetchResult TThreadedUpdater::FetchPublicKeysFromHttp() const { + TStringStream s; + + THttpHeaders outHeaders; + TKeepAliveHttpClient::THttpCode code = GetClient().DoGet(PublicKeysUrl_, &s, {}, &outHeaders); + + const THttpInputHeader* settings = outHeaders.FindHeader("X-Ya-Retry-Settings"); + + return {code, {}, "/2/keys", s.Str(), settings ? settings->Value() : ""}; + } + + bool TThreadedUpdater::UpdateRetrySettings(const TString& header) const { + if (header.empty()) { + // Probably it is some kind of test? + return false; + } + + try { + TString raw = NUtils::Base64url2bin(header); + Y_ENSURE(raw, "Invalid base64url in settings"); + + retry_settings::v1::Settings proto; + Y_ENSURE(proto.ParseFromString(raw), "Invalid proto"); + + // This ugly hack helps to process these settings in any case + TThreadedUpdater& this_ = *const_cast<TThreadedUpdater*>(this); + TRetrySettings& res = this_.RetrySettings_; + + TStringStream diff; + auto update = [&diff](auto& l, const auto& r, TStringBuf desc) { + if (l != r) { + diff << desc << ":" << l << "->" << r << ";"; + l = r; + } + }; + + if (proto.has_exponential_backoff_min_sec()) { + update(res.BackoffSettings.Min, + TDuration::Seconds(proto.exponential_backoff_min_sec()), + "exponential_backoff_min"); + } + if (proto.has_exponential_backoff_max_sec()) { + update(res.BackoffSettings.Max, + TDuration::Seconds(proto.exponential_backoff_max_sec()), + "exponential_backoff_max"); + } + if (proto.has_exponential_backoff_factor()) { + update(res.BackoffSettings.Factor, + proto.exponential_backoff_factor(), + "exponential_backoff_factor"); + } + if (proto.has_exponential_backoff_jitter()) { + update(res.BackoffSettings.Jitter, + proto.exponential_backoff_jitter(), + "exponential_backoff_jitter"); + } + this_.ExpBackoff_.UpdateSettings(res.BackoffSettings); + + if (proto.has_max_random_sleep_default()) { + update(res.MaxRandomSleepDefault, + TDuration::MilliSeconds(proto.max_random_sleep_default()), + "max_random_sleep_default"); + } + if (proto.has_max_random_sleep_when_ok()) { + update(res.MaxRandomSleepWhenOk, + TDuration::MilliSeconds(proto.max_random_sleep_when_ok()), + "max_random_sleep_when_ok"); + } + if (proto.has_retries_on_start()) { + Y_ENSURE(proto.retries_on_start(), "retries_on_start==0"); + update(res.RetriesOnStart, + proto.retries_on_start(), + "retries_on_start"); + } + if (proto.has_retries_in_background()) { + Y_ENSURE(proto.retries_in_background(), "retries_in_background==0"); + update(res.RetriesInBackground, + proto.retries_in_background(), + "retries_in_background"); + } + if (proto.has_worker_awaking_period_sec()) { + update(res.WorkerAwakingPeriod, + TDuration::Seconds(proto.worker_awaking_period_sec()), + "worker_awaking_period"); + this_.WorkerAwakingPeriod_ = res.WorkerAwakingPeriod; + } + if (proto.has_dsts_limit()) { + Y_ENSURE(proto.dsts_limit(), "dsts_limit==0"); + update(res.DstsLimit, + proto.dsts_limit(), + "dsts_limit"); + } + + if (proto.has_roles_update_period_sec()) { + Y_ENSURE(proto.roles_update_period_sec(), "roles_update_period==0"); + update(res.RolesUpdatePeriod, + TDuration::Seconds(proto.roles_update_period_sec()), + "roles_update_period_sec"); + } + if (proto.has_roles_warn_period_sec()) { + Y_ENSURE(proto.roles_warn_period_sec(), "roles_warn_period_sec==0"); + update(res.RolesWarnPeriod, + TDuration::Seconds(proto.roles_warn_period_sec()), + "roles_warn_period_sec"); + } + + if (diff.empty()) { + return false; + } + + LogDebug("Retry settings were updated: " + diff.Str()); + return true; + } catch (const std::exception& e) { + LogWarning(TStringBuilder() + << "Failed to update retry settings from server, header '" + << header << "': " + << e.what()); + } + + return false; + } + + template <typename Func> + NUtils::TFetchResult TThreadedUpdater::FetchWithRetries(Func func, EScope scope) const { + const ui32 tries = Inited_ ? RetrySettings_.RetriesInBackground + : RetrySettings_.RetriesOnStart; + + for (size_t idx = 1;; ++idx) { + RandomSleep(); + + try { + NUtils::TFetchResult result = func(); + + if (UpdateRetrySettings(result.RetrySettings) && RetrySettingsFilepath_) { + TDiskWriter w(RetrySettingsFilepath_, Logger_.Get()); + w.Write(result.RetrySettings); + } + + if (400 <= result.Code && result.Code <= 499) { + throw TNonRetriableException() << ProcessHttpError(scope, result.Path, result.Code, result.Response); + } + if (result.Code < 200 || result.Code >= 399) { + throw yexception() << ProcessHttpError(scope, result.Path, result.Code, result.Response); + } + + ExpBackoff_.Decrease(); + return result; + } catch (const TNonRetriableException& e) { + LogWarning(TStringBuilder() << "Failed to get " << scope << ": " << e.what()); + ExpBackoff_.Increase(); + throw; + } catch (const std::exception& e) { + LogWarning(TStringBuilder() << "Failed to get " << scope << ": " << e.what()); + ExpBackoff_.Increase(); + if (idx >= tries) { + throw; + } + } + } + + throw yexception() << "unreachable"; + } + + void TThreadedUpdater::RandomSleep() const { + const TDuration maxSleep = TClientStatus::ECode::Ok == GetState() + ? RetrySettings_.MaxRandomSleepWhenOk + : RetrySettings_.MaxRandomSleepDefault; + + if (maxSleep) { + ui32 toSleep = Random_.GenRand() % maxSleep.MilliSeconds(); + ExpBackoff_.Sleep(TDuration::MilliSeconds(toSleep)); + } + } + + TString TThreadedUpdater::PrepareRequestForServiceTickets(TTvmId src, + const TServiceContext& ctx, + const TClientSettings::TDstVector& dsts, + const NUtils::TProcInfo& procInfo, + time_t now) { + TStringStream s; + + const TString ts = IntToString<10>(now); + TStringStream dst; + dst.Reserve(10 * dsts.size()); + for (const TClientSettings::TDst& d : dsts) { + if (dst.Str()) { + dst << ','; + } + dst << d.Id; + } + + s << "grant_type=client_credentials"; + s << "&src=" << src; + s << "&dst=" << dst.Str(); + s << "&ts=" << ts; + s << "&sign=" << ctx.SignCgiParamsForTvm(ts, dst.Str()); + s << "&get_retry_settings=yes"; + + s << "&"; + procInfo.AddToRequest(s); + + return s.Str(); + } + + template <class Dsts> + void TThreadedUpdater::ParseTicketsFromResponse(TStringBuf resp, + const Dsts& dsts, + TPairTicketsErrors& out) const { + NJson::TJsonValue doc; + Y_ENSURE(NJson::ReadJsonTree(resp, &doc), "Invalid json from tvm-api: " << resp); + + const NJson::TJsonValue* currentResp = doc.IsMap() ? &doc : nullptr; + auto find = [¤tResp, &doc](TTvmId id, NJson::TJsonValue& obj) -> bool { + const TString idStr = IntToString<10>(id); + if (currentResp && currentResp->GetValue(idStr, &obj)) { + return true; + } + + for (const NJson::TJsonValue& val : doc.GetArray()) { + currentResp = &val; + if (currentResp->GetValue(idStr, &obj)) { + return true; + } + } + + return false; + }; + + for (const TClientSettings::TDst& d : dsts) { + NJson::TJsonValue obj; + NJson::TJsonValue val; + + if (!find(d.Id, obj) || !obj.GetValue("ticket", &val)) { + TString err; + if (obj.GetValue("error", &val)) { + err = val.GetString(); + } else { + err = "Missing tvm_id in response, should never happend: " + IntToString<10>(d.Id); + } + + TStringStream s; + s << "Failed to get ServiceTicket for " << d.Id << ": " << err; + ProcessError(EType::NonRetriable, EScope::ServiceTickets, s.Str()); + + out.Errors.insert({d.Id, std::move(err)}); + continue; + } + + out.Tickets.insert({d.Id, val.GetString()}); + } + } + + static const char DELIMETER = '\t'; + TString TThreadedUpdater::PrepareTicketsForDisk(TStringBuf tvmResponse, TTvmId selfId) { + TStringStream s; + s << tvmResponse << DELIMETER << selfId; + return s.Str(); + } + + std::pair<TStringBuf, TTvmId> TThreadedUpdater::ParseTicketsFromDisk(TStringBuf data) { + TStringBuf tvmId = data.RNextTok(DELIMETER); + return {data, IntFromString<TTvmId, 10>(tvmId)}; + } + + const TDstSet& TThreadedUpdater::GetDsts() const { + return Destinations_; + } + + void TThreadedUpdater::AddDstToSettings(const TClientSettings::TDst& dst) { + Destinations_.insert(dst); + } + + bool TThreadedUpdater::IsTimeToUpdateServiceTickets(TInstant lastUpdate) const { + return TInstant::Now() - lastUpdate > ServiceTicketsDurations_.RefreshPeriod; + } + + bool TThreadedUpdater::IsTimeToUpdatePublicKeys(TInstant lastUpdate) const { + return TInstant::Now() - lastUpdate > PublicKeysDurations_.RefreshPeriod; + } + + bool TThreadedUpdater::AreServicesTicketsOk() const { + if (!Settings_.IsServiceTicketFetchingRequired()) { + return true; + } + auto c = GetCachedServiceTickets(); + return c && (!Settings_.IsIncompleteTicketsSetAnError || c->TicketsById.size() == Destinations_.size()); + } + + bool TThreadedUpdater::IsServiceContextOk() const { + if (!Settings_.IsServiceTicketCheckingRequired()) { + return true; + } + + return bool(GetCachedServiceContext()); + } + + bool TThreadedUpdater::IsUserContextOk() const { + if (!Settings_.IsUserTicketCheckingRequired()) { + return true; + } + return bool(GetCachedUserContext()); + } + + void TThreadedUpdater::Worker() { + UpdateServiceTickets(); + UpdatePublicKeys(); + UpdateRoles(); + } + + TServiceTickets::TMapAliasId TThreadedUpdater::MakeAliasMap(const TClientSettings& settings) { + TServiceTickets::TMapAliasId res; + + if (settings.HasDstAliases()) { + for (const auto& pair : settings.GetDstAliases()) { + res.insert({pair.first, pair.second.Id}); + } + } + + return res; + } + + TClientSettings::TDstVector TThreadedUpdater::FindMissingDsts(TServiceTicketsPtr available, const TDstSet& required) { + Y_ENSURE(available); + TDstSet set; + // available->TicketsById is not sorted + for (const auto& pair : available->TicketsById) { + set.insert(pair.first); + } + return FindMissingDsts(set, required); + } + + TClientSettings::TDstVector TThreadedUpdater::FindMissingDsts(const TDstSet& available, const TDstSet& required) { + TClientSettings::TDstVector res; + std::set_difference(required.begin(), required.end(), + available.begin(), available.end(), + std::inserter(res, res.begin())); + return res; + } + + TString TThreadedUpdater::CreateJsonArray(const TSmallVec<TString>& responses) { + if (responses.empty()) { + return "[]"; + } + + size_t size = 0; + for (const TString& r : responses) { + size += r.size() + 1; + } + + TString res; + res.reserve(size + 2); + + res.push_back('['); + for (const TString& r : responses) { + res.append(r).push_back(','); + } + res.back() = ']'; + + return res; + } + + TString TThreadedUpdater::AppendToJsonArray(const TString& json, const TSmallVec<TString>& responses) { + Y_ENSURE(json, "previous body required"); + + size_t size = 0; + for (const TString& r : responses) { + size += r.size() + 1; + } + + TString res; + res.reserve(size + 2 + json.size()); + + res.push_back('['); + if (json.StartsWith('[')) { + Y_ENSURE(json.EndsWith(']'), "array is broken:" << json); + res.append(TStringBuf(json).Chop(1).Skip(1)); + } else { + res.append(json); + } + + res.push_back(','); + for (const TString& r : responses) { + res.append(r).push_back(','); + } + res.back() = ']'; + + return res; + } +} diff --git a/library/cpp/tvmauth/client/misc/api/threaded_updater.h b/library/cpp/tvmauth/client/misc/api/threaded_updater.h index e546bbe030..9983c49e6d 100644 --- a/library/cpp/tvmauth/client/misc/api/threaded_updater.h +++ b/library/cpp/tvmauth/client/misc/api/threaded_updater.h @@ -1,140 +1,140 @@ -#pragma once - -#include "retry_settings.h" -#include "roles_fetcher.h" -#include "settings.h" - -#include <library/cpp/tvmauth/client/misc/async_updater.h> -#include <library/cpp/tvmauth/client/misc/threaded_updater.h> - -#include <util/generic/set.h> -#include <util/random/fast.h> - -namespace NTvmAuth::NTvmApi { - using TDstSet = TSet<TClientSettings::TDst>; - - class TThreadedUpdater: public TThreadedUpdaterBase { - public: - /*! - * Starts thread for updating of in-memory cache in background - * Reads cache from disk if specified - * @param settings - * @param logger is usefull for monitoring and debuging - */ - static TAsyncUpdaterPtr Create(const TClientSettings& settings, TLoggerPtr logger); - ~TThreadedUpdater(); - - TClientStatus GetStatus() const override; - NRoles::TRolesPtr GetRoles() const override; - - protected: // for tests - TClientStatus::ECode GetState() const; - - TThreadedUpdater(const TClientSettings& settings, TLoggerPtr logger); - void Init(); - - void UpdateServiceTickets(); - void UpdateAllServiceTickets(); - TServiceTicketsPtr UpdateMissingServiceTickets(const TDstSet& required); - void UpdatePublicKeys(); - void UpdateRoles(); - - TServiceTicketsPtr UpdateServiceTicketsCachePartly(TPairTicketsErrors&& tickets, size_t got); - void UpdateServiceTicketsCache(TPairTicketsErrors&& tickets, TInstant time); - void UpdatePublicKeysCache(const TString& publicKeys, TInstant time); - - void ReadStateFromDisk(); - - struct TServiceTicketsFromDisk { - TPairTicketsErrors TicketsWithErrors; - TInstant BornDate; - TString FileBody; - }; - - TServiceTicketsFromDisk ReadServiceTicketsFromDisk() const; - std::pair<TString, TInstant> ReadPublicKeysFromDisk() const; - TString ReadRetrySettingsFromDisk() const; - - struct THttpResult { - TPairTicketsErrors TicketsWithErrors; - TSmallVec<TString> Responses; - }; - - template <class Dsts> - THttpResult GetServiceTicketsFromHttp(const Dsts& dsts, const size_t dstLimit) const; - TString GetPublicKeysFromHttp() const; - - virtual NUtils::TFetchResult FetchServiceTicketsFromHttp(const TString& body) const; - virtual NUtils::TFetchResult FetchPublicKeysFromHttp() const; - - bool UpdateRetrySettings(const TString& header) const; - - template <typename Func> - NUtils::TFetchResult FetchWithRetries(Func func, EScope scope) const; - void RandomSleep() const; - - static TString PrepareRequestForServiceTickets(TTvmId src, - const TServiceContext& ctx, - const TClientSettings::TDstVector& dsts, - const NUtils::TProcInfo& procInfo, - time_t now = time(nullptr)); - template <class Dsts> - void ParseTicketsFromResponse(TStringBuf resp, - const Dsts& dsts, - TPairTicketsErrors& out) const; - - static TString PrepareTicketsForDisk(TStringBuf tvmResponse, TTvmId selfId); - static std::pair<TStringBuf, TTvmId> ParseTicketsFromDisk(TStringBuf data); - - const TDstSet& GetDsts() const; - void AddDstToSettings(const TClientSettings::TDst& dst); - - bool IsTimeToUpdateServiceTickets(TInstant lastUpdate) const; - bool IsTimeToUpdatePublicKeys(TInstant lastUpdate) const; - - bool AreServicesTicketsOk() const; - bool IsServiceContextOk() const; - bool IsUserContextOk() const; - - void Worker() override; - - static TServiceTickets::TMapAliasId MakeAliasMap(const TClientSettings& settings); - static TClientSettings::TDstVector FindMissingDsts(TServiceTicketsPtr available, const TDstSet& required); - static TClientSettings::TDstVector FindMissingDsts(const TDstSet& available, const TDstSet& required); - - static TString CreateJsonArray(const TSmallVec<TString>& responses); - static TString AppendToJsonArray(const TString& json, const TSmallVec<TString>& responses); - - private: - TRetrySettings RetrySettings_; - - protected: - mutable TExponentialBackoff ExpBackoff_; - - private: - const TClientSettings Settings_; - - const NUtils::TProcInfo ProcInfo_; - - const TString PublicKeysUrl_; - - const TServiceTickets::TMapAliasId DstAliases_; - - const TKeepAliveHttpClient::THeaders Headers_; - TMaybe<TServiceContext> SigningContext_; - - TDstSet Destinations_; - TString DiskCacheServiceTickets_; - bool NeedFetchMissingServiceTickets_ = true; - - TString PublicKeysFilepath_; - TString ServiceTicketsFilepath_; - TString RetrySettingsFilepath_; - - std::unique_ptr<TRolesFetcher> RolesFetcher_; - - mutable TReallyFastRng32 Random_; - - bool Inited_ = false; - }; -} +#pragma once + +#include "retry_settings.h" +#include "roles_fetcher.h" +#include "settings.h" + +#include <library/cpp/tvmauth/client/misc/async_updater.h> +#include <library/cpp/tvmauth/client/misc/threaded_updater.h> + +#include <util/generic/set.h> +#include <util/random/fast.h> + +namespace NTvmAuth::NTvmApi { + using TDstSet = TSet<TClientSettings::TDst>; + + class TThreadedUpdater: public TThreadedUpdaterBase { + public: + /*! + * Starts thread for updating of in-memory cache in background + * Reads cache from disk if specified + * @param settings + * @param logger is usefull for monitoring and debuging + */ + static TAsyncUpdaterPtr Create(const TClientSettings& settings, TLoggerPtr logger); + ~TThreadedUpdater(); + + TClientStatus GetStatus() const override; + NRoles::TRolesPtr GetRoles() const override; + + protected: // for tests + TClientStatus::ECode GetState() const; + + TThreadedUpdater(const TClientSettings& settings, TLoggerPtr logger); + void Init(); + + void UpdateServiceTickets(); + void UpdateAllServiceTickets(); + TServiceTicketsPtr UpdateMissingServiceTickets(const TDstSet& required); + void UpdatePublicKeys(); + void UpdateRoles(); + + TServiceTicketsPtr UpdateServiceTicketsCachePartly(TPairTicketsErrors&& tickets, size_t got); + void UpdateServiceTicketsCache(TPairTicketsErrors&& tickets, TInstant time); + void UpdatePublicKeysCache(const TString& publicKeys, TInstant time); + + void ReadStateFromDisk(); + + struct TServiceTicketsFromDisk { + TPairTicketsErrors TicketsWithErrors; + TInstant BornDate; + TString FileBody; + }; + + TServiceTicketsFromDisk ReadServiceTicketsFromDisk() const; + std::pair<TString, TInstant> ReadPublicKeysFromDisk() const; + TString ReadRetrySettingsFromDisk() const; + + struct THttpResult { + TPairTicketsErrors TicketsWithErrors; + TSmallVec<TString> Responses; + }; + + template <class Dsts> + THttpResult GetServiceTicketsFromHttp(const Dsts& dsts, const size_t dstLimit) const; + TString GetPublicKeysFromHttp() const; + + virtual NUtils::TFetchResult FetchServiceTicketsFromHttp(const TString& body) const; + virtual NUtils::TFetchResult FetchPublicKeysFromHttp() const; + + bool UpdateRetrySettings(const TString& header) const; + + template <typename Func> + NUtils::TFetchResult FetchWithRetries(Func func, EScope scope) const; + void RandomSleep() const; + + static TString PrepareRequestForServiceTickets(TTvmId src, + const TServiceContext& ctx, + const TClientSettings::TDstVector& dsts, + const NUtils::TProcInfo& procInfo, + time_t now = time(nullptr)); + template <class Dsts> + void ParseTicketsFromResponse(TStringBuf resp, + const Dsts& dsts, + TPairTicketsErrors& out) const; + + static TString PrepareTicketsForDisk(TStringBuf tvmResponse, TTvmId selfId); + static std::pair<TStringBuf, TTvmId> ParseTicketsFromDisk(TStringBuf data); + + const TDstSet& GetDsts() const; + void AddDstToSettings(const TClientSettings::TDst& dst); + + bool IsTimeToUpdateServiceTickets(TInstant lastUpdate) const; + bool IsTimeToUpdatePublicKeys(TInstant lastUpdate) const; + + bool AreServicesTicketsOk() const; + bool IsServiceContextOk() const; + bool IsUserContextOk() const; + + void Worker() override; + + static TServiceTickets::TMapAliasId MakeAliasMap(const TClientSettings& settings); + static TClientSettings::TDstVector FindMissingDsts(TServiceTicketsPtr available, const TDstSet& required); + static TClientSettings::TDstVector FindMissingDsts(const TDstSet& available, const TDstSet& required); + + static TString CreateJsonArray(const TSmallVec<TString>& responses); + static TString AppendToJsonArray(const TString& json, const TSmallVec<TString>& responses); + + private: + TRetrySettings RetrySettings_; + + protected: + mutable TExponentialBackoff ExpBackoff_; + + private: + const TClientSettings Settings_; + + const NUtils::TProcInfo ProcInfo_; + + const TString PublicKeysUrl_; + + const TServiceTickets::TMapAliasId DstAliases_; + + const TKeepAliveHttpClient::THeaders Headers_; + TMaybe<TServiceContext> SigningContext_; + + TDstSet Destinations_; + TString DiskCacheServiceTickets_; + bool NeedFetchMissingServiceTickets_ = true; + + TString PublicKeysFilepath_; + TString ServiceTicketsFilepath_; + TString RetrySettingsFilepath_; + + std::unique_ptr<TRolesFetcher> RolesFetcher_; + + mutable TReallyFastRng32 Random_; + + bool Inited_ = false; + }; +} diff --git a/library/cpp/tvmauth/client/misc/async_updater.cpp b/library/cpp/tvmauth/client/misc/async_updater.cpp index 9cb0332ed4..47bc889ef5 100644 --- a/library/cpp/tvmauth/client/misc/async_updater.cpp +++ b/library/cpp/tvmauth/client/misc/async_updater.cpp @@ -1,152 +1,152 @@ -#include "async_updater.h" - -#include "utils.h" - -#include <library/cpp/tvmauth/client/exception.h> - -#include <util/string/builder.h> -#include <util/system/spin_wait.h> - -namespace NTvmAuth { - TAsyncUpdaterBase::TAsyncUpdaterBase() { - ServiceTicketsDurations_.RefreshPeriod = TDuration::Hours(1); - ServiceTicketsDurations_.Expiring = TDuration::Hours(2); - ServiceTicketsDurations_.Invalid = TDuration::Hours(11); - - PublicKeysDurations_.RefreshPeriod = TDuration::Days(1); - PublicKeysDurations_.Expiring = TDuration::Days(2); - PublicKeysDurations_.Invalid = TDuration::Days(6); - } - - NRoles::TRolesPtr TAsyncUpdaterBase::GetRoles() const { - ythrow TIllegalUsage() << "not implemented"; - } - - TInstant TAsyncUpdaterBase::GetUpdateTimeOfPublicKeys() const { - return PublicKeysTime_.Get(); - } - - TInstant TAsyncUpdaterBase::GetUpdateTimeOfServiceTickets() const { - return ServiceTicketsTime_.Get(); - } - - TInstant TAsyncUpdaterBase::GetUpdateTimeOfRoles() const { - return RolesTime_.Get(); - } - - TInstant TAsyncUpdaterBase::GetInvalidationTimeOfPublicKeys() const { - TInstant ins = GetUpdateTimeOfPublicKeys(); - return ins == TInstant() ? TInstant() : ins + PublicKeysDurations_.Invalid; - } - - TInstant TAsyncUpdaterBase::GetInvalidationTimeOfServiceTickets() const { - TServiceTicketsPtr c = GetCachedServiceTickets(); - return c ? c->InvalidationTime : TInstant(); - } - - bool TAsyncUpdaterBase::ArePublicKeysInvalid(TInstant now) const { - return IsInvalid(GetInvalidationTimeOfPublicKeys(), now); - } - - bool TAsyncUpdaterBase::AreServiceTicketsInvalid(TInstant now) const { +#include "async_updater.h" + +#include "utils.h" + +#include <library/cpp/tvmauth/client/exception.h> + +#include <util/string/builder.h> +#include <util/system/spin_wait.h> + +namespace NTvmAuth { + TAsyncUpdaterBase::TAsyncUpdaterBase() { + ServiceTicketsDurations_.RefreshPeriod = TDuration::Hours(1); + ServiceTicketsDurations_.Expiring = TDuration::Hours(2); + ServiceTicketsDurations_.Invalid = TDuration::Hours(11); + + PublicKeysDurations_.RefreshPeriod = TDuration::Days(1); + PublicKeysDurations_.Expiring = TDuration::Days(2); + PublicKeysDurations_.Invalid = TDuration::Days(6); + } + + NRoles::TRolesPtr TAsyncUpdaterBase::GetRoles() const { + ythrow TIllegalUsage() << "not implemented"; + } + + TInstant TAsyncUpdaterBase::GetUpdateTimeOfPublicKeys() const { + return PublicKeysTime_.Get(); + } + + TInstant TAsyncUpdaterBase::GetUpdateTimeOfServiceTickets() const { + return ServiceTicketsTime_.Get(); + } + + TInstant TAsyncUpdaterBase::GetUpdateTimeOfRoles() const { + return RolesTime_.Get(); + } + + TInstant TAsyncUpdaterBase::GetInvalidationTimeOfPublicKeys() const { + TInstant ins = GetUpdateTimeOfPublicKeys(); + return ins == TInstant() ? TInstant() : ins + PublicKeysDurations_.Invalid; + } + + TInstant TAsyncUpdaterBase::GetInvalidationTimeOfServiceTickets() const { + TServiceTicketsPtr c = GetCachedServiceTickets(); + return c ? c->InvalidationTime : TInstant(); + } + + bool TAsyncUpdaterBase::ArePublicKeysInvalid(TInstant now) const { + return IsInvalid(GetInvalidationTimeOfPublicKeys(), now); + } + + bool TAsyncUpdaterBase::AreServiceTicketsInvalid(TInstant now) const { TServiceTicketsPtr c = GetCachedServiceTickets(); // Empty set of tickets is allways valid. - return c && !c->TicketsById.empty() && IsInvalid(GetInvalidationTimeOfServiceTickets(), now); - } - - bool TAsyncUpdaterBase::IsInvalid(TInstant invTime, TInstant now) { - return invTime - - TDuration::Minutes(1) // lag for closing from balancer - < now; - } - - void TAsyncUpdaterBase::SetBbEnv(EBlackboxEnv original, TMaybe<EBlackboxEnv> overrided) { - if (overrided) { - Y_ENSURE_EX(NUtils::CheckBbEnvOverriding(original, *overrided), - TBrokenTvmClientSettings() << "Overriding of BlackboxEnv is illegal: " - << original << " -> " << *overrided); - } - - Envs_.store({original, overrided}, std::memory_order_relaxed); - } - - TServiceTicketsPtr TAsyncUpdaterBase::GetCachedServiceTickets() const { - return ServiceTickets_.Get(); - } - - TServiceContextPtr TAsyncUpdaterBase::GetCachedServiceContext() const { - return ServiceContext_.Get(); - } - - TUserContextPtr TAsyncUpdaterBase::GetCachedUserContext(TMaybe<EBlackboxEnv> overridenEnv) const { - TAllUserContextsPtr ctx = AllUserContexts_.Get(); - if (!ctx) { - return nullptr; - } - - const TEnvs envs = Envs_.load(std::memory_order_relaxed); - if (!envs.Original) { - return nullptr; - } - - EBlackboxEnv env = *envs.Original; - - if (overridenEnv) { - Y_ENSURE_EX(NUtils::CheckBbEnvOverriding(*envs.Original, *overridenEnv), - TBrokenTvmClientSettings() << "Overriding of BlackboxEnv is illegal: " - << *envs.Original << " -> " << *overridenEnv); - env = *overridenEnv; - } else if (envs.Overrided) { - env = *envs.Overrided; - } - - return ctx->Get(env); - } - - void TAsyncUpdaterBase::SetServiceTickets(TServiceTicketsPtr c) { - ServiceTickets_.Set(std::move(c)); - } - - void TAsyncUpdaterBase::SetServiceContext(TServiceContextPtr c) { - ServiceContext_.Set(std::move(c)); - } - - void TAsyncUpdaterBase::SetUserContext(TStringBuf publicKeys) { - AllUserContexts_.Set(MakeIntrusiveConst<TAllUserContexts>(publicKeys)); - } - - void TAsyncUpdaterBase::SetUpdateTimeOfPublicKeys(TInstant ins) { - PublicKeysTime_.Set(ins); - } - - void TAsyncUpdaterBase::SetUpdateTimeOfServiceTickets(TInstant ins) { - ServiceTicketsTime_.Set(ins); - } - - void TAsyncUpdaterBase::SetUpdateTimeOfRoles(TInstant ins) { - RolesTime_.Set(ins); - } - - bool TAsyncUpdaterBase::IsServiceTicketMapOk(TServiceTicketsPtr c, size_t expectedTicketCount, bool strict) { - return c && - (strict - ? c->TicketsById.size() == expectedTicketCount - : !c->TicketsById.empty()); - } - - TAllUserContexts::TAllUserContexts(TStringBuf publicKeys) { - auto add = [&, this](EBlackboxEnv env) { - Ctx_[(size_t)env] = MakeIntrusiveConst<TUserContext>(env, publicKeys); - }; - - add(EBlackboxEnv::Prod); - add(EBlackboxEnv::Test); - add(EBlackboxEnv::ProdYateam); - add(EBlackboxEnv::TestYateam); - add(EBlackboxEnv::Stress); - } - - TUserContextPtr TAllUserContexts::Get(EBlackboxEnv env) const { - return Ctx_[(size_t)env]; - } -} + return c && !c->TicketsById.empty() && IsInvalid(GetInvalidationTimeOfServiceTickets(), now); + } + + bool TAsyncUpdaterBase::IsInvalid(TInstant invTime, TInstant now) { + return invTime - + TDuration::Minutes(1) // lag for closing from balancer + < now; + } + + void TAsyncUpdaterBase::SetBbEnv(EBlackboxEnv original, TMaybe<EBlackboxEnv> overrided) { + if (overrided) { + Y_ENSURE_EX(NUtils::CheckBbEnvOverriding(original, *overrided), + TBrokenTvmClientSettings() << "Overriding of BlackboxEnv is illegal: " + << original << " -> " << *overrided); + } + + Envs_.store({original, overrided}, std::memory_order_relaxed); + } + + TServiceTicketsPtr TAsyncUpdaterBase::GetCachedServiceTickets() const { + return ServiceTickets_.Get(); + } + + TServiceContextPtr TAsyncUpdaterBase::GetCachedServiceContext() const { + return ServiceContext_.Get(); + } + + TUserContextPtr TAsyncUpdaterBase::GetCachedUserContext(TMaybe<EBlackboxEnv> overridenEnv) const { + TAllUserContextsPtr ctx = AllUserContexts_.Get(); + if (!ctx) { + return nullptr; + } + + const TEnvs envs = Envs_.load(std::memory_order_relaxed); + if (!envs.Original) { + return nullptr; + } + + EBlackboxEnv env = *envs.Original; + + if (overridenEnv) { + Y_ENSURE_EX(NUtils::CheckBbEnvOverriding(*envs.Original, *overridenEnv), + TBrokenTvmClientSettings() << "Overriding of BlackboxEnv is illegal: " + << *envs.Original << " -> " << *overridenEnv); + env = *overridenEnv; + } else if (envs.Overrided) { + env = *envs.Overrided; + } + + return ctx->Get(env); + } + + void TAsyncUpdaterBase::SetServiceTickets(TServiceTicketsPtr c) { + ServiceTickets_.Set(std::move(c)); + } + + void TAsyncUpdaterBase::SetServiceContext(TServiceContextPtr c) { + ServiceContext_.Set(std::move(c)); + } + + void TAsyncUpdaterBase::SetUserContext(TStringBuf publicKeys) { + AllUserContexts_.Set(MakeIntrusiveConst<TAllUserContexts>(publicKeys)); + } + + void TAsyncUpdaterBase::SetUpdateTimeOfPublicKeys(TInstant ins) { + PublicKeysTime_.Set(ins); + } + + void TAsyncUpdaterBase::SetUpdateTimeOfServiceTickets(TInstant ins) { + ServiceTicketsTime_.Set(ins); + } + + void TAsyncUpdaterBase::SetUpdateTimeOfRoles(TInstant ins) { + RolesTime_.Set(ins); + } + + bool TAsyncUpdaterBase::IsServiceTicketMapOk(TServiceTicketsPtr c, size_t expectedTicketCount, bool strict) { + return c && + (strict + ? c->TicketsById.size() == expectedTicketCount + : !c->TicketsById.empty()); + } + + TAllUserContexts::TAllUserContexts(TStringBuf publicKeys) { + auto add = [&, this](EBlackboxEnv env) { + Ctx_[(size_t)env] = MakeIntrusiveConst<TUserContext>(env, publicKeys); + }; + + add(EBlackboxEnv::Prod); + add(EBlackboxEnv::Test); + add(EBlackboxEnv::ProdYateam); + add(EBlackboxEnv::TestYateam); + add(EBlackboxEnv::Stress); + } + + TUserContextPtr TAllUserContexts::Get(EBlackboxEnv env) const { + return Ctx_[(size_t)env]; + } +} diff --git a/library/cpp/tvmauth/client/misc/async_updater.h b/library/cpp/tvmauth/client/misc/async_updater.h index 7b556d7a38..1ad6c209f8 100644 --- a/library/cpp/tvmauth/client/misc/async_updater.h +++ b/library/cpp/tvmauth/client/misc/async_updater.h @@ -1,183 +1,183 @@ -#pragma once - -#include "last_error.h" -#include "settings.h" -#include "roles/roles.h" - -#include <library/cpp/tvmauth/client/client_status.h> -#include <library/cpp/tvmauth/client/logger.h> - -#include <library/cpp/tvmauth/deprecated/service_context.h> -#include <library/cpp/tvmauth/deprecated/user_context.h> -#include <library/cpp/tvmauth/src/utils.h> - -#include <util/datetime/base.h> -#include <util/generic/hash.h> -#include <util/generic/maybe.h> -#include <util/generic/noncopyable.h> -#include <util/generic/ptr.h> - -#include <array> +#pragma once + +#include "last_error.h" +#include "settings.h" +#include "roles/roles.h" + +#include <library/cpp/tvmauth/client/client_status.h> +#include <library/cpp/tvmauth/client/logger.h> + +#include <library/cpp/tvmauth/deprecated/service_context.h> +#include <library/cpp/tvmauth/deprecated/user_context.h> +#include <library/cpp/tvmauth/src/utils.h> + +#include <util/datetime/base.h> +#include <util/generic/hash.h> +#include <util/generic/maybe.h> +#include <util/generic/noncopyable.h> +#include <util/generic/ptr.h> + +#include <array> #include <atomic> - -namespace NTvmAuth::NInternal { - class TClientCaningKnife; -} - -namespace NTvmAuth { - class TServiceTickets: public TAtomicRefCount<TServiceTickets> { - public: - using TMapAliasStr = THashMap<TClientSettings::TAlias, TString>; - using TMapIdStr = THashMap<TTvmId, TString>; + +namespace NTvmAuth::NInternal { + class TClientCaningKnife; +} + +namespace NTvmAuth { + class TServiceTickets: public TAtomicRefCount<TServiceTickets> { + public: + using TMapAliasStr = THashMap<TClientSettings::TAlias, TString>; + using TMapIdStr = THashMap<TTvmId, TString>; using TIdSet = THashSet<TTvmId>; using TAliasSet = THashSet<TClientSettings::TAlias>; - using TMapAliasId = THashMap<TClientSettings::TAlias, TTvmId>; - - TServiceTickets(TMapIdStr&& tickets, TMapIdStr&& errors, const TMapAliasId& dstMap) - : TicketsById(std::move(tickets)) - , ErrorsById(std::move(errors)) - { + using TMapAliasId = THashMap<TClientSettings::TAlias, TTvmId>; + + TServiceTickets(TMapIdStr&& tickets, TMapIdStr&& errors, const TMapAliasId& dstMap) + : TicketsById(std::move(tickets)) + , ErrorsById(std::move(errors)) + { InitAliasesAndUnfetchedIds(dstMap); - InitInvalidationTime(); - } - - static TInstant GetInvalidationTime(const TMapIdStr& ticketsById) { - TInstant res; - - for (const auto& pair : ticketsById) { - TMaybe<TInstant> t = NTvmAuth::NInternal::TCanningKnife::GetExpirationTime(pair.second); - if (!t) { - continue; - } - - res = res == TInstant() ? *t : std::min(res, *t); - } - - return res; - } - - public: - TMapIdStr TicketsById; - TMapIdStr ErrorsById; - TMapAliasStr TicketsByAlias; - TMapAliasStr ErrorsByAlias; - TInstant InvalidationTime; - TIdSet UnfetchedIds; - TAliasSet UnfetchedAliases; - - private: + InitInvalidationTime(); + } + + static TInstant GetInvalidationTime(const TMapIdStr& ticketsById) { + TInstant res; + + for (const auto& pair : ticketsById) { + TMaybe<TInstant> t = NTvmAuth::NInternal::TCanningKnife::GetExpirationTime(pair.second); + if (!t) { + continue; + } + + res = res == TInstant() ? *t : std::min(res, *t); + } + + return res; + } + + public: + TMapIdStr TicketsById; + TMapIdStr ErrorsById; + TMapAliasStr TicketsByAlias; + TMapAliasStr ErrorsByAlias; + TInstant InvalidationTime; + TIdSet UnfetchedIds; + TAliasSet UnfetchedAliases; + + private: void InitAliasesAndUnfetchedIds(const TMapAliasId& dstMap) { - for (const auto& pair : dstMap) { - auto it = TicketsById.find(pair.second); - auto errIt = ErrorsById.find(pair.second); - - if (it == TicketsById.end()) { - if (errIt != ErrorsById.end()) { - Y_ENSURE(ErrorsByAlias.insert({pair.first, errIt->second}).second, + for (const auto& pair : dstMap) { + auto it = TicketsById.find(pair.second); + auto errIt = ErrorsById.find(pair.second); + + if (it == TicketsById.end()) { + if (errIt != ErrorsById.end()) { + Y_ENSURE(ErrorsByAlias.insert({pair.first, errIt->second}).second, "failed to add: " << pair.first); } else { - UnfetchedAliases.insert(pair.first); - UnfetchedIds.insert(pair.second); + UnfetchedAliases.insert(pair.first); + UnfetchedIds.insert(pair.second); } - } else { - Y_ENSURE(TicketsByAlias.insert({pair.first, it->second}).second, - "failed to add: " << pair.first); - } - } - } - - void InitInvalidationTime() { - InvalidationTime = GetInvalidationTime(TicketsById); - } - }; - using TServiceTicketsPtr = TIntrusiveConstPtr<TServiceTickets>; - - class TAllUserContexts: public TAtomicRefCount<TAllUserContexts> { - public: - TAllUserContexts(TStringBuf publicKeys); - - TUserContextPtr Get(EBlackboxEnv env) const; - - private: - std::array<TUserContextPtr, 5> Ctx_; - }; - using TAllUserContextsPtr = TIntrusiveConstPtr<TAllUserContexts>; - - class TAsyncUpdaterBase: public TAtomicRefCount<TAsyncUpdaterBase>, protected TLastError, TNonCopyable { - public: - TAsyncUpdaterBase(); - virtual ~TAsyncUpdaterBase() = default; - - virtual TClientStatus GetStatus() const = 0; - virtual NRoles::TRolesPtr GetRoles() const; - - TServiceTicketsPtr GetCachedServiceTickets() const; - TServiceContextPtr GetCachedServiceContext() const; - TUserContextPtr GetCachedUserContext(TMaybe<EBlackboxEnv> overridenEnv = {}) const; - - TInstant GetUpdateTimeOfPublicKeys() const; - TInstant GetUpdateTimeOfServiceTickets() const; - TInstant GetUpdateTimeOfRoles() const; - TInstant GetInvalidationTimeOfPublicKeys() const; - TInstant GetInvalidationTimeOfServiceTickets() const; - - bool ArePublicKeysInvalid(TInstant now) const; - bool AreServiceTicketsInvalid(TInstant now) const; - static bool IsInvalid(TInstant invTime, TInstant now); - - protected: - void SetBbEnv(EBlackboxEnv original, TMaybe<EBlackboxEnv> overrided = {}); - - void SetServiceTickets(TServiceTicketsPtr c); - void SetServiceContext(TServiceContextPtr c); - void SetUserContext(TStringBuf publicKeys); - void SetUpdateTimeOfPublicKeys(TInstant ins); - void SetUpdateTimeOfServiceTickets(TInstant ins); - void SetUpdateTimeOfRoles(TInstant ins); - - static bool IsServiceTicketMapOk(TServiceTicketsPtr c, size_t expectedTicketCount, bool strict); - - protected: - struct TPairTicketsErrors { - TServiceTickets::TMapIdStr Tickets; - TServiceTickets::TMapIdStr Errors; - - bool operator==(const TPairTicketsErrors& o) const { - return Tickets == o.Tickets && Errors == o.Errors; - } - }; - - struct TStateDurations { - TDuration RefreshPeriod; - TDuration Expiring; - TDuration Invalid; - }; - - TStateDurations ServiceTicketsDurations_; - TStateDurations PublicKeysDurations_; - - protected: - virtual void StartTvmClientStopping() const { - } - virtual bool IsTvmClientStopped() const { - return true; - } - friend class NTvmAuth::NInternal::TClientCaningKnife; - - private: - struct TEnvs { - TMaybe<EBlackboxEnv> Original; - TMaybe<EBlackboxEnv> Overrided; - }; - static_assert(sizeof(TEnvs) <= 8, "Small struct is easy to store as atomic"); - std::atomic<TEnvs> Envs_ = {{}}; - - NUtils::TProtectedValue<TServiceTicketsPtr> ServiceTickets_; - NUtils::TProtectedValue<TServiceContextPtr> ServiceContext_; - NUtils::TProtectedValue<TAllUserContextsPtr> AllUserContexts_; - NUtils::TProtectedValue<TInstant> PublicKeysTime_; - NUtils::TProtectedValue<TInstant> ServiceTicketsTime_; - NUtils::TProtectedValue<TInstant> RolesTime_; - }; - using TAsyncUpdaterPtr = TIntrusiveConstPtr<TAsyncUpdaterBase>; -} + } else { + Y_ENSURE(TicketsByAlias.insert({pair.first, it->second}).second, + "failed to add: " << pair.first); + } + } + } + + void InitInvalidationTime() { + InvalidationTime = GetInvalidationTime(TicketsById); + } + }; + using TServiceTicketsPtr = TIntrusiveConstPtr<TServiceTickets>; + + class TAllUserContexts: public TAtomicRefCount<TAllUserContexts> { + public: + TAllUserContexts(TStringBuf publicKeys); + + TUserContextPtr Get(EBlackboxEnv env) const; + + private: + std::array<TUserContextPtr, 5> Ctx_; + }; + using TAllUserContextsPtr = TIntrusiveConstPtr<TAllUserContexts>; + + class TAsyncUpdaterBase: public TAtomicRefCount<TAsyncUpdaterBase>, protected TLastError, TNonCopyable { + public: + TAsyncUpdaterBase(); + virtual ~TAsyncUpdaterBase() = default; + + virtual TClientStatus GetStatus() const = 0; + virtual NRoles::TRolesPtr GetRoles() const; + + TServiceTicketsPtr GetCachedServiceTickets() const; + TServiceContextPtr GetCachedServiceContext() const; + TUserContextPtr GetCachedUserContext(TMaybe<EBlackboxEnv> overridenEnv = {}) const; + + TInstant GetUpdateTimeOfPublicKeys() const; + TInstant GetUpdateTimeOfServiceTickets() const; + TInstant GetUpdateTimeOfRoles() const; + TInstant GetInvalidationTimeOfPublicKeys() const; + TInstant GetInvalidationTimeOfServiceTickets() const; + + bool ArePublicKeysInvalid(TInstant now) const; + bool AreServiceTicketsInvalid(TInstant now) const; + static bool IsInvalid(TInstant invTime, TInstant now); + + protected: + void SetBbEnv(EBlackboxEnv original, TMaybe<EBlackboxEnv> overrided = {}); + + void SetServiceTickets(TServiceTicketsPtr c); + void SetServiceContext(TServiceContextPtr c); + void SetUserContext(TStringBuf publicKeys); + void SetUpdateTimeOfPublicKeys(TInstant ins); + void SetUpdateTimeOfServiceTickets(TInstant ins); + void SetUpdateTimeOfRoles(TInstant ins); + + static bool IsServiceTicketMapOk(TServiceTicketsPtr c, size_t expectedTicketCount, bool strict); + + protected: + struct TPairTicketsErrors { + TServiceTickets::TMapIdStr Tickets; + TServiceTickets::TMapIdStr Errors; + + bool operator==(const TPairTicketsErrors& o) const { + return Tickets == o.Tickets && Errors == o.Errors; + } + }; + + struct TStateDurations { + TDuration RefreshPeriod; + TDuration Expiring; + TDuration Invalid; + }; + + TStateDurations ServiceTicketsDurations_; + TStateDurations PublicKeysDurations_; + + protected: + virtual void StartTvmClientStopping() const { + } + virtual bool IsTvmClientStopped() const { + return true; + } + friend class NTvmAuth::NInternal::TClientCaningKnife; + + private: + struct TEnvs { + TMaybe<EBlackboxEnv> Original; + TMaybe<EBlackboxEnv> Overrided; + }; + static_assert(sizeof(TEnvs) <= 8, "Small struct is easy to store as atomic"); + std::atomic<TEnvs> Envs_ = {{}}; + + NUtils::TProtectedValue<TServiceTicketsPtr> ServiceTickets_; + NUtils::TProtectedValue<TServiceContextPtr> ServiceContext_; + NUtils::TProtectedValue<TAllUserContextsPtr> AllUserContexts_; + NUtils::TProtectedValue<TInstant> PublicKeysTime_; + NUtils::TProtectedValue<TInstant> ServiceTicketsTime_; + NUtils::TProtectedValue<TInstant> RolesTime_; + }; + using TAsyncUpdaterPtr = TIntrusiveConstPtr<TAsyncUpdaterBase>; +} diff --git a/library/cpp/tvmauth/client/misc/checker.h b/library/cpp/tvmauth/client/misc/checker.h index e8ed2f5503..608b7a2f39 100644 --- a/library/cpp/tvmauth/client/misc/checker.h +++ b/library/cpp/tvmauth/client/misc/checker.h @@ -1,67 +1,67 @@ -#pragma once - -#include "async_updater.h" - -#include <library/cpp/tvmauth/client/exception.h> - -#include <library/cpp/tvmauth/checked_service_ticket.h> -#include <library/cpp/tvmauth/checked_user_ticket.h> - -namespace NTvmAuth { - class TServiceTicketChecker { - public: - TServiceTicketChecker(TAsyncUpdaterPtr updater) - : Updater_(std::move(updater)) - { - Y_ENSURE(Updater_); - GetCache(); - } - - /*! - * Checking must be enabled in TClientSettings - * Can throw exception if cache is out of date or wrong config - * @param ticket - */ - TCheckedServiceTicket Check(TStringBuf ticket) const { - return GetCache()->Check(ticket); - } - - private: - TServiceContextPtr GetCache() const { - TServiceContextPtr c = Updater_->GetCachedServiceContext(); - Y_ENSURE_EX(c, TBrokenTvmClientSettings() << "Need to use TClientSettings::EnableServiceTicketChecking()"); - return c; - } - - private: - TAsyncUpdaterPtr Updater_; - }; - - class TUserTicketChecker { - public: - TUserTicketChecker(TAsyncUpdaterPtr updater) - : Updater_(std::move(updater)) - { - Y_ENSURE(Updater_); - GetCache({}); - } - - /*! - * Blackbox enviroment must be cofingured in TClientSettings - * Can throw exception if cache is out of date or wrong config - */ - TCheckedUserTicket Check(TStringBuf ticket, TMaybe<EBlackboxEnv> overridenEnv) const { - return GetCache(overridenEnv)->Check(ticket); - } - - private: - TUserContextPtr GetCache(TMaybe<EBlackboxEnv> overridenEnv) const { - TUserContextPtr c = Updater_->GetCachedUserContext(overridenEnv); - Y_ENSURE_EX(c, TBrokenTvmClientSettings() << "Need to use TClientSettings::EnableUserTicketChecking()"); - return c; - } - - private: - TAsyncUpdaterPtr Updater_; - }; -} +#pragma once + +#include "async_updater.h" + +#include <library/cpp/tvmauth/client/exception.h> + +#include <library/cpp/tvmauth/checked_service_ticket.h> +#include <library/cpp/tvmauth/checked_user_ticket.h> + +namespace NTvmAuth { + class TServiceTicketChecker { + public: + TServiceTicketChecker(TAsyncUpdaterPtr updater) + : Updater_(std::move(updater)) + { + Y_ENSURE(Updater_); + GetCache(); + } + + /*! + * Checking must be enabled in TClientSettings + * Can throw exception if cache is out of date or wrong config + * @param ticket + */ + TCheckedServiceTicket Check(TStringBuf ticket) const { + return GetCache()->Check(ticket); + } + + private: + TServiceContextPtr GetCache() const { + TServiceContextPtr c = Updater_->GetCachedServiceContext(); + Y_ENSURE_EX(c, TBrokenTvmClientSettings() << "Need to use TClientSettings::EnableServiceTicketChecking()"); + return c; + } + + private: + TAsyncUpdaterPtr Updater_; + }; + + class TUserTicketChecker { + public: + TUserTicketChecker(TAsyncUpdaterPtr updater) + : Updater_(std::move(updater)) + { + Y_ENSURE(Updater_); + GetCache({}); + } + + /*! + * Blackbox enviroment must be cofingured in TClientSettings + * Can throw exception if cache is out of date or wrong config + */ + TCheckedUserTicket Check(TStringBuf ticket, TMaybe<EBlackboxEnv> overridenEnv) const { + return GetCache(overridenEnv)->Check(ticket); + } + + private: + TUserContextPtr GetCache(TMaybe<EBlackboxEnv> overridenEnv) const { + TUserContextPtr c = Updater_->GetCachedUserContext(overridenEnv); + Y_ENSURE_EX(c, TBrokenTvmClientSettings() << "Need to use TClientSettings::EnableUserTicketChecking()"); + return c; + } + + private: + TAsyncUpdaterPtr Updater_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/default_uid_checker.h b/library/cpp/tvmauth/client/misc/default_uid_checker.h index 1594f826bd..10c8df82c0 100644 --- a/library/cpp/tvmauth/client/misc/default_uid_checker.h +++ b/library/cpp/tvmauth/client/misc/default_uid_checker.h @@ -1,46 +1,46 @@ -#pragma once - -#include "async_updater.h" - -#include <library/cpp/tvmauth/client/exception.h> - -#include <library/cpp/tvmauth/checked_user_ticket.h> -#include <library/cpp/tvmauth/src/user_impl.h> - -namespace NTvmAuth { - class TDefaultUidChecker { - public: - TDefaultUidChecker(TAsyncUpdaterPtr updater) - : Updater_(std::move(updater)) - { - Y_ENSURE(Updater_); - GetCache(); - } - - /*! - * Checking must be enabled in TClientSettings - * Can throw exception if cache is out of date or wrong config - * @param ticket - */ - TCheckedUserTicket Check(TCheckedUserTicket ticket) const { - NRoles::TConsumerRolesPtr roles = GetCache()->GetRolesForUser(ticket); - if (roles) { - return ticket; - } - - TUserTicketImplPtr impl = THolder(NInternal::TCanningKnife::GetU(ticket)); - impl->SetStatus(ETicketStatus::NoRoles); - return TCheckedUserTicket(std::move(impl)); - } - - private: - NRoles::TRolesPtr GetCache() const { - NRoles::TRolesPtr c = Updater_->GetRoles(); - Y_ENSURE_EX(c, TBrokenTvmClientSettings() << "Need to use TClientSettings::EnableRolesFetching()"); - return c; - } - - private: - TAsyncUpdaterPtr Updater_; - }; -} +#pragma once + +#include "async_updater.h" + +#include <library/cpp/tvmauth/client/exception.h> + +#include <library/cpp/tvmauth/checked_user_ticket.h> +#include <library/cpp/tvmauth/src/user_impl.h> + +namespace NTvmAuth { + class TDefaultUidChecker { + public: + TDefaultUidChecker(TAsyncUpdaterPtr updater) + : Updater_(std::move(updater)) + { + Y_ENSURE(Updater_); + GetCache(); + } + + /*! + * Checking must be enabled in TClientSettings + * Can throw exception if cache is out of date or wrong config + * @param ticket + */ + TCheckedUserTicket Check(TCheckedUserTicket ticket) const { + NRoles::TConsumerRolesPtr roles = GetCache()->GetRolesForUser(ticket); + if (roles) { + return ticket; + } + + TUserTicketImplPtr impl = THolder(NInternal::TCanningKnife::GetU(ticket)); + impl->SetStatus(ETicketStatus::NoRoles); + return TCheckedUserTicket(std::move(impl)); + } + + private: + NRoles::TRolesPtr GetCache() const { + NRoles::TRolesPtr c = Updater_->GetRoles(); + Y_ENSURE_EX(c, TBrokenTvmClientSettings() << "Need to use TClientSettings::EnableRolesFetching()"); + return c; + } + + private: + TAsyncUpdaterPtr Updater_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/disk_cache.cpp b/library/cpp/tvmauth/client/misc/disk_cache.cpp index 3c01be4a83..da266bc29e 100644 --- a/library/cpp/tvmauth/client/misc/disk_cache.cpp +++ b/library/cpp/tvmauth/client/misc/disk_cache.cpp @@ -1,165 +1,165 @@ -#include "disk_cache.h" - -#include <library/cpp/tvmauth/client/logger.h> - -#include <contrib/libs/openssl/include/openssl/evp.h> -#include <contrib/libs/openssl/include/openssl/hmac.h> -#include <contrib/libs/openssl/include/openssl/sha.h> - -#include <util/folder/path.h> -#include <util/stream/file.h> -#include <util/stream/str.h> -#include <util/system/fs.h> +#include "disk_cache.h" + +#include <library/cpp/tvmauth/client/logger.h> + +#include <contrib/libs/openssl/include/openssl/evp.h> +#include <contrib/libs/openssl/include/openssl/hmac.h> +#include <contrib/libs/openssl/include/openssl/sha.h> + +#include <util/folder/path.h> +#include <util/stream/file.h> +#include <util/stream/str.h> +#include <util/system/fs.h> #include <util/system/sysstat.h> #include <util/system/tempfile.h> - -#include <exception> - -namespace NTvmAuth { - static const size_t HASH_SIZE = 32; - static const size_t TIMESTAMP_SIZE = sizeof(time_t); - - TDiskReader::TDiskReader(const TString& filename, ILogger* logger) - : Filename_(filename) - , Logger_(logger) - { - } - - bool TDiskReader::Read() { - TStringStream s; - - try { - if (!NFs::Exists(Filename_)) { - if (Logger_) { - s << "File '" << Filename_ << "' does not exist"; - Logger_->Debug(s.Str()); - } - return false; - } - - TFile file(Filename_, OpenExisting | RdOnly | Seq); - file.Flock(LOCK_SH | LOCK_NB); - - TFileInput input(file); - return ParseData(input.ReadAll()); - } catch (const std::exception& e) { - if (Logger_) { - s << "Failed to read '" << Filename_ << "': " << e.what(); - Logger_->Error(s.Str()); - } - } - - return false; - } - - bool TDiskReader::ParseData(TStringBuf buf) { - TStringStream s; - - if (buf.size() <= HASH_SIZE + TIMESTAMP_SIZE) { - if (Logger_) { - s << "File '" << Filename_ << "' is too small"; - Logger_->Warning(s.Str()); - } - return false; - } - - TStringBuf hash = buf.SubStr(0, HASH_SIZE); - if (hash != GetHash(buf.Skip(HASH_SIZE))) { - if (Logger_) { - s << "Content of '" << Filename_ << "' was incorrectly changed"; - Logger_->Warning(s.Str()); - } - return false; - } - - Time_ = TInstant::Seconds(GetTimestamp(buf.substr(0, TIMESTAMP_SIZE))); - Data_ = buf.Skip(TIMESTAMP_SIZE); - - if (Logger_) { - s << "File '" << Filename_ << "' was successfully read"; - Logger_->Info(s.Str()); - } - return true; - } - - TString TDiskReader::GetHash(TStringBuf data) { - TString value(EVP_MAX_MD_SIZE, 0); - unsigned macLen = 0; - if (!::HMAC(EVP_sha256(), - "", - 0, - (unsigned char*)data.data(), - data.size(), - (unsigned char*)value.data(), - &macLen)) { - return {}; - } - - if (macLen != EVP_MAX_MD_SIZE) { - value.resize(macLen); - } - - return value; - } - - time_t TDiskReader::GetTimestamp(TStringBuf data) { - time_t time = 0; - for (int idx = TIMESTAMP_SIZE - 1; idx >= 0; --idx) { - time <<= 8; - time |= static_cast<unsigned char>(data.at(idx)); - } - return time; - } - - TDiskWriter::TDiskWriter(const TString& filename, ILogger* logger) - : Filename_(filename) - , Logger_(logger) - { - } - - bool TDiskWriter::Write(TStringBuf data, TInstant now) { - TStringStream s; - - try { - { + +#include <exception> + +namespace NTvmAuth { + static const size_t HASH_SIZE = 32; + static const size_t TIMESTAMP_SIZE = sizeof(time_t); + + TDiskReader::TDiskReader(const TString& filename, ILogger* logger) + : Filename_(filename) + , Logger_(logger) + { + } + + bool TDiskReader::Read() { + TStringStream s; + + try { + if (!NFs::Exists(Filename_)) { + if (Logger_) { + s << "File '" << Filename_ << "' does not exist"; + Logger_->Debug(s.Str()); + } + return false; + } + + TFile file(Filename_, OpenExisting | RdOnly | Seq); + file.Flock(LOCK_SH | LOCK_NB); + + TFileInput input(file); + return ParseData(input.ReadAll()); + } catch (const std::exception& e) { + if (Logger_) { + s << "Failed to read '" << Filename_ << "': " << e.what(); + Logger_->Error(s.Str()); + } + } + + return false; + } + + bool TDiskReader::ParseData(TStringBuf buf) { + TStringStream s; + + if (buf.size() <= HASH_SIZE + TIMESTAMP_SIZE) { + if (Logger_) { + s << "File '" << Filename_ << "' is too small"; + Logger_->Warning(s.Str()); + } + return false; + } + + TStringBuf hash = buf.SubStr(0, HASH_SIZE); + if (hash != GetHash(buf.Skip(HASH_SIZE))) { + if (Logger_) { + s << "Content of '" << Filename_ << "' was incorrectly changed"; + Logger_->Warning(s.Str()); + } + return false; + } + + Time_ = TInstant::Seconds(GetTimestamp(buf.substr(0, TIMESTAMP_SIZE))); + Data_ = buf.Skip(TIMESTAMP_SIZE); + + if (Logger_) { + s << "File '" << Filename_ << "' was successfully read"; + Logger_->Info(s.Str()); + } + return true; + } + + TString TDiskReader::GetHash(TStringBuf data) { + TString value(EVP_MAX_MD_SIZE, 0); + unsigned macLen = 0; + if (!::HMAC(EVP_sha256(), + "", + 0, + (unsigned char*)data.data(), + data.size(), + (unsigned char*)value.data(), + &macLen)) { + return {}; + } + + if (macLen != EVP_MAX_MD_SIZE) { + value.resize(macLen); + } + + return value; + } + + time_t TDiskReader::GetTimestamp(TStringBuf data) { + time_t time = 0; + for (int idx = TIMESTAMP_SIZE - 1; idx >= 0; --idx) { + time <<= 8; + time |= static_cast<unsigned char>(data.at(idx)); + } + return time; + } + + TDiskWriter::TDiskWriter(const TString& filename, ILogger* logger) + : Filename_(filename) + , Logger_(logger) + { + } + + bool TDiskWriter::Write(TStringBuf data, TInstant now) { + TStringStream s; + + try { + { if (NFs::Exists(Filename_)) { Chmod(Filename_.c_str(), S_IRUSR | S_IWUSR); // 600 } TFile file(Filename_, CreateAlways | WrOnly | Seq | AWUser | ARUser); - file.Flock(LOCK_EX | LOCK_NB); - - TFileOutput output(file); - output << PrepareData(now, data); - } - - if (Logger_) { - s << "File '" << Filename_ << "' was successfully written"; - Logger_->Info(s.Str()); - } - return true; - } catch (const std::exception& e) { - if (Logger_) { - s << "Failed to write '" << Filename_ << "': " << e.what(); - Logger_->Error(s.Str()); - } - } - - return false; - } - - TString TDiskWriter::PrepareData(TInstant time, TStringBuf data) { - TString toHash = WriteTimestamp(time.TimeT()) + data; - return TDiskReader::GetHash(toHash) + toHash; - } - - TString TDiskWriter::WriteTimestamp(time_t time) { - TString res(TIMESTAMP_SIZE, 0); - for (size_t idx = 0; idx < TIMESTAMP_SIZE; ++idx) { - res[idx] = time & 0xFF; - time >>= 8; - } - return res; - } -} + file.Flock(LOCK_EX | LOCK_NB); + + TFileOutput output(file); + output << PrepareData(now, data); + } + + if (Logger_) { + s << "File '" << Filename_ << "' was successfully written"; + Logger_->Info(s.Str()); + } + return true; + } catch (const std::exception& e) { + if (Logger_) { + s << "Failed to write '" << Filename_ << "': " << e.what(); + Logger_->Error(s.Str()); + } + } + + return false; + } + + TString TDiskWriter::PrepareData(TInstant time, TStringBuf data) { + TString toHash = WriteTimestamp(time.TimeT()) + data; + return TDiskReader::GetHash(toHash) + toHash; + } + + TString TDiskWriter::WriteTimestamp(time_t time) { + TString res(TIMESTAMP_SIZE, 0); + for (size_t idx = 0; idx < TIMESTAMP_SIZE; ++idx) { + res[idx] = time & 0xFF; + time >>= 8; + } + return res; + } +} diff --git a/library/cpp/tvmauth/client/misc/disk_cache.h b/library/cpp/tvmauth/client/misc/disk_cache.h index 9e77556f86..91be2634aa 100644 --- a/library/cpp/tvmauth/client/misc/disk_cache.h +++ b/library/cpp/tvmauth/client/misc/disk_cache.h @@ -1,50 +1,50 @@ -#pragma once - -#include <util/datetime/base.h> -#include <util/generic/string.h> - -namespace NTvmAuth { - class ILogger; - - class TDiskReader { - public: - TDiskReader(const TString& filename, ILogger* logger = nullptr); - - bool Read(); - - const TString& Data() const { - return Data_; - } - - TInstant Time() const { - return Time_; - } - - public: // for tests - bool ParseData(TStringBuf buf); - - static TString GetHash(TStringBuf data); - static time_t GetTimestamp(TStringBuf data); - - private: - TString Filename_; - ILogger* Logger_; - TInstant Time_; - TString Data_; - }; - - class TDiskWriter { - public: - TDiskWriter(const TString& filename, ILogger* logger = nullptr); - - bool Write(TStringBuf data, TInstant now = TInstant::Now()); - - public: // for tests - static TString PrepareData(TInstant time, TStringBuf data); - static TString WriteTimestamp(time_t time); - - private: - TString Filename_; - ILogger* Logger_; - }; -} +#pragma once + +#include <util/datetime/base.h> +#include <util/generic/string.h> + +namespace NTvmAuth { + class ILogger; + + class TDiskReader { + public: + TDiskReader(const TString& filename, ILogger* logger = nullptr); + + bool Read(); + + const TString& Data() const { + return Data_; + } + + TInstant Time() const { + return Time_; + } + + public: // for tests + bool ParseData(TStringBuf buf); + + static TString GetHash(TStringBuf data); + static time_t GetTimestamp(TStringBuf data); + + private: + TString Filename_; + ILogger* Logger_; + TInstant Time_; + TString Data_; + }; + + class TDiskWriter { + public: + TDiskWriter(const TString& filename, ILogger* logger = nullptr); + + bool Write(TStringBuf data, TInstant now = TInstant::Now()); + + public: // for tests + static TString PrepareData(TInstant time, TStringBuf data); + static TString WriteTimestamp(time_t time); + + private: + TString Filename_; + ILogger* Logger_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/exponential_backoff.h b/library/cpp/tvmauth/client/misc/exponential_backoff.h index 89a7a3c8ad..af77520c6e 100644 --- a/library/cpp/tvmauth/client/misc/exponential_backoff.h +++ b/library/cpp/tvmauth/client/misc/exponential_backoff.h @@ -1,94 +1,94 @@ -#pragma once - -#include <util/datetime/base.h> -#include <util/random/normal.h> -#include <util/system/event.h> - +#pragma once + +#include <util/datetime/base.h> +#include <util/random/normal.h> +#include <util/system/event.h> + #include <atomic> -namespace NTvmAuth { - // https://habr.com/ru/post/227225/ - class TExponentialBackoff { - public: - struct TSettings { - TDuration Min; - TDuration Max; - double Factor = 1.001; - double Jitter = 0; - - bool operator==(const TSettings& o) const { - return Min == o.Min && - Max == o.Max && - Factor == o.Factor && - Jitter == o.Jitter; - } - }; - - TExponentialBackoff(const TSettings& settings, bool isEnabled = true) - : CurrentValue_(settings.Min) - , IsEnabled_(isEnabled) - { - UpdateSettings(settings); - } - - void UpdateSettings(const TSettings& settings) { - Y_ENSURE(settings.Factor > 1, "factor=" << settings.Factor << ". Should be > 1"); - Y_ENSURE(settings.Jitter >= 0 && settings.Jitter < 1, "jitter should be in range [0, 1)"); - - Min_ = settings.Min; - Max_ = settings.Max; - Factor_ = settings.Factor; - Jitter_ = settings.Jitter; - } - - TDuration Increase() { - CurrentValue_ = std::min(CurrentValue_ * Factor_, Max_); - - double rnd = StdNormalRandom<double>(); - const bool isNegative = rnd < 0; - rnd = std::abs(rnd); - - const TDuration diff = rnd * Jitter_ * CurrentValue_; - if (isNegative) { - CurrentValue_ -= diff; - } else { - CurrentValue_ += diff; - } - - return CurrentValue_; - } - - TDuration Decrease() { - CurrentValue_ = std::max(CurrentValue_ / Factor_, Min_); - return CurrentValue_; - } - - void Sleep(TDuration add = TDuration()) { - if (IsEnabled_.load(std::memory_order_relaxed)) { - Ev_.WaitT(CurrentValue_ + add); - } - } - - void Interrupt() { - Ev_.Signal(); - } - - TDuration GetCurrentValue() const { - return CurrentValue_; - } - - void SetEnabled(bool val) { - IsEnabled_.store(val); - } - - private: - TDuration Min_; - TDuration Max_; - double Factor_; - double Jitter_; - TDuration CurrentValue_; - std::atomic_bool IsEnabled_; - - TAutoEvent Ev_; - }; -} +namespace NTvmAuth { + // https://habr.com/ru/post/227225/ + class TExponentialBackoff { + public: + struct TSettings { + TDuration Min; + TDuration Max; + double Factor = 1.001; + double Jitter = 0; + + bool operator==(const TSettings& o) const { + return Min == o.Min && + Max == o.Max && + Factor == o.Factor && + Jitter == o.Jitter; + } + }; + + TExponentialBackoff(const TSettings& settings, bool isEnabled = true) + : CurrentValue_(settings.Min) + , IsEnabled_(isEnabled) + { + UpdateSettings(settings); + } + + void UpdateSettings(const TSettings& settings) { + Y_ENSURE(settings.Factor > 1, "factor=" << settings.Factor << ". Should be > 1"); + Y_ENSURE(settings.Jitter >= 0 && settings.Jitter < 1, "jitter should be in range [0, 1)"); + + Min_ = settings.Min; + Max_ = settings.Max; + Factor_ = settings.Factor; + Jitter_ = settings.Jitter; + } + + TDuration Increase() { + CurrentValue_ = std::min(CurrentValue_ * Factor_, Max_); + + double rnd = StdNormalRandom<double>(); + const bool isNegative = rnd < 0; + rnd = std::abs(rnd); + + const TDuration diff = rnd * Jitter_ * CurrentValue_; + if (isNegative) { + CurrentValue_ -= diff; + } else { + CurrentValue_ += diff; + } + + return CurrentValue_; + } + + TDuration Decrease() { + CurrentValue_ = std::max(CurrentValue_ / Factor_, Min_); + return CurrentValue_; + } + + void Sleep(TDuration add = TDuration()) { + if (IsEnabled_.load(std::memory_order_relaxed)) { + Ev_.WaitT(CurrentValue_ + add); + } + } + + void Interrupt() { + Ev_.Signal(); + } + + TDuration GetCurrentValue() const { + return CurrentValue_; + } + + void SetEnabled(bool val) { + IsEnabled_.store(val); + } + + private: + TDuration Min_; + TDuration Max_; + double Factor_; + double Jitter_; + TDuration CurrentValue_; + std::atomic_bool IsEnabled_; + + TAutoEvent Ev_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/fetch_result.h b/library/cpp/tvmauth/client/misc/fetch_result.h index 4b0774e92f..c454499477 100644 --- a/library/cpp/tvmauth/client/misc/fetch_result.h +++ b/library/cpp/tvmauth/client/misc/fetch_result.h @@ -1,13 +1,13 @@ -#pragma once - -#include <library/cpp/http/simple/http_client.h> - -namespace NTvmAuth::NUtils { - struct TFetchResult { - TKeepAliveHttpClient::THttpCode Code; - THttpHeaders Headers; - TStringBuf Path; - TString Response; - TString RetrySettings; - }; -} +#pragma once + +#include <library/cpp/http/simple/http_client.h> + +namespace NTvmAuth::NUtils { + struct TFetchResult { + TKeepAliveHttpClient::THttpCode Code; + THttpHeaders Headers; + TStringBuf Path; + TString Response; + TString RetrySettings; + }; +} diff --git a/library/cpp/tvmauth/client/misc/getter.h b/library/cpp/tvmauth/client/misc/getter.h index b0327d69e9..a2bde9de7c 100644 --- a/library/cpp/tvmauth/client/misc/getter.h +++ b/library/cpp/tvmauth/client/misc/getter.h @@ -1,66 +1,66 @@ -#pragma once - -#include "checker.h" - -namespace NTvmAuth { - class TServiceTicketGetter { - public: - TServiceTicketGetter(TAsyncUpdaterPtr updater) - : Updater_(std::move(updater)) - { - Y_ENSURE(Updater_); - GetCache(); - } - - /*! - * Fetching must enabled in TClientSettings - * Can throw exception if cache is invalid or wrong config - * @param dst - */ - TString GetTicket(const TClientSettings::TAlias& dst) const { - TServiceTicketsPtr c = GetCache(); - return GetTicketImpl(dst, c->TicketsByAlias, c->ErrorsByAlias, c->UnfetchedAliases); - } - - TString GetTicket(const TTvmId dst) const { - TServiceTicketsPtr c = GetCache(); - return GetTicketImpl(dst, c->TicketsById, c->ErrorsById, c->UnfetchedIds); - } - - private: +#pragma once + +#include "checker.h" + +namespace NTvmAuth { + class TServiceTicketGetter { + public: + TServiceTicketGetter(TAsyncUpdaterPtr updater) + : Updater_(std::move(updater)) + { + Y_ENSURE(Updater_); + GetCache(); + } + + /*! + * Fetching must enabled in TClientSettings + * Can throw exception if cache is invalid or wrong config + * @param dst + */ + TString GetTicket(const TClientSettings::TAlias& dst) const { + TServiceTicketsPtr c = GetCache(); + return GetTicketImpl(dst, c->TicketsByAlias, c->ErrorsByAlias, c->UnfetchedAliases); + } + + TString GetTicket(const TTvmId dst) const { + TServiceTicketsPtr c = GetCache(); + return GetTicketImpl(dst, c->TicketsById, c->ErrorsById, c->UnfetchedIds); + } + + private: template <class Key, class Cont, class UnfetchedCont> TString GetTicketImpl(const Key& dst, const Cont& tickets, const Cont& errors, const UnfetchedCont& unfetched) const { - auto it = tickets.find(dst); - if (it != tickets.end()) { - return it->second; - } - - it = errors.find(dst); - if (it != errors.end()) { - ythrow TMissingServiceTicket() - << "Failed to get ticket for '" << dst << "': " - << it->second; - } - + auto it = tickets.find(dst); + if (it != tickets.end()) { + return it->second; + } + + it = errors.find(dst); + if (it != errors.end()) { + ythrow TMissingServiceTicket() + << "Failed to get ticket for '" << dst << "': " + << it->second; + } + if (unfetched.contains(dst)) { ythrow TMissingServiceTicket() << "Failed to get ticket for '" << dst << "': this dst was not fetched yet."; } - ythrow TBrokenTvmClientSettings() - << "Destination '" << dst << "' was not specified in settings. " - << "Check your settings (if you use Qloud/YP/tvmtool - check it's settings)"; - } - - private: - TServiceTicketsPtr GetCache() const { - TServiceTicketsPtr c = Updater_->GetCachedServiceTickets(); - Y_ENSURE_EX(c, TBrokenTvmClientSettings() - << "Need to use TClientSettings::EnableServiceTicketsFetchOptions()"); - return c; - } - - private: - TAsyncUpdaterPtr Updater_; - }; -} + ythrow TBrokenTvmClientSettings() + << "Destination '" << dst << "' was not specified in settings. " + << "Check your settings (if you use Qloud/YP/tvmtool - check it's settings)"; + } + + private: + TServiceTicketsPtr GetCache() const { + TServiceTicketsPtr c = Updater_->GetCachedServiceTickets(); + Y_ENSURE_EX(c, TBrokenTvmClientSettings() + << "Need to use TClientSettings::EnableServiceTicketsFetchOptions()"); + return c; + } + + private: + TAsyncUpdaterPtr Updater_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/last_error.cpp b/library/cpp/tvmauth/client/misc/last_error.cpp index a6279bb1ef..b71f4d5bbb 100644 --- a/library/cpp/tvmauth/client/misc/last_error.cpp +++ b/library/cpp/tvmauth/client/misc/last_error.cpp @@ -1,115 +1,115 @@ -#include "last_error.h" - -#include <util/string/builder.h> - -namespace NTvmAuth { - TLastError::TLastError() - : LastErrors_(MakeIntrusiveConst<TLastErrors>()) - { - } - - TString TLastError::GetLastError(bool isOk, EType* type) const { - if (isOk) { - return OK_; - } - - const TLastErrorsPtr ptr = LastErrors_.Get(); - - for (const TLastErr& err : ptr->Errors) { - if (err && err->first == EType::NonRetriable) { - if (type) { - *type = EType::NonRetriable; - } - return err->second; - } - } - - for (const TLastErr& err : ptr->Errors) { - if (err) { - if (type) { - *type = EType::Retriable; - } - return err->second; - } - } - - if (type) { - *type = EType::NonRetriable; - } - return "Internal client error: failed to collect last useful error message, please report this message to tvm-dev@yandex-team.ru"; - } - - TString TLastError::ProcessHttpError(TLastError::EScope scope, - TStringBuf path, - int code, - const TString& msg) const { - TString err = TStringBuilder() << "Path:" << path << ".Code=" << code << ": " << msg; - - ProcessError(code >= 400 && code < 500 ? EType::NonRetriable - : EType::Retriable, - scope, - err); - - return err; - } - - void TLastError::ProcessError(TLastError::EType type, TLastError::EScope scope, const TStringBuf msg) const { - Update(scope, [&](TLastErr& lastError) { - if (lastError && lastError->first == EType::NonRetriable && type == EType::Retriable) { - return false; - } - - TString err = TStringBuilder() << scope << ": " << msg; - err.erase(std::remove(err.begin(), err.vend(), '\r'), err.vend()); - std::replace(err.begin(), err.vend(), '\n', ' '); - - lastError = {type, std::move(err)}; - return true; - }); - } - - void TLastError::ClearError(TLastError::EScope scope) { - Update(scope, [&](TLastErr& lastError) { - if (!lastError) { - return false; - } - - lastError.Clear(); - return true; - }); - } - - void TLastError::ClearErrors() { - for (size_t idx = 0; idx < (size_t)EScope::COUNT; ++idx) { - ClearError((EScope)idx); - } - } - - void TLastError::ThrowLastError() { - EType type; - TString err = GetLastError(false, &type); - - switch (type) { - case EType::NonRetriable: - ythrow TNonRetriableException() - << "Failed to start TvmClient. Do not retry: " - << err; - case EType::Retriable: - ythrow TRetriableException() - << "Failed to start TvmClient. You can retry: " - << err; - } - } - - template <typename Func> - void TLastError::Update(TLastError::EScope scope, Func func) const { - Y_VERIFY(scope != EScope::COUNT); - - TLastErrors errs = *LastErrors_.Get(); - TLastErr& lastError = errs.Errors[(size_t)scope]; - - if (func(lastError)) { - LastErrors_.Set(MakeIntrusiveConst<TLastErrors>(std::move(errs))); - } - } -} +#include "last_error.h" + +#include <util/string/builder.h> + +namespace NTvmAuth { + TLastError::TLastError() + : LastErrors_(MakeIntrusiveConst<TLastErrors>()) + { + } + + TString TLastError::GetLastError(bool isOk, EType* type) const { + if (isOk) { + return OK_; + } + + const TLastErrorsPtr ptr = LastErrors_.Get(); + + for (const TLastErr& err : ptr->Errors) { + if (err && err->first == EType::NonRetriable) { + if (type) { + *type = EType::NonRetriable; + } + return err->second; + } + } + + for (const TLastErr& err : ptr->Errors) { + if (err) { + if (type) { + *type = EType::Retriable; + } + return err->second; + } + } + + if (type) { + *type = EType::NonRetriable; + } + return "Internal client error: failed to collect last useful error message, please report this message to tvm-dev@yandex-team.ru"; + } + + TString TLastError::ProcessHttpError(TLastError::EScope scope, + TStringBuf path, + int code, + const TString& msg) const { + TString err = TStringBuilder() << "Path:" << path << ".Code=" << code << ": " << msg; + + ProcessError(code >= 400 && code < 500 ? EType::NonRetriable + : EType::Retriable, + scope, + err); + + return err; + } + + void TLastError::ProcessError(TLastError::EType type, TLastError::EScope scope, const TStringBuf msg) const { + Update(scope, [&](TLastErr& lastError) { + if (lastError && lastError->first == EType::NonRetriable && type == EType::Retriable) { + return false; + } + + TString err = TStringBuilder() << scope << ": " << msg; + err.erase(std::remove(err.begin(), err.vend(), '\r'), err.vend()); + std::replace(err.begin(), err.vend(), '\n', ' '); + + lastError = {type, std::move(err)}; + return true; + }); + } + + void TLastError::ClearError(TLastError::EScope scope) { + Update(scope, [&](TLastErr& lastError) { + if (!lastError) { + return false; + } + + lastError.Clear(); + return true; + }); + } + + void TLastError::ClearErrors() { + for (size_t idx = 0; idx < (size_t)EScope::COUNT; ++idx) { + ClearError((EScope)idx); + } + } + + void TLastError::ThrowLastError() { + EType type; + TString err = GetLastError(false, &type); + + switch (type) { + case EType::NonRetriable: + ythrow TNonRetriableException() + << "Failed to start TvmClient. Do not retry: " + << err; + case EType::Retriable: + ythrow TRetriableException() + << "Failed to start TvmClient. You can retry: " + << err; + } + } + + template <typename Func> + void TLastError::Update(TLastError::EScope scope, Func func) const { + Y_VERIFY(scope != EScope::COUNT); + + TLastErrors errs = *LastErrors_.Get(); + TLastErr& lastError = errs.Errors[(size_t)scope]; + + if (func(lastError)) { + LastErrors_.Set(MakeIntrusiveConst<TLastErrors>(std::move(errs))); + } + } +} diff --git a/library/cpp/tvmauth/client/misc/last_error.h b/library/cpp/tvmauth/client/misc/last_error.h index b0ad33611f..7d650a9b12 100644 --- a/library/cpp/tvmauth/client/misc/last_error.h +++ b/library/cpp/tvmauth/client/misc/last_error.h @@ -1,51 +1,51 @@ -#pragma once - -#include "utils.h" - -#include <array> - -namespace NTvmAuth { - class TLastError { - public: - enum class EType { - NonRetriable, - Retriable, - }; - - enum class EScope { - ServiceTickets, - PublicKeys, - Roles, - TvmtoolConfig, - - COUNT, - }; - - using TLastErr = TMaybe<std::pair<EType, TString>>; - - struct TLastErrors: public TAtomicRefCount<TLastErrors> { - std::array<TLastErr, (int)EScope::COUNT> Errors; - }; - using TLastErrorsPtr = TIntrusiveConstPtr<TLastErrors>; - - public: - TLastError(); - - TString GetLastError(bool isOk, EType* type = nullptr) const; - - TString ProcessHttpError(EScope scope, TStringBuf path, int code, const TString& msg) const; - void ProcessError(EType type, EScope scope, const TStringBuf msg) const; - void ClearError(EScope scope); - void ClearErrors(); - void ThrowLastError(); - - private: - template <typename Func> - void Update(EScope scope, Func func) const; - - private: - const TString OK_ = "OK"; - - mutable NUtils::TProtectedValue<TLastErrorsPtr> LastErrors_; - }; -} +#pragma once + +#include "utils.h" + +#include <array> + +namespace NTvmAuth { + class TLastError { + public: + enum class EType { + NonRetriable, + Retriable, + }; + + enum class EScope { + ServiceTickets, + PublicKeys, + Roles, + TvmtoolConfig, + + COUNT, + }; + + using TLastErr = TMaybe<std::pair<EType, TString>>; + + struct TLastErrors: public TAtomicRefCount<TLastErrors> { + std::array<TLastErr, (int)EScope::COUNT> Errors; + }; + using TLastErrorsPtr = TIntrusiveConstPtr<TLastErrors>; + + public: + TLastError(); + + TString GetLastError(bool isOk, EType* type = nullptr) const; + + TString ProcessHttpError(EScope scope, TStringBuf path, int code, const TString& msg) const; + void ProcessError(EType type, EScope scope, const TStringBuf msg) const; + void ClearError(EScope scope); + void ClearErrors(); + void ThrowLastError(); + + private: + template <typename Func> + void Update(EScope scope, Func func) const; + + private: + const TString OK_ = "OK"; + + mutable NUtils::TProtectedValue<TLastErrorsPtr> LastErrors_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/proc_info.cpp b/library/cpp/tvmauth/client/misc/proc_info.cpp index e2e5ec15b9..0d4535b47f 100644 --- a/library/cpp/tvmauth/client/misc/proc_info.cpp +++ b/library/cpp/tvmauth/client/misc/proc_info.cpp @@ -1,53 +1,53 @@ -#include "proc_info.h" - -#include <library/cpp/tvmauth/version.h> - -#include <library/cpp/string_utils/quote/quote.h> - -#include <util/stream/file.h> -#include <util/string/cast.h> -#include <util/system/getpid.h> - -namespace NTvmAuth::NUtils { - void TProcInfo::AddToRequest(IOutputStream& out) const { - out << "_pid=" << Pid; - if (ProcessName) { - out << "&_procces_name=" << *ProcessName; - } - out << "&lib_version=client_" << VersionPrefix << LibVersion(); - } - - TProcInfo TProcInfo::Create(const TString& versionPrefix) { - TProcInfo res; - res.Pid = IntToString<10>(GetPID()); - res.ProcessName = GetProcessName(); - res.VersionPrefix = versionPrefix; - return res; - } - - std::optional<TString> TProcInfo::GetProcessName() { - try { - // works only for linux - TFileInput proc("/proc/self/status"); - - TString line; - while (proc.ReadLine(line)) { - TStringBuf buf(line); - if (!buf.SkipPrefix("Name:")) { - continue; - } - - while (buf && isspace(buf.front())) { - buf.Skip(1); - } - - TString res(buf); - CGIEscape(res); - return res; - } - } catch (...) { - } - - return {}; - } -} +#include "proc_info.h" + +#include <library/cpp/tvmauth/version.h> + +#include <library/cpp/string_utils/quote/quote.h> + +#include <util/stream/file.h> +#include <util/string/cast.h> +#include <util/system/getpid.h> + +namespace NTvmAuth::NUtils { + void TProcInfo::AddToRequest(IOutputStream& out) const { + out << "_pid=" << Pid; + if (ProcessName) { + out << "&_procces_name=" << *ProcessName; + } + out << "&lib_version=client_" << VersionPrefix << LibVersion(); + } + + TProcInfo TProcInfo::Create(const TString& versionPrefix) { + TProcInfo res; + res.Pid = IntToString<10>(GetPID()); + res.ProcessName = GetProcessName(); + res.VersionPrefix = versionPrefix; + return res; + } + + std::optional<TString> TProcInfo::GetProcessName() { + try { + // works only for linux + TFileInput proc("/proc/self/status"); + + TString line; + while (proc.ReadLine(line)) { + TStringBuf buf(line); + if (!buf.SkipPrefix("Name:")) { + continue; + } + + while (buf && isspace(buf.front())) { + buf.Skip(1); + } + + TString res(buf); + CGIEscape(res); + return res; + } + } catch (...) { + } + + return {}; + } +} diff --git a/library/cpp/tvmauth/client/misc/proc_info.h b/library/cpp/tvmauth/client/misc/proc_info.h index b1526e5c47..8595f23a76 100644 --- a/library/cpp/tvmauth/client/misc/proc_info.h +++ b/library/cpp/tvmauth/client/misc/proc_info.h @@ -1,18 +1,18 @@ -#pragma once - -#include <util/generic/string.h> - -#include <optional> - -namespace NTvmAuth::NUtils { - struct TProcInfo { - TString Pid; - std::optional<TString> ProcessName; - TString VersionPrefix; - - void AddToRequest(IOutputStream& out) const; - - static TProcInfo Create(const TString& versionPrefix); - static std::optional<TString> GetProcessName(); - }; -} +#pragma once + +#include <util/generic/string.h> + +#include <optional> + +namespace NTvmAuth::NUtils { + struct TProcInfo { + TString Pid; + std::optional<TString> ProcessName; + TString VersionPrefix; + + void AddToRequest(IOutputStream& out) const; + + static TProcInfo Create(const TString& versionPrefix); + static std::optional<TString> GetProcessName(); + }; +} diff --git a/library/cpp/tvmauth/client/misc/retry_settings/v1/settings.proto b/library/cpp/tvmauth/client/misc/retry_settings/v1/settings.proto index 72817847a6..840a4d0c7b 100644 --- a/library/cpp/tvmauth/client/misc/retry_settings/v1/settings.proto +++ b/library/cpp/tvmauth/client/misc/retry_settings/v1/settings.proto @@ -1,21 +1,21 @@ -syntax = "proto2"; - -package retry_settings.v1; - -option cc_enable_arenas = true; -option go_package = "a.yandex-team.ru/library/cpp/tvmauth/client/misc/retry_settings/v1"; - -message Settings { - optional uint32 exponential_backoff_min_sec = 1; - optional uint32 exponential_backoff_max_sec = 2; - optional double exponential_backoff_factor = 3; - optional double exponential_backoff_jitter = 4; - optional uint32 max_random_sleep_default = 5; - optional uint32 max_random_sleep_when_ok = 12; - optional uint32 retries_on_start = 6; - optional uint32 worker_awaking_period_sec = 7; - optional uint32 dsts_limit = 8; - optional uint32 retries_in_background = 9; - optional uint32 roles_update_period_sec = 10; - optional uint32 roles_warn_period_sec = 11; -} +syntax = "proto2"; + +package retry_settings.v1; + +option cc_enable_arenas = true; +option go_package = "a.yandex-team.ru/library/cpp/tvmauth/client/misc/retry_settings/v1"; + +message Settings { + optional uint32 exponential_backoff_min_sec = 1; + optional uint32 exponential_backoff_max_sec = 2; + optional double exponential_backoff_factor = 3; + optional double exponential_backoff_jitter = 4; + optional uint32 max_random_sleep_default = 5; + optional uint32 max_random_sleep_when_ok = 12; + optional uint32 retries_on_start = 6; + optional uint32 worker_awaking_period_sec = 7; + optional uint32 dsts_limit = 8; + optional uint32 retries_in_background = 9; + optional uint32 roles_update_period_sec = 10; + optional uint32 roles_warn_period_sec = 11; +} diff --git a/library/cpp/tvmauth/client/misc/retry_settings/v1/ya.make b/library/cpp/tvmauth/client/misc/retry_settings/v1/ya.make index 226bf7cea7..0e1453fd98 100644 --- a/library/cpp/tvmauth/client/misc/retry_settings/v1/ya.make +++ b/library/cpp/tvmauth/client/misc/retry_settings/v1/ya.make @@ -1,15 +1,15 @@ -PROTO_LIBRARY() - -OWNER(g:passport_infra) - -EXCLUDE_TAGS( - JAVA_PROTO - PY_PROTO - PY3_PROTO -) - -SRCS( - settings.proto -) - -END() +PROTO_LIBRARY() + +OWNER(g:passport_infra) + +EXCLUDE_TAGS( + JAVA_PROTO + PY_PROTO + PY3_PROTO +) + +SRCS( + settings.proto +) + +END() diff --git a/library/cpp/tvmauth/client/misc/roles/decoder.cpp b/library/cpp/tvmauth/client/misc/roles/decoder.cpp index 6337fb91c2..98905e97e3 100644 --- a/library/cpp/tvmauth/client/misc/roles/decoder.cpp +++ b/library/cpp/tvmauth/client/misc/roles/decoder.cpp @@ -1,93 +1,93 @@ -#include "decoder.h" - -#include <library/cpp/tvmauth/client/misc/utils.h> - -#include <library/cpp/openssl/crypto/sha.h> -#include <library/cpp/streams/brotli/brotli.h> -#include <library/cpp/streams/zstd/zstd.h> - -#include <util/generic/yexception.h> -#include <util/stream/zlib.h> -#include <util/string/ascii.h> - -namespace NTvmAuth::NRoles { - TString TDecoder::Decode(const TStringBuf codec, TString&& blob) { - if (codec.empty()) { - return std::move(blob); - } - - const TCodecInfo info = ParseCodec(codec); - TString decoded = DecodeImpl(info.Type, blob); - - VerifySize(decoded, info.Size); - VerifyChecksum(decoded, info.Sha256); - - return decoded; - } - - TDecoder::TCodecInfo TDecoder::ParseCodec(TStringBuf codec) { - const char delim = ':'; - - const TStringBuf version = codec.NextTok(delim); - Y_ENSURE(version == "1", - "unknown codec format version; known: 1; got: " << version); - - TCodecInfo res; - res.Type = codec.NextTok(delim); - Y_ENSURE(res.Type, "codec type is empty"); - - const TStringBuf size = codec.NextTok(delim); - Y_ENSURE(TryIntFromString<10>(size, res.Size), - "decoded blob size is not number"); - - res.Sha256 = codec; - const size_t expectedSha256Size = 2 * NOpenSsl::NSha256::DIGEST_LENGTH; - Y_ENSURE(res.Sha256.size() == expectedSha256Size, - "sha256 of decoded blob has invalid length: expected " - << expectedSha256Size << ", got " << res.Sha256.size()); - - return res; - } - - TString TDecoder::DecodeImpl(TStringBuf codec, const TString& blob) { - if (AsciiEqualsIgnoreCase(codec, "brotli")) { - return DecodeBrolti(blob); - } else if (AsciiEqualsIgnoreCase(codec, "gzip")) { - return DecodeGzip(blob); - } else if (AsciiEqualsIgnoreCase(codec, "zstd")) { - return DecodeZstd(blob); - } - - ythrow yexception() << "unknown codec: '" << codec << "'"; - } - - TString TDecoder::DecodeBrolti(const TString& blob) { - TStringInput in(blob); - return TBrotliDecompress(&in).ReadAll(); - } - - TString TDecoder::DecodeGzip(const TString& blob) { - TStringInput in(blob); - return TZLibDecompress(&in).ReadAll(); - } - - TString TDecoder::DecodeZstd(const TString& blob) { - TStringInput in(blob); - return TZstdDecompress(&in).ReadAll(); - } - - void TDecoder::VerifySize(const TStringBuf decoded, size_t expected) { - Y_ENSURE(expected == decoded.size(), - "Decoded blob has bad size: expected " << expected << ", actual " << decoded.size()); - } - - void TDecoder::VerifyChecksum(const TStringBuf decoded, const TStringBuf expected) { - using namespace NOpenSsl::NSha256; - - const TDigest dig = Calc(decoded); - const TString actual = NUtils::ToHex(TStringBuf((char*)dig.data(), dig.size())); - - Y_ENSURE(AsciiEqualsIgnoreCase(actual, expected), - "Decoded blob has bad sha256: expected=" << expected << ", actual=" << actual); - } -} +#include "decoder.h" + +#include <library/cpp/tvmauth/client/misc/utils.h> + +#include <library/cpp/openssl/crypto/sha.h> +#include <library/cpp/streams/brotli/brotli.h> +#include <library/cpp/streams/zstd/zstd.h> + +#include <util/generic/yexception.h> +#include <util/stream/zlib.h> +#include <util/string/ascii.h> + +namespace NTvmAuth::NRoles { + TString TDecoder::Decode(const TStringBuf codec, TString&& blob) { + if (codec.empty()) { + return std::move(blob); + } + + const TCodecInfo info = ParseCodec(codec); + TString decoded = DecodeImpl(info.Type, blob); + + VerifySize(decoded, info.Size); + VerifyChecksum(decoded, info.Sha256); + + return decoded; + } + + TDecoder::TCodecInfo TDecoder::ParseCodec(TStringBuf codec) { + const char delim = ':'; + + const TStringBuf version = codec.NextTok(delim); + Y_ENSURE(version == "1", + "unknown codec format version; known: 1; got: " << version); + + TCodecInfo res; + res.Type = codec.NextTok(delim); + Y_ENSURE(res.Type, "codec type is empty"); + + const TStringBuf size = codec.NextTok(delim); + Y_ENSURE(TryIntFromString<10>(size, res.Size), + "decoded blob size is not number"); + + res.Sha256 = codec; + const size_t expectedSha256Size = 2 * NOpenSsl::NSha256::DIGEST_LENGTH; + Y_ENSURE(res.Sha256.size() == expectedSha256Size, + "sha256 of decoded blob has invalid length: expected " + << expectedSha256Size << ", got " << res.Sha256.size()); + + return res; + } + + TString TDecoder::DecodeImpl(TStringBuf codec, const TString& blob) { + if (AsciiEqualsIgnoreCase(codec, "brotli")) { + return DecodeBrolti(blob); + } else if (AsciiEqualsIgnoreCase(codec, "gzip")) { + return DecodeGzip(blob); + } else if (AsciiEqualsIgnoreCase(codec, "zstd")) { + return DecodeZstd(blob); + } + + ythrow yexception() << "unknown codec: '" << codec << "'"; + } + + TString TDecoder::DecodeBrolti(const TString& blob) { + TStringInput in(blob); + return TBrotliDecompress(&in).ReadAll(); + } + + TString TDecoder::DecodeGzip(const TString& blob) { + TStringInput in(blob); + return TZLibDecompress(&in).ReadAll(); + } + + TString TDecoder::DecodeZstd(const TString& blob) { + TStringInput in(blob); + return TZstdDecompress(&in).ReadAll(); + } + + void TDecoder::VerifySize(const TStringBuf decoded, size_t expected) { + Y_ENSURE(expected == decoded.size(), + "Decoded blob has bad size: expected " << expected << ", actual " << decoded.size()); + } + + void TDecoder::VerifyChecksum(const TStringBuf decoded, const TStringBuf expected) { + using namespace NOpenSsl::NSha256; + + const TDigest dig = Calc(decoded); + const TString actual = NUtils::ToHex(TStringBuf((char*)dig.data(), dig.size())); + + Y_ENSURE(AsciiEqualsIgnoreCase(actual, expected), + "Decoded blob has bad sha256: expected=" << expected << ", actual=" << actual); + } +} diff --git a/library/cpp/tvmauth/client/misc/roles/decoder.h b/library/cpp/tvmauth/client/misc/roles/decoder.h index de5cdb37e0..ef77cab56d 100644 --- a/library/cpp/tvmauth/client/misc/roles/decoder.h +++ b/library/cpp/tvmauth/client/misc/roles/decoder.h @@ -1,32 +1,32 @@ -#pragma once - -#include <util/generic/string.h> - -namespace NTvmAuth::NRoles { - class TDecoder { - public: - static TString Decode(const TStringBuf codec, TString&& blob); - - public: - struct TCodecInfo { - TStringBuf Type; - size_t Size = 0; - TStringBuf Sha256; - - bool operator==(const TCodecInfo& o) const { - return Type == o.Type && - Size == o.Size && - Sha256 == o.Sha256; - } - }; - - static TCodecInfo ParseCodec(TStringBuf codec); - static TString DecodeImpl(TStringBuf codec, const TString& blob); - static TString DecodeBrolti(const TString& blob); - static TString DecodeGzip(const TString& blob); - static TString DecodeZstd(const TString& blob); - - static void VerifySize(const TStringBuf decoded, size_t expected); - static void VerifyChecksum(const TStringBuf decoded, const TStringBuf expected); - }; -} +#pragma once + +#include <util/generic/string.h> + +namespace NTvmAuth::NRoles { + class TDecoder { + public: + static TString Decode(const TStringBuf codec, TString&& blob); + + public: + struct TCodecInfo { + TStringBuf Type; + size_t Size = 0; + TStringBuf Sha256; + + bool operator==(const TCodecInfo& o) const { + return Type == o.Type && + Size == o.Size && + Sha256 == o.Sha256; + } + }; + + static TCodecInfo ParseCodec(TStringBuf codec); + static TString DecodeImpl(TStringBuf codec, const TString& blob); + static TString DecodeBrolti(const TString& blob); + static TString DecodeGzip(const TString& blob); + static TString DecodeZstd(const TString& blob); + + static void VerifySize(const TStringBuf decoded, size_t expected); + static void VerifyChecksum(const TStringBuf decoded, const TStringBuf expected); + }; +} diff --git a/library/cpp/tvmauth/client/misc/roles/entities_index.cpp b/library/cpp/tvmauth/client/misc/roles/entities_index.cpp index c9b72c3a17..2a9e4ab7b9 100644 --- a/library/cpp/tvmauth/client/misc/roles/entities_index.cpp +++ b/library/cpp/tvmauth/client/misc/roles/entities_index.cpp @@ -1,114 +1,114 @@ -#include "entities_index.h" - -#include <util/stream/str.h> - -#include <set> - -namespace NTvmAuth::NRoles { - TEntitiesIndex::TStage::TStage(const std::set<TString>& k) - : Keys_(k.begin(), k.end()) - { - } - - // TODO TStringBuf - bool TEntitiesIndex::TStage::GetNextKeySet(std::vector<TString>& out) { - out.clear(); - out.reserve(Keys_.size()); - - ++Id_; - for (size_t idx = 0; idx < Keys_.size(); ++idx) { - bool need = (Id_ >> idx) & 0x01; - - if (need) { - out.push_back(Keys_[idx]); - } - } - - return !out.empty(); - } - - TEntitiesIndex::TEntitiesIndex(const std::vector<TEntityPtr>& entities) { - const std::set<TString> uniqueKeys = GetUniqueSortedKeys(entities); - Idx_.Entities = entities; - Idx_.SubTree.reserve(uniqueKeys.size() * entities.size()); - - TStage stage(uniqueKeys); - std::vector<TString> keyset; - while (stage.GetNextKeySet(keyset)) { - for (const TEntityPtr& e : entities) { - TSubTree* currentBranch = &Idx_; - - for (const TString& key : keyset) { - auto it = e->find(key); - if (it == e->end()) { - continue; - } - - auto [i, ok] = currentBranch->SubTree.emplace( - TKeyValue{it->first, it->second}, - TSubTree()); - - currentBranch = &i->second; - currentBranch->Entities.push_back(e); - } - } - } - - MakeUnique(Idx_); - } - - std::set<TString> TEntitiesIndex::GetUniqueSortedKeys(const std::vector<TEntityPtr>& entities) { - std::set<TString> res; - - for (const TEntityPtr& e : entities) { - for (const auto& [key, value] : *e) { - res.insert(key); - } - } - - return res; - } - - void TEntitiesIndex::MakeUnique(TSubTree& branch) { - auto& vec = branch.Entities; - std::sort(vec.begin(), vec.end()); - vec.erase(std::unique(vec.begin(), vec.end()), vec.end()); - - for (auto& [_, restPart] : branch.SubTree) { - MakeUnique(restPart); - } - } - - static void Print(const TEntitiesIndex::TSubTree& part, IOutputStream& out, size_t offset = 0) { - std::vector<std::pair<TKeyValue, const TEntitiesIndex::TSubTree*>> vec; - vec.reserve(part.SubTree.size()); - - for (const auto& [key, value] : part.SubTree) { - vec.push_back({key, &value}); - } - - std::sort(vec.begin(), vec.end(), [](const auto& l, const auto& r) { - if (l.first.Key < r.first.Key) { - return true; - } - if (l.first.Value < r.first.Value) { - return true; - } - return false; - }); - - for (const auto& [key, value] : vec) { - out << TString(offset, ' ') << "\"" << key.Key << "/" << key.Value << "\"" << Endl; - Print(*value, out, offset + 4); - } - } - - TString TEntitiesIndex::PrintDebugString() const { - TStringStream res; - res << Endl; - - Print(Idx_, res); - - return res.Str(); - } -} +#include "entities_index.h" + +#include <util/stream/str.h> + +#include <set> + +namespace NTvmAuth::NRoles { + TEntitiesIndex::TStage::TStage(const std::set<TString>& k) + : Keys_(k.begin(), k.end()) + { + } + + // TODO TStringBuf + bool TEntitiesIndex::TStage::GetNextKeySet(std::vector<TString>& out) { + out.clear(); + out.reserve(Keys_.size()); + + ++Id_; + for (size_t idx = 0; idx < Keys_.size(); ++idx) { + bool need = (Id_ >> idx) & 0x01; + + if (need) { + out.push_back(Keys_[idx]); + } + } + + return !out.empty(); + } + + TEntitiesIndex::TEntitiesIndex(const std::vector<TEntityPtr>& entities) { + const std::set<TString> uniqueKeys = GetUniqueSortedKeys(entities); + Idx_.Entities = entities; + Idx_.SubTree.reserve(uniqueKeys.size() * entities.size()); + + TStage stage(uniqueKeys); + std::vector<TString> keyset; + while (stage.GetNextKeySet(keyset)) { + for (const TEntityPtr& e : entities) { + TSubTree* currentBranch = &Idx_; + + for (const TString& key : keyset) { + auto it = e->find(key); + if (it == e->end()) { + continue; + } + + auto [i, ok] = currentBranch->SubTree.emplace( + TKeyValue{it->first, it->second}, + TSubTree()); + + currentBranch = &i->second; + currentBranch->Entities.push_back(e); + } + } + } + + MakeUnique(Idx_); + } + + std::set<TString> TEntitiesIndex::GetUniqueSortedKeys(const std::vector<TEntityPtr>& entities) { + std::set<TString> res; + + for (const TEntityPtr& e : entities) { + for (const auto& [key, value] : *e) { + res.insert(key); + } + } + + return res; + } + + void TEntitiesIndex::MakeUnique(TSubTree& branch) { + auto& vec = branch.Entities; + std::sort(vec.begin(), vec.end()); + vec.erase(std::unique(vec.begin(), vec.end()), vec.end()); + + for (auto& [_, restPart] : branch.SubTree) { + MakeUnique(restPart); + } + } + + static void Print(const TEntitiesIndex::TSubTree& part, IOutputStream& out, size_t offset = 0) { + std::vector<std::pair<TKeyValue, const TEntitiesIndex::TSubTree*>> vec; + vec.reserve(part.SubTree.size()); + + for (const auto& [key, value] : part.SubTree) { + vec.push_back({key, &value}); + } + + std::sort(vec.begin(), vec.end(), [](const auto& l, const auto& r) { + if (l.first.Key < r.first.Key) { + return true; + } + if (l.first.Value < r.first.Value) { + return true; + } + return false; + }); + + for (const auto& [key, value] : vec) { + out << TString(offset, ' ') << "\"" << key.Key << "/" << key.Value << "\"" << Endl; + Print(*value, out, offset + 4); + } + } + + TString TEntitiesIndex::PrintDebugString() const { + TStringStream res; + res << Endl; + + Print(Idx_, res); + + return res.Str(); + } +} diff --git a/library/cpp/tvmauth/client/misc/roles/entities_index.h b/library/cpp/tvmauth/client/misc/roles/entities_index.h index bf42750d52..50ecacd77f 100644 --- a/library/cpp/tvmauth/client/misc/roles/entities_index.h +++ b/library/cpp/tvmauth/client/misc/roles/entities_index.h @@ -1,107 +1,107 @@ -#pragma once - -#include "types.h" - -#include <library/cpp/tvmauth/client/exception.h> - -#include <set> -#include <vector> - -namespace NTvmAuth::NRoles { - class TEntitiesIndex: TMoveOnly { - public: - struct TSubTree; - using TIdxByAttrs = THashMap<TKeyValue, TSubTree>; - - struct TSubTree { - std::vector<TEntityPtr> Entities; - TIdxByAttrs SubTree; - }; - - class TStage { - public: - TStage(const std::set<TString>& k); - - bool GetNextKeySet(std::vector<TString>& out); - - private: - std::vector<TString> Keys_; - size_t Id_ = 0; - }; - - public: - TEntitiesIndex(const std::vector<TEntityPtr>& entities); - - /** - * Iterators must be to sorted unique key/value - */ - template <typename Iterator> - bool ContainsExactEntity(Iterator begin, Iterator end) const; - - /** - * Iterators must be to sorted unique key/value - */ - template <typename Iterator> - const std::vector<TEntityPtr>& GetEntitiesWithAttrs(Iterator begin, Iterator end) const; - - public: // for tests - static std::set<TString> GetUniqueSortedKeys(const std::vector<TEntityPtr>& entities); - static void MakeUnique(TEntitiesIndex::TSubTree& branch); - - TString PrintDebugString() const; - - private: - template <typename Iterator> - const TSubTree* FindSubtree(Iterator begin, Iterator end, size_t& size) const; - - private: - TSubTree Idx_; - std::vector<TEntityPtr> EmptyResult_; - }; - - template <typename Iterator> - bool TEntitiesIndex::ContainsExactEntity(Iterator begin, Iterator end) const { - size_t size = 0; - const TSubTree* subtree = FindSubtree(begin, end, size); - if (!subtree) { - return false; - } - - auto res = std::find_if( - subtree->Entities.begin(), - subtree->Entities.end(), - [size](const auto& e) { return size == e->size(); }); - return res != subtree->Entities.end(); - } - - template <typename Iterator> - const std::vector<TEntityPtr>& TEntitiesIndex::GetEntitiesWithAttrs(Iterator begin, Iterator end) const { - size_t size = 0; - const TSubTree* subtree = FindSubtree(begin, end, size); - if (!subtree) { - return EmptyResult_; - } - - return subtree->Entities; - } - - template <typename Iterator> - const TEntitiesIndex::TSubTree* TEntitiesIndex::FindSubtree(Iterator begin, - Iterator end, - size_t& size) const { - const TSubTree* subtree = &Idx_; - size = 0; - - for (auto attr = begin; attr != end; ++attr) { - auto it = subtree->SubTree.find(TKeyValueView{attr->first, attr->second}); - if (it == subtree->SubTree.end()) { - return nullptr; - } - - ++size; - subtree = &it->second; - } - - return subtree; - } -} +#pragma once + +#include "types.h" + +#include <library/cpp/tvmauth/client/exception.h> + +#include <set> +#include <vector> + +namespace NTvmAuth::NRoles { + class TEntitiesIndex: TMoveOnly { + public: + struct TSubTree; + using TIdxByAttrs = THashMap<TKeyValue, TSubTree>; + + struct TSubTree { + std::vector<TEntityPtr> Entities; + TIdxByAttrs SubTree; + }; + + class TStage { + public: + TStage(const std::set<TString>& k); + + bool GetNextKeySet(std::vector<TString>& out); + + private: + std::vector<TString> Keys_; + size_t Id_ = 0; + }; + + public: + TEntitiesIndex(const std::vector<TEntityPtr>& entities); + + /** + * Iterators must be to sorted unique key/value + */ + template <typename Iterator> + bool ContainsExactEntity(Iterator begin, Iterator end) const; + + /** + * Iterators must be to sorted unique key/value + */ + template <typename Iterator> + const std::vector<TEntityPtr>& GetEntitiesWithAttrs(Iterator begin, Iterator end) const; + + public: // for tests + static std::set<TString> GetUniqueSortedKeys(const std::vector<TEntityPtr>& entities); + static void MakeUnique(TEntitiesIndex::TSubTree& branch); + + TString PrintDebugString() const; + + private: + template <typename Iterator> + const TSubTree* FindSubtree(Iterator begin, Iterator end, size_t& size) const; + + private: + TSubTree Idx_; + std::vector<TEntityPtr> EmptyResult_; + }; + + template <typename Iterator> + bool TEntitiesIndex::ContainsExactEntity(Iterator begin, Iterator end) const { + size_t size = 0; + const TSubTree* subtree = FindSubtree(begin, end, size); + if (!subtree) { + return false; + } + + auto res = std::find_if( + subtree->Entities.begin(), + subtree->Entities.end(), + [size](const auto& e) { return size == e->size(); }); + return res != subtree->Entities.end(); + } + + template <typename Iterator> + const std::vector<TEntityPtr>& TEntitiesIndex::GetEntitiesWithAttrs(Iterator begin, Iterator end) const { + size_t size = 0; + const TSubTree* subtree = FindSubtree(begin, end, size); + if (!subtree) { + return EmptyResult_; + } + + return subtree->Entities; + } + + template <typename Iterator> + const TEntitiesIndex::TSubTree* TEntitiesIndex::FindSubtree(Iterator begin, + Iterator end, + size_t& size) const { + const TSubTree* subtree = &Idx_; + size = 0; + + for (auto attr = begin; attr != end; ++attr) { + auto it = subtree->SubTree.find(TKeyValueView{attr->first, attr->second}); + if (it == subtree->SubTree.end()) { + return nullptr; + } + + ++size; + subtree = &it->second; + } + + return subtree; + } +} diff --git a/library/cpp/tvmauth/client/misc/roles/parser.cpp b/library/cpp/tvmauth/client/misc/roles/parser.cpp index eb991b5716..0d040bade6 100644 --- a/library/cpp/tvmauth/client/misc/roles/parser.cpp +++ b/library/cpp/tvmauth/client/misc/roles/parser.cpp @@ -1,149 +1,149 @@ -#include "parser.h" - -#include <library/cpp/json/json_reader.h> - -#include <util/string/cast.h> - -namespace NTvmAuth::NRoles { - static void GetRequiredValue(const NJson::TJsonValue& doc, - TStringBuf key, - NJson::TJsonValue& obj) { - Y_ENSURE(doc.GetValue(key, &obj), "Missing '" << key << "'"); - } - - static ui64 GetRequiredUInt(const NJson::TJsonValue& doc, - TStringBuf key) { - NJson::TJsonValue obj; - GetRequiredValue(doc, key, obj); - Y_ENSURE(obj.IsUInteger(), "key '" << key << "' must be uint"); - return obj.GetUInteger(); - } - - static bool GetOptionalMap(const NJson::TJsonValue& doc, - TStringBuf key, - NJson::TJsonValue& obj) { - if (!doc.GetValue(key, &obj)) { - return false; - } - - Y_ENSURE(obj.IsMap(), "'" << key << "' must be object"); - return true; - } - - TRolesPtr TParser::Parse(TRawPtr decodedBlob) { - try { - return ParseImpl(decodedBlob); - } catch (const std::exception& e) { - throw yexception() << "Failed to parse roles from tirole: " << e.what() - << ". '" << *decodedBlob << "'"; - } - } - - TRolesPtr TParser::ParseImpl(TRawPtr decodedBlob) { - NJson::TJsonValue doc; - Y_ENSURE(NJson::ReadJsonTree(*decodedBlob, &doc), "Invalid json"); - Y_ENSURE(doc.IsMap(), "Json must be object"); - - TRoles::TTvmConsumers tvm = GetConsumers<TTvmId>(doc, "tvm"); - TRoles::TUserConsumers user = GetConsumers<TUid>(doc, "user"); - - // fetch it last to provide more correct apply instant - TRoles::TMeta meta = GetMeta(doc); - - return std::make_shared<TRoles>( - std::move(meta), - std::move(tvm), - std::move(user), - std::move(decodedBlob)); - } - - TRoles::TMeta TParser::GetMeta(const NJson::TJsonValue& doc) { - TRoles::TMeta res; - - NJson::TJsonValue obj; - GetRequiredValue(doc, "revision", obj); - if (obj.IsString()) { - res.Revision = obj.GetString(); - } else if (obj.IsUInteger()) { - res.Revision = ToString(obj.GetUInteger()); - } else { - ythrow yexception() << "'revision' has unexpected type: " << obj.GetType(); - } - - res.BornTime = TInstant::Seconds(GetRequiredUInt(doc, "born_date")); - - return res; - } - - template <typename Id> - THashMap<Id, TConsumerRolesPtr> TParser::GetConsumers(const NJson::TJsonValue& doc, - TStringBuf type) { - THashMap<Id, TConsumerRolesPtr> res; - - NJson::TJsonValue obj; - if (!GetOptionalMap(doc, type, obj)) { - return res; - } - - for (const auto& [key, value] : obj.GetMap()) { - Y_ENSURE(value.IsMap(), - "roles for consumer must be map: '" << key << "' is " << value.GetType()); - - Id id = 0; - Y_ENSURE(TryIntFromString<10>(key, id), - "id must be valid positive number of proper size for " - << type << ". got '" - << key << "'"); - - Y_ENSURE(res.emplace(id, GetConsumer(value, key)).second, - "consumer duplicate detected: '" << key << "' for " << type); - } - - return res; - } - - TConsumerRolesPtr TParser::GetConsumer(const NJson::TJsonValue& obj, TStringBuf consumer) { - THashMap<TString, TEntitiesPtr> entities; - - for (const auto& [key, value] : obj.GetMap()) { - Y_ENSURE(value.IsArray(), - "entities for roles must be array: '" << key << "' is " << value.GetType()); - - entities.emplace(key, GetEntities(value, consumer, key)); - } - - return std::make_shared<TConsumerRoles>(std::move(entities)); - } - - TEntitiesPtr TParser::GetEntities(const NJson::TJsonValue& obj, - TStringBuf consumer, - TStringBuf role) { - std::vector<TEntityPtr> entities; - entities.reserve(obj.GetArray().size()); - - for (const NJson::TJsonValue& e : obj.GetArray()) { - Y_ENSURE(e.IsMap(), - "role entity for role must be map: consumer '" - << consumer << "' with role '" << role << "' has " << e.GetType()); - - entities.push_back(GetEntity(e, consumer, role)); - } - - return std::make_shared<TEntities>(TEntities(entities)); - } - - TEntityPtr TParser::GetEntity(const NJson::TJsonValue& obj, TStringBuf consumer, TStringBuf role) { - TEntityPtr res = std::make_shared<TEntity>(); - - for (const auto& [key, value] : obj.GetMap()) { - Y_ENSURE(value.IsString(), - "entity is map (str->str), got value " - << value.GetType() << ". consumer '" - << consumer << "' with role '" << role << "'"); - - res->emplace(key, value.GetString()); - } - - return res; - } -} +#include "parser.h" + +#include <library/cpp/json/json_reader.h> + +#include <util/string/cast.h> + +namespace NTvmAuth::NRoles { + static void GetRequiredValue(const NJson::TJsonValue& doc, + TStringBuf key, + NJson::TJsonValue& obj) { + Y_ENSURE(doc.GetValue(key, &obj), "Missing '" << key << "'"); + } + + static ui64 GetRequiredUInt(const NJson::TJsonValue& doc, + TStringBuf key) { + NJson::TJsonValue obj; + GetRequiredValue(doc, key, obj); + Y_ENSURE(obj.IsUInteger(), "key '" << key << "' must be uint"); + return obj.GetUInteger(); + } + + static bool GetOptionalMap(const NJson::TJsonValue& doc, + TStringBuf key, + NJson::TJsonValue& obj) { + if (!doc.GetValue(key, &obj)) { + return false; + } + + Y_ENSURE(obj.IsMap(), "'" << key << "' must be object"); + return true; + } + + TRolesPtr TParser::Parse(TRawPtr decodedBlob) { + try { + return ParseImpl(decodedBlob); + } catch (const std::exception& e) { + throw yexception() << "Failed to parse roles from tirole: " << e.what() + << ". '" << *decodedBlob << "'"; + } + } + + TRolesPtr TParser::ParseImpl(TRawPtr decodedBlob) { + NJson::TJsonValue doc; + Y_ENSURE(NJson::ReadJsonTree(*decodedBlob, &doc), "Invalid json"); + Y_ENSURE(doc.IsMap(), "Json must be object"); + + TRoles::TTvmConsumers tvm = GetConsumers<TTvmId>(doc, "tvm"); + TRoles::TUserConsumers user = GetConsumers<TUid>(doc, "user"); + + // fetch it last to provide more correct apply instant + TRoles::TMeta meta = GetMeta(doc); + + return std::make_shared<TRoles>( + std::move(meta), + std::move(tvm), + std::move(user), + std::move(decodedBlob)); + } + + TRoles::TMeta TParser::GetMeta(const NJson::TJsonValue& doc) { + TRoles::TMeta res; + + NJson::TJsonValue obj; + GetRequiredValue(doc, "revision", obj); + if (obj.IsString()) { + res.Revision = obj.GetString(); + } else if (obj.IsUInteger()) { + res.Revision = ToString(obj.GetUInteger()); + } else { + ythrow yexception() << "'revision' has unexpected type: " << obj.GetType(); + } + + res.BornTime = TInstant::Seconds(GetRequiredUInt(doc, "born_date")); + + return res; + } + + template <typename Id> + THashMap<Id, TConsumerRolesPtr> TParser::GetConsumers(const NJson::TJsonValue& doc, + TStringBuf type) { + THashMap<Id, TConsumerRolesPtr> res; + + NJson::TJsonValue obj; + if (!GetOptionalMap(doc, type, obj)) { + return res; + } + + for (const auto& [key, value] : obj.GetMap()) { + Y_ENSURE(value.IsMap(), + "roles for consumer must be map: '" << key << "' is " << value.GetType()); + + Id id = 0; + Y_ENSURE(TryIntFromString<10>(key, id), + "id must be valid positive number of proper size for " + << type << ". got '" + << key << "'"); + + Y_ENSURE(res.emplace(id, GetConsumer(value, key)).second, + "consumer duplicate detected: '" << key << "' for " << type); + } + + return res; + } + + TConsumerRolesPtr TParser::GetConsumer(const NJson::TJsonValue& obj, TStringBuf consumer) { + THashMap<TString, TEntitiesPtr> entities; + + for (const auto& [key, value] : obj.GetMap()) { + Y_ENSURE(value.IsArray(), + "entities for roles must be array: '" << key << "' is " << value.GetType()); + + entities.emplace(key, GetEntities(value, consumer, key)); + } + + return std::make_shared<TConsumerRoles>(std::move(entities)); + } + + TEntitiesPtr TParser::GetEntities(const NJson::TJsonValue& obj, + TStringBuf consumer, + TStringBuf role) { + std::vector<TEntityPtr> entities; + entities.reserve(obj.GetArray().size()); + + for (const NJson::TJsonValue& e : obj.GetArray()) { + Y_ENSURE(e.IsMap(), + "role entity for role must be map: consumer '" + << consumer << "' with role '" << role << "' has " << e.GetType()); + + entities.push_back(GetEntity(e, consumer, role)); + } + + return std::make_shared<TEntities>(TEntities(entities)); + } + + TEntityPtr TParser::GetEntity(const NJson::TJsonValue& obj, TStringBuf consumer, TStringBuf role) { + TEntityPtr res = std::make_shared<TEntity>(); + + for (const auto& [key, value] : obj.GetMap()) { + Y_ENSURE(value.IsString(), + "entity is map (str->str), got value " + << value.GetType() << ". consumer '" + << consumer << "' with role '" << role << "'"); + + res->emplace(key, value.GetString()); + } + + return res; + } +} diff --git a/library/cpp/tvmauth/client/misc/roles/parser.h b/library/cpp/tvmauth/client/misc/roles/parser.h index 0982ba78c6..7cf1d01f47 100644 --- a/library/cpp/tvmauth/client/misc/roles/parser.h +++ b/library/cpp/tvmauth/client/misc/roles/parser.h @@ -1,36 +1,36 @@ -#pragma once - -#include "roles.h" -#include "types.h" - -namespace NJson { - class TJsonValue; -} - -namespace NTvmAuth::NRoles { - class TParser { - public: - static TRolesPtr Parse(TRawPtr decodedBlob); - - public: - static TRolesPtr ParseImpl(TRawPtr decodedBlob); - static TRoles::TMeta GetMeta(const NJson::TJsonValue& doc); - - template <typename Id> - static THashMap<Id, TConsumerRolesPtr> GetConsumers( - const NJson::TJsonValue& doc, - TStringBuf key); - - static TConsumerRolesPtr GetConsumer( - const NJson::TJsonValue& obj, - TStringBuf consumer); - static TEntitiesPtr GetEntities( - const NJson::TJsonValue& obj, - TStringBuf consumer, - TStringBuf role); - static TEntityPtr GetEntity( - const NJson::TJsonValue& obj, - TStringBuf consumer, - TStringBuf role); - }; -} +#pragma once + +#include "roles.h" +#include "types.h" + +namespace NJson { + class TJsonValue; +} + +namespace NTvmAuth::NRoles { + class TParser { + public: + static TRolesPtr Parse(TRawPtr decodedBlob); + + public: + static TRolesPtr ParseImpl(TRawPtr decodedBlob); + static TRoles::TMeta GetMeta(const NJson::TJsonValue& doc); + + template <typename Id> + static THashMap<Id, TConsumerRolesPtr> GetConsumers( + const NJson::TJsonValue& doc, + TStringBuf key); + + static TConsumerRolesPtr GetConsumer( + const NJson::TJsonValue& obj, + TStringBuf consumer); + static TEntitiesPtr GetEntities( + const NJson::TJsonValue& obj, + TStringBuf consumer, + TStringBuf role); + static TEntityPtr GetEntity( + const NJson::TJsonValue& obj, + TStringBuf consumer, + TStringBuf role); + }; +} diff --git a/library/cpp/tvmauth/client/misc/roles/roles.cpp b/library/cpp/tvmauth/client/misc/roles/roles.cpp index f412558b99..a2663df392 100644 --- a/library/cpp/tvmauth/client/misc/roles/roles.cpp +++ b/library/cpp/tvmauth/client/misc/roles/roles.cpp @@ -1,101 +1,101 @@ -#include "roles.h" - -#include <library/cpp/tvmauth/checked_service_ticket.h> -#include <library/cpp/tvmauth/checked_user_ticket.h> - -namespace NTvmAuth::NRoles { - TRoles::TRoles(TMeta&& meta, - TTvmConsumers tvm, - TUserConsumers user, - TRawPtr raw) - : Meta_(std::move(meta)) - , TvmIds_(std::move(tvm)) - , Users_(std::move(user)) - , Raw_(std::move(raw)) - { - Y_ENSURE(Raw_); - } - - TConsumerRolesPtr TRoles::GetRolesForService(const TCheckedServiceTicket& t) const { - Y_ENSURE_EX(t, - TIllegalUsage() << "Service ticket must be valid, got: " << t.GetStatus()); - auto it = TvmIds_.find(t.GetSrc()); - return it == TvmIds_.end() ? TConsumerRolesPtr() : it->second; - } - - TConsumerRolesPtr TRoles::GetRolesForUser(const TCheckedUserTicket& t, - std::optional<TUid> selectedUid) const { - Y_ENSURE_EX(t, - TIllegalUsage() << "User ticket must be valid, got: " << t.GetStatus()); - Y_ENSURE_EX(t.GetEnv() == EBlackboxEnv::ProdYateam, - TIllegalUsage() << "User ticket must be from ProdYateam, got from " << t.GetEnv()); - - TUid uid = t.GetDefaultUid(); - if (selectedUid) { - auto it = std::find(t.GetUids().begin(), t.GetUids().end(), *selectedUid); - Y_ENSURE_EX(it != t.GetUids().end(), - TIllegalUsage() << "selectedUid must be in user ticket but it's not: " - << *selectedUid); - uid = *selectedUid; - } - - auto it = Users_.find(uid); - return it == Users_.end() ? TConsumerRolesPtr() : it->second; - } - - const TRoles::TMeta& TRoles::GetMeta() const { - return Meta_; - } - - const TString& TRoles::GetRaw() const { - return *Raw_; - } - - bool TRoles::CheckServiceRole(const TCheckedServiceTicket& t, - const TStringBuf roleName) const { - TConsumerRolesPtr c = GetRolesForService(t); - return c ? c->HasRole(roleName) : false; - } - - bool TRoles::CheckUserRole(const TCheckedUserTicket& t, - const TStringBuf roleName, - std::optional<TUid> selectedUid) const { - TConsumerRolesPtr c = GetRolesForUser(t, selectedUid); - return c ? c->HasRole(roleName) : false; - } - - bool TRoles::CheckServiceRoleForExactEntity(const TCheckedServiceTicket& t, - const TStringBuf roleName, - const TEntity& exactEntity) const { - TConsumerRolesPtr c = GetRolesForService(t); - return c ? c->CheckRoleForExactEntity(roleName, exactEntity) : false; - } - - bool TRoles::CheckUserRoleForExactEntity(const TCheckedUserTicket& t, - const TStringBuf roleName, - const TEntity& exactEntity, - std::optional<TUid> selectedUid) const { - TConsumerRolesPtr c = GetRolesForUser(t, selectedUid); - return c ? c->CheckRoleForExactEntity(roleName, exactEntity) : false; - } - - TConsumerRoles::TConsumerRoles(THashMap<TString, TEntitiesPtr> roles) - : Roles_(std::move(roles)) - { - } - - bool TConsumerRoles::CheckRoleForExactEntity(const TStringBuf roleName, - const TEntity& exactEntity) const { - auto it = Roles_.find(roleName); - if (it == Roles_.end()) { - return false; - } - - return it->second->Contains(exactEntity); - } - - TEntities::TEntities(TEntitiesIndex idx) - : Idx_(std::move(idx)) - { - } -} +#include "roles.h" + +#include <library/cpp/tvmauth/checked_service_ticket.h> +#include <library/cpp/tvmauth/checked_user_ticket.h> + +namespace NTvmAuth::NRoles { + TRoles::TRoles(TMeta&& meta, + TTvmConsumers tvm, + TUserConsumers user, + TRawPtr raw) + : Meta_(std::move(meta)) + , TvmIds_(std::move(tvm)) + , Users_(std::move(user)) + , Raw_(std::move(raw)) + { + Y_ENSURE(Raw_); + } + + TConsumerRolesPtr TRoles::GetRolesForService(const TCheckedServiceTicket& t) const { + Y_ENSURE_EX(t, + TIllegalUsage() << "Service ticket must be valid, got: " << t.GetStatus()); + auto it = TvmIds_.find(t.GetSrc()); + return it == TvmIds_.end() ? TConsumerRolesPtr() : it->second; + } + + TConsumerRolesPtr TRoles::GetRolesForUser(const TCheckedUserTicket& t, + std::optional<TUid> selectedUid) const { + Y_ENSURE_EX(t, + TIllegalUsage() << "User ticket must be valid, got: " << t.GetStatus()); + Y_ENSURE_EX(t.GetEnv() == EBlackboxEnv::ProdYateam, + TIllegalUsage() << "User ticket must be from ProdYateam, got from " << t.GetEnv()); + + TUid uid = t.GetDefaultUid(); + if (selectedUid) { + auto it = std::find(t.GetUids().begin(), t.GetUids().end(), *selectedUid); + Y_ENSURE_EX(it != t.GetUids().end(), + TIllegalUsage() << "selectedUid must be in user ticket but it's not: " + << *selectedUid); + uid = *selectedUid; + } + + auto it = Users_.find(uid); + return it == Users_.end() ? TConsumerRolesPtr() : it->second; + } + + const TRoles::TMeta& TRoles::GetMeta() const { + return Meta_; + } + + const TString& TRoles::GetRaw() const { + return *Raw_; + } + + bool TRoles::CheckServiceRole(const TCheckedServiceTicket& t, + const TStringBuf roleName) const { + TConsumerRolesPtr c = GetRolesForService(t); + return c ? c->HasRole(roleName) : false; + } + + bool TRoles::CheckUserRole(const TCheckedUserTicket& t, + const TStringBuf roleName, + std::optional<TUid> selectedUid) const { + TConsumerRolesPtr c = GetRolesForUser(t, selectedUid); + return c ? c->HasRole(roleName) : false; + } + + bool TRoles::CheckServiceRoleForExactEntity(const TCheckedServiceTicket& t, + const TStringBuf roleName, + const TEntity& exactEntity) const { + TConsumerRolesPtr c = GetRolesForService(t); + return c ? c->CheckRoleForExactEntity(roleName, exactEntity) : false; + } + + bool TRoles::CheckUserRoleForExactEntity(const TCheckedUserTicket& t, + const TStringBuf roleName, + const TEntity& exactEntity, + std::optional<TUid> selectedUid) const { + TConsumerRolesPtr c = GetRolesForUser(t, selectedUid); + return c ? c->CheckRoleForExactEntity(roleName, exactEntity) : false; + } + + TConsumerRoles::TConsumerRoles(THashMap<TString, TEntitiesPtr> roles) + : Roles_(std::move(roles)) + { + } + + bool TConsumerRoles::CheckRoleForExactEntity(const TStringBuf roleName, + const TEntity& exactEntity) const { + auto it = Roles_.find(roleName); + if (it == Roles_.end()) { + return false; + } + + return it->second->Contains(exactEntity); + } + + TEntities::TEntities(TEntitiesIndex idx) + : Idx_(std::move(idx)) + { + } +} diff --git a/library/cpp/tvmauth/client/misc/roles/roles.h b/library/cpp/tvmauth/client/misc/roles/roles.h index 00ffb7e070..344702b539 100644 --- a/library/cpp/tvmauth/client/misc/roles/roles.h +++ b/library/cpp/tvmauth/client/misc/roles/roles.h @@ -1,182 +1,182 @@ -#pragma once - -#include "entities_index.h" -#include "types.h" - -#include <library/cpp/tvmauth/client/exception.h> - -#include <library/cpp/tvmauth/type.h> - -#include <util/datetime/base.h> -#include <util/generic/array_ref.h> -#include <util/generic/hash.h> - -#include <vector> - -namespace NTvmAuth { - class TCheckedServiceTicket; - class TCheckedUserTicket; -} - -namespace NTvmAuth::NRoles { - class TRoles { - public: - struct TMeta { - TString Revision; - TInstant BornTime; - TInstant Applied = TInstant::Now(); - }; - - using TTvmConsumers = THashMap<TTvmId, TConsumerRolesPtr>; - using TUserConsumers = THashMap<TUid, TConsumerRolesPtr>; - - TRoles(TMeta&& meta, - TTvmConsumers tvm, - TUserConsumers user, - TRawPtr raw); - - /** - * @return ptr to roles. It will be nullptr if there are no roles - */ - TConsumerRolesPtr GetRolesForService(const TCheckedServiceTicket& t) const; - - /** - * @return ptr to roles. It will be nullptr if there are no roles - */ - TConsumerRolesPtr GetRolesForUser(const TCheckedUserTicket& t, - std::optional<TUid> selectedUid = {}) const; - - const TMeta& GetMeta() const; - const TString& GetRaw() const; - - public: // shortcuts - /** - * @brief CheckServiceRole() is shortcut for simple role checking - for any possible entity - */ - bool CheckServiceRole( - const TCheckedServiceTicket& t, - const TStringBuf roleName) const; - - /** - * @brief CheckUserRole() is shortcut for simple role checking - for any possible entity - */ - bool CheckUserRole( - const TCheckedUserTicket& t, - const TStringBuf roleName, - std::optional<TUid> selectedUid = {}) const; - - /** - * @brief CheckServiceRoleForExactEntity() is shortcut for simple role checking for exact entity - */ - bool CheckServiceRoleForExactEntity( - const TCheckedServiceTicket& t, - const TStringBuf roleName, - const TEntity& exactEntity) const; - - /** - * @brief CheckUserRoleForExactEntity() is shortcut for simple role checking for exact entity - */ - bool CheckUserRoleForExactEntity( - const TCheckedUserTicket& t, - const TStringBuf roleName, - const TEntity& exactEntity, - std::optional<TUid> selectedUid = {}) const; - - private: - TMeta Meta_; - TTvmConsumers TvmIds_; - TUserConsumers Users_; - TRawPtr Raw_; - }; - - class TConsumerRoles { - public: - TConsumerRoles(THashMap<TString, TEntitiesPtr> roles); - - bool HasRole(const TStringBuf roleName) const { - return Roles_.contains(roleName); - } - - /** - * @return ptr to entries. It will be nullptr if there is no role - */ - TEntitiesPtr GetEntitiesForRole(const TStringBuf roleName) const { - auto it = Roles_.find(roleName); - return it == Roles_.end() ? TEntitiesPtr() : it->second; - } - - /** - * @brief CheckRoleForExactEntity() is shortcut for simple role checking for exact entity - */ - bool CheckRoleForExactEntity(const TStringBuf roleName, - const TEntity& exactEntity) const; - - private: - THashMap<TString, TEntitiesPtr> Roles_; - }; - - class TEntities { - public: - TEntities(TEntitiesIndex idx); - - /** - * @brief Contains() provides info about entity presence - */ - bool Contains(const TEntity& exactEntity) const { - return Idx_.ContainsExactEntity(exactEntity.begin(), exactEntity.end()); - } - - /** - * @brief The same as Contains() - * It checks span for sorted and unique properties. - */ - template <class StrKey = TString, class StrValue = TString> - bool ContainsSortedUnique( - const TArrayRef<const std::pair<StrKey, StrValue>>& exactEntity) const { - CheckSpan(exactEntity); - return Idx_.ContainsExactEntity(exactEntity.begin(), exactEntity.end()); - } - - /** - * @brief GetEntitiesWithAttrs() collects entities with ALL attributes from `attrs` - */ - template <class StrKey = TString, class StrValue = TString> - const std::vector<TEntityPtr>& GetEntitiesWithAttrs( - const std::map<StrKey, StrValue>& attrs) const { - return Idx_.GetEntitiesWithAttrs(attrs.begin(), attrs.end()); - } - - /** - * @brief The same as GetEntitiesWithAttrs() - * It checks span for sorted and unique properties. - */ - template <class StrKey = TString, class StrValue = TString> - const std::vector<TEntityPtr>& GetEntitiesWithSortedUniqueAttrs( - const TArrayRef<const std::pair<StrKey, StrValue>>& attrs) const { - CheckSpan(attrs); - return Idx_.GetEntitiesWithAttrs(attrs.begin(), attrs.end()); - } - - private: - template <class StrKey, class StrValue> - static void CheckSpan(const TArrayRef<const std::pair<StrKey, StrValue>>& attrs) { - if (attrs.empty()) { - return; - } - - auto prev = attrs.begin(); - for (auto it = prev + 1; it != attrs.end(); ++it) { - Y_ENSURE_EX(prev->first != it->first, - TIllegalUsage() << "attrs are not unique: '" << it->first << "'"); - Y_ENSURE_EX(prev->first < it->first, - TIllegalUsage() << "attrs are not sorted: '" << prev->first - << "' before '" << it->first << "'"); - - prev = it; - } - } - - private: - TEntitiesIndex Idx_; - }; -} +#pragma once + +#include "entities_index.h" +#include "types.h" + +#include <library/cpp/tvmauth/client/exception.h> + +#include <library/cpp/tvmauth/type.h> + +#include <util/datetime/base.h> +#include <util/generic/array_ref.h> +#include <util/generic/hash.h> + +#include <vector> + +namespace NTvmAuth { + class TCheckedServiceTicket; + class TCheckedUserTicket; +} + +namespace NTvmAuth::NRoles { + class TRoles { + public: + struct TMeta { + TString Revision; + TInstant BornTime; + TInstant Applied = TInstant::Now(); + }; + + using TTvmConsumers = THashMap<TTvmId, TConsumerRolesPtr>; + using TUserConsumers = THashMap<TUid, TConsumerRolesPtr>; + + TRoles(TMeta&& meta, + TTvmConsumers tvm, + TUserConsumers user, + TRawPtr raw); + + /** + * @return ptr to roles. It will be nullptr if there are no roles + */ + TConsumerRolesPtr GetRolesForService(const TCheckedServiceTicket& t) const; + + /** + * @return ptr to roles. It will be nullptr if there are no roles + */ + TConsumerRolesPtr GetRolesForUser(const TCheckedUserTicket& t, + std::optional<TUid> selectedUid = {}) const; + + const TMeta& GetMeta() const; + const TString& GetRaw() const; + + public: // shortcuts + /** + * @brief CheckServiceRole() is shortcut for simple role checking - for any possible entity + */ + bool CheckServiceRole( + const TCheckedServiceTicket& t, + const TStringBuf roleName) const; + + /** + * @brief CheckUserRole() is shortcut for simple role checking - for any possible entity + */ + bool CheckUserRole( + const TCheckedUserTicket& t, + const TStringBuf roleName, + std::optional<TUid> selectedUid = {}) const; + + /** + * @brief CheckServiceRoleForExactEntity() is shortcut for simple role checking for exact entity + */ + bool CheckServiceRoleForExactEntity( + const TCheckedServiceTicket& t, + const TStringBuf roleName, + const TEntity& exactEntity) const; + + /** + * @brief CheckUserRoleForExactEntity() is shortcut for simple role checking for exact entity + */ + bool CheckUserRoleForExactEntity( + const TCheckedUserTicket& t, + const TStringBuf roleName, + const TEntity& exactEntity, + std::optional<TUid> selectedUid = {}) const; + + private: + TMeta Meta_; + TTvmConsumers TvmIds_; + TUserConsumers Users_; + TRawPtr Raw_; + }; + + class TConsumerRoles { + public: + TConsumerRoles(THashMap<TString, TEntitiesPtr> roles); + + bool HasRole(const TStringBuf roleName) const { + return Roles_.contains(roleName); + } + + /** + * @return ptr to entries. It will be nullptr if there is no role + */ + TEntitiesPtr GetEntitiesForRole(const TStringBuf roleName) const { + auto it = Roles_.find(roleName); + return it == Roles_.end() ? TEntitiesPtr() : it->second; + } + + /** + * @brief CheckRoleForExactEntity() is shortcut for simple role checking for exact entity + */ + bool CheckRoleForExactEntity(const TStringBuf roleName, + const TEntity& exactEntity) const; + + private: + THashMap<TString, TEntitiesPtr> Roles_; + }; + + class TEntities { + public: + TEntities(TEntitiesIndex idx); + + /** + * @brief Contains() provides info about entity presence + */ + bool Contains(const TEntity& exactEntity) const { + return Idx_.ContainsExactEntity(exactEntity.begin(), exactEntity.end()); + } + + /** + * @brief The same as Contains() + * It checks span for sorted and unique properties. + */ + template <class StrKey = TString, class StrValue = TString> + bool ContainsSortedUnique( + const TArrayRef<const std::pair<StrKey, StrValue>>& exactEntity) const { + CheckSpan(exactEntity); + return Idx_.ContainsExactEntity(exactEntity.begin(), exactEntity.end()); + } + + /** + * @brief GetEntitiesWithAttrs() collects entities with ALL attributes from `attrs` + */ + template <class StrKey = TString, class StrValue = TString> + const std::vector<TEntityPtr>& GetEntitiesWithAttrs( + const std::map<StrKey, StrValue>& attrs) const { + return Idx_.GetEntitiesWithAttrs(attrs.begin(), attrs.end()); + } + + /** + * @brief The same as GetEntitiesWithAttrs() + * It checks span for sorted and unique properties. + */ + template <class StrKey = TString, class StrValue = TString> + const std::vector<TEntityPtr>& GetEntitiesWithSortedUniqueAttrs( + const TArrayRef<const std::pair<StrKey, StrValue>>& attrs) const { + CheckSpan(attrs); + return Idx_.GetEntitiesWithAttrs(attrs.begin(), attrs.end()); + } + + private: + template <class StrKey, class StrValue> + static void CheckSpan(const TArrayRef<const std::pair<StrKey, StrValue>>& attrs) { + if (attrs.empty()) { + return; + } + + auto prev = attrs.begin(); + for (auto it = prev + 1; it != attrs.end(); ++it) { + Y_ENSURE_EX(prev->first != it->first, + TIllegalUsage() << "attrs are not unique: '" << it->first << "'"); + Y_ENSURE_EX(prev->first < it->first, + TIllegalUsage() << "attrs are not sorted: '" << prev->first + << "' before '" << it->first << "'"); + + prev = it; + } + } + + private: + TEntitiesIndex Idx_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/roles/types.h b/library/cpp/tvmauth/client/misc/roles/types.h index e7614bf637..79a01950b6 100644 --- a/library/cpp/tvmauth/client/misc/roles/types.h +++ b/library/cpp/tvmauth/client/misc/roles/types.h @@ -1,68 +1,68 @@ -#pragma once - -#include <util/generic/hash_set.h> - -#include <map> -#include <memory> - -namespace NTvmAuth::NRoles { - using TEntity = std::map<TString, TString>; - using TEntityPtr = std::shared_ptr<TEntity>; - - class TEntities; - using TEntitiesPtr = std::shared_ptr<TEntities>; - - class TConsumerRoles; - using TConsumerRolesPtr = std::shared_ptr<TConsumerRoles>; - - class TRoles; - using TRolesPtr = std::shared_ptr<TRoles>; - - using TRawPtr = std::shared_ptr<TString>; - - template <class T> - struct TKeyValueBase { - T Key; - T Value; - - template <typename U> - bool operator==(const TKeyValueBase<U>& o) const { - return Key == o.Key && Value == o.Value; - } - }; - - using TKeyValue = TKeyValueBase<TString>; - using TKeyValueView = TKeyValueBase<TStringBuf>; -} - -// Traits - -template <> -struct THash<NTvmAuth::NRoles::TKeyValue> { - std::size_t operator()(const NTvmAuth::NRoles::TKeyValue& e) const { - return std::hash<std::string_view>()(e.Key) + std::hash<std::string_view>()(e.Value); - } - - std::size_t operator()(const NTvmAuth::NRoles::TKeyValueView& e) const { - return std::hash<std::string_view>()(e.Key) + std::hash<std::string_view>()(e.Value); - } -}; - -template <> -struct TEqualTo<NTvmAuth::NRoles::TKeyValue> { - using is_transparent = std::true_type; - - template <typename T, typename U> - bool operator()(const NTvmAuth::NRoles::TKeyValueBase<T>& l, - const NTvmAuth::NRoles::TKeyValueBase<U>& r) { - return l == r; - } -}; - -inline bool operator<(const NTvmAuth::NRoles::TEntityPtr& l, const NTvmAuth::NRoles::TEntityPtr& r) { - return *l < *r; -} - -inline bool operator==(const NTvmAuth::NRoles::TEntityPtr& l, const NTvmAuth::NRoles::TEntityPtr& r) { - return *l == *r; -} +#pragma once + +#include <util/generic/hash_set.h> + +#include <map> +#include <memory> + +namespace NTvmAuth::NRoles { + using TEntity = std::map<TString, TString>; + using TEntityPtr = std::shared_ptr<TEntity>; + + class TEntities; + using TEntitiesPtr = std::shared_ptr<TEntities>; + + class TConsumerRoles; + using TConsumerRolesPtr = std::shared_ptr<TConsumerRoles>; + + class TRoles; + using TRolesPtr = std::shared_ptr<TRoles>; + + using TRawPtr = std::shared_ptr<TString>; + + template <class T> + struct TKeyValueBase { + T Key; + T Value; + + template <typename U> + bool operator==(const TKeyValueBase<U>& o) const { + return Key == o.Key && Value == o.Value; + } + }; + + using TKeyValue = TKeyValueBase<TString>; + using TKeyValueView = TKeyValueBase<TStringBuf>; +} + +// Traits + +template <> +struct THash<NTvmAuth::NRoles::TKeyValue> { + std::size_t operator()(const NTvmAuth::NRoles::TKeyValue& e) const { + return std::hash<std::string_view>()(e.Key) + std::hash<std::string_view>()(e.Value); + } + + std::size_t operator()(const NTvmAuth::NRoles::TKeyValueView& e) const { + return std::hash<std::string_view>()(e.Key) + std::hash<std::string_view>()(e.Value); + } +}; + +template <> +struct TEqualTo<NTvmAuth::NRoles::TKeyValue> { + using is_transparent = std::true_type; + + template <typename T, typename U> + bool operator()(const NTvmAuth::NRoles::TKeyValueBase<T>& l, + const NTvmAuth::NRoles::TKeyValueBase<U>& r) { + return l == r; + } +}; + +inline bool operator<(const NTvmAuth::NRoles::TEntityPtr& l, const NTvmAuth::NRoles::TEntityPtr& r) { + return *l < *r; +} + +inline bool operator==(const NTvmAuth::NRoles::TEntityPtr& l, const NTvmAuth::NRoles::TEntityPtr& r) { + return *l == *r; +} diff --git a/library/cpp/tvmauth/client/misc/settings.h b/library/cpp/tvmauth/client/misc/settings.h index 8fae6c34d3..6d63ab5bf7 100644 --- a/library/cpp/tvmauth/client/misc/settings.h +++ b/library/cpp/tvmauth/client/misc/settings.h @@ -1,13 +1,13 @@ -#pragma once - -#include <util/generic/fwd.h> - -namespace NTvmAuth { - class TClientSettings { - public: - /*! - * Look at description in relevant settings: NTvmApi::TClientSettings or NTvmTool::TClientSettings - */ - using TAlias = TString; - }; -} +#pragma once + +#include <util/generic/fwd.h> + +namespace NTvmAuth { + class TClientSettings { + public: + /*! + * Look at description in relevant settings: NTvmApi::TClientSettings or NTvmTool::TClientSettings + */ + using TAlias = TString; + }; +} diff --git a/library/cpp/tvmauth/client/misc/src_checker.h b/library/cpp/tvmauth/client/misc/src_checker.h index 25e8e72602..2b9f7e98f9 100644 --- a/library/cpp/tvmauth/client/misc/src_checker.h +++ b/library/cpp/tvmauth/client/misc/src_checker.h @@ -1,46 +1,46 @@ -#pragma once - -#include "async_updater.h" - -#include <library/cpp/tvmauth/client/exception.h> - -#include <library/cpp/tvmauth/checked_service_ticket.h> -#include <library/cpp/tvmauth/src/service_impl.h> - -namespace NTvmAuth { - class TSrcChecker { - public: - TSrcChecker(TAsyncUpdaterPtr updater) - : Updater_(std::move(updater)) - { - Y_ENSURE(Updater_); - GetCache(); - } - - /*! - * Checking must be enabled in TClientSettings - * Can throw exception if cache is out of date or wrong config - * @param ticket - */ - TCheckedServiceTicket Check(TCheckedServiceTicket ticket) const { - NRoles::TConsumerRolesPtr roles = GetCache()->GetRolesForService(ticket); - if (roles) { - return ticket; - } - +#pragma once + +#include "async_updater.h" + +#include <library/cpp/tvmauth/client/exception.h> + +#include <library/cpp/tvmauth/checked_service_ticket.h> +#include <library/cpp/tvmauth/src/service_impl.h> + +namespace NTvmAuth { + class TSrcChecker { + public: + TSrcChecker(TAsyncUpdaterPtr updater) + : Updater_(std::move(updater)) + { + Y_ENSURE(Updater_); + GetCache(); + } + + /*! + * Checking must be enabled in TClientSettings + * Can throw exception if cache is out of date or wrong config + * @param ticket + */ + TCheckedServiceTicket Check(TCheckedServiceTicket ticket) const { + NRoles::TConsumerRolesPtr roles = GetCache()->GetRolesForService(ticket); + if (roles) { + return ticket; + } + TServiceTicketImplPtr impl = THolder(NInternal::TCanningKnife::GetS(ticket)); - impl->SetStatus(ETicketStatus::NoRoles); - return TCheckedServiceTicket(std::move(impl)); - } - - private: - NRoles::TRolesPtr GetCache() const { - NRoles::TRolesPtr c = Updater_->GetRoles(); - Y_ENSURE_EX(c, TBrokenTvmClientSettings() << "Need to use TClientSettings::EnableRolesFetching()"); - return c; - } - - private: - TAsyncUpdaterPtr Updater_; - }; -} + impl->SetStatus(ETicketStatus::NoRoles); + return TCheckedServiceTicket(std::move(impl)); + } + + private: + NRoles::TRolesPtr GetCache() const { + NRoles::TRolesPtr c = Updater_->GetRoles(); + Y_ENSURE_EX(c, TBrokenTvmClientSettings() << "Need to use TClientSettings::EnableRolesFetching()"); + return c; + } + + private: + TAsyncUpdaterPtr Updater_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/threaded_updater.cpp b/library/cpp/tvmauth/client/misc/threaded_updater.cpp index 5d21ce67a7..0e6f9dbd66 100644 --- a/library/cpp/tvmauth/client/misc/threaded_updater.cpp +++ b/library/cpp/tvmauth/client/misc/threaded_updater.cpp @@ -1,111 +1,111 @@ -#include "threaded_updater.h" - -#include <library/cpp/tvmauth/client/exception.h> - -#include <util/string/builder.h> -#include <util/system/spin_wait.h> +#include "threaded_updater.h" + +#include <library/cpp/tvmauth/client/exception.h> + +#include <util/string/builder.h> +#include <util/system/spin_wait.h> #include <util/system/thread.h> - -namespace NTvmAuth { - TThreadedUpdaterBase::TThreadedUpdaterBase(TDuration workerAwakingPeriod, - TLoggerPtr logger, - const TString& url, + +namespace NTvmAuth { + TThreadedUpdaterBase::TThreadedUpdaterBase(TDuration workerAwakingPeriod, + TLoggerPtr logger, + const TString& url, ui16 port, TDuration socketTimeout, TDuration connectTimeout) - : WorkerAwakingPeriod_(workerAwakingPeriod) - , Logger_(std::move(logger)) - , TvmUrl_(url) - , TvmPort_(port) + : WorkerAwakingPeriod_(workerAwakingPeriod) + , Logger_(std::move(logger)) + , TvmUrl_(url) + , TvmPort_(port) , TvmSocketTimeout_(socketTimeout) , TvmConnectTimeout_(connectTimeout) - , IsStopped_(true) - { - Y_ENSURE_EX(Logger_, TNonRetriableException() << "Logger is required"); - - ServiceTicketsDurations_.RefreshPeriod = TDuration::Hours(1); - ServiceTicketsDurations_.Expiring = TDuration::Hours(2); - ServiceTicketsDurations_.Invalid = TDuration::Hours(11); - - PublicKeysDurations_.RefreshPeriod = TDuration::Days(1); - PublicKeysDurations_.Expiring = TDuration::Days(2); - PublicKeysDurations_.Invalid = TDuration::Days(6); - } - - TThreadedUpdaterBase::~TThreadedUpdaterBase() { - StopWorker(); - } - - void TThreadedUpdaterBase::StartWorker() { - if (HttpClient_) { - HttpClient_->ResetConnection(); - } - Thread_ = MakeHolder<TThread>(WorkerWrap, this); - Thread_->Start(); - Started_.Wait(); - IsStopped_ = false; - } - - void TThreadedUpdaterBase::StopWorker() { - Event_.Signal(); - if (Thread_) { - Thread_.Reset(); - } - } - - TKeepAliveHttpClient& TThreadedUpdaterBase::GetClient() const { - if (!HttpClient_) { + , IsStopped_(true) + { + Y_ENSURE_EX(Logger_, TNonRetriableException() << "Logger is required"); + + ServiceTicketsDurations_.RefreshPeriod = TDuration::Hours(1); + ServiceTicketsDurations_.Expiring = TDuration::Hours(2); + ServiceTicketsDurations_.Invalid = TDuration::Hours(11); + + PublicKeysDurations_.RefreshPeriod = TDuration::Days(1); + PublicKeysDurations_.Expiring = TDuration::Days(2); + PublicKeysDurations_.Invalid = TDuration::Days(6); + } + + TThreadedUpdaterBase::~TThreadedUpdaterBase() { + StopWorker(); + } + + void TThreadedUpdaterBase::StartWorker() { + if (HttpClient_) { + HttpClient_->ResetConnection(); + } + Thread_ = MakeHolder<TThread>(WorkerWrap, this); + Thread_->Start(); + Started_.Wait(); + IsStopped_ = false; + } + + void TThreadedUpdaterBase::StopWorker() { + Event_.Signal(); + if (Thread_) { + Thread_.Reset(); + } + } + + TKeepAliveHttpClient& TThreadedUpdaterBase::GetClient() const { + if (!HttpClient_) { HttpClient_ = MakeHolder<TKeepAliveHttpClient>(TvmUrl_, TvmPort_, TvmSocketTimeout_, TvmConnectTimeout_); - } - - return *HttpClient_; - } - - void TThreadedUpdaterBase::LogDebug(const TString& msg) const { - if (Logger_) { - Logger_->Debug(msg); - } - } - - void TThreadedUpdaterBase::LogInfo(const TString& msg) const { - if (Logger_) { - Logger_->Info(msg); - } - } - - void TThreadedUpdaterBase::LogWarning(const TString& msg) const { - if (Logger_) { - Logger_->Warning(msg); - } - } - - void TThreadedUpdaterBase::LogError(const TString& msg) const { - if (Logger_) { - Logger_->Error(msg); - } - } - - void* TThreadedUpdaterBase::WorkerWrap(void* arg) { + } + + return *HttpClient_; + } + + void TThreadedUpdaterBase::LogDebug(const TString& msg) const { + if (Logger_) { + Logger_->Debug(msg); + } + } + + void TThreadedUpdaterBase::LogInfo(const TString& msg) const { + if (Logger_) { + Logger_->Info(msg); + } + } + + void TThreadedUpdaterBase::LogWarning(const TString& msg) const { + if (Logger_) { + Logger_->Warning(msg); + } + } + + void TThreadedUpdaterBase::LogError(const TString& msg) const { + if (Logger_) { + Logger_->Error(msg); + } + } + + void* TThreadedUpdaterBase::WorkerWrap(void* arg) { TThread::SetCurrentThreadName("TicketParserUpd"); - TThreadedUpdaterBase& this_ = *reinterpret_cast<TThreadedUpdaterBase*>(arg); - this_.Started_.Signal(); - this_.LogDebug("Thread-worker started"); - - while (true) { - if (this_.Event_.WaitT(this_.WorkerAwakingPeriod_)) { - break; - } - - try { - this_.Worker(); - this_.GetClient().ResetConnection(); - } catch (const std::exception& e) { // impossible now - this_.LogError(TStringBuilder() << "Failed to generate new cache: " << e.what()); - } - } - - this_.LogDebug("Thread-worker stopped"); - this_.IsStopped_ = true; - return nullptr; - } -} + TThreadedUpdaterBase& this_ = *reinterpret_cast<TThreadedUpdaterBase*>(arg); + this_.Started_.Signal(); + this_.LogDebug("Thread-worker started"); + + while (true) { + if (this_.Event_.WaitT(this_.WorkerAwakingPeriod_)) { + break; + } + + try { + this_.Worker(); + this_.GetClient().ResetConnection(); + } catch (const std::exception& e) { // impossible now + this_.LogError(TStringBuilder() << "Failed to generate new cache: " << e.what()); + } + } + + this_.LogDebug("Thread-worker stopped"); + this_.IsStopped_ = true; + return nullptr; + } +} diff --git a/library/cpp/tvmauth/client/misc/threaded_updater.h b/library/cpp/tvmauth/client/misc/threaded_updater.h index 783684ba3b..d6b251b4ed 100644 --- a/library/cpp/tvmauth/client/misc/threaded_updater.h +++ b/library/cpp/tvmauth/client/misc/threaded_updater.h @@ -1,76 +1,76 @@ -#pragma once - -#include "async_updater.h" -#include "settings.h" - -#include <library/cpp/tvmauth/client/logger.h> - -#include <library/cpp/http/simple/http_client.h> - -#include <util/datetime/base.h> -#include <util/generic/ptr.h> -#include <util/system/event.h> -#include <util/system/thread.h> - -class TKeepAliveHttpClient; - -namespace NTvmAuth::NInternal { - class TClientCaningKnife; -} -namespace NTvmAuth { - class TThreadedUpdaterBase: public TAsyncUpdaterBase { - public: +#pragma once + +#include "async_updater.h" +#include "settings.h" + +#include <library/cpp/tvmauth/client/logger.h> + +#include <library/cpp/http/simple/http_client.h> + +#include <util/datetime/base.h> +#include <util/generic/ptr.h> +#include <util/system/event.h> +#include <util/system/thread.h> + +class TKeepAliveHttpClient; + +namespace NTvmAuth::NInternal { + class TClientCaningKnife; +} +namespace NTvmAuth { + class TThreadedUpdaterBase: public TAsyncUpdaterBase { + public: TThreadedUpdaterBase(TDuration workerAwakingPeriod, TLoggerPtr logger, const TString& url, ui16 port, TDuration socketTimeout, TDuration connectTimeout); - virtual ~TThreadedUpdaterBase(); - - protected: - void StartWorker(); - void StopWorker(); - - virtual void Worker() { - } - - TKeepAliveHttpClient& GetClient() const; - - void LogDebug(const TString& msg) const; - void LogInfo(const TString& msg) const; - void LogWarning(const TString& msg) const; - void LogError(const TString& msg) const; - - protected: - TDuration WorkerAwakingPeriod_; - - const TLoggerPtr Logger_; - - protected: - const TString TvmUrl_; - - private: - static void* WorkerWrap(void* arg); - - void StartTvmClientStopping() const override { - Event_.Signal(); - } - - bool IsTvmClientStopped() const override { - return IsStopped_; - } - - private: - mutable THolder<TKeepAliveHttpClient> HttpClient_; - - const ui32 TvmPort_; + virtual ~TThreadedUpdaterBase(); + + protected: + void StartWorker(); + void StopWorker(); + + virtual void Worker() { + } + + TKeepAliveHttpClient& GetClient() const; + + void LogDebug(const TString& msg) const; + void LogInfo(const TString& msg) const; + void LogWarning(const TString& msg) const; + void LogError(const TString& msg) const; + + protected: + TDuration WorkerAwakingPeriod_; + + const TLoggerPtr Logger_; + + protected: + const TString TvmUrl_; + + private: + static void* WorkerWrap(void* arg); + + void StartTvmClientStopping() const override { + Event_.Signal(); + } + + bool IsTvmClientStopped() const override { + return IsStopped_; + } + + private: + mutable THolder<TKeepAliveHttpClient> HttpClient_; + + const ui32 TvmPort_; const TDuration TvmSocketTimeout_; const TDuration TvmConnectTimeout_; - - mutable TAutoEvent Event_; - mutable TAutoEvent Started_; - std::atomic_bool IsStopped_; - THolder<TThread> Thread_; - }; -} + + mutable TAutoEvent Event_; + mutable TAutoEvent Started_; + std::atomic_bool IsStopped_; + THolder<TThread> Thread_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/tool/meta_info.cpp b/library/cpp/tvmauth/client/misc/tool/meta_info.cpp index 5d905b0cb8..c99151ec6e 100644 --- a/library/cpp/tvmauth/client/misc/tool/meta_info.cpp +++ b/library/cpp/tvmauth/client/misc/tool/meta_info.cpp @@ -1,200 +1,200 @@ -#include "meta_info.h" - -#include <library/cpp/json/json_reader.h> - -#include <util/string/builder.h> - -namespace NTvmAuth::NTvmTool { - TString TMetaInfo::TConfig::ToString() const { - TStringStream s; - s << "self_tvm_id=" << SelfTvmId << ", " - << "bb_env=" << BbEnv << ", " - << "dsts=["; - - for (const auto& pair : DstAliases) { - s << "(" << pair.first << ":" << pair.second << ")"; - } - - s << "]"; - - return std::move(s.Str()); - } - - TMetaInfo::TMetaInfo(TLoggerPtr logger) - : Logger_(std::move(logger)) - { - } - - TMetaInfo::TConfigPtr TMetaInfo::Init(TKeepAliveHttpClient& client, - const TClientSettings& settings) { - ApplySettings(settings); - - TryPing(client); - const TString metaString = Fetch(client); - if (Logger_) { - TStringStream s; - s << "Meta info fetched from " << settings.GetHostname() << ":" << settings.GetPort(); - Logger_->Debug(s.Str()); - } - - try { - Config_.Set(ParseMetaString(metaString, SelfAlias_)); - } catch (const yexception& e) { - ythrow TNonRetriableException() << "Malformed json from tvmtool: " << e.what(); - } - TConfigPtr cfg = Config_.Get(); - Y_ENSURE_EX(cfg, TNonRetriableException() << "Alias '" << SelfAlias_ << "' not found in meta info"); - - if (Logger_) { - Logger_->Info("Meta: " + cfg->ToString()); - } - - return cfg; - } - - TString TMetaInfo::GetRequestForTickets(const TConfig& config) { - Y_ENSURE(!config.DstAliases.empty()); - - TStringStream s; - s << "/tvm/tickets" - << "?src=" << config.SelfTvmId - << "&dsts="; - - for (const auto& pair : config.DstAliases) { - s << pair.second << ","; // avoid aliases - url-encoding required - } - s.Str().pop_back(); - - return s.Str(); - } - - bool TMetaInfo::TryUpdateConfig(TKeepAliveHttpClient& client) { - const TString metaString = Fetch(client); - - TConfigPtr config; - try { - config = ParseMetaString(metaString, SelfAlias_); - } catch (const yexception& e) { - ythrow TNonRetriableException() << "Malformed json from tvmtool: " << e.what(); - } - Y_ENSURE_EX(config, TNonRetriableException() << "Alias '" << SelfAlias_ << "' not found in meta info"); - - TConfigPtr oldConfig = Config_.Get(); - if (*config == *oldConfig) { - return false; - } - - if (Logger_) { - Logger_->Info(TStringBuilder() - << "Meta was updated. Old: (" << oldConfig->ToString() - << "). New: (" << config->ToString() << ")"); - } - - Config_ = config; - return true; - } - - void TMetaInfo::TryPing(TKeepAliveHttpClient& client) { - try { - TStringStream s; - TKeepAliveHttpClient::THttpCode code = client.DoGet("/tvm/ping", &s); - if (code < 200 || 300 <= code) { - throw yexception() << "(" << code << ") " << s.Str(); - } - } catch (const std::exception& e) { - ythrow TNonRetriableException() << "Failed to connect to tvmtool: " << e.what(); - } - } - - TString TMetaInfo::Fetch(TKeepAliveHttpClient& client) const { - TStringStream res; - TKeepAliveHttpClient::THttpCode code; - try { - code = client.DoGet("/tvm/private_api/__meta__", &res, AuthHeader_); - } catch (const std::exception& e) { - ythrow TRetriableException() << "Failed to fetch meta data from tvmtool: " << e.what(); - } - - if (code != 200) { - Y_ENSURE_EX(code != 404, - TNonRetriableException() << "Library does not support so old tvmtool. You need tvmtool>=1.1.0"); - - TStringStream err; - err << "Failed to fetch meta from tvmtool: " << client.GetHost() << ":" << client.GetPort() - << " (" << code << "): " << res.Str(); - Y_ENSURE_EX(!(500 <= code && code < 600), TRetriableException() << err.Str()); - ythrow TNonRetriableException() << err.Str(); - } - - return res.Str(); - } - - static TMetaInfo::TDstAliases::value_type ParsePair(const NJson::TJsonValue& val, const TString& meta) { - NJson::TJsonValue jAlias; - Y_ENSURE(val.GetValue("alias", &jAlias), meta); - Y_ENSURE(jAlias.IsString(), meta); - - NJson::TJsonValue jClientId; - Y_ENSURE(val.GetValue("client_id", &jClientId), meta); - Y_ENSURE(jClientId.IsInteger(), meta); - - return {jAlias.GetString(), jClientId.GetInteger()}; - } - - TMetaInfo::TConfigPtr TMetaInfo::ParseMetaString(const TString& meta, const TString& self) { - NJson::TJsonValue jDoc; - Y_ENSURE(NJson::ReadJsonTree(meta, &jDoc), meta); - - NJson::TJsonValue jEnv; - Y_ENSURE(jDoc.GetValue("bb_env", &jEnv), meta); - - NJson::TJsonValue jTenants; - Y_ENSURE(jDoc.GetValue("tenants", &jTenants), meta); - Y_ENSURE(jTenants.IsArray(), meta); - - for (const NJson::TJsonValue& jTen : jTenants.GetArray()) { - NJson::TJsonValue jSelf; - Y_ENSURE(jTen.GetValue("self", &jSelf), meta); - auto selfPair = ParsePair(jSelf, meta); - if (selfPair.first != self) { - continue; - } - - TConfigPtr config = std::make_shared<TConfig>(); - config->SelfTvmId = selfPair.second; - config->BbEnv = BbEnvFromString(jEnv.GetString(), meta); - - NJson::TJsonValue jDsts; - Y_ENSURE(jTen.GetValue("dsts", &jDsts), meta); - Y_ENSURE(jDsts.IsArray(), meta); - for (const NJson::TJsonValue& jDst : jDsts.GetArray()) { - config->DstAliases.insert(ParsePair(jDst, meta)); - } - - return config; - } - - return {}; - } - - void TMetaInfo::ApplySettings(const TClientSettings& settings) { - AuthHeader_ = {{"Authorization", settings.GetAuthToken()}}; - SelfAlias_ = settings.GetSelfAlias(); - } - - EBlackboxEnv TMetaInfo::BbEnvFromString(const TString& env, const TString& meta) { - if (env == "Prod") { - return EBlackboxEnv::Prod; - } else if (env == "Test") { - return EBlackboxEnv::Test; - } else if (env == "ProdYaTeam") { - return EBlackboxEnv::ProdYateam; - } else if (env == "TestYaTeam") { - return EBlackboxEnv::TestYateam; - } else if (env == "Stress") { - return EBlackboxEnv::Stress; - } - - ythrow yexception() << "'bb_env'=='" << env << "'. " << meta; - } -} +#include "meta_info.h" + +#include <library/cpp/json/json_reader.h> + +#include <util/string/builder.h> + +namespace NTvmAuth::NTvmTool { + TString TMetaInfo::TConfig::ToString() const { + TStringStream s; + s << "self_tvm_id=" << SelfTvmId << ", " + << "bb_env=" << BbEnv << ", " + << "dsts=["; + + for (const auto& pair : DstAliases) { + s << "(" << pair.first << ":" << pair.second << ")"; + } + + s << "]"; + + return std::move(s.Str()); + } + + TMetaInfo::TMetaInfo(TLoggerPtr logger) + : Logger_(std::move(logger)) + { + } + + TMetaInfo::TConfigPtr TMetaInfo::Init(TKeepAliveHttpClient& client, + const TClientSettings& settings) { + ApplySettings(settings); + + TryPing(client); + const TString metaString = Fetch(client); + if (Logger_) { + TStringStream s; + s << "Meta info fetched from " << settings.GetHostname() << ":" << settings.GetPort(); + Logger_->Debug(s.Str()); + } + + try { + Config_.Set(ParseMetaString(metaString, SelfAlias_)); + } catch (const yexception& e) { + ythrow TNonRetriableException() << "Malformed json from tvmtool: " << e.what(); + } + TConfigPtr cfg = Config_.Get(); + Y_ENSURE_EX(cfg, TNonRetriableException() << "Alias '" << SelfAlias_ << "' not found in meta info"); + + if (Logger_) { + Logger_->Info("Meta: " + cfg->ToString()); + } + + return cfg; + } + + TString TMetaInfo::GetRequestForTickets(const TConfig& config) { + Y_ENSURE(!config.DstAliases.empty()); + + TStringStream s; + s << "/tvm/tickets" + << "?src=" << config.SelfTvmId + << "&dsts="; + + for (const auto& pair : config.DstAliases) { + s << pair.second << ","; // avoid aliases - url-encoding required + } + s.Str().pop_back(); + + return s.Str(); + } + + bool TMetaInfo::TryUpdateConfig(TKeepAliveHttpClient& client) { + const TString metaString = Fetch(client); + + TConfigPtr config; + try { + config = ParseMetaString(metaString, SelfAlias_); + } catch (const yexception& e) { + ythrow TNonRetriableException() << "Malformed json from tvmtool: " << e.what(); + } + Y_ENSURE_EX(config, TNonRetriableException() << "Alias '" << SelfAlias_ << "' not found in meta info"); + + TConfigPtr oldConfig = Config_.Get(); + if (*config == *oldConfig) { + return false; + } + + if (Logger_) { + Logger_->Info(TStringBuilder() + << "Meta was updated. Old: (" << oldConfig->ToString() + << "). New: (" << config->ToString() << ")"); + } + + Config_ = config; + return true; + } + + void TMetaInfo::TryPing(TKeepAliveHttpClient& client) { + try { + TStringStream s; + TKeepAliveHttpClient::THttpCode code = client.DoGet("/tvm/ping", &s); + if (code < 200 || 300 <= code) { + throw yexception() << "(" << code << ") " << s.Str(); + } + } catch (const std::exception& e) { + ythrow TNonRetriableException() << "Failed to connect to tvmtool: " << e.what(); + } + } + + TString TMetaInfo::Fetch(TKeepAliveHttpClient& client) const { + TStringStream res; + TKeepAliveHttpClient::THttpCode code; + try { + code = client.DoGet("/tvm/private_api/__meta__", &res, AuthHeader_); + } catch (const std::exception& e) { + ythrow TRetriableException() << "Failed to fetch meta data from tvmtool: " << e.what(); + } + + if (code != 200) { + Y_ENSURE_EX(code != 404, + TNonRetriableException() << "Library does not support so old tvmtool. You need tvmtool>=1.1.0"); + + TStringStream err; + err << "Failed to fetch meta from tvmtool: " << client.GetHost() << ":" << client.GetPort() + << " (" << code << "): " << res.Str(); + Y_ENSURE_EX(!(500 <= code && code < 600), TRetriableException() << err.Str()); + ythrow TNonRetriableException() << err.Str(); + } + + return res.Str(); + } + + static TMetaInfo::TDstAliases::value_type ParsePair(const NJson::TJsonValue& val, const TString& meta) { + NJson::TJsonValue jAlias; + Y_ENSURE(val.GetValue("alias", &jAlias), meta); + Y_ENSURE(jAlias.IsString(), meta); + + NJson::TJsonValue jClientId; + Y_ENSURE(val.GetValue("client_id", &jClientId), meta); + Y_ENSURE(jClientId.IsInteger(), meta); + + return {jAlias.GetString(), jClientId.GetInteger()}; + } + + TMetaInfo::TConfigPtr TMetaInfo::ParseMetaString(const TString& meta, const TString& self) { + NJson::TJsonValue jDoc; + Y_ENSURE(NJson::ReadJsonTree(meta, &jDoc), meta); + + NJson::TJsonValue jEnv; + Y_ENSURE(jDoc.GetValue("bb_env", &jEnv), meta); + + NJson::TJsonValue jTenants; + Y_ENSURE(jDoc.GetValue("tenants", &jTenants), meta); + Y_ENSURE(jTenants.IsArray(), meta); + + for (const NJson::TJsonValue& jTen : jTenants.GetArray()) { + NJson::TJsonValue jSelf; + Y_ENSURE(jTen.GetValue("self", &jSelf), meta); + auto selfPair = ParsePair(jSelf, meta); + if (selfPair.first != self) { + continue; + } + + TConfigPtr config = std::make_shared<TConfig>(); + config->SelfTvmId = selfPair.second; + config->BbEnv = BbEnvFromString(jEnv.GetString(), meta); + + NJson::TJsonValue jDsts; + Y_ENSURE(jTen.GetValue("dsts", &jDsts), meta); + Y_ENSURE(jDsts.IsArray(), meta); + for (const NJson::TJsonValue& jDst : jDsts.GetArray()) { + config->DstAliases.insert(ParsePair(jDst, meta)); + } + + return config; + } + + return {}; + } + + void TMetaInfo::ApplySettings(const TClientSettings& settings) { + AuthHeader_ = {{"Authorization", settings.GetAuthToken()}}; + SelfAlias_ = settings.GetSelfAlias(); + } + + EBlackboxEnv TMetaInfo::BbEnvFromString(const TString& env, const TString& meta) { + if (env == "Prod") { + return EBlackboxEnv::Prod; + } else if (env == "Test") { + return EBlackboxEnv::Test; + } else if (env == "ProdYaTeam") { + return EBlackboxEnv::ProdYateam; + } else if (env == "TestYaTeam") { + return EBlackboxEnv::TestYateam; + } else if (env == "Stress") { + return EBlackboxEnv::Stress; + } + + ythrow yexception() << "'bb_env'=='" << env << "'. " << meta; + } +} diff --git a/library/cpp/tvmauth/client/misc/tool/meta_info.h b/library/cpp/tvmauth/client/misc/tool/meta_info.h index c4b9688e39..659c8f677f 100644 --- a/library/cpp/tvmauth/client/misc/tool/meta_info.h +++ b/library/cpp/tvmauth/client/misc/tool/meta_info.h @@ -1,67 +1,67 @@ -#pragma once - -#include "settings.h" - -#include <library/cpp/tvmauth/client/misc/utils.h> - -#include <library/cpp/tvmauth/client/logger.h> - -#include <library/cpp/http/simple/http_client.h> - -namespace NTvmAuth::NTvmTool { - class TMetaInfo { - public: - using TDstAliases = THashMap<TClientSettings::TAlias, TTvmId>; - - struct TConfig { - TTvmId SelfTvmId = 0; - EBlackboxEnv BbEnv = EBlackboxEnv::Prod; - TDstAliases DstAliases; - - bool AreTicketsRequired() const { - return !DstAliases.empty(); - } - - TString ToString() const; - - bool operator==(const TConfig& c) const { - return SelfTvmId == c.SelfTvmId && - BbEnv == c.BbEnv && - DstAliases == c.DstAliases; - } - }; - using TConfigPtr = std::shared_ptr<TConfig>; - - public: - TMetaInfo(TLoggerPtr logger); - - TConfigPtr Init(TKeepAliveHttpClient& client, - const TClientSettings& settings); - - static TString GetRequestForTickets(const TMetaInfo::TConfig& config); - - const TKeepAliveHttpClient::THeaders& GetAuthHeader() const { - return AuthHeader_; - } - - TConfigPtr GetConfig() const { - return Config_.Get(); - } - - bool TryUpdateConfig(TKeepAliveHttpClient& client); - - protected: - void TryPing(TKeepAliveHttpClient& client); - TString Fetch(TKeepAliveHttpClient& client) const; - static TConfigPtr ParseMetaString(const TString& meta, const TString& self); - void ApplySettings(const TClientSettings& settings); - static EBlackboxEnv BbEnvFromString(const TString& env, const TString& meta); - - protected: - NUtils::TProtectedValue<TConfigPtr> Config_; - TKeepAliveHttpClient::THeaders AuthHeader_; - - TLoggerPtr Logger_; - TString SelfAlias_; - }; -} +#pragma once + +#include "settings.h" + +#include <library/cpp/tvmauth/client/misc/utils.h> + +#include <library/cpp/tvmauth/client/logger.h> + +#include <library/cpp/http/simple/http_client.h> + +namespace NTvmAuth::NTvmTool { + class TMetaInfo { + public: + using TDstAliases = THashMap<TClientSettings::TAlias, TTvmId>; + + struct TConfig { + TTvmId SelfTvmId = 0; + EBlackboxEnv BbEnv = EBlackboxEnv::Prod; + TDstAliases DstAliases; + + bool AreTicketsRequired() const { + return !DstAliases.empty(); + } + + TString ToString() const; + + bool operator==(const TConfig& c) const { + return SelfTvmId == c.SelfTvmId && + BbEnv == c.BbEnv && + DstAliases == c.DstAliases; + } + }; + using TConfigPtr = std::shared_ptr<TConfig>; + + public: + TMetaInfo(TLoggerPtr logger); + + TConfigPtr Init(TKeepAliveHttpClient& client, + const TClientSettings& settings); + + static TString GetRequestForTickets(const TMetaInfo::TConfig& config); + + const TKeepAliveHttpClient::THeaders& GetAuthHeader() const { + return AuthHeader_; + } + + TConfigPtr GetConfig() const { + return Config_.Get(); + } + + bool TryUpdateConfig(TKeepAliveHttpClient& client); + + protected: + void TryPing(TKeepAliveHttpClient& client); + TString Fetch(TKeepAliveHttpClient& client) const; + static TConfigPtr ParseMetaString(const TString& meta, const TString& self); + void ApplySettings(const TClientSettings& settings); + static EBlackboxEnv BbEnvFromString(const TString& env, const TString& meta); + + protected: + NUtils::TProtectedValue<TConfigPtr> Config_; + TKeepAliveHttpClient::THeaders AuthHeader_; + + TLoggerPtr Logger_; + TString SelfAlias_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/tool/settings.cpp b/library/cpp/tvmauth/client/misc/tool/settings.cpp index 894501f19d..174a8ef4e8 100644 --- a/library/cpp/tvmauth/client/misc/tool/settings.cpp +++ b/library/cpp/tvmauth/client/misc/tool/settings.cpp @@ -1,37 +1,37 @@ -#include "settings.h" - -#include <library/cpp/string_utils/url/url.h> - -#include <util/system/env.h> - -namespace NTvmAuth::NTvmTool { - TClientSettings::TClientSettings(const TAlias& selfAias) - : SelfAias_(selfAias) - , Hostname_("localhost") - , Port_(1) +#include "settings.h" + +#include <library/cpp/string_utils/url/url.h> + +#include <util/system/env.h> + +namespace NTvmAuth::NTvmTool { + TClientSettings::TClientSettings(const TAlias& selfAias) + : SelfAias_(selfAias) + , Hostname_("localhost") + , Port_(1) , SocketTimeout_(TDuration::Seconds(5)) , ConnectTimeout_(TDuration::Seconds(30)) - { - AuthToken_ = GetEnv("TVMTOOL_LOCAL_AUTHTOKEN"); - if (!AuthToken_) { - AuthToken_ = GetEnv("QLOUD_TVM_TOKEN"); - } - TStringBuf auth(AuthToken_); - FixSpaces(auth); - AuthToken_ = auth; - - const TString url = GetEnv("DEPLOY_TVM_TOOL_URL"); - if (url) { - TStringBuf scheme, host; - TryGetSchemeHostAndPort(url, scheme, host, Port_); - } - - Y_ENSURE_EX(SelfAias_, TBrokenTvmClientSettings() << "Alias for your TVM client cannot be empty"); - } - - void TClientSettings::FixSpaces(TStringBuf& str) { - while (str && isspace(str.back())) { - str.Chop(1); - } - } -} + { + AuthToken_ = GetEnv("TVMTOOL_LOCAL_AUTHTOKEN"); + if (!AuthToken_) { + AuthToken_ = GetEnv("QLOUD_TVM_TOKEN"); + } + TStringBuf auth(AuthToken_); + FixSpaces(auth); + AuthToken_ = auth; + + const TString url = GetEnv("DEPLOY_TVM_TOOL_URL"); + if (url) { + TStringBuf scheme, host; + TryGetSchemeHostAndPort(url, scheme, host, Port_); + } + + Y_ENSURE_EX(SelfAias_, TBrokenTvmClientSettings() << "Alias for your TVM client cannot be empty"); + } + + void TClientSettings::FixSpaces(TStringBuf& str) { + while (str && isspace(str.back())) { + str.Chop(1); + } + } +} diff --git a/library/cpp/tvmauth/client/misc/tool/settings.h b/library/cpp/tvmauth/client/misc/tool/settings.h index 63255ed090..0510c8b52e 100644 --- a/library/cpp/tvmauth/client/misc/tool/settings.h +++ b/library/cpp/tvmauth/client/misc/tool/settings.h @@ -1,58 +1,58 @@ -#pragma once - -#include <library/cpp/tvmauth/client/misc/settings.h> - -#include <library/cpp/tvmauth/client/exception.h> - -#include <library/cpp/tvmauth/checked_user_ticket.h> - +#pragma once + +#include <library/cpp/tvmauth/client/misc/settings.h> + +#include <library/cpp/tvmauth/client/exception.h> + +#include <library/cpp/tvmauth/checked_user_ticket.h> + #include <util/datetime/base.h> -#include <util/generic/maybe.h> - -namespace NTvmAuth::NTvmTool { - /** - * Uses local http-interface to get state: http://localhost/tvm/. - * This interface can be provided with tvmtool (local daemon) or Qloud/YP (local http api in container). - * See more: https://wiki.yandex-team.ru/passport/tvm2/qloud/. - * - * Most part of settings will be fetched from tvmtool on start of client. - * You need to use aliases for TVM-clients (src and dst) which you specified in tvmtool or Qloud/YP interface - */ - class TClientSettings: public NTvmAuth::TClientSettings { - public: - /*! - * Sets default values: - * - hostname == "localhost" - * - port detected with env["DEPLOY_TVM_TOOL_URL"] (provided with Yandex.Deploy), - * otherwise port == 1 (it is ok for Qloud) - * - authToken: env["TVMTOOL_LOCAL_AUTHTOKEN"] (provided with Yandex.Deploy), - * otherwise env["QLOUD_TVM_TOKEN"] (provided with Qloud) - * - * AuthToken is protection from SSRF. - * - * @param selfAias - alias for your TVM client, which you specified in tvmtool or YD interface - */ - TClientSettings(const TAlias& selfAias); - - /*! - * Look at comment for ctor - * @param port - */ - TClientSettings& SetPort(ui16 port) { - Port_ = port; - return *this; - } - - /*! - * Default value: hostname == "localhost" - * @param hostname - */ - TClientSettings& SetHostname(const TString& hostname) { - Y_ENSURE_EX(hostname, TBrokenTvmClientSettings() << "Hostname cannot be empty"); - Hostname_ = hostname; - return *this; - } - +#include <util/generic/maybe.h> + +namespace NTvmAuth::NTvmTool { + /** + * Uses local http-interface to get state: http://localhost/tvm/. + * This interface can be provided with tvmtool (local daemon) or Qloud/YP (local http api in container). + * See more: https://wiki.yandex-team.ru/passport/tvm2/qloud/. + * + * Most part of settings will be fetched from tvmtool on start of client. + * You need to use aliases for TVM-clients (src and dst) which you specified in tvmtool or Qloud/YP interface + */ + class TClientSettings: public NTvmAuth::TClientSettings { + public: + /*! + * Sets default values: + * - hostname == "localhost" + * - port detected with env["DEPLOY_TVM_TOOL_URL"] (provided with Yandex.Deploy), + * otherwise port == 1 (it is ok for Qloud) + * - authToken: env["TVMTOOL_LOCAL_AUTHTOKEN"] (provided with Yandex.Deploy), + * otherwise env["QLOUD_TVM_TOKEN"] (provided with Qloud) + * + * AuthToken is protection from SSRF. + * + * @param selfAias - alias for your TVM client, which you specified in tvmtool or YD interface + */ + TClientSettings(const TAlias& selfAias); + + /*! + * Look at comment for ctor + * @param port + */ + TClientSettings& SetPort(ui16 port) { + Port_ = port; + return *this; + } + + /*! + * Default value: hostname == "localhost" + * @param hostname + */ + TClientSettings& SetHostname(const TString& hostname) { + Y_ENSURE_EX(hostname, TBrokenTvmClientSettings() << "Hostname cannot be empty"); + Hostname_ = hostname; + return *this; + } + TClientSettings& SetSocketTimeout(TDuration socketTimeout) { SocketTimeout_ = socketTimeout; return *this; @@ -63,46 +63,46 @@ namespace NTvmAuth::NTvmTool { return *this; } - /*! - * Look at comment for ctor - * @param token - */ - TClientSettings& SetAuthToken(TStringBuf token) { - FixSpaces(token); - Y_ENSURE_EX(token, TBrokenTvmClientSettings() << "Auth token cannot be empty"); - AuthToken_ = token; - return *this; - } - - /*! - * Blackbox environmet is provided by tvmtool for client. - * You can override it for your purpose with limitations: - * (env from tvmtool) -> (override) - * - Prod/ProdYateam -> Prod/ProdYateam - * - Test/TestYateam -> Test/TestYateam - * - Stress -> Stress - * - * You can contact tvm-dev@yandex-team.ru if limitations are too strict - * @param env - */ - TClientSettings& OverrideBlackboxEnv(EBlackboxEnv env) { - BbEnv_ = env; - return *this; - } - - public: // for TAsyncUpdaterBase - const TAlias& GetSelfAlias() const { - return SelfAias_; - } - - const TString& GetHostname() const { - return Hostname_; - } - - ui16 GetPort() const { - return Port_; - } - + /*! + * Look at comment for ctor + * @param token + */ + TClientSettings& SetAuthToken(TStringBuf token) { + FixSpaces(token); + Y_ENSURE_EX(token, TBrokenTvmClientSettings() << "Auth token cannot be empty"); + AuthToken_ = token; + return *this; + } + + /*! + * Blackbox environmet is provided by tvmtool for client. + * You can override it for your purpose with limitations: + * (env from tvmtool) -> (override) + * - Prod/ProdYateam -> Prod/ProdYateam + * - Test/TestYateam -> Test/TestYateam + * - Stress -> Stress + * + * You can contact tvm-dev@yandex-team.ru if limitations are too strict + * @param env + */ + TClientSettings& OverrideBlackboxEnv(EBlackboxEnv env) { + BbEnv_ = env; + return *this; + } + + public: // for TAsyncUpdaterBase + const TAlias& GetSelfAlias() const { + return SelfAias_; + } + + const TString& GetHostname() const { + return Hostname_; + } + + ui16 GetPort() const { + return Port_; + } + TDuration GetSocketTimeout() const { return SocketTimeout_; } @@ -111,27 +111,27 @@ namespace NTvmAuth::NTvmTool { return ConnectTimeout_; } - const TString& GetAuthToken() const { - Y_ENSURE_EX(AuthToken_, TBrokenTvmClientSettings() - << "Auth token cannot be empty. " - << "Env 'TVMTOOL_LOCAL_AUTHTOKEN' and 'QLOUD_TVM_TOKEN' are empty."); - return AuthToken_; - } - - TMaybe<EBlackboxEnv> GetOverridedBlackboxEnv() const { - return BbEnv_; - } - - private: - void FixSpaces(TStringBuf& str); - - private: - TAlias SelfAias_; - TString Hostname_; - ui16 Port_; + const TString& GetAuthToken() const { + Y_ENSURE_EX(AuthToken_, TBrokenTvmClientSettings() + << "Auth token cannot be empty. " + << "Env 'TVMTOOL_LOCAL_AUTHTOKEN' and 'QLOUD_TVM_TOKEN' are empty."); + return AuthToken_; + } + + TMaybe<EBlackboxEnv> GetOverridedBlackboxEnv() const { + return BbEnv_; + } + + private: + void FixSpaces(TStringBuf& str); + + private: + TAlias SelfAias_; + TString Hostname_; + ui16 Port_; TDuration SocketTimeout_; TDuration ConnectTimeout_; - TString AuthToken_; - TMaybe<EBlackboxEnv> BbEnv_; - }; -} + TString AuthToken_; + TMaybe<EBlackboxEnv> BbEnv_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/tool/threaded_updater.cpp b/library/cpp/tvmauth/client/misc/tool/threaded_updater.cpp index 8490f7ab54..c811e2a52e 100644 --- a/library/cpp/tvmauth/client/misc/tool/threaded_updater.cpp +++ b/library/cpp/tvmauth/client/misc/tool/threaded_updater.cpp @@ -1,331 +1,331 @@ -#include "threaded_updater.h" - -#include <library/cpp/tvmauth/client/misc/utils.h> - -#include <library/cpp/json/json_reader.h> - -#include <util/generic/hash_set.h> -#include <util/stream/str.h> -#include <util/string/ascii.h> -#include <util/string/builder.h> -#include <util/string/cast.h> - -namespace NTvmAuth::NTvmTool { - TAsyncUpdaterPtr TThreadedUpdater::Create(const TClientSettings& settings, TLoggerPtr logger) { - Y_ENSURE_EX(logger, TNonRetriableException() << "Logger is required"); - THolder<TThreadedUpdater> p(new TThreadedUpdater( - settings.GetHostname(), - settings.GetPort(), - settings.GetSocketTimeout(), - settings.GetConnectTimeout(), - std::move(logger))); - p->Init(settings); - p->StartWorker(); - return p.Release(); - } - - TThreadedUpdater::~TThreadedUpdater() { - StopWorker(); // Required here to avoid using of deleted members - } - - TClientStatus TThreadedUpdater::GetStatus() const { - const TClientStatus::ECode state = GetState(); - return TClientStatus(state, GetLastError(state == TClientStatus::Ok)); - } - - TClientStatus::ECode TThreadedUpdater::GetState() const { - const TInstant now = TInstant::Now(); - const TMetaInfo::TConfigPtr config = MetaInfo_.GetConfig(); - - if ((config->AreTicketsRequired() && AreServiceTicketsInvalid(now)) || ArePublicKeysInvalid(now)) { - return TClientStatus::Error; - } - - if (config->AreTicketsRequired()) { - if (!GetCachedServiceTickets() || config->DstAliases.size() > GetCachedServiceTickets()->TicketsByAlias.size()) { - return TClientStatus::Error; - } - } - - const TDuration st = now - GetUpdateTimeOfServiceTickets(); - const TDuration pk = now - GetUpdateTimeOfPublicKeys(); - - if ((config->AreTicketsRequired() && st > ServiceTicketsDurations_.Expiring) || pk > PublicKeysDurations_.Expiring) { - return TClientStatus::Warning; - } - - if (IsConfigWarnTime()) { - return TClientStatus::Warning; - } - - return TClientStatus::Ok; - } - +#include "threaded_updater.h" + +#include <library/cpp/tvmauth/client/misc/utils.h> + +#include <library/cpp/json/json_reader.h> + +#include <util/generic/hash_set.h> +#include <util/stream/str.h> +#include <util/string/ascii.h> +#include <util/string/builder.h> +#include <util/string/cast.h> + +namespace NTvmAuth::NTvmTool { + TAsyncUpdaterPtr TThreadedUpdater::Create(const TClientSettings& settings, TLoggerPtr logger) { + Y_ENSURE_EX(logger, TNonRetriableException() << "Logger is required"); + THolder<TThreadedUpdater> p(new TThreadedUpdater( + settings.GetHostname(), + settings.GetPort(), + settings.GetSocketTimeout(), + settings.GetConnectTimeout(), + std::move(logger))); + p->Init(settings); + p->StartWorker(); + return p.Release(); + } + + TThreadedUpdater::~TThreadedUpdater() { + StopWorker(); // Required here to avoid using of deleted members + } + + TClientStatus TThreadedUpdater::GetStatus() const { + const TClientStatus::ECode state = GetState(); + return TClientStatus(state, GetLastError(state == TClientStatus::Ok)); + } + + TClientStatus::ECode TThreadedUpdater::GetState() const { + const TInstant now = TInstant::Now(); + const TMetaInfo::TConfigPtr config = MetaInfo_.GetConfig(); + + if ((config->AreTicketsRequired() && AreServiceTicketsInvalid(now)) || ArePublicKeysInvalid(now)) { + return TClientStatus::Error; + } + + if (config->AreTicketsRequired()) { + if (!GetCachedServiceTickets() || config->DstAliases.size() > GetCachedServiceTickets()->TicketsByAlias.size()) { + return TClientStatus::Error; + } + } + + const TDuration st = now - GetUpdateTimeOfServiceTickets(); + const TDuration pk = now - GetUpdateTimeOfPublicKeys(); + + if ((config->AreTicketsRequired() && st > ServiceTicketsDurations_.Expiring) || pk > PublicKeysDurations_.Expiring) { + return TClientStatus::Warning; + } + + if (IsConfigWarnTime()) { + return TClientStatus::Warning; + } + + return TClientStatus::Ok; + } + TThreadedUpdater::TThreadedUpdater(const TString& host, ui16 port, TDuration socketTimeout, TDuration connectTimeout, TLoggerPtr logger) - : TThreadedUpdaterBase(TDuration::Seconds(5), logger, host, port, socketTimeout, connectTimeout) - , MetaInfo_(logger) - , ConfigWarnDelay_(TDuration::Seconds(30)) - { - ServiceTicketsDurations_.RefreshPeriod = TDuration::Minutes(10); - PublicKeysDurations_.RefreshPeriod = TDuration::Minutes(10); - } - - void TThreadedUpdater::Init(const TClientSettings& settings) { - const TMetaInfo::TConfigPtr config = MetaInfo_.Init(GetClient(), settings); - LastVisitForConfig_ = TInstant::Now(); - - SetBbEnv(config->BbEnv, settings.GetOverridedBlackboxEnv()); - if (settings.GetOverridedBlackboxEnv()) { - LogInfo(TStringBuilder() - << "Meta: override blackbox env: " << config->BbEnv - << "->" << *settings.GetOverridedBlackboxEnv()); - } - - ui8 tries = 3; - do { - UpdateState(); - } while (!IsEverythingOk(*config) && --tries > 0); - - if (!IsEverythingOk(*config)) { - ThrowLastError(); - } - } - - void TThreadedUpdater::UpdateState() { - bool wasUpdated = false; - try { - wasUpdated = MetaInfo_.TryUpdateConfig(GetClient()); - LastVisitForConfig_ = TInstant::Now(); - ClearError(EScope::TvmtoolConfig); - } catch (const std::exception& e) { - ProcessError(EType::Retriable, EScope::TvmtoolConfig, e.what()); - LogWarning(TStringBuilder() << "Error while fetching of tvmtool config: " << e.what()); - } - if (IsConfigWarnTime()) { - LogError(TStringBuilder() << "Tvmtool config have not been refreshed for too long period"); - } - - TMetaInfo::TConfigPtr config = MetaInfo_.GetConfig(); - - if (wasUpdated || IsTimeToUpdateServiceTickets(*config, LastVisitForServiceTickets_)) { - try { - const TInstant updateTime = UpdateServiceTickets(*config); - SetUpdateTimeOfServiceTickets(updateTime); - LastVisitForServiceTickets_ = TInstant::Now(); - - if (AreServiceTicketsOk(*config)) { - ClearError(EScope::ServiceTickets); - } - LogDebug(TStringBuilder() << "Tickets fetched from tvmtool: " << updateTime); - } catch (const std::exception& e) { - ProcessError(EType::Retriable, EScope::ServiceTickets, e.what()); - LogWarning(TStringBuilder() << "Error while fetching of tickets: " << e.what()); - } - - if (TInstant::Now() - GetUpdateTimeOfServiceTickets() > ServiceTicketsDurations_.Expiring) { - LogError("Service tickets have not been refreshed for too long period"); - } - } - - if (wasUpdated || IsTimeToUpdatePublicKeys(LastVisitForPublicKeys_)) { - try { - const TInstant updateTime = UpdateKeys(*config); - SetUpdateTimeOfPublicKeys(updateTime); - LastVisitForPublicKeys_ = TInstant::Now(); - - if (ArePublicKeysOk()) { - ClearError(EScope::PublicKeys); - } - LogDebug(TStringBuilder() << "Public keys fetched from tvmtool: " << updateTime); - } catch (const std::exception& e) { - ProcessError(EType::Retriable, EScope::PublicKeys, e.what()); - LogWarning(TStringBuilder() << "Error while fetching of public keys: " << e.what()); - } - - if (TInstant::Now() - GetUpdateTimeOfPublicKeys() > PublicKeysDurations_.Expiring) { - LogError("Public keys have not been refreshed for too long period"); - } - } - } - - TInstant TThreadedUpdater::UpdateServiceTickets(const TMetaInfo::TConfig& config) { - const std::pair<TString, TInstant> tickets = FetchServiceTickets(config); - - if (TInstant::Now() - tickets.second >= ServiceTicketsDurations_.Invalid) { - throw yexception() << "Service tickets are too old: " << tickets.second; - } - - TPairTicketsErrors p = ParseFetchTicketsResponse(tickets.first, config.DstAliases); - SetServiceTickets(MakeIntrusiveConst<TServiceTickets>(std::move(p.Tickets), - std::move(p.Errors), - config.DstAliases)); - return tickets.second; - } - - std::pair<TString, TInstant> TThreadedUpdater::FetchServiceTickets(const TMetaInfo::TConfig& config) const { - TStringStream s; - THttpHeaders headers; - - const TString request = TMetaInfo::GetRequestForTickets(config); - auto code = GetClient().DoGet(request, &s, MetaInfo_.GetAuthHeader(), &headers); - Y_ENSURE(code == 200, ProcessHttpError(EScope::ServiceTickets, request, code, s.Str())); - - return {s.Str(), GetBirthTimeFromResponse(headers, "tickets")}; - } - - static THashSet<TTvmId> GetAllTvmIds(const TMetaInfo::TDstAliases& dsts) { - THashSet<TTvmId> res; - res.reserve(dsts.size()); - - for (const auto& pair : dsts) { - res.insert(pair.second); - } - - return res; - } - - TAsyncUpdaterBase::TPairTicketsErrors TThreadedUpdater::ParseFetchTicketsResponse(const TString& resp, - const TMetaInfo::TDstAliases& dsts) const { - const THashSet<TTvmId> allTvmIds = GetAllTvmIds(dsts); - - TServiceTickets::TMapIdStr tickets; - TServiceTickets::TMapIdStr errors; - - auto procErr = [this](const TString& msg) { - ProcessError(EType::NonRetriable, EScope::ServiceTickets, msg); - LogError(msg); - }; - - NJson::TJsonValue doc; - Y_ENSURE(NJson::ReadJsonTree(resp, &doc), "Invalid json from tvmtool: " << resp); - - for (const auto& pair : doc.GetMap()) { - NJson::TJsonValue tvmId; - unsigned long long tvmIdNum = 0; - - if (!pair.second.GetValue("tvm_id", &tvmId) || - !tvmId.GetUInteger(&tvmIdNum)) { - procErr(TStringBuilder() - << "Failed to get 'tvm_id' from key, should never happend '" - << pair.first << "': " << resp); - continue; - } - - if (!allTvmIds.contains(tvmIdNum)) { - continue; - } - - NJson::TJsonValue val; - if (!pair.second.GetValue("ticket", &val)) { - TString err; - if (pair.second.GetValue("error", &val)) { - err = val.GetString(); - } else { - err = "Failed to get 'ticket' and 'error', should never happend: " + pair.first; - } - - procErr(TStringBuilder() - << "Failed to get ServiceTicket for " << pair.first - << " (" << tvmIdNum << "): " << err); - - errors.insert({tvmIdNum, std::move(err)}); - continue; - } - - tickets.insert({tvmIdNum, val.GetString()}); - } - - // This work-around is required because of bug in old verions of tvmtool: PASSP-24829 - for (const auto& pair : dsts) { - if (!tickets.contains(pair.second) && !errors.contains(pair.second)) { - TString err = "Missing tvm_id in response, should never happend: " + pair.first; - - procErr(TStringBuilder() - << "Failed to get ServiceTicket for " << pair.first - << " (" << pair.second << "): " << err); - - errors.emplace(pair.second, std::move(err)); - } - } - - return {std::move(tickets), std::move(errors)}; - } - - TInstant TThreadedUpdater::UpdateKeys(const TMetaInfo::TConfig& config) { - const std::pair<TString, TInstant> keys = FetchPublicKeys(); - - if (TInstant::Now() - keys.second >= PublicKeysDurations_.Invalid) { - throw yexception() << "Public keys are too old: " << keys.second; - } - - SetServiceContext(MakeIntrusiveConst<TServiceContext>( - TServiceContext::CheckingFactory(config.SelfTvmId, keys.first))); - SetUserContext(keys.first); - - return keys.second; - } - - std::pair<TString, TInstant> TThreadedUpdater::FetchPublicKeys() const { - TStringStream s; - THttpHeaders headers; - - auto code = GetClient().DoGet("/tvm/keys", &s, MetaInfo_.GetAuthHeader(), &headers); - Y_ENSURE(code == 200, ProcessHttpError(EScope::PublicKeys, "/tvm/keys", code, s.Str())); - - return {s.Str(), GetBirthTimeFromResponse(headers, "public keys")}; - } - - TInstant TThreadedUpdater::GetBirthTimeFromResponse(const THttpHeaders& headers, TStringBuf errMsg) { - auto it = std::find_if(headers.begin(), - headers.end(), - [](const THttpInputHeader& h) { - return AsciiEqualsIgnoreCase(h.Name(), "X-Ya-Tvmtool-Data-Birthtime"); - }); - Y_ENSURE(it != headers.end(), "Failed to fetch bithtime of " << errMsg << " from tvmtool"); - - ui64 time = 0; - Y_ENSURE(TryIntFromString<10>(it->Value(), time), - "Bithtime of " << errMsg << " from tvmtool must be unixtime. Got: " << it->Value()); - - return TInstant::Seconds(time); - } - - bool TThreadedUpdater::IsTimeToUpdateServiceTickets(const TMetaInfo::TConfig& config, - TInstant lastUpdate) const { - return config.AreTicketsRequired() && - TInstant::Now() - lastUpdate > ServiceTicketsDurations_.RefreshPeriod; - } - - bool TThreadedUpdater::IsTimeToUpdatePublicKeys(TInstant lastUpdate) const { - return TInstant::Now() - lastUpdate > PublicKeysDurations_.RefreshPeriod; - } - - bool TThreadedUpdater::IsEverythingOk(const TMetaInfo::TConfig& config) const { - return AreServiceTicketsOk(config) && ArePublicKeysOk(); - } - - bool TThreadedUpdater::AreServiceTicketsOk(const TMetaInfo::TConfig& config) const { - return AreServiceTicketsOk(config.DstAliases.size()); - } - - bool TThreadedUpdater::AreServiceTicketsOk(size_t requiredCount) const { - if (requiredCount == 0) { - return true; - } - - auto c = GetCachedServiceTickets(); - return c && c->TicketsByAlias.size() == requiredCount; - } - - bool TThreadedUpdater::ArePublicKeysOk() const { - return GetCachedServiceContext() && GetCachedUserContext(); - } - - bool TThreadedUpdater::IsConfigWarnTime() const { - return LastVisitForConfig_ + ConfigWarnDelay_ < TInstant::Now(); - } - - void TThreadedUpdater::Worker() { - UpdateState(); - } -} + : TThreadedUpdaterBase(TDuration::Seconds(5), logger, host, port, socketTimeout, connectTimeout) + , MetaInfo_(logger) + , ConfigWarnDelay_(TDuration::Seconds(30)) + { + ServiceTicketsDurations_.RefreshPeriod = TDuration::Minutes(10); + PublicKeysDurations_.RefreshPeriod = TDuration::Minutes(10); + } + + void TThreadedUpdater::Init(const TClientSettings& settings) { + const TMetaInfo::TConfigPtr config = MetaInfo_.Init(GetClient(), settings); + LastVisitForConfig_ = TInstant::Now(); + + SetBbEnv(config->BbEnv, settings.GetOverridedBlackboxEnv()); + if (settings.GetOverridedBlackboxEnv()) { + LogInfo(TStringBuilder() + << "Meta: override blackbox env: " << config->BbEnv + << "->" << *settings.GetOverridedBlackboxEnv()); + } + + ui8 tries = 3; + do { + UpdateState(); + } while (!IsEverythingOk(*config) && --tries > 0); + + if (!IsEverythingOk(*config)) { + ThrowLastError(); + } + } + + void TThreadedUpdater::UpdateState() { + bool wasUpdated = false; + try { + wasUpdated = MetaInfo_.TryUpdateConfig(GetClient()); + LastVisitForConfig_ = TInstant::Now(); + ClearError(EScope::TvmtoolConfig); + } catch (const std::exception& e) { + ProcessError(EType::Retriable, EScope::TvmtoolConfig, e.what()); + LogWarning(TStringBuilder() << "Error while fetching of tvmtool config: " << e.what()); + } + if (IsConfigWarnTime()) { + LogError(TStringBuilder() << "Tvmtool config have not been refreshed for too long period"); + } + + TMetaInfo::TConfigPtr config = MetaInfo_.GetConfig(); + + if (wasUpdated || IsTimeToUpdateServiceTickets(*config, LastVisitForServiceTickets_)) { + try { + const TInstant updateTime = UpdateServiceTickets(*config); + SetUpdateTimeOfServiceTickets(updateTime); + LastVisitForServiceTickets_ = TInstant::Now(); + + if (AreServiceTicketsOk(*config)) { + ClearError(EScope::ServiceTickets); + } + LogDebug(TStringBuilder() << "Tickets fetched from tvmtool: " << updateTime); + } catch (const std::exception& e) { + ProcessError(EType::Retriable, EScope::ServiceTickets, e.what()); + LogWarning(TStringBuilder() << "Error while fetching of tickets: " << e.what()); + } + + if (TInstant::Now() - GetUpdateTimeOfServiceTickets() > ServiceTicketsDurations_.Expiring) { + LogError("Service tickets have not been refreshed for too long period"); + } + } + + if (wasUpdated || IsTimeToUpdatePublicKeys(LastVisitForPublicKeys_)) { + try { + const TInstant updateTime = UpdateKeys(*config); + SetUpdateTimeOfPublicKeys(updateTime); + LastVisitForPublicKeys_ = TInstant::Now(); + + if (ArePublicKeysOk()) { + ClearError(EScope::PublicKeys); + } + LogDebug(TStringBuilder() << "Public keys fetched from tvmtool: " << updateTime); + } catch (const std::exception& e) { + ProcessError(EType::Retriable, EScope::PublicKeys, e.what()); + LogWarning(TStringBuilder() << "Error while fetching of public keys: " << e.what()); + } + + if (TInstant::Now() - GetUpdateTimeOfPublicKeys() > PublicKeysDurations_.Expiring) { + LogError("Public keys have not been refreshed for too long period"); + } + } + } + + TInstant TThreadedUpdater::UpdateServiceTickets(const TMetaInfo::TConfig& config) { + const std::pair<TString, TInstant> tickets = FetchServiceTickets(config); + + if (TInstant::Now() - tickets.second >= ServiceTicketsDurations_.Invalid) { + throw yexception() << "Service tickets are too old: " << tickets.second; + } + + TPairTicketsErrors p = ParseFetchTicketsResponse(tickets.first, config.DstAliases); + SetServiceTickets(MakeIntrusiveConst<TServiceTickets>(std::move(p.Tickets), + std::move(p.Errors), + config.DstAliases)); + return tickets.second; + } + + std::pair<TString, TInstant> TThreadedUpdater::FetchServiceTickets(const TMetaInfo::TConfig& config) const { + TStringStream s; + THttpHeaders headers; + + const TString request = TMetaInfo::GetRequestForTickets(config); + auto code = GetClient().DoGet(request, &s, MetaInfo_.GetAuthHeader(), &headers); + Y_ENSURE(code == 200, ProcessHttpError(EScope::ServiceTickets, request, code, s.Str())); + + return {s.Str(), GetBirthTimeFromResponse(headers, "tickets")}; + } + + static THashSet<TTvmId> GetAllTvmIds(const TMetaInfo::TDstAliases& dsts) { + THashSet<TTvmId> res; + res.reserve(dsts.size()); + + for (const auto& pair : dsts) { + res.insert(pair.second); + } + + return res; + } + + TAsyncUpdaterBase::TPairTicketsErrors TThreadedUpdater::ParseFetchTicketsResponse(const TString& resp, + const TMetaInfo::TDstAliases& dsts) const { + const THashSet<TTvmId> allTvmIds = GetAllTvmIds(dsts); + + TServiceTickets::TMapIdStr tickets; + TServiceTickets::TMapIdStr errors; + + auto procErr = [this](const TString& msg) { + ProcessError(EType::NonRetriable, EScope::ServiceTickets, msg); + LogError(msg); + }; + + NJson::TJsonValue doc; + Y_ENSURE(NJson::ReadJsonTree(resp, &doc), "Invalid json from tvmtool: " << resp); + + for (const auto& pair : doc.GetMap()) { + NJson::TJsonValue tvmId; + unsigned long long tvmIdNum = 0; + + if (!pair.second.GetValue("tvm_id", &tvmId) || + !tvmId.GetUInteger(&tvmIdNum)) { + procErr(TStringBuilder() + << "Failed to get 'tvm_id' from key, should never happend '" + << pair.first << "': " << resp); + continue; + } + + if (!allTvmIds.contains(tvmIdNum)) { + continue; + } + + NJson::TJsonValue val; + if (!pair.second.GetValue("ticket", &val)) { + TString err; + if (pair.second.GetValue("error", &val)) { + err = val.GetString(); + } else { + err = "Failed to get 'ticket' and 'error', should never happend: " + pair.first; + } + + procErr(TStringBuilder() + << "Failed to get ServiceTicket for " << pair.first + << " (" << tvmIdNum << "): " << err); + + errors.insert({tvmIdNum, std::move(err)}); + continue; + } + + tickets.insert({tvmIdNum, val.GetString()}); + } + + // This work-around is required because of bug in old verions of tvmtool: PASSP-24829 + for (const auto& pair : dsts) { + if (!tickets.contains(pair.second) && !errors.contains(pair.second)) { + TString err = "Missing tvm_id in response, should never happend: " + pair.first; + + procErr(TStringBuilder() + << "Failed to get ServiceTicket for " << pair.first + << " (" << pair.second << "): " << err); + + errors.emplace(pair.second, std::move(err)); + } + } + + return {std::move(tickets), std::move(errors)}; + } + + TInstant TThreadedUpdater::UpdateKeys(const TMetaInfo::TConfig& config) { + const std::pair<TString, TInstant> keys = FetchPublicKeys(); + + if (TInstant::Now() - keys.second >= PublicKeysDurations_.Invalid) { + throw yexception() << "Public keys are too old: " << keys.second; + } + + SetServiceContext(MakeIntrusiveConst<TServiceContext>( + TServiceContext::CheckingFactory(config.SelfTvmId, keys.first))); + SetUserContext(keys.first); + + return keys.second; + } + + std::pair<TString, TInstant> TThreadedUpdater::FetchPublicKeys() const { + TStringStream s; + THttpHeaders headers; + + auto code = GetClient().DoGet("/tvm/keys", &s, MetaInfo_.GetAuthHeader(), &headers); + Y_ENSURE(code == 200, ProcessHttpError(EScope::PublicKeys, "/tvm/keys", code, s.Str())); + + return {s.Str(), GetBirthTimeFromResponse(headers, "public keys")}; + } + + TInstant TThreadedUpdater::GetBirthTimeFromResponse(const THttpHeaders& headers, TStringBuf errMsg) { + auto it = std::find_if(headers.begin(), + headers.end(), + [](const THttpInputHeader& h) { + return AsciiEqualsIgnoreCase(h.Name(), "X-Ya-Tvmtool-Data-Birthtime"); + }); + Y_ENSURE(it != headers.end(), "Failed to fetch bithtime of " << errMsg << " from tvmtool"); + + ui64 time = 0; + Y_ENSURE(TryIntFromString<10>(it->Value(), time), + "Bithtime of " << errMsg << " from tvmtool must be unixtime. Got: " << it->Value()); + + return TInstant::Seconds(time); + } + + bool TThreadedUpdater::IsTimeToUpdateServiceTickets(const TMetaInfo::TConfig& config, + TInstant lastUpdate) const { + return config.AreTicketsRequired() && + TInstant::Now() - lastUpdate > ServiceTicketsDurations_.RefreshPeriod; + } + + bool TThreadedUpdater::IsTimeToUpdatePublicKeys(TInstant lastUpdate) const { + return TInstant::Now() - lastUpdate > PublicKeysDurations_.RefreshPeriod; + } + + bool TThreadedUpdater::IsEverythingOk(const TMetaInfo::TConfig& config) const { + return AreServiceTicketsOk(config) && ArePublicKeysOk(); + } + + bool TThreadedUpdater::AreServiceTicketsOk(const TMetaInfo::TConfig& config) const { + return AreServiceTicketsOk(config.DstAliases.size()); + } + + bool TThreadedUpdater::AreServiceTicketsOk(size_t requiredCount) const { + if (requiredCount == 0) { + return true; + } + + auto c = GetCachedServiceTickets(); + return c && c->TicketsByAlias.size() == requiredCount; + } + + bool TThreadedUpdater::ArePublicKeysOk() const { + return GetCachedServiceContext() && GetCachedUserContext(); + } + + bool TThreadedUpdater::IsConfigWarnTime() const { + return LastVisitForConfig_ + ConfigWarnDelay_ < TInstant::Now(); + } + + void TThreadedUpdater::Worker() { + UpdateState(); + } +} diff --git a/library/cpp/tvmauth/client/misc/tool/threaded_updater.h b/library/cpp/tvmauth/client/misc/tool/threaded_updater.h index 7fe88adfae..656beff6dd 100644 --- a/library/cpp/tvmauth/client/misc/tool/threaded_updater.h +++ b/library/cpp/tvmauth/client/misc/tool/threaded_updater.h @@ -1,55 +1,55 @@ -#pragma once - -#include "meta_info.h" - -#include <library/cpp/tvmauth/client/misc/async_updater.h> -#include <library/cpp/tvmauth/client/misc/threaded_updater.h> - -#include <atomic> - -namespace NTvmAuth::NTvmTool { - class TThreadedUpdater: public TThreadedUpdaterBase { - public: - static TAsyncUpdaterPtr Create(const TClientSettings& settings, TLoggerPtr logger); - ~TThreadedUpdater(); - - TClientStatus GetStatus() const override; - - protected: // for tests - TClientStatus::ECode GetState() const; - +#pragma once + +#include "meta_info.h" + +#include <library/cpp/tvmauth/client/misc/async_updater.h> +#include <library/cpp/tvmauth/client/misc/threaded_updater.h> + +#include <atomic> + +namespace NTvmAuth::NTvmTool { + class TThreadedUpdater: public TThreadedUpdaterBase { + public: + static TAsyncUpdaterPtr Create(const TClientSettings& settings, TLoggerPtr logger); + ~TThreadedUpdater(); + + TClientStatus GetStatus() const override; + + protected: // for tests + TClientStatus::ECode GetState() const; + TThreadedUpdater(const TString& host, ui16 port, TDuration socketTimeout, TDuration connectTimeout, TLoggerPtr logger); - - void Init(const TClientSettings& settings); - void UpdateState(); - - TInstant UpdateServiceTickets(const TMetaInfo::TConfig& config); - std::pair<TString, TInstant> FetchServiceTickets(const TMetaInfo::TConfig& config) const; - TPairTicketsErrors ParseFetchTicketsResponse(const TString& resp, - const TMetaInfo::TDstAliases& dsts) const; - - TInstant UpdateKeys(const TMetaInfo::TConfig& config); - std::pair<TString, TInstant> FetchPublicKeys() const; - - static TInstant GetBirthTimeFromResponse(const THttpHeaders& headers, TStringBuf errMsg); - - bool IsTimeToUpdateServiceTickets(const TMetaInfo::TConfig& config, TInstant lastUpdate) const; - bool IsTimeToUpdatePublicKeys(TInstant lastUpdate) const; - - bool IsEverythingOk(const TMetaInfo::TConfig& config) const; - bool AreServiceTicketsOk(const TMetaInfo::TConfig& config) const; - bool AreServiceTicketsOk(size_t requiredCount) const; - bool ArePublicKeysOk() const; - bool IsConfigWarnTime() const; - - private: - void Worker() override; - - protected: - TMetaInfo MetaInfo_; - TInstant LastVisitForServiceTickets_; - TInstant LastVisitForPublicKeys_; - TInstant LastVisitForConfig_; - TDuration ConfigWarnDelay_; - }; -} + + void Init(const TClientSettings& settings); + void UpdateState(); + + TInstant UpdateServiceTickets(const TMetaInfo::TConfig& config); + std::pair<TString, TInstant> FetchServiceTickets(const TMetaInfo::TConfig& config) const; + TPairTicketsErrors ParseFetchTicketsResponse(const TString& resp, + const TMetaInfo::TDstAliases& dsts) const; + + TInstant UpdateKeys(const TMetaInfo::TConfig& config); + std::pair<TString, TInstant> FetchPublicKeys() const; + + static TInstant GetBirthTimeFromResponse(const THttpHeaders& headers, TStringBuf errMsg); + + bool IsTimeToUpdateServiceTickets(const TMetaInfo::TConfig& config, TInstant lastUpdate) const; + bool IsTimeToUpdatePublicKeys(TInstant lastUpdate) const; + + bool IsEverythingOk(const TMetaInfo::TConfig& config) const; + bool AreServiceTicketsOk(const TMetaInfo::TConfig& config) const; + bool AreServiceTicketsOk(size_t requiredCount) const; + bool ArePublicKeysOk() const; + bool IsConfigWarnTime() const; + + private: + void Worker() override; + + protected: + TMetaInfo MetaInfo_; + TInstant LastVisitForServiceTickets_; + TInstant LastVisitForPublicKeys_; + TInstant LastVisitForConfig_; + TDuration ConfigWarnDelay_; + }; +} diff --git a/library/cpp/tvmauth/client/misc/utils.cpp b/library/cpp/tvmauth/client/misc/utils.cpp index a124c7b11c..508215c294 100644 --- a/library/cpp/tvmauth/client/misc/utils.cpp +++ b/library/cpp/tvmauth/client/misc/utils.cpp @@ -1,46 +1,46 @@ -#include "utils.h" - -#include <library/cpp/tvmauth/client/facade.h> - -#include <util/stream/format.h> - -namespace NTvmAuth::NInternal { - void TClientCaningKnife::StartTvmClientStopping(TTvmClient* c) { - if (c && c->Updater_) { - c->Updater_->StartTvmClientStopping(); - } - } - - bool TClientCaningKnife::IsTvmClientStopped(TTvmClient* c) { - return c && c->Updater_ ? c->Updater_->IsTvmClientStopped() : true; - } -} - -namespace NTvmAuth::NUtils { - TString ToHex(const TStringBuf s) { - TStringStream res; - res.Reserve(2 * s.size()); - - for (char c : s) { - res << Hex(c, HF_FULL); - } - - return std::move(res.Str()); - } - - bool CheckBbEnvOverriding(EBlackboxEnv original, EBlackboxEnv override) noexcept { - switch (original) { - case EBlackboxEnv::Prod: - case EBlackboxEnv::ProdYateam: - return override == EBlackboxEnv::Prod || override == EBlackboxEnv::ProdYateam; - case EBlackboxEnv::Test: - return true; - case EBlackboxEnv::TestYateam: - return override == EBlackboxEnv::Test || override == EBlackboxEnv::TestYateam; - case EBlackboxEnv::Stress: - return override == EBlackboxEnv::Stress; - } - - return false; - } -} +#include "utils.h" + +#include <library/cpp/tvmauth/client/facade.h> + +#include <util/stream/format.h> + +namespace NTvmAuth::NInternal { + void TClientCaningKnife::StartTvmClientStopping(TTvmClient* c) { + if (c && c->Updater_) { + c->Updater_->StartTvmClientStopping(); + } + } + + bool TClientCaningKnife::IsTvmClientStopped(TTvmClient* c) { + return c && c->Updater_ ? c->Updater_->IsTvmClientStopped() : true; + } +} + +namespace NTvmAuth::NUtils { + TString ToHex(const TStringBuf s) { + TStringStream res; + res.Reserve(2 * s.size()); + + for (char c : s) { + res << Hex(c, HF_FULL); + } + + return std::move(res.Str()); + } + + bool CheckBbEnvOverriding(EBlackboxEnv original, EBlackboxEnv override) noexcept { + switch (original) { + case EBlackboxEnv::Prod: + case EBlackboxEnv::ProdYateam: + return override == EBlackboxEnv::Prod || override == EBlackboxEnv::ProdYateam; + case EBlackboxEnv::Test: + return true; + case EBlackboxEnv::TestYateam: + return override == EBlackboxEnv::Test || override == EBlackboxEnv::TestYateam; + case EBlackboxEnv::Stress: + return override == EBlackboxEnv::Stress; + } + + return false; + } +} diff --git a/library/cpp/tvmauth/client/misc/utils.h b/library/cpp/tvmauth/client/misc/utils.h index 1aa5e61bf1..d2333b16fc 100644 --- a/library/cpp/tvmauth/client/misc/utils.h +++ b/library/cpp/tvmauth/client/misc/utils.h @@ -1,95 +1,95 @@ -#pragma once - -#include "api/settings.h" -#include "tool/settings.h" - -#include <util/string/cast.h> -#include <util/system/spinlock.h> - -#include <optional> - -namespace NTvmAuth { - class TTvmClient; -} - -namespace NTvmAuth::NInternal { - class TClientCaningKnife { - public: - static void StartTvmClientStopping(TTvmClient* c); - static bool IsTvmClientStopped(TTvmClient* c); - }; -} - -namespace NTvmAuth::NUtils { - TString ToHex(const TStringBuf s); - - inline NTvmAuth::NTvmApi::TClientSettings::TDstMap ParseDstMap(TStringBuf dsts) { - NTvmAuth::NTvmApi::TClientSettings::TDstMap res; - - while (dsts) { - TStringBuf pair = dsts.NextTok(';'); - TStringBuf alias = pair.NextTok(':'); - res.insert(decltype(res)::value_type( - alias, - IntFromString<TTvmId, 10>(pair))); - } - - return res; - } - - inline NTvmAuth::NTvmApi::TClientSettings::TDstVector ParseDstVector(TStringBuf dsts) { - NTvmAuth::NTvmApi::TClientSettings::TDstVector res; - - while (dsts) { - res.push_back(IntFromString<TTvmId, 10>(dsts.NextTok(';'))); - } - - return res; - } - - bool CheckBbEnvOverriding(EBlackboxEnv original, EBlackboxEnv override) noexcept; - - template <class T> - class TProtectedValue { - class TAssignOp { - public: - static void Assign(T& l, const T& r) { - l = r; - } - - template <typename U> - static void Assign(std::shared_ptr<U>& l, std::shared_ptr<U>& r) { - l.swap(r); - } - - template <typename U> - static void Assign(TIntrusiveConstPtr<U>& l, TIntrusiveConstPtr<U>& r) { - l.Swap(r); - } - }; - - public: - TProtectedValue() = default; - - TProtectedValue(T value) - : Value_(value) - { - } - - T Get() const { - with_lock (Lock_) { - return Value_; - } - } - - void Set(T o) { - with_lock (Lock_) { - TAssignOp::Assign(Value_, o); - } - } - - private: - T Value_; - mutable TAdaptiveLock Lock_; - }; -} +#pragma once + +#include "api/settings.h" +#include "tool/settings.h" + +#include <util/string/cast.h> +#include <util/system/spinlock.h> + +#include <optional> + +namespace NTvmAuth { + class TTvmClient; +} + +namespace NTvmAuth::NInternal { + class TClientCaningKnife { + public: + static void StartTvmClientStopping(TTvmClient* c); + static bool IsTvmClientStopped(TTvmClient* c); + }; +} + +namespace NTvmAuth::NUtils { + TString ToHex(const TStringBuf s); + + inline NTvmAuth::NTvmApi::TClientSettings::TDstMap ParseDstMap(TStringBuf dsts) { + NTvmAuth::NTvmApi::TClientSettings::TDstMap res; + + while (dsts) { + TStringBuf pair = dsts.NextTok(';'); + TStringBuf alias = pair.NextTok(':'); + res.insert(decltype(res)::value_type( + alias, + IntFromString<TTvmId, 10>(pair))); + } + + return res; + } + + inline NTvmAuth::NTvmApi::TClientSettings::TDstVector ParseDstVector(TStringBuf dsts) { + NTvmAuth::NTvmApi::TClientSettings::TDstVector res; + + while (dsts) { + res.push_back(IntFromString<TTvmId, 10>(dsts.NextTok(';'))); + } + + return res; + } + + bool CheckBbEnvOverriding(EBlackboxEnv original, EBlackboxEnv override) noexcept; + + template <class T> + class TProtectedValue { + class TAssignOp { + public: + static void Assign(T& l, const T& r) { + l = r; + } + + template <typename U> + static void Assign(std::shared_ptr<U>& l, std::shared_ptr<U>& r) { + l.swap(r); + } + + template <typename U> + static void Assign(TIntrusiveConstPtr<U>& l, TIntrusiveConstPtr<U>& r) { + l.Swap(r); + } + }; + + public: + TProtectedValue() = default; + + TProtectedValue(T value) + : Value_(value) + { + } + + T Get() const { + with_lock (Lock_) { + return Value_; + } + } + + void Set(T o) { + with_lock (Lock_) { + TAssignOp::Assign(Value_, o); + } + } + + private: + T Value_; + mutable TAdaptiveLock Lock_; + }; +} diff --git a/library/cpp/tvmauth/client/mocked_updater.cpp b/library/cpp/tvmauth/client/mocked_updater.cpp index 54f94bc92a..6da02c43d1 100644 --- a/library/cpp/tvmauth/client/mocked_updater.cpp +++ b/library/cpp/tvmauth/client/mocked_updater.cpp @@ -1,60 +1,60 @@ -#include "mocked_updater.h" - -#include <library/cpp/tvmauth/unittest.h> - -namespace NTvmAuth { - TMockedUpdater::TSettings TMockedUpdater::TSettings::CreateDeafult() { - TMockedUpdater::TSettings res; - - res.SelfTvmId = 100500; - - res.Backends = { - { - /*.Alias_ = */ "my_dest", - /*.Id_ = */ 42, - /*.Value_ = */ "3:serv:CBAQ__________9_IgYIlJEGECo:O9-vbod_8czkKrpwJAZCI8UgOIhNr2xKPcS-LWALrVC224jga2nIT6vLiw6q3d6pAT60g9K7NB39LEmh7vMuePtUMjzuZuL-uJg17BsH2iTLCZSxDjWxbU9piA2T6u607jiSyiy-FI74pEPqkz7KKJ28aPsefuC1VUweGkYFzNY", - }, - }; - - res.BadBackends = { - { - /*.Alias_ = */ "my_bad_dest", - /*.Id_ = */ 43, - /*.Value_ = */ "Dst is not found", - }, - }; - - return res; - } - - TMockedUpdater::TMockedUpdater(const TSettings& settings) - : Roles_(settings.Roles) - { - SetServiceContext(MakeIntrusiveConst<TServiceContext>(TServiceContext::CheckingFactory( - settings.SelfTvmId, - NUnittest::TVMKNIFE_PUBLIC_KEYS))); - - SetBbEnv(settings.UserTicketEnv); - SetUserContext(NUnittest::TVMKNIFE_PUBLIC_KEYS); - - TServiceTickets::TMapIdStr tickets, errors; - TServiceTickets::TMapAliasId aliases; - - for (const TSettings::TTuple& t : settings.Backends) { - tickets[t.Id] = t.Value; - aliases[t.Alias] = t.Id; - } - for (const TSettings::TTuple& t : settings.BadBackends) { - errors[t.Id] = t.Value; - aliases[t.Alias] = t.Id; - } - - SetServiceTickets(MakeIntrusiveConst<TServiceTickets>( - std::move(tickets), - std::move(errors), - std::move(aliases))); - - SetUpdateTimeOfPublicKeys(TInstant::Now()); - SetUpdateTimeOfServiceTickets(TInstant::Now()); - } -} +#include "mocked_updater.h" + +#include <library/cpp/tvmauth/unittest.h> + +namespace NTvmAuth { + TMockedUpdater::TSettings TMockedUpdater::TSettings::CreateDeafult() { + TMockedUpdater::TSettings res; + + res.SelfTvmId = 100500; + + res.Backends = { + { + /*.Alias_ = */ "my_dest", + /*.Id_ = */ 42, + /*.Value_ = */ "3:serv:CBAQ__________9_IgYIlJEGECo:O9-vbod_8czkKrpwJAZCI8UgOIhNr2xKPcS-LWALrVC224jga2nIT6vLiw6q3d6pAT60g9K7NB39LEmh7vMuePtUMjzuZuL-uJg17BsH2iTLCZSxDjWxbU9piA2T6u607jiSyiy-FI74pEPqkz7KKJ28aPsefuC1VUweGkYFzNY", + }, + }; + + res.BadBackends = { + { + /*.Alias_ = */ "my_bad_dest", + /*.Id_ = */ 43, + /*.Value_ = */ "Dst is not found", + }, + }; + + return res; + } + + TMockedUpdater::TMockedUpdater(const TSettings& settings) + : Roles_(settings.Roles) + { + SetServiceContext(MakeIntrusiveConst<TServiceContext>(TServiceContext::CheckingFactory( + settings.SelfTvmId, + NUnittest::TVMKNIFE_PUBLIC_KEYS))); + + SetBbEnv(settings.UserTicketEnv); + SetUserContext(NUnittest::TVMKNIFE_PUBLIC_KEYS); + + TServiceTickets::TMapIdStr tickets, errors; + TServiceTickets::TMapAliasId aliases; + + for (const TSettings::TTuple& t : settings.Backends) { + tickets[t.Id] = t.Value; + aliases[t.Alias] = t.Id; + } + for (const TSettings::TTuple& t : settings.BadBackends) { + errors[t.Id] = t.Value; + aliases[t.Alias] = t.Id; + } + + SetServiceTickets(MakeIntrusiveConst<TServiceTickets>( + std::move(tickets), + std::move(errors), + std::move(aliases))); + + SetUpdateTimeOfPublicKeys(TInstant::Now()); + SetUpdateTimeOfServiceTickets(TInstant::Now()); + } +} diff --git a/library/cpp/tvmauth/client/mocked_updater.h b/library/cpp/tvmauth/client/mocked_updater.h index f8a6394f5f..d20cf5f53f 100644 --- a/library/cpp/tvmauth/client/mocked_updater.h +++ b/library/cpp/tvmauth/client/mocked_updater.h @@ -1,43 +1,43 @@ -#pragma once - -#include "misc/async_updater.h" - -namespace NTvmAuth { - class TMockedUpdater: public TAsyncUpdaterBase { - public: - struct TSettings { - struct TTuple { - TClientSettings::TAlias Alias; - TTvmId Id = 0; - TString Value; // ticket or error - }; - - TTvmId SelfTvmId = 0; - TVector<TTuple> Backends; - TVector<TTuple> BadBackends; - EBlackboxEnv UserTicketEnv = EBlackboxEnv::Test; - NRoles::TRolesPtr Roles; - - static TSettings CreateDeafult(); - }; - - TMockedUpdater(const TSettings& settings = TSettings::CreateDeafult()); - - TClientStatus GetStatus() const override { - return TClientStatus(); - } - - NRoles::TRolesPtr GetRoles() const override { - return Roles_; - } - - using TAsyncUpdaterBase::SetServiceContext; - using TAsyncUpdaterBase::SetServiceTickets; - using TAsyncUpdaterBase::SetUpdateTimeOfPublicKeys; - using TAsyncUpdaterBase::SetUpdateTimeOfServiceTickets; - using TAsyncUpdaterBase::SetUserContext; - - protected: - NRoles::TRolesPtr Roles_; - }; -} +#pragma once + +#include "misc/async_updater.h" + +namespace NTvmAuth { + class TMockedUpdater: public TAsyncUpdaterBase { + public: + struct TSettings { + struct TTuple { + TClientSettings::TAlias Alias; + TTvmId Id = 0; + TString Value; // ticket or error + }; + + TTvmId SelfTvmId = 0; + TVector<TTuple> Backends; + TVector<TTuple> BadBackends; + EBlackboxEnv UserTicketEnv = EBlackboxEnv::Test; + NRoles::TRolesPtr Roles; + + static TSettings CreateDeafult(); + }; + + TMockedUpdater(const TSettings& settings = TSettings::CreateDeafult()); + + TClientStatus GetStatus() const override { + return TClientStatus(); + } + + NRoles::TRolesPtr GetRoles() const override { + return Roles_; + } + + using TAsyncUpdaterBase::SetServiceContext; + using TAsyncUpdaterBase::SetServiceTickets; + using TAsyncUpdaterBase::SetUpdateTimeOfPublicKeys; + using TAsyncUpdaterBase::SetUpdateTimeOfServiceTickets; + using TAsyncUpdaterBase::SetUserContext; + + protected: + NRoles::TRolesPtr Roles_; + }; +} diff --git a/library/cpp/tvmauth/client/ut/async_updater_ut.cpp b/library/cpp/tvmauth/client/ut/async_updater_ut.cpp index 1c1e8cbaae..7bbe035225 100644 --- a/library/cpp/tvmauth/client/ut/async_updater_ut.cpp +++ b/library/cpp/tvmauth/client/ut/async_updater_ut.cpp @@ -1,165 +1,165 @@ -#include "common.h" - -#include <library/cpp/tvmauth/client/misc/async_updater.h> - -#include <library/cpp/tvmauth/unittest.h> - -#include <library/cpp/testing/unittest/registar.h> - -using namespace NTvmAuth; - -Y_UNIT_TEST_SUITE(AsyncUpdater) { - static const TString SRV_TICKET = "3:serv:CBAQ__________9_IgYIexCUkQY:GioCM49Ob6_f80y6FY0XBVN4hLXuMlFeyMvIMiDuQnZkbkLpRpQOuQo5YjWoBjM0Vf-XqOm8B7xtrvxSYHDD7Q4OatN2l-Iwg7i71lE3scUeD36x47st3nd0OThvtjrFx_D8mw_c0GT5KcniZlqq1SjhLyAk1b_zJsx8viRAhCU"; - static const TString PROD_TICKET = "3:user:CAsQ__________9_Gg4KAgh7EHsg0oXYzAQoAA:N8PvrDNLh-5JywinxJntLeQGDEHBUxfzjuvB8-_BEUv1x9CALU7do8irDlDYVeVVDr4AIpR087YPZVzWPAqmnBuRJS0tJXekmDDvrivLnbRrzY4IUXZ_fImB0fJhTyVetKv6RD11bGqnAJeDpIukBwPTbJc_EMvKDt8V490CJFw"; - static const TString TEST_TICKET = "3:user:CA0Q__________9_Gg4KAgh7EHsg0oXYzAQoAQ:FSADps3wNGm92Vyb1E9IVq5M6ZygdGdt1vafWWEhfDDeCLoVA-sJesxMl2pGW4OxJ8J1r_MfpG3ZoBk8rLVMHUFrPa6HheTbeXFAWl8quEniauXvKQe4VyrpA1SPgtRoFqi5upSDIJzEAe1YRJjq1EClQ_slMt8R0kA_JjKUX54"; - static const TString PROD_YATEAM_TICKET = "3:user:CAwQ__________9_Gg4KAgh7EHsg0oXYzAQoAg:M9dEFEWHLHXiL7brCsyfYlm254PE6VeshUjI62u2qMDRzt6-0jAoJTIdDiogerItht1YFYSn8fSqmMf23_rueGj-wkmvyNzbcBSk3jtK2U5sai_W0bK6OwukR9tzWzi1Gcgg9DrNEeIKFvs1EBqYCF4mPHWo5bgk0CR580Cgit4"; - static const TString TEST_YATEAM_TICKET = "3:user:CA4Q__________9_Gg4KAgh7EHsg0oXYzAQoAw:IlaV3htk3jYrviIOz3k3Dfwz7p-bYYpbrgdn53GiUrMGdrT9eobHeuzNvPLrWB0yuYZAD46C3MGxok4GGmHhT73mki4XOCX8yWT4jW_hzcHBik1442tjWwh8IWqV_7q5j5496suVuLWjnZORWbb7I-2iwdIlU1BUiDfhoAolCq8"; - static const TString STRESS_TICKET = "3:user:CA8Q__________9_Gg4KAgh7EHsg0oXYzAQoBA:GBuG_TLo6SL2OYFxp7Zly04HPNzmAF7Fu2E8E9SnwQDoxq9rf7VThSPtTmnBSAl5UVRRPkMsRtzzHZ87qtj6l-PvF0K7PrDu7-yS_xiFTgAl9sEfXAIHJVzZLoksGRgpoBtpBUg9vVaJsPns0kWFKJgq8M-Mk9agrSk7sb2VUeQ"; - - class TTestUpdater: public TAsyncUpdaterBase { - public: - using TAsyncUpdaterBase::SetBbEnv; - using TAsyncUpdaterBase::SetUserContext; - - TClientStatus GetStatus() const override { - return TClientStatus(); - } - }; - - Y_UNIT_TEST(User) { - TTestUpdater u; - - UNIT_ASSERT(!u.GetCachedUserContext()); - - u.SetUserContext(NUnittest::TVMKNIFE_PUBLIC_KEYS); - UNIT_ASSERT(!u.GetCachedUserContext()); - - UNIT_ASSERT_NO_EXCEPTION(u.SetBbEnv(EBlackboxEnv::Prod)); - UNIT_ASSERT(u.GetCachedUserContext()); - UNIT_ASSERT(u.GetCachedUserContext()->Check(PROD_TICKET)); - UNIT_ASSERT_NO_EXCEPTION(u.GetCachedUserContext(EBlackboxEnv::ProdYateam)); - UNIT_ASSERT(u.GetCachedUserContext(EBlackboxEnv::ProdYateam)->Check(PROD_YATEAM_TICKET)); - - UNIT_ASSERT_EXCEPTION_CONTAINS(u.SetBbEnv(EBlackboxEnv::Prod, EBlackboxEnv::Test), - TBrokenTvmClientSettings, - "Overriding of BlackboxEnv is illegal: Prod -> Test"); - UNIT_ASSERT_EXCEPTION_CONTAINS(u.GetCachedUserContext(EBlackboxEnv::Test), - TBrokenTvmClientSettings, - "Overriding of BlackboxEnv is illegal: Prod -> Test"); - - UNIT_ASSERT(u.GetCachedUserContext()); - UNIT_ASSERT(u.GetCachedUserContext()->Check(PROD_TICKET)); - } - - class DummyUpdater: public TAsyncUpdaterBase { - public: - TClientStatus GetStatus() const override { - return TClientStatus(); - } - - using TAsyncUpdaterBase::SetServiceContext; - using TAsyncUpdaterBase::SetServiceTickets; - using TAsyncUpdaterBase::SetUserContext; - }; - - Y_UNIT_TEST(Cache) { - DummyUpdater d; - - UNIT_ASSERT(!d.GetCachedServiceTickets()); - TServiceTicketsPtr st = MakeIntrusiveConst<TServiceTickets>(TServiceTickets::TMapIdStr(), - TServiceTickets::TMapIdStr(), - TServiceTickets::TMapAliasId()); - d.SetServiceTickets(st); - UNIT_ASSERT_EQUAL(st.Get(), d.GetCachedServiceTickets().Get()); - - UNIT_ASSERT(!d.GetCachedServiceContext()); - TServiceContextPtr sc = MakeIntrusiveConst<TServiceContext>(TServiceContext::SigningFactory("kjndfadfndsfafdasd")); - d.SetServiceContext(sc); - UNIT_ASSERT_EQUAL(sc.Get(), d.GetCachedServiceContext().Get()); - - UNIT_ASSERT(!d.GetCachedUserContext()); - d.SetUserContext(NUnittest::TVMKNIFE_PUBLIC_KEYS); - } - - Y_UNIT_TEST(ServiceTickets_Aliases) { - using TId = TServiceTickets::TMapIdStr; +#include "common.h" + +#include <library/cpp/tvmauth/client/misc/async_updater.h> + +#include <library/cpp/tvmauth/unittest.h> + +#include <library/cpp/testing/unittest/registar.h> + +using namespace NTvmAuth; + +Y_UNIT_TEST_SUITE(AsyncUpdater) { + static const TString SRV_TICKET = "3:serv:CBAQ__________9_IgYIexCUkQY:GioCM49Ob6_f80y6FY0XBVN4hLXuMlFeyMvIMiDuQnZkbkLpRpQOuQo5YjWoBjM0Vf-XqOm8B7xtrvxSYHDD7Q4OatN2l-Iwg7i71lE3scUeD36x47st3nd0OThvtjrFx_D8mw_c0GT5KcniZlqq1SjhLyAk1b_zJsx8viRAhCU"; + static const TString PROD_TICKET = "3:user:CAsQ__________9_Gg4KAgh7EHsg0oXYzAQoAA:N8PvrDNLh-5JywinxJntLeQGDEHBUxfzjuvB8-_BEUv1x9CALU7do8irDlDYVeVVDr4AIpR087YPZVzWPAqmnBuRJS0tJXekmDDvrivLnbRrzY4IUXZ_fImB0fJhTyVetKv6RD11bGqnAJeDpIukBwPTbJc_EMvKDt8V490CJFw"; + static const TString TEST_TICKET = "3:user:CA0Q__________9_Gg4KAgh7EHsg0oXYzAQoAQ:FSADps3wNGm92Vyb1E9IVq5M6ZygdGdt1vafWWEhfDDeCLoVA-sJesxMl2pGW4OxJ8J1r_MfpG3ZoBk8rLVMHUFrPa6HheTbeXFAWl8quEniauXvKQe4VyrpA1SPgtRoFqi5upSDIJzEAe1YRJjq1EClQ_slMt8R0kA_JjKUX54"; + static const TString PROD_YATEAM_TICKET = "3:user:CAwQ__________9_Gg4KAgh7EHsg0oXYzAQoAg:M9dEFEWHLHXiL7brCsyfYlm254PE6VeshUjI62u2qMDRzt6-0jAoJTIdDiogerItht1YFYSn8fSqmMf23_rueGj-wkmvyNzbcBSk3jtK2U5sai_W0bK6OwukR9tzWzi1Gcgg9DrNEeIKFvs1EBqYCF4mPHWo5bgk0CR580Cgit4"; + static const TString TEST_YATEAM_TICKET = "3:user:CA4Q__________9_Gg4KAgh7EHsg0oXYzAQoAw:IlaV3htk3jYrviIOz3k3Dfwz7p-bYYpbrgdn53GiUrMGdrT9eobHeuzNvPLrWB0yuYZAD46C3MGxok4GGmHhT73mki4XOCX8yWT4jW_hzcHBik1442tjWwh8IWqV_7q5j5496suVuLWjnZORWbb7I-2iwdIlU1BUiDfhoAolCq8"; + static const TString STRESS_TICKET = "3:user:CA8Q__________9_Gg4KAgh7EHsg0oXYzAQoBA:GBuG_TLo6SL2OYFxp7Zly04HPNzmAF7Fu2E8E9SnwQDoxq9rf7VThSPtTmnBSAl5UVRRPkMsRtzzHZ87qtj6l-PvF0K7PrDu7-yS_xiFTgAl9sEfXAIHJVzZLoksGRgpoBtpBUg9vVaJsPns0kWFKJgq8M-Mk9agrSk7sb2VUeQ"; + + class TTestUpdater: public TAsyncUpdaterBase { + public: + using TAsyncUpdaterBase::SetBbEnv; + using TAsyncUpdaterBase::SetUserContext; + + TClientStatus GetStatus() const override { + return TClientStatus(); + } + }; + + Y_UNIT_TEST(User) { + TTestUpdater u; + + UNIT_ASSERT(!u.GetCachedUserContext()); + + u.SetUserContext(NUnittest::TVMKNIFE_PUBLIC_KEYS); + UNIT_ASSERT(!u.GetCachedUserContext()); + + UNIT_ASSERT_NO_EXCEPTION(u.SetBbEnv(EBlackboxEnv::Prod)); + UNIT_ASSERT(u.GetCachedUserContext()); + UNIT_ASSERT(u.GetCachedUserContext()->Check(PROD_TICKET)); + UNIT_ASSERT_NO_EXCEPTION(u.GetCachedUserContext(EBlackboxEnv::ProdYateam)); + UNIT_ASSERT(u.GetCachedUserContext(EBlackboxEnv::ProdYateam)->Check(PROD_YATEAM_TICKET)); + + UNIT_ASSERT_EXCEPTION_CONTAINS(u.SetBbEnv(EBlackboxEnv::Prod, EBlackboxEnv::Test), + TBrokenTvmClientSettings, + "Overriding of BlackboxEnv is illegal: Prod -> Test"); + UNIT_ASSERT_EXCEPTION_CONTAINS(u.GetCachedUserContext(EBlackboxEnv::Test), + TBrokenTvmClientSettings, + "Overriding of BlackboxEnv is illegal: Prod -> Test"); + + UNIT_ASSERT(u.GetCachedUserContext()); + UNIT_ASSERT(u.GetCachedUserContext()->Check(PROD_TICKET)); + } + + class DummyUpdater: public TAsyncUpdaterBase { + public: + TClientStatus GetStatus() const override { + return TClientStatus(); + } + + using TAsyncUpdaterBase::SetServiceContext; + using TAsyncUpdaterBase::SetServiceTickets; + using TAsyncUpdaterBase::SetUserContext; + }; + + Y_UNIT_TEST(Cache) { + DummyUpdater d; + + UNIT_ASSERT(!d.GetCachedServiceTickets()); + TServiceTicketsPtr st = MakeIntrusiveConst<TServiceTickets>(TServiceTickets::TMapIdStr(), + TServiceTickets::TMapIdStr(), + TServiceTickets::TMapAliasId()); + d.SetServiceTickets(st); + UNIT_ASSERT_EQUAL(st.Get(), d.GetCachedServiceTickets().Get()); + + UNIT_ASSERT(!d.GetCachedServiceContext()); + TServiceContextPtr sc = MakeIntrusiveConst<TServiceContext>(TServiceContext::SigningFactory("kjndfadfndsfafdasd")); + d.SetServiceContext(sc); + UNIT_ASSERT_EQUAL(sc.Get(), d.GetCachedServiceContext().Get()); + + UNIT_ASSERT(!d.GetCachedUserContext()); + d.SetUserContext(NUnittest::TVMKNIFE_PUBLIC_KEYS); + } + + Y_UNIT_TEST(ServiceTickets_Aliases) { + using TId = TServiceTickets::TMapIdStr; using TUnfetchedId = TServiceTickets::TIdSet; - using TStr = TServiceTickets::TMapAliasStr; + using TStr = TServiceTickets::TMapAliasStr; using TUnfetchedAlias = TServiceTickets::TAliasSet; - using TAls = TServiceTickets::TMapAliasId; - TServiceTickets t(TId{}, TId{}, TAls{}); - - UNIT_ASSERT_NO_EXCEPTION(t = TServiceTickets(TId({{1, "t1"}, {2, "t2"}}), - TId({{3, "e1"}}), - TAls())); - UNIT_ASSERT_EQUAL(TId({{1, "t1"}, {2, "t2"}}), t.TicketsById); - UNIT_ASSERT_EQUAL(TId({{3, "e1"}}), t.ErrorsById); - UNIT_ASSERT_EQUAL(TStr(), t.TicketsByAlias); - UNIT_ASSERT_EQUAL(TStr(), t.ErrorsByAlias); - - UNIT_ASSERT_NO_EXCEPTION(t = TServiceTickets(TId({{1, "t1"}, {2, "t2"}}), - TId({{3, "e1"}}), - TAls({{"1", 1}, {"2", 2}, {"3", 3}}))); - UNIT_ASSERT_EQUAL(TId({{1, "t1"}, {2, "t2"}}), t.TicketsById); - UNIT_ASSERT_EQUAL(TId({{3, "e1"}}), t.ErrorsById); - UNIT_ASSERT_EQUAL(TUnfetchedId(), t.UnfetchedIds); - UNIT_ASSERT_EQUAL(TStr({{"1", "t1"}, {"2", "t2"}}), t.TicketsByAlias); - UNIT_ASSERT_EQUAL(TStr({{"3", "e1"}}), t.ErrorsByAlias); - UNIT_ASSERT_EQUAL(TUnfetchedAlias({}), t.UnfetchedAliases); + using TAls = TServiceTickets::TMapAliasId; + TServiceTickets t(TId{}, TId{}, TAls{}); + + UNIT_ASSERT_NO_EXCEPTION(t = TServiceTickets(TId({{1, "t1"}, {2, "t2"}}), + TId({{3, "e1"}}), + TAls())); + UNIT_ASSERT_EQUAL(TId({{1, "t1"}, {2, "t2"}}), t.TicketsById); + UNIT_ASSERT_EQUAL(TId({{3, "e1"}}), t.ErrorsById); + UNIT_ASSERT_EQUAL(TStr(), t.TicketsByAlias); + UNIT_ASSERT_EQUAL(TStr(), t.ErrorsByAlias); + + UNIT_ASSERT_NO_EXCEPTION(t = TServiceTickets(TId({{1, "t1"}, {2, "t2"}}), + TId({{3, "e1"}}), + TAls({{"1", 1}, {"2", 2}, {"3", 3}}))); + UNIT_ASSERT_EQUAL(TId({{1, "t1"}, {2, "t2"}}), t.TicketsById); + UNIT_ASSERT_EQUAL(TId({{3, "e1"}}), t.ErrorsById); + UNIT_ASSERT_EQUAL(TUnfetchedId(), t.UnfetchedIds); + UNIT_ASSERT_EQUAL(TStr({{"1", "t1"}, {"2", "t2"}}), t.TicketsByAlias); + UNIT_ASSERT_EQUAL(TStr({{"3", "e1"}}), t.ErrorsByAlias); + UNIT_ASSERT_EQUAL(TUnfetchedAlias({}), t.UnfetchedAliases); } - + Y_UNIT_TEST(ServiceTickets_UnfetchedIds) { using TId = TServiceTickets::TMapIdStr; using TUnfetchedId = TServiceTickets::TIdSet; using TStr = TServiceTickets::TMapAliasStr; using TUnfetchedAlias = TServiceTickets::TAliasSet; using TAls = TServiceTickets::TMapAliasId; - TServiceTickets t(TId({{1, "t1"}, {2, "t2"}}), - TId(), - TAls({{"1", 1}, {"2", 2}, {"3", 3}})); - - UNIT_ASSERT_EQUAL(TId({{1, "t1"}, {2, "t2"}}), t.TicketsById); - UNIT_ASSERT_EQUAL(TId({}), t.ErrorsById); - UNIT_ASSERT_EQUAL(TUnfetchedId({3}), t.UnfetchedIds); - UNIT_ASSERT_EQUAL(TUnfetchedAlias({{"3"}}), t.UnfetchedAliases); - UNIT_ASSERT_EQUAL(TStr({{"1", "t1"}, {"2", "t2"}}), t.TicketsByAlias); - UNIT_ASSERT_EQUAL(TStr(), t.ErrorsByAlias); - } - - Y_UNIT_TEST(ServiceTickets_InvalidationTime) { - using TId = TServiceTickets::TMapIdStr; - using TAls = TServiceTickets::TMapAliasId; - - TServiceTickets t(TId{}, TId{}, TAls{}); - UNIT_ASSERT_VALUES_EQUAL(TInstant(), t.InvalidationTime); - - UNIT_ASSERT_NO_EXCEPTION(t = TServiceTickets(TId({{1, SRV_TICKET}}), - TId(), - TAls())); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(std::numeric_limits<time_t>::max()), t.InvalidationTime); - - UNIT_ASSERT_NO_EXCEPTION(t = TServiceTickets(TId({ - {1, SRV_TICKET}, - {2, "serv"}, - }), - TId(), - TAls())); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(std::numeric_limits<time_t>::max()), t.InvalidationTime); - - UNIT_ASSERT_NO_EXCEPTION(t = TServiceTickets(TId({ - {2, "serv"}, - }), - TId(), - TAls())); - UNIT_ASSERT_VALUES_EQUAL(TInstant(), t.InvalidationTime); - - UNIT_ASSERT_NO_EXCEPTION(t = TServiceTickets(TId({ - {1, SRV_TICKET}, - {2, "serv"}, - {3, "3:serv:CBAQeyIECAMQAw:TiZjG2Ut9j-9n0zcqxGW8xiYmnFa-i10-dbA0FKIInKzeDuueovWVEBcgbQHndblzRCxoIBMgbotOf7ALk2xoSBnRbOKomAIEtiTBL77GByL5O8K_HUGNYb-ygqnmZlIuLalgeRQAdsKstgUwQzufnOQyekipmamwo7EVQhr8Ug"}, - }), - TId(), - TAls())); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(123), t.InvalidationTime); - } -} + TServiceTickets t(TId({{1, "t1"}, {2, "t2"}}), + TId(), + TAls({{"1", 1}, {"2", 2}, {"3", 3}})); + + UNIT_ASSERT_EQUAL(TId({{1, "t1"}, {2, "t2"}}), t.TicketsById); + UNIT_ASSERT_EQUAL(TId({}), t.ErrorsById); + UNIT_ASSERT_EQUAL(TUnfetchedId({3}), t.UnfetchedIds); + UNIT_ASSERT_EQUAL(TUnfetchedAlias({{"3"}}), t.UnfetchedAliases); + UNIT_ASSERT_EQUAL(TStr({{"1", "t1"}, {"2", "t2"}}), t.TicketsByAlias); + UNIT_ASSERT_EQUAL(TStr(), t.ErrorsByAlias); + } + + Y_UNIT_TEST(ServiceTickets_InvalidationTime) { + using TId = TServiceTickets::TMapIdStr; + using TAls = TServiceTickets::TMapAliasId; + + TServiceTickets t(TId{}, TId{}, TAls{}); + UNIT_ASSERT_VALUES_EQUAL(TInstant(), t.InvalidationTime); + + UNIT_ASSERT_NO_EXCEPTION(t = TServiceTickets(TId({{1, SRV_TICKET}}), + TId(), + TAls())); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(std::numeric_limits<time_t>::max()), t.InvalidationTime); + + UNIT_ASSERT_NO_EXCEPTION(t = TServiceTickets(TId({ + {1, SRV_TICKET}, + {2, "serv"}, + }), + TId(), + TAls())); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(std::numeric_limits<time_t>::max()), t.InvalidationTime); + + UNIT_ASSERT_NO_EXCEPTION(t = TServiceTickets(TId({ + {2, "serv"}, + }), + TId(), + TAls())); + UNIT_ASSERT_VALUES_EQUAL(TInstant(), t.InvalidationTime); + + UNIT_ASSERT_NO_EXCEPTION(t = TServiceTickets(TId({ + {1, SRV_TICKET}, + {2, "serv"}, + {3, "3:serv:CBAQeyIECAMQAw:TiZjG2Ut9j-9n0zcqxGW8xiYmnFa-i10-dbA0FKIInKzeDuueovWVEBcgbQHndblzRCxoIBMgbotOf7ALk2xoSBnRbOKomAIEtiTBL77GByL5O8K_HUGNYb-ygqnmZlIuLalgeRQAdsKstgUwQzufnOQyekipmamwo7EVQhr8Ug"}, + }), + TId(), + TAls())); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(123), t.InvalidationTime); + } +} diff --git a/library/cpp/tvmauth/client/ut/checker_ut.cpp b/library/cpp/tvmauth/client/ut/checker_ut.cpp index 54a25974c1..21d303f649 100644 --- a/library/cpp/tvmauth/client/ut/checker_ut.cpp +++ b/library/cpp/tvmauth/client/ut/checker_ut.cpp @@ -1,176 +1,176 @@ -#include "common.h" - -#include <library/cpp/tvmauth/client/mocked_updater.h> -#include <library/cpp/tvmauth/client/misc/checker.h> -#include <library/cpp/tvmauth/client/misc/getter.h> -#include <library/cpp/tvmauth/client/misc/api/threaded_updater.h> - -#include <library/cpp/tvmauth/type.h> - +#include "common.h" + +#include <library/cpp/tvmauth/client/mocked_updater.h> +#include <library/cpp/tvmauth/client/misc/checker.h> +#include <library/cpp/tvmauth/client/misc/getter.h> +#include <library/cpp/tvmauth/client/misc/api/threaded_updater.h> + +#include <library/cpp/tvmauth/type.h> + #include <library/cpp/testing/unittest/registar.h> - -using namespace NTvmAuth; - + +using namespace NTvmAuth; + Y_UNIT_TEST_SUITE(ClientChecker) { - static const TTvmId OK_CLIENT = 100500; - static const TString PROD_TICKET = "3:user:CAsQ__________9_Gg4KAgh7EHsg0oXYzAQoAA:N8PvrDNLh-5JywinxJntLeQGDEHBUxfzjuvB8-_BEUv1x9CALU7do8irDlDYVeVVDr4AIpR087YPZVzWPAqmnBuRJS0tJXekmDDvrivLnbRrzY4IUXZ_fImB0fJhTyVetKv6RD11bGqnAJeDpIukBwPTbJc_EMvKDt8V490CJFw"; - static const TString TEST_TICKET = "3:user:CA0Q__________9_Gg4KAgh7EHsg0oXYzAQoAQ:FSADps3wNGm92Vyb1E9IVq5M6ZygdGdt1vafWWEhfDDeCLoVA-sJesxMl2pGW4OxJ8J1r_MfpG3ZoBk8rLVMHUFrPa6HheTbeXFAWl8quEniauXvKQe4VyrpA1SPgtRoFqi5upSDIJzEAe1YRJjq1EClQ_slMt8R0kA_JjKUX54"; - static const TString PROD_YATEAM_TICKET = "3:user:CAwQ__________9_Gg4KAgh7EHsg0oXYzAQoAg:M9dEFEWHLHXiL7brCsyfYlm254PE6VeshUjI62u2qMDRzt6-0jAoJTIdDiogerItht1YFYSn8fSqmMf23_rueGj-wkmvyNzbcBSk3jtK2U5sai_W0bK6OwukR9tzWzi1Gcgg9DrNEeIKFvs1EBqYCF4mPHWo5bgk0CR580Cgit4"; - static const TString TEST_YATEAM_TICKET = "3:user:CA4Q__________9_Gg4KAgh7EHsg0oXYzAQoAw:IlaV3htk3jYrviIOz3k3Dfwz7p-bYYpbrgdn53GiUrMGdrT9eobHeuzNvPLrWB0yuYZAD46C3MGxok4GGmHhT73mki4XOCX8yWT4jW_hzcHBik1442tjWwh8IWqV_7q5j5496suVuLWjnZORWbb7I-2iwdIlU1BUiDfhoAolCq8"; - static const TString STRESS_TICKET = "3:user:CA8Q__________9_Gg4KAgh7EHsg0oXYzAQoBA:GBuG_TLo6SL2OYFxp7Zly04HPNzmAF7Fu2E8E9SnwQDoxq9rf7VThSPtTmnBSAl5UVRRPkMsRtzzHZ87qtj6l-PvF0K7PrDu7-yS_xiFTgAl9sEfXAIHJVzZLoksGRgpoBtpBUg9vVaJsPns0kWFKJgq8M-Mk9agrSk7sb2VUeQ"; - static const TString SRV_TICKET = "3:serv:CBAQ__________9_IgYIexCUkQY:GioCM49Ob6_f80y6FY0XBVN4hLXuMlFeyMvIMiDuQnZkbkLpRpQOuQo5YjWoBjM0Vf-XqOm8B7xtrvxSYHDD7Q4OatN2l-Iwg7i71lE3scUeD36x47st3nd0OThvtjrFx_D8mw_c0GT5KcniZlqq1SjhLyAk1b_zJsx8viRAhCU"; - + static const TTvmId OK_CLIENT = 100500; + static const TString PROD_TICKET = "3:user:CAsQ__________9_Gg4KAgh7EHsg0oXYzAQoAA:N8PvrDNLh-5JywinxJntLeQGDEHBUxfzjuvB8-_BEUv1x9CALU7do8irDlDYVeVVDr4AIpR087YPZVzWPAqmnBuRJS0tJXekmDDvrivLnbRrzY4IUXZ_fImB0fJhTyVetKv6RD11bGqnAJeDpIukBwPTbJc_EMvKDt8V490CJFw"; + static const TString TEST_TICKET = "3:user:CA0Q__________9_Gg4KAgh7EHsg0oXYzAQoAQ:FSADps3wNGm92Vyb1E9IVq5M6ZygdGdt1vafWWEhfDDeCLoVA-sJesxMl2pGW4OxJ8J1r_MfpG3ZoBk8rLVMHUFrPa6HheTbeXFAWl8quEniauXvKQe4VyrpA1SPgtRoFqi5upSDIJzEAe1YRJjq1EClQ_slMt8R0kA_JjKUX54"; + static const TString PROD_YATEAM_TICKET = "3:user:CAwQ__________9_Gg4KAgh7EHsg0oXYzAQoAg:M9dEFEWHLHXiL7brCsyfYlm254PE6VeshUjI62u2qMDRzt6-0jAoJTIdDiogerItht1YFYSn8fSqmMf23_rueGj-wkmvyNzbcBSk3jtK2U5sai_W0bK6OwukR9tzWzi1Gcgg9DrNEeIKFvs1EBqYCF4mPHWo5bgk0CR580Cgit4"; + static const TString TEST_YATEAM_TICKET = "3:user:CA4Q__________9_Gg4KAgh7EHsg0oXYzAQoAw:IlaV3htk3jYrviIOz3k3Dfwz7p-bYYpbrgdn53GiUrMGdrT9eobHeuzNvPLrWB0yuYZAD46C3MGxok4GGmHhT73mki4XOCX8yWT4jW_hzcHBik1442tjWwh8IWqV_7q5j5496suVuLWjnZORWbb7I-2iwdIlU1BUiDfhoAolCq8"; + static const TString STRESS_TICKET = "3:user:CA8Q__________9_Gg4KAgh7EHsg0oXYzAQoBA:GBuG_TLo6SL2OYFxp7Zly04HPNzmAF7Fu2E8E9SnwQDoxq9rf7VThSPtTmnBSAl5UVRRPkMsRtzzHZ87qtj6l-PvF0K7PrDu7-yS_xiFTgAl9sEfXAIHJVzZLoksGRgpoBtpBUg9vVaJsPns0kWFKJgq8M-Mk9agrSk7sb2VUeQ"; + static const TString SRV_TICKET = "3:serv:CBAQ__________9_IgYIexCUkQY:GioCM49Ob6_f80y6FY0XBVN4hLXuMlFeyMvIMiDuQnZkbkLpRpQOuQo5YjWoBjM0Vf-XqOm8B7xtrvxSYHDD7Q4OatN2l-Iwg7i71lE3scUeD36x47st3nd0OThvtjrFx_D8mw_c0GT5KcniZlqq1SjhLyAk1b_zJsx8viRAhCU"; + Y_UNIT_TEST(User) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(OK_CLIENT); - s.EnableServiceTicketChecking(); - s.SetDiskCacheDir(GetCachePath()); - - auto l = MakeIntrusive<TLogger>(); - { - auto u = NTvmApi::TThreadedUpdater::Create(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); - UNIT_ASSERT_EXCEPTION(TUserTicketChecker(u), TBrokenTvmClientSettings); - } - UNIT_ASSERT_C(l->Stream.Str().find("was successfully fetched") == TString::npos, l->Stream.Str()); - - s.EnableUserTicketChecking(EBlackboxEnv::Prod); - { - auto u = NTvmApi::TThreadedUpdater::Create(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); - TUserTicketChecker c(u); - UNIT_ASSERT(c.Check(PROD_TICKET, {})); - UNIT_ASSERT(!c.Check(TEST_TICKET, {})); - UNIT_ASSERT(!c.Check(PROD_YATEAM_TICKET, {})); - UNIT_ASSERT(!c.Check(TEST_YATEAM_TICKET, {})); - UNIT_ASSERT(!c.Check(STRESS_TICKET, {})); - - UNIT_ASSERT(!c.Check(PROD_TICKET, EBlackboxEnv::ProdYateam)); - UNIT_ASSERT(!c.Check(TEST_TICKET, EBlackboxEnv::ProdYateam)); - UNIT_ASSERT(c.Check(PROD_YATEAM_TICKET, EBlackboxEnv::ProdYateam)); - UNIT_ASSERT(!c.Check(TEST_YATEAM_TICKET, EBlackboxEnv::ProdYateam)); - UNIT_ASSERT(!c.Check(STRESS_TICKET, EBlackboxEnv::ProdYateam)); - - UNIT_ASSERT_EXCEPTION(c.Check(PROD_TICKET, EBlackboxEnv::Stress), TBrokenTvmClientSettings); - } - - s.EnableUserTicketChecking(EBlackboxEnv::Test); - { - auto u = NTvmApi::TThreadedUpdater::Create(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); - TUserTicketChecker c(u); - UNIT_ASSERT(!c.Check(PROD_TICKET, {})); - UNIT_ASSERT(c.Check(TEST_TICKET, {})); - UNIT_ASSERT(!c.Check(PROD_YATEAM_TICKET, {})); - UNIT_ASSERT(!c.Check(TEST_YATEAM_TICKET, {})); - UNIT_ASSERT(!c.Check(STRESS_TICKET, {})); - } - - s.EnableUserTicketChecking(EBlackboxEnv::ProdYateam); - { - auto u = NTvmApi::TThreadedUpdater::Create(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); - TUserTicketChecker c(u); - UNIT_ASSERT(!c.Check(PROD_TICKET, {})); - UNIT_ASSERT(!c.Check(TEST_TICKET, {})); - UNIT_ASSERT(c.Check(PROD_YATEAM_TICKET, {})); - UNIT_ASSERT(!c.Check(TEST_YATEAM_TICKET, {})); - UNIT_ASSERT(!c.Check(STRESS_TICKET, {})); - } - - s.EnableUserTicketChecking(EBlackboxEnv::TestYateam); - { - auto u = NTvmApi::TThreadedUpdater::Create(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); - TUserTicketChecker c(u); - UNIT_ASSERT(!c.Check(PROD_TICKET, {})); - UNIT_ASSERT(!c.Check(TEST_TICKET, {})); - UNIT_ASSERT(!c.Check(PROD_YATEAM_TICKET, {})); - UNIT_ASSERT(c.Check(TEST_YATEAM_TICKET, {})); - UNIT_ASSERT(!c.Check(STRESS_TICKET, {})); - } - - s.EnableUserTicketChecking(EBlackboxEnv::Stress); - { - auto u = NTvmApi::TThreadedUpdater::Create(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); - TUserTicketChecker c(u); - UNIT_ASSERT(c.Check(PROD_TICKET, {})); - UNIT_ASSERT(!c.Check(TEST_TICKET, {})); - UNIT_ASSERT(!c.Check(PROD_YATEAM_TICKET, {})); - UNIT_ASSERT(!c.Check(TEST_YATEAM_TICKET, {})); - UNIT_ASSERT(c.Check(STRESS_TICKET, {})); - } - } - + NTvmApi::TClientSettings s; + s.SetSelfTvmId(OK_CLIENT); + s.EnableServiceTicketChecking(); + s.SetDiskCacheDir(GetCachePath()); + + auto l = MakeIntrusive<TLogger>(); + { + auto u = NTvmApi::TThreadedUpdater::Create(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); + UNIT_ASSERT_EXCEPTION(TUserTicketChecker(u), TBrokenTvmClientSettings); + } + UNIT_ASSERT_C(l->Stream.Str().find("was successfully fetched") == TString::npos, l->Stream.Str()); + + s.EnableUserTicketChecking(EBlackboxEnv::Prod); + { + auto u = NTvmApi::TThreadedUpdater::Create(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); + TUserTicketChecker c(u); + UNIT_ASSERT(c.Check(PROD_TICKET, {})); + UNIT_ASSERT(!c.Check(TEST_TICKET, {})); + UNIT_ASSERT(!c.Check(PROD_YATEAM_TICKET, {})); + UNIT_ASSERT(!c.Check(TEST_YATEAM_TICKET, {})); + UNIT_ASSERT(!c.Check(STRESS_TICKET, {})); + + UNIT_ASSERT(!c.Check(PROD_TICKET, EBlackboxEnv::ProdYateam)); + UNIT_ASSERT(!c.Check(TEST_TICKET, EBlackboxEnv::ProdYateam)); + UNIT_ASSERT(c.Check(PROD_YATEAM_TICKET, EBlackboxEnv::ProdYateam)); + UNIT_ASSERT(!c.Check(TEST_YATEAM_TICKET, EBlackboxEnv::ProdYateam)); + UNIT_ASSERT(!c.Check(STRESS_TICKET, EBlackboxEnv::ProdYateam)); + + UNIT_ASSERT_EXCEPTION(c.Check(PROD_TICKET, EBlackboxEnv::Stress), TBrokenTvmClientSettings); + } + + s.EnableUserTicketChecking(EBlackboxEnv::Test); + { + auto u = NTvmApi::TThreadedUpdater::Create(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); + TUserTicketChecker c(u); + UNIT_ASSERT(!c.Check(PROD_TICKET, {})); + UNIT_ASSERT(c.Check(TEST_TICKET, {})); + UNIT_ASSERT(!c.Check(PROD_YATEAM_TICKET, {})); + UNIT_ASSERT(!c.Check(TEST_YATEAM_TICKET, {})); + UNIT_ASSERT(!c.Check(STRESS_TICKET, {})); + } + + s.EnableUserTicketChecking(EBlackboxEnv::ProdYateam); + { + auto u = NTvmApi::TThreadedUpdater::Create(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); + TUserTicketChecker c(u); + UNIT_ASSERT(!c.Check(PROD_TICKET, {})); + UNIT_ASSERT(!c.Check(TEST_TICKET, {})); + UNIT_ASSERT(c.Check(PROD_YATEAM_TICKET, {})); + UNIT_ASSERT(!c.Check(TEST_YATEAM_TICKET, {})); + UNIT_ASSERT(!c.Check(STRESS_TICKET, {})); + } + + s.EnableUserTicketChecking(EBlackboxEnv::TestYateam); + { + auto u = NTvmApi::TThreadedUpdater::Create(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); + TUserTicketChecker c(u); + UNIT_ASSERT(!c.Check(PROD_TICKET, {})); + UNIT_ASSERT(!c.Check(TEST_TICKET, {})); + UNIT_ASSERT(!c.Check(PROD_YATEAM_TICKET, {})); + UNIT_ASSERT(c.Check(TEST_YATEAM_TICKET, {})); + UNIT_ASSERT(!c.Check(STRESS_TICKET, {})); + } + + s.EnableUserTicketChecking(EBlackboxEnv::Stress); + { + auto u = NTvmApi::TThreadedUpdater::Create(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); + TUserTicketChecker c(u); + UNIT_ASSERT(c.Check(PROD_TICKET, {})); + UNIT_ASSERT(!c.Check(TEST_TICKET, {})); + UNIT_ASSERT(!c.Check(PROD_YATEAM_TICKET, {})); + UNIT_ASSERT(!c.Check(TEST_YATEAM_TICKET, {})); + UNIT_ASSERT(c.Check(STRESS_TICKET, {})); + } + } + Y_UNIT_TEST(Service) { - NTvmApi::TClientSettings s; - s.EnableUserTicketChecking(EBlackboxEnv::Stress); - s.SetSelfTvmId(OK_CLIENT); - s.SetDiskCacheDir(GetCachePath()); - - auto l = MakeIntrusive<TLogger>(); - { - auto u = NTvmApi::TThreadedUpdater::Create(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); - UNIT_ASSERT_EXCEPTION(TServiceTicketChecker(u), TBrokenTvmClientSettings); - } - UNIT_ASSERT_C(l->Stream.Str().find("was successfully fetched") == TString::npos, l->Stream.Str()); - - s.EnableServiceTicketChecking(); - l = MakeIntrusive<TLogger>(); - { - auto u = NTvmApi::TThreadedUpdater::Create(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); - TServiceTicketChecker c(u); - UNIT_ASSERT(c.Check(SRV_TICKET)); - UNIT_ASSERT(!c.Check(PROD_TICKET)); - } - UNIT_ASSERT_C(l->Stream.Str().find("was successfully fetched") == TString::npos, l->Stream.Str()); - - s.SetSelfTvmId(17); - l = MakeIntrusive<TLogger>(); - { - auto u = NTvmApi::TThreadedUpdater::Create(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); - TServiceTicketChecker c(u); - UNIT_ASSERT(!c.Check(SRV_TICKET)); - UNIT_ASSERT(!c.Check(PROD_TICKET)); - } - UNIT_ASSERT_C(l->Stream.Str().find("was successfully fetched") == TString::npos, l->Stream.Str()); - } - + NTvmApi::TClientSettings s; + s.EnableUserTicketChecking(EBlackboxEnv::Stress); + s.SetSelfTvmId(OK_CLIENT); + s.SetDiskCacheDir(GetCachePath()); + + auto l = MakeIntrusive<TLogger>(); + { + auto u = NTvmApi::TThreadedUpdater::Create(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); + UNIT_ASSERT_EXCEPTION(TServiceTicketChecker(u), TBrokenTvmClientSettings); + } + UNIT_ASSERT_C(l->Stream.Str().find("was successfully fetched") == TString::npos, l->Stream.Str()); + + s.EnableServiceTicketChecking(); + l = MakeIntrusive<TLogger>(); + { + auto u = NTvmApi::TThreadedUpdater::Create(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); + TServiceTicketChecker c(u); + UNIT_ASSERT(c.Check(SRV_TICKET)); + UNIT_ASSERT(!c.Check(PROD_TICKET)); + } + UNIT_ASSERT_C(l->Stream.Str().find("was successfully fetched") == TString::npos, l->Stream.Str()); + + s.SetSelfTvmId(17); + l = MakeIntrusive<TLogger>(); + { + auto u = NTvmApi::TThreadedUpdater::Create(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); + TServiceTicketChecker c(u); + UNIT_ASSERT(!c.Check(SRV_TICKET)); + UNIT_ASSERT(!c.Check(PROD_TICKET)); + } + UNIT_ASSERT_C(l->Stream.Str().find("was successfully fetched") == TString::npos, l->Stream.Str()); + } + Y_UNIT_TEST(Tickets) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(OK_CLIENT); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); - s.SetDiskCacheDir(GetCachePath()); - - auto l = MakeIntrusive<TLogger>(); - { - auto u = NTvmApi::TThreadedUpdater::Create(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); - TServiceTicketGetter g(u); - UNIT_ASSERT_VALUES_EQUAL("3:serv:CBAQ__________9_IgYIKhCUkQY:CX", g.GetTicket("blackbox")); - UNIT_ASSERT_EXCEPTION_CONTAINS(g.GetTicket("blackbox2"), - TBrokenTvmClientSettings, - "Destination 'blackbox2' was not specified in settings. Check your settings (if you use Qloud/YP/tvmtool - check it's settings)"); - } - UNIT_ASSERT_C(l->Stream.Str().find("was successfully fetched") == TString::npos, l->Stream.Str()); - } - - Y_UNIT_TEST(ErrorForDst) { - TServiceTicketGetter g(new TMockedUpdater); - - UNIT_ASSERT_VALUES_EQUAL(TMockedUpdater::TSettings::CreateDeafult().Backends.at(0).Value, - g.GetTicket("my_dest")); - UNIT_ASSERT_VALUES_EQUAL(TMockedUpdater::TSettings::CreateDeafult().Backends.at(0).Value, - g.GetTicket(42)); - UNIT_ASSERT_EXCEPTION_CONTAINS(g.GetTicket("my_bad_dest"), - TMissingServiceTicket, - "Failed to get ticket for 'my_bad_dest': Dst is not found"); - UNIT_ASSERT_EXCEPTION_CONTAINS(g.GetTicket(43), - TMissingServiceTicket, - "Failed to get ticket for '43': Dst is not found"); - } -} + NTvmApi::TClientSettings s; + s.SetSelfTvmId(OK_CLIENT); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); + s.SetDiskCacheDir(GetCachePath()); + + auto l = MakeIntrusive<TLogger>(); + { + auto u = NTvmApi::TThreadedUpdater::Create(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus().GetCode()); + TServiceTicketGetter g(u); + UNIT_ASSERT_VALUES_EQUAL("3:serv:CBAQ__________9_IgYIKhCUkQY:CX", g.GetTicket("blackbox")); + UNIT_ASSERT_EXCEPTION_CONTAINS(g.GetTicket("blackbox2"), + TBrokenTvmClientSettings, + "Destination 'blackbox2' was not specified in settings. Check your settings (if you use Qloud/YP/tvmtool - check it's settings)"); + } + UNIT_ASSERT_C(l->Stream.Str().find("was successfully fetched") == TString::npos, l->Stream.Str()); + } + + Y_UNIT_TEST(ErrorForDst) { + TServiceTicketGetter g(new TMockedUpdater); + + UNIT_ASSERT_VALUES_EQUAL(TMockedUpdater::TSettings::CreateDeafult().Backends.at(0).Value, + g.GetTicket("my_dest")); + UNIT_ASSERT_VALUES_EQUAL(TMockedUpdater::TSettings::CreateDeafult().Backends.at(0).Value, + g.GetTicket(42)); + UNIT_ASSERT_EXCEPTION_CONTAINS(g.GetTicket("my_bad_dest"), + TMissingServiceTicket, + "Failed to get ticket for 'my_bad_dest': Dst is not found"); + UNIT_ASSERT_EXCEPTION_CONTAINS(g.GetTicket(43), + TMissingServiceTicket, + "Failed to get ticket for '43': Dst is not found"); + } +} diff --git a/library/cpp/tvmauth/client/ut/client_status_ut.cpp b/library/cpp/tvmauth/client/ut/client_status_ut.cpp index a1c3ae74ce..53d0dc3cf9 100644 --- a/library/cpp/tvmauth/client/ut/client_status_ut.cpp +++ b/library/cpp/tvmauth/client/ut/client_status_ut.cpp @@ -1,18 +1,18 @@ -#include <library/cpp/tvmauth/client/client_status.h> - -#include <library/cpp/testing/unittest/registar.h> - -using namespace NTvmAuth; - -Y_UNIT_TEST_SUITE(ClientStatus) { - Y_UNIT_TEST(Common) { - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, TClientStatus().GetCode()); - UNIT_ASSERT_VALUES_EQUAL("", TClientStatus().GetLastError()); - - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Warning, TClientStatus(TClientStatus::Warning, "kek")); - UNIT_ASSERT_VALUES_EQUAL("kek", - TClientStatus(TClientStatus::Warning, "kek").GetLastError()); - UNIT_ASSERT_VALUES_EQUAL("2;TvmClient: kek\n", - TClientStatus(TClientStatus::Error, "kek").CreateJugglerMessage()); - } -} +#include <library/cpp/tvmauth/client/client_status.h> + +#include <library/cpp/testing/unittest/registar.h> + +using namespace NTvmAuth; + +Y_UNIT_TEST_SUITE(ClientStatus) { + Y_UNIT_TEST(Common) { + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, TClientStatus().GetCode()); + UNIT_ASSERT_VALUES_EQUAL("", TClientStatus().GetLastError()); + + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Warning, TClientStatus(TClientStatus::Warning, "kek")); + UNIT_ASSERT_VALUES_EQUAL("kek", + TClientStatus(TClientStatus::Warning, "kek").GetLastError()); + UNIT_ASSERT_VALUES_EQUAL("2;TvmClient: kek\n", + TClientStatus(TClientStatus::Error, "kek").CreateJugglerMessage()); + } +} diff --git a/library/cpp/tvmauth/client/ut/common.h b/library/cpp/tvmauth/client/ut/common.h index 5dddc182b5..c2f577d72d 100644 --- a/library/cpp/tvmauth/client/ut/common.h +++ b/library/cpp/tvmauth/client/ut/common.h @@ -1,232 +1,232 @@ -#pragma once - -#include <library/cpp/tvmauth/client/logger.h> -#include <library/cpp/tvmauth/client/misc/disk_cache.h> -#include <library/cpp/tvmauth/client/misc/roles/entities_index.h> - -#include <library/cpp/tvmauth/unittest.h> - +#pragma once + +#include <library/cpp/tvmauth/client/logger.h> +#include <library/cpp/tvmauth/client/misc/disk_cache.h> +#include <library/cpp/tvmauth/client/misc/roles/entities_index.h> + +#include <library/cpp/tvmauth/unittest.h> + #include <library/cpp/cgiparam/cgiparam.h> -#include <library/cpp/testing/mock_server/server.h> +#include <library/cpp/testing/mock_server/server.h> #include <library/cpp/testing/unittest/env.h> #include <library/cpp/testing/unittest/tests_data.h> - -#include <util/stream/str.h> -#include <util/system/fs.h> - -class TLogger: public NTvmAuth::ILogger { -public: - void Log(int lvl, const TString& msg) override { - Cout << TInstant::Now() << " lvl=" << lvl << " msg: " << msg << "\n"; - Stream << lvl << ": " << msg << Endl; - } - - TStringStream Stream; -}; - -static inline TString GetFilePath(const char* name) { - return ArcadiaSourceRoot() + "/library/cpp/tvmauth/client/ut/files/" + name; -} - -static inline TString GetCachePath(const TString& dir = {}) { - if (dir) { - Y_ENSURE(NFs::MakeDirectoryRecursive("./" + dir)); - } - - auto wr = [](const TString& p, const TStringBuf body) { - NTvmAuth::TDiskWriter w(p); - Y_ENSURE(w.Write(body, TInstant::ParseIso8601("2050-01-01T00:00:00.000000Z"))); - }; - wr("./" + dir + "/public_keys", NTvmAuth::NUnittest::TVMKNIFE_PUBLIC_KEYS); - wr("./" + dir + "/service_tickets", - R"({ - "19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, - "213" : { "ticket" : "service_ticket_2"}, - "234" : { "error" : "Dst is not found" }, - "185" : { "ticket" : "service_ticket_3"} -} 100500)"); - - return "./" + dir; -} - -static const TString AUTH_TOKEN = "strong_token"; -static const TString META = R"( -{ -"bb_env" : "ProdYaTeam", -"tenants" : [ - { - "self": { - "alias" : "me", - "client_id": 100500 - }, - "dsts" : [ - { - "alias" : "bbox", - "client_id": 242 - }, - { - "alias" : "pass_likers", - "client_id": 11 - } - ] - }, - { - "self": { - "alias" : "push-client", - "client_id": 100501 - }, - "dsts" : [ - { - "alias" : "pass_likers", - "client_id": 100502 - } - ] - }, - { - "self": { - "alias" : "multi_names_for_dst", - "client_id": 100599 - }, - "dsts" : [ - { - "alias" : "pass_likers", - "client_id": 100502 - }, - { - "alias" : "pass_haters", - "client_id": 100502 - } - ] - }, - { - "self": { - "alias" : "something_else", - "client_id": 100503 - }, - "dsts" : [ - ] - } -] -})"; - -static const TString TICKETS_ME = - R"({ - "pass_likers": { - "ticket": "3:serv:CBAQ__________9_IgYIlJEGEAs:T-apeMNWFc_vHPQ3iLaZv9NjG-hf5-i23O4AhRu1M68ryN3FU5qvyqTSSiPbtJdFP6EE41QQBzEs59dHn9DRkqQNwwKf1is00Oewwj2XKO0uHukuzd9XxZnro7MfjPswsjWufxX28rmJtlfSXwAtyKt8TI5yKJnMeBPQ0m5R3k8", - "tvm_id": 11 - }, - "bbox": { - "ticket": "3:serv:CBAQ__________9_IgcIlJEGEPIB:N7luw0_rVmBosTTI130jwDbQd0-cMmqJeEl0ma4ZlIo_mHXjBzpOuMQ3A9YagbmOBOt8TZ_gzGvVSegWZkEeB24gM22acw0w-RcHaQKrzSOA5Zq8WLNIC8QUa4_WGTlAsb7R7eC4KTAGgouIquNAgMBdTuGOuZHnMLvZyLnOMKc", - "tvm_id": 242 - } - })"; - -static const TString SERVICE_TICKET_PC = "3:serv:CBAQ__________9_IggIlpEGEJaRBg:BAxaQJCdK4eFuJ6i_egqPwvJgWtlh0enDQRPr84Nx2phZ_8QtxKAUCwEa7KOU_jVvIBQIC5-ETTl2vjBt7UyygF8frdK4ab6zJoWj4n07np6vbmWd385l8KvzztLt4QkBrPiE7U46dK3pL0U8tfBkSXE8rvUIsl3RvvgSNH2J3c"; -static const TString TICKETS_PC = - R"({ - "pass_likers": { - "ticket": "3:serv:CBAQ__________9_IggIlpEGEJaRBg:BAxaQJCdK4eFuJ6i_egqPwvJgWtlh0enDQRPr84Nx2phZ_8QtxKAUCwEa7KOU_jVvIBQIC5-ETTl2vjBt7UyygF8frdK4ab6zJoWj4n07np6vbmWd385l8KvzztLt4QkBrPiE7U46dK3pL0U8tfBkSXE8rvUIsl3RvvgSNH2J3c", - "tvm_id": 100502 - } - })"; - -static const TString TICKETS_MANY_DSTS = - R"({ - "pass_likers": { - "ticket": "3:serv:CBAQ__________9_IggI95EGEJaRBg:D0MOLDhKQyI-OhC0ON9gYukz2hOctUipu1yXsvkw6NRuLhcBfvGayyUqF4ILrqepjz9GtPWIR_wO6oLSW35Z0YaFn60QWp5tG6IcAnr80lm_OnLHJt4kmEoLtGg1V0aWBT0YyouzGB2-QFNOVO86G7sYzU8FC6-V3Iyc4X7XTNc", - "tvm_id": 100502 - }, - "who_are_you??": { - "ticket": "kek", - "tvm_id": 100503 - }, - "pass_haters": { - "ticket": "3:serv:CBAQ__________9_IggI95EGEJaRBg:D0MOLDhKQyI-OhC0ON9gYukz2hOctUipu1yXsvkw6NRuLhcBfvGayyUqF4ILrqepjz9GtPWIR_wO6oLSW35Z0YaFn60QWp5tG6IcAnr80lm_OnLHJt4kmEoLtGg1V0aWBT0YyouzGB2-QFNOVO86G7sYzU8FC6-V3Iyc4X7XTNc", - "tvm_id": 100502 - } - })"; - -static const TString TICKETS_SE = R"({})"; - -static const TInstant BIRTHTIME = TInstant::Seconds(14380887840); -class TTvmTool: public TRequestReplier { -public: - TString Meta; - HttpCodes Code; - TInstant Birthtime; - - TTvmTool() - : Meta(META) - , Code(HTTP_OK) - , Birthtime(BIRTHTIME) - { - } - - bool DoReply(const TReplyParams& params) override { - const TParsedHttpFull http(params.Input.FirstLine()); - if (http.Path == "/tvm/ping") { - THttpResponse resp(HTTP_OK); - resp.SetContent("OK"); - resp.OutTo(params.Output); - return true; - } - - auto it = std::find_if(params.Input.Headers().begin(), - params.Input.Headers().end(), - [](const THttpInputHeader& h) { return h.Name() == "Authorization"; }); - if (it == params.Input.Headers().end() || it->Value() != AUTH_TOKEN) { - THttpResponse resp(HTTP_UNAUTHORIZED); - resp.SetContent("pong"); - resp.OutTo(params.Output); - return true; - } - - THttpResponse resp(Code); - if (http.Path == "/tvm/keys") { - resp.SetContent(NTvmAuth::NUnittest::TVMKNIFE_PUBLIC_KEYS); - } else if (http.Path == "/tvm/tickets") { - TCgiParameters cg; - cg.ScanAddAll(http.Cgi); - if (cg.Get("src") == "100500") { - resp.SetContent(TICKETS_ME); - } else if (cg.Get("src") == "100501") { - resp.SetContent(TICKETS_PC); - } else if (cg.Get("src") == "100599") { - resp.SetContent(TICKETS_MANY_DSTS); - } - } else if (http.Path == "/tvm/private_api/__meta__") { - resp.SetContent(Meta); - } - resp.AddHeader("X-Ya-Tvmtool-Data-Birthtime", IntToString<10>(Birthtime.Seconds())); - resp.OutTo(params.Output); - - return true; - } -}; - -static inline NTvmAuth::NRoles::TEntitiesIndex CreateEntitiesIndex() { - using namespace NTvmAuth::NRoles; - - TEntitiesIndex index( - { - std::make_shared<TEntity>(TEntity{ - {"key#1", "value#11"}, - }), - std::make_shared<TEntity>(TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#22"}, - {"key#3", "value#33"}, - }), - std::make_shared<TEntity>(TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#23"}, - {"key#3", "value#33"}, - }), - std::make_shared<TEntity>(TEntity{ - {"key#1", "value#13"}, - {"key#3", "value#33"}, - }), - }); - - return index; -} + +#include <util/stream/str.h> +#include <util/system/fs.h> + +class TLogger: public NTvmAuth::ILogger { +public: + void Log(int lvl, const TString& msg) override { + Cout << TInstant::Now() << " lvl=" << lvl << " msg: " << msg << "\n"; + Stream << lvl << ": " << msg << Endl; + } + + TStringStream Stream; +}; + +static inline TString GetFilePath(const char* name) { + return ArcadiaSourceRoot() + "/library/cpp/tvmauth/client/ut/files/" + name; +} + +static inline TString GetCachePath(const TString& dir = {}) { + if (dir) { + Y_ENSURE(NFs::MakeDirectoryRecursive("./" + dir)); + } + + auto wr = [](const TString& p, const TStringBuf body) { + NTvmAuth::TDiskWriter w(p); + Y_ENSURE(w.Write(body, TInstant::ParseIso8601("2050-01-01T00:00:00.000000Z"))); + }; + wr("./" + dir + "/public_keys", NTvmAuth::NUnittest::TVMKNIFE_PUBLIC_KEYS); + wr("./" + dir + "/service_tickets", + R"({ + "19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, + "213" : { "ticket" : "service_ticket_2"}, + "234" : { "error" : "Dst is not found" }, + "185" : { "ticket" : "service_ticket_3"} +} 100500)"); + + return "./" + dir; +} + +static const TString AUTH_TOKEN = "strong_token"; +static const TString META = R"( +{ +"bb_env" : "ProdYaTeam", +"tenants" : [ + { + "self": { + "alias" : "me", + "client_id": 100500 + }, + "dsts" : [ + { + "alias" : "bbox", + "client_id": 242 + }, + { + "alias" : "pass_likers", + "client_id": 11 + } + ] + }, + { + "self": { + "alias" : "push-client", + "client_id": 100501 + }, + "dsts" : [ + { + "alias" : "pass_likers", + "client_id": 100502 + } + ] + }, + { + "self": { + "alias" : "multi_names_for_dst", + "client_id": 100599 + }, + "dsts" : [ + { + "alias" : "pass_likers", + "client_id": 100502 + }, + { + "alias" : "pass_haters", + "client_id": 100502 + } + ] + }, + { + "self": { + "alias" : "something_else", + "client_id": 100503 + }, + "dsts" : [ + ] + } +] +})"; + +static const TString TICKETS_ME = + R"({ + "pass_likers": { + "ticket": "3:serv:CBAQ__________9_IgYIlJEGEAs:T-apeMNWFc_vHPQ3iLaZv9NjG-hf5-i23O4AhRu1M68ryN3FU5qvyqTSSiPbtJdFP6EE41QQBzEs59dHn9DRkqQNwwKf1is00Oewwj2XKO0uHukuzd9XxZnro7MfjPswsjWufxX28rmJtlfSXwAtyKt8TI5yKJnMeBPQ0m5R3k8", + "tvm_id": 11 + }, + "bbox": { + "ticket": "3:serv:CBAQ__________9_IgcIlJEGEPIB:N7luw0_rVmBosTTI130jwDbQd0-cMmqJeEl0ma4ZlIo_mHXjBzpOuMQ3A9YagbmOBOt8TZ_gzGvVSegWZkEeB24gM22acw0w-RcHaQKrzSOA5Zq8WLNIC8QUa4_WGTlAsb7R7eC4KTAGgouIquNAgMBdTuGOuZHnMLvZyLnOMKc", + "tvm_id": 242 + } + })"; + +static const TString SERVICE_TICKET_PC = "3:serv:CBAQ__________9_IggIlpEGEJaRBg:BAxaQJCdK4eFuJ6i_egqPwvJgWtlh0enDQRPr84Nx2phZ_8QtxKAUCwEa7KOU_jVvIBQIC5-ETTl2vjBt7UyygF8frdK4ab6zJoWj4n07np6vbmWd385l8KvzztLt4QkBrPiE7U46dK3pL0U8tfBkSXE8rvUIsl3RvvgSNH2J3c"; +static const TString TICKETS_PC = + R"({ + "pass_likers": { + "ticket": "3:serv:CBAQ__________9_IggIlpEGEJaRBg:BAxaQJCdK4eFuJ6i_egqPwvJgWtlh0enDQRPr84Nx2phZ_8QtxKAUCwEa7KOU_jVvIBQIC5-ETTl2vjBt7UyygF8frdK4ab6zJoWj4n07np6vbmWd385l8KvzztLt4QkBrPiE7U46dK3pL0U8tfBkSXE8rvUIsl3RvvgSNH2J3c", + "tvm_id": 100502 + } + })"; + +static const TString TICKETS_MANY_DSTS = + R"({ + "pass_likers": { + "ticket": "3:serv:CBAQ__________9_IggI95EGEJaRBg:D0MOLDhKQyI-OhC0ON9gYukz2hOctUipu1yXsvkw6NRuLhcBfvGayyUqF4ILrqepjz9GtPWIR_wO6oLSW35Z0YaFn60QWp5tG6IcAnr80lm_OnLHJt4kmEoLtGg1V0aWBT0YyouzGB2-QFNOVO86G7sYzU8FC6-V3Iyc4X7XTNc", + "tvm_id": 100502 + }, + "who_are_you??": { + "ticket": "kek", + "tvm_id": 100503 + }, + "pass_haters": { + "ticket": "3:serv:CBAQ__________9_IggI95EGEJaRBg:D0MOLDhKQyI-OhC0ON9gYukz2hOctUipu1yXsvkw6NRuLhcBfvGayyUqF4ILrqepjz9GtPWIR_wO6oLSW35Z0YaFn60QWp5tG6IcAnr80lm_OnLHJt4kmEoLtGg1V0aWBT0YyouzGB2-QFNOVO86G7sYzU8FC6-V3Iyc4X7XTNc", + "tvm_id": 100502 + } + })"; + +static const TString TICKETS_SE = R"({})"; + +static const TInstant BIRTHTIME = TInstant::Seconds(14380887840); +class TTvmTool: public TRequestReplier { +public: + TString Meta; + HttpCodes Code; + TInstant Birthtime; + + TTvmTool() + : Meta(META) + , Code(HTTP_OK) + , Birthtime(BIRTHTIME) + { + } + + bool DoReply(const TReplyParams& params) override { + const TParsedHttpFull http(params.Input.FirstLine()); + if (http.Path == "/tvm/ping") { + THttpResponse resp(HTTP_OK); + resp.SetContent("OK"); + resp.OutTo(params.Output); + return true; + } + + auto it = std::find_if(params.Input.Headers().begin(), + params.Input.Headers().end(), + [](const THttpInputHeader& h) { return h.Name() == "Authorization"; }); + if (it == params.Input.Headers().end() || it->Value() != AUTH_TOKEN) { + THttpResponse resp(HTTP_UNAUTHORIZED); + resp.SetContent("pong"); + resp.OutTo(params.Output); + return true; + } + + THttpResponse resp(Code); + if (http.Path == "/tvm/keys") { + resp.SetContent(NTvmAuth::NUnittest::TVMKNIFE_PUBLIC_KEYS); + } else if (http.Path == "/tvm/tickets") { + TCgiParameters cg; + cg.ScanAddAll(http.Cgi); + if (cg.Get("src") == "100500") { + resp.SetContent(TICKETS_ME); + } else if (cg.Get("src") == "100501") { + resp.SetContent(TICKETS_PC); + } else if (cg.Get("src") == "100599") { + resp.SetContent(TICKETS_MANY_DSTS); + } + } else if (http.Path == "/tvm/private_api/__meta__") { + resp.SetContent(Meta); + } + resp.AddHeader("X-Ya-Tvmtool-Data-Birthtime", IntToString<10>(Birthtime.Seconds())); + resp.OutTo(params.Output); + + return true; + } +}; + +static inline NTvmAuth::NRoles::TEntitiesIndex CreateEntitiesIndex() { + using namespace NTvmAuth::NRoles; + + TEntitiesIndex index( + { + std::make_shared<TEntity>(TEntity{ + {"key#1", "value#11"}, + }), + std::make_shared<TEntity>(TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#22"}, + {"key#3", "value#33"}, + }), + std::make_shared<TEntity>(TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#23"}, + {"key#3", "value#33"}, + }), + std::make_shared<TEntity>(TEntity{ + {"key#1", "value#13"}, + {"key#3", "value#33"}, + }), + }); + + return index; +} diff --git a/library/cpp/tvmauth/client/ut/default_uid_checker_ut.cpp b/library/cpp/tvmauth/client/ut/default_uid_checker_ut.cpp index a92530cab1..57b96dfd9e 100644 --- a/library/cpp/tvmauth/client/ut/default_uid_checker_ut.cpp +++ b/library/cpp/tvmauth/client/ut/default_uid_checker_ut.cpp @@ -1,52 +1,52 @@ -#include "common.h" - -#include <library/cpp/tvmauth/client/mocked_updater.h> -#include <library/cpp/tvmauth/client/misc/default_uid_checker.h> -#include <library/cpp/tvmauth/client/misc/api/threaded_updater.h> - -#include <library/cpp/tvmauth/type.h> -#include <library/cpp/tvmauth/unittest.h> - -#include <library/cpp/testing/unittest/registar.h> - -using namespace NTvmAuth; - -Y_UNIT_TEST_SUITE(DefaultUidChecker) { - Y_UNIT_TEST(Ctor) { - UNIT_ASSERT_EXCEPTION_CONTAINS( - TDefaultUidChecker(new TMockedUpdater), - TBrokenTvmClientSettings, - "Need to use TClientSettings::EnableRolesFetching"); - } - - Y_UNIT_TEST(Check) { - NRoles::TRolesPtr roles = std::make_shared<NRoles::TRoles>( - NRoles::TRoles::TMeta{}, - NRoles::TRoles::TTvmConsumers{}, - NRoles::TRoles::TUserConsumers{ - {12345, std::make_shared<NRoles::TConsumerRoles>( - THashMap<TString, NRoles::TEntitiesPtr>())}, - }, - std::make_shared<TString>()); - const TDefaultUidChecker checker(new TMockedUpdater({.Roles = roles})); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - checker.Check(NUnittest::CreateUserTicket(ETicketStatus::Expired, 12345, {})), - TIllegalUsage, - "User ticket must be valid"); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - checker.Check(NUnittest::CreateUserTicket(ETicketStatus::Ok, 12345, {}, {}, EBlackboxEnv::Test)), - TIllegalUsage, - "User ticket must be from ProdYateam, got from Test"); - - TCheckedUserTicket ticket; - UNIT_ASSERT_NO_EXCEPTION( - ticket = checker.Check(NUnittest::CreateUserTicket(ETicketStatus::Ok, 12345, {}, {}, EBlackboxEnv::ProdYateam))); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, ticket.GetStatus()); - - UNIT_ASSERT_NO_EXCEPTION( - ticket = checker.Check(NUnittest::CreateUserTicket(ETicketStatus::Ok, 9999, {}, {}, EBlackboxEnv::ProdYateam))); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::NoRoles, ticket.GetStatus()); - } -} +#include "common.h" + +#include <library/cpp/tvmauth/client/mocked_updater.h> +#include <library/cpp/tvmauth/client/misc/default_uid_checker.h> +#include <library/cpp/tvmauth/client/misc/api/threaded_updater.h> + +#include <library/cpp/tvmauth/type.h> +#include <library/cpp/tvmauth/unittest.h> + +#include <library/cpp/testing/unittest/registar.h> + +using namespace NTvmAuth; + +Y_UNIT_TEST_SUITE(DefaultUidChecker) { + Y_UNIT_TEST(Ctor) { + UNIT_ASSERT_EXCEPTION_CONTAINS( + TDefaultUidChecker(new TMockedUpdater), + TBrokenTvmClientSettings, + "Need to use TClientSettings::EnableRolesFetching"); + } + + Y_UNIT_TEST(Check) { + NRoles::TRolesPtr roles = std::make_shared<NRoles::TRoles>( + NRoles::TRoles::TMeta{}, + NRoles::TRoles::TTvmConsumers{}, + NRoles::TRoles::TUserConsumers{ + {12345, std::make_shared<NRoles::TConsumerRoles>( + THashMap<TString, NRoles::TEntitiesPtr>())}, + }, + std::make_shared<TString>()); + const TDefaultUidChecker checker(new TMockedUpdater({.Roles = roles})); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + checker.Check(NUnittest::CreateUserTicket(ETicketStatus::Expired, 12345, {})), + TIllegalUsage, + "User ticket must be valid"); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + checker.Check(NUnittest::CreateUserTicket(ETicketStatus::Ok, 12345, {}, {}, EBlackboxEnv::Test)), + TIllegalUsage, + "User ticket must be from ProdYateam, got from Test"); + + TCheckedUserTicket ticket; + UNIT_ASSERT_NO_EXCEPTION( + ticket = checker.Check(NUnittest::CreateUserTicket(ETicketStatus::Ok, 12345, {}, {}, EBlackboxEnv::ProdYateam))); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, ticket.GetStatus()); + + UNIT_ASSERT_NO_EXCEPTION( + ticket = checker.Check(NUnittest::CreateUserTicket(ETicketStatus::Ok, 9999, {}, {}, EBlackboxEnv::ProdYateam))); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::NoRoles, ticket.GetStatus()); + } +} diff --git a/library/cpp/tvmauth/client/ut/disk_cache_ut.cpp b/library/cpp/tvmauth/client/ut/disk_cache_ut.cpp index 7dd851c9b3..5d99927c6c 100644 --- a/library/cpp/tvmauth/client/ut/disk_cache_ut.cpp +++ b/library/cpp/tvmauth/client/ut/disk_cache_ut.cpp @@ -1,204 +1,204 @@ -#include "common.h" - -#include <library/cpp/tvmauth/client/logger.h> -#include <library/cpp/tvmauth/client/misc/disk_cache.h> - -#include <library/cpp/tvmauth/src/utils.h> - +#include "common.h" + +#include <library/cpp/tvmauth/client/logger.h> +#include <library/cpp/tvmauth/client/misc/disk_cache.h> + +#include <library/cpp/tvmauth/src/utils.h> + #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/tests_data.h> - -#include <util/stream/file.h> -#include <util/system/fs.h> -#include <util/system/sysstat.h> - -#include <thread> - -using namespace NTvmAuth; - + +#include <util/stream/file.h> +#include <util/system/fs.h> +#include <util/system/sysstat.h> + +#include <thread> + +using namespace NTvmAuth; + Y_UNIT_TEST_SUITE(ClientDisk) { Y_UNIT_TEST(Hash) { - TString hash = TDiskReader::GetHash("asd"); - UNIT_ASSERT(hash); - UNIT_ASSERT_VALUES_EQUAL(32, hash.size()); + TString hash = TDiskReader::GetHash("asd"); + UNIT_ASSERT(hash); + UNIT_ASSERT_VALUES_EQUAL(32, hash.size()); UNIT_ASSERT_VALUES_EQUAL("Zj5_qYg31bPlqjBW76z8IV0rCsHmv-iN-McV6ybS1-g", NUtils::Bin2base64url(hash)); - } - + } + Y_UNIT_TEST(Timestamp) { - time_t t = 100500; - - TString s = TDiskWriter::WriteTimestamp(t); + time_t t = 100500; + + TString s = TDiskWriter::WriteTimestamp(t); UNIT_ASSERT_VALUES_EQUAL("lIgBAAAAAAA", NUtils::Bin2base64url(s)); - UNIT_ASSERT_VALUES_EQUAL(t, TDiskReader::GetTimestamp(s)); - - t = 123123123213089; - s = TDiskWriter::WriteTimestamp(t); + UNIT_ASSERT_VALUES_EQUAL(t, TDiskReader::GetTimestamp(s)); + + t = 123123123213089; + s = TDiskWriter::WriteTimestamp(t); UNIT_ASSERT_VALUES_EQUAL("IdMF1vpvAAA", NUtils::Bin2base64url(s)); - UNIT_ASSERT_VALUES_EQUAL(t, TDiskReader::GetTimestamp(s)); - - t = time(nullptr); - s = TDiskWriter::WriteTimestamp(t); - UNIT_ASSERT_VALUES_EQUAL(t, TDiskReader::GetTimestamp(s)); - } - - const TInstant TIME = TInstant::Seconds(100500); - const TString DATA = "oiweuhn \n vw3ut hweoi uhgewproritjhwequtherwoiughfdsv 8ty34q01u 34 1=3"; - + UNIT_ASSERT_VALUES_EQUAL(t, TDiskReader::GetTimestamp(s)); + + t = time(nullptr); + s = TDiskWriter::WriteTimestamp(t); + UNIT_ASSERT_VALUES_EQUAL(t, TDiskReader::GetTimestamp(s)); + } + + const TInstant TIME = TInstant::Seconds(100500); + const TString DATA = "oiweuhn \n vw3ut hweoi uhgewproritjhwequtherwoiughfdsv 8ty34q01u 34 1=3"; + Y_UNIT_TEST(ParseData_Ok) { - TLogger l; - - const TInstant time = TInstant::Seconds(1523446554789); - - TString toFile = TDiskWriter::PrepareData(time, DATA); - UNIT_ASSERT_VALUES_EQUAL(113, toFile.size()); - UNIT_ASSERT_VALUES_EQUAL("T8BnRIMoC6mlMXexPg9cV5jYxeFtgDWk97JTajHDunCloH20YgEAAG9pd2V1aG4gCiB2dzN1dCBod2VvaSB1aGdld3Byb3JpdGpod2VxdXRoZXJ3b2l1Z2hmZHN2IDh0eTM0cTAxdSAgIDM0ICAxPTM", - NUtils::Bin2base64url(toFile)); - - TDiskReader r("qwerty", &l); - UNIT_ASSERT(r.ParseData(toFile)); + TLogger l; + + const TInstant time = TInstant::Seconds(1523446554789); + + TString toFile = TDiskWriter::PrepareData(time, DATA); + UNIT_ASSERT_VALUES_EQUAL(113, toFile.size()); + UNIT_ASSERT_VALUES_EQUAL("T8BnRIMoC6mlMXexPg9cV5jYxeFtgDWk97JTajHDunCloH20YgEAAG9pd2V1aG4gCiB2dzN1dCBod2VvaSB1aGdld3Byb3JpdGpod2VxdXRoZXJ3b2l1Z2hmZHN2IDh0eTM0cTAxdSAgIDM0ICAxPTM", + NUtils::Bin2base64url(toFile)); + + TDiskReader r("qwerty", &l); + UNIT_ASSERT(r.ParseData(toFile)); UNIT_ASSERT_VALUES_EQUAL(DATA, r.Data()); - UNIT_ASSERT_VALUES_EQUAL(time, r.Time()); + UNIT_ASSERT_VALUES_EQUAL(time, r.Time()); UNIT_ASSERT_VALUES_EQUAL("6: File 'qwerty' was successfully read\n", - l.Stream.Str()); - } - + l.Stream.Str()); + } + Y_UNIT_TEST(ParseData_SmallFile) { - TLogger l; - - TString toFile = TDiskWriter::PrepareData(TIME, DATA); - TDiskReader r("qwerty", &l); - UNIT_ASSERT(!r.ParseData(toFile.substr(0, 17))); + TLogger l; + + TString toFile = TDiskWriter::PrepareData(TIME, DATA); + TDiskReader r("qwerty", &l); + UNIT_ASSERT(!r.ParseData(toFile.substr(0, 17))); UNIT_ASSERT_VALUES_EQUAL("4: File 'qwerty' is too small\n", - l.Stream.Str()); - } - + l.Stream.Str()); + } + Y_UNIT_TEST(ParseData_Changed) { - TLogger l; - - TString toFile = TDiskWriter::PrepareData(TIME, DATA); - toFile[17] = toFile[17] + 1; - TDiskReader r("qwerty", &l); - UNIT_ASSERT(!r.ParseData(toFile)); + TLogger l; + + TString toFile = TDiskWriter::PrepareData(TIME, DATA); + toFile[17] = toFile[17] + 1; + TDiskReader r("qwerty", &l); + UNIT_ASSERT(!r.ParseData(toFile)); UNIT_ASSERT_VALUES_EQUAL("4: Content of 'qwerty' was incorrectly changed\n", - l.Stream.Str()); - } - + l.Stream.Str()); + } + Y_UNIT_TEST(Read_Ok) { - TLogger l; - - TDiskReader r(GetFilePath("ok.cache"), &l); - UNIT_ASSERT(r.Read()); + TLogger l; + + TDiskReader r(GetFilePath("ok.cache"), &l); + UNIT_ASSERT(r.Read()); UNIT_ASSERT_VALUES_EQUAL(DATA, r.Data()); - UNIT_ASSERT_VALUES_EQUAL(TIME, r.Time()); - UNIT_ASSERT_C(l.Stream.Str().find("was successfully read") != TString::npos, l.Stream.Str()); - } - + UNIT_ASSERT_VALUES_EQUAL(TIME, r.Time()); + UNIT_ASSERT_C(l.Stream.Str().find("was successfully read") != TString::npos, l.Stream.Str()); + } + Y_UNIT_TEST(Read_NoFile) { - TLogger l; - - TDiskReader r("missing", &l); - UNIT_ASSERT(!r.Read()); + TLogger l; + + TDiskReader r("missing", &l); + UNIT_ASSERT(!r.Read()); UNIT_ASSERT_VALUES_EQUAL("7: File 'missing' does not exist\n", - l.Stream.Str()); - } - -#ifdef _unix_ + l.Stream.Str()); + } + +#ifdef _unix_ Y_UNIT_TEST(Read_NoPermitions) { - TLogger l; - - const TString path = GetWorkPath() + "/123"; - { - TFileOutput output(path); - } - Chmod(path.data(), S_IWUSR); - - TDiskReader r(path, &l); - UNIT_ASSERT(!r.Read()); - UNIT_ASSERT_C(l.Stream.Str().find("Permission denied") != TString::npos, l.Stream.Str()); - - Chmod(path.data(), S_IRWXU); - NFs::Remove(path); - } -#endif - + TLogger l; + + const TString path = GetWorkPath() + "/123"; + { + TFileOutput output(path); + } + Chmod(path.data(), S_IWUSR); + + TDiskReader r(path, &l); + UNIT_ASSERT(!r.Read()); + UNIT_ASSERT_C(l.Stream.Str().find("Permission denied") != TString::npos, l.Stream.Str()); + + Chmod(path.data(), S_IRWXU); + NFs::Remove(path); + } +#endif + Y_UNIT_TEST(Write_Ok) { - TLogger l; - - const TString path = "./tmp_file"; - TDiskWriter w(path, &l); - UNIT_ASSERT_C(w.Write(DATA), l.Stream.Str()); - UNIT_ASSERT_C(l.Stream.Str().find("was successfully written") != TString::npos, l.Stream.Str()); - l.Stream.Clear(); - - TDiskReader r(path, &l); - UNIT_ASSERT_C(r.Read(), l.Stream.Str()); + TLogger l; + + const TString path = "./tmp_file"; + TDiskWriter w(path, &l); + UNIT_ASSERT_C(w.Write(DATA), l.Stream.Str()); + UNIT_ASSERT_C(l.Stream.Str().find("was successfully written") != TString::npos, l.Stream.Str()); + l.Stream.Clear(); + + TDiskReader r(path, &l); + UNIT_ASSERT_C(r.Read(), l.Stream.Str()); UNIT_ASSERT_VALUES_EQUAL(DATA, r.Data()); - UNIT_ASSERT(TInstant::Now() - r.Time() < TDuration::Minutes(5)); - UNIT_ASSERT_C(l.Stream.Str().find("was successfully read") != TString::npos, l.Stream.Str()); - - NFs::Remove(path); - } - + UNIT_ASSERT(TInstant::Now() - r.Time() < TDuration::Minutes(5)); + UNIT_ASSERT_C(l.Stream.Str().find("was successfully read") != TString::npos, l.Stream.Str()); + + NFs::Remove(path); + } + Y_UNIT_TEST(Write_NoPermitions) { - TLogger l; - - TDiskWriter w("/some_file", &l); - UNIT_ASSERT(!w.Write(DATA)); - UNIT_ASSERT_C(l.Stream.Str().Contains("3: Failed to write '/some_file': ("), l.Stream.Str()); - UNIT_ASSERT_C(l.Stream.Str().Contains("denied"), l.Stream.Str()); - } - - Y_UNIT_TEST(race) { - const TString path = "./tmp_file"; - const TString data = "ejufhsadkjfvbhsaoicnaofssdahfasdfhasdofdsaf"; - NFs::Remove(path); - - std::atomic<bool> fail = false; - std::vector<std::thread> thrs; - for (size_t idx = 0; idx < 16; ++idx) { - thrs.push_back(std::thread([&fail, data, path]() { - TDiskWriter w(path); - for (size_t k = 0; k < 1000; ++k) { - if (!w.Write(data)) { - fail = true; - } - } - })); - } - for (std::thread& t : thrs) { - t.join(); - } - thrs.clear(); - UNIT_ASSERT(fail); - { - TDiskWriter w(path); - UNIT_ASSERT(w.Write(data)); // checks unlocked flock - } - - fail = false; - - for (size_t idx = 0; idx < 4; ++idx) { - thrs.push_back(std::thread([&fail, data, path]() { - TLogger l; - TDiskReader r(path, &l); - for (size_t k = 0; k < 100; ++k) { - if (!r.Read()) { - Cerr << l.Stream.Str() << Flush; - fail = true; - return; - } - if (r.Data() != data) { - Cerr << (TStringBuilder() << "'" << data << "' vs '" << r.Data() << "'" << Endl) << Flush; - fail = true; - return; - } - } - })); - } - for (std::thread& t : thrs) { - t.join(); - } - thrs.clear(); - UNIT_ASSERT(!fail); - } -} + TLogger l; + + TDiskWriter w("/some_file", &l); + UNIT_ASSERT(!w.Write(DATA)); + UNIT_ASSERT_C(l.Stream.Str().Contains("3: Failed to write '/some_file': ("), l.Stream.Str()); + UNIT_ASSERT_C(l.Stream.Str().Contains("denied"), l.Stream.Str()); + } + + Y_UNIT_TEST(race) { + const TString path = "./tmp_file"; + const TString data = "ejufhsadkjfvbhsaoicnaofssdahfasdfhasdofdsaf"; + NFs::Remove(path); + + std::atomic<bool> fail = false; + std::vector<std::thread> thrs; + for (size_t idx = 0; idx < 16; ++idx) { + thrs.push_back(std::thread([&fail, data, path]() { + TDiskWriter w(path); + for (size_t k = 0; k < 1000; ++k) { + if (!w.Write(data)) { + fail = true; + } + } + })); + } + for (std::thread& t : thrs) { + t.join(); + } + thrs.clear(); + UNIT_ASSERT(fail); + { + TDiskWriter w(path); + UNIT_ASSERT(w.Write(data)); // checks unlocked flock + } + + fail = false; + + for (size_t idx = 0; idx < 4; ++idx) { + thrs.push_back(std::thread([&fail, data, path]() { + TLogger l; + TDiskReader r(path, &l); + for (size_t k = 0; k < 100; ++k) { + if (!r.Read()) { + Cerr << l.Stream.Str() << Flush; + fail = true; + return; + } + if (r.Data() != data) { + Cerr << (TStringBuilder() << "'" << data << "' vs '" << r.Data() << "'" << Endl) << Flush; + fail = true; + return; + } + } + })); + } + for (std::thread& t : thrs) { + t.join(); + } + thrs.clear(); + UNIT_ASSERT(!fail); + } +} diff --git a/library/cpp/tvmauth/client/ut/exponential_backoff_ut.cpp b/library/cpp/tvmauth/client/ut/exponential_backoff_ut.cpp index 3dcbe6ad49..11e735f836 100644 --- a/library/cpp/tvmauth/client/ut/exponential_backoff_ut.cpp +++ b/library/cpp/tvmauth/client/ut/exponential_backoff_ut.cpp @@ -1,44 +1,44 @@ -#include <library/cpp/tvmauth/client/misc/exponential_backoff.h> - +#include <library/cpp/tvmauth/client/misc/exponential_backoff.h> + #include <library/cpp/testing/unittest/registar.h> - -#include <thread> - -using namespace NTvmAuth; - -Y_UNIT_TEST_SUITE(PasspUtilsExpBackoff) { - Y_UNIT_TEST(common) { - TExponentialBackoff b({TDuration::Seconds(1), TDuration::Seconds(60), 2, 0.01}); - - UNIT_ASSERT_VALUES_EQUAL(TDuration::Seconds(1), b.GetCurrentValue()); - - TDuration dur = b.GetCurrentValue(); - for (size_t idx = 0; idx < 6; ++idx) { - TDuration newValue = b.Increase(); - UNIT_ASSERT_LT(dur, newValue); - dur = newValue; - } - - UNIT_ASSERT_LT(TDuration::Seconds(60) - TDuration::Seconds(3), dur); - UNIT_ASSERT_LT(dur, TDuration::Seconds(60) + TDuration::Seconds(3)); - } - - Y_UNIT_TEST(sleep) { - TExponentialBackoff b({TDuration::Seconds(60), TDuration::Seconds(600), 2, 0.01}); - - const TInstant start = TInstant::Now(); - - TAutoEvent started; - std::thread t([&b, &started]() { - started.Signal(); - b.Sleep(); - }); - - started.WaitT(TDuration::Seconds(30)); - b.Interrupt(); - t.join(); - TDuration dur = TInstant::Now() - start; - - UNIT_ASSERT_LT(dur, TDuration::Seconds(60)); - } -} + +#include <thread> + +using namespace NTvmAuth; + +Y_UNIT_TEST_SUITE(PasspUtilsExpBackoff) { + Y_UNIT_TEST(common) { + TExponentialBackoff b({TDuration::Seconds(1), TDuration::Seconds(60), 2, 0.01}); + + UNIT_ASSERT_VALUES_EQUAL(TDuration::Seconds(1), b.GetCurrentValue()); + + TDuration dur = b.GetCurrentValue(); + for (size_t idx = 0; idx < 6; ++idx) { + TDuration newValue = b.Increase(); + UNIT_ASSERT_LT(dur, newValue); + dur = newValue; + } + + UNIT_ASSERT_LT(TDuration::Seconds(60) - TDuration::Seconds(3), dur); + UNIT_ASSERT_LT(dur, TDuration::Seconds(60) + TDuration::Seconds(3)); + } + + Y_UNIT_TEST(sleep) { + TExponentialBackoff b({TDuration::Seconds(60), TDuration::Seconds(600), 2, 0.01}); + + const TInstant start = TInstant::Now(); + + TAutoEvent started; + std::thread t([&b, &started]() { + started.Signal(); + b.Sleep(); + }); + + started.WaitT(TDuration::Seconds(30)); + b.Interrupt(); + t.join(); + TDuration dur = TInstant::Now() - start; + + UNIT_ASSERT_LT(dur, TDuration::Seconds(60)); + } +} diff --git a/library/cpp/tvmauth/client/ut/facade_ut.cpp b/library/cpp/tvmauth/client/ut/facade_ut.cpp index 62e8e6c731..d3d33e8b81 100644 --- a/library/cpp/tvmauth/client/ut/facade_ut.cpp +++ b/library/cpp/tvmauth/client/ut/facade_ut.cpp @@ -1,167 +1,167 @@ -#include "common.h" - -#include <library/cpp/tvmauth/client/facade.h> -#include <library/cpp/tvmauth/client/mocked_updater.h> - +#include "common.h" + +#include <library/cpp/tvmauth/client/facade.h> +#include <library/cpp/tvmauth/client/mocked_updater.h> + #include <library/cpp/testing/unittest/registar.h> - -#include <util/generic/vector.h> - -using namespace NTvmAuth; - + +#include <util/generic/vector.h> + +using namespace NTvmAuth; + Y_UNIT_TEST_SUITE(ClientFacade) { - static const TTvmId OK_CLIENT = 100500; - static const TString SRV_TICKET_123 = "3:serv:CBAQ__________9_IgYIexCUkQY:GioCM49Ob6_f80y6FY0XBVN4hLXuMlFeyMvIMiDuQnZkbkLpRpQOuQo5YjWoBjM0Vf-XqOm8B7xtrvxSYHDD7Q4OatN2l-Iwg7i71lE3scUeD36x47st3nd0OThvtjrFx_D8mw_c0GT5KcniZlqq1SjhLyAk1b_zJsx8viRAhCU"; - static const TString SRV_TICKET_456 = "3:serv:CBAQ__________9_IgcIyAMQlJEG:VrnqRhpoiDnJeAQbySJluJ1moQ5Kemic99iWzOrHLGfuh7iTw_xMT7KewRAmZMUwDKzE6otj7V86Xsnxbv5xZl8746wbvNcyUXu-nGWmbByZjO7xpSIcY07sISqEhP9n9C_yMSvqDP7ho_PRIfpGCDMXxKlFZ_BhBLLp0kHEvw4"; - static const TString PROD_TICKET = "3:user:CAsQ__________9_Gg4KAgh7EHsg0oXYzAQoAA:N8PvrDNLh-5JywinxJntLeQGDEHBUxfzjuvB8-_BEUv1x9CALU7do8irDlDYVeVVDr4AIpR087YPZVzWPAqmnBuRJS0tJXekmDDvrivLnbRrzY4IUXZ_fImB0fJhTyVetKv6RD11bGqnAJeDpIukBwPTbJc_EMvKDt8V490CJFw"; - static const TString TEST_TICKET = "3:user:CA0Q__________9_Gg4KAgh7EHsg0oXYzAQoAQ:FSADps3wNGm92Vyb1E9IVq5M6ZygdGdt1vafWWEhfDDeCLoVA-sJesxMl2pGW4OxJ8J1r_MfpG3ZoBk8rLVMHUFrPa6HheTbeXFAWl8quEniauXvKQe4VyrpA1SPgtRoFqi5upSDIJzEAe1YRJjq1EClQ_slMt8R0kA_JjKUX54"; - - TTvmClient GetClient(const NTvmApi::TClientSettings& s) { - auto l = MakeIntrusive<TLogger>(); - TTvmClient f(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, f.GetStatus()); - Sleep(TDuration::MilliSeconds(300)); - TString logs = l->Stream.Str(); - UNIT_ASSERT_C(logs.find("was successfully read") != TString::npos, logs); - UNIT_ASSERT_C(logs.find("was successfully fetched") == TString::npos, logs); - return f; - } - + static const TTvmId OK_CLIENT = 100500; + static const TString SRV_TICKET_123 = "3:serv:CBAQ__________9_IgYIexCUkQY:GioCM49Ob6_f80y6FY0XBVN4hLXuMlFeyMvIMiDuQnZkbkLpRpQOuQo5YjWoBjM0Vf-XqOm8B7xtrvxSYHDD7Q4OatN2l-Iwg7i71lE3scUeD36x47st3nd0OThvtjrFx_D8mw_c0GT5KcniZlqq1SjhLyAk1b_zJsx8viRAhCU"; + static const TString SRV_TICKET_456 = "3:serv:CBAQ__________9_IgcIyAMQlJEG:VrnqRhpoiDnJeAQbySJluJ1moQ5Kemic99iWzOrHLGfuh7iTw_xMT7KewRAmZMUwDKzE6otj7V86Xsnxbv5xZl8746wbvNcyUXu-nGWmbByZjO7xpSIcY07sISqEhP9n9C_yMSvqDP7ho_PRIfpGCDMXxKlFZ_BhBLLp0kHEvw4"; + static const TString PROD_TICKET = "3:user:CAsQ__________9_Gg4KAgh7EHsg0oXYzAQoAA:N8PvrDNLh-5JywinxJntLeQGDEHBUxfzjuvB8-_BEUv1x9CALU7do8irDlDYVeVVDr4AIpR087YPZVzWPAqmnBuRJS0tJXekmDDvrivLnbRrzY4IUXZ_fImB0fJhTyVetKv6RD11bGqnAJeDpIukBwPTbJc_EMvKDt8V490CJFw"; + static const TString TEST_TICKET = "3:user:CA0Q__________9_Gg4KAgh7EHsg0oXYzAQoAQ:FSADps3wNGm92Vyb1E9IVq5M6ZygdGdt1vafWWEhfDDeCLoVA-sJesxMl2pGW4OxJ8J1r_MfpG3ZoBk8rLVMHUFrPa6HheTbeXFAWl8quEniauXvKQe4VyrpA1SPgtRoFqi5upSDIJzEAe1YRJjq1EClQ_slMt8R0kA_JjKUX54"; + + TTvmClient GetClient(const NTvmApi::TClientSettings& s) { + auto l = MakeIntrusive<TLogger>(); + TTvmClient f(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, f.GetStatus()); + Sleep(TDuration::MilliSeconds(300)); + TString logs = l->Stream.Str(); + UNIT_ASSERT_C(logs.find("was successfully read") != TString::npos, logs); + UNIT_ASSERT_C(logs.find("was successfully fetched") == TString::npos, logs); + return f; + } + Y_UNIT_TEST(Service) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(OK_CLIENT); - s.EnableServiceTicketChecking(); - s.SetDiskCacheDir(GetCachePath()); - TTvmClient f = GetClient(s); - - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(2524608000), f.GetUpdateTimeOfPublicKeys()); - UNIT_ASSERT_VALUES_EQUAL(TInstant(), f.GetUpdateTimeOfServiceTickets()); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(2525126400), f.GetInvalidationTimeOfPublicKeys()); - UNIT_ASSERT_VALUES_EQUAL(TInstant(), f.GetInvalidationTimeOfServiceTickets()); - - UNIT_ASSERT(f.CheckServiceTicket(SRV_TICKET_123)); - UNIT_ASSERT_EXCEPTION(f.CheckUserTicket(PROD_TICKET), yexception); - UNIT_ASSERT_EXCEPTION(f.CheckUserTicket(TEST_TICKET), yexception); - } - + NTvmApi::TClientSettings s; + s.SetSelfTvmId(OK_CLIENT); + s.EnableServiceTicketChecking(); + s.SetDiskCacheDir(GetCachePath()); + TTvmClient f = GetClient(s); + + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(2524608000), f.GetUpdateTimeOfPublicKeys()); + UNIT_ASSERT_VALUES_EQUAL(TInstant(), f.GetUpdateTimeOfServiceTickets()); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(2525126400), f.GetInvalidationTimeOfPublicKeys()); + UNIT_ASSERT_VALUES_EQUAL(TInstant(), f.GetInvalidationTimeOfServiceTickets()); + + UNIT_ASSERT(f.CheckServiceTicket(SRV_TICKET_123)); + UNIT_ASSERT_EXCEPTION(f.CheckUserTicket(PROD_TICKET), yexception); + UNIT_ASSERT_EXCEPTION(f.CheckUserTicket(TEST_TICKET), yexception); + } + Y_UNIT_TEST(User) { - NTvmApi::TClientSettings s; - s.EnableUserTicketChecking(EBlackboxEnv::Prod); - s.SetDiskCacheDir(GetCachePath()); - - TTvmClient f = GetClient(s); - UNIT_ASSERT_EXCEPTION(f.CheckServiceTicket(SRV_TICKET_123), yexception); - UNIT_ASSERT(f.CheckUserTicket(PROD_TICKET)); - UNIT_ASSERT(!f.CheckUserTicket(TEST_TICKET)); - } - + NTvmApi::TClientSettings s; + s.EnableUserTicketChecking(EBlackboxEnv::Prod); + s.SetDiskCacheDir(GetCachePath()); + + TTvmClient f = GetClient(s); + UNIT_ASSERT_EXCEPTION(f.CheckServiceTicket(SRV_TICKET_123), yexception); + UNIT_ASSERT(f.CheckUserTicket(PROD_TICKET)); + UNIT_ASSERT(!f.CheckUserTicket(TEST_TICKET)); + } + Y_UNIT_TEST(Ctors) { - NTvmApi::TClientSettings s; - s.EnableUserTicketChecking(EBlackboxEnv::Prod); - s.SetDiskCacheDir(GetCachePath()); - - TTvmClient f = GetClient(s); - f = GetClient(s); - - TVector<TTvmClient> v; - v.push_back(std::move(f)); - v.front() = std::move(*v.begin()); - } - + NTvmApi::TClientSettings s; + s.EnableUserTicketChecking(EBlackboxEnv::Prod); + s.SetDiskCacheDir(GetCachePath()); + + TTvmClient f = GetClient(s); + f = GetClient(s); + + TVector<TTvmClient> v; + v.push_back(std::move(f)); + v.front() = std::move(*v.begin()); + } + Y_UNIT_TEST(Tickets) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(OK_CLIENT); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); - s.SetDiskCacheDir(GetCachePath()); - TTvmClient f = GetClient(s); - - UNIT_ASSERT_VALUES_EQUAL(TInstant(), f.GetUpdateTimeOfPublicKeys()); - UNIT_ASSERT_VALUES_EQUAL(TInstant::ParseIso8601("2050-01-01T00:00:00.000000Z"), f.GetUpdateTimeOfServiceTickets()); - UNIT_ASSERT_VALUES_EQUAL(TInstant(), f.GetInvalidationTimeOfPublicKeys()); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(std::numeric_limits<size_t>::max()), f.GetInvalidationTimeOfServiceTickets()); - - UNIT_ASSERT_VALUES_EQUAL("3:serv:CBAQ__________9_IgYIKhCUkQY:CX", f.GetServiceTicketFor("blackbox")); - UNIT_ASSERT_VALUES_EQUAL("3:serv:CBAQ__________9_IgYIKhCUkQY:CX", f.GetServiceTicketFor(19)); - UNIT_ASSERT_EXCEPTION_CONTAINS(f.GetServiceTicketFor("blackbox2"), - TBrokenTvmClientSettings, - "Destination 'blackbox2' was not specified in settings. Check your settings (if you use Qloud/YP/tvmtool - check it's settings)"); - UNIT_ASSERT_EXCEPTION_CONTAINS(f.GetServiceTicketFor(20), - TBrokenTvmClientSettings, - "Destination '20' was not specified in settings. Check your settings (if you use Qloud/YP/tvmtool - check it's settings)"); - } - - Y_UNIT_TEST(Tool) { - TPortManager pm; - ui16 port = pm.GetPort(80); - NMock::TMockServer server(port, []() { return new TTvmTool; }); - - NTvmTool::TClientSettings s("push-client"); - s.SetPort(port); - s.SetAuthToken(AUTH_TOKEN); - auto l = MakeIntrusive<TLogger>(); - { - TTvmClient f(s, l); - - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(14380887840), f.GetUpdateTimeOfPublicKeys()); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(14380887840), f.GetUpdateTimeOfServiceTickets()); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(14381406240), f.GetInvalidationTimeOfPublicKeys()); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(std::numeric_limits<time_t>::max()), f.GetInvalidationTimeOfServiceTickets()); - - UNIT_ASSERT_VALUES_EQUAL(SERVICE_TICKET_PC, f.GetServiceTicketFor("pass_likers")); - UNIT_ASSERT_VALUES_EQUAL(SERVICE_TICKET_PC, f.GetServiceTicketFor(100502)); - UNIT_ASSERT_EXCEPTION_CONTAINS(f.GetServiceTicketFor("blackbox"), - TBrokenTvmClientSettings, - "Destination 'blackbox' was not specified in settings. Check your settings (if you use Qloud/YP/tvmtool - check it's settings)"); - UNIT_ASSERT_EXCEPTION_CONTAINS(f.GetServiceTicketFor(242), - TBrokenTvmClientSettings, - "Destination '242' was not specified in settings. Check your settings (if you use Qloud/YP/tvmtool - check it's settings)"); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "7: Meta info fetched from localhost:" << port << "\n" - << "6: Meta: self_tvm_id=100501, bb_env=ProdYateam, dsts=[(pass_likers:100502)]\n" - << "7: Tickets fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" - << "7: Public keys fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - l->Stream.Str()); - } - - Y_UNIT_TEST(CheckRoles) { - { // roles not configured - TTvmClient f(new TMockedUpdater(TMockedUpdater::TSettings{ - .SelfTvmId = OK_CLIENT, - })); - - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, - f.CheckServiceTicket(SRV_TICKET_123).GetStatus()); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, - f.CheckServiceTicket(SRV_TICKET_456).GetStatus()); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Malformed, - f.CheckServiceTicket("asdfg").GetStatus()); - } - - { // roles configured - NRoles::TRolesPtr roles = std::make_shared<NRoles::TRoles>( - NRoles::TRoles::TMeta{}, - NRoles::TRoles::TTvmConsumers{ - {123, std::make_shared<NRoles::TConsumerRoles>( - THashMap<TString, NRoles::TEntitiesPtr>())}, - }, - NRoles::TRoles::TUserConsumers{}, - std::make_shared<TString>()); - TTvmClient f(new TMockedUpdater(TMockedUpdater::TSettings{ - .SelfTvmId = OK_CLIENT, - .Roles = roles, - })); - - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, - f.CheckServiceTicket(SRV_TICKET_123).GetStatus()); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::NoRoles, - f.CheckServiceTicket(SRV_TICKET_456).GetStatus()); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Malformed, - f.CheckServiceTicket("asdfg").GetStatus()); - } - } -} + NTvmApi::TClientSettings s; + s.SetSelfTvmId(OK_CLIENT); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); + s.SetDiskCacheDir(GetCachePath()); + TTvmClient f = GetClient(s); + + UNIT_ASSERT_VALUES_EQUAL(TInstant(), f.GetUpdateTimeOfPublicKeys()); + UNIT_ASSERT_VALUES_EQUAL(TInstant::ParseIso8601("2050-01-01T00:00:00.000000Z"), f.GetUpdateTimeOfServiceTickets()); + UNIT_ASSERT_VALUES_EQUAL(TInstant(), f.GetInvalidationTimeOfPublicKeys()); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(std::numeric_limits<size_t>::max()), f.GetInvalidationTimeOfServiceTickets()); + + UNIT_ASSERT_VALUES_EQUAL("3:serv:CBAQ__________9_IgYIKhCUkQY:CX", f.GetServiceTicketFor("blackbox")); + UNIT_ASSERT_VALUES_EQUAL("3:serv:CBAQ__________9_IgYIKhCUkQY:CX", f.GetServiceTicketFor(19)); + UNIT_ASSERT_EXCEPTION_CONTAINS(f.GetServiceTicketFor("blackbox2"), + TBrokenTvmClientSettings, + "Destination 'blackbox2' was not specified in settings. Check your settings (if you use Qloud/YP/tvmtool - check it's settings)"); + UNIT_ASSERT_EXCEPTION_CONTAINS(f.GetServiceTicketFor(20), + TBrokenTvmClientSettings, + "Destination '20' was not specified in settings. Check your settings (if you use Qloud/YP/tvmtool - check it's settings)"); + } + + Y_UNIT_TEST(Tool) { + TPortManager pm; + ui16 port = pm.GetPort(80); + NMock::TMockServer server(port, []() { return new TTvmTool; }); + + NTvmTool::TClientSettings s("push-client"); + s.SetPort(port); + s.SetAuthToken(AUTH_TOKEN); + auto l = MakeIntrusive<TLogger>(); + { + TTvmClient f(s, l); + + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(14380887840), f.GetUpdateTimeOfPublicKeys()); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(14380887840), f.GetUpdateTimeOfServiceTickets()); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(14381406240), f.GetInvalidationTimeOfPublicKeys()); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(std::numeric_limits<time_t>::max()), f.GetInvalidationTimeOfServiceTickets()); + + UNIT_ASSERT_VALUES_EQUAL(SERVICE_TICKET_PC, f.GetServiceTicketFor("pass_likers")); + UNIT_ASSERT_VALUES_EQUAL(SERVICE_TICKET_PC, f.GetServiceTicketFor(100502)); + UNIT_ASSERT_EXCEPTION_CONTAINS(f.GetServiceTicketFor("blackbox"), + TBrokenTvmClientSettings, + "Destination 'blackbox' was not specified in settings. Check your settings (if you use Qloud/YP/tvmtool - check it's settings)"); + UNIT_ASSERT_EXCEPTION_CONTAINS(f.GetServiceTicketFor(242), + TBrokenTvmClientSettings, + "Destination '242' was not specified in settings. Check your settings (if you use Qloud/YP/tvmtool - check it's settings)"); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "7: Meta info fetched from localhost:" << port << "\n" + << "6: Meta: self_tvm_id=100501, bb_env=ProdYateam, dsts=[(pass_likers:100502)]\n" + << "7: Tickets fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" + << "7: Public keys fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + l->Stream.Str()); + } + + Y_UNIT_TEST(CheckRoles) { + { // roles not configured + TTvmClient f(new TMockedUpdater(TMockedUpdater::TSettings{ + .SelfTvmId = OK_CLIENT, + })); + + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, + f.CheckServiceTicket(SRV_TICKET_123).GetStatus()); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, + f.CheckServiceTicket(SRV_TICKET_456).GetStatus()); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Malformed, + f.CheckServiceTicket("asdfg").GetStatus()); + } + + { // roles configured + NRoles::TRolesPtr roles = std::make_shared<NRoles::TRoles>( + NRoles::TRoles::TMeta{}, + NRoles::TRoles::TTvmConsumers{ + {123, std::make_shared<NRoles::TConsumerRoles>( + THashMap<TString, NRoles::TEntitiesPtr>())}, + }, + NRoles::TRoles::TUserConsumers{}, + std::make_shared<TString>()); + TTvmClient f(new TMockedUpdater(TMockedUpdater::TSettings{ + .SelfTvmId = OK_CLIENT, + .Roles = roles, + })); + + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, + f.CheckServiceTicket(SRV_TICKET_123).GetStatus()); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::NoRoles, + f.CheckServiceTicket(SRV_TICKET_456).GetStatus()); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Malformed, + f.CheckServiceTicket("asdfg").GetStatus()); + } + } +} diff --git a/library/cpp/tvmauth/client/ut/files/public_keys b/library/cpp/tvmauth/client/ut/files/public_keys Binary files differdeleted file mode 100644 index fa683d18f3..0000000000 --- a/library/cpp/tvmauth/client/ut/files/public_keys +++ /dev/null diff --git a/library/cpp/tvmauth/client/ut/last_error_ut.cpp b/library/cpp/tvmauth/client/ut/last_error_ut.cpp index 6751e78be7..9d4f951762 100644 --- a/library/cpp/tvmauth/client/ut/last_error_ut.cpp +++ b/library/cpp/tvmauth/client/ut/last_error_ut.cpp @@ -1,56 +1,56 @@ -#include <library/cpp/tvmauth/client/misc/last_error.h> - -#include <library/cpp/testing/unittest/registar.h> - -using namespace NTvmAuth; - -Y_UNIT_TEST_SUITE(LastError) { - Y_UNIT_TEST(common) { - TLastError le; - - UNIT_ASSERT_VALUES_EQUAL("OK", - le.GetLastError(true)); - UNIT_ASSERT_VALUES_EQUAL("Internal client error: failed to collect last useful error message, please report this message to tvm-dev@yandex-team.ru", - le.GetLastError(false)); - - UNIT_ASSERT_EXCEPTION_CONTAINS(le.ThrowLastError(), - TNonRetriableException, - "Internal client error: failed to collect last useful error message"); - - le.ProcessError(TLastError::EType::Retriable, TLastError::EScope::PublicKeys, "err_re#1"); - UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_re#1", - le.GetLastError(false)); - le.ProcessError(TLastError::EType::Retriable, TLastError::EScope::PublicKeys, "err_re#2"); - UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_re#2", - le.GetLastError(false)); - le.ProcessError(TLastError::EType::NonRetriable, TLastError::EScope::PublicKeys, "err_nonre#3"); - UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_nonre#3", - le.GetLastError(false)); - le.ProcessError(TLastError::EType::NonRetriable, TLastError::EScope::PublicKeys, "err_nonre#4"); - UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_nonre#4", - le.GetLastError(false)); - le.ProcessError(TLastError::EType::Retriable, TLastError::EScope::PublicKeys, "err_re#5"); - UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_nonre#4", - le.GetLastError(false)); - UNIT_ASSERT_EXCEPTION_CONTAINS(le.ThrowLastError(), - TNonRetriableException, - "Failed to start TvmClient. Do not retry: PublicKeys: err_nonre#4"); - - le.ProcessError(TLastError::EType::Retriable, TLastError::EScope::ServiceTickets, "err_re#6"); - UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_nonre#4", - le.GetLastError(false)); - le.ProcessError(TLastError::EType::Retriable, TLastError::EScope::ServiceTickets, "err_re#7"); - UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_nonre#4", - le.GetLastError(false)); - le.ProcessError(TLastError::EType::NonRetriable, TLastError::EScope::ServiceTickets, "err_nonre#8"); - UNIT_ASSERT_VALUES_EQUAL("ServiceTickets: err_nonre#8", - le.GetLastError(false)); - - le.ClearError(TLastError::EScope::ServiceTickets); - UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_nonre#4", - le.GetLastError(false)); - le.ClearError(TLastError::EScope::PublicKeys); - UNIT_ASSERT_VALUES_EQUAL("Internal client error: failed to collect last useful error message, please report this message to tvm-dev@yandex-team.ru", - le.GetLastError(false)); - } -} +#include <library/cpp/tvmauth/client/misc/last_error.h> + +#include <library/cpp/testing/unittest/registar.h> + +using namespace NTvmAuth; + +Y_UNIT_TEST_SUITE(LastError) { + Y_UNIT_TEST(common) { + TLastError le; + + UNIT_ASSERT_VALUES_EQUAL("OK", + le.GetLastError(true)); + UNIT_ASSERT_VALUES_EQUAL("Internal client error: failed to collect last useful error message, please report this message to tvm-dev@yandex-team.ru", + le.GetLastError(false)); + + UNIT_ASSERT_EXCEPTION_CONTAINS(le.ThrowLastError(), + TNonRetriableException, + "Internal client error: failed to collect last useful error message"); + + le.ProcessError(TLastError::EType::Retriable, TLastError::EScope::PublicKeys, "err_re#1"); + UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_re#1", + le.GetLastError(false)); + le.ProcessError(TLastError::EType::Retriable, TLastError::EScope::PublicKeys, "err_re#2"); + UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_re#2", + le.GetLastError(false)); + le.ProcessError(TLastError::EType::NonRetriable, TLastError::EScope::PublicKeys, "err_nonre#3"); + UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_nonre#3", + le.GetLastError(false)); + le.ProcessError(TLastError::EType::NonRetriable, TLastError::EScope::PublicKeys, "err_nonre#4"); + UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_nonre#4", + le.GetLastError(false)); + le.ProcessError(TLastError::EType::Retriable, TLastError::EScope::PublicKeys, "err_re#5"); + UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_nonre#4", + le.GetLastError(false)); + UNIT_ASSERT_EXCEPTION_CONTAINS(le.ThrowLastError(), + TNonRetriableException, + "Failed to start TvmClient. Do not retry: PublicKeys: err_nonre#4"); + + le.ProcessError(TLastError::EType::Retriable, TLastError::EScope::ServiceTickets, "err_re#6"); + UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_nonre#4", + le.GetLastError(false)); + le.ProcessError(TLastError::EType::Retriable, TLastError::EScope::ServiceTickets, "err_re#7"); + UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_nonre#4", + le.GetLastError(false)); + le.ProcessError(TLastError::EType::NonRetriable, TLastError::EScope::ServiceTickets, "err_nonre#8"); + UNIT_ASSERT_VALUES_EQUAL("ServiceTickets: err_nonre#8", + le.GetLastError(false)); + + le.ClearError(TLastError::EScope::ServiceTickets); + UNIT_ASSERT_VALUES_EQUAL("PublicKeys: err_nonre#4", + le.GetLastError(false)); + le.ClearError(TLastError::EScope::PublicKeys); + UNIT_ASSERT_VALUES_EQUAL("Internal client error: failed to collect last useful error message, please report this message to tvm-dev@yandex-team.ru", + le.GetLastError(false)); + } +} diff --git a/library/cpp/tvmauth/client/ut/logger_ut.cpp b/library/cpp/tvmauth/client/ut/logger_ut.cpp index 76236e8913..e84a123c79 100644 --- a/library/cpp/tvmauth/client/ut/logger_ut.cpp +++ b/library/cpp/tvmauth/client/ut/logger_ut.cpp @@ -1,43 +1,43 @@ -#include "common.h" - -#include <library/cpp/tvmauth/client/logger.h> - +#include "common.h" + +#include <library/cpp/tvmauth/client/logger.h> + #include <library/cpp/testing/unittest/registar.h> - -using namespace NTvmAuth; - + +using namespace NTvmAuth; + Y_UNIT_TEST_SUITE(ClientLogger) { - int i = 0; - + int i = 0; + Y_UNIT_TEST(Debug) { - TLogger l; - l.Debug("qwerty"); - UNIT_ASSERT_VALUES_EQUAL("7: qwerty\n", l.Stream.Str()); - } - + TLogger l; + l.Debug("qwerty"); + UNIT_ASSERT_VALUES_EQUAL("7: qwerty\n", l.Stream.Str()); + } + Y_UNIT_TEST(Info) { - TLogger l; - l.Info("qwerty"); - UNIT_ASSERT_VALUES_EQUAL("6: qwerty\n", l.Stream.Str()); - } - + TLogger l; + l.Info("qwerty"); + UNIT_ASSERT_VALUES_EQUAL("6: qwerty\n", l.Stream.Str()); + } + Y_UNIT_TEST(Warning) { - TLogger l; - l.Warning("qwerty"); - UNIT_ASSERT_VALUES_EQUAL("4: qwerty\n", l.Stream.Str()); - } - + TLogger l; + l.Warning("qwerty"); + UNIT_ASSERT_VALUES_EQUAL("4: qwerty\n", l.Stream.Str()); + } + Y_UNIT_TEST(Error) { - TLogger l; - l.Error("qwerty"); - UNIT_ASSERT_VALUES_EQUAL("3: qwerty\n", l.Stream.Str()); - } - -#ifdef _unix_ + TLogger l; + l.Error("qwerty"); + UNIT_ASSERT_VALUES_EQUAL("3: qwerty\n", l.Stream.Str()); + } + +#ifdef _unix_ Y_UNIT_TEST(Cerr_) { - TCerrLogger l(5); - l.Error("hit"); - l.Debug("miss"); - } -#endif -} + TCerrLogger l(5); + l.Error("hit"); + l.Debug("miss"); + } +#endif +} diff --git a/library/cpp/tvmauth/client/ut/roles/decoder_ut.cpp b/library/cpp/tvmauth/client/ut/roles/decoder_ut.cpp index 0ee5fc7cb7..28984bc1d5 100644 --- a/library/cpp/tvmauth/client/ut/roles/decoder_ut.cpp +++ b/library/cpp/tvmauth/client/ut/roles/decoder_ut.cpp @@ -1,163 +1,163 @@ -#include <library/cpp/tvmauth/client/exception.h> -#include <library/cpp/tvmauth/client/misc/roles/decoder.h> - -#include <library/cpp/tvmauth/unittest.h> -#include <library/cpp/tvmauth/src/utils.h> - -#include <library/cpp/testing/unittest/registar.h> - -using namespace NTvmAuth; -using namespace NTvmAuth::NRoles; - -Y_UNIT_TEST_SUITE(Decoder) { - const TString BROTLI = NUtils::Base64url2bin("GyMAAAR0Y6ku58ObclAQzDweUSUwbdqc5yOOKgI"); - const TString GZIP = NUtils::Base64url2bin("H4sIAAAAAAAA_yrOz01VKEstqkTGCpm5BflFJYl5JQpJOflJgAAAAP__MbeeiSQAAAA"); - const TString ZSTD = NUtils::Base64url2bin("KLUv_QBY9AAAwHNvbWUgdmVyeSBpbXBvcnRhbnQgYmxvYgEAc-4IAQAA"); - - Y_UNIT_TEST(Decode) { - // Errs - UNIT_ASSERT_EXCEPTION_CONTAINS( - TDecoder::Decode( - "1:brotli:10000:88839244E8C7C426B20729AF1A13AD792C5FA83C7F2FB6ADCFC60DA1B5EF9603", - TString(BROTLI)), - yexception, - "Decoded blob has bad size: expected 10000, actual 36"); - UNIT_ASSERT_EXCEPTION_CONTAINS( - TDecoder::Decode( - "1:brotli:36:88839244E8C7C426B20729AF1A13AD792C5FA83C7F2FB6ADCFC60DA1B5EF0000", - TString(BROTLI)), - yexception, - "Decoded blob has bad sha256"); - - // OK - TString decoded; - UNIT_ASSERT_NO_EXCEPTION( - decoded = TDecoder::Decode("", "some veryveryveryvery important blob")); - UNIT_ASSERT_VALUES_EQUAL(decoded, "some veryveryveryvery important blob"); - - UNIT_ASSERT_NO_EXCEPTION( - decoded = TDecoder::Decode( - "1:brotli:36:88839244E8C7C426B20729AF1A13AD792C5FA83C7F2FB6ADCFC60DA1B5EF9603", - TString(BROTLI))); - UNIT_ASSERT_VALUES_EQUAL(decoded, "some veryveryveryvery important blob"); - - UNIT_ASSERT_NO_EXCEPTION( - decoded = TDecoder::Decode( - "1:gzip:36:88839244E8C7C426B20729AF1A13AD792C5FA83C7F2FB6ADCFC60DA1B5EF9603", - TString(GZIP))); - UNIT_ASSERT_VALUES_EQUAL(decoded, "some veryveryveryvery important blob"); - - UNIT_ASSERT_NO_EXCEPTION( - decoded = TDecoder::Decode( - "1:zstd:36:88839244E8C7C426B20729AF1A13AD792C5FA83C7F2FB6ADCFC60DA1B5EF9603", - TString(ZSTD))); - UNIT_ASSERT_VALUES_EQUAL(decoded, "some veryveryveryvery important blob"); - } - - Y_UNIT_TEST(UnknownCodecs) { - for (const TStringBuf codec : {"lz", "lzma", "kek"}) { - UNIT_ASSERT_EXCEPTION_CONTAINS( - TDecoder::DecodeImpl(codec, ""), - yexception, - TStringBuilder() << "unknown codec: '" << codec << "'"); - } - } - - Y_UNIT_TEST(ParseCodec) { - UNIT_ASSERT_EXCEPTION_CONTAINS( - TDecoder::ParseCodec("2:kek"), - yexception, - "unknown codec format version; known: 1; got: 2"); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - TDecoder::ParseCodec("1:::"), - yexception, - "codec type is empty"); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - TDecoder::ParseCodec("1:some_codec:asd:"), - yexception, - "decoded blob size is not number"); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - TDecoder::ParseCodec("1:some_codec:789:qwe"), - yexception, - "sha256 of decoded blob has invalid length: expected 64, got 3"); - - TDecoder::TCodecInfo info; - UNIT_ASSERT_NO_EXCEPTION( - info = TDecoder::ParseCodec("1:some_codec:789:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")); - - UNIT_ASSERT_VALUES_EQUAL("some_codec", info.Type); - UNIT_ASSERT_VALUES_EQUAL(789, info.Size); - UNIT_ASSERT_VALUES_EQUAL("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - info.Sha256); - } - - Y_UNIT_TEST(DecodeBrolti) { - UNIT_ASSERT_EXCEPTION( - TDecoder::DecodeBrolti(""), - yexception); - - TString blob; - UNIT_ASSERT_NO_EXCEPTION( - blob = TDecoder::DecodeBrolti( - TString(BROTLI))); - - UNIT_ASSERT_VALUES_EQUAL( - "some veryveryveryvery important blob", - blob); - } - - Y_UNIT_TEST(DecodeGzip) { - TString blob; - UNIT_ASSERT_NO_EXCEPTION(blob = TDecoder::DecodeGzip("")); - UNIT_ASSERT_VALUES_EQUAL("", blob); - - UNIT_ASSERT_NO_EXCEPTION( - blob = TDecoder::DecodeGzip( - TString(GZIP))); - - UNIT_ASSERT_VALUES_EQUAL( - "some veryveryveryvery important blob", - blob); - } - - Y_UNIT_TEST(DecodeZstd) { - TString blob; - UNIT_ASSERT_NO_EXCEPTION(blob = TDecoder::DecodeZstd("")); - UNIT_ASSERT_VALUES_EQUAL("", blob); - - UNIT_ASSERT_NO_EXCEPTION( - blob = TDecoder::DecodeZstd( - TString(ZSTD))); - - UNIT_ASSERT_VALUES_EQUAL( - "some veryveryveryvery important blob", - blob); - } - - Y_UNIT_TEST(VerifySize) { - UNIT_ASSERT_EXCEPTION_CONTAINS( - TDecoder::VerifySize("qwerty", 100), - yexception, - TStringBuilder() << "Decoded blob has bad size: expected 100, actual 6"); - - UNIT_ASSERT_NO_EXCEPTION(TDecoder::VerifySize("qwert", 5)); - } - - Y_UNIT_TEST(VerifyChecksum) { - UNIT_ASSERT_EXCEPTION_CONTAINS( - TDecoder::VerifyChecksum("qwerty", "zzzz"), - yexception, - "Decoded blob has bad sha256: expected=zzzz," - " actual=65E84BE33532FB784C48129675F9EFF3A682B27168C0EA744B2CF58EE02337C5"); - - UNIT_ASSERT_NO_EXCEPTION( - TDecoder::VerifyChecksum("qwerty", - "65E84BE33532FB784C48129675F9EFF3A682B27168C0EA744B2CF58EE02337C5")); - UNIT_ASSERT_NO_EXCEPTION( - TDecoder::VerifyChecksum("qwerty", - "65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5")); - } -} +#include <library/cpp/tvmauth/client/exception.h> +#include <library/cpp/tvmauth/client/misc/roles/decoder.h> + +#include <library/cpp/tvmauth/unittest.h> +#include <library/cpp/tvmauth/src/utils.h> + +#include <library/cpp/testing/unittest/registar.h> + +using namespace NTvmAuth; +using namespace NTvmAuth::NRoles; + +Y_UNIT_TEST_SUITE(Decoder) { + const TString BROTLI = NUtils::Base64url2bin("GyMAAAR0Y6ku58ObclAQzDweUSUwbdqc5yOOKgI"); + const TString GZIP = NUtils::Base64url2bin("H4sIAAAAAAAA_yrOz01VKEstqkTGCpm5BflFJYl5JQpJOflJgAAAAP__MbeeiSQAAAA"); + const TString ZSTD = NUtils::Base64url2bin("KLUv_QBY9AAAwHNvbWUgdmVyeSBpbXBvcnRhbnQgYmxvYgEAc-4IAQAA"); + + Y_UNIT_TEST(Decode) { + // Errs + UNIT_ASSERT_EXCEPTION_CONTAINS( + TDecoder::Decode( + "1:brotli:10000:88839244E8C7C426B20729AF1A13AD792C5FA83C7F2FB6ADCFC60DA1B5EF9603", + TString(BROTLI)), + yexception, + "Decoded blob has bad size: expected 10000, actual 36"); + UNIT_ASSERT_EXCEPTION_CONTAINS( + TDecoder::Decode( + "1:brotli:36:88839244E8C7C426B20729AF1A13AD792C5FA83C7F2FB6ADCFC60DA1B5EF0000", + TString(BROTLI)), + yexception, + "Decoded blob has bad sha256"); + + // OK + TString decoded; + UNIT_ASSERT_NO_EXCEPTION( + decoded = TDecoder::Decode("", "some veryveryveryvery important blob")); + UNIT_ASSERT_VALUES_EQUAL(decoded, "some veryveryveryvery important blob"); + + UNIT_ASSERT_NO_EXCEPTION( + decoded = TDecoder::Decode( + "1:brotli:36:88839244E8C7C426B20729AF1A13AD792C5FA83C7F2FB6ADCFC60DA1B5EF9603", + TString(BROTLI))); + UNIT_ASSERT_VALUES_EQUAL(decoded, "some veryveryveryvery important blob"); + + UNIT_ASSERT_NO_EXCEPTION( + decoded = TDecoder::Decode( + "1:gzip:36:88839244E8C7C426B20729AF1A13AD792C5FA83C7F2FB6ADCFC60DA1B5EF9603", + TString(GZIP))); + UNIT_ASSERT_VALUES_EQUAL(decoded, "some veryveryveryvery important blob"); + + UNIT_ASSERT_NO_EXCEPTION( + decoded = TDecoder::Decode( + "1:zstd:36:88839244E8C7C426B20729AF1A13AD792C5FA83C7F2FB6ADCFC60DA1B5EF9603", + TString(ZSTD))); + UNIT_ASSERT_VALUES_EQUAL(decoded, "some veryveryveryvery important blob"); + } + + Y_UNIT_TEST(UnknownCodecs) { + for (const TStringBuf codec : {"lz", "lzma", "kek"}) { + UNIT_ASSERT_EXCEPTION_CONTAINS( + TDecoder::DecodeImpl(codec, ""), + yexception, + TStringBuilder() << "unknown codec: '" << codec << "'"); + } + } + + Y_UNIT_TEST(ParseCodec) { + UNIT_ASSERT_EXCEPTION_CONTAINS( + TDecoder::ParseCodec("2:kek"), + yexception, + "unknown codec format version; known: 1; got: 2"); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + TDecoder::ParseCodec("1:::"), + yexception, + "codec type is empty"); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + TDecoder::ParseCodec("1:some_codec:asd:"), + yexception, + "decoded blob size is not number"); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + TDecoder::ParseCodec("1:some_codec:789:qwe"), + yexception, + "sha256 of decoded blob has invalid length: expected 64, got 3"); + + TDecoder::TCodecInfo info; + UNIT_ASSERT_NO_EXCEPTION( + info = TDecoder::ParseCodec("1:some_codec:789:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")); + + UNIT_ASSERT_VALUES_EQUAL("some_codec", info.Type); + UNIT_ASSERT_VALUES_EQUAL(789, info.Size); + UNIT_ASSERT_VALUES_EQUAL("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + info.Sha256); + } + + Y_UNIT_TEST(DecodeBrolti) { + UNIT_ASSERT_EXCEPTION( + TDecoder::DecodeBrolti(""), + yexception); + + TString blob; + UNIT_ASSERT_NO_EXCEPTION( + blob = TDecoder::DecodeBrolti( + TString(BROTLI))); + + UNIT_ASSERT_VALUES_EQUAL( + "some veryveryveryvery important blob", + blob); + } + + Y_UNIT_TEST(DecodeGzip) { + TString blob; + UNIT_ASSERT_NO_EXCEPTION(blob = TDecoder::DecodeGzip("")); + UNIT_ASSERT_VALUES_EQUAL("", blob); + + UNIT_ASSERT_NO_EXCEPTION( + blob = TDecoder::DecodeGzip( + TString(GZIP))); + + UNIT_ASSERT_VALUES_EQUAL( + "some veryveryveryvery important blob", + blob); + } + + Y_UNIT_TEST(DecodeZstd) { + TString blob; + UNIT_ASSERT_NO_EXCEPTION(blob = TDecoder::DecodeZstd("")); + UNIT_ASSERT_VALUES_EQUAL("", blob); + + UNIT_ASSERT_NO_EXCEPTION( + blob = TDecoder::DecodeZstd( + TString(ZSTD))); + + UNIT_ASSERT_VALUES_EQUAL( + "some veryveryveryvery important blob", + blob); + } + + Y_UNIT_TEST(VerifySize) { + UNIT_ASSERT_EXCEPTION_CONTAINS( + TDecoder::VerifySize("qwerty", 100), + yexception, + TStringBuilder() << "Decoded blob has bad size: expected 100, actual 6"); + + UNIT_ASSERT_NO_EXCEPTION(TDecoder::VerifySize("qwert", 5)); + } + + Y_UNIT_TEST(VerifyChecksum) { + UNIT_ASSERT_EXCEPTION_CONTAINS( + TDecoder::VerifyChecksum("qwerty", "zzzz"), + yexception, + "Decoded blob has bad sha256: expected=zzzz," + " actual=65E84BE33532FB784C48129675F9EFF3A682B27168C0EA744B2CF58EE02337C5"); + + UNIT_ASSERT_NO_EXCEPTION( + TDecoder::VerifyChecksum("qwerty", + "65E84BE33532FB784C48129675F9EFF3A682B27168C0EA744B2CF58EE02337C5")); + UNIT_ASSERT_NO_EXCEPTION( + TDecoder::VerifyChecksum("qwerty", + "65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5")); + } +} diff --git a/library/cpp/tvmauth/client/ut/roles/entities_index_ut.cpp b/library/cpp/tvmauth/client/ut/roles/entities_index_ut.cpp index 7e62a87b64..14ed9b79cf 100644 --- a/library/cpp/tvmauth/client/ut/roles/entities_index_ut.cpp +++ b/library/cpp/tvmauth/client/ut/roles/entities_index_ut.cpp @@ -1,358 +1,358 @@ -#include <library/cpp/tvmauth/client/ut/common.h> - -#include <library/cpp/tvmauth/client/misc/roles/entities_index.h> - -#include <library/cpp/testing/unittest/registar.h> - -#include <array> - -using namespace NTvmAuth::NRoles; - -Y_UNIT_TEST_SUITE(RolesEntitiesIndex) { - Y_UNIT_TEST(Stage) { - TEntitiesIndex::TStage stage({ - "key#1", - "key#2", - "key#3", - "key#4", - }); - - const std::vector<std::vector<TString>> results = { - {"key#1"}, - {"key#2"}, - {"key#1", "key#2"}, - {"key#3"}, - {"key#1", "key#3"}, - {"key#2", "key#3"}, - {"key#1", "key#2", "key#3"}, - {"key#4"}, - {"key#1", "key#4"}, - {"key#2", "key#4"}, - {"key#1", "key#2", "key#4"}, - {"key#3", "key#4"}, - {"key#1", "key#3", "key#4"}, - {"key#2", "key#3", "key#4"}, - {"key#1", "key#2", "key#3", "key#4"}, - }; - - std::vector<TString> keys; - for (const std::vector<TString>& res : results) { - UNIT_ASSERT(stage.GetNextKeySet(keys)); - UNIT_ASSERT_VALUES_EQUAL(keys, res); - } - - UNIT_ASSERT_C(!stage.GetNextKeySet(keys), keys); - } - - Y_UNIT_TEST(GetUniqueSortedKeys) { - std::vector<TEntityPtr> entities; - - UNIT_ASSERT_VALUES_EQUAL(std::set<TString>(), - TEntitiesIndex::GetUniqueSortedKeys(entities)); - - entities = { - std::make_shared<TEntity>(), - }; - UNIT_ASSERT_VALUES_EQUAL(std::set<TString>(), - TEntitiesIndex::GetUniqueSortedKeys(entities)); - - entities = { - std::make_shared<TEntity>(TEntity{ - {"key#1", "value#1"}, - }), - }; - UNIT_ASSERT_VALUES_EQUAL(std::set<TString>({ - "key#1", - }), - TEntitiesIndex::GetUniqueSortedKeys(entities)); - - entities = { - std::make_shared<TEntity>(TEntity{ - {"key#1", "value#1"}, - }), - std::make_shared<TEntity>(TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#22"}, - }), - }; - UNIT_ASSERT_VALUES_EQUAL(std::set<TString>({ - "key#1", - "key#2", - }), - TEntitiesIndex::GetUniqueSortedKeys(entities)); - } - - Y_UNIT_TEST(MakeUnique) { - const TEntityPtr entityA = std::make_shared<TEntity>(TEntity{{"key#1", "aaaa"}}); - const TEntityPtr entityA2 = std::make_shared<TEntity>(TEntity{{"key#1", "aaaa"}}); - const TEntityPtr entityB = std::make_shared<TEntity>(TEntity{{"key#1", "bbbb"}}); - - TEntitiesIndex::TSubTree idx = { - std::vector<TEntityPtr>{ - entityA, - entityA, - }, - TEntitiesIndex::TIdxByAttrs{ - { - TKeyValue{"key#1", "value#11"}, - TEntitiesIndex::TSubTree{ - std::vector<TEntityPtr>{ - entityA, - entityB, - entityA, - }, - TEntitiesIndex::TIdxByAttrs{ - { - TKeyValue{"key#2", "value#21"}, - TEntitiesIndex::TSubTree{ - std::vector<TEntityPtr>{ - entityA, - entityB, - entityA, - }, - TEntitiesIndex::TIdxByAttrs{}, - }, - }, - }, - }, - }, - { - TKeyValue{"key#1", "value#12"}, - TEntitiesIndex::TSubTree{ - std::vector<TEntityPtr>{ - entityA, - entityB, - entityA2, - }, - TEntitiesIndex::TIdxByAttrs{}, - }, - }, - }, - }; - - TEntitiesIndex::MakeUnique(idx); - - UNIT_ASSERT_VALUES_EQUAL(idx.Entities.size(), 1); - - auto it = idx.SubTree.find(TKeyValue{"key#1", "value#12"}); - UNIT_ASSERT(it != idx.SubTree.end()); - UNIT_ASSERT_VALUES_EQUAL(it->second.Entities.size(), 2); - - it = idx.SubTree.find(TKeyValue{"key#1", "value#11"}); - UNIT_ASSERT(it != idx.SubTree.end()); - UNIT_ASSERT_VALUES_EQUAL(it->second.Entities.size(), 2); - - it = it->second.SubTree.find(TKeyValue{"key#2", "value#21"}); - UNIT_ASSERT(it != it->second.SubTree.end()); - UNIT_ASSERT_VALUES_EQUAL(it->second.Entities.size(), 2); - } - - Y_UNIT_TEST(GetByAttrs) { - const TEntitiesIndex index = CreateEntitiesIndex(); - - UNIT_ASSERT_STRINGS_EQUAL( - index.PrintDebugString(), - R"( -"key#1/value#11" - "key#2/value#22" - "key#3/value#33" - "key#2/value#23" - "key#3/value#33" - "key#3/value#33" -"key#1/value#13" - "key#3/value#33" -"key#2/value#22" - "key#3/value#33" -"key#2/value#23" - "key#3/value#33" -"key#3/value#33" -)"); - - struct TCase { - TEntity AttrsToFind; - std::vector<TEntity> Result; - }; - - std::vector<TCase> cases = { - { - TEntity{}, - std::vector<TEntity>{ - TEntity{ - {"key#1", "value#11"}, - }, - TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#22"}, - {"key#3", "value#33"}, - }, - TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#23"}, - {"key#3", "value#33"}, - }, - TEntity{ - {"key#1", "value#13"}, - {"key#3", "value#33"}, - }, - }, - }, - { - TEntity{ - {"key#1", "value#11"}, - }, - std::vector<TEntity>{ - TEntity{ - {"key#1", "value#11"}, - }, - TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#22"}, - {"key#3", "value#33"}, - }, - TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#23"}, - {"key#3", "value#33"}, - }, - }, - }, - { - TEntity{ - {"key#1", "value#13"}, - }, - std::vector<TEntity>{ - TEntity{ - {"key#1", "value#13"}, - {"key#3", "value#33"}, - }, - }, - }, - { - TEntity{ - {"key#1", "value#14"}, - }, - std::vector<TEntity>{}, - }, - { - TEntity{ - {"key#2", "value#22"}, - }, - std::vector<TEntity>{ - TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#22"}, - {"key#3", "value#33"}, - }, - }, - }, - { - TEntity{ - {"key#3", "value#33"}, - }, - std::vector<TEntity>{ - TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#22"}, - {"key#3", "value#33"}, - }, - TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#23"}, - {"key#3", "value#33"}, - }, - TEntity{ - {"key#1", "value#13"}, - {"key#3", "value#33"}, - }, - }, - }, - }; - - for (const TCase& c : cases) { - std::vector<TEntityPtr> expected; - for (const TEntity& e : c.Result) { - expected.push_back(std::make_shared<TEntity>(e)); - } - - UNIT_ASSERT_VALUES_EQUAL_C( - index.GetEntitiesWithAttrs(c.AttrsToFind.begin(), c.AttrsToFind.end()), - expected, - "'" << c.AttrsToFind << "'"); - } - } - - Y_UNIT_TEST(Contains) { - const TEntitiesIndex index = CreateEntitiesIndex(); - - struct TCase { - TEntity Exact; - bool Result = false; - }; - - std::vector<TCase> cases = { - { - TEntity{}, - false, - }, - { - TEntity{ - {"key#1", "value#11"}, - }, - true, - }, - { - TEntity{ - {"key#1", "value#13"}, - }, - false, - }, - { - TEntity{ - {"key#1", "value#13"}, - {"key#3", "value#33"}, - }, - true, - }, - }; - - for (const TCase& c : cases) { - UNIT_ASSERT_VALUES_EQUAL_C( - index.ContainsExactEntity(c.Exact.begin(), c.Exact.end()), - c.Result, - "'" << c.Exact << "'"); - } - } -} - -template <> -void Out<std::vector<TString>>(IOutputStream& o, const std::vector<TString>& s) { - for (const auto& key : s) { - o << key << ","; - } -} - -template <> -void Out<std::set<TString>>(IOutputStream& o, const std::set<TString>& s) { - for (const auto& key : s) { - o << key << ","; - } -} - -template <> -void Out<std::vector<TEntityPtr>>(IOutputStream& o, const std::vector<TEntityPtr>& v) { - for (const TEntityPtr& p : v) { - o << *p << Endl; - } -} - -template <> -void Out<TEntityPtr>(IOutputStream& o, const TEntityPtr& v) { - o << *v; -} - -template <> -void Out<TEntity>(IOutputStream& o, const TEntity& v) { - for (const auto& [key, value] : v) { - o << key << "->" << value << Endl; - } -} +#include <library/cpp/tvmauth/client/ut/common.h> + +#include <library/cpp/tvmauth/client/misc/roles/entities_index.h> + +#include <library/cpp/testing/unittest/registar.h> + +#include <array> + +using namespace NTvmAuth::NRoles; + +Y_UNIT_TEST_SUITE(RolesEntitiesIndex) { + Y_UNIT_TEST(Stage) { + TEntitiesIndex::TStage stage({ + "key#1", + "key#2", + "key#3", + "key#4", + }); + + const std::vector<std::vector<TString>> results = { + {"key#1"}, + {"key#2"}, + {"key#1", "key#2"}, + {"key#3"}, + {"key#1", "key#3"}, + {"key#2", "key#3"}, + {"key#1", "key#2", "key#3"}, + {"key#4"}, + {"key#1", "key#4"}, + {"key#2", "key#4"}, + {"key#1", "key#2", "key#4"}, + {"key#3", "key#4"}, + {"key#1", "key#3", "key#4"}, + {"key#2", "key#3", "key#4"}, + {"key#1", "key#2", "key#3", "key#4"}, + }; + + std::vector<TString> keys; + for (const std::vector<TString>& res : results) { + UNIT_ASSERT(stage.GetNextKeySet(keys)); + UNIT_ASSERT_VALUES_EQUAL(keys, res); + } + + UNIT_ASSERT_C(!stage.GetNextKeySet(keys), keys); + } + + Y_UNIT_TEST(GetUniqueSortedKeys) { + std::vector<TEntityPtr> entities; + + UNIT_ASSERT_VALUES_EQUAL(std::set<TString>(), + TEntitiesIndex::GetUniqueSortedKeys(entities)); + + entities = { + std::make_shared<TEntity>(), + }; + UNIT_ASSERT_VALUES_EQUAL(std::set<TString>(), + TEntitiesIndex::GetUniqueSortedKeys(entities)); + + entities = { + std::make_shared<TEntity>(TEntity{ + {"key#1", "value#1"}, + }), + }; + UNIT_ASSERT_VALUES_EQUAL(std::set<TString>({ + "key#1", + }), + TEntitiesIndex::GetUniqueSortedKeys(entities)); + + entities = { + std::make_shared<TEntity>(TEntity{ + {"key#1", "value#1"}, + }), + std::make_shared<TEntity>(TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#22"}, + }), + }; + UNIT_ASSERT_VALUES_EQUAL(std::set<TString>({ + "key#1", + "key#2", + }), + TEntitiesIndex::GetUniqueSortedKeys(entities)); + } + + Y_UNIT_TEST(MakeUnique) { + const TEntityPtr entityA = std::make_shared<TEntity>(TEntity{{"key#1", "aaaa"}}); + const TEntityPtr entityA2 = std::make_shared<TEntity>(TEntity{{"key#1", "aaaa"}}); + const TEntityPtr entityB = std::make_shared<TEntity>(TEntity{{"key#1", "bbbb"}}); + + TEntitiesIndex::TSubTree idx = { + std::vector<TEntityPtr>{ + entityA, + entityA, + }, + TEntitiesIndex::TIdxByAttrs{ + { + TKeyValue{"key#1", "value#11"}, + TEntitiesIndex::TSubTree{ + std::vector<TEntityPtr>{ + entityA, + entityB, + entityA, + }, + TEntitiesIndex::TIdxByAttrs{ + { + TKeyValue{"key#2", "value#21"}, + TEntitiesIndex::TSubTree{ + std::vector<TEntityPtr>{ + entityA, + entityB, + entityA, + }, + TEntitiesIndex::TIdxByAttrs{}, + }, + }, + }, + }, + }, + { + TKeyValue{"key#1", "value#12"}, + TEntitiesIndex::TSubTree{ + std::vector<TEntityPtr>{ + entityA, + entityB, + entityA2, + }, + TEntitiesIndex::TIdxByAttrs{}, + }, + }, + }, + }; + + TEntitiesIndex::MakeUnique(idx); + + UNIT_ASSERT_VALUES_EQUAL(idx.Entities.size(), 1); + + auto it = idx.SubTree.find(TKeyValue{"key#1", "value#12"}); + UNIT_ASSERT(it != idx.SubTree.end()); + UNIT_ASSERT_VALUES_EQUAL(it->second.Entities.size(), 2); + + it = idx.SubTree.find(TKeyValue{"key#1", "value#11"}); + UNIT_ASSERT(it != idx.SubTree.end()); + UNIT_ASSERT_VALUES_EQUAL(it->second.Entities.size(), 2); + + it = it->second.SubTree.find(TKeyValue{"key#2", "value#21"}); + UNIT_ASSERT(it != it->second.SubTree.end()); + UNIT_ASSERT_VALUES_EQUAL(it->second.Entities.size(), 2); + } + + Y_UNIT_TEST(GetByAttrs) { + const TEntitiesIndex index = CreateEntitiesIndex(); + + UNIT_ASSERT_STRINGS_EQUAL( + index.PrintDebugString(), + R"( +"key#1/value#11" + "key#2/value#22" + "key#3/value#33" + "key#2/value#23" + "key#3/value#33" + "key#3/value#33" +"key#1/value#13" + "key#3/value#33" +"key#2/value#22" + "key#3/value#33" +"key#2/value#23" + "key#3/value#33" +"key#3/value#33" +)"); + + struct TCase { + TEntity AttrsToFind; + std::vector<TEntity> Result; + }; + + std::vector<TCase> cases = { + { + TEntity{}, + std::vector<TEntity>{ + TEntity{ + {"key#1", "value#11"}, + }, + TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#22"}, + {"key#3", "value#33"}, + }, + TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#23"}, + {"key#3", "value#33"}, + }, + TEntity{ + {"key#1", "value#13"}, + {"key#3", "value#33"}, + }, + }, + }, + { + TEntity{ + {"key#1", "value#11"}, + }, + std::vector<TEntity>{ + TEntity{ + {"key#1", "value#11"}, + }, + TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#22"}, + {"key#3", "value#33"}, + }, + TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#23"}, + {"key#3", "value#33"}, + }, + }, + }, + { + TEntity{ + {"key#1", "value#13"}, + }, + std::vector<TEntity>{ + TEntity{ + {"key#1", "value#13"}, + {"key#3", "value#33"}, + }, + }, + }, + { + TEntity{ + {"key#1", "value#14"}, + }, + std::vector<TEntity>{}, + }, + { + TEntity{ + {"key#2", "value#22"}, + }, + std::vector<TEntity>{ + TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#22"}, + {"key#3", "value#33"}, + }, + }, + }, + { + TEntity{ + {"key#3", "value#33"}, + }, + std::vector<TEntity>{ + TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#22"}, + {"key#3", "value#33"}, + }, + TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#23"}, + {"key#3", "value#33"}, + }, + TEntity{ + {"key#1", "value#13"}, + {"key#3", "value#33"}, + }, + }, + }, + }; + + for (const TCase& c : cases) { + std::vector<TEntityPtr> expected; + for (const TEntity& e : c.Result) { + expected.push_back(std::make_shared<TEntity>(e)); + } + + UNIT_ASSERT_VALUES_EQUAL_C( + index.GetEntitiesWithAttrs(c.AttrsToFind.begin(), c.AttrsToFind.end()), + expected, + "'" << c.AttrsToFind << "'"); + } + } + + Y_UNIT_TEST(Contains) { + const TEntitiesIndex index = CreateEntitiesIndex(); + + struct TCase { + TEntity Exact; + bool Result = false; + }; + + std::vector<TCase> cases = { + { + TEntity{}, + false, + }, + { + TEntity{ + {"key#1", "value#11"}, + }, + true, + }, + { + TEntity{ + {"key#1", "value#13"}, + }, + false, + }, + { + TEntity{ + {"key#1", "value#13"}, + {"key#3", "value#33"}, + }, + true, + }, + }; + + for (const TCase& c : cases) { + UNIT_ASSERT_VALUES_EQUAL_C( + index.ContainsExactEntity(c.Exact.begin(), c.Exact.end()), + c.Result, + "'" << c.Exact << "'"); + } + } +} + +template <> +void Out<std::vector<TString>>(IOutputStream& o, const std::vector<TString>& s) { + for (const auto& key : s) { + o << key << ","; + } +} + +template <> +void Out<std::set<TString>>(IOutputStream& o, const std::set<TString>& s) { + for (const auto& key : s) { + o << key << ","; + } +} + +template <> +void Out<std::vector<TEntityPtr>>(IOutputStream& o, const std::vector<TEntityPtr>& v) { + for (const TEntityPtr& p : v) { + o << *p << Endl; + } +} + +template <> +void Out<TEntityPtr>(IOutputStream& o, const TEntityPtr& v) { + o << *v; +} + +template <> +void Out<TEntity>(IOutputStream& o, const TEntity& v) { + for (const auto& [key, value] : v) { + o << key << "->" << value << Endl; + } +} diff --git a/library/cpp/tvmauth/client/ut/roles/parser_ut.cpp b/library/cpp/tvmauth/client/ut/roles/parser_ut.cpp index 87f8ade267..df866501b5 100644 --- a/library/cpp/tvmauth/client/ut/roles/parser_ut.cpp +++ b/library/cpp/tvmauth/client/ut/roles/parser_ut.cpp @@ -1,160 +1,160 @@ -#include <library/cpp/tvmauth/client/misc/roles/parser.h> - -#include <library/cpp/tvmauth/unittest.h> - -#include <library/cpp/json/json_reader.h> -#include <library/cpp/testing/unittest/registar.h> - -using namespace NTvmAuth; -using namespace NTvmAuth::NRoles; - -Y_UNIT_TEST_SUITE(Parser) { - static NJson::TJsonValue ToJsonValue(TStringBuf body) { - NJson::TJsonValue doc; - UNIT_ASSERT(NJson::ReadJsonTree(body, &doc)); - return doc; - } - - Y_UNIT_TEST(GetEntity) { - UNIT_ASSERT_EXCEPTION_CONTAINS( - TParser::GetEntity(ToJsonValue(R"({"scope": false})"), - "cons", - "read"), - yexception, - "entity is map (str->str), got value Boolean. consumer 'cons' with role 'read'"); - - TEntityPtr en; - UNIT_ASSERT_NO_EXCEPTION( - en = TParser::GetEntity(ToJsonValue(R"({})"), - "cons", - "read")); - UNIT_ASSERT_VALUES_EQUAL(en->size(), 0); - - UNIT_ASSERT_NO_EXCEPTION( - en = TParser::GetEntity(ToJsonValue(R"({"key1": "val1", "key2": "val2"})"), - "cons", - "read")); - UNIT_ASSERT_VALUES_EQUAL(en->size(), 2); - } - - Y_UNIT_TEST(GetEntities) { - UNIT_ASSERT_EXCEPTION_CONTAINS( - TParser::GetEntities(ToJsonValue(R"([{},[]])"), - "cons", - "read"), - yexception, - "role entity for role must be map: consumer 'cons' with role 'read' has Array"); - - TEntitiesPtr en; - UNIT_ASSERT_NO_EXCEPTION( - en = TParser::GetEntities(ToJsonValue(R"([])"), - "cons", - "read")); - UNIT_ASSERT(!en->Contains({})); - - UNIT_ASSERT_NO_EXCEPTION( - en = TParser::GetEntities(ToJsonValue(R"([{}])"), - "cons", - "read")); - UNIT_ASSERT(en->Contains({})); - } - - Y_UNIT_TEST(GetConsumer) { - UNIT_ASSERT_EXCEPTION_CONTAINS( - TParser::GetConsumer(ToJsonValue(R"({"role1": [],"role2": {}})"), - "cons"), - yexception, - "entities for roles must be array: 'role2' is Map"); - - TConsumerRolesPtr c; - UNIT_ASSERT_NO_EXCEPTION( - c = TParser::GetConsumer(ToJsonValue(R"({"role1": [],"role2": []})"), - "cons")); - UNIT_ASSERT(c->HasRole("role1")); - UNIT_ASSERT(c->HasRole("role2")); - UNIT_ASSERT(!c->HasRole("role3")); - } - - Y_UNIT_TEST(GetConsumers) { - TRoles::TTvmConsumers cons; - UNIT_ASSERT_NO_EXCEPTION( - cons = TParser::GetConsumers<TTvmId>(ToJsonValue(R"({})"), - "tvm")); - UNIT_ASSERT_VALUES_EQUAL(0, cons.size()); - - UNIT_ASSERT_NO_EXCEPTION( - cons = TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": {}})"), - "tvm")); - UNIT_ASSERT_VALUES_EQUAL(0, cons.size()); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": []})"), - "tvm"), - yexception, - "'tvm' must be object"); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": {"asd": []}})"), - "tvm"), - yexception, - "roles for consumer must be map: 'asd' is Array"); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": {"asd": {}}})"), - "tvm"), - yexception, - "id must be valid positive number of proper size for tvm. got 'asd'"); - UNIT_ASSERT_EXCEPTION_CONTAINS( - TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": {"1120000000001062": {}}})"), - "tvm"), - yexception, - "id must be valid positive number of proper size for tvm. got '1120000000001062'"); - UNIT_ASSERT_NO_EXCEPTION( - TParser::GetConsumers<TUid>(ToJsonValue(R"({"user": {"1120000000001062": {}}})"), - "user")); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": {"42": {}, "042": {}}})"), - "tvm"), - yexception, - "consumer duplicate detected: '42' for tvm"); - - UNIT_ASSERT_NO_EXCEPTION( - cons = TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": {"42": {}}})"), - "tvm")); - UNIT_ASSERT_VALUES_EQUAL(1, cons.size()); - } - - Y_UNIT_TEST(GetMeta) { - UNIT_ASSERT_EXCEPTION_CONTAINS( - TParser::GetMeta(ToJsonValue(R"({})")), - yexception, - "Missing 'revision'"); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - TParser::GetMeta(ToJsonValue(R"({"revision": null})")), - yexception, - "'revision' has unexpected type: Null"); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - TParser::GetMeta(ToJsonValue(R"({"revision": 100500})")), - yexception, - "Missing 'born_date'"); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - TParser::GetMeta(ToJsonValue(R"({"revision": 100500, "born_date": false})")), - yexception, - "key 'born_date' must be uint"); - - TRoles::TMeta meta; - UNIT_ASSERT_NO_EXCEPTION( - meta = TParser::GetMeta(ToJsonValue(R"({"revision": 100500, "born_date": 42})"))); - UNIT_ASSERT_VALUES_EQUAL("100500", meta.Revision); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(42), meta.BornTime); - - UNIT_ASSERT_NO_EXCEPTION( - meta = TParser::GetMeta(ToJsonValue(R"({"revision": "100501", "born_date": 42})"))); - UNIT_ASSERT_VALUES_EQUAL("100501", meta.Revision); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(42), meta.BornTime); - } -} +#include <library/cpp/tvmauth/client/misc/roles/parser.h> + +#include <library/cpp/tvmauth/unittest.h> + +#include <library/cpp/json/json_reader.h> +#include <library/cpp/testing/unittest/registar.h> + +using namespace NTvmAuth; +using namespace NTvmAuth::NRoles; + +Y_UNIT_TEST_SUITE(Parser) { + static NJson::TJsonValue ToJsonValue(TStringBuf body) { + NJson::TJsonValue doc; + UNIT_ASSERT(NJson::ReadJsonTree(body, &doc)); + return doc; + } + + Y_UNIT_TEST(GetEntity) { + UNIT_ASSERT_EXCEPTION_CONTAINS( + TParser::GetEntity(ToJsonValue(R"({"scope": false})"), + "cons", + "read"), + yexception, + "entity is map (str->str), got value Boolean. consumer 'cons' with role 'read'"); + + TEntityPtr en; + UNIT_ASSERT_NO_EXCEPTION( + en = TParser::GetEntity(ToJsonValue(R"({})"), + "cons", + "read")); + UNIT_ASSERT_VALUES_EQUAL(en->size(), 0); + + UNIT_ASSERT_NO_EXCEPTION( + en = TParser::GetEntity(ToJsonValue(R"({"key1": "val1", "key2": "val2"})"), + "cons", + "read")); + UNIT_ASSERT_VALUES_EQUAL(en->size(), 2); + } + + Y_UNIT_TEST(GetEntities) { + UNIT_ASSERT_EXCEPTION_CONTAINS( + TParser::GetEntities(ToJsonValue(R"([{},[]])"), + "cons", + "read"), + yexception, + "role entity for role must be map: consumer 'cons' with role 'read' has Array"); + + TEntitiesPtr en; + UNIT_ASSERT_NO_EXCEPTION( + en = TParser::GetEntities(ToJsonValue(R"([])"), + "cons", + "read")); + UNIT_ASSERT(!en->Contains({})); + + UNIT_ASSERT_NO_EXCEPTION( + en = TParser::GetEntities(ToJsonValue(R"([{}])"), + "cons", + "read")); + UNIT_ASSERT(en->Contains({})); + } + + Y_UNIT_TEST(GetConsumer) { + UNIT_ASSERT_EXCEPTION_CONTAINS( + TParser::GetConsumer(ToJsonValue(R"({"role1": [],"role2": {}})"), + "cons"), + yexception, + "entities for roles must be array: 'role2' is Map"); + + TConsumerRolesPtr c; + UNIT_ASSERT_NO_EXCEPTION( + c = TParser::GetConsumer(ToJsonValue(R"({"role1": [],"role2": []})"), + "cons")); + UNIT_ASSERT(c->HasRole("role1")); + UNIT_ASSERT(c->HasRole("role2")); + UNIT_ASSERT(!c->HasRole("role3")); + } + + Y_UNIT_TEST(GetConsumers) { + TRoles::TTvmConsumers cons; + UNIT_ASSERT_NO_EXCEPTION( + cons = TParser::GetConsumers<TTvmId>(ToJsonValue(R"({})"), + "tvm")); + UNIT_ASSERT_VALUES_EQUAL(0, cons.size()); + + UNIT_ASSERT_NO_EXCEPTION( + cons = TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": {}})"), + "tvm")); + UNIT_ASSERT_VALUES_EQUAL(0, cons.size()); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": []})"), + "tvm"), + yexception, + "'tvm' must be object"); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": {"asd": []}})"), + "tvm"), + yexception, + "roles for consumer must be map: 'asd' is Array"); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": {"asd": {}}})"), + "tvm"), + yexception, + "id must be valid positive number of proper size for tvm. got 'asd'"); + UNIT_ASSERT_EXCEPTION_CONTAINS( + TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": {"1120000000001062": {}}})"), + "tvm"), + yexception, + "id must be valid positive number of proper size for tvm. got '1120000000001062'"); + UNIT_ASSERT_NO_EXCEPTION( + TParser::GetConsumers<TUid>(ToJsonValue(R"({"user": {"1120000000001062": {}}})"), + "user")); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": {"42": {}, "042": {}}})"), + "tvm"), + yexception, + "consumer duplicate detected: '42' for tvm"); + + UNIT_ASSERT_NO_EXCEPTION( + cons = TParser::GetConsumers<TTvmId>(ToJsonValue(R"({"tvm": {"42": {}}})"), + "tvm")); + UNIT_ASSERT_VALUES_EQUAL(1, cons.size()); + } + + Y_UNIT_TEST(GetMeta) { + UNIT_ASSERT_EXCEPTION_CONTAINS( + TParser::GetMeta(ToJsonValue(R"({})")), + yexception, + "Missing 'revision'"); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + TParser::GetMeta(ToJsonValue(R"({"revision": null})")), + yexception, + "'revision' has unexpected type: Null"); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + TParser::GetMeta(ToJsonValue(R"({"revision": 100500})")), + yexception, + "Missing 'born_date'"); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + TParser::GetMeta(ToJsonValue(R"({"revision": 100500, "born_date": false})")), + yexception, + "key 'born_date' must be uint"); + + TRoles::TMeta meta; + UNIT_ASSERT_NO_EXCEPTION( + meta = TParser::GetMeta(ToJsonValue(R"({"revision": 100500, "born_date": 42})"))); + UNIT_ASSERT_VALUES_EQUAL("100500", meta.Revision); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(42), meta.BornTime); + + UNIT_ASSERT_NO_EXCEPTION( + meta = TParser::GetMeta(ToJsonValue(R"({"revision": "100501", "born_date": 42})"))); + UNIT_ASSERT_VALUES_EQUAL("100501", meta.Revision); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(42), meta.BornTime); + } +} diff --git a/library/cpp/tvmauth/client/ut/roles/roles_ut.cpp b/library/cpp/tvmauth/client/ut/roles/roles_ut.cpp index 5ba28d5435..924a77b3af 100644 --- a/library/cpp/tvmauth/client/ut/roles/roles_ut.cpp +++ b/library/cpp/tvmauth/client/ut/roles/roles_ut.cpp @@ -1,415 +1,415 @@ -#include <library/cpp/tvmauth/client/ut/common.h> - -#include <library/cpp/tvmauth/client/exception.h> -#include <library/cpp/tvmauth/client/misc/roles/roles.h> - -#include <library/cpp/tvmauth/unittest.h> - -#include <library/cpp/testing/unittest/registar.h> - -#include <array> - -using namespace NTvmAuth; -using namespace NTvmAuth::NRoles; - -Y_UNIT_TEST_SUITE(Roles) { - Y_UNIT_TEST(EntContains) { - TEntities ent(CreateEntitiesIndex()); - - UNIT_ASSERT(ent.Contains({{"key#1", "value#11"}})); - UNIT_ASSERT(ent.Contains({ - {"key#1", "value#13"}, - {"key#3", "value#33"}, - })); - UNIT_ASSERT(!ent.Contains({{"key#111", "value#11"}})); - UNIT_ASSERT(!ent.Contains({ - {"key#111", "value#13"}, - {"key#3", "value#33"}, - })); - - // valid calls - { - std::array<const std::pair<TStringBuf, TString>, 1> arr = {{{"key#1", "value#11"}}}; - UNIT_ASSERT(ent.ContainsSortedUnique<TStringBuf>({arr.begin(), arr.end()})); - } - { - std::array<const std::pair<TString, TStringBuf>, 2> arr = {{ - {"key#1", "value#13"}, - {"key#3", "value#33"}, - }}; - bool res = ent.ContainsSortedUnique<TString, TStringBuf>({arr.begin(), arr.end()}); - UNIT_ASSERT(res); - } - { - std::array<const std::pair<TStringBuf, TStringBuf>, 1> arr = {{{"key#111", "value#11"}}}; - bool res = ent.ContainsSortedUnique<TStringBuf, TStringBuf>({arr.begin(), arr.end()}); - UNIT_ASSERT(!res); - } - { - std::array<const std::pair<TString, TString>, 2> arr = {{ - {"key#111", "value#13"}, - {"key#3", "value#33"}, - }}; - UNIT_ASSERT(!ent.ContainsSortedUnique({arr.begin(), arr.end()})); - } - - // invalid calls - { - std::array<const std::pair<TString, TString>, 2> arr = {{ - {"key#3", "value#33"}, - {"key#1", "value#13"}, - }}; - UNIT_ASSERT_EXCEPTION_CONTAINS( - ent.ContainsSortedUnique({arr.begin(), arr.end()}), - TIllegalUsage, - "attrs are not sorted: 'key#3' before 'key#1'"); - } - { - std::array<const std::pair<TString, TString>, 2> arr = {{ - {"key#1", "value#13"}, - {"key#1", "value#13"}, - }}; - UNIT_ASSERT_EXCEPTION_CONTAINS( - ent.ContainsSortedUnique({arr.begin(), arr.end()}), - TIllegalUsage, - "attrs are not unique: 'key#1'"); - } - } - - Y_UNIT_TEST(EntWithAttrs) { - TEntities ent(CreateEntitiesIndex()); - - UNIT_ASSERT_VALUES_EQUAL( - ent.GetEntitiesWithAttrs({{"key#1", "value#11"}}), - std::vector<TEntityPtr>({ - std::make_shared<TEntity>(TEntity{ - {"key#1", "value#11"}, - }), - std::make_shared<TEntity>(TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#22"}, - {"key#3", "value#33"}, - }), - std::make_shared<TEntity>(TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#23"}, - {"key#3", "value#33"}, - }), - })); - UNIT_ASSERT_VALUES_EQUAL( - ent.GetEntitiesWithAttrs({{"key#111", "value#11"}}), - std::vector<TEntityPtr>()); - - // valid calls - { - std::array<const std::pair<TStringBuf, TString>, 2> arr = {{ - {"key#1", "value#11"}, - {"key#3", "value#33"}, - }}; - auto vec = ent.GetEntitiesWithSortedUniqueAttrs<TStringBuf>({arr.begin(), arr.end()}); - UNIT_ASSERT_VALUES_EQUAL( - vec, - std::vector<TEntityPtr>({ - std::make_shared<TEntity>(TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#22"}, - {"key#3", "value#33"}, - }), - std::make_shared<TEntity>(TEntity{ - {"key#1", "value#11"}, - {"key#2", "value#23"}, - {"key#3", "value#33"}, - }), - })); - } - { - std::array<const std::pair<TString, TString>, 2> arr = {{ - {"key#111", "value#13"}, - {"key#3", "value#33"}, - }}; - UNIT_ASSERT_VALUES_EQUAL( - ent.GetEntitiesWithSortedUniqueAttrs({arr.begin(), arr.end()}), - std::vector<TEntityPtr>()); - } - - // invalid calls - { - std::array<const std::pair<TString, TString>, 2> arr = {{ - {"key#3", "value#33"}, - {"key#1", "value#13"}, - }}; - UNIT_ASSERT_EXCEPTION_CONTAINS( - ent.GetEntitiesWithSortedUniqueAttrs({arr.begin(), arr.end()}), - TIllegalUsage, - "attrs are not sorted: 'key#3' before 'key#1'"); - } - { - std::array<const std::pair<TString, TString>, 2> arr = {{ - {"key#1", "value#13"}, - {"key#1", "value#13"}, - }}; - UNIT_ASSERT_EXCEPTION_CONTAINS( - ent.GetEntitiesWithSortedUniqueAttrs({arr.begin(), arr.end()}), - TIllegalUsage, - "attrs are not unique: 'key#1'"); - } - } - - Y_UNIT_TEST(Consumer) { - TConsumerRoles c({ - {"read", std::make_shared<TEntities>(CreateEntitiesIndex())}, - {"write", std::make_shared<TEntities>(CreateEntitiesIndex())}, - }); - - UNIT_ASSERT(c.HasRole("read")); - UNIT_ASSERT(c.HasRole("write")); - UNIT_ASSERT(!c.HasRole("access")); - - UNIT_ASSERT_EQUAL(nullptr, c.GetEntitiesForRole("access")); - - TEntitiesPtr ent = c.GetEntitiesForRole("read"); - UNIT_ASSERT_UNEQUAL(nullptr, ent); - UNIT_ASSERT(ent->Contains({{"key#1", "value#11"}})); - UNIT_ASSERT(!ent->Contains({{"key#111", "value#11"}})); - - UNIT_ASSERT(c.CheckRoleForExactEntity("read", {{"key#1", "value#11"}})); - UNIT_ASSERT(!c.CheckRoleForExactEntity("acess", {{"key#1", "value#11"}})); - UNIT_ASSERT(!c.CheckRoleForExactEntity("read", {{"key#111", "value#11"}})); - UNIT_ASSERT(!c.CheckRoleForExactEntity("read", {})); - } - - Y_UNIT_TEST(RolesService) { - TRoles r( - {}, - { - {100500, std::make_shared<TConsumerRoles>(THashMap<TString, TEntitiesPtr>{ - {"write", std::make_shared<TEntities>(CreateEntitiesIndex())}, - })}, - }, - {}, - std::make_shared<TString>()); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - r.GetRolesForService(NUnittest::CreateServiceTicket( - ETicketStatus::InvalidDst, - 100500)), - TIllegalUsage, - "Service ticket must be valid, got: InvalidDst"); - - TConsumerRolesPtr cons; - UNIT_ASSERT_NO_EXCEPTION( - cons = r.GetRolesForService(NUnittest::CreateServiceTicket( - ETicketStatus::Ok, - 100501))); - UNIT_ASSERT_EQUAL(nullptr, cons); - - cons = r.GetRolesForService(NUnittest::CreateServiceTicket( - ETicketStatus::Ok, - 100500)); - UNIT_ASSERT_UNEQUAL(nullptr, cons); - UNIT_ASSERT(!cons->HasRole("read")); - UNIT_ASSERT(cons->HasRole("write")); - - ////shortcuts - // no tvmid - UNIT_ASSERT(!r.CheckServiceRole( - NUnittest::CreateServiceTicket( - ETicketStatus::Ok, - 100501), - "write")); - - // no role - UNIT_ASSERT(!r.CheckServiceRole( - NUnittest::CreateServiceTicket( - ETicketStatus::Ok, - 100500), - "read")); - - // success - UNIT_ASSERT(r.CheckServiceRole( - NUnittest::CreateServiceTicket( - ETicketStatus::Ok, - 100500), - "write")); - - // no tvmid - UNIT_ASSERT(!r.CheckServiceRoleForExactEntity( - NUnittest::CreateServiceTicket( - ETicketStatus::Ok, - 100501), - "write", - {{"key#1", "value#11"}})); - - // no role - UNIT_ASSERT(!r.CheckServiceRoleForExactEntity( - NUnittest::CreateServiceTicket( - ETicketStatus::Ok, - 100500), - "read", - {{"key#1", "value#11"}})); - - // no entity - UNIT_ASSERT(!r.CheckServiceRoleForExactEntity( - NUnittest::CreateServiceTicket( - ETicketStatus::Ok, - 100500), - "write", - {{"key#111", "value#11"}})); - - // success - UNIT_ASSERT(r.CheckServiceRoleForExactEntity( - NUnittest::CreateServiceTicket( - ETicketStatus::Ok, - 100500), - "write", - {{"key#1", "value#11"}})); - } - - Y_UNIT_TEST(RolesUser) { - TRoles r( - {}, - {}, - { - {789654, std::make_shared<TConsumerRoles>(THashMap<TString, TEntitiesPtr>{ - {"read", std::make_shared<TEntities>(CreateEntitiesIndex())}, - })}, - }, - std::make_shared<TString>("some roles")); - - UNIT_ASSERT_VALUES_EQUAL("some roles", r.GetRaw()); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - r.GetRolesForUser(NUnittest::CreateUserTicket( - ETicketStatus::Malformed, - 789654, - {})), - TIllegalUsage, - "User ticket must be valid, got: Malformed"); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - r.GetRolesForUser(NUnittest::CreateUserTicket( - ETicketStatus::Ok, - 789654, - {}), - 789123), - TIllegalUsage, - "User ticket must be from ProdYateam, got from Test"); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - r.GetRolesForUser(NUnittest::CreateUserTicket( - ETicketStatus::Ok, - 789654, - {}, - {}, - EBlackboxEnv::ProdYateam), - 789123), - TIllegalUsage, - "selectedUid must be in user ticket but it's not: 789123"); - - TConsumerRolesPtr cons; - UNIT_ASSERT_NO_EXCEPTION( - cons = r.GetRolesForUser(NUnittest::CreateUserTicket( - ETicketStatus::Ok, - 789123, - {}, - {}, - EBlackboxEnv::ProdYateam))); - UNIT_ASSERT_EQUAL(nullptr, cons); - - cons = r.GetRolesForUser(NUnittest::CreateUserTicket( - ETicketStatus::Ok, - 789654, - {}, - {}, - EBlackboxEnv::ProdYateam)); - UNIT_ASSERT_UNEQUAL(nullptr, cons); - UNIT_ASSERT(cons->HasRole("read")); - UNIT_ASSERT(!cons->HasRole("write")); - - cons = r.GetRolesForUser(NUnittest::CreateUserTicket( - ETicketStatus::Ok, - 789123, - {}, - {789654, 789741}, - EBlackboxEnv::ProdYateam), - 789654); - UNIT_ASSERT_UNEQUAL(nullptr, cons); - UNIT_ASSERT(cons->HasRole("read")); - UNIT_ASSERT(!cons->HasRole("write")); - - ////shortcuts - // no uid - UNIT_ASSERT(!r.CheckUserRole( - NUnittest::CreateUserTicket( - ETicketStatus::Ok, - 789123, - {}, - {}, - EBlackboxEnv::ProdYateam), - "read")); - - // no role - UNIT_ASSERT(!r.CheckUserRole( - NUnittest::CreateUserTicket( - ETicketStatus::Ok, - 789654, - {}, - {}, - EBlackboxEnv::ProdYateam), - "wrire")); - - // success - UNIT_ASSERT(r.CheckUserRole( - NUnittest::CreateUserTicket( - ETicketStatus::Ok, - 789654, - {}, - {}, - EBlackboxEnv::ProdYateam), - "read")); - - // no uid - UNIT_ASSERT(!r.CheckUserRoleForExactEntity( - NUnittest::CreateUserTicket( - ETicketStatus::Ok, - 789123, - {}, - {}, - EBlackboxEnv::ProdYateam), - "read", - {{"key#1", "value#11"}})); - - // no role - UNIT_ASSERT(!r.CheckUserRoleForExactEntity( - NUnittest::CreateUserTicket( - ETicketStatus::Ok, - 789654, - {}, - {}, - EBlackboxEnv::ProdYateam), - "wrire", - {{"key#1", "value#11"}})); - - // no entity - UNIT_ASSERT(!r.CheckUserRoleForExactEntity( - NUnittest::CreateUserTicket( - ETicketStatus::Ok, - 789654, - {}, - {}, - EBlackboxEnv::ProdYateam), - "read", - {{"key#111", "value#11"}})); - - // success - UNIT_ASSERT(r.CheckUserRoleForExactEntity( - NUnittest::CreateUserTicket( - ETicketStatus::Ok, - 789654, - {}, - {}, - EBlackboxEnv::ProdYateam), - "read", - {{"key#1", "value#11"}})); - } -} +#include <library/cpp/tvmauth/client/ut/common.h> + +#include <library/cpp/tvmauth/client/exception.h> +#include <library/cpp/tvmauth/client/misc/roles/roles.h> + +#include <library/cpp/tvmauth/unittest.h> + +#include <library/cpp/testing/unittest/registar.h> + +#include <array> + +using namespace NTvmAuth; +using namespace NTvmAuth::NRoles; + +Y_UNIT_TEST_SUITE(Roles) { + Y_UNIT_TEST(EntContains) { + TEntities ent(CreateEntitiesIndex()); + + UNIT_ASSERT(ent.Contains({{"key#1", "value#11"}})); + UNIT_ASSERT(ent.Contains({ + {"key#1", "value#13"}, + {"key#3", "value#33"}, + })); + UNIT_ASSERT(!ent.Contains({{"key#111", "value#11"}})); + UNIT_ASSERT(!ent.Contains({ + {"key#111", "value#13"}, + {"key#3", "value#33"}, + })); + + // valid calls + { + std::array<const std::pair<TStringBuf, TString>, 1> arr = {{{"key#1", "value#11"}}}; + UNIT_ASSERT(ent.ContainsSortedUnique<TStringBuf>({arr.begin(), arr.end()})); + } + { + std::array<const std::pair<TString, TStringBuf>, 2> arr = {{ + {"key#1", "value#13"}, + {"key#3", "value#33"}, + }}; + bool res = ent.ContainsSortedUnique<TString, TStringBuf>({arr.begin(), arr.end()}); + UNIT_ASSERT(res); + } + { + std::array<const std::pair<TStringBuf, TStringBuf>, 1> arr = {{{"key#111", "value#11"}}}; + bool res = ent.ContainsSortedUnique<TStringBuf, TStringBuf>({arr.begin(), arr.end()}); + UNIT_ASSERT(!res); + } + { + std::array<const std::pair<TString, TString>, 2> arr = {{ + {"key#111", "value#13"}, + {"key#3", "value#33"}, + }}; + UNIT_ASSERT(!ent.ContainsSortedUnique({arr.begin(), arr.end()})); + } + + // invalid calls + { + std::array<const std::pair<TString, TString>, 2> arr = {{ + {"key#3", "value#33"}, + {"key#1", "value#13"}, + }}; + UNIT_ASSERT_EXCEPTION_CONTAINS( + ent.ContainsSortedUnique({arr.begin(), arr.end()}), + TIllegalUsage, + "attrs are not sorted: 'key#3' before 'key#1'"); + } + { + std::array<const std::pair<TString, TString>, 2> arr = {{ + {"key#1", "value#13"}, + {"key#1", "value#13"}, + }}; + UNIT_ASSERT_EXCEPTION_CONTAINS( + ent.ContainsSortedUnique({arr.begin(), arr.end()}), + TIllegalUsage, + "attrs are not unique: 'key#1'"); + } + } + + Y_UNIT_TEST(EntWithAttrs) { + TEntities ent(CreateEntitiesIndex()); + + UNIT_ASSERT_VALUES_EQUAL( + ent.GetEntitiesWithAttrs({{"key#1", "value#11"}}), + std::vector<TEntityPtr>({ + std::make_shared<TEntity>(TEntity{ + {"key#1", "value#11"}, + }), + std::make_shared<TEntity>(TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#22"}, + {"key#3", "value#33"}, + }), + std::make_shared<TEntity>(TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#23"}, + {"key#3", "value#33"}, + }), + })); + UNIT_ASSERT_VALUES_EQUAL( + ent.GetEntitiesWithAttrs({{"key#111", "value#11"}}), + std::vector<TEntityPtr>()); + + // valid calls + { + std::array<const std::pair<TStringBuf, TString>, 2> arr = {{ + {"key#1", "value#11"}, + {"key#3", "value#33"}, + }}; + auto vec = ent.GetEntitiesWithSortedUniqueAttrs<TStringBuf>({arr.begin(), arr.end()}); + UNIT_ASSERT_VALUES_EQUAL( + vec, + std::vector<TEntityPtr>({ + std::make_shared<TEntity>(TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#22"}, + {"key#3", "value#33"}, + }), + std::make_shared<TEntity>(TEntity{ + {"key#1", "value#11"}, + {"key#2", "value#23"}, + {"key#3", "value#33"}, + }), + })); + } + { + std::array<const std::pair<TString, TString>, 2> arr = {{ + {"key#111", "value#13"}, + {"key#3", "value#33"}, + }}; + UNIT_ASSERT_VALUES_EQUAL( + ent.GetEntitiesWithSortedUniqueAttrs({arr.begin(), arr.end()}), + std::vector<TEntityPtr>()); + } + + // invalid calls + { + std::array<const std::pair<TString, TString>, 2> arr = {{ + {"key#3", "value#33"}, + {"key#1", "value#13"}, + }}; + UNIT_ASSERT_EXCEPTION_CONTAINS( + ent.GetEntitiesWithSortedUniqueAttrs({arr.begin(), arr.end()}), + TIllegalUsage, + "attrs are not sorted: 'key#3' before 'key#1'"); + } + { + std::array<const std::pair<TString, TString>, 2> arr = {{ + {"key#1", "value#13"}, + {"key#1", "value#13"}, + }}; + UNIT_ASSERT_EXCEPTION_CONTAINS( + ent.GetEntitiesWithSortedUniqueAttrs({arr.begin(), arr.end()}), + TIllegalUsage, + "attrs are not unique: 'key#1'"); + } + } + + Y_UNIT_TEST(Consumer) { + TConsumerRoles c({ + {"read", std::make_shared<TEntities>(CreateEntitiesIndex())}, + {"write", std::make_shared<TEntities>(CreateEntitiesIndex())}, + }); + + UNIT_ASSERT(c.HasRole("read")); + UNIT_ASSERT(c.HasRole("write")); + UNIT_ASSERT(!c.HasRole("access")); + + UNIT_ASSERT_EQUAL(nullptr, c.GetEntitiesForRole("access")); + + TEntitiesPtr ent = c.GetEntitiesForRole("read"); + UNIT_ASSERT_UNEQUAL(nullptr, ent); + UNIT_ASSERT(ent->Contains({{"key#1", "value#11"}})); + UNIT_ASSERT(!ent->Contains({{"key#111", "value#11"}})); + + UNIT_ASSERT(c.CheckRoleForExactEntity("read", {{"key#1", "value#11"}})); + UNIT_ASSERT(!c.CheckRoleForExactEntity("acess", {{"key#1", "value#11"}})); + UNIT_ASSERT(!c.CheckRoleForExactEntity("read", {{"key#111", "value#11"}})); + UNIT_ASSERT(!c.CheckRoleForExactEntity("read", {})); + } + + Y_UNIT_TEST(RolesService) { + TRoles r( + {}, + { + {100500, std::make_shared<TConsumerRoles>(THashMap<TString, TEntitiesPtr>{ + {"write", std::make_shared<TEntities>(CreateEntitiesIndex())}, + })}, + }, + {}, + std::make_shared<TString>()); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + r.GetRolesForService(NUnittest::CreateServiceTicket( + ETicketStatus::InvalidDst, + 100500)), + TIllegalUsage, + "Service ticket must be valid, got: InvalidDst"); + + TConsumerRolesPtr cons; + UNIT_ASSERT_NO_EXCEPTION( + cons = r.GetRolesForService(NUnittest::CreateServiceTicket( + ETicketStatus::Ok, + 100501))); + UNIT_ASSERT_EQUAL(nullptr, cons); + + cons = r.GetRolesForService(NUnittest::CreateServiceTicket( + ETicketStatus::Ok, + 100500)); + UNIT_ASSERT_UNEQUAL(nullptr, cons); + UNIT_ASSERT(!cons->HasRole("read")); + UNIT_ASSERT(cons->HasRole("write")); + + ////shortcuts + // no tvmid + UNIT_ASSERT(!r.CheckServiceRole( + NUnittest::CreateServiceTicket( + ETicketStatus::Ok, + 100501), + "write")); + + // no role + UNIT_ASSERT(!r.CheckServiceRole( + NUnittest::CreateServiceTicket( + ETicketStatus::Ok, + 100500), + "read")); + + // success + UNIT_ASSERT(r.CheckServiceRole( + NUnittest::CreateServiceTicket( + ETicketStatus::Ok, + 100500), + "write")); + + // no tvmid + UNIT_ASSERT(!r.CheckServiceRoleForExactEntity( + NUnittest::CreateServiceTicket( + ETicketStatus::Ok, + 100501), + "write", + {{"key#1", "value#11"}})); + + // no role + UNIT_ASSERT(!r.CheckServiceRoleForExactEntity( + NUnittest::CreateServiceTicket( + ETicketStatus::Ok, + 100500), + "read", + {{"key#1", "value#11"}})); + + // no entity + UNIT_ASSERT(!r.CheckServiceRoleForExactEntity( + NUnittest::CreateServiceTicket( + ETicketStatus::Ok, + 100500), + "write", + {{"key#111", "value#11"}})); + + // success + UNIT_ASSERT(r.CheckServiceRoleForExactEntity( + NUnittest::CreateServiceTicket( + ETicketStatus::Ok, + 100500), + "write", + {{"key#1", "value#11"}})); + } + + Y_UNIT_TEST(RolesUser) { + TRoles r( + {}, + {}, + { + {789654, std::make_shared<TConsumerRoles>(THashMap<TString, TEntitiesPtr>{ + {"read", std::make_shared<TEntities>(CreateEntitiesIndex())}, + })}, + }, + std::make_shared<TString>("some roles")); + + UNIT_ASSERT_VALUES_EQUAL("some roles", r.GetRaw()); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + r.GetRolesForUser(NUnittest::CreateUserTicket( + ETicketStatus::Malformed, + 789654, + {})), + TIllegalUsage, + "User ticket must be valid, got: Malformed"); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + r.GetRolesForUser(NUnittest::CreateUserTicket( + ETicketStatus::Ok, + 789654, + {}), + 789123), + TIllegalUsage, + "User ticket must be from ProdYateam, got from Test"); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + r.GetRolesForUser(NUnittest::CreateUserTicket( + ETicketStatus::Ok, + 789654, + {}, + {}, + EBlackboxEnv::ProdYateam), + 789123), + TIllegalUsage, + "selectedUid must be in user ticket but it's not: 789123"); + + TConsumerRolesPtr cons; + UNIT_ASSERT_NO_EXCEPTION( + cons = r.GetRolesForUser(NUnittest::CreateUserTicket( + ETicketStatus::Ok, + 789123, + {}, + {}, + EBlackboxEnv::ProdYateam))); + UNIT_ASSERT_EQUAL(nullptr, cons); + + cons = r.GetRolesForUser(NUnittest::CreateUserTicket( + ETicketStatus::Ok, + 789654, + {}, + {}, + EBlackboxEnv::ProdYateam)); + UNIT_ASSERT_UNEQUAL(nullptr, cons); + UNIT_ASSERT(cons->HasRole("read")); + UNIT_ASSERT(!cons->HasRole("write")); + + cons = r.GetRolesForUser(NUnittest::CreateUserTicket( + ETicketStatus::Ok, + 789123, + {}, + {789654, 789741}, + EBlackboxEnv::ProdYateam), + 789654); + UNIT_ASSERT_UNEQUAL(nullptr, cons); + UNIT_ASSERT(cons->HasRole("read")); + UNIT_ASSERT(!cons->HasRole("write")); + + ////shortcuts + // no uid + UNIT_ASSERT(!r.CheckUserRole( + NUnittest::CreateUserTicket( + ETicketStatus::Ok, + 789123, + {}, + {}, + EBlackboxEnv::ProdYateam), + "read")); + + // no role + UNIT_ASSERT(!r.CheckUserRole( + NUnittest::CreateUserTicket( + ETicketStatus::Ok, + 789654, + {}, + {}, + EBlackboxEnv::ProdYateam), + "wrire")); + + // success + UNIT_ASSERT(r.CheckUserRole( + NUnittest::CreateUserTicket( + ETicketStatus::Ok, + 789654, + {}, + {}, + EBlackboxEnv::ProdYateam), + "read")); + + // no uid + UNIT_ASSERT(!r.CheckUserRoleForExactEntity( + NUnittest::CreateUserTicket( + ETicketStatus::Ok, + 789123, + {}, + {}, + EBlackboxEnv::ProdYateam), + "read", + {{"key#1", "value#11"}})); + + // no role + UNIT_ASSERT(!r.CheckUserRoleForExactEntity( + NUnittest::CreateUserTicket( + ETicketStatus::Ok, + 789654, + {}, + {}, + EBlackboxEnv::ProdYateam), + "wrire", + {{"key#1", "value#11"}})); + + // no entity + UNIT_ASSERT(!r.CheckUserRoleForExactEntity( + NUnittest::CreateUserTicket( + ETicketStatus::Ok, + 789654, + {}, + {}, + EBlackboxEnv::ProdYateam), + "read", + {{"key#111", "value#11"}})); + + // success + UNIT_ASSERT(r.CheckUserRoleForExactEntity( + NUnittest::CreateUserTicket( + ETicketStatus::Ok, + 789654, + {}, + {}, + EBlackboxEnv::ProdYateam), + "read", + {{"key#1", "value#11"}})); + } +} diff --git a/library/cpp/tvmauth/client/ut/roles/tvmapi_roles_fetcher_ut.cpp b/library/cpp/tvmauth/client/ut/roles/tvmapi_roles_fetcher_ut.cpp index 7eaf611e82..635bb8ca9e 100644 --- a/library/cpp/tvmauth/client/ut/roles/tvmapi_roles_fetcher_ut.cpp +++ b/library/cpp/tvmauth/client/ut/roles/tvmapi_roles_fetcher_ut.cpp @@ -1,197 +1,197 @@ -#include <library/cpp/tvmauth/client/ut/common.h> - -#include <library/cpp/tvmauth/client/misc/disk_cache.h> -#include <library/cpp/tvmauth/client/misc/api/roles_fetcher.h> - -#include <library/cpp/tvmauth/unittest.h> - -#include <library/cpp/testing/unittest/registar.h> - -#include <util/stream/file.h> -#include <util/system/fs.h> - -using namespace NTvmAuth; -using namespace NTvmAuth::NTvmApi; - -Y_UNIT_TEST_SUITE(TvmApiRolesFetcher) { - static const TString ROLES = R"({"revision": "100501", "born_date": 42})"; - - static const TString CACHE_DIR = "./tmp/"; - - static void CleanCache() { - NFs::RemoveRecursive(CACHE_DIR); - NFs::MakeDirectoryRecursive(CACHE_DIR); - } - - Y_UNIT_TEST(ReadFromDisk) { - CleanCache(); - auto logger = MakeIntrusive<TLogger>(); - - TRolesFetcherSettings s; - s.CacheDir = CACHE_DIR; - s.SelfTvmId = 111111; - s.IdmSystemSlug = "fem\tida"; - TRolesFetcher fetcher(s, logger); - - UNIT_ASSERT(!fetcher.AreRolesOk()); - - UNIT_ASSERT_VALUES_EQUAL(TInstant(), fetcher.ReadFromDisk()); - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "7: File './tmp/roles' does not exist\n", - logger->Stream.Str()); - logger->Stream.clear(); - - const TInstant now = TInstant::Seconds(TInstant::Now().Seconds()); - - TDiskWriter wr(CACHE_DIR + "roles"); - UNIT_ASSERT(wr.Write("kek", now)); - UNIT_ASSERT_NO_EXCEPTION(fetcher.ReadFromDisk()); - UNIT_ASSERT(!fetcher.AreRolesOk()); - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/roles' was successfully read\n" - << "4: Roles in disk cache are for another slug (kek). Self=fem\tida\n", - logger->Stream.Str()); - logger->Stream.clear(); - - UNIT_ASSERT(wr.Write(TRolesFetcher::PrepareDiskFormat(ROLES, "femida_test"), now)); - UNIT_ASSERT_VALUES_EQUAL(TInstant(), fetcher.ReadFromDisk()); - UNIT_ASSERT(!fetcher.AreRolesOk()); - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/roles' was successfully read\n" - "4: Roles in disk cache are for another slug (femida_test). Self=fem\tida\n", - logger->Stream.Str()); - logger->Stream.clear(); - - UNIT_ASSERT(wr.Write(TRolesFetcher::PrepareDiskFormat(ROLES, "fem\tida"), now)); - UNIT_ASSERT_VALUES_EQUAL(now, fetcher.ReadFromDisk()); - UNIT_ASSERT(fetcher.AreRolesOk()); - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/roles' was successfully read\n" - "7: Succeed to read roles with revision 100501 from ./tmp/roles\n", - logger->Stream.Str()); - logger->Stream.clear(); - } - - Y_UNIT_TEST(IsTimeToUpdate) { - TRetrySettings settings; - settings.RolesUpdatePeriod = TDuration::Minutes(123); - - UNIT_ASSERT(!TRolesFetcher::IsTimeToUpdate(settings, TDuration::Seconds(5))); - UNIT_ASSERT(TRolesFetcher::IsTimeToUpdate(settings, TDuration::Hours(5))); - } - - Y_UNIT_TEST(ShouldWarn) { - TRetrySettings settings; - settings.RolesWarnPeriod = TDuration::Minutes(123); - - UNIT_ASSERT(!TRolesFetcher::ShouldWarn(settings, TDuration::Seconds(5))); - UNIT_ASSERT(TRolesFetcher::ShouldWarn(settings, TDuration::Hours(5))); - } - - Y_UNIT_TEST(Update) { - CleanCache(); - auto logger = MakeIntrusive<TLogger>(); - - TRolesFetcherSettings s; - s.CacheDir = CACHE_DIR; - s.SelfTvmId = 111111; - TRolesFetcher fetcher(s, logger); - - UNIT_ASSERT(!fetcher.AreRolesOk()); - - NUtils::TFetchResult fetchResult; - fetchResult.Code = 304; - - UNIT_ASSERT_EXCEPTION_CONTAINS( - fetcher.Update(NUtils::TFetchResult(fetchResult)), - yexception, - "tirole did not return any roles because current roles are actual, but there are no roles in memory"); - UNIT_ASSERT(!fetcher.AreRolesOk()); - UNIT_ASSERT(!NFs::Exists(CACHE_DIR + "roles")); - - fetchResult.Code = 206; - UNIT_ASSERT_EXCEPTION_CONTAINS( - fetcher.Update(NUtils::TFetchResult(fetchResult)), - yexception, - "Unexpected code from tirole: 206."); - UNIT_ASSERT(!fetcher.AreRolesOk()); - UNIT_ASSERT(!NFs::Exists(CACHE_DIR + "roles")); - - fetchResult.Code = 200; - fetchResult.Response = "kek"; - UNIT_ASSERT_EXCEPTION_CONTAINS( - fetcher.Update(NUtils::TFetchResult(fetchResult)), - yexception, - "Invalid json. 'kek'"); - UNIT_ASSERT(!fetcher.AreRolesOk()); - UNIT_ASSERT(!NFs::Exists(CACHE_DIR + "roles")); - - fetchResult.Response = ROLES; - UNIT_ASSERT_NO_EXCEPTION(fetcher.Update(NUtils::TFetchResult(fetchResult))); - UNIT_ASSERT(fetcher.AreRolesOk()); - UNIT_ASSERT(NFs::Exists(CACHE_DIR + "roles")); - { - TFileInput f(CACHE_DIR + "roles"); - TString body = f.ReadAll(); - UNIT_ASSERT_C(body.Contains(ROLES), "got body: '" << body << "'"); - } - - fetchResult.Code = 304; - fetchResult.Response.clear(); - UNIT_ASSERT_NO_EXCEPTION(fetcher.Update(NUtils::TFetchResult(fetchResult))); - UNIT_ASSERT(fetcher.AreRolesOk()); - UNIT_ASSERT(NFs::Exists(CACHE_DIR + "roles")); - - fetchResult.Code = 200; - fetchResult.Headers.AddHeader("X-Tirole-Compression", "kek"); - UNIT_ASSERT_EXCEPTION_CONTAINS( - fetcher.Update(NUtils::TFetchResult(fetchResult)), - yexception, - "unknown codec format version; known: 1; got: kek"); - } - - Y_UNIT_TEST(CreateTiroleRequest) { - CleanCache(); - auto logger = MakeIntrusive<TLogger>(); - - TRolesFetcherSettings s; - s.CacheDir = CACHE_DIR; - s.SelfTvmId = 111111; - s.IdmSystemSlug = "some sys"; - TRolesFetcher fetcher(s, logger); - - TRolesFetcher::TRequest req = fetcher.CreateTiroleRequest("some_ticket"); - UNIT_ASSERT_VALUES_EQUAL( - "/v1/get_actual_roles?system_slug=some+sys&_pid=&lib_version=client_", - TStringBuf(req.Url).Chop(5)); - UNIT_ASSERT_VALUES_EQUAL( - TKeepAliveHttpClient::THeaders({ - {"X-Ya-Service-Ticket", "some_ticket"}, - }), - req.Headers); - - TDiskWriter wr(CACHE_DIR + "roles"); - UNIT_ASSERT(wr.Write(TRolesFetcher::PrepareDiskFormat( - R"({"revision": "asd&qwe", "born_date": 42})", - "some sys"))); - UNIT_ASSERT_NO_EXCEPTION(fetcher.ReadFromDisk()); - - req = fetcher.CreateTiroleRequest("some_ticket"); - UNIT_ASSERT_VALUES_EQUAL( - "/v1/get_actual_roles?system_slug=some+sys&_pid=&lib_version=client_", - TStringBuf(req.Url).Chop(5)); - UNIT_ASSERT_VALUES_EQUAL( - TKeepAliveHttpClient::THeaders({ - {"If-None-Match", R"("asd&qwe")"}, - {"X-Ya-Service-Ticket", "some_ticket"}, - }), - req.Headers); - } -} +#include <library/cpp/tvmauth/client/ut/common.h> + +#include <library/cpp/tvmauth/client/misc/disk_cache.h> +#include <library/cpp/tvmauth/client/misc/api/roles_fetcher.h> + +#include <library/cpp/tvmauth/unittest.h> + +#include <library/cpp/testing/unittest/registar.h> + +#include <util/stream/file.h> +#include <util/system/fs.h> + +using namespace NTvmAuth; +using namespace NTvmAuth::NTvmApi; + +Y_UNIT_TEST_SUITE(TvmApiRolesFetcher) { + static const TString ROLES = R"({"revision": "100501", "born_date": 42})"; + + static const TString CACHE_DIR = "./tmp/"; + + static void CleanCache() { + NFs::RemoveRecursive(CACHE_DIR); + NFs::MakeDirectoryRecursive(CACHE_DIR); + } + + Y_UNIT_TEST(ReadFromDisk) { + CleanCache(); + auto logger = MakeIntrusive<TLogger>(); + + TRolesFetcherSettings s; + s.CacheDir = CACHE_DIR; + s.SelfTvmId = 111111; + s.IdmSystemSlug = "fem\tida"; + TRolesFetcher fetcher(s, logger); + + UNIT_ASSERT(!fetcher.AreRolesOk()); + + UNIT_ASSERT_VALUES_EQUAL(TInstant(), fetcher.ReadFromDisk()); + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "7: File './tmp/roles' does not exist\n", + logger->Stream.Str()); + logger->Stream.clear(); + + const TInstant now = TInstant::Seconds(TInstant::Now().Seconds()); + + TDiskWriter wr(CACHE_DIR + "roles"); + UNIT_ASSERT(wr.Write("kek", now)); + UNIT_ASSERT_NO_EXCEPTION(fetcher.ReadFromDisk()); + UNIT_ASSERT(!fetcher.AreRolesOk()); + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/roles' was successfully read\n" + << "4: Roles in disk cache are for another slug (kek). Self=fem\tida\n", + logger->Stream.Str()); + logger->Stream.clear(); + + UNIT_ASSERT(wr.Write(TRolesFetcher::PrepareDiskFormat(ROLES, "femida_test"), now)); + UNIT_ASSERT_VALUES_EQUAL(TInstant(), fetcher.ReadFromDisk()); + UNIT_ASSERT(!fetcher.AreRolesOk()); + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/roles' was successfully read\n" + "4: Roles in disk cache are for another slug (femida_test). Self=fem\tida\n", + logger->Stream.Str()); + logger->Stream.clear(); + + UNIT_ASSERT(wr.Write(TRolesFetcher::PrepareDiskFormat(ROLES, "fem\tida"), now)); + UNIT_ASSERT_VALUES_EQUAL(now, fetcher.ReadFromDisk()); + UNIT_ASSERT(fetcher.AreRolesOk()); + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/roles' was successfully read\n" + "7: Succeed to read roles with revision 100501 from ./tmp/roles\n", + logger->Stream.Str()); + logger->Stream.clear(); + } + + Y_UNIT_TEST(IsTimeToUpdate) { + TRetrySettings settings; + settings.RolesUpdatePeriod = TDuration::Minutes(123); + + UNIT_ASSERT(!TRolesFetcher::IsTimeToUpdate(settings, TDuration::Seconds(5))); + UNIT_ASSERT(TRolesFetcher::IsTimeToUpdate(settings, TDuration::Hours(5))); + } + + Y_UNIT_TEST(ShouldWarn) { + TRetrySettings settings; + settings.RolesWarnPeriod = TDuration::Minutes(123); + + UNIT_ASSERT(!TRolesFetcher::ShouldWarn(settings, TDuration::Seconds(5))); + UNIT_ASSERT(TRolesFetcher::ShouldWarn(settings, TDuration::Hours(5))); + } + + Y_UNIT_TEST(Update) { + CleanCache(); + auto logger = MakeIntrusive<TLogger>(); + + TRolesFetcherSettings s; + s.CacheDir = CACHE_DIR; + s.SelfTvmId = 111111; + TRolesFetcher fetcher(s, logger); + + UNIT_ASSERT(!fetcher.AreRolesOk()); + + NUtils::TFetchResult fetchResult; + fetchResult.Code = 304; + + UNIT_ASSERT_EXCEPTION_CONTAINS( + fetcher.Update(NUtils::TFetchResult(fetchResult)), + yexception, + "tirole did not return any roles because current roles are actual, but there are no roles in memory"); + UNIT_ASSERT(!fetcher.AreRolesOk()); + UNIT_ASSERT(!NFs::Exists(CACHE_DIR + "roles")); + + fetchResult.Code = 206; + UNIT_ASSERT_EXCEPTION_CONTAINS( + fetcher.Update(NUtils::TFetchResult(fetchResult)), + yexception, + "Unexpected code from tirole: 206."); + UNIT_ASSERT(!fetcher.AreRolesOk()); + UNIT_ASSERT(!NFs::Exists(CACHE_DIR + "roles")); + + fetchResult.Code = 200; + fetchResult.Response = "kek"; + UNIT_ASSERT_EXCEPTION_CONTAINS( + fetcher.Update(NUtils::TFetchResult(fetchResult)), + yexception, + "Invalid json. 'kek'"); + UNIT_ASSERT(!fetcher.AreRolesOk()); + UNIT_ASSERT(!NFs::Exists(CACHE_DIR + "roles")); + + fetchResult.Response = ROLES; + UNIT_ASSERT_NO_EXCEPTION(fetcher.Update(NUtils::TFetchResult(fetchResult))); + UNIT_ASSERT(fetcher.AreRolesOk()); + UNIT_ASSERT(NFs::Exists(CACHE_DIR + "roles")); + { + TFileInput f(CACHE_DIR + "roles"); + TString body = f.ReadAll(); + UNIT_ASSERT_C(body.Contains(ROLES), "got body: '" << body << "'"); + } + + fetchResult.Code = 304; + fetchResult.Response.clear(); + UNIT_ASSERT_NO_EXCEPTION(fetcher.Update(NUtils::TFetchResult(fetchResult))); + UNIT_ASSERT(fetcher.AreRolesOk()); + UNIT_ASSERT(NFs::Exists(CACHE_DIR + "roles")); + + fetchResult.Code = 200; + fetchResult.Headers.AddHeader("X-Tirole-Compression", "kek"); + UNIT_ASSERT_EXCEPTION_CONTAINS( + fetcher.Update(NUtils::TFetchResult(fetchResult)), + yexception, + "unknown codec format version; known: 1; got: kek"); + } + + Y_UNIT_TEST(CreateTiroleRequest) { + CleanCache(); + auto logger = MakeIntrusive<TLogger>(); + + TRolesFetcherSettings s; + s.CacheDir = CACHE_DIR; + s.SelfTvmId = 111111; + s.IdmSystemSlug = "some sys"; + TRolesFetcher fetcher(s, logger); + + TRolesFetcher::TRequest req = fetcher.CreateTiroleRequest("some_ticket"); + UNIT_ASSERT_VALUES_EQUAL( + "/v1/get_actual_roles?system_slug=some+sys&_pid=&lib_version=client_", + TStringBuf(req.Url).Chop(5)); + UNIT_ASSERT_VALUES_EQUAL( + TKeepAliveHttpClient::THeaders({ + {"X-Ya-Service-Ticket", "some_ticket"}, + }), + req.Headers); + + TDiskWriter wr(CACHE_DIR + "roles"); + UNIT_ASSERT(wr.Write(TRolesFetcher::PrepareDiskFormat( + R"({"revision": "asd&qwe", "born_date": 42})", + "some sys"))); + UNIT_ASSERT_NO_EXCEPTION(fetcher.ReadFromDisk()); + + req = fetcher.CreateTiroleRequest("some_ticket"); + UNIT_ASSERT_VALUES_EQUAL( + "/v1/get_actual_roles?system_slug=some+sys&_pid=&lib_version=client_", + TStringBuf(req.Url).Chop(5)); + UNIT_ASSERT_VALUES_EQUAL( + TKeepAliveHttpClient::THeaders({ + {"If-None-Match", R"("asd&qwe")"}, + {"X-Ya-Service-Ticket", "some_ticket"}, + }), + req.Headers); + } +} diff --git a/library/cpp/tvmauth/client/ut/settings_ut.cpp b/library/cpp/tvmauth/client/ut/settings_ut.cpp index 76c9542442..caa93c6a21 100644 --- a/library/cpp/tvmauth/client/ut/settings_ut.cpp +++ b/library/cpp/tvmauth/client/ut/settings_ut.cpp @@ -1,169 +1,169 @@ -#include "common.h" - -#include <library/cpp/tvmauth/client/misc/api/settings.h> - +#include "common.h" + +#include <library/cpp/tvmauth/client/misc/api/settings.h> + #include <library/cpp/testing/unittest/registar.h> - -using namespace NTvmAuth; - + +using namespace NTvmAuth; + Y_UNIT_TEST_SUITE(ClientSettings) { -#if !defined(_win_) - Y_UNIT_TEST(CheckValid) { - struct TTestCase { - TString Name; - NTvmApi::TClientSettings Settings; - TString Err; - }; - std::vector<TTestCase> cases = { - TTestCase{ - .Name = "default", - .Settings = {}, - .Err = "Invalid settings: nothing to do", - }, - TTestCase{ - .Name = "only secret", - .Settings = { - .Secret = TStringBuf("foobar"), - }, - .Err = "Secret is present but destinations list is empty. It makes no sense", - }, - TTestCase{ - .Name = "only dsts", - .Settings = { - .FetchServiceTicketsForDsts = {42}, - }, - .Err = "SelfTvmId cannot be 0 if fetching of Service Tickets required", - }, - TTestCase{ - .Name = "dsts with selfTvmId", - .Settings = { - .SelfTvmId = 43, - .FetchServiceTicketsForDsts = {42}, - }, - .Err = "Secret is required for fetching of Service Tickets", - }, - TTestCase{ - .Name = "correct service tickets fetching", - .Settings = { +#if !defined(_win_) + Y_UNIT_TEST(CheckValid) { + struct TTestCase { + TString Name; + NTvmApi::TClientSettings Settings; + TString Err; + }; + std::vector<TTestCase> cases = { + TTestCase{ + .Name = "default", + .Settings = {}, + .Err = "Invalid settings: nothing to do", + }, + TTestCase{ + .Name = "only secret", + .Settings = { + .Secret = TStringBuf("foobar"), + }, + .Err = "Secret is present but destinations list is empty. It makes no sense", + }, + TTestCase{ + .Name = "only dsts", + .Settings = { + .FetchServiceTicketsForDsts = {42}, + }, + .Err = "SelfTvmId cannot be 0 if fetching of Service Tickets required", + }, + TTestCase{ + .Name = "dsts with selfTvmId", + .Settings = { .SelfTvmId = 43, - .Secret = TStringBuf("foobar"), + .FetchServiceTicketsForDsts = {42}, + }, + .Err = "Secret is required for fetching of Service Tickets", + }, + TTestCase{ + .Name = "correct service tickets fetching", + .Settings = { + .SelfTvmId = 43, + .Secret = TStringBuf("foobar"), .FetchServiceTicketsForDsts = {42}, - }, - .Err = "", - }, - TTestCase{ - .Name = "only check srv flag", - .Settings = { - .CheckServiceTickets = true, - }, - .Err = "SelfTvmId cannot be 0 if checking of Service Tickets required", - }, - TTestCase{ - .Name = "tirole without disk cache", - .Settings = { - .SelfTvmId = 43, - .Secret = TStringBuf("foobar"), - .FetchRolesForIdmSystemSlug = "kek", - }, - .Err = "Disk cache must be enabled to use roles: they can be heavy", - }, - }; - - for (const TTestCase& c : cases) { - if (c.Err) { - UNIT_ASSERT_EXCEPTION_CONTAINS_C( - c.Settings.CheckValid(), - TBrokenTvmClientSettings, - c.Err, - c.Name); - } else { - UNIT_ASSERT_NO_EXCEPTION_C(c.Settings.CheckValid(), c.Name); - } - } - - NTvmApi::TClientSettings s{.DiskCacheDir = "/impossible/dir"}; - UNIT_ASSERT_EXCEPTION(s.CheckValid(), TPermissionDenied); - } - - Y_UNIT_TEST(CloneNormalized) { - NTvmApi::TClientSettings original; - original.FetchServiceTicketsForDsts = {43}; - - UNIT_ASSERT_EXCEPTION_CONTAINS(original.CloneNormalized(), - TBrokenTvmClientSettings, - "SelfTvmId cannot be 0 if fetching of Service Tickets required"); - original.SelfTvmId = 15; - original.Secret = "bar"; - original.DiskCacheDir = "./"; - - NTvmApi::TClientSettings::TDstVector expected = {43}; - UNIT_ASSERT_VALUES_EQUAL(expected, original.CloneNormalized().FetchServiceTicketsForDsts); - - original.FetchServiceTicketsForDstsWithAliases = {{"foo", 42}}; - expected = {42, 43}; - UNIT_ASSERT_VALUES_EQUAL(expected, original.CloneNormalized().FetchServiceTicketsForDsts); - - original.FetchRolesForIdmSystemSlug = "kek"; - expected = {42, 43, 2028120}; - UNIT_ASSERT_VALUES_EQUAL(expected, original.CloneNormalized().FetchServiceTicketsForDsts); - - original.FetchServiceTicketsForDsts.push_back(2028120); - expected = {42, 43, 2028120}; - UNIT_ASSERT_VALUES_EQUAL(expected, original.CloneNormalized().FetchServiceTicketsForDsts); - } - - Y_UNIT_TEST(NeedServiceTicketsFetching) { - NTvmApi::TClientSettings s; - - UNIT_ASSERT(!s.NeedServiceTicketsFetching()); - - s.FetchServiceTicketsForDsts = {42}; - UNIT_ASSERT(s.NeedServiceTicketsFetching()); - s.FetchServiceTicketsForDsts.clear(); - - s.FetchServiceTicketsForDstsWithAliases = {{"foo", 42}}; - UNIT_ASSERT(s.NeedServiceTicketsFetching()); - s.FetchServiceTicketsForDstsWithAliases.clear(); - - s.FetchRolesForIdmSystemSlug = "bar"; - UNIT_ASSERT(s.NeedServiceTicketsFetching()); - s.FetchRolesForIdmSystemSlug.clear(); - } - - Y_UNIT_TEST(permitions) { - UNIT_ASSERT_EXCEPTION(NTvmApi::TClientSettings::CheckPermissions("/qwerty"), TPermissionDenied); - - const TString tmpDir = "./cache_dir"; - - NFs::RemoveRecursive(tmpDir); - NFs::MakeDirectory(tmpDir, NFs::FP_OWNER_WRITE | NFs::FP_GROUP_WRITE | NFs::FP_ALL_WRITE); - UNIT_ASSERT_EXCEPTION(NTvmApi::TClientSettings::CheckPermissions(tmpDir), TPermissionDenied); - - NFs::RemoveRecursive(tmpDir); - NFs::MakeDirectory(tmpDir, NFs::FP_OWNER_READ | NFs::FP_GROUP_READ | NFs::FP_ALL_READ); - UNIT_ASSERT_EXCEPTION(NTvmApi::TClientSettings::CheckPermissions(tmpDir), TPermissionDenied); - - NFs::RemoveRecursive(tmpDir); - NFs::MakeDirectory(tmpDir, NFs::FP_COMMON_FILE); - UNIT_ASSERT_NO_EXCEPTION(NTvmApi::TClientSettings::CheckPermissions(tmpDir)); - } -#endif - - Y_UNIT_TEST(Dst) { - UNIT_ASSERT_EXCEPTION_CONTAINS(NTvmApi::TClientSettings::TDst(0), yexception, "TvmId cannot be 0"); - UNIT_ASSERT_EXCEPTION_CONTAINS(NTvmApi::TClientSettings::TDstMap({{"blackbox", 0}}), - TBrokenTvmClientSettings, - "TvmId cannot be 0"); - } - - Y_UNIT_TEST(Fetching) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(125); - - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); - UNIT_ASSERT_NO_EXCEPTION(s.CheckValid()); - - UNIT_ASSERT_VALUES_EQUAL(s.FetchServiceTicketsForDsts.size(), 1); - UNIT_ASSERT_VALUES_EQUAL(s.FetchServiceTicketsForDsts[0], 19); - } -} + }, + .Err = "", + }, + TTestCase{ + .Name = "only check srv flag", + .Settings = { + .CheckServiceTickets = true, + }, + .Err = "SelfTvmId cannot be 0 if checking of Service Tickets required", + }, + TTestCase{ + .Name = "tirole without disk cache", + .Settings = { + .SelfTvmId = 43, + .Secret = TStringBuf("foobar"), + .FetchRolesForIdmSystemSlug = "kek", + }, + .Err = "Disk cache must be enabled to use roles: they can be heavy", + }, + }; + + for (const TTestCase& c : cases) { + if (c.Err) { + UNIT_ASSERT_EXCEPTION_CONTAINS_C( + c.Settings.CheckValid(), + TBrokenTvmClientSettings, + c.Err, + c.Name); + } else { + UNIT_ASSERT_NO_EXCEPTION_C(c.Settings.CheckValid(), c.Name); + } + } + + NTvmApi::TClientSettings s{.DiskCacheDir = "/impossible/dir"}; + UNIT_ASSERT_EXCEPTION(s.CheckValid(), TPermissionDenied); + } + + Y_UNIT_TEST(CloneNormalized) { + NTvmApi::TClientSettings original; + original.FetchServiceTicketsForDsts = {43}; + + UNIT_ASSERT_EXCEPTION_CONTAINS(original.CloneNormalized(), + TBrokenTvmClientSettings, + "SelfTvmId cannot be 0 if fetching of Service Tickets required"); + original.SelfTvmId = 15; + original.Secret = "bar"; + original.DiskCacheDir = "./"; + + NTvmApi::TClientSettings::TDstVector expected = {43}; + UNIT_ASSERT_VALUES_EQUAL(expected, original.CloneNormalized().FetchServiceTicketsForDsts); + + original.FetchServiceTicketsForDstsWithAliases = {{"foo", 42}}; + expected = {42, 43}; + UNIT_ASSERT_VALUES_EQUAL(expected, original.CloneNormalized().FetchServiceTicketsForDsts); + + original.FetchRolesForIdmSystemSlug = "kek"; + expected = {42, 43, 2028120}; + UNIT_ASSERT_VALUES_EQUAL(expected, original.CloneNormalized().FetchServiceTicketsForDsts); + + original.FetchServiceTicketsForDsts.push_back(2028120); + expected = {42, 43, 2028120}; + UNIT_ASSERT_VALUES_EQUAL(expected, original.CloneNormalized().FetchServiceTicketsForDsts); + } + + Y_UNIT_TEST(NeedServiceTicketsFetching) { + NTvmApi::TClientSettings s; + + UNIT_ASSERT(!s.NeedServiceTicketsFetching()); + + s.FetchServiceTicketsForDsts = {42}; + UNIT_ASSERT(s.NeedServiceTicketsFetching()); + s.FetchServiceTicketsForDsts.clear(); + + s.FetchServiceTicketsForDstsWithAliases = {{"foo", 42}}; + UNIT_ASSERT(s.NeedServiceTicketsFetching()); + s.FetchServiceTicketsForDstsWithAliases.clear(); + + s.FetchRolesForIdmSystemSlug = "bar"; + UNIT_ASSERT(s.NeedServiceTicketsFetching()); + s.FetchRolesForIdmSystemSlug.clear(); + } + + Y_UNIT_TEST(permitions) { + UNIT_ASSERT_EXCEPTION(NTvmApi::TClientSettings::CheckPermissions("/qwerty"), TPermissionDenied); + + const TString tmpDir = "./cache_dir"; + + NFs::RemoveRecursive(tmpDir); + NFs::MakeDirectory(tmpDir, NFs::FP_OWNER_WRITE | NFs::FP_GROUP_WRITE | NFs::FP_ALL_WRITE); + UNIT_ASSERT_EXCEPTION(NTvmApi::TClientSettings::CheckPermissions(tmpDir), TPermissionDenied); + + NFs::RemoveRecursive(tmpDir); + NFs::MakeDirectory(tmpDir, NFs::FP_OWNER_READ | NFs::FP_GROUP_READ | NFs::FP_ALL_READ); + UNIT_ASSERT_EXCEPTION(NTvmApi::TClientSettings::CheckPermissions(tmpDir), TPermissionDenied); + + NFs::RemoveRecursive(tmpDir); + NFs::MakeDirectory(tmpDir, NFs::FP_COMMON_FILE); + UNIT_ASSERT_NO_EXCEPTION(NTvmApi::TClientSettings::CheckPermissions(tmpDir)); + } +#endif + + Y_UNIT_TEST(Dst) { + UNIT_ASSERT_EXCEPTION_CONTAINS(NTvmApi::TClientSettings::TDst(0), yexception, "TvmId cannot be 0"); + UNIT_ASSERT_EXCEPTION_CONTAINS(NTvmApi::TClientSettings::TDstMap({{"blackbox", 0}}), + TBrokenTvmClientSettings, + "TvmId cannot be 0"); + } + + Y_UNIT_TEST(Fetching) { + NTvmApi::TClientSettings s; + s.SetSelfTvmId(125); + + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); + UNIT_ASSERT_NO_EXCEPTION(s.CheckValid()); + + UNIT_ASSERT_VALUES_EQUAL(s.FetchServiceTicketsForDsts.size(), 1); + UNIT_ASSERT_VALUES_EQUAL(s.FetchServiceTicketsForDsts[0], 19); + } +} diff --git a/library/cpp/tvmauth/client/ut/src_checker_ut.cpp b/library/cpp/tvmauth/client/ut/src_checker_ut.cpp index bd1646d6b9..30a3577aff 100644 --- a/library/cpp/tvmauth/client/ut/src_checker_ut.cpp +++ b/library/cpp/tvmauth/client/ut/src_checker_ut.cpp @@ -1,47 +1,47 @@ -#include "common.h" - -#include <library/cpp/tvmauth/client/mocked_updater.h> -#include <library/cpp/tvmauth/client/misc/src_checker.h> -#include <library/cpp/tvmauth/client/misc/api/threaded_updater.h> - -#include <library/cpp/tvmauth/type.h> -#include <library/cpp/tvmauth/unittest.h> - -#include <library/cpp/testing/unittest/registar.h> - -using namespace NTvmAuth; - -Y_UNIT_TEST_SUITE(SrcChecker) { - Y_UNIT_TEST(Ctor) { - UNIT_ASSERT_EXCEPTION_CONTAINS( - TSrcChecker(new TMockedUpdater), - TBrokenTvmClientSettings, - "Need to use TClientSettings::EnableRolesFetching"); - } - - Y_UNIT_TEST(Check) { - NRoles::TRolesPtr roles = std::make_shared<NRoles::TRoles>( - NRoles::TRoles::TMeta{}, - NRoles::TRoles::TTvmConsumers{ - {12345, std::make_shared<NRoles::TConsumerRoles>( - THashMap<TString, NRoles::TEntitiesPtr>())}, - }, - NRoles::TRoles::TUserConsumers{}, - std::make_shared<TString>()); - const TSrcChecker checker(new TMockedUpdater({.Roles = roles})); - - UNIT_ASSERT_EXCEPTION_CONTAINS( - checker.Check(NUnittest::CreateServiceTicket(ETicketStatus::Expired, 12345)), - TIllegalUsage, - "Service ticket must be valid"); - - TCheckedServiceTicket ticket; - UNIT_ASSERT_NO_EXCEPTION( - ticket = checker.Check(NUnittest::CreateServiceTicket(ETicketStatus::Ok, 12345))); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, ticket.GetStatus()); - - UNIT_ASSERT_NO_EXCEPTION( - ticket = checker.Check(NUnittest::CreateServiceTicket(ETicketStatus::Ok, 9999))); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::NoRoles, ticket.GetStatus()); - } -} +#include "common.h" + +#include <library/cpp/tvmauth/client/mocked_updater.h> +#include <library/cpp/tvmauth/client/misc/src_checker.h> +#include <library/cpp/tvmauth/client/misc/api/threaded_updater.h> + +#include <library/cpp/tvmauth/type.h> +#include <library/cpp/tvmauth/unittest.h> + +#include <library/cpp/testing/unittest/registar.h> + +using namespace NTvmAuth; + +Y_UNIT_TEST_SUITE(SrcChecker) { + Y_UNIT_TEST(Ctor) { + UNIT_ASSERT_EXCEPTION_CONTAINS( + TSrcChecker(new TMockedUpdater), + TBrokenTvmClientSettings, + "Need to use TClientSettings::EnableRolesFetching"); + } + + Y_UNIT_TEST(Check) { + NRoles::TRolesPtr roles = std::make_shared<NRoles::TRoles>( + NRoles::TRoles::TMeta{}, + NRoles::TRoles::TTvmConsumers{ + {12345, std::make_shared<NRoles::TConsumerRoles>( + THashMap<TString, NRoles::TEntitiesPtr>())}, + }, + NRoles::TRoles::TUserConsumers{}, + std::make_shared<TString>()); + const TSrcChecker checker(new TMockedUpdater({.Roles = roles})); + + UNIT_ASSERT_EXCEPTION_CONTAINS( + checker.Check(NUnittest::CreateServiceTicket(ETicketStatus::Expired, 12345)), + TIllegalUsage, + "Service ticket must be valid"); + + TCheckedServiceTicket ticket; + UNIT_ASSERT_NO_EXCEPTION( + ticket = checker.Check(NUnittest::CreateServiceTicket(ETicketStatus::Ok, 12345))); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, ticket.GetStatus()); + + UNIT_ASSERT_NO_EXCEPTION( + ticket = checker.Check(NUnittest::CreateServiceTicket(ETicketStatus::Ok, 9999))); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::NoRoles, ticket.GetStatus()); + } +} diff --git a/library/cpp/tvmauth/client/ut/tvmapi_updater_ut.cpp b/library/cpp/tvmauth/client/ut/tvmapi_updater_ut.cpp index 4cf449711b..31650941c2 100644 --- a/library/cpp/tvmauth/client/ut/tvmapi_updater_ut.cpp +++ b/library/cpp/tvmauth/client/ut/tvmapi_updater_ut.cpp @@ -1,1237 +1,1237 @@ -#include "common.h" - -#include <library/cpp/tvmauth/client/mocked_updater.h> -#include <library/cpp/tvmauth/client/misc/disk_cache.h> -#include <library/cpp/tvmauth/client/misc/api/threaded_updater.h> - +#include "common.h" + +#include <library/cpp/tvmauth/client/mocked_updater.h> +#include <library/cpp/tvmauth/client/misc/disk_cache.h> +#include <library/cpp/tvmauth/client/misc/api/threaded_updater.h> + #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/tests_data.h> - -#include <util/stream/file.h> -#include <util/string/subst.h> -#include <util/system/fs.h> - -#include <regex> - -using namespace NTvmAuth; -static const std::regex TIME_REGEX(R"(\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d.\d{6}Z)"); - -Y_UNIT_TEST_SUITE(ApiUpdater) { - static const TString SRV_TICKET = "3:serv:CBAQ__________9_IgYIexCUkQY:GioCM49Ob6_f80y6FY0XBVN4hLXuMlFeyMvIMiDuQnZkbkLpRpQOuQo5YjWoBjM0Vf-XqOm8B7xtrvxSYHDD7Q4OatN2l-Iwg7i71lE3scUeD36x47st3nd0OThvtjrFx_D8mw_c0GT5KcniZlqq1SjhLyAk1b_zJsx8viRAhCU"; - static const TString TEST_TICKET = "3:user:CA0Q__________9_Gg4KAgh7EHsg0oXYzAQoAQ:FSADps3wNGm92Vyb1E9IVq5M6ZygdGdt1vafWWEhfDDeCLoVA-sJesxMl2pGW4OxJ8J1r_MfpG3ZoBk8rLVMHUFrPa6HheTbeXFAWl8quEniauXvKQe4VyrpA1SPgtRoFqi5upSDIJzEAe1YRJjq1EClQ_slMt8R0kA_JjKUX54"; - static const TString TVM_RESPONSE = - R"({ - "19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, - "213" : { "ticket" : "service_ticket_2"}, - "234" : { "error" : "Dst is not found" }, - "185" : { "ticket" : "service_ticket_3"}, - "deprecated" : { "ticket" : "deprecated_ticket" } - })"; - - static const TString CACHE_DIR = "./tmp/"; - - static void CleanCache() { - NFs::RemoveRecursive(CACHE_DIR); - NFs::MakeDirectoryRecursive(CACHE_DIR); - } - - Y_UNIT_TEST(MockedUpdater) { - TMockedUpdater m; - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, m.GetStatus()); - UNIT_ASSERT(m.GetCachedServiceContext()->Check(SRV_TICKET)); - UNIT_ASSERT(m.GetCachedUserContext()->Check(TEST_TICKET)); - } - - Y_UNIT_TEST(Updater) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketChecking(); - s.SetDiskCacheDir(GetCachePath()); - - auto l = MakeIntrusive<TLogger>(); - { - auto u = NTvmApi::TThreadedUpdater::Create(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus()); - } - - UNIT_ASSERT_C(l->Stream.Str().find("was successfully read") != TString::npos, l->Stream.Str()); - UNIT_ASSERT_C(l->Stream.Str().find("were successfully fetched") == TString::npos, l->Stream.Str()); - } - - Y_UNIT_TEST(Updater_badConfig) { - NTvmApi::TClientSettings s; - UNIT_ASSERT_EXCEPTION(NTvmApi::TThreadedUpdater::Create(s, TDevNullLogger::IAmBrave()), yexception); - s.SetSelfTvmId(100500); - UNIT_ASSERT_EXCEPTION(NTvmApi::TThreadedUpdater::Create(s, TDevNullLogger::IAmBrave()), yexception); - s.SetDiskCacheDir(GetCachePath()); - UNIT_ASSERT_EXCEPTION(NTvmApi::TThreadedUpdater::Create(s, TDevNullLogger::IAmBrave()), yexception); - } - - class TOfflineUpdater: public NTvmApi::TThreadedUpdater { - bool Enabled_; - TString PublicKeys_; - - public: - TOfflineUpdater(const NTvmApi::TClientSettings& settings, - TIntrusivePtr<TLogger> l, - bool enabled = false, - TString keys = NUnittest::TVMKNIFE_PUBLIC_KEYS) - : NTvmApi::TThreadedUpdater(settings, l) - , Enabled_(enabled) - , PublicKeys_(keys) - { - Init(); - StartWorker(); - } - - NUtils::TFetchResult FetchServiceTicketsFromHttp(const TString&) const override { - if (!Enabled_) { - throw yexception() << "alarm"; - } - return {200, {}, "/2/ticket", TVM_RESPONSE, ""}; - } - - NUtils::TFetchResult FetchPublicKeysFromHttp() const override { - if (!Enabled_) { - throw yexception() << "alarm"; - } - return {200, {}, "/2/keys", PublicKeys_, ""}; - } - }; - - Y_UNIT_TEST(StartWithoutCache) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); - s.EnableServiceTicketChecking(); - - auto l = MakeIntrusive<TLogger>(); - UNIT_ASSERT_EXCEPTION_CONTAINS(TOfflineUpdater(s, l), - TRetriableException, - "Failed to start TvmClient. You can retry:"); - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() + +#include <util/stream/file.h> +#include <util/string/subst.h> +#include <util/system/fs.h> + +#include <regex> + +using namespace NTvmAuth; +static const std::regex TIME_REGEX(R"(\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d.\d{6}Z)"); + +Y_UNIT_TEST_SUITE(ApiUpdater) { + static const TString SRV_TICKET = "3:serv:CBAQ__________9_IgYIexCUkQY:GioCM49Ob6_f80y6FY0XBVN4hLXuMlFeyMvIMiDuQnZkbkLpRpQOuQo5YjWoBjM0Vf-XqOm8B7xtrvxSYHDD7Q4OatN2l-Iwg7i71lE3scUeD36x47st3nd0OThvtjrFx_D8mw_c0GT5KcniZlqq1SjhLyAk1b_zJsx8viRAhCU"; + static const TString TEST_TICKET = "3:user:CA0Q__________9_Gg4KAgh7EHsg0oXYzAQoAQ:FSADps3wNGm92Vyb1E9IVq5M6ZygdGdt1vafWWEhfDDeCLoVA-sJesxMl2pGW4OxJ8J1r_MfpG3ZoBk8rLVMHUFrPa6HheTbeXFAWl8quEniauXvKQe4VyrpA1SPgtRoFqi5upSDIJzEAe1YRJjq1EClQ_slMt8R0kA_JjKUX54"; + static const TString TVM_RESPONSE = + R"({ + "19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, + "213" : { "ticket" : "service_ticket_2"}, + "234" : { "error" : "Dst is not found" }, + "185" : { "ticket" : "service_ticket_3"}, + "deprecated" : { "ticket" : "deprecated_ticket" } + })"; + + static const TString CACHE_DIR = "./tmp/"; + + static void CleanCache() { + NFs::RemoveRecursive(CACHE_DIR); + NFs::MakeDirectoryRecursive(CACHE_DIR); + } + + Y_UNIT_TEST(MockedUpdater) { + TMockedUpdater m; + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, m.GetStatus()); + UNIT_ASSERT(m.GetCachedServiceContext()->Check(SRV_TICKET)); + UNIT_ASSERT(m.GetCachedUserContext()->Check(TEST_TICKET)); + } + + Y_UNIT_TEST(Updater) { + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketChecking(); + s.SetDiskCacheDir(GetCachePath()); + + auto l = MakeIntrusive<TLogger>(); + { + auto u = NTvmApi::TThreadedUpdater::Create(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus()); + } + + UNIT_ASSERT_C(l->Stream.Str().find("was successfully read") != TString::npos, l->Stream.Str()); + UNIT_ASSERT_C(l->Stream.Str().find("were successfully fetched") == TString::npos, l->Stream.Str()); + } + + Y_UNIT_TEST(Updater_badConfig) { + NTvmApi::TClientSettings s; + UNIT_ASSERT_EXCEPTION(NTvmApi::TThreadedUpdater::Create(s, TDevNullLogger::IAmBrave()), yexception); + s.SetSelfTvmId(100500); + UNIT_ASSERT_EXCEPTION(NTvmApi::TThreadedUpdater::Create(s, TDevNullLogger::IAmBrave()), yexception); + s.SetDiskCacheDir(GetCachePath()); + UNIT_ASSERT_EXCEPTION(NTvmApi::TThreadedUpdater::Create(s, TDevNullLogger::IAmBrave()), yexception); + } + + class TOfflineUpdater: public NTvmApi::TThreadedUpdater { + bool Enabled_; + TString PublicKeys_; + + public: + TOfflineUpdater(const NTvmApi::TClientSettings& settings, + TIntrusivePtr<TLogger> l, + bool enabled = false, + TString keys = NUnittest::TVMKNIFE_PUBLIC_KEYS) + : NTvmApi::TThreadedUpdater(settings, l) + , Enabled_(enabled) + , PublicKeys_(keys) + { + Init(); + StartWorker(); + } + + NUtils::TFetchResult FetchServiceTicketsFromHttp(const TString&) const override { + if (!Enabled_) { + throw yexception() << "alarm"; + } + return {200, {}, "/2/ticket", TVM_RESPONSE, ""}; + } + + NUtils::TFetchResult FetchPublicKeysFromHttp() const override { + if (!Enabled_) { + throw yexception() << "alarm"; + } + return {200, {}, "/2/keys", PublicKeys_, ""}; + } + }; + + Y_UNIT_TEST(StartWithoutCache) { + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); + s.EnableServiceTicketChecking(); + + auto l = MakeIntrusive<TLogger>(); + UNIT_ASSERT_EXCEPTION_CONTAINS(TOfflineUpdater(s, l), + TRetriableException, + "Failed to start TvmClient. You can retry:"); + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() << "6: Disk cache disabled. Please set disk cache directory in settings for best reliability\n" - << "4: Failed to get ServiceTickets: alarm\n" - << "4: Failed to get ServiceTickets: alarm\n" - << "4: Failed to get ServiceTickets: alarm\n" - << "4: Failed to update service tickets: alarm\n" - << "3: Service tickets have not been refreshed for too long period\n", - l->Stream.Str()); - } - - static void WriteFile(TString name, TStringBuf body, TInstant time) { - NFs::Remove(CACHE_DIR + name); - TFileOutput f(CACHE_DIR + name); - f << TDiskWriter::PrepareData(time, body); - } - - Y_UNIT_TEST(StartWithOldCache) { - CleanCache(); - WriteFile("./public_keys", - NUnittest::TVMKNIFE_PUBLIC_KEYS, - TInstant::Now() - TDuration::Days(30)); // too old - WriteFile("./service_tickets", - R"({"19":{"ticket":"3:serv:CBAQACIGCJSRBhAL:Fi"}})" - "\t100500", - TInstant::Now()); // too old - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); - s.EnableServiceTicketChecking(); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - { - TOfflineUpdater u(s, l, true); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - } - - UNIT_ASSERT_C(l->Stream.Str().find("Disk cache (public keys) is too old") != TString::npos, l->Stream.Str()); - UNIT_ASSERT_C(l->Stream.Str().find("Disk cache (service tickets) is too old") != TString::npos, l->Stream.Str()); - UNIT_ASSERT_C(l->Stream.Str().find("were successfully fetched") != TString::npos, l->Stream.Str()); - } - - Y_UNIT_TEST(StartWithMissingCache) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketChecking(); - s.SetDiskCacheDir("../"); - - auto l = MakeIntrusive<TLogger>(); - UNIT_ASSERT_EXCEPTION_CONTAINS(TOfflineUpdater(s, l), - TRetriableException, - "Failed to start TvmClient. You can retry: "); - - UNIT_ASSERT_C(l->Stream.Str().find("does not exist") != TString::npos, l->Stream.Str()); - UNIT_ASSERT_C(l->Stream.Str().find("were successfully fetched") == TString::npos, l->Stream.Str()); - } - - Y_UNIT_TEST(StartWithBadCache_Tickets) { - CleanCache(); - WriteFile("./service_tickets", - TVM_RESPONSE, - TInstant::Now()); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - { - TOfflineUpdater u(s, l, true); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/service_tickets' was successfully read\n" - << "4: Failed to read service tickets from disk: YYYYYYYYYYYYYYY\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" - << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" - << "6: Cache was updated with 2 service ticket(s): XXXXXXXXXXX\n" - << "6: File './tmp/service_tickets' was successfully written\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - std::regex_replace(std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX"), - std::regex(R"(Failed to read service tickets from disk: [^\n]+)"), - "Failed to read service tickets from disk: YYYYYYYYYYYYYYY")); - } - - Y_UNIT_TEST(StartWithBadCache_PublicKeys) { - CleanCache(); - WriteFile("./public_keys", - "ksjdafnlskdjzfgbhdl", - TInstant::Now()); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketChecking(); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - UNIT_ASSERT_EXCEPTION_CONTAINS(TOfflineUpdater(s, l), - TRetriableException, - "Failed to start TvmClient. You can retry:"); - - UNIT_ASSERT_C(l->Stream.Str().find("4: Failed to read public keys from disk: Malformed TVM keys") != TString::npos, l->Stream.Str()); - } - - Y_UNIT_TEST(StartWithCacheForAnotherTvmId) { - CleanCache(); - WriteFile("./service_tickets", - TVM_RESPONSE + "\t" + "100499", - TInstant::Now()); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - { - TOfflineUpdater u(s, l, true); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/service_tickets' was successfully read\n" - << "4: Disk cache is for another tvmId (100499). Self=100500\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" - << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" - << "6: Cache was updated with 2 service ticket(s): XXXXXXXXXXX\n" - << "6: File './tmp/service_tickets' was successfully written\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); - } - - Y_UNIT_TEST(StartWithCacheForAnotherDsts) { - CleanCache(); - TInstant now = TInstant::Now(); - WriteFile("./service_tickets", - R"({"213" : { "ticket" : "3:serv:CBAQ__________9_IgYIlJEGEAs:T-"}})" - "\t" - "100500", - now); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - { - TOfflineUpdater u(s, l, true); - auto cache = u.GetCachedServiceTickets(); - UNIT_ASSERT(cache->TicketsById.contains(213)); - UNIT_ASSERT(cache->TicketsById.contains(19)); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - } - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/service_tickets' was successfully read\n" - << "6: Got 1 service ticket(s) from disk\n" - << "6: Cache was updated with 1 service ticket(s): " << TInstant::Seconds(now.Seconds()) << "\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Response with service tickets for 1 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" - << "7: Got responses with service tickets with 1 pages for 1 destination(s)\n" - << "6: Cache was partly updated with 1 service ticket(s). total: 2\n" - << "6: File './tmp/service_tickets' was successfully written\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - l->Stream.Str()); - l->Stream.Clear(); - - { - TOfflineUpdater u(s, l, true); - auto cache = u.GetCachedServiceTickets(); - UNIT_ASSERT(cache->TicketsById.contains(213)); - UNIT_ASSERT(cache->TicketsById.contains(19)); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - } - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/service_tickets' was successfully read\n" - << "6: Got 2 service ticket(s) from disk\n" - << "6: Cache was updated with 2 service ticket(s): XXXXXXXXXXX\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); - } - - Y_UNIT_TEST(StartWithNotFreshCacheForAnotherDsts) { - CleanCache(); - TInstant now = TInstant::Now(); - WriteFile("./service_tickets", - R"({"213" : { "ticket" : "3:serv:CBAQ__________9_IgYIlJEGEAs:T-"}})" - "\t" - "100500", - now - TDuration::Hours(2)); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - { - TOfflineUpdater u(s, l, true); - auto cache = u.GetCachedServiceTickets(); - UNIT_ASSERT(cache->TicketsById.contains(213)); - UNIT_ASSERT(cache->TicketsById.contains(19)); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - } - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/service_tickets' was successfully read\n" - << "6: Got 1 service ticket(s) from disk\n" - << "6: Cache was updated with 1 service ticket(s): XXXXXXXXXXX\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" - << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" - << "6: Cache was updated with 2 service ticket(s): XXXXXXXXXXX\n" - << "6: File './tmp/service_tickets' was successfully written\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); - l->Stream.Clear(); - - { - TOfflineUpdater u(s, l, true); - auto cache = u.GetCachedServiceTickets(); - UNIT_ASSERT(cache->TicketsById.contains(213)); - UNIT_ASSERT(cache->TicketsById.contains(19)); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - } - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/service_tickets' was successfully read\n" - << "6: Got 2 service ticket(s) from disk\n" - << "6: Cache was updated with 2 service ticket(s): XXXXXXXXXXX\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); - } - - Y_UNIT_TEST(StartWithPartialDiskCache) { - CleanCache(); - WriteFile("./public_keys", - NUnittest::TVMKNIFE_PUBLIC_KEYS, - TInstant::Now()); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); - s.EnableServiceTicketChecking(); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - { - TOfflineUpdater u(s, l, true); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "7: File './tmp/service_tickets' does not exist\n" - << "6: File './tmp/public_keys' was successfully read\n" - << "6: Cache was updated with public keys: XXXXXXXXXXX\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" - << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" - << "6: Cache was updated with 2 service ticket(s): XXXXXXXXXXX\n" - << "6: File './tmp/service_tickets' was successfully written\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); - } - - Y_UNIT_TEST(StartFromHttpAndRestartFromDisk) { - CleanCache(); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); - s.EnableServiceTicketChecking(); - s.EnableUserTicketChecking(EBlackboxEnv::Test); - s.SetDiskCacheDir(CACHE_DIR); - - { - auto l = MakeIntrusive<TLogger>(); - { - TOfflineUpdater u(s, l, true); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "7: File './tmp/service_tickets' does not exist\n" - << "7: File './tmp/public_keys' does not exist\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Response with service tickets for 1 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" - << "7: Got responses with service tickets with 1 pages for 1 destination(s)\n" - << "6: Cache was updated with 1 service ticket(s): XXXXXXXXXXX\n" - << "6: File './tmp/service_tickets' was successfully written\n" - << "7: Public keys were successfully fetched from https://tvm-api.yandex.net\n" - << "6: Cache was updated with public keys: XXXXXXXXXXX\n" - << "6: File './tmp/public_keys' was successfully written\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); - } - - { - auto l = MakeIntrusive<TLogger>(); - { - TOfflineUpdater u(s, l, true); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/service_tickets' was successfully read\n" - << "6: Got 1 service ticket(s) from disk\n" - << "6: Cache was updated with 1 service ticket(s): XXXXXXXXXXX\n" - << "6: File './tmp/public_keys' was successfully read\n" - << "6: Cache was updated with public keys: XXXXXXXXXXX\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); - } - } - - class TUnstableUpdater: public NTvmApi::TThreadedUpdater { - mutable int V1_ = 0; - mutable int V2_ = 0; - - public: - TUnstableUpdater(const NTvmApi::TClientSettings& settings, TIntrusivePtr<TLogger> l) - : NTvmApi::TThreadedUpdater(settings, l) - { - UNIT_ASSERT_NO_EXCEPTION_C(Init(), l->Stream.Str()); - ExpBackoff_.SetEnabled(false); - StartWorker(); - - UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Ok, GetStatus(), l->Stream.Str()); - - Sleep(TDuration::MicroSeconds(100)); - PublicKeysDurations_.Expiring = TDuration::MicroSeconds(100); - UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus(TClientStatus::Warning, "Internal client error: failed to collect last useful error message, please report this message to tvm-dev@yandex-team.ru"), - GetStatus(), - l->Stream.Str()); - - PublicKeysDurations_.Invalid = TDuration::MicroSeconds(20); - UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Error, GetStatus(), l->Stream.Str()); - - PublicKeysDurations_.Expiring = TDuration::Seconds(100); - PublicKeysDurations_.Invalid = TDuration::Seconds(200); - UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Ok, GetStatus(), l->Stream.Str()); - - ServiceTicketsDurations_.Expiring = TDuration::MicroSeconds(100); - UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Warning, GetStatus(), l->Stream.Str()); - - ServiceTicketsDurations_.Invalid = TDuration::MicroSeconds(20); - UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Warning, GetStatus(), l->Stream.Str()); - - const TInstant* inv = &GetCachedServiceTickets()->InvalidationTime; - *const_cast<TInstant*>(inv) = TInstant::Now() + TDuration::Seconds(30); - UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Error, GetStatus(), l->Stream.Str()); - } - - NUtils::TFetchResult FetchServiceTicketsFromHttp(const TString&) const override { - Y_ENSURE_EX(++V1_ > 1, yexception() << "++v1_ > 1:" << V1_); - return {200, {}, "/2/ticket", TVM_RESPONSE, ""}; - } - - NUtils::TFetchResult FetchPublicKeysFromHttp() const override { - Y_ENSURE_EX(++V2_ > 2, yexception() << "++v2_ > 2:" << V2_); - return {200, {}, "/2/keys", NUnittest::TVMKNIFE_PUBLIC_KEYS, ""}; - } - }; - - Y_UNIT_TEST(StartFromUnstableHttp) { - CleanCache(); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); - s.EnableServiceTicketChecking(); - s.EnableUserTicketChecking(EBlackboxEnv::Test); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - { - TUnstableUpdater u(s, l); - } - - UNIT_ASSERT_C(l->Stream.Str().Contains("++v1_ > 1"), l->Stream.Str()); - UNIT_ASSERT_C(l->Stream.Str().Contains("++v2_ > 2"), l->Stream.Str()); - UNIT_ASSERT_C(l->Stream.Str().Contains("7: Response with service tickets for 1 destination(s) was successfully fetched from https://tvm-api.yandex.net"), l->Stream.Str()); - UNIT_ASSERT_C(l->Stream.Str().Contains("7: Public keys were successfully fetched"), l->Stream.Str()); - } - - Y_UNIT_TEST(GetUpdateTimeOfServiceTickets) { - CleanCache(); - TInstant ins = TInstant::Now(); - WriteFile("./service_tickets", - TVM_RESPONSE + "\t" + "100500", - ins); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - TOfflineUpdater u(s, l, true); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - UNIT_ASSERT_VALUES_EQUAL(TInstant(), u.GetUpdateTimeOfPublicKeys()); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(ins.Seconds()), u.GetUpdateTimeOfServiceTickets()); - } - - class TSignalingUpdater: public NTvmApi::TThreadedUpdater { - mutable int V_ = 0; - TAutoEvent& Ev_; - const TStringBuf PublicKeys_; - - public: - TSignalingUpdater(const NTvmApi::TClientSettings& settings, - TLoggerPtr l, - TAutoEvent& ev, - const TStringBuf keys = NUnittest::TVMKNIFE_PUBLIC_KEYS) - : NTvmApi::TThreadedUpdater(settings, l) - , Ev_(ev) - , PublicKeys_(keys) - { - WorkerAwakingPeriod_ = TDuration::MilliSeconds(300); - PublicKeysDurations_.RefreshPeriod = TDuration::MilliSeconds(700); - Init(); - ExpBackoff_.SetEnabled(false); - StartWorker(); - } - - NUtils::TFetchResult FetchPublicKeysFromHttp() const override { - if (++V_ >= 2) { - Ev_.Signal(); - } - return {200, {}, "/2/keys", TString(PublicKeys_), ""}; - } - }; - - Y_UNIT_TEST(StartWorker) { - class TSignalingUpdater: public NTvmApi::TThreadedUpdater { - mutable int V_ = 0; - TAutoEvent& Ev_; - - public: - TSignalingUpdater(const NTvmApi::TClientSettings& settings, TLoggerPtr l, TAutoEvent& ev) - : NTvmApi::TThreadedUpdater(settings, l) - , Ev_(ev) - { - WorkerAwakingPeriod_ = TDuration::MilliSeconds(300); - PublicKeysDurations_.RefreshPeriod = TDuration::MilliSeconds(700); - Init(); - ExpBackoff_.SetEnabled(false); - StartWorker(); - } - - void Worker() override { - NTvmApi::TThreadedUpdater::Worker(); - Ev_.Signal(); - } - - NUtils::TFetchResult FetchPublicKeysFromHttp() const override { - if (++V_ < 4) { - return {500, {}, "/2/keys", "lol", ""}; - } - return {200, {}, "/2/keys", NUnittest::TVMKNIFE_PUBLIC_KEYS, "CAEQChkAAAAAAAD4PyGamZmZmZm5PyhkMAE4B0BGSAI"}; - } - }; - - CleanCache(); - TInstant expiringPubKeys = TInstant::Now() - TDuration::Days(3); - WriteFile("./public_keys", NUnittest::TVMKNIFE_PUBLIC_KEYS, expiringPubKeys); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketChecking(); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - TAutoEvent ev; - { - TSignalingUpdater u(s, l, ev); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus(TClientStatus::Warning, "PublicKeys: Path:/2/keys.Code=500: lol"), - u.GetStatus()); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(expiringPubKeys.Seconds()), u.GetUpdateTimeOfPublicKeys()); - UNIT_ASSERT_VALUES_EQUAL(TInstant(), u.GetUpdateTimeOfServiceTickets()); - - UNIT_ASSERT(ev.WaitT(TDuration::Seconds(15))); - Sleep(TDuration::MilliSeconds(500)); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/public_keys' was successfully read\n" - << "6: Cache was updated with public keys: XXXXXXXXXXX\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "4: Failed to get PublicKeys: Path:/2/keys.Code=500: lol\n" - << "4: Failed to get PublicKeys: Path:/2/keys.Code=500: lol\n" - << "4: Failed to get PublicKeys: Path:/2/keys.Code=500: lol\n" - << "4: Failed to update public keys: Path:/2/keys.Code=500: lol\n" - << "3: Public keys have not been refreshed for too long period\n" - << "7: Thread-worker started\n" - << "7: Retry settings were updated: exponential_backoff_min:0.000000s->1.000000s;exponential_backoff_max:60.000000s->10.000000s;exponential_backoff_factor:2->1.5;exponential_backoff_jitter:0.5->0.1;max_random_sleep_default:5.000000s->0.100000s;retries_on_start:3->1;worker_awaking_period:10.000000s->7.000000s;dsts_limit:300->70;\n" - << "6: File './tmp/retry_settings' was successfully written\n" - << "7: Public keys were successfully fetched from https://tvm-api.yandex.net\n" - << "6: Cache was updated with public keys: XXXXXXXXXXX\n" - << "6: File './tmp/public_keys' was successfully written\n" - << "7: Thread-worker stopped\n", - std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); - } - -#if defined(_unix_) - Y_UNIT_TEST(StartFromCacheAndBadPublicKeysFromHttp) { - CleanCache(); - TInstant now = TInstant::Now(); - WriteFile("public_keys", NUnittest::TVMKNIFE_PUBLIC_KEYS, now - TDuration::Days(3)); // expiring public keys - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketChecking(); - s.SetDiskCacheDir(CACHE_DIR); - - auto l = MakeIntrusive<TLogger>(); - { - TAutoEvent ev; - TSignalingUpdater u(s, l, ev, "malformed keys"); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus(TClientStatus::Warning, "PublicKeys: Malformed TVM keys"), - u.GetStatus()); - - UNIT_ASSERT(ev.WaitT(TDuration::Seconds(15))); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Warning, u.GetStatus()); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "6: File './tmp/public_keys' was successfully read\n" - << "6: Cache was updated with public keys: " << TInstant::Seconds((now - TDuration::Days(3)).Seconds()) << "\n" - << "7: File './tmp/retry_settings' does not exist\n" - << "7: Public keys were successfully fetched from https://tvm-api.yandex.net\n" - << "4: Failed to update public keys: Malformed TVM keys\n" - << "3: Public keys have not been refreshed for too long period\n" - << "7: Thread-worker started\n" - << "7: Public keys were successfully fetched from https://tvm-api.yandex.net\n" - << "4: Failed to update public keys: Malformed TVM keys\n" - << "3: Public keys have not been refreshed for too long period\n" - << "7: Thread-worker stopped\n", - l->Stream.Str()); - } -#endif - - Y_UNIT_TEST(StartWithBadPublicKeysFromHttp) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketChecking(); - - auto l = MakeIntrusive<TLogger>(); - TAutoEvent ev; - UNIT_ASSERT_EXCEPTION_CONTAINS(TOfflineUpdater(s, l, true, "some public keys"), - TRetriableException, - "Failed to start TvmClient. You can retry:"); - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() + << "4: Failed to get ServiceTickets: alarm\n" + << "4: Failed to get ServiceTickets: alarm\n" + << "4: Failed to get ServiceTickets: alarm\n" + << "4: Failed to update service tickets: alarm\n" + << "3: Service tickets have not been refreshed for too long period\n", + l->Stream.Str()); + } + + static void WriteFile(TString name, TStringBuf body, TInstant time) { + NFs::Remove(CACHE_DIR + name); + TFileOutput f(CACHE_DIR + name); + f << TDiskWriter::PrepareData(time, body); + } + + Y_UNIT_TEST(StartWithOldCache) { + CleanCache(); + WriteFile("./public_keys", + NUnittest::TVMKNIFE_PUBLIC_KEYS, + TInstant::Now() - TDuration::Days(30)); // too old + WriteFile("./service_tickets", + R"({"19":{"ticket":"3:serv:CBAQACIGCJSRBhAL:Fi"}})" + "\t100500", + TInstant::Now()); // too old + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); + s.EnableServiceTicketChecking(); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + { + TOfflineUpdater u(s, l, true); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + } + + UNIT_ASSERT_C(l->Stream.Str().find("Disk cache (public keys) is too old") != TString::npos, l->Stream.Str()); + UNIT_ASSERT_C(l->Stream.Str().find("Disk cache (service tickets) is too old") != TString::npos, l->Stream.Str()); + UNIT_ASSERT_C(l->Stream.Str().find("were successfully fetched") != TString::npos, l->Stream.Str()); + } + + Y_UNIT_TEST(StartWithMissingCache) { + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketChecking(); + s.SetDiskCacheDir("../"); + + auto l = MakeIntrusive<TLogger>(); + UNIT_ASSERT_EXCEPTION_CONTAINS(TOfflineUpdater(s, l), + TRetriableException, + "Failed to start TvmClient. You can retry: "); + + UNIT_ASSERT_C(l->Stream.Str().find("does not exist") != TString::npos, l->Stream.Str()); + UNIT_ASSERT_C(l->Stream.Str().find("were successfully fetched") == TString::npos, l->Stream.Str()); + } + + Y_UNIT_TEST(StartWithBadCache_Tickets) { + CleanCache(); + WriteFile("./service_tickets", + TVM_RESPONSE, + TInstant::Now()); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + { + TOfflineUpdater u(s, l, true); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/service_tickets' was successfully read\n" + << "4: Failed to read service tickets from disk: YYYYYYYYYYYYYYY\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" + << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" + << "6: Cache was updated with 2 service ticket(s): XXXXXXXXXXX\n" + << "6: File './tmp/service_tickets' was successfully written\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + std::regex_replace(std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX"), + std::regex(R"(Failed to read service tickets from disk: [^\n]+)"), + "Failed to read service tickets from disk: YYYYYYYYYYYYYYY")); + } + + Y_UNIT_TEST(StartWithBadCache_PublicKeys) { + CleanCache(); + WriteFile("./public_keys", + "ksjdafnlskdjzfgbhdl", + TInstant::Now()); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketChecking(); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + UNIT_ASSERT_EXCEPTION_CONTAINS(TOfflineUpdater(s, l), + TRetriableException, + "Failed to start TvmClient. You can retry:"); + + UNIT_ASSERT_C(l->Stream.Str().find("4: Failed to read public keys from disk: Malformed TVM keys") != TString::npos, l->Stream.Str()); + } + + Y_UNIT_TEST(StartWithCacheForAnotherTvmId) { + CleanCache(); + WriteFile("./service_tickets", + TVM_RESPONSE + "\t" + "100499", + TInstant::Now()); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + { + TOfflineUpdater u(s, l, true); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/service_tickets' was successfully read\n" + << "4: Disk cache is for another tvmId (100499). Self=100500\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" + << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" + << "6: Cache was updated with 2 service ticket(s): XXXXXXXXXXX\n" + << "6: File './tmp/service_tickets' was successfully written\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); + } + + Y_UNIT_TEST(StartWithCacheForAnotherDsts) { + CleanCache(); + TInstant now = TInstant::Now(); + WriteFile("./service_tickets", + R"({"213" : { "ticket" : "3:serv:CBAQ__________9_IgYIlJEGEAs:T-"}})" + "\t" + "100500", + now); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + { + TOfflineUpdater u(s, l, true); + auto cache = u.GetCachedServiceTickets(); + UNIT_ASSERT(cache->TicketsById.contains(213)); + UNIT_ASSERT(cache->TicketsById.contains(19)); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + } + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/service_tickets' was successfully read\n" + << "6: Got 1 service ticket(s) from disk\n" + << "6: Cache was updated with 1 service ticket(s): " << TInstant::Seconds(now.Seconds()) << "\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Response with service tickets for 1 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" + << "7: Got responses with service tickets with 1 pages for 1 destination(s)\n" + << "6: Cache was partly updated with 1 service ticket(s). total: 2\n" + << "6: File './tmp/service_tickets' was successfully written\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + l->Stream.Str()); + l->Stream.Clear(); + + { + TOfflineUpdater u(s, l, true); + auto cache = u.GetCachedServiceTickets(); + UNIT_ASSERT(cache->TicketsById.contains(213)); + UNIT_ASSERT(cache->TicketsById.contains(19)); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + } + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/service_tickets' was successfully read\n" + << "6: Got 2 service ticket(s) from disk\n" + << "6: Cache was updated with 2 service ticket(s): XXXXXXXXXXX\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); + } + + Y_UNIT_TEST(StartWithNotFreshCacheForAnotherDsts) { + CleanCache(); + TInstant now = TInstant::Now(); + WriteFile("./service_tickets", + R"({"213" : { "ticket" : "3:serv:CBAQ__________9_IgYIlJEGEAs:T-"}})" + "\t" + "100500", + now - TDuration::Hours(2)); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + { + TOfflineUpdater u(s, l, true); + auto cache = u.GetCachedServiceTickets(); + UNIT_ASSERT(cache->TicketsById.contains(213)); + UNIT_ASSERT(cache->TicketsById.contains(19)); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + } + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/service_tickets' was successfully read\n" + << "6: Got 1 service ticket(s) from disk\n" + << "6: Cache was updated with 1 service ticket(s): XXXXXXXXXXX\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" + << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" + << "6: Cache was updated with 2 service ticket(s): XXXXXXXXXXX\n" + << "6: File './tmp/service_tickets' was successfully written\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); + l->Stream.Clear(); + + { + TOfflineUpdater u(s, l, true); + auto cache = u.GetCachedServiceTickets(); + UNIT_ASSERT(cache->TicketsById.contains(213)); + UNIT_ASSERT(cache->TicketsById.contains(19)); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + } + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/service_tickets' was successfully read\n" + << "6: Got 2 service ticket(s) from disk\n" + << "6: Cache was updated with 2 service ticket(s): XXXXXXXXXXX\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); + } + + Y_UNIT_TEST(StartWithPartialDiskCache) { + CleanCache(); + WriteFile("./public_keys", + NUnittest::TVMKNIFE_PUBLIC_KEYS, + TInstant::Now()); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"kolmo", 213}}); + s.EnableServiceTicketChecking(); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + { + TOfflineUpdater u(s, l, true); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "7: File './tmp/service_tickets' does not exist\n" + << "6: File './tmp/public_keys' was successfully read\n" + << "6: Cache was updated with public keys: XXXXXXXXXXX\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" + << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" + << "6: Cache was updated with 2 service ticket(s): XXXXXXXXXXX\n" + << "6: File './tmp/service_tickets' was successfully written\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); + } + + Y_UNIT_TEST(StartFromHttpAndRestartFromDisk) { + CleanCache(); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); + s.EnableServiceTicketChecking(); + s.EnableUserTicketChecking(EBlackboxEnv::Test); + s.SetDiskCacheDir(CACHE_DIR); + + { + auto l = MakeIntrusive<TLogger>(); + { + TOfflineUpdater u(s, l, true); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "7: File './tmp/service_tickets' does not exist\n" + << "7: File './tmp/public_keys' does not exist\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Response with service tickets for 1 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" + << "7: Got responses with service tickets with 1 pages for 1 destination(s)\n" + << "6: Cache was updated with 1 service ticket(s): XXXXXXXXXXX\n" + << "6: File './tmp/service_tickets' was successfully written\n" + << "7: Public keys were successfully fetched from https://tvm-api.yandex.net\n" + << "6: Cache was updated with public keys: XXXXXXXXXXX\n" + << "6: File './tmp/public_keys' was successfully written\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); + } + + { + auto l = MakeIntrusive<TLogger>(); + { + TOfflineUpdater u(s, l, true); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/service_tickets' was successfully read\n" + << "6: Got 1 service ticket(s) from disk\n" + << "6: Cache was updated with 1 service ticket(s): XXXXXXXXXXX\n" + << "6: File './tmp/public_keys' was successfully read\n" + << "6: Cache was updated with public keys: XXXXXXXXXXX\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); + } + } + + class TUnstableUpdater: public NTvmApi::TThreadedUpdater { + mutable int V1_ = 0; + mutable int V2_ = 0; + + public: + TUnstableUpdater(const NTvmApi::TClientSettings& settings, TIntrusivePtr<TLogger> l) + : NTvmApi::TThreadedUpdater(settings, l) + { + UNIT_ASSERT_NO_EXCEPTION_C(Init(), l->Stream.Str()); + ExpBackoff_.SetEnabled(false); + StartWorker(); + + UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Ok, GetStatus(), l->Stream.Str()); + + Sleep(TDuration::MicroSeconds(100)); + PublicKeysDurations_.Expiring = TDuration::MicroSeconds(100); + UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus(TClientStatus::Warning, "Internal client error: failed to collect last useful error message, please report this message to tvm-dev@yandex-team.ru"), + GetStatus(), + l->Stream.Str()); + + PublicKeysDurations_.Invalid = TDuration::MicroSeconds(20); + UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Error, GetStatus(), l->Stream.Str()); + + PublicKeysDurations_.Expiring = TDuration::Seconds(100); + PublicKeysDurations_.Invalid = TDuration::Seconds(200); + UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Ok, GetStatus(), l->Stream.Str()); + + ServiceTicketsDurations_.Expiring = TDuration::MicroSeconds(100); + UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Warning, GetStatus(), l->Stream.Str()); + + ServiceTicketsDurations_.Invalid = TDuration::MicroSeconds(20); + UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Warning, GetStatus(), l->Stream.Str()); + + const TInstant* inv = &GetCachedServiceTickets()->InvalidationTime; + *const_cast<TInstant*>(inv) = TInstant::Now() + TDuration::Seconds(30); + UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Error, GetStatus(), l->Stream.Str()); + } + + NUtils::TFetchResult FetchServiceTicketsFromHttp(const TString&) const override { + Y_ENSURE_EX(++V1_ > 1, yexception() << "++v1_ > 1:" << V1_); + return {200, {}, "/2/ticket", TVM_RESPONSE, ""}; + } + + NUtils::TFetchResult FetchPublicKeysFromHttp() const override { + Y_ENSURE_EX(++V2_ > 2, yexception() << "++v2_ > 2:" << V2_); + return {200, {}, "/2/keys", NUnittest::TVMKNIFE_PUBLIC_KEYS, ""}; + } + }; + + Y_UNIT_TEST(StartFromUnstableHttp) { + CleanCache(); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); + s.EnableServiceTicketChecking(); + s.EnableUserTicketChecking(EBlackboxEnv::Test); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + { + TUnstableUpdater u(s, l); + } + + UNIT_ASSERT_C(l->Stream.Str().Contains("++v1_ > 1"), l->Stream.Str()); + UNIT_ASSERT_C(l->Stream.Str().Contains("++v2_ > 2"), l->Stream.Str()); + UNIT_ASSERT_C(l->Stream.Str().Contains("7: Response with service tickets for 1 destination(s) was successfully fetched from https://tvm-api.yandex.net"), l->Stream.Str()); + UNIT_ASSERT_C(l->Stream.Str().Contains("7: Public keys were successfully fetched"), l->Stream.Str()); + } + + Y_UNIT_TEST(GetUpdateTimeOfServiceTickets) { + CleanCache(); + TInstant ins = TInstant::Now(); + WriteFile("./service_tickets", + TVM_RESPONSE + "\t" + "100500", + ins); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + TOfflineUpdater u(s, l, true); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + UNIT_ASSERT_VALUES_EQUAL(TInstant(), u.GetUpdateTimeOfPublicKeys()); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(ins.Seconds()), u.GetUpdateTimeOfServiceTickets()); + } + + class TSignalingUpdater: public NTvmApi::TThreadedUpdater { + mutable int V_ = 0; + TAutoEvent& Ev_; + const TStringBuf PublicKeys_; + + public: + TSignalingUpdater(const NTvmApi::TClientSettings& settings, + TLoggerPtr l, + TAutoEvent& ev, + const TStringBuf keys = NUnittest::TVMKNIFE_PUBLIC_KEYS) + : NTvmApi::TThreadedUpdater(settings, l) + , Ev_(ev) + , PublicKeys_(keys) + { + WorkerAwakingPeriod_ = TDuration::MilliSeconds(300); + PublicKeysDurations_.RefreshPeriod = TDuration::MilliSeconds(700); + Init(); + ExpBackoff_.SetEnabled(false); + StartWorker(); + } + + NUtils::TFetchResult FetchPublicKeysFromHttp() const override { + if (++V_ >= 2) { + Ev_.Signal(); + } + return {200, {}, "/2/keys", TString(PublicKeys_), ""}; + } + }; + + Y_UNIT_TEST(StartWorker) { + class TSignalingUpdater: public NTvmApi::TThreadedUpdater { + mutable int V_ = 0; + TAutoEvent& Ev_; + + public: + TSignalingUpdater(const NTvmApi::TClientSettings& settings, TLoggerPtr l, TAutoEvent& ev) + : NTvmApi::TThreadedUpdater(settings, l) + , Ev_(ev) + { + WorkerAwakingPeriod_ = TDuration::MilliSeconds(300); + PublicKeysDurations_.RefreshPeriod = TDuration::MilliSeconds(700); + Init(); + ExpBackoff_.SetEnabled(false); + StartWorker(); + } + + void Worker() override { + NTvmApi::TThreadedUpdater::Worker(); + Ev_.Signal(); + } + + NUtils::TFetchResult FetchPublicKeysFromHttp() const override { + if (++V_ < 4) { + return {500, {}, "/2/keys", "lol", ""}; + } + return {200, {}, "/2/keys", NUnittest::TVMKNIFE_PUBLIC_KEYS, "CAEQChkAAAAAAAD4PyGamZmZmZm5PyhkMAE4B0BGSAI"}; + } + }; + + CleanCache(); + TInstant expiringPubKeys = TInstant::Now() - TDuration::Days(3); + WriteFile("./public_keys", NUnittest::TVMKNIFE_PUBLIC_KEYS, expiringPubKeys); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketChecking(); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + TAutoEvent ev; + { + TSignalingUpdater u(s, l, ev); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus(TClientStatus::Warning, "PublicKeys: Path:/2/keys.Code=500: lol"), + u.GetStatus()); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(expiringPubKeys.Seconds()), u.GetUpdateTimeOfPublicKeys()); + UNIT_ASSERT_VALUES_EQUAL(TInstant(), u.GetUpdateTimeOfServiceTickets()); + + UNIT_ASSERT(ev.WaitT(TDuration::Seconds(15))); + Sleep(TDuration::MilliSeconds(500)); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/public_keys' was successfully read\n" + << "6: Cache was updated with public keys: XXXXXXXXXXX\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "4: Failed to get PublicKeys: Path:/2/keys.Code=500: lol\n" + << "4: Failed to get PublicKeys: Path:/2/keys.Code=500: lol\n" + << "4: Failed to get PublicKeys: Path:/2/keys.Code=500: lol\n" + << "4: Failed to update public keys: Path:/2/keys.Code=500: lol\n" + << "3: Public keys have not been refreshed for too long period\n" + << "7: Thread-worker started\n" + << "7: Retry settings were updated: exponential_backoff_min:0.000000s->1.000000s;exponential_backoff_max:60.000000s->10.000000s;exponential_backoff_factor:2->1.5;exponential_backoff_jitter:0.5->0.1;max_random_sleep_default:5.000000s->0.100000s;retries_on_start:3->1;worker_awaking_period:10.000000s->7.000000s;dsts_limit:300->70;\n" + << "6: File './tmp/retry_settings' was successfully written\n" + << "7: Public keys were successfully fetched from https://tvm-api.yandex.net\n" + << "6: Cache was updated with public keys: XXXXXXXXXXX\n" + << "6: File './tmp/public_keys' was successfully written\n" + << "7: Thread-worker stopped\n", + std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); + } + +#if defined(_unix_) + Y_UNIT_TEST(StartFromCacheAndBadPublicKeysFromHttp) { + CleanCache(); + TInstant now = TInstant::Now(); + WriteFile("public_keys", NUnittest::TVMKNIFE_PUBLIC_KEYS, now - TDuration::Days(3)); // expiring public keys + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketChecking(); + s.SetDiskCacheDir(CACHE_DIR); + + auto l = MakeIntrusive<TLogger>(); + { + TAutoEvent ev; + TSignalingUpdater u(s, l, ev, "malformed keys"); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus(TClientStatus::Warning, "PublicKeys: Malformed TVM keys"), + u.GetStatus()); + + UNIT_ASSERT(ev.WaitT(TDuration::Seconds(15))); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Warning, u.GetStatus()); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "6: File './tmp/public_keys' was successfully read\n" + << "6: Cache was updated with public keys: " << TInstant::Seconds((now - TDuration::Days(3)).Seconds()) << "\n" + << "7: File './tmp/retry_settings' does not exist\n" + << "7: Public keys were successfully fetched from https://tvm-api.yandex.net\n" + << "4: Failed to update public keys: Malformed TVM keys\n" + << "3: Public keys have not been refreshed for too long period\n" + << "7: Thread-worker started\n" + << "7: Public keys were successfully fetched from https://tvm-api.yandex.net\n" + << "4: Failed to update public keys: Malformed TVM keys\n" + << "3: Public keys have not been refreshed for too long period\n" + << "7: Thread-worker stopped\n", + l->Stream.Str()); + } +#endif + + Y_UNIT_TEST(StartWithBadPublicKeysFromHttp) { + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketChecking(); + + auto l = MakeIntrusive<TLogger>(); + TAutoEvent ev; + UNIT_ASSERT_EXCEPTION_CONTAINS(TOfflineUpdater(s, l, true, "some public keys"), + TRetriableException, + "Failed to start TvmClient. You can retry:"); + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() << "6: Disk cache disabled. Please set disk cache directory in settings for best reliability\n" - << "7: Public keys were successfully fetched from https://tvm-api.yandex.net\n" - << "4: Failed to update public keys: Malformed TVM keys\n" - << "3: Public keys have not been refreshed for too long period\n", - l->Stream.Str()); - } - - class TNotInitedUpdater: public NTvmApi::TThreadedUpdater { - public: - TNotInitedUpdater(const NTvmApi::TClientSettings& settings, TLoggerPtr l = TDevNullLogger::IAmBrave()) - : NTvmApi::TThreadedUpdater(settings, l) - { - this->ExpBackoff_.SetEnabled(false); - } - - using NTvmApi::TThreadedUpdater::AppendToJsonArray; - using NTvmApi::TThreadedUpdater::AreServicesTicketsOk; - using NTvmApi::TThreadedUpdater::CreateJsonArray; - using NTvmApi::TThreadedUpdater::FindMissingDsts; - using NTvmApi::TThreadedUpdater::GetPublicKeysFromHttp; - using NTvmApi::TThreadedUpdater::GetServiceTicketsFromHttp; - using NTvmApi::TThreadedUpdater::Init; - using NTvmApi::TThreadedUpdater::IsServiceContextOk; - using NTvmApi::TThreadedUpdater::IsTimeToUpdatePublicKeys; - using NTvmApi::TThreadedUpdater::IsTimeToUpdateServiceTickets; - using NTvmApi::TThreadedUpdater::IsUserContextOk; - using NTvmApi::TThreadedUpdater::ParseTicketsFromDisk; - using NTvmApi::TThreadedUpdater::ParseTicketsFromResponse; - using NTvmApi::TThreadedUpdater::PrepareRequestForServiceTickets; - using NTvmApi::TThreadedUpdater::PrepareTicketsForDisk; - using NTvmApi::TThreadedUpdater::SetServiceContext; - using NTvmApi::TThreadedUpdater::SetServiceTickets; - using NTvmApi::TThreadedUpdater::SetUserContext; - using NTvmApi::TThreadedUpdater::THttpResult; - using NTvmApi::TThreadedUpdater::TPairTicketsErrors; - using TAsyncUpdaterBase::IsServiceTicketMapOk; - }; - - Y_UNIT_TEST(IsCacheComplete_Empty) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"blackbox2", 20}}); - s.EnableServiceTicketChecking(); - s.EnableUserTicketChecking(EBlackboxEnv::Test); - - TNotInitedUpdater u(s); - UNIT_ASSERT(!u.AreServicesTicketsOk()); - } - - Y_UNIT_TEST(IsCacheComplete_Tickets) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"blackbox2", 20}}); - - TNotInitedUpdater u(s); - UNIT_ASSERT(!u.AreServicesTicketsOk()); - - u.SetServiceTickets(MakeIntrusiveConst<TServiceTickets>( - TServiceTickets::TMapIdStr({{1, "mega_ticket"}}), - TServiceTickets::TMapIdStr({{2, "mega_error"}}), - TServiceTickets::TMapAliasId())); - UNIT_ASSERT(!u.AreServicesTicketsOk()); - - u.SetServiceTickets(MakeIntrusiveConst<TServiceTickets>( - TServiceTickets::TMapIdStr({ - {1, "mega_ticket"}, - {2, "mega_ticket2"}, - }), - TServiceTickets::TMapIdStr({ - {3, "mega_error3"}, - }), - TServiceTickets::TMapAliasId())); - UNIT_ASSERT(u.AreServicesTicketsOk()); - } - - Y_UNIT_TEST(IsCacheComplete_Service) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketChecking(); - - TNotInitedUpdater u(s); - UNIT_ASSERT(!u.IsServiceContextOk()); - - u.SetServiceContext(MakeIntrusiveConst<TServiceContext>( - TServiceContext::CheckingFactory(100500, NUnittest::TVMKNIFE_PUBLIC_KEYS))); - UNIT_ASSERT(u.IsServiceContextOk()); - } - - Y_UNIT_TEST(IsCacheComplete_User) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableUserTicketChecking(EBlackboxEnv::Test); - - TNotInitedUpdater u(s); - UNIT_ASSERT(!u.IsUserContextOk()); - - u.SetUserContext(NUnittest::TVMKNIFE_PUBLIC_KEYS); - UNIT_ASSERT(u.IsUserContextOk()); - } - - Y_UNIT_TEST(TicketsOnDisk) { - TString res = R"({ - "19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, - "213" : { "ticket" : "service_ticket_2"}, - "234" : { "error" : "Dst is not found" }, - "185" : { "ticket" : "service_ticket_3"}, - "deprecated" : { "ticket" : "deprecated_ticket" } - })"; - res.append("\t100500"); - - UNIT_ASSERT_VALUES_EQUAL(res, TNotInitedUpdater::PrepareTicketsForDisk(TVM_RESPONSE, 100500)); - - auto pair = TNotInitedUpdater::ParseTicketsFromDisk(res); - UNIT_ASSERT_VALUES_EQUAL(pair.first, TVM_RESPONSE); - UNIT_ASSERT_VALUES_EQUAL(pair.second, 100500); - - res.push_back('a'); - UNIT_ASSERT_EXCEPTION(TNotInitedUpdater::ParseTicketsFromDisk(res), yexception); - } - - Y_UNIT_TEST(IsTimeToUpdatePublicKeys) { - NTvmApi::TClientSettings s; - s.EnableUserTicketChecking(EBlackboxEnv::Test); - - TNotInitedUpdater u(s); - - UNIT_ASSERT(!u.IsTimeToUpdatePublicKeys(TInstant::Now())); - UNIT_ASSERT(!u.IsTimeToUpdatePublicKeys(TInstant::Now() - TDuration::Hours(23))); - UNIT_ASSERT(u.IsTimeToUpdatePublicKeys(TInstant::Now() - TDuration::Days(1) - TDuration::MilliSeconds(1))); - } - - Y_UNIT_TEST(IsTimeToUpdateServiceTickets) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"blackbox2", 20}}); - - TNotInitedUpdater u(s); - - UNIT_ASSERT(!u.IsTimeToUpdateServiceTickets(TInstant::Now() - TDuration::Minutes(59))); - UNIT_ASSERT(u.IsTimeToUpdateServiceTickets(TInstant::Now() - TDuration::Hours(1) - TDuration::MilliSeconds(1))); - } - - Y_UNIT_TEST(StartWithIncompliteCache) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", NTvmApi::TClientSettings::TDstVector({19, 20})); - s.EnableServiceTicketChecking(); - s.EnableUserTicketChecking(EBlackboxEnv::Test); - - auto l = MakeIntrusive<TLogger>(); - UNIT_ASSERT_EXCEPTION_CONTAINS(TOfflineUpdater(s, l, true), - TNonRetriableException, - "Failed to get ServiceTicket for 20: Missing tvm_id in response, should never happend: 20"); - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() + << "7: Public keys were successfully fetched from https://tvm-api.yandex.net\n" + << "4: Failed to update public keys: Malformed TVM keys\n" + << "3: Public keys have not been refreshed for too long period\n", + l->Stream.Str()); + } + + class TNotInitedUpdater: public NTvmApi::TThreadedUpdater { + public: + TNotInitedUpdater(const NTvmApi::TClientSettings& settings, TLoggerPtr l = TDevNullLogger::IAmBrave()) + : NTvmApi::TThreadedUpdater(settings, l) + { + this->ExpBackoff_.SetEnabled(false); + } + + using NTvmApi::TThreadedUpdater::AppendToJsonArray; + using NTvmApi::TThreadedUpdater::AreServicesTicketsOk; + using NTvmApi::TThreadedUpdater::CreateJsonArray; + using NTvmApi::TThreadedUpdater::FindMissingDsts; + using NTvmApi::TThreadedUpdater::GetPublicKeysFromHttp; + using NTvmApi::TThreadedUpdater::GetServiceTicketsFromHttp; + using NTvmApi::TThreadedUpdater::Init; + using NTvmApi::TThreadedUpdater::IsServiceContextOk; + using NTvmApi::TThreadedUpdater::IsTimeToUpdatePublicKeys; + using NTvmApi::TThreadedUpdater::IsTimeToUpdateServiceTickets; + using NTvmApi::TThreadedUpdater::IsUserContextOk; + using NTvmApi::TThreadedUpdater::ParseTicketsFromDisk; + using NTvmApi::TThreadedUpdater::ParseTicketsFromResponse; + using NTvmApi::TThreadedUpdater::PrepareRequestForServiceTickets; + using NTvmApi::TThreadedUpdater::PrepareTicketsForDisk; + using NTvmApi::TThreadedUpdater::SetServiceContext; + using NTvmApi::TThreadedUpdater::SetServiceTickets; + using NTvmApi::TThreadedUpdater::SetUserContext; + using NTvmApi::TThreadedUpdater::THttpResult; + using NTvmApi::TThreadedUpdater::TPairTicketsErrors; + using TAsyncUpdaterBase::IsServiceTicketMapOk; + }; + + Y_UNIT_TEST(IsCacheComplete_Empty) { + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"blackbox2", 20}}); + s.EnableServiceTicketChecking(); + s.EnableUserTicketChecking(EBlackboxEnv::Test); + + TNotInitedUpdater u(s); + UNIT_ASSERT(!u.AreServicesTicketsOk()); + } + + Y_UNIT_TEST(IsCacheComplete_Tickets) { + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"blackbox2", 20}}); + + TNotInitedUpdater u(s); + UNIT_ASSERT(!u.AreServicesTicketsOk()); + + u.SetServiceTickets(MakeIntrusiveConst<TServiceTickets>( + TServiceTickets::TMapIdStr({{1, "mega_ticket"}}), + TServiceTickets::TMapIdStr({{2, "mega_error"}}), + TServiceTickets::TMapAliasId())); + UNIT_ASSERT(!u.AreServicesTicketsOk()); + + u.SetServiceTickets(MakeIntrusiveConst<TServiceTickets>( + TServiceTickets::TMapIdStr({ + {1, "mega_ticket"}, + {2, "mega_ticket2"}, + }), + TServiceTickets::TMapIdStr({ + {3, "mega_error3"}, + }), + TServiceTickets::TMapAliasId())); + UNIT_ASSERT(u.AreServicesTicketsOk()); + } + + Y_UNIT_TEST(IsCacheComplete_Service) { + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketChecking(); + + TNotInitedUpdater u(s); + UNIT_ASSERT(!u.IsServiceContextOk()); + + u.SetServiceContext(MakeIntrusiveConst<TServiceContext>( + TServiceContext::CheckingFactory(100500, NUnittest::TVMKNIFE_PUBLIC_KEYS))); + UNIT_ASSERT(u.IsServiceContextOk()); + } + + Y_UNIT_TEST(IsCacheComplete_User) { + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableUserTicketChecking(EBlackboxEnv::Test); + + TNotInitedUpdater u(s); + UNIT_ASSERT(!u.IsUserContextOk()); + + u.SetUserContext(NUnittest::TVMKNIFE_PUBLIC_KEYS); + UNIT_ASSERT(u.IsUserContextOk()); + } + + Y_UNIT_TEST(TicketsOnDisk) { + TString res = R"({ + "19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, + "213" : { "ticket" : "service_ticket_2"}, + "234" : { "error" : "Dst is not found" }, + "185" : { "ticket" : "service_ticket_3"}, + "deprecated" : { "ticket" : "deprecated_ticket" } + })"; + res.append("\t100500"); + + UNIT_ASSERT_VALUES_EQUAL(res, TNotInitedUpdater::PrepareTicketsForDisk(TVM_RESPONSE, 100500)); + + auto pair = TNotInitedUpdater::ParseTicketsFromDisk(res); + UNIT_ASSERT_VALUES_EQUAL(pair.first, TVM_RESPONSE); + UNIT_ASSERT_VALUES_EQUAL(pair.second, 100500); + + res.push_back('a'); + UNIT_ASSERT_EXCEPTION(TNotInitedUpdater::ParseTicketsFromDisk(res), yexception); + } + + Y_UNIT_TEST(IsTimeToUpdatePublicKeys) { + NTvmApi::TClientSettings s; + s.EnableUserTicketChecking(EBlackboxEnv::Test); + + TNotInitedUpdater u(s); + + UNIT_ASSERT(!u.IsTimeToUpdatePublicKeys(TInstant::Now())); + UNIT_ASSERT(!u.IsTimeToUpdatePublicKeys(TInstant::Now() - TDuration::Hours(23))); + UNIT_ASSERT(u.IsTimeToUpdatePublicKeys(TInstant::Now() - TDuration::Days(1) - TDuration::MilliSeconds(1))); + } + + Y_UNIT_TEST(IsTimeToUpdateServiceTickets) { + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}, {"blackbox2", 20}}); + + TNotInitedUpdater u(s); + + UNIT_ASSERT(!u.IsTimeToUpdateServiceTickets(TInstant::Now() - TDuration::Minutes(59))); + UNIT_ASSERT(u.IsTimeToUpdateServiceTickets(TInstant::Now() - TDuration::Hours(1) - TDuration::MilliSeconds(1))); + } + + Y_UNIT_TEST(StartWithIncompliteCache) { + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", NTvmApi::TClientSettings::TDstVector({19, 20})); + s.EnableServiceTicketChecking(); + s.EnableUserTicketChecking(EBlackboxEnv::Test); + + auto l = MakeIntrusive<TLogger>(); + UNIT_ASSERT_EXCEPTION_CONTAINS(TOfflineUpdater(s, l, true), + TNonRetriableException, + "Failed to get ServiceTicket for 20: Missing tvm_id in response, should never happend: 20"); + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() << "6: Disk cache disabled. Please set disk cache directory in settings for best reliability\n" - << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" - << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" - << "3: Failed to get service ticket for dst=20: Missing tvm_id in response, should never happend: 20\n" - << "6: Cache was updated with 1 service ticket(s): XXXXXXXXXXX\n", - std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); - } - - Y_UNIT_TEST(PrepareRequestForServiceTickets) { - const TServiceContext ctx = TServiceContext::SigningFactory("AAAAAAAAAAAAAAAAAAAAAA"); - - TString s = TNotInitedUpdater::PrepareRequestForServiceTickets(117, - ctx, - {19, 20}, - NUtils::TProcInfo{ - "__some_pid__", - "__some_pname__", - "kar", - }, - 100700); - SubstGlobal(s.resize(s.size() - 5), "deb_", ""); - UNIT_ASSERT_VALUES_EQUAL("grant_type=client_credentials&src=117&dst=19,20&ts=100700&sign=XTz2Obd6PII_BHxswzWPJTjju9SrKsN6hyu1VsyxBvU&get_retry_settings=yes&_pid=__some_pid__&_procces_name=__some_pname__&lib_version=client_kar", - s); - - s = TNotInitedUpdater::PrepareRequestForServiceTickets(118, - ctx, - {19}, - NUtils::TProcInfo{ - "__some_pid__", - {}, - "kva_", - }, - 100900); - SubstGlobal(s.resize(s.size() - 5), "deb_", ""); - UNIT_ASSERT_VALUES_EQUAL("grant_type=client_credentials&src=118&dst=19&ts=100900&sign=-trBo9AtBLjp2ihy6cFAdMAQ6S9afHj23rFzYQ32jkQ&get_retry_settings=yes&_pid=__some_pid__&lib_version=client_kva_", - s); - } - - Y_UNIT_TEST(ParseTicketsFromResponse) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketChecking(); - - auto l = MakeIntrusive<TLogger>(); - TNotInitedUpdater u(s, l); - - TNotInitedUpdater::TPairTicketsErrors t; - UNIT_ASSERT_EXCEPTION_CONTAINS(u.ParseTicketsFromResponse("{", NTvmApi::TDstSet{19}, t), - yexception, - "Invalid json from tvm-api"); - - t = {}; - u.ParseTicketsFromResponse(TVM_RESPONSE, NTvmApi::TDstSet{19}, t); - - TNotInitedUpdater::TPairTicketsErrors expected{{{19, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}}, {}}; + << "7: Response with service tickets for 2 destination(s) was successfully fetched from https://tvm-api.yandex.net\n" + << "7: Got responses with service tickets with 1 pages for 2 destination(s)\n" + << "3: Failed to get service ticket for dst=20: Missing tvm_id in response, should never happend: 20\n" + << "6: Cache was updated with 1 service ticket(s): XXXXXXXXXXX\n", + std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); + } + + Y_UNIT_TEST(PrepareRequestForServiceTickets) { + const TServiceContext ctx = TServiceContext::SigningFactory("AAAAAAAAAAAAAAAAAAAAAA"); + + TString s = TNotInitedUpdater::PrepareRequestForServiceTickets(117, + ctx, + {19, 20}, + NUtils::TProcInfo{ + "__some_pid__", + "__some_pname__", + "kar", + }, + 100700); + SubstGlobal(s.resize(s.size() - 5), "deb_", ""); + UNIT_ASSERT_VALUES_EQUAL("grant_type=client_credentials&src=117&dst=19,20&ts=100700&sign=XTz2Obd6PII_BHxswzWPJTjju9SrKsN6hyu1VsyxBvU&get_retry_settings=yes&_pid=__some_pid__&_procces_name=__some_pname__&lib_version=client_kar", + s); + + s = TNotInitedUpdater::PrepareRequestForServiceTickets(118, + ctx, + {19}, + NUtils::TProcInfo{ + "__some_pid__", + {}, + "kva_", + }, + 100900); + SubstGlobal(s.resize(s.size() - 5), "deb_", ""); + UNIT_ASSERT_VALUES_EQUAL("grant_type=client_credentials&src=118&dst=19&ts=100900&sign=-trBo9AtBLjp2ihy6cFAdMAQ6S9afHj23rFzYQ32jkQ&get_retry_settings=yes&_pid=__some_pid__&lib_version=client_kva_", + s); + } + + Y_UNIT_TEST(ParseTicketsFromResponse) { + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketChecking(); + + auto l = MakeIntrusive<TLogger>(); + TNotInitedUpdater u(s, l); + + TNotInitedUpdater::TPairTicketsErrors t; + UNIT_ASSERT_EXCEPTION_CONTAINS(u.ParseTicketsFromResponse("{", NTvmApi::TDstSet{19}, t), + yexception, + "Invalid json from tvm-api"); + + t = {}; + u.ParseTicketsFromResponse(TVM_RESPONSE, NTvmApi::TDstSet{19}, t); + + TNotInitedUpdater::TPairTicketsErrors expected{{{19, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}}, {}}; UNIT_ASSERT_VALUES_EQUAL("6: Disk cache disabled. Please set disk cache directory in settings for best reliability\n", - l->Stream.Str()); - UNIT_ASSERT_EQUAL(expected, t); - - t = {}; - u.ParseTicketsFromResponse(TVM_RESPONSE, - NTvmApi::TDstSet{19, 213, 234, 235}, - t); - expected = {{{19, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, - {213, "service_ticket_2"}}, - {{234, "Dst is not found"}, - {235, "Missing tvm_id in response, should never happend: 235"}}}; - UNIT_ASSERT_EQUAL(expected, t); + l->Stream.Str()); + UNIT_ASSERT_EQUAL(expected, t); + + t = {}; + u.ParseTicketsFromResponse(TVM_RESPONSE, + NTvmApi::TDstSet{19, 213, 234, 235}, + t); + expected = {{{19, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, + {213, "service_ticket_2"}}, + {{234, "Dst is not found"}, + {235, "Missing tvm_id in response, should never happend: 235"}}}; + UNIT_ASSERT_EQUAL(expected, t); UNIT_ASSERT_VALUES_EQUAL("6: Disk cache disabled. Please set disk cache directory in settings for best reliability\n", - l->Stream.Str()); - - t = {}; - u.ParseTicketsFromResponse( - R"([ - {"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"},"234" : { "error" : "Dst is not found" }}, - {"213" : { "ticket" : "service_ticket_2"},"185" : { "ticket" : "service_ticket_3"}}, - {"deprecated" : { "ticket" : "deprecated_ticket" }} - ])", - NTvmApi::TDstSet{19, 213, 234, 235}, - t); - expected = {{{19, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, - {213, "service_ticket_2"}}, - {{234, "Dst is not found"}, - {235, "Missing tvm_id in response, should never happend: 235"}}}; - UNIT_ASSERT_EQUAL(expected, t); + l->Stream.Str()); + + t = {}; + u.ParseTicketsFromResponse( + R"([ + {"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"},"234" : { "error" : "Dst is not found" }}, + {"213" : { "ticket" : "service_ticket_2"},"185" : { "ticket" : "service_ticket_3"}}, + {"deprecated" : { "ticket" : "deprecated_ticket" }} + ])", + NTvmApi::TDstSet{19, 213, 234, 235}, + t); + expected = {{{19, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, + {213, "service_ticket_2"}}, + {{234, "Dst is not found"}, + {235, "Missing tvm_id in response, should never happend: 235"}}}; + UNIT_ASSERT_EQUAL(expected, t); UNIT_ASSERT_VALUES_EQUAL("6: Disk cache disabled. Please set disk cache directory in settings for best reliability\n", - l->Stream.Str()); - } - - Y_UNIT_TEST(ParseTicketsFromResponseAsArray) { - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketChecking(); - - auto l = MakeIntrusive<TLogger>(); - TNotInitedUpdater u(s, l); - - TNotInitedUpdater::TPairTicketsErrors t; - UNIT_ASSERT_EXCEPTION_CONTAINS(u.ParseTicketsFromResponse("[", NTvmApi::TDstSet{19}, t), - yexception, - "Invalid json from tvm-api"); - - u.ParseTicketsFromResponse(R"([])", NTvmApi::TDstSet{19}, t); + l->Stream.Str()); + } + + Y_UNIT_TEST(ParseTicketsFromResponseAsArray) { + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketChecking(); + + auto l = MakeIntrusive<TLogger>(); + TNotInitedUpdater u(s, l); + + TNotInitedUpdater::TPairTicketsErrors t; + UNIT_ASSERT_EXCEPTION_CONTAINS(u.ParseTicketsFromResponse("[", NTvmApi::TDstSet{19}, t), + yexception, + "Invalid json from tvm-api"); + + u.ParseTicketsFromResponse(R"([])", NTvmApi::TDstSet{19}, t); UNIT_ASSERT_VALUES_EQUAL("6: Disk cache disabled. Please set disk cache directory in settings for best reliability\n", - l->Stream.Str()); - TNotInitedUpdater::TPairTicketsErrors expected = { - {}, {{19, "Missing tvm_id in response, should never happend: 19"}}}; - UNIT_ASSERT_VALUES_EQUAL(expected, t); - l->Stream.Clear(); - - t = {}; - u.ParseTicketsFromResponse( - R"([{},{"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}}, {"213" : { "ticket" : "service_ticket_2"}}])", - NTvmApi::TDstSet{19}, - t); - UNIT_ASSERT_VALUES_EQUAL("", l->Stream.Str()); - expected = {{{19, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}}, {}}; - UNIT_ASSERT_EQUAL(expected, t); - - t = {}; - u.ParseTicketsFromResponse( - R"([{ - "19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"} - }, - { - "213" : { "ticket" : "service_ticket_2"}, - "234" : { "error" : "Dst is not found" } - }, - { - "185" : { "ticket" : "service_ticket_3"}, - "deprecated" : { "ticket" : "deprecated_ticket" } - } - ])", - NTvmApi::TDstSet{19, 213, 234, 235}, - t); - expected = {{{19, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, - {213, "service_ticket_2"}}, - {{234, "Dst is not found"}, - {235, "Missing tvm_id in response, should never happend: 235"}}}; - UNIT_ASSERT_EQUAL(expected, t); - UNIT_ASSERT_VALUES_EQUAL("", l->Stream.Str()); - } - - class TReplier: public TRequestReplier { - public: - HttpCodes Code = HTTP_OK; - - bool DoReply(const TReplyParams& params) override { - TParsedHttpFull fl(params.Input.FirstLine()); - - THttpResponse resp(Code); - if (fl.Path == "/2/keys") { - resp.SetContent(NUnittest::TVMKNIFE_PUBLIC_KEYS); - } else if (fl.Path == "/2/ticket") { - resp.SetContent(TVM_RESPONSE); - } else { - UNIT_ASSERT(false); - } - resp.OutTo(params.Output); - - return true; - } - }; - - class TOnlineUpdater: public NTvmApi::TThreadedUpdater { - public: - TOnlineUpdater(const NTvmApi::TClientSettings& settings, TIntrusivePtr<TLogger> l) - : NTvmApi::TThreadedUpdater(settings, l) - { - Init(); - ExpBackoff_.SetEnabled(false); - StartWorker(); - } - }; - - Y_UNIT_TEST(MocServerOk) { - TPortManager pm; - ui16 tvmPort = pm.GetPort(80); - NMock::TMockServer server(tvmPort, []() { return new TReplier; }); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); - s.EnableServiceTicketChecking(); - s.EnableUserTicketChecking(EBlackboxEnv::Test); - s.SetTvmHostPort("http://localhost", tvmPort); - - auto l = MakeIntrusive<TLogger>(); - { - TOnlineUpdater u(s, l); - UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Ok, u.GetStatus(), l->Stream.Str()); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() + l->Stream.Str()); + TNotInitedUpdater::TPairTicketsErrors expected = { + {}, {{19, "Missing tvm_id in response, should never happend: 19"}}}; + UNIT_ASSERT_VALUES_EQUAL(expected, t); + l->Stream.Clear(); + + t = {}; + u.ParseTicketsFromResponse( + R"([{},{"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}}, {"213" : { "ticket" : "service_ticket_2"}}])", + NTvmApi::TDstSet{19}, + t); + UNIT_ASSERT_VALUES_EQUAL("", l->Stream.Str()); + expected = {{{19, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}}, {}}; + UNIT_ASSERT_EQUAL(expected, t); + + t = {}; + u.ParseTicketsFromResponse( + R"([{ + "19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"} + }, + { + "213" : { "ticket" : "service_ticket_2"}, + "234" : { "error" : "Dst is not found" } + }, + { + "185" : { "ticket" : "service_ticket_3"}, + "deprecated" : { "ticket" : "deprecated_ticket" } + } + ])", + NTvmApi::TDstSet{19, 213, 234, 235}, + t); + expected = {{{19, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, + {213, "service_ticket_2"}}, + {{234, "Dst is not found"}, + {235, "Missing tvm_id in response, should never happend: 235"}}}; + UNIT_ASSERT_EQUAL(expected, t); + UNIT_ASSERT_VALUES_EQUAL("", l->Stream.Str()); + } + + class TReplier: public TRequestReplier { + public: + HttpCodes Code = HTTP_OK; + + bool DoReply(const TReplyParams& params) override { + TParsedHttpFull fl(params.Input.FirstLine()); + + THttpResponse resp(Code); + if (fl.Path == "/2/keys") { + resp.SetContent(NUnittest::TVMKNIFE_PUBLIC_KEYS); + } else if (fl.Path == "/2/ticket") { + resp.SetContent(TVM_RESPONSE); + } else { + UNIT_ASSERT(false); + } + resp.OutTo(params.Output); + + return true; + } + }; + + class TOnlineUpdater: public NTvmApi::TThreadedUpdater { + public: + TOnlineUpdater(const NTvmApi::TClientSettings& settings, TIntrusivePtr<TLogger> l) + : NTvmApi::TThreadedUpdater(settings, l) + { + Init(); + ExpBackoff_.SetEnabled(false); + StartWorker(); + } + }; + + Y_UNIT_TEST(MocServerOk) { + TPortManager pm; + ui16 tvmPort = pm.GetPort(80); + NMock::TMockServer server(tvmPort, []() { return new TReplier; }); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); + s.EnableServiceTicketChecking(); + s.EnableUserTicketChecking(EBlackboxEnv::Test); + s.SetTvmHostPort("http://localhost", tvmPort); + + auto l = MakeIntrusive<TLogger>(); + { + TOnlineUpdater u(s, l); + UNIT_ASSERT_VALUES_EQUAL_C(TClientStatus::Ok, u.GetStatus(), l->Stream.Str()); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() << "6: Disk cache disabled. Please set disk cache directory in settings for best reliability\n" - << "7: Response with service tickets for 1 destination(s) was successfully fetched from http://localhost\n" - << "7: Got responses with service tickets with 1 pages for 1 destination(s)\n" - << "6: Cache was updated with 1 service ticket(s): XXXXXXXXXXX\n" - << "7: Public keys were successfully fetched from http://localhost\n" - << "6: Cache was updated with public keys: XXXXXXXXXXX\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); - } - - Y_UNIT_TEST(MocServerBad) { - TPortManager pm; - ui16 tvmPort = pm.GetPort(80); - NMock::TMockServer server(tvmPort, - []() { - auto p = new TReplier; - p->Code = HTTP_BAD_REQUEST; - return p; - }); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); - s.EnableServiceTicketChecking(); - s.EnableUserTicketChecking(EBlackboxEnv::Test); - s.SetTvmHostPort("localhost", tvmPort); - - auto l = MakeIntrusive<TLogger>(); - UNIT_ASSERT_EXCEPTION_CONTAINS_C(TOnlineUpdater(s, l), - TNonRetriableException, - "Failed to start TvmClient. Do not retry: ServiceTickets: Path:/2/ticket.Code=400:", - l->Stream.Str()); - } - - Y_UNIT_TEST(MocServerPaginated) { - class TReplier: public TRequestReplier { - public: - TString Response; - TReplier(TString response) - : Response(response) - { - } - - bool DoReply(const TReplyParams& params) override { - TParsedHttpFull fl(params.Input.FirstLine()); - if (fl.Path != "/2/ticket") { - UNIT_ASSERT_C(false, fl.Path); - } - - THttpResponse resp(HTTP_OK); - resp.SetContent(Response); - resp.OutTo(params.Output); - return true; - } - }; - - TPortManager pm; - ui16 tvmPort = pm.GetPort(80); - TVector<TString> responses = { - R"({"15" : { "ticket" : "service_ticket_3" },"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})", - R"({"222" : { "ticket" : "service_ticket_2"}, "239" : { "error" : "Dst is not found" }})", - R"({"185" : { "ticket" : "service_ticket_3"}})", - }; - NMock::TMockServer server(tvmPort, [&responses]() { - if (responses.empty()) { - return new TReplier("<NULL>"); - } - TString r = responses.front(); - responses.erase(responses.begin()); - return new TReplier(r); - }); - - NTvmApi::TClientSettings s; - s.SetSelfTvmId(100500); - s.EnableServiceTicketsFetchOptions("qwerty", NTvmApi::TClientSettings::TDstVector{19, 222, 239, 100500, 15}); - s.SetTvmHostPort("http://localhost", tvmPort); - - auto l = MakeIntrusive<TLogger>(); - { - TNotInitedUpdater u(s, l); - TNotInitedUpdater::THttpResult result = u.GetServiceTicketsFromHttp(NTvmApi::TDstSet{19, 222, 239, 100500, 15}, 2); - UNIT_ASSERT_VALUES_EQUAL(TSmallVec<TString>({ - R"({"15" : { "ticket" : "service_ticket_3" },"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})", - R"({"222" : { "ticket" : "service_ticket_2"}, "239" : { "error" : "Dst is not found" }})", - R"({"185" : { "ticket" : "service_ticket_3"}})", - }), - result.Responses); - TNotInitedUpdater::TPairTicketsErrors expected{ - { - {19, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, - {222, "service_ticket_2"}, - {15, "service_ticket_3"}, - }, - { - {239, "Dst is not found"}, - {100500, "Missing tvm_id in response, should never happend: 100500"}, - }, - }; - UNIT_ASSERT_VALUES_EQUAL(expected, result.TicketsWithErrors); - } - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() + << "7: Response with service tickets for 1 destination(s) was successfully fetched from http://localhost\n" + << "7: Got responses with service tickets with 1 pages for 1 destination(s)\n" + << "6: Cache was updated with 1 service ticket(s): XXXXXXXXXXX\n" + << "7: Public keys were successfully fetched from http://localhost\n" + << "6: Cache was updated with public keys: XXXXXXXXXXX\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + std::regex_replace(std::string(l->Stream.Str()), TIME_REGEX, "XXXXXXXXXXX")); + } + + Y_UNIT_TEST(MocServerBad) { + TPortManager pm; + ui16 tvmPort = pm.GetPort(80); + NMock::TMockServer server(tvmPort, + []() { + auto p = new TReplier; + p->Code = HTTP_BAD_REQUEST; + return p; + }); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", {{"blackbox", 19}}); + s.EnableServiceTicketChecking(); + s.EnableUserTicketChecking(EBlackboxEnv::Test); + s.SetTvmHostPort("localhost", tvmPort); + + auto l = MakeIntrusive<TLogger>(); + UNIT_ASSERT_EXCEPTION_CONTAINS_C(TOnlineUpdater(s, l), + TNonRetriableException, + "Failed to start TvmClient. Do not retry: ServiceTickets: Path:/2/ticket.Code=400:", + l->Stream.Str()); + } + + Y_UNIT_TEST(MocServerPaginated) { + class TReplier: public TRequestReplier { + public: + TString Response; + TReplier(TString response) + : Response(response) + { + } + + bool DoReply(const TReplyParams& params) override { + TParsedHttpFull fl(params.Input.FirstLine()); + if (fl.Path != "/2/ticket") { + UNIT_ASSERT_C(false, fl.Path); + } + + THttpResponse resp(HTTP_OK); + resp.SetContent(Response); + resp.OutTo(params.Output); + return true; + } + }; + + TPortManager pm; + ui16 tvmPort = pm.GetPort(80); + TVector<TString> responses = { + R"({"15" : { "ticket" : "service_ticket_3" },"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})", + R"({"222" : { "ticket" : "service_ticket_2"}, "239" : { "error" : "Dst is not found" }})", + R"({"185" : { "ticket" : "service_ticket_3"}})", + }; + NMock::TMockServer server(tvmPort, [&responses]() { + if (responses.empty()) { + return new TReplier("<NULL>"); + } + TString r = responses.front(); + responses.erase(responses.begin()); + return new TReplier(r); + }); + + NTvmApi::TClientSettings s; + s.SetSelfTvmId(100500); + s.EnableServiceTicketsFetchOptions("qwerty", NTvmApi::TClientSettings::TDstVector{19, 222, 239, 100500, 15}); + s.SetTvmHostPort("http://localhost", tvmPort); + + auto l = MakeIntrusive<TLogger>(); + { + TNotInitedUpdater u(s, l); + TNotInitedUpdater::THttpResult result = u.GetServiceTicketsFromHttp(NTvmApi::TDstSet{19, 222, 239, 100500, 15}, 2); + UNIT_ASSERT_VALUES_EQUAL(TSmallVec<TString>({ + R"({"15" : { "ticket" : "service_ticket_3" },"19" : { "ticket" : "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}})", + R"({"222" : { "ticket" : "service_ticket_2"}, "239" : { "error" : "Dst is not found" }})", + R"({"185" : { "ticket" : "service_ticket_3"}})", + }), + result.Responses); + TNotInitedUpdater::TPairTicketsErrors expected{ + { + {19, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, + {222, "service_ticket_2"}, + {15, "service_ticket_3"}, + }, + { + {239, "Dst is not found"}, + {100500, "Missing tvm_id in response, should never happend: 100500"}, + }, + }; + UNIT_ASSERT_VALUES_EQUAL(expected, result.TicketsWithErrors); + } + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() << "6: Disk cache disabled. Please set disk cache directory in settings for best reliability\n" - << "7: Response with service tickets for 2 destination(s) was successfully fetched from http://localhost\n" - << "7: Response with service tickets for 2 destination(s) was successfully fetched from http://localhost\n" - << "7: Response with service tickets for 1 destination(s) was successfully fetched from http://localhost\n" - << "7: Got responses with service tickets with 3 pages for 5 destination(s)\n" - << "3: Failed to get service ticket for dst=100500: Missing tvm_id in response, should never happend: 100500\n" - << "3: Failed to get service ticket for dst=239: Dst is not found\n", - l->Stream.Str()); - } - - Y_UNIT_TEST(FindMissingDsts) { - UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector({6, 9}), - TNotInitedUpdater::FindMissingDsts({1, 2, 3, 4}, {1, 4, 6, 9})); - UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector(), - TNotInitedUpdater::FindMissingDsts({1, 2, 3, 4, 5, 6, 7, 8, 9}, {1, 4, 6, 9})); - UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector({1, 4, 6, 9}), - TNotInitedUpdater::FindMissingDsts(NTvmApi::TDstSet(), {1, 4, 6, 9})); - UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector(1, 19), - TNotInitedUpdater::FindMissingDsts({213}, {19, 213})); - - auto make = [](TVector<int> ids) { - TServiceTickets::TMapIdStr m; - for (auto i : ids) { - m.insert({i, ""}); - } - return MakeIntrusiveConst<TServiceTickets>(std::move(m), TServiceTickets::TMapIdStr{}, TServiceTickets::TMapAliasId{}); - }; - - UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector({6, 9}), - TNotInitedUpdater::FindMissingDsts(make({1, 2, 3, 4}), {1, 4, 6, 9})); - UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector(), - TNotInitedUpdater::FindMissingDsts(make({1, 2, 3, 4, 5, 6, 7, 8, 9}), {1, 4, 6, 9})); - UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector({1, 4, 6, 9}), - TNotInitedUpdater::FindMissingDsts(make({}), {1, 4, 6, 9})); - UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector(1, 19), - TNotInitedUpdater::FindMissingDsts(make({213}), {19, 213})); - } - - Y_UNIT_TEST(CreateJsonArray) { - UNIT_ASSERT_VALUES_EQUAL("[]", TNotInitedUpdater::CreateJsonArray({})); - UNIT_ASSERT_VALUES_EQUAL("[sdlzkjvbsdljhfbsdajlhfbsakjdfb]", - TNotInitedUpdater::CreateJsonArray({"sdlzkjvbsdljhfbsdajlhfbsakjdfb"})); - UNIT_ASSERT_VALUES_EQUAL("[sdlzkjvbsdljhfbsdajlhfbsakjdfb,o92q83yh2uhq2eri23r]", - TNotInitedUpdater::CreateJsonArray({"sdlzkjvbsdljhfbsdajlhfbsakjdfb", - "o92q83yh2uhq2eri23r"})); - } - - Y_UNIT_TEST(AppendArrayToJson) { - UNIT_ASSERT_EXCEPTION_CONTAINS(TNotInitedUpdater::AppendToJsonArray("", {}), - yexception, - "previous body required"); - UNIT_ASSERT_EXCEPTION_CONTAINS(TNotInitedUpdater::AppendToJsonArray("[kek", {}), - yexception, - "array is broken:"); - - UNIT_ASSERT_VALUES_EQUAL("[kek]", TNotInitedUpdater::AppendToJsonArray("kek", {})); - - UNIT_ASSERT_VALUES_EQUAL( - "[kek,sdlzkjvbsdljhfbsdajlhfbsakjdfb]", - TNotInitedUpdater::AppendToJsonArray("kek", - {"sdlzkjvbsdljhfbsdajlhfbsakjdfb"})); - UNIT_ASSERT_VALUES_EQUAL( - "[kek,sdlzkjvbsdljhfbsdajlhfbsakjdfb,o92q83yh2uhq2eri23r]", - TNotInitedUpdater::AppendToJsonArray("kek", - {"sdlzkjvbsdljhfbsdajlhfbsakjdfb", "o92q83yh2uhq2eri23r"})); - - UNIT_ASSERT_VALUES_EQUAL( - "[kek,sdlzkjvbsdljhfbsdajlhfbsakjdfb]", - TNotInitedUpdater::AppendToJsonArray("[kek]", - {"sdlzkjvbsdljhfbsdajlhfbsakjdfb"})); - UNIT_ASSERT_VALUES_EQUAL( - "[kek,sdlzkjvbsdljhfbsdajlhfbsakjdfb,o92q83yh2uhq2eri23r]", - TNotInitedUpdater::AppendToJsonArray("[kek]", - {"sdlzkjvbsdljhfbsdajlhfbsakjdfb", "o92q83yh2uhq2eri23r"})); - } + << "7: Response with service tickets for 2 destination(s) was successfully fetched from http://localhost\n" + << "7: Response with service tickets for 2 destination(s) was successfully fetched from http://localhost\n" + << "7: Response with service tickets for 1 destination(s) was successfully fetched from http://localhost\n" + << "7: Got responses with service tickets with 3 pages for 5 destination(s)\n" + << "3: Failed to get service ticket for dst=100500: Missing tvm_id in response, should never happend: 100500\n" + << "3: Failed to get service ticket for dst=239: Dst is not found\n", + l->Stream.Str()); + } + + Y_UNIT_TEST(FindMissingDsts) { + UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector({6, 9}), + TNotInitedUpdater::FindMissingDsts({1, 2, 3, 4}, {1, 4, 6, 9})); + UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector(), + TNotInitedUpdater::FindMissingDsts({1, 2, 3, 4, 5, 6, 7, 8, 9}, {1, 4, 6, 9})); + UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector({1, 4, 6, 9}), + TNotInitedUpdater::FindMissingDsts(NTvmApi::TDstSet(), {1, 4, 6, 9})); + UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector(1, 19), + TNotInitedUpdater::FindMissingDsts({213}, {19, 213})); + + auto make = [](TVector<int> ids) { + TServiceTickets::TMapIdStr m; + for (auto i : ids) { + m.insert({i, ""}); + } + return MakeIntrusiveConst<TServiceTickets>(std::move(m), TServiceTickets::TMapIdStr{}, TServiceTickets::TMapAliasId{}); + }; + + UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector({6, 9}), + TNotInitedUpdater::FindMissingDsts(make({1, 2, 3, 4}), {1, 4, 6, 9})); + UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector(), + TNotInitedUpdater::FindMissingDsts(make({1, 2, 3, 4, 5, 6, 7, 8, 9}), {1, 4, 6, 9})); + UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector({1, 4, 6, 9}), + TNotInitedUpdater::FindMissingDsts(make({}), {1, 4, 6, 9})); + UNIT_ASSERT_VALUES_EQUAL(NTvmApi::TClientSettings::TDstVector(1, 19), + TNotInitedUpdater::FindMissingDsts(make({213}), {19, 213})); + } + + Y_UNIT_TEST(CreateJsonArray) { + UNIT_ASSERT_VALUES_EQUAL("[]", TNotInitedUpdater::CreateJsonArray({})); + UNIT_ASSERT_VALUES_EQUAL("[sdlzkjvbsdljhfbsdajlhfbsakjdfb]", + TNotInitedUpdater::CreateJsonArray({"sdlzkjvbsdljhfbsdajlhfbsakjdfb"})); + UNIT_ASSERT_VALUES_EQUAL("[sdlzkjvbsdljhfbsdajlhfbsakjdfb,o92q83yh2uhq2eri23r]", + TNotInitedUpdater::CreateJsonArray({"sdlzkjvbsdljhfbsdajlhfbsakjdfb", + "o92q83yh2uhq2eri23r"})); + } + + Y_UNIT_TEST(AppendArrayToJson) { + UNIT_ASSERT_EXCEPTION_CONTAINS(TNotInitedUpdater::AppendToJsonArray("", {}), + yexception, + "previous body required"); + UNIT_ASSERT_EXCEPTION_CONTAINS(TNotInitedUpdater::AppendToJsonArray("[kek", {}), + yexception, + "array is broken:"); + + UNIT_ASSERT_VALUES_EQUAL("[kek]", TNotInitedUpdater::AppendToJsonArray("kek", {})); + + UNIT_ASSERT_VALUES_EQUAL( + "[kek,sdlzkjvbsdljhfbsdajlhfbsakjdfb]", + TNotInitedUpdater::AppendToJsonArray("kek", + {"sdlzkjvbsdljhfbsdajlhfbsakjdfb"})); + UNIT_ASSERT_VALUES_EQUAL( + "[kek,sdlzkjvbsdljhfbsdajlhfbsakjdfb,o92q83yh2uhq2eri23r]", + TNotInitedUpdater::AppendToJsonArray("kek", + {"sdlzkjvbsdljhfbsdajlhfbsakjdfb", "o92q83yh2uhq2eri23r"})); + + UNIT_ASSERT_VALUES_EQUAL( + "[kek,sdlzkjvbsdljhfbsdajlhfbsakjdfb]", + TNotInitedUpdater::AppendToJsonArray("[kek]", + {"sdlzkjvbsdljhfbsdajlhfbsakjdfb"})); + UNIT_ASSERT_VALUES_EQUAL( + "[kek,sdlzkjvbsdljhfbsdajlhfbsakjdfb,o92q83yh2uhq2eri23r]", + TNotInitedUpdater::AppendToJsonArray("[kek]", + {"sdlzkjvbsdljhfbsdajlhfbsakjdfb", "o92q83yh2uhq2eri23r"})); + } Y_UNIT_TEST(UpdaterTimeouts) { NTvmApi::TClientSettings s; s.SetSelfTvmId(100500); s.EnableServiceTicketChecking(); - s.TvmHost = "localhost"; - s.TvmPort = GetRandomPort(); + s.TvmHost = "localhost"; + s.TvmPort = GetRandomPort(); const auto timeout = TDuration::MilliSeconds(10); - s.TvmConnectTimeout = timeout; - s.TvmSocketTimeout = timeout; + s.TvmConnectTimeout = timeout; + s.TvmSocketTimeout = timeout; { auto l = MakeIntrusive<TLogger>(); @@ -1240,33 +1240,33 @@ Y_UNIT_TEST_SUITE(ApiUpdater) { UNIT_ASSERT_LT(::Now() - startTs, timeout * 2); } } -} - -template <> -void Out<TSmallVec<TString>>(IOutputStream& out, const TSmallVec<TString>& m) { - for (const TString& s : m) { - out << s << ";"; - } -} - -template <> -void Out<TServiceTickets::TMapIdStr>( - IOutputStream& out, - const TServiceTickets::TMapIdStr& m) { - for (const auto& pair : m) { - out << pair.first << " -> " << pair.second << ";"; - } -} - -template <> -void Out<NTestSuiteApiUpdater::TNotInitedUpdater::TPairTicketsErrors>( - IOutputStream& out, - const NTestSuiteApiUpdater::TNotInitedUpdater::TPairTicketsErrors& m) { - out << m.Tickets << "\n"; - out << m.Errors << "\n"; -} - -template <> -void Out<NTvmAuth::NTvmApi::TClientSettings::TDst>(IOutputStream& out, const NTvmAuth::NTvmApi::TClientSettings::TDst& m) { - out << m.Id; -} +} + +template <> +void Out<TSmallVec<TString>>(IOutputStream& out, const TSmallVec<TString>& m) { + for (const TString& s : m) { + out << s << ";"; + } +} + +template <> +void Out<TServiceTickets::TMapIdStr>( + IOutputStream& out, + const TServiceTickets::TMapIdStr& m) { + for (const auto& pair : m) { + out << pair.first << " -> " << pair.second << ";"; + } +} + +template <> +void Out<NTestSuiteApiUpdater::TNotInitedUpdater::TPairTicketsErrors>( + IOutputStream& out, + const NTestSuiteApiUpdater::TNotInitedUpdater::TPairTicketsErrors& m) { + out << m.Tickets << "\n"; + out << m.Errors << "\n"; +} + +template <> +void Out<NTvmAuth::NTvmApi::TClientSettings::TDst>(IOutputStream& out, const NTvmAuth::NTvmApi::TClientSettings::TDst& m) { + out << m.Id; +} diff --git a/library/cpp/tvmauth/client/ut/tvmtool_updater_ut.cpp b/library/cpp/tvmauth/client/ut/tvmtool_updater_ut.cpp index 1295ed750e..89d4f924e9 100644 --- a/library/cpp/tvmauth/client/ut/tvmtool_updater_ut.cpp +++ b/library/cpp/tvmauth/client/ut/tvmtool_updater_ut.cpp @@ -1,744 +1,744 @@ -#include "common.h" - -#include <library/cpp/tvmauth/client/facade.h> -#include <library/cpp/tvmauth/client/misc/tool/threaded_updater.h> - -#include <library/cpp/http/simple/http_client.h> +#include "common.h" + +#include <library/cpp/tvmauth/client/facade.h> +#include <library/cpp/tvmauth/client/misc/tool/threaded_updater.h> + +#include <library/cpp/http/simple/http_client.h> #include <library/cpp/testing/unittest/registar.h> - -#include <util/system/env.h> - -using namespace NTvmAuth; -using namespace NTvmAuth::NTvmTool; - -Y_UNIT_TEST_SUITE(ToolUpdater) { - static const TString SRV_TICKET = "3:serv:CBAQ__________9_IgYIexCUkQY:GioCM49Ob6_f80y6FY0XBVN4hLXuMlFeyMvIMiDuQnZkbkLpRpQOuQo5YjWoBjM0Vf-XqOm8B7xtrvxSYHDD7Q4OatN2l-Iwg7i71lE3scUeD36x47st3nd0OThvtjrFx_D8mw_c0GT5KcniZlqq1SjhLyAk1b_zJsx8viRAhCU"; - static const TString SRV_TICKET_DST_100503 = "3:serv:CBAQ__________9_IggIwMQHEJeRBg:Kj7VApP6D91UJ8pKpeaE3vYaNTBBJcdYpJLbF9w2-Mb-75s_SmMKkPqqA2rMS358uFfoYpv9YZxq0tIaUj5HPQ1WaQ1yiVuPZ_oi3pJRdr006eRyihM8PUfl6m9ioCFftfOcAg9oN5BGeHTNhn7VWuj3yMg7feaMB0zAUpyaPG0"; - static const TString TEST_TICKET = "3:user:CA0Q__________9_Gg4KAgh7EHsg0oXYzAQoAQ:FSADps3wNGm92Vyb1E9IVq5M6ZygdGdt1vafWWEhfDDeCLoVA-sJesxMl2pGW4OxJ8J1r_MfpG3ZoBk8rLVMHUFrPa6HheTbeXFAWl8quEniauXvKQe4VyrpA1SPgtRoFqi5upSDIJzEAe1YRJjq1EClQ_slMt8R0kA_JjKUX54"; - static const TString PROD_YATEAM_TICKET = "3:user:CAwQ__________9_Gg4KAgh7EHsg0oXYzAQoAg:G2wloFRSi8--RLb2GDSro_sKXPF2JSdL5CVOuOHgUcRvLm-3OxIPn0NUqbJ9DWDmhPplOqEiblIbLK85My1VMJ2aG5SLbRNKEtwfmxLvkwNpl_gUEwWPJm9_8Khslfj71P3hccxtEEqM9bJSMwHueVAY-a9HSzFo-uMFMeSgQ-k"; - - class TMetaInfoProxy: public TMetaInfo { - public: - using TMetaInfo::ApplySettings; - using TMetaInfo::BbEnvFromString; - using TMetaInfo::Config_; - using TMetaInfo::Fetch; - using TMetaInfo::ParseMetaString; - using TMetaInfo::TMetaInfo; - }; - - Y_UNIT_TEST(Settings) { - NTvmTool::TClientSettings s("foo"); - UNIT_ASSERT_EXCEPTION_CONTAINS(s.SetAuthToken("\n "), - TBrokenTvmClientSettings, - "Auth token cannot be empty"); - UNIT_ASSERT_EXCEPTION_CONTAINS(s.GetAuthToken(), - TBrokenTvmClientSettings, - "Auth token cannot be empty. Env 'TVMTOOL_LOCAL_AUTHTOKEN' and 'QLOUD_TVM_TOKEN' are empty."); - - UNIT_ASSERT_NO_EXCEPTION(s.SetAuthToken(AUTH_TOKEN + "\n")); - UNIT_ASSERT_VALUES_EQUAL(AUTH_TOKEN, s.GetAuthToken()); - - UNIT_ASSERT_VALUES_EQUAL("localhost", s.GetHostname()); - UNIT_ASSERT_EXCEPTION_CONTAINS(s.SetHostname(""), - TBrokenTvmClientSettings, - "Hostname cannot be empty"); - - UNIT_ASSERT_NO_EXCEPTION(s.SetHostname("qwe")); - UNIT_ASSERT_VALUES_EQUAL("qwe", s.GetHostname()); - } - - Y_UNIT_TEST(SettingsCtor) { - UNIT_ASSERT_EXCEPTION_CONTAINS(NTvmTool::TClientSettings(""), - TBrokenTvmClientSettings, - "Alias for your TVM client cannot be empty"); - { - NTvmTool::TClientSettings s("self"); - UNIT_ASSERT_EXCEPTION_CONTAINS(s.GetAuthToken(), - TBrokenTvmClientSettings, - "Auth token cannot be empty. " - "Env 'TVMTOOL_LOCAL_AUTHTOKEN' and 'QLOUD_TVM_TOKEN' are empty."); - } - - struct TEnvs { - TEnvs(const std::map<TString, TString>& Env) { - for (const auto& [key, value] : Env) { - Prev[key] = GetEnv(key); - SetEnv(key, value); - } - } - - ~TEnvs() { - for (const auto& [key, value] : Prev) { - SetEnv(key, value); - } - } - - std::map<TString, TString> Prev; - }; - - struct TCase { - std::map<TString, TString> Env; - TString AuthToken; - ui16 Port = 0; - }; - - std::vector<TCase> cases = { - { - { - {"TVMTOOL_LOCAL_AUTHTOKEN", "qwerty"}, - }, - "qwerty", - 1, - }, - { - { - {"TVMTOOL_LOCAL_AUTHTOKEN", "qwerty"}, - {"QLOUD_TVM_TOKEN", "zxcvbn"}, - }, - "qwerty", - 1, - }, - { - { - {"QLOUD_TVM_TOKEN", "zxcvbn"}, - }, - "zxcvbn", - 1, - }, - { - { - {"TVMTOOL_LOCAL_AUTHTOKEN", "qwerty"}, - {"DEPLOY_TVM_TOOL_URL", "32272"}, - }, - "qwerty", - 1, - }, - { - { - {"TVMTOOL_LOCAL_AUTHTOKEN", "qwerty"}, - {"DEPLOY_TVM_TOOL_URL", "localhost:32272"}, - }, - "qwerty", - 32272, - }, - { - { - {"TVMTOOL_LOCAL_AUTHTOKEN", "qwerty"}, - {"DEPLOY_TVM_TOOL_URL", "http://localhost:32272"}, - }, - "qwerty", - 32272, - }, - }; - - for (const TCase& c : cases) { - TEnvs envs(c.Env); - - NTvmTool::TClientSettings s("self"); - UNIT_ASSERT_VALUES_EQUAL(c.AuthToken, s.GetAuthToken()); - UNIT_ASSERT_VALUES_EQUAL(c.Port, s.GetPort()); - } - } - - Y_UNIT_TEST(Meta_Fetch) { - TPortManager pm; - ui16 port = pm.GetPort(80); - NMock::TMockServer server(port, []() { return new TTvmTool; }); - TKeepAliveHttpClient client("localhost", port); - - TMetaInfoProxy m(nullptr); - NTvmTool::TClientSettings settings("me"); - settings.SetAuthToken(AUTH_TOKEN); - m.ApplySettings(settings); - - UNIT_ASSERT_VALUES_EQUAL(META, m.Fetch(client)); - - settings.SetAuthToken("qwerty"); - m.ApplySettings(settings); - UNIT_ASSERT_EXCEPTION_CONTAINS(m.Fetch(client), - TNonRetriableException, - "Failed to fetch meta from tvmtool: localhost:"); - - settings.SetAuthToken(AUTH_TOKEN); - m.ApplySettings(settings); - { - TKeepAliveHttpClient client("localhost", 0); - UNIT_ASSERT_EXCEPTION_CONTAINS(m.Fetch(client), - TRetriableException, - "Failed to fetch meta data from tvmtool: "); - } - - server.SetGenerator([]() { - auto p = new TTvmTool; - p->Code = HTTP_NOT_FOUND; - return p; }); - UNIT_ASSERT_EXCEPTION_CONTAINS(m.Fetch(client), - TNonRetriableException, - "Library does not support so old tvmtool. You need tvmtool>=1.1.0"); - server.SetGenerator([]() { - auto p = new TTvmTool; - p->Code = HTTP_INTERNAL_SERVER_ERROR; - return p; }); - UNIT_ASSERT_EXCEPTION_CONTAINS(m.Fetch(client), - TRetriableException, - "Failed to fetch meta from tvmtool: localhost:"); - } - - Y_UNIT_TEST(Meta_ParseMetaString_me) { - TMetaInfo::TConfigPtr c; - UNIT_ASSERT(c = TMetaInfoProxy::ParseMetaString(META, "me")); - UNIT_ASSERT_VALUES_EQUAL(100500, c->SelfTvmId); - UNIT_ASSERT_EQUAL(EBlackboxEnv::ProdYateam, c->BbEnv); - UNIT_ASSERT_EQUAL(TMetaInfo::TDstAliases({{"bbox", 242}, {"pass_likers", 11}}), c->DstAliases); - } - - Y_UNIT_TEST(Meta_ParseMetaString_pc) { - TMetaInfo::TConfigPtr c; - UNIT_ASSERT(c = TMetaInfoProxy::ParseMetaString(META, "push-client")); - UNIT_ASSERT_VALUES_EQUAL(100501, c->SelfTvmId); - UNIT_ASSERT_EQUAL(EBlackboxEnv::ProdYateam, c->BbEnv); - UNIT_ASSERT_EQUAL(TMetaInfo::TDstAliases({{"pass_likers", 100502}}), c->DstAliases); - } - - Y_UNIT_TEST(Meta_ParseMetaString_se) { - TMetaInfo::TConfigPtr c; - UNIT_ASSERT(c = TMetaInfoProxy::ParseMetaString(META, "something_else")); - UNIT_ASSERT_VALUES_EQUAL(100503, c->SelfTvmId); - UNIT_ASSERT_EQUAL(EBlackboxEnv::ProdYateam, c->BbEnv); - UNIT_ASSERT(c->DstAliases.empty()); - } - - Y_UNIT_TEST(Meta_ParseMetaString_errors) { - TMetaInfoProxy m(nullptr); - UNIT_ASSERT(!m.ParseMetaString(META, "ololo")); - - TString meta = "}"; - UNIT_ASSERT_EXCEPTION_CONTAINS(m.ParseMetaString(meta, "qqq"), yexception, meta); - meta = "{}"; - UNIT_ASSERT_EXCEPTION_CONTAINS(m.ParseMetaString(meta, "qqq"), yexception, meta); - meta = R"({"tenants" : {}})"; - UNIT_ASSERT_EXCEPTION_CONTAINS(m.ParseMetaString(meta, "qqq"), yexception, meta); - meta = R"({"tenants" : [{"self":{}}]})"; - UNIT_ASSERT_EXCEPTION_CONTAINS(m.ParseMetaString(meta, "qqq"), yexception, meta); - } - - Y_UNIT_TEST(Meta_BbEnvFromString) { - UNIT_ASSERT_VALUES_EQUAL(EBlackboxEnv::Prod, TMetaInfoProxy::BbEnvFromString("Prod", META)); - UNIT_ASSERT_VALUES_EQUAL(EBlackboxEnv::Test, TMetaInfoProxy::BbEnvFromString("Test", META)); - UNIT_ASSERT_VALUES_EQUAL(EBlackboxEnv::ProdYateam, TMetaInfoProxy::BbEnvFromString("ProdYaTeam", META)); - UNIT_ASSERT_VALUES_EQUAL(EBlackboxEnv::TestYateam, TMetaInfoProxy::BbEnvFromString("TestYaTeam", META)); - UNIT_ASSERT_VALUES_EQUAL(EBlackboxEnv::Stress, TMetaInfoProxy::BbEnvFromString("Stress", META)); - UNIT_ASSERT_EXCEPTION_CONTAINS(TMetaInfoProxy::BbEnvFromString("foo", META), - yexception, - "'bb_env'=='foo'"); - } - - Y_UNIT_TEST(Meta_ApplySettings) { - NTvmTool::TClientSettings s("foo"); - s.SetAuthToken(AUTH_TOKEN); - - TMetaInfoProxy m(nullptr); - m.ApplySettings(s); - - UNIT_ASSERT_VALUES_EQUAL( - TKeepAliveHttpClient::THeaders({{"Authorization", AUTH_TOKEN}}), - m.GetAuthHeader()); - } - - Y_UNIT_TEST(Meta_Init) { - TPortManager pm; - ui16 port = pm.GetPort(80); - NMock::TMockServer server(port, []() { return new TTvmTool; }); - TKeepAliveHttpClient client("localhost", port); - - NTvmTool::TClientSettings s("me"); - s.SetAuthToken(AUTH_TOKEN); - s.SetPort(port); - auto l = MakeIntrusive<TLogger>(); - TMetaInfo m(l); - UNIT_ASSERT_NO_EXCEPTION(m.Init(client, s)); - UNIT_ASSERT_VALUES_EQUAL(100500, m.GetConfig()->SelfTvmId); - UNIT_ASSERT_EQUAL(EBlackboxEnv::ProdYateam, m.GetConfig()->BbEnv); - UNIT_ASSERT_EQUAL(TMetaInfo::TDstAliases({{"bbox", 242}, {"pass_likers", 11}}), m.GetConfig()->DstAliases); - UNIT_ASSERT_VALUES_EQUAL(TStringBuilder() - << "7: Meta info fetched from localhost:" << port << "\n" - << "6: Meta: self_tvm_id=100500, bb_env=ProdYateam, dsts=[(pass_likers:11)(bbox:242)]\n", - l->Stream.Str()); - l->Stream.Clear(); - UNIT_ASSERT_VALUES_EQUAL( - "/tvm/tickets?src=100500&dsts=11,242", - TMetaInfo::GetRequestForTickets(*m.GetConfig())); - - server.SetGenerator([]() { - auto p = new TTvmTool; - p->Meta = R"({ - "bb_env" : "Prod", - "tenants" : [{ - "self": {"alias" : "me", "client_id": 100500}, - "dsts" : [{"alias" : "pass_likers","client_id": 11}] - }] - })"; - return p; }); - UNIT_ASSERT(m.TryUpdateConfig(client)); - UNIT_ASSERT_VALUES_EQUAL( - "6: Meta was updated. Old: (self_tvm_id=100500, bb_env=ProdYateam, dsts=[(pass_likers:11)(bbox:242)]). New: (self_tvm_id=100500, bb_env=Prod, dsts=[(pass_likers:11)])\n", - l->Stream.Str()); - l->Stream.clear(); - - s = NTvmTool::TClientSettings("foo"); - s.SetAuthToken(AUTH_TOKEN); - s.SetPort(port); - TMetaInfo m2(l); - UNIT_ASSERT_EXCEPTION_CONTAINS(m2.Init(client, s), TNonRetriableException, "Alias 'foo' not found in meta info"); - UNIT_ASSERT_VALUES_EQUAL(TStringBuilder() - << "7: Meta info fetched from localhost:" << port << "\n", - l->Stream.Str()); - UNIT_ASSERT_EXCEPTION_CONTAINS(TMetaInfo::GetRequestForTickets({}), - yexception, - "DstAliases.empty()"); - - server.SetGenerator([]() { - auto p = new TTvmTool; - p->Meta = "}"; - return p; }); - UNIT_ASSERT_EXCEPTION_CONTAINS(m.Init(client, s), - TNonRetriableException, - "Malformed json from tvmtool:"); - } - - class TNonInitedUpdater: public TThreadedUpdater { - public: - TNonInitedUpdater(const TString& host, ui16 port, TLoggerPtr logger) + +#include <util/system/env.h> + +using namespace NTvmAuth; +using namespace NTvmAuth::NTvmTool; + +Y_UNIT_TEST_SUITE(ToolUpdater) { + static const TString SRV_TICKET = "3:serv:CBAQ__________9_IgYIexCUkQY:GioCM49Ob6_f80y6FY0XBVN4hLXuMlFeyMvIMiDuQnZkbkLpRpQOuQo5YjWoBjM0Vf-XqOm8B7xtrvxSYHDD7Q4OatN2l-Iwg7i71lE3scUeD36x47st3nd0OThvtjrFx_D8mw_c0GT5KcniZlqq1SjhLyAk1b_zJsx8viRAhCU"; + static const TString SRV_TICKET_DST_100503 = "3:serv:CBAQ__________9_IggIwMQHEJeRBg:Kj7VApP6D91UJ8pKpeaE3vYaNTBBJcdYpJLbF9w2-Mb-75s_SmMKkPqqA2rMS358uFfoYpv9YZxq0tIaUj5HPQ1WaQ1yiVuPZ_oi3pJRdr006eRyihM8PUfl6m9ioCFftfOcAg9oN5BGeHTNhn7VWuj3yMg7feaMB0zAUpyaPG0"; + static const TString TEST_TICKET = "3:user:CA0Q__________9_Gg4KAgh7EHsg0oXYzAQoAQ:FSADps3wNGm92Vyb1E9IVq5M6ZygdGdt1vafWWEhfDDeCLoVA-sJesxMl2pGW4OxJ8J1r_MfpG3ZoBk8rLVMHUFrPa6HheTbeXFAWl8quEniauXvKQe4VyrpA1SPgtRoFqi5upSDIJzEAe1YRJjq1EClQ_slMt8R0kA_JjKUX54"; + static const TString PROD_YATEAM_TICKET = "3:user:CAwQ__________9_Gg4KAgh7EHsg0oXYzAQoAg:G2wloFRSi8--RLb2GDSro_sKXPF2JSdL5CVOuOHgUcRvLm-3OxIPn0NUqbJ9DWDmhPplOqEiblIbLK85My1VMJ2aG5SLbRNKEtwfmxLvkwNpl_gUEwWPJm9_8Khslfj71P3hccxtEEqM9bJSMwHueVAY-a9HSzFo-uMFMeSgQ-k"; + + class TMetaInfoProxy: public TMetaInfo { + public: + using TMetaInfo::ApplySettings; + using TMetaInfo::BbEnvFromString; + using TMetaInfo::Config_; + using TMetaInfo::Fetch; + using TMetaInfo::ParseMetaString; + using TMetaInfo::TMetaInfo; + }; + + Y_UNIT_TEST(Settings) { + NTvmTool::TClientSettings s("foo"); + UNIT_ASSERT_EXCEPTION_CONTAINS(s.SetAuthToken("\n "), + TBrokenTvmClientSettings, + "Auth token cannot be empty"); + UNIT_ASSERT_EXCEPTION_CONTAINS(s.GetAuthToken(), + TBrokenTvmClientSettings, + "Auth token cannot be empty. Env 'TVMTOOL_LOCAL_AUTHTOKEN' and 'QLOUD_TVM_TOKEN' are empty."); + + UNIT_ASSERT_NO_EXCEPTION(s.SetAuthToken(AUTH_TOKEN + "\n")); + UNIT_ASSERT_VALUES_EQUAL(AUTH_TOKEN, s.GetAuthToken()); + + UNIT_ASSERT_VALUES_EQUAL("localhost", s.GetHostname()); + UNIT_ASSERT_EXCEPTION_CONTAINS(s.SetHostname(""), + TBrokenTvmClientSettings, + "Hostname cannot be empty"); + + UNIT_ASSERT_NO_EXCEPTION(s.SetHostname("qwe")); + UNIT_ASSERT_VALUES_EQUAL("qwe", s.GetHostname()); + } + + Y_UNIT_TEST(SettingsCtor) { + UNIT_ASSERT_EXCEPTION_CONTAINS(NTvmTool::TClientSettings(""), + TBrokenTvmClientSettings, + "Alias for your TVM client cannot be empty"); + { + NTvmTool::TClientSettings s("self"); + UNIT_ASSERT_EXCEPTION_CONTAINS(s.GetAuthToken(), + TBrokenTvmClientSettings, + "Auth token cannot be empty. " + "Env 'TVMTOOL_LOCAL_AUTHTOKEN' and 'QLOUD_TVM_TOKEN' are empty."); + } + + struct TEnvs { + TEnvs(const std::map<TString, TString>& Env) { + for (const auto& [key, value] : Env) { + Prev[key] = GetEnv(key); + SetEnv(key, value); + } + } + + ~TEnvs() { + for (const auto& [key, value] : Prev) { + SetEnv(key, value); + } + } + + std::map<TString, TString> Prev; + }; + + struct TCase { + std::map<TString, TString> Env; + TString AuthToken; + ui16 Port = 0; + }; + + std::vector<TCase> cases = { + { + { + {"TVMTOOL_LOCAL_AUTHTOKEN", "qwerty"}, + }, + "qwerty", + 1, + }, + { + { + {"TVMTOOL_LOCAL_AUTHTOKEN", "qwerty"}, + {"QLOUD_TVM_TOKEN", "zxcvbn"}, + }, + "qwerty", + 1, + }, + { + { + {"QLOUD_TVM_TOKEN", "zxcvbn"}, + }, + "zxcvbn", + 1, + }, + { + { + {"TVMTOOL_LOCAL_AUTHTOKEN", "qwerty"}, + {"DEPLOY_TVM_TOOL_URL", "32272"}, + }, + "qwerty", + 1, + }, + { + { + {"TVMTOOL_LOCAL_AUTHTOKEN", "qwerty"}, + {"DEPLOY_TVM_TOOL_URL", "localhost:32272"}, + }, + "qwerty", + 32272, + }, + { + { + {"TVMTOOL_LOCAL_AUTHTOKEN", "qwerty"}, + {"DEPLOY_TVM_TOOL_URL", "http://localhost:32272"}, + }, + "qwerty", + 32272, + }, + }; + + for (const TCase& c : cases) { + TEnvs envs(c.Env); + + NTvmTool::TClientSettings s("self"); + UNIT_ASSERT_VALUES_EQUAL(c.AuthToken, s.GetAuthToken()); + UNIT_ASSERT_VALUES_EQUAL(c.Port, s.GetPort()); + } + } + + Y_UNIT_TEST(Meta_Fetch) { + TPortManager pm; + ui16 port = pm.GetPort(80); + NMock::TMockServer server(port, []() { return new TTvmTool; }); + TKeepAliveHttpClient client("localhost", port); + + TMetaInfoProxy m(nullptr); + NTvmTool::TClientSettings settings("me"); + settings.SetAuthToken(AUTH_TOKEN); + m.ApplySettings(settings); + + UNIT_ASSERT_VALUES_EQUAL(META, m.Fetch(client)); + + settings.SetAuthToken("qwerty"); + m.ApplySettings(settings); + UNIT_ASSERT_EXCEPTION_CONTAINS(m.Fetch(client), + TNonRetriableException, + "Failed to fetch meta from tvmtool: localhost:"); + + settings.SetAuthToken(AUTH_TOKEN); + m.ApplySettings(settings); + { + TKeepAliveHttpClient client("localhost", 0); + UNIT_ASSERT_EXCEPTION_CONTAINS(m.Fetch(client), + TRetriableException, + "Failed to fetch meta data from tvmtool: "); + } + + server.SetGenerator([]() { + auto p = new TTvmTool; + p->Code = HTTP_NOT_FOUND; + return p; }); + UNIT_ASSERT_EXCEPTION_CONTAINS(m.Fetch(client), + TNonRetriableException, + "Library does not support so old tvmtool. You need tvmtool>=1.1.0"); + server.SetGenerator([]() { + auto p = new TTvmTool; + p->Code = HTTP_INTERNAL_SERVER_ERROR; + return p; }); + UNIT_ASSERT_EXCEPTION_CONTAINS(m.Fetch(client), + TRetriableException, + "Failed to fetch meta from tvmtool: localhost:"); + } + + Y_UNIT_TEST(Meta_ParseMetaString_me) { + TMetaInfo::TConfigPtr c; + UNIT_ASSERT(c = TMetaInfoProxy::ParseMetaString(META, "me")); + UNIT_ASSERT_VALUES_EQUAL(100500, c->SelfTvmId); + UNIT_ASSERT_EQUAL(EBlackboxEnv::ProdYateam, c->BbEnv); + UNIT_ASSERT_EQUAL(TMetaInfo::TDstAliases({{"bbox", 242}, {"pass_likers", 11}}), c->DstAliases); + } + + Y_UNIT_TEST(Meta_ParseMetaString_pc) { + TMetaInfo::TConfigPtr c; + UNIT_ASSERT(c = TMetaInfoProxy::ParseMetaString(META, "push-client")); + UNIT_ASSERT_VALUES_EQUAL(100501, c->SelfTvmId); + UNIT_ASSERT_EQUAL(EBlackboxEnv::ProdYateam, c->BbEnv); + UNIT_ASSERT_EQUAL(TMetaInfo::TDstAliases({{"pass_likers", 100502}}), c->DstAliases); + } + + Y_UNIT_TEST(Meta_ParseMetaString_se) { + TMetaInfo::TConfigPtr c; + UNIT_ASSERT(c = TMetaInfoProxy::ParseMetaString(META, "something_else")); + UNIT_ASSERT_VALUES_EQUAL(100503, c->SelfTvmId); + UNIT_ASSERT_EQUAL(EBlackboxEnv::ProdYateam, c->BbEnv); + UNIT_ASSERT(c->DstAliases.empty()); + } + + Y_UNIT_TEST(Meta_ParseMetaString_errors) { + TMetaInfoProxy m(nullptr); + UNIT_ASSERT(!m.ParseMetaString(META, "ololo")); + + TString meta = "}"; + UNIT_ASSERT_EXCEPTION_CONTAINS(m.ParseMetaString(meta, "qqq"), yexception, meta); + meta = "{}"; + UNIT_ASSERT_EXCEPTION_CONTAINS(m.ParseMetaString(meta, "qqq"), yexception, meta); + meta = R"({"tenants" : {}})"; + UNIT_ASSERT_EXCEPTION_CONTAINS(m.ParseMetaString(meta, "qqq"), yexception, meta); + meta = R"({"tenants" : [{"self":{}}]})"; + UNIT_ASSERT_EXCEPTION_CONTAINS(m.ParseMetaString(meta, "qqq"), yexception, meta); + } + + Y_UNIT_TEST(Meta_BbEnvFromString) { + UNIT_ASSERT_VALUES_EQUAL(EBlackboxEnv::Prod, TMetaInfoProxy::BbEnvFromString("Prod", META)); + UNIT_ASSERT_VALUES_EQUAL(EBlackboxEnv::Test, TMetaInfoProxy::BbEnvFromString("Test", META)); + UNIT_ASSERT_VALUES_EQUAL(EBlackboxEnv::ProdYateam, TMetaInfoProxy::BbEnvFromString("ProdYaTeam", META)); + UNIT_ASSERT_VALUES_EQUAL(EBlackboxEnv::TestYateam, TMetaInfoProxy::BbEnvFromString("TestYaTeam", META)); + UNIT_ASSERT_VALUES_EQUAL(EBlackboxEnv::Stress, TMetaInfoProxy::BbEnvFromString("Stress", META)); + UNIT_ASSERT_EXCEPTION_CONTAINS(TMetaInfoProxy::BbEnvFromString("foo", META), + yexception, + "'bb_env'=='foo'"); + } + + Y_UNIT_TEST(Meta_ApplySettings) { + NTvmTool::TClientSettings s("foo"); + s.SetAuthToken(AUTH_TOKEN); + + TMetaInfoProxy m(nullptr); + m.ApplySettings(s); + + UNIT_ASSERT_VALUES_EQUAL( + TKeepAliveHttpClient::THeaders({{"Authorization", AUTH_TOKEN}}), + m.GetAuthHeader()); + } + + Y_UNIT_TEST(Meta_Init) { + TPortManager pm; + ui16 port = pm.GetPort(80); + NMock::TMockServer server(port, []() { return new TTvmTool; }); + TKeepAliveHttpClient client("localhost", port); + + NTvmTool::TClientSettings s("me"); + s.SetAuthToken(AUTH_TOKEN); + s.SetPort(port); + auto l = MakeIntrusive<TLogger>(); + TMetaInfo m(l); + UNIT_ASSERT_NO_EXCEPTION(m.Init(client, s)); + UNIT_ASSERT_VALUES_EQUAL(100500, m.GetConfig()->SelfTvmId); + UNIT_ASSERT_EQUAL(EBlackboxEnv::ProdYateam, m.GetConfig()->BbEnv); + UNIT_ASSERT_EQUAL(TMetaInfo::TDstAliases({{"bbox", 242}, {"pass_likers", 11}}), m.GetConfig()->DstAliases); + UNIT_ASSERT_VALUES_EQUAL(TStringBuilder() + << "7: Meta info fetched from localhost:" << port << "\n" + << "6: Meta: self_tvm_id=100500, bb_env=ProdYateam, dsts=[(pass_likers:11)(bbox:242)]\n", + l->Stream.Str()); + l->Stream.Clear(); + UNIT_ASSERT_VALUES_EQUAL( + "/tvm/tickets?src=100500&dsts=11,242", + TMetaInfo::GetRequestForTickets(*m.GetConfig())); + + server.SetGenerator([]() { + auto p = new TTvmTool; + p->Meta = R"({ + "bb_env" : "Prod", + "tenants" : [{ + "self": {"alias" : "me", "client_id": 100500}, + "dsts" : [{"alias" : "pass_likers","client_id": 11}] + }] + })"; + return p; }); + UNIT_ASSERT(m.TryUpdateConfig(client)); + UNIT_ASSERT_VALUES_EQUAL( + "6: Meta was updated. Old: (self_tvm_id=100500, bb_env=ProdYateam, dsts=[(pass_likers:11)(bbox:242)]). New: (self_tvm_id=100500, bb_env=Prod, dsts=[(pass_likers:11)])\n", + l->Stream.Str()); + l->Stream.clear(); + + s = NTvmTool::TClientSettings("foo"); + s.SetAuthToken(AUTH_TOKEN); + s.SetPort(port); + TMetaInfo m2(l); + UNIT_ASSERT_EXCEPTION_CONTAINS(m2.Init(client, s), TNonRetriableException, "Alias 'foo' not found in meta info"); + UNIT_ASSERT_VALUES_EQUAL(TStringBuilder() + << "7: Meta info fetched from localhost:" << port << "\n", + l->Stream.Str()); + UNIT_ASSERT_EXCEPTION_CONTAINS(TMetaInfo::GetRequestForTickets({}), + yexception, + "DstAliases.empty()"); + + server.SetGenerator([]() { + auto p = new TTvmTool; + p->Meta = "}"; + return p; }); + UNIT_ASSERT_EXCEPTION_CONTAINS(m.Init(client, s), + TNonRetriableException, + "Malformed json from tvmtool:"); + } + + class TNonInitedUpdater: public TThreadedUpdater { + public: + TNonInitedUpdater(const TString& host, ui16 port, TLoggerPtr logger) : TThreadedUpdater(host, port, TDuration::Seconds(5), TDuration::Seconds(30), logger) - { - } - - using TThreadedUpdater::ArePublicKeysOk; - using TThreadedUpdater::AreServiceTicketsOk; - using TThreadedUpdater::FetchPublicKeys; - using TThreadedUpdater::FetchServiceTickets; - using TThreadedUpdater::GetBirthTimeFromResponse; - using TThreadedUpdater::Init; - using TThreadedUpdater::IsTimeToUpdatePublicKeys; - using TThreadedUpdater::IsTimeToUpdateServiceTickets; - using TThreadedUpdater::LastVisitForConfig_; - using TThreadedUpdater::MetaInfo_; - using TThreadedUpdater::ParseFetchTicketsResponse; - using TThreadedUpdater::SetBbEnv; - using TThreadedUpdater::SetServiceContext; - using TThreadedUpdater::SetServiceTickets; - using TThreadedUpdater::SetUpdateTimeOfPublicKeys; - using TThreadedUpdater::SetUpdateTimeOfServiceTickets; - using TThreadedUpdater::SetUserContext; - using TThreadedUpdater::TPairTicketsErrors; - using TThreadedUpdater::UpdateKeys; - using TThreadedUpdater::UpdateServiceTickets; - }; - - Y_UNIT_TEST(GetBirthTimeFromResponse) { - THttpHeaders h; - UNIT_ASSERT_EXCEPTION_CONTAINS(TNonInitedUpdater::GetBirthTimeFromResponse(h, "ololo"), - yexception, - "Failed to fetch bithtime of ololo from tvmtool"); - - h.AddHeader(THttpInputHeader("X-Ya-Tvmtool-Data-Birthtime: qwe")); - UNIT_ASSERT_EXCEPTION_CONTAINS(TNonInitedUpdater::GetBirthTimeFromResponse(h, "ololo"), - yexception, - "Bithtime of ololo from tvmtool must be unixtime. Got: qwe"); - - h.AddOrReplaceHeader(THttpInputHeader("X-Ya-Tvmtool-Data-Birthtime: 123")); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(123), TNonInitedUpdater::GetBirthTimeFromResponse(h, "ololo")); - } - - Y_UNIT_TEST(Fetch) { - TPortManager pm; - ui16 port = pm.GetPort(80); - NMock::TMockServer server(port, []() { return new TTvmTool; }); - TKeepAliveHttpClient client("localhost", port); - - auto l = MakeIntrusive<TLogger>(); - TNonInitedUpdater u("localhost", port, l); - NTvmTool::TClientSettings s("me"); - s.SetAuthToken(AUTH_TOKEN); - s.SetPort(port); - u.MetaInfo_.Init(client, s); - auto p = u.FetchPublicKeys(); - UNIT_ASSERT_STRINGS_EQUAL(NUnittest::TVMKNIFE_PUBLIC_KEYS, p.first); - UNIT_ASSERT_VALUES_EQUAL(BIRTHTIME, p.second); - - auto p2 = u.FetchServiceTickets(*u.MetaInfo_.GetConfig()); - UNIT_ASSERT_STRINGS_EQUAL(TICKETS_ME, p2.first); - UNIT_ASSERT_VALUES_EQUAL(BIRTHTIME, p2.second); - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "7: Meta info fetched from localhost:" << port << "\n" - << "6: Meta: self_tvm_id=100500, bb_env=ProdYateam, dsts=[(pass_likers:11)(bbox:242)]\n", - l->Stream.Str()); - } - - Y_UNIT_TEST(ParseFetchTicketsResponse) { - auto l = MakeIntrusive<TLogger>(); - TNonInitedUpdater u("", 0, l); - - UNIT_ASSERT_EXCEPTION_CONTAINS(u.ParseFetchTicketsResponse("}", {}), - yexception, - "Invalid json from tvmtool: }"); - - auto t = u.ParseFetchTicketsResponse(TICKETS_ME, {{"pass_likers", 11}, {"se", 2}}); - auto expected = TNonInitedUpdater::TPairTicketsErrors{ - {{11, "3:serv:CBAQ__________9_IgYIlJEGEAs:T-apeMNWFc_vHPQ3iLaZv9NjG-hf5-i23O4AhRu1M68ryN3FU5qvyqTSSiPbtJdFP6EE41QQBzEs59dHn9DRkqQNwwKf1is00Oewwj2XKO0uHukuzd9XxZnro7MfjPswsjWufxX28rmJtlfSXwAtyKt8TI5yKJnMeBPQ0m5R3k8"}}, - { - {2, "Missing tvm_id in response, should never happend: se"}, - }, - }; - UNIT_ASSERT_VALUES_EQUAL(expected, t); - - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "3: Failed to get ServiceTicket for se (2): Missing tvm_id in response, should never happend: se\n", - l->Stream.Str()); - } - - Y_UNIT_TEST(Update) { - TPortManager pm; - ui16 port = pm.GetPort(80); - NMock::TMockServer server(port, []() { return new TTvmTool; }); - TKeepAliveHttpClient client("localhost", port); - - auto l = MakeIntrusive<TLogger>(); - TNonInitedUpdater u("localhost", port, l); - NTvmTool::TClientSettings s("me"); - s.SetAuthToken(AUTH_TOKEN); - s.SetPort(port); - u.MetaInfo_.Init(client, s); - - using TTickets = TServiceTickets::TMapAliasStr; - UNIT_ASSERT(!u.GetCachedServiceTickets()); - UNIT_ASSERT_VALUES_EQUAL(BIRTHTIME, u.UpdateServiceTickets(*u.MetaInfo_.GetConfig())); - UNIT_ASSERT(u.GetCachedServiceTickets()); - UNIT_ASSERT_VALUES_EQUAL(TInstant(), u.GetUpdateTimeOfServiceTickets()); - UNIT_ASSERT_EQUAL( - TTickets({ - {"bbox", "3:serv:CBAQ__________9_IgcIlJEGEPIB:N7luw0_rVmBosTTI130jwDbQd0-cMmqJeEl0ma4ZlIo_mHXjBzpOuMQ3A9YagbmOBOt8TZ_gzGvVSegWZkEeB24gM22acw0w-RcHaQKrzSOA5Zq8WLNIC8QUa4_WGTlAsb7R7eC4KTAGgouIquNAgMBdTuGOuZHnMLvZyLnOMKc"}, - {"pass_likers", "3:serv:CBAQ__________9_IgYIlJEGEAs:T-apeMNWFc_vHPQ3iLaZv9NjG-hf5-i23O4AhRu1M68ryN3FU5qvyqTSSiPbtJdFP6EE41QQBzEs59dHn9DRkqQNwwKf1is00Oewwj2XKO0uHukuzd9XxZnro7MfjPswsjWufxX28rmJtlfSXwAtyKt8TI5yKJnMeBPQ0m5R3k8"}, - }), - u.GetCachedServiceTickets()->TicketsByAlias); - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "7: Meta info fetched from localhost:" << port << "\n" - << "6: Meta: self_tvm_id=100500, bb_env=ProdYateam, dsts=[(pass_likers:11)(bbox:242)]\n", - l->Stream.Str()); - l->Stream.Clear(); - - UNIT_ASSERT(!u.GetCachedServiceContext()); - UNIT_ASSERT(!u.GetCachedUserContext()); - UNIT_ASSERT_VALUES_EQUAL(BIRTHTIME, u.UpdateKeys(*u.MetaInfo_.GetConfig())); - UNIT_ASSERT(u.GetCachedServiceContext()); - UNIT_ASSERT(!u.GetCachedUserContext()); - u.SetBbEnv(EBlackboxEnv::Test); - UNIT_ASSERT(u.GetCachedUserContext()); - UNIT_ASSERT_VALUES_EQUAL("", l->Stream.Str()); - l->Stream.Clear(); - - { - TAsyncUpdaterPtr u = TThreadedUpdater::Create(s, l); - UNIT_ASSERT(u->GetCachedServiceTickets()); - UNIT_ASSERT(u->GetCachedServiceContext()); - UNIT_ASSERT(u->GetCachedUserContext()); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus()); - - NTvmAuth::TTvmClient c(u); - UNIT_ASSERT(c.CheckServiceTicket(SRV_TICKET)); - UNIT_ASSERT(!c.CheckServiceTicket(SRV_TICKET_DST_100503)); - UNIT_ASSERT(c.CheckUserTicket(PROD_YATEAM_TICKET)); - UNIT_ASSERT_VALUES_EQUAL("3:serv:CBAQ__________9_IgYIlJEGEAs:T-apeMNWFc_vHPQ3iLaZv9NjG-hf5-i23O4AhRu1M68ryN3FU5qvyqTSSiPbtJdFP6EE41QQBzEs59dHn9DRkqQNwwKf1is00Oewwj2XKO0uHukuzd9XxZnro7MfjPswsjWufxX28rmJtlfSXwAtyKt8TI5yKJnMeBPQ0m5R3k8", c.GetServiceTicketFor("pass_likers")); - } - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "7: Meta info fetched from localhost:" << port << "\n" - << "6: Meta: self_tvm_id=100500, bb_env=ProdYateam, dsts=[(pass_likers:11)(bbox:242)]\n" - << "7: Tickets fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" - << "7: Public keys fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - l->Stream.Str()); - l->Stream.Clear(); - - { - NTvmTool::TClientSettings s("something_else"); - s.SetAuthToken(AUTH_TOKEN); - s.SetPort(port); - - TAsyncUpdaterPtr u = TThreadedUpdater::Create(s, l); - UNIT_ASSERT(!u->GetCachedServiceTickets()); - UNIT_ASSERT(u->GetCachedServiceContext()); - UNIT_ASSERT(u->GetCachedUserContext()); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus()); - - NTvmAuth::TTvmClient c(u); - UNIT_ASSERT(!c.CheckServiceTicket(SRV_TICKET)); - UNIT_ASSERT(c.CheckServiceTicket(SRV_TICKET_DST_100503)); - UNIT_ASSERT(c.CheckUserTicket(PROD_YATEAM_TICKET)); - UNIT_ASSERT_EXCEPTION_CONTAINS(c.GetServiceTicketFor("pass_likers"), - TBrokenTvmClientSettings, - "Need to enable ServiceTickets fetching"); - } - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "7: Meta info fetched from localhost:" << port << "\n" - << "6: Meta: self_tvm_id=100503, bb_env=ProdYateam, dsts=[]\n" - << "7: Public keys fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - l->Stream.Str()); - l->Stream.Clear(); - } - - Y_UNIT_TEST(IsOk) { - TNonInitedUpdater u("", 0, TDevNullLogger::IAmBrave()); - using TTickets = TServiceTickets::TMapIdStr; - - UNIT_ASSERT(u.AreServiceTicketsOk(0)); - UNIT_ASSERT(!u.AreServiceTicketsOk(2)); - u.SetServiceTickets(MakeIntrusiveConst<TServiceTickets>(TTickets(), - TTickets(), - TServiceTickets::TMapAliasId())); - UNIT_ASSERT(u.AreServiceTicketsOk(0)); - UNIT_ASSERT(!u.AreServiceTicketsOk(2)); - u.SetServiceTickets(MakeIntrusiveConst<TServiceTickets>( - TTickets({ - {1, "mega_ticket"}, - {2, "mega_ticket2"}, - }), - TTickets({ - {3, "mega_error3"}, - }), - TServiceTickets::TMapAliasId())); - UNIT_ASSERT(u.AreServiceTicketsOk(0)); - UNIT_ASSERT(!u.AreServiceTicketsOk(2)); - - u.SetServiceTickets(MakeIntrusiveConst<TServiceTickets>( - TTickets({ - {1, "mega_ticket"}, - {2, "mega_ticket2"}, - }), - TTickets({ - {3, "mega_error3"}, - }), - TServiceTickets::TMapAliasId({ - {"mega_ticket", 1}, - {"mega_ticket2", 2}, - {"mega_ticket3", 3}, - }))); - UNIT_ASSERT(u.AreServiceTicketsOk(2)); - - UNIT_ASSERT(!u.ArePublicKeysOk()); - u.SetServiceContext(MakeIntrusiveConst<TServiceContext>( - TServiceContext::CheckingFactory(12, NUnittest::TVMKNIFE_PUBLIC_KEYS))); - UNIT_ASSERT(!u.ArePublicKeysOk()); - u.SetUserContext(NUnittest::TVMKNIFE_PUBLIC_KEYS); - UNIT_ASSERT(!u.ArePublicKeysOk()); - u.SetBbEnv(EBlackboxEnv::Test); - UNIT_ASSERT(u.ArePublicKeysOk()); - } - - Y_UNIT_TEST(IsTimeToUpdate) { - TNonInitedUpdater u("", 0, TDevNullLogger::IAmBrave()); - - UNIT_ASSERT(!u.IsTimeToUpdatePublicKeys(TInstant::Now() - TDuration::Seconds(597))); - UNIT_ASSERT(u.IsTimeToUpdatePublicKeys(TInstant::Now() - TDuration::Seconds(603))); - - TMetaInfo::TConfig cfg; - UNIT_ASSERT(!u.IsTimeToUpdateServiceTickets(cfg, TInstant::Now() - TDuration::Seconds(597))); - UNIT_ASSERT(!u.IsTimeToUpdateServiceTickets(cfg, TInstant::Now() - TDuration::Seconds(603))); - - cfg.DstAliases = {{"q", 1}}; - UNIT_ASSERT(!u.IsTimeToUpdateServiceTickets(cfg, TInstant::Now() - TDuration::Seconds(597))); - UNIT_ASSERT(u.IsTimeToUpdateServiceTickets(cfg, TInstant::Now() - TDuration::Seconds(603))); - } - - Y_UNIT_TEST(InitWithOldData) { - TPortManager pm; - ui16 port = pm.GetPort(80); - NMock::TMockServer server(port, - []() { - auto p = new TTvmTool; - p->Birthtime = TInstant::Seconds(123); - return p; - }); - - NTvmTool::TClientSettings s("me"); - s.SetAuthToken(AUTH_TOKEN); - s.SetPort(port); - - auto l = MakeIntrusive<TLogger>(); - UNIT_ASSERT_EXCEPTION_CONTAINS(TThreadedUpdater::Create(s, l), - TRetriableException, - "Failed to start TvmClient. You can retry: "); - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "7: Meta info fetched from localhost:" << port << "\n" - << "6: Meta: self_tvm_id=100500, bb_env=ProdYateam, dsts=[(pass_likers:11)(bbox:242)]\n" - << "4: Error while fetching of tickets: Service tickets are too old: 1970-01-01T00:02:03.000000Z\n" - << "3: Service tickets have not been refreshed for too long period\n" - << "4: Error while fetching of public keys: Public keys are too old: 1970-01-01T00:02:03.000000Z\n" - << "3: Public keys have not been refreshed for too long period\n" - << "4: Error while fetching of tickets: Service tickets are too old: 1970-01-01T00:02:03.000000Z\n" - << "3: Service tickets have not been refreshed for too long period\n" - << "4: Error while fetching of public keys: Public keys are too old: 1970-01-01T00:02:03.000000Z\n" - << "3: Public keys have not been refreshed for too long period\n" - << "4: Error while fetching of tickets: Service tickets are too old: 1970-01-01T00:02:03.000000Z\n" - << "3: Service tickets have not been refreshed for too long period\n" - << "4: Error while fetching of public keys: Public keys are too old: 1970-01-01T00:02:03.000000Z\n" - << "3: Public keys have not been refreshed for too long period\n", - l->Stream.Str()); - } - - Y_UNIT_TEST(InitWithOldData_onlyKeys) { - TPortManager pm; - ui16 port = pm.GetPort(80); - NMock::TMockServer server(port, - []() { - auto p = new TTvmTool; - p->Birthtime = TInstant::Seconds(123); - return p; - }); - - NTvmTool::TClientSettings s("something_else"); - s.SetAuthToken(AUTH_TOKEN); - s.SetPort(port); - - { - s.OverrideBlackboxEnv(EBlackboxEnv::Stress); - auto l = MakeIntrusive<TLogger>(); - UNIT_ASSERT_EXCEPTION_CONTAINS(TThreadedUpdater::Create(s, l), - TBrokenTvmClientSettings, - "Overriding of BlackboxEnv is illegal: ProdYateam -> Stress"); - } - - s.OverrideBlackboxEnv(EBlackboxEnv::Prod); - auto l = MakeIntrusive<TLogger>(); - UNIT_ASSERT_EXCEPTION_CONTAINS(TThreadedUpdater::Create(s, l), - TRetriableException, - "Failed to start TvmClient. You can retry: "); - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "7: Meta info fetched from localhost:" << port << "\n" - << "6: Meta: self_tvm_id=100503, bb_env=ProdYateam, dsts=[]\n" - << "6: Meta: override blackbox env: ProdYateam->Prod\n" - << "4: Error while fetching of public keys: Public keys are too old: 1970-01-01T00:02:03.000000Z\n" - << "3: Public keys have not been refreshed for too long period\n" - << "4: Error while fetching of public keys: Public keys are too old: 1970-01-01T00:02:03.000000Z\n" - << "3: Public keys have not been refreshed for too long period\n" - << "4: Error while fetching of public keys: Public keys are too old: 1970-01-01T00:02:03.000000Z\n" - << "3: Public keys have not been refreshed for too long period\n", - l->Stream.Str()); - } - - Y_UNIT_TEST(Init) { - TPortManager pm; - ui16 port = pm.GetPort(80); - NMock::TMockServer server(port, []() { return new TTvmTool; }); - - NTvmTool::TClientSettings s("push-client"); - s.SetAuthToken(AUTH_TOKEN); - s.SetPort(port); - s.SetHostname("localhost"); - - auto l = MakeIntrusive<TLogger>(); - { - TAsyncUpdaterPtr u = TThreadedUpdater::Create(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus()); - } - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "7: Meta info fetched from localhost:" << port << "\n" - << "6: Meta: self_tvm_id=100501, bb_env=ProdYateam, dsts=[(pass_likers:100502)]\n" - << "7: Tickets fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" - << "7: Public keys fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - l->Stream.Str()); - } - - Y_UNIT_TEST(InitWithoutTvmtool) { - NTvmTool::TClientSettings s("me"); - s.SetAuthToken(AUTH_TOKEN); - s.SetPort(0); - - UNIT_ASSERT_EXCEPTION_CONTAINS(TThreadedUpdater::Create(s, TDevNullLogger::IAmBrave()), - TNonRetriableException, - "can not connect to "); - } - - Y_UNIT_TEST(GetStatus) { - TNonInitedUpdater u("", 0, TDevNullLogger::IAmBrave()); - TMetaInfoProxy m(nullptr); - m.Config_ = std::make_shared<TMetaInfo::TConfig>(); - u.MetaInfo_ = m; - u.LastVisitForConfig_ = TInstant::Now(); - - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Error, u.GetStatus()); - u.SetUpdateTimeOfPublicKeys(TInstant::Now() - TDuration::Days(3)); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Warning, u.GetStatus()); - u.SetUpdateTimeOfPublicKeys(TInstant::Now() - TDuration::Hours(3)); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - - u.SetServiceTickets(new TServiceTickets({}, {}, {})); - - TMetaInfo::TConfig cfg; - cfg.DstAliases = {{"q", 1}, {"q2", 2}}; - m.Config_ = std::make_shared<TMetaInfo::TConfig>(cfg); - u.MetaInfo_ = m; - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Error, u.GetStatus()); - u.SetUpdateTimeOfServiceTickets(TInstant::Now() - TDuration::Hours(3)); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Error, u.GetStatus()); - - u.SetServiceTickets(MakeIntrusiveConst<TServiceTickets>( - TServiceTickets::TMapIdStr({{1, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, {2, "t"}}), - TServiceTickets::TMapIdStr({{3, "mega_error"}, {4, "error2"}}), - TServiceTickets::TMapAliasId({ - {"some_alias#1", 1}, - {"some_alias#2", 2}, - }))); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Warning, u.GetStatus()); - - const TInstant* inv = &u.GetCachedServiceTickets()->InvalidationTime; - *const_cast<TInstant*>(inv) = TInstant::Now() + TDuration::Hours(3); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Warning, u.GetStatus()); - - u.SetUpdateTimeOfServiceTickets(TInstant::Now() - TDuration::Minutes(3)); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); - - u.LastVisitForConfig_ = TInstant::Now() - TDuration::Minutes(1); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Warning, u.GetStatus()); - } - - Y_UNIT_TEST(multiNamesForDst) { - TPortManager pm; - ui16 port = pm.GetPort(80); - NMock::TMockServer server(port, []() { return new TTvmTool; }); - - NTvmTool::TClientSettings s("multi_names_for_dst"); - s.SetAuthToken(AUTH_TOKEN); - s.SetPort(port); - s.SetHostname("localhost"); - - auto l = MakeIntrusive<TLogger>(); - { - TAsyncUpdaterPtr u = TThreadedUpdater::Create(s, l); - UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus()); - } - UNIT_ASSERT_VALUES_EQUAL( - TStringBuilder() - << "7: Meta info fetched from localhost:" << port << "\n" - << "6: Meta: self_tvm_id=100599, bb_env=ProdYateam, dsts=[(pass_haters:100502)(pass_likers:100502)]\n" - << "7: Tickets fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" - << "7: Public keys fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" - << "7: Thread-worker started\n" - << "7: Thread-worker stopped\n", - l->Stream.Str()); - } -} + { + } + + using TThreadedUpdater::ArePublicKeysOk; + using TThreadedUpdater::AreServiceTicketsOk; + using TThreadedUpdater::FetchPublicKeys; + using TThreadedUpdater::FetchServiceTickets; + using TThreadedUpdater::GetBirthTimeFromResponse; + using TThreadedUpdater::Init; + using TThreadedUpdater::IsTimeToUpdatePublicKeys; + using TThreadedUpdater::IsTimeToUpdateServiceTickets; + using TThreadedUpdater::LastVisitForConfig_; + using TThreadedUpdater::MetaInfo_; + using TThreadedUpdater::ParseFetchTicketsResponse; + using TThreadedUpdater::SetBbEnv; + using TThreadedUpdater::SetServiceContext; + using TThreadedUpdater::SetServiceTickets; + using TThreadedUpdater::SetUpdateTimeOfPublicKeys; + using TThreadedUpdater::SetUpdateTimeOfServiceTickets; + using TThreadedUpdater::SetUserContext; + using TThreadedUpdater::TPairTicketsErrors; + using TThreadedUpdater::UpdateKeys; + using TThreadedUpdater::UpdateServiceTickets; + }; + + Y_UNIT_TEST(GetBirthTimeFromResponse) { + THttpHeaders h; + UNIT_ASSERT_EXCEPTION_CONTAINS(TNonInitedUpdater::GetBirthTimeFromResponse(h, "ololo"), + yexception, + "Failed to fetch bithtime of ololo from tvmtool"); + + h.AddHeader(THttpInputHeader("X-Ya-Tvmtool-Data-Birthtime: qwe")); + UNIT_ASSERT_EXCEPTION_CONTAINS(TNonInitedUpdater::GetBirthTimeFromResponse(h, "ololo"), + yexception, + "Bithtime of ololo from tvmtool must be unixtime. Got: qwe"); + + h.AddOrReplaceHeader(THttpInputHeader("X-Ya-Tvmtool-Data-Birthtime: 123")); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(123), TNonInitedUpdater::GetBirthTimeFromResponse(h, "ololo")); + } + + Y_UNIT_TEST(Fetch) { + TPortManager pm; + ui16 port = pm.GetPort(80); + NMock::TMockServer server(port, []() { return new TTvmTool; }); + TKeepAliveHttpClient client("localhost", port); + + auto l = MakeIntrusive<TLogger>(); + TNonInitedUpdater u("localhost", port, l); + NTvmTool::TClientSettings s("me"); + s.SetAuthToken(AUTH_TOKEN); + s.SetPort(port); + u.MetaInfo_.Init(client, s); + auto p = u.FetchPublicKeys(); + UNIT_ASSERT_STRINGS_EQUAL(NUnittest::TVMKNIFE_PUBLIC_KEYS, p.first); + UNIT_ASSERT_VALUES_EQUAL(BIRTHTIME, p.second); + + auto p2 = u.FetchServiceTickets(*u.MetaInfo_.GetConfig()); + UNIT_ASSERT_STRINGS_EQUAL(TICKETS_ME, p2.first); + UNIT_ASSERT_VALUES_EQUAL(BIRTHTIME, p2.second); + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "7: Meta info fetched from localhost:" << port << "\n" + << "6: Meta: self_tvm_id=100500, bb_env=ProdYateam, dsts=[(pass_likers:11)(bbox:242)]\n", + l->Stream.Str()); + } + + Y_UNIT_TEST(ParseFetchTicketsResponse) { + auto l = MakeIntrusive<TLogger>(); + TNonInitedUpdater u("", 0, l); + + UNIT_ASSERT_EXCEPTION_CONTAINS(u.ParseFetchTicketsResponse("}", {}), + yexception, + "Invalid json from tvmtool: }"); + + auto t = u.ParseFetchTicketsResponse(TICKETS_ME, {{"pass_likers", 11}, {"se", 2}}); + auto expected = TNonInitedUpdater::TPairTicketsErrors{ + {{11, "3:serv:CBAQ__________9_IgYIlJEGEAs:T-apeMNWFc_vHPQ3iLaZv9NjG-hf5-i23O4AhRu1M68ryN3FU5qvyqTSSiPbtJdFP6EE41QQBzEs59dHn9DRkqQNwwKf1is00Oewwj2XKO0uHukuzd9XxZnro7MfjPswsjWufxX28rmJtlfSXwAtyKt8TI5yKJnMeBPQ0m5R3k8"}}, + { + {2, "Missing tvm_id in response, should never happend: se"}, + }, + }; + UNIT_ASSERT_VALUES_EQUAL(expected, t); + + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "3: Failed to get ServiceTicket for se (2): Missing tvm_id in response, should never happend: se\n", + l->Stream.Str()); + } + + Y_UNIT_TEST(Update) { + TPortManager pm; + ui16 port = pm.GetPort(80); + NMock::TMockServer server(port, []() { return new TTvmTool; }); + TKeepAliveHttpClient client("localhost", port); + + auto l = MakeIntrusive<TLogger>(); + TNonInitedUpdater u("localhost", port, l); + NTvmTool::TClientSettings s("me"); + s.SetAuthToken(AUTH_TOKEN); + s.SetPort(port); + u.MetaInfo_.Init(client, s); + + using TTickets = TServiceTickets::TMapAliasStr; + UNIT_ASSERT(!u.GetCachedServiceTickets()); + UNIT_ASSERT_VALUES_EQUAL(BIRTHTIME, u.UpdateServiceTickets(*u.MetaInfo_.GetConfig())); + UNIT_ASSERT(u.GetCachedServiceTickets()); + UNIT_ASSERT_VALUES_EQUAL(TInstant(), u.GetUpdateTimeOfServiceTickets()); + UNIT_ASSERT_EQUAL( + TTickets({ + {"bbox", "3:serv:CBAQ__________9_IgcIlJEGEPIB:N7luw0_rVmBosTTI130jwDbQd0-cMmqJeEl0ma4ZlIo_mHXjBzpOuMQ3A9YagbmOBOt8TZ_gzGvVSegWZkEeB24gM22acw0w-RcHaQKrzSOA5Zq8WLNIC8QUa4_WGTlAsb7R7eC4KTAGgouIquNAgMBdTuGOuZHnMLvZyLnOMKc"}, + {"pass_likers", "3:serv:CBAQ__________9_IgYIlJEGEAs:T-apeMNWFc_vHPQ3iLaZv9NjG-hf5-i23O4AhRu1M68ryN3FU5qvyqTSSiPbtJdFP6EE41QQBzEs59dHn9DRkqQNwwKf1is00Oewwj2XKO0uHukuzd9XxZnro7MfjPswsjWufxX28rmJtlfSXwAtyKt8TI5yKJnMeBPQ0m5R3k8"}, + }), + u.GetCachedServiceTickets()->TicketsByAlias); + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "7: Meta info fetched from localhost:" << port << "\n" + << "6: Meta: self_tvm_id=100500, bb_env=ProdYateam, dsts=[(pass_likers:11)(bbox:242)]\n", + l->Stream.Str()); + l->Stream.Clear(); + + UNIT_ASSERT(!u.GetCachedServiceContext()); + UNIT_ASSERT(!u.GetCachedUserContext()); + UNIT_ASSERT_VALUES_EQUAL(BIRTHTIME, u.UpdateKeys(*u.MetaInfo_.GetConfig())); + UNIT_ASSERT(u.GetCachedServiceContext()); + UNIT_ASSERT(!u.GetCachedUserContext()); + u.SetBbEnv(EBlackboxEnv::Test); + UNIT_ASSERT(u.GetCachedUserContext()); + UNIT_ASSERT_VALUES_EQUAL("", l->Stream.Str()); + l->Stream.Clear(); + + { + TAsyncUpdaterPtr u = TThreadedUpdater::Create(s, l); + UNIT_ASSERT(u->GetCachedServiceTickets()); + UNIT_ASSERT(u->GetCachedServiceContext()); + UNIT_ASSERT(u->GetCachedUserContext()); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus()); + + NTvmAuth::TTvmClient c(u); + UNIT_ASSERT(c.CheckServiceTicket(SRV_TICKET)); + UNIT_ASSERT(!c.CheckServiceTicket(SRV_TICKET_DST_100503)); + UNIT_ASSERT(c.CheckUserTicket(PROD_YATEAM_TICKET)); + UNIT_ASSERT_VALUES_EQUAL("3:serv:CBAQ__________9_IgYIlJEGEAs:T-apeMNWFc_vHPQ3iLaZv9NjG-hf5-i23O4AhRu1M68ryN3FU5qvyqTSSiPbtJdFP6EE41QQBzEs59dHn9DRkqQNwwKf1is00Oewwj2XKO0uHukuzd9XxZnro7MfjPswsjWufxX28rmJtlfSXwAtyKt8TI5yKJnMeBPQ0m5R3k8", c.GetServiceTicketFor("pass_likers")); + } + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "7: Meta info fetched from localhost:" << port << "\n" + << "6: Meta: self_tvm_id=100500, bb_env=ProdYateam, dsts=[(pass_likers:11)(bbox:242)]\n" + << "7: Tickets fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" + << "7: Public keys fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + l->Stream.Str()); + l->Stream.Clear(); + + { + NTvmTool::TClientSettings s("something_else"); + s.SetAuthToken(AUTH_TOKEN); + s.SetPort(port); + + TAsyncUpdaterPtr u = TThreadedUpdater::Create(s, l); + UNIT_ASSERT(!u->GetCachedServiceTickets()); + UNIT_ASSERT(u->GetCachedServiceContext()); + UNIT_ASSERT(u->GetCachedUserContext()); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus()); + + NTvmAuth::TTvmClient c(u); + UNIT_ASSERT(!c.CheckServiceTicket(SRV_TICKET)); + UNIT_ASSERT(c.CheckServiceTicket(SRV_TICKET_DST_100503)); + UNIT_ASSERT(c.CheckUserTicket(PROD_YATEAM_TICKET)); + UNIT_ASSERT_EXCEPTION_CONTAINS(c.GetServiceTicketFor("pass_likers"), + TBrokenTvmClientSettings, + "Need to enable ServiceTickets fetching"); + } + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "7: Meta info fetched from localhost:" << port << "\n" + << "6: Meta: self_tvm_id=100503, bb_env=ProdYateam, dsts=[]\n" + << "7: Public keys fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + l->Stream.Str()); + l->Stream.Clear(); + } + + Y_UNIT_TEST(IsOk) { + TNonInitedUpdater u("", 0, TDevNullLogger::IAmBrave()); + using TTickets = TServiceTickets::TMapIdStr; + + UNIT_ASSERT(u.AreServiceTicketsOk(0)); + UNIT_ASSERT(!u.AreServiceTicketsOk(2)); + u.SetServiceTickets(MakeIntrusiveConst<TServiceTickets>(TTickets(), + TTickets(), + TServiceTickets::TMapAliasId())); + UNIT_ASSERT(u.AreServiceTicketsOk(0)); + UNIT_ASSERT(!u.AreServiceTicketsOk(2)); + u.SetServiceTickets(MakeIntrusiveConst<TServiceTickets>( + TTickets({ + {1, "mega_ticket"}, + {2, "mega_ticket2"}, + }), + TTickets({ + {3, "mega_error3"}, + }), + TServiceTickets::TMapAliasId())); + UNIT_ASSERT(u.AreServiceTicketsOk(0)); + UNIT_ASSERT(!u.AreServiceTicketsOk(2)); + + u.SetServiceTickets(MakeIntrusiveConst<TServiceTickets>( + TTickets({ + {1, "mega_ticket"}, + {2, "mega_ticket2"}, + }), + TTickets({ + {3, "mega_error3"}, + }), + TServiceTickets::TMapAliasId({ + {"mega_ticket", 1}, + {"mega_ticket2", 2}, + {"mega_ticket3", 3}, + }))); + UNIT_ASSERT(u.AreServiceTicketsOk(2)); + + UNIT_ASSERT(!u.ArePublicKeysOk()); + u.SetServiceContext(MakeIntrusiveConst<TServiceContext>( + TServiceContext::CheckingFactory(12, NUnittest::TVMKNIFE_PUBLIC_KEYS))); + UNIT_ASSERT(!u.ArePublicKeysOk()); + u.SetUserContext(NUnittest::TVMKNIFE_PUBLIC_KEYS); + UNIT_ASSERT(!u.ArePublicKeysOk()); + u.SetBbEnv(EBlackboxEnv::Test); + UNIT_ASSERT(u.ArePublicKeysOk()); + } + + Y_UNIT_TEST(IsTimeToUpdate) { + TNonInitedUpdater u("", 0, TDevNullLogger::IAmBrave()); + + UNIT_ASSERT(!u.IsTimeToUpdatePublicKeys(TInstant::Now() - TDuration::Seconds(597))); + UNIT_ASSERT(u.IsTimeToUpdatePublicKeys(TInstant::Now() - TDuration::Seconds(603))); + + TMetaInfo::TConfig cfg; + UNIT_ASSERT(!u.IsTimeToUpdateServiceTickets(cfg, TInstant::Now() - TDuration::Seconds(597))); + UNIT_ASSERT(!u.IsTimeToUpdateServiceTickets(cfg, TInstant::Now() - TDuration::Seconds(603))); + + cfg.DstAliases = {{"q", 1}}; + UNIT_ASSERT(!u.IsTimeToUpdateServiceTickets(cfg, TInstant::Now() - TDuration::Seconds(597))); + UNIT_ASSERT(u.IsTimeToUpdateServiceTickets(cfg, TInstant::Now() - TDuration::Seconds(603))); + } + + Y_UNIT_TEST(InitWithOldData) { + TPortManager pm; + ui16 port = pm.GetPort(80); + NMock::TMockServer server(port, + []() { + auto p = new TTvmTool; + p->Birthtime = TInstant::Seconds(123); + return p; + }); + + NTvmTool::TClientSettings s("me"); + s.SetAuthToken(AUTH_TOKEN); + s.SetPort(port); + + auto l = MakeIntrusive<TLogger>(); + UNIT_ASSERT_EXCEPTION_CONTAINS(TThreadedUpdater::Create(s, l), + TRetriableException, + "Failed to start TvmClient. You can retry: "); + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "7: Meta info fetched from localhost:" << port << "\n" + << "6: Meta: self_tvm_id=100500, bb_env=ProdYateam, dsts=[(pass_likers:11)(bbox:242)]\n" + << "4: Error while fetching of tickets: Service tickets are too old: 1970-01-01T00:02:03.000000Z\n" + << "3: Service tickets have not been refreshed for too long period\n" + << "4: Error while fetching of public keys: Public keys are too old: 1970-01-01T00:02:03.000000Z\n" + << "3: Public keys have not been refreshed for too long period\n" + << "4: Error while fetching of tickets: Service tickets are too old: 1970-01-01T00:02:03.000000Z\n" + << "3: Service tickets have not been refreshed for too long period\n" + << "4: Error while fetching of public keys: Public keys are too old: 1970-01-01T00:02:03.000000Z\n" + << "3: Public keys have not been refreshed for too long period\n" + << "4: Error while fetching of tickets: Service tickets are too old: 1970-01-01T00:02:03.000000Z\n" + << "3: Service tickets have not been refreshed for too long period\n" + << "4: Error while fetching of public keys: Public keys are too old: 1970-01-01T00:02:03.000000Z\n" + << "3: Public keys have not been refreshed for too long period\n", + l->Stream.Str()); + } + + Y_UNIT_TEST(InitWithOldData_onlyKeys) { + TPortManager pm; + ui16 port = pm.GetPort(80); + NMock::TMockServer server(port, + []() { + auto p = new TTvmTool; + p->Birthtime = TInstant::Seconds(123); + return p; + }); + + NTvmTool::TClientSettings s("something_else"); + s.SetAuthToken(AUTH_TOKEN); + s.SetPort(port); + + { + s.OverrideBlackboxEnv(EBlackboxEnv::Stress); + auto l = MakeIntrusive<TLogger>(); + UNIT_ASSERT_EXCEPTION_CONTAINS(TThreadedUpdater::Create(s, l), + TBrokenTvmClientSettings, + "Overriding of BlackboxEnv is illegal: ProdYateam -> Stress"); + } + + s.OverrideBlackboxEnv(EBlackboxEnv::Prod); + auto l = MakeIntrusive<TLogger>(); + UNIT_ASSERT_EXCEPTION_CONTAINS(TThreadedUpdater::Create(s, l), + TRetriableException, + "Failed to start TvmClient. You can retry: "); + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "7: Meta info fetched from localhost:" << port << "\n" + << "6: Meta: self_tvm_id=100503, bb_env=ProdYateam, dsts=[]\n" + << "6: Meta: override blackbox env: ProdYateam->Prod\n" + << "4: Error while fetching of public keys: Public keys are too old: 1970-01-01T00:02:03.000000Z\n" + << "3: Public keys have not been refreshed for too long period\n" + << "4: Error while fetching of public keys: Public keys are too old: 1970-01-01T00:02:03.000000Z\n" + << "3: Public keys have not been refreshed for too long period\n" + << "4: Error while fetching of public keys: Public keys are too old: 1970-01-01T00:02:03.000000Z\n" + << "3: Public keys have not been refreshed for too long period\n", + l->Stream.Str()); + } + + Y_UNIT_TEST(Init) { + TPortManager pm; + ui16 port = pm.GetPort(80); + NMock::TMockServer server(port, []() { return new TTvmTool; }); + + NTvmTool::TClientSettings s("push-client"); + s.SetAuthToken(AUTH_TOKEN); + s.SetPort(port); + s.SetHostname("localhost"); + + auto l = MakeIntrusive<TLogger>(); + { + TAsyncUpdaterPtr u = TThreadedUpdater::Create(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus()); + } + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "7: Meta info fetched from localhost:" << port << "\n" + << "6: Meta: self_tvm_id=100501, bb_env=ProdYateam, dsts=[(pass_likers:100502)]\n" + << "7: Tickets fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" + << "7: Public keys fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + l->Stream.Str()); + } + + Y_UNIT_TEST(InitWithoutTvmtool) { + NTvmTool::TClientSettings s("me"); + s.SetAuthToken(AUTH_TOKEN); + s.SetPort(0); + + UNIT_ASSERT_EXCEPTION_CONTAINS(TThreadedUpdater::Create(s, TDevNullLogger::IAmBrave()), + TNonRetriableException, + "can not connect to "); + } + + Y_UNIT_TEST(GetStatus) { + TNonInitedUpdater u("", 0, TDevNullLogger::IAmBrave()); + TMetaInfoProxy m(nullptr); + m.Config_ = std::make_shared<TMetaInfo::TConfig>(); + u.MetaInfo_ = m; + u.LastVisitForConfig_ = TInstant::Now(); + + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Error, u.GetStatus()); + u.SetUpdateTimeOfPublicKeys(TInstant::Now() - TDuration::Days(3)); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Warning, u.GetStatus()); + u.SetUpdateTimeOfPublicKeys(TInstant::Now() - TDuration::Hours(3)); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + + u.SetServiceTickets(new TServiceTickets({}, {}, {})); + + TMetaInfo::TConfig cfg; + cfg.DstAliases = {{"q", 1}, {"q2", 2}}; + m.Config_ = std::make_shared<TMetaInfo::TConfig>(cfg); + u.MetaInfo_ = m; + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Error, u.GetStatus()); + u.SetUpdateTimeOfServiceTickets(TInstant::Now() - TDuration::Hours(3)); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Error, u.GetStatus()); + + u.SetServiceTickets(MakeIntrusiveConst<TServiceTickets>( + TServiceTickets::TMapIdStr({{1, "3:serv:CBAQ__________9_IgYIKhCUkQY:CX"}, {2, "t"}}), + TServiceTickets::TMapIdStr({{3, "mega_error"}, {4, "error2"}}), + TServiceTickets::TMapAliasId({ + {"some_alias#1", 1}, + {"some_alias#2", 2}, + }))); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Warning, u.GetStatus()); + + const TInstant* inv = &u.GetCachedServiceTickets()->InvalidationTime; + *const_cast<TInstant*>(inv) = TInstant::Now() + TDuration::Hours(3); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Warning, u.GetStatus()); + + u.SetUpdateTimeOfServiceTickets(TInstant::Now() - TDuration::Minutes(3)); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u.GetStatus()); + + u.LastVisitForConfig_ = TInstant::Now() - TDuration::Minutes(1); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Warning, u.GetStatus()); + } + + Y_UNIT_TEST(multiNamesForDst) { + TPortManager pm; + ui16 port = pm.GetPort(80); + NMock::TMockServer server(port, []() { return new TTvmTool; }); + + NTvmTool::TClientSettings s("multi_names_for_dst"); + s.SetAuthToken(AUTH_TOKEN); + s.SetPort(port); + s.SetHostname("localhost"); + + auto l = MakeIntrusive<TLogger>(); + { + TAsyncUpdaterPtr u = TThreadedUpdater::Create(s, l); + UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, u->GetStatus()); + } + UNIT_ASSERT_VALUES_EQUAL( + TStringBuilder() + << "7: Meta info fetched from localhost:" << port << "\n" + << "6: Meta: self_tvm_id=100599, bb_env=ProdYateam, dsts=[(pass_haters:100502)(pass_likers:100502)]\n" + << "7: Tickets fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" + << "7: Public keys fetched from tvmtool: 2425-09-17T11:04:00.000000Z\n" + << "7: Thread-worker started\n" + << "7: Thread-worker stopped\n", + l->Stream.Str()); + } +} diff --git a/library/cpp/tvmauth/client/ut/utils_ut.cpp b/library/cpp/tvmauth/client/ut/utils_ut.cpp index e780fb2779..23ac35f416 100644 --- a/library/cpp/tvmauth/client/ut/utils_ut.cpp +++ b/library/cpp/tvmauth/client/ut/utils_ut.cpp @@ -1,88 +1,88 @@ -#include <library/cpp/tvmauth/client/misc/utils.h> - +#include <library/cpp/tvmauth/client/misc/utils.h> + #include <library/cpp/testing/unittest/registar.h> - -Y_UNIT_TEST_SUITE(UtilsTest) { - using namespace NTvmAuth; - - Y_UNIT_TEST(ParseDstMap) { - using TMap = NTvmAuth::NTvmApi::TClientSettings::TDstMap; - UNIT_ASSERT_EQUAL(TMap(), NUtils::ParseDstMap("")); - UNIT_ASSERT_EXCEPTION(NUtils::ParseDstMap(";"), TFromStringException); - UNIT_ASSERT_EXCEPTION(NUtils::ParseDstMap(":"), TFromStringException); - UNIT_ASSERT_EXCEPTION(NUtils::ParseDstMap("3;"), TFromStringException); - UNIT_ASSERT_EXCEPTION(NUtils::ParseDstMap("3:foo;"), TFromStringException); - - UNIT_ASSERT_EQUAL(TMap({ - {"foo", 3}, - }), - NUtils::ParseDstMap("foo:3")); - UNIT_ASSERT_EQUAL(TMap({ - {"foo", 3}, - {"bar", 17}, - }), - NUtils::ParseDstMap("foo:3;bar:17;")); - } - - Y_UNIT_TEST(ParseDstVector) { - using TVector = NTvmAuth::NTvmApi::TClientSettings::TDstVector; - UNIT_ASSERT_EQUAL(TVector(), NUtils::ParseDstVector("")); - UNIT_ASSERT_EXCEPTION_CONTAINS(NUtils::ParseDstVector(";"), - yexception, - "Cannot parse empty string as number"); - UNIT_ASSERT_EXCEPTION_CONTAINS(NUtils::ParseDstVector(":"), - yexception, - "Unexpected symbol"); - UNIT_ASSERT_EXCEPTION_CONTAINS(NUtils::ParseDstVector("3:foo;"), - yexception, - "Unexpected symbol"); - UNIT_ASSERT_EXCEPTION_CONTAINS(NUtils::ParseDstVector("foo:3;"), - yexception, - "Unexpected symbol"); - - UNIT_ASSERT_EQUAL(TVector(1, 3), - NUtils::ParseDstVector("3")); - UNIT_ASSERT_EQUAL(TVector({3, 17}), - NUtils::ParseDstVector("3;17;")); - } - - Y_UNIT_TEST(ToHex) { - UNIT_ASSERT_VALUES_EQUAL("", NUtils::ToHex("")); - UNIT_ASSERT_VALUES_EQUAL("61", NUtils::ToHex("a")); - UNIT_ASSERT_VALUES_EQUAL( - "6C6B787A6E7620736C6A6876627761656220", - NUtils::ToHex("lkxznv sljhvbwaeb ")); - } - - Y_UNIT_TEST(CheckBbEnvOverriding) { - UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Prod, EBlackboxEnv::Prod)); - UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Prod, EBlackboxEnv::ProdYateam)); - UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Prod, EBlackboxEnv::Test)); - UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Prod, EBlackboxEnv::TestYateam)); - UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Prod, EBlackboxEnv::Stress)); - - UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::ProdYateam, EBlackboxEnv::Prod)); - UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::ProdYateam, EBlackboxEnv::ProdYateam)); - UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::ProdYateam, EBlackboxEnv::Test)); - UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::ProdYateam, EBlackboxEnv::TestYateam)); - UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::ProdYateam, EBlackboxEnv::Stress)); - - UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Test, EBlackboxEnv::Prod)); - UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Test, EBlackboxEnv::ProdYateam)); - UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Test, EBlackboxEnv::Test)); - UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Test, EBlackboxEnv::TestYateam)); - UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Test, EBlackboxEnv::Stress)); - - UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::TestYateam, EBlackboxEnv::Prod)); - UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::TestYateam, EBlackboxEnv::ProdYateam)); - UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::TestYateam, EBlackboxEnv::Test)); - UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::TestYateam, EBlackboxEnv::TestYateam)); - UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::TestYateam, EBlackboxEnv::Stress)); - - UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Stress, EBlackboxEnv::Prod)); - UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Stress, EBlackboxEnv::ProdYateam)); - UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Stress, EBlackboxEnv::Test)); - UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Stress, EBlackboxEnv::TestYateam)); - UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Stress, EBlackboxEnv::Stress)); - } -} + +Y_UNIT_TEST_SUITE(UtilsTest) { + using namespace NTvmAuth; + + Y_UNIT_TEST(ParseDstMap) { + using TMap = NTvmAuth::NTvmApi::TClientSettings::TDstMap; + UNIT_ASSERT_EQUAL(TMap(), NUtils::ParseDstMap("")); + UNIT_ASSERT_EXCEPTION(NUtils::ParseDstMap(";"), TFromStringException); + UNIT_ASSERT_EXCEPTION(NUtils::ParseDstMap(":"), TFromStringException); + UNIT_ASSERT_EXCEPTION(NUtils::ParseDstMap("3;"), TFromStringException); + UNIT_ASSERT_EXCEPTION(NUtils::ParseDstMap("3:foo;"), TFromStringException); + + UNIT_ASSERT_EQUAL(TMap({ + {"foo", 3}, + }), + NUtils::ParseDstMap("foo:3")); + UNIT_ASSERT_EQUAL(TMap({ + {"foo", 3}, + {"bar", 17}, + }), + NUtils::ParseDstMap("foo:3;bar:17;")); + } + + Y_UNIT_TEST(ParseDstVector) { + using TVector = NTvmAuth::NTvmApi::TClientSettings::TDstVector; + UNIT_ASSERT_EQUAL(TVector(), NUtils::ParseDstVector("")); + UNIT_ASSERT_EXCEPTION_CONTAINS(NUtils::ParseDstVector(";"), + yexception, + "Cannot parse empty string as number"); + UNIT_ASSERT_EXCEPTION_CONTAINS(NUtils::ParseDstVector(":"), + yexception, + "Unexpected symbol"); + UNIT_ASSERT_EXCEPTION_CONTAINS(NUtils::ParseDstVector("3:foo;"), + yexception, + "Unexpected symbol"); + UNIT_ASSERT_EXCEPTION_CONTAINS(NUtils::ParseDstVector("foo:3;"), + yexception, + "Unexpected symbol"); + + UNIT_ASSERT_EQUAL(TVector(1, 3), + NUtils::ParseDstVector("3")); + UNIT_ASSERT_EQUAL(TVector({3, 17}), + NUtils::ParseDstVector("3;17;")); + } + + Y_UNIT_TEST(ToHex) { + UNIT_ASSERT_VALUES_EQUAL("", NUtils::ToHex("")); + UNIT_ASSERT_VALUES_EQUAL("61", NUtils::ToHex("a")); + UNIT_ASSERT_VALUES_EQUAL( + "6C6B787A6E7620736C6A6876627761656220", + NUtils::ToHex("lkxznv sljhvbwaeb ")); + } + + Y_UNIT_TEST(CheckBbEnvOverriding) { + UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Prod, EBlackboxEnv::Prod)); + UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Prod, EBlackboxEnv::ProdYateam)); + UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Prod, EBlackboxEnv::Test)); + UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Prod, EBlackboxEnv::TestYateam)); + UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Prod, EBlackboxEnv::Stress)); + + UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::ProdYateam, EBlackboxEnv::Prod)); + UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::ProdYateam, EBlackboxEnv::ProdYateam)); + UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::ProdYateam, EBlackboxEnv::Test)); + UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::ProdYateam, EBlackboxEnv::TestYateam)); + UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::ProdYateam, EBlackboxEnv::Stress)); + + UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Test, EBlackboxEnv::Prod)); + UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Test, EBlackboxEnv::ProdYateam)); + UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Test, EBlackboxEnv::Test)); + UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Test, EBlackboxEnv::TestYateam)); + UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Test, EBlackboxEnv::Stress)); + + UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::TestYateam, EBlackboxEnv::Prod)); + UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::TestYateam, EBlackboxEnv::ProdYateam)); + UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::TestYateam, EBlackboxEnv::Test)); + UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::TestYateam, EBlackboxEnv::TestYateam)); + UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::TestYateam, EBlackboxEnv::Stress)); + + UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Stress, EBlackboxEnv::Prod)); + UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Stress, EBlackboxEnv::ProdYateam)); + UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Stress, EBlackboxEnv::Test)); + UNIT_ASSERT(!NUtils::CheckBbEnvOverriding(EBlackboxEnv::Stress, EBlackboxEnv::TestYateam)); + UNIT_ASSERT(NUtils::CheckBbEnvOverriding(EBlackboxEnv::Stress, EBlackboxEnv::Stress)); + } +} diff --git a/library/cpp/tvmauth/client/ut/ya.make b/library/cpp/tvmauth/client/ut/ya.make index e2686cd8d7..20eef6acba 100644 --- a/library/cpp/tvmauth/client/ut/ya.make +++ b/library/cpp/tvmauth/client/ut/ya.make @@ -1,36 +1,36 @@ -UNITTEST_FOR(library/cpp/tvmauth/client) - -OWNER(g:passport_infra) - -DATA(arcadia/library/cpp/tvmauth/client/ut/files) - -PEERDIR( +UNITTEST_FOR(library/cpp/tvmauth/client) + +OWNER(g:passport_infra) + +DATA(arcadia/library/cpp/tvmauth/client/ut/files) + +PEERDIR( library/cpp/cgiparam - library/cpp/testing/mock_server -) - -SRCS( - async_updater_ut.cpp - checker_ut.cpp - client_status_ut.cpp - default_uid_checker_ut.cpp - disk_cache_ut.cpp - exponential_backoff_ut.cpp - facade_ut.cpp - last_error_ut.cpp - logger_ut.cpp - roles/decoder_ut.cpp - roles/entities_index_ut.cpp - roles/parser_ut.cpp - roles/roles_ut.cpp - roles/tvmapi_roles_fetcher_ut.cpp - settings_ut.cpp - src_checker_ut.cpp - tvmapi_updater_ut.cpp - tvmtool_updater_ut.cpp - utils_ut.cpp -) - + library/cpp/testing/mock_server +) + +SRCS( + async_updater_ut.cpp + checker_ut.cpp + client_status_ut.cpp + default_uid_checker_ut.cpp + disk_cache_ut.cpp + exponential_backoff_ut.cpp + facade_ut.cpp + last_error_ut.cpp + logger_ut.cpp + roles/decoder_ut.cpp + roles/entities_index_ut.cpp + roles/parser_ut.cpp + roles/roles_ut.cpp + roles/tvmapi_roles_fetcher_ut.cpp + settings_ut.cpp + src_checker_ut.cpp + tvmapi_updater_ut.cpp + tvmtool_updater_ut.cpp + utils_ut.cpp +) + REQUIREMENTS(ram:11) -END() +END() diff --git a/library/cpp/tvmauth/client/ya.make b/library/cpp/tvmauth/client/ya.make index 8ac4e56e01..c3986021b2 100644 --- a/library/cpp/tvmauth/client/ya.make +++ b/library/cpp/tvmauth/client/ya.make @@ -1,49 +1,49 @@ -LIBRARY() - -OWNER(g:passport_infra) - -PEERDIR( - library/cpp/http/simple - library/cpp/json - library/cpp/openssl/crypto - library/cpp/streams/brotli - library/cpp/streams/zstd - library/cpp/string_utils/quote - library/cpp/tvmauth - library/cpp/tvmauth/client/misc/retry_settings/v1 -) - -SRCS( - client_status.cpp - facade.cpp - logger.cpp - misc/api/roles_fetcher.cpp - misc/api/settings.cpp - misc/api/threaded_updater.cpp - misc/async_updater.cpp - misc/disk_cache.cpp - misc/last_error.cpp - misc/proc_info.cpp - misc/roles/decoder.cpp - misc/roles/entities_index.cpp - misc/roles/parser.cpp - misc/roles/roles.cpp - misc/threaded_updater.cpp - misc/tool/meta_info.cpp - misc/tool/settings.cpp - misc/tool/threaded_updater.cpp - misc/utils.cpp - mocked_updater.cpp -) - -GENERATE_ENUM_SERIALIZATION(client_status.h) -GENERATE_ENUM_SERIALIZATION(misc/async_updater.h) -GENERATE_ENUM_SERIALIZATION(misc/last_error.h) - -END() - -RECURSE_FOR_TESTS( - examples - misc/api/dynamic_dst - ut -) +LIBRARY() + +OWNER(g:passport_infra) + +PEERDIR( + library/cpp/http/simple + library/cpp/json + library/cpp/openssl/crypto + library/cpp/streams/brotli + library/cpp/streams/zstd + library/cpp/string_utils/quote + library/cpp/tvmauth + library/cpp/tvmauth/client/misc/retry_settings/v1 +) + +SRCS( + client_status.cpp + facade.cpp + logger.cpp + misc/api/roles_fetcher.cpp + misc/api/settings.cpp + misc/api/threaded_updater.cpp + misc/async_updater.cpp + misc/disk_cache.cpp + misc/last_error.cpp + misc/proc_info.cpp + misc/roles/decoder.cpp + misc/roles/entities_index.cpp + misc/roles/parser.cpp + misc/roles/roles.cpp + misc/threaded_updater.cpp + misc/tool/meta_info.cpp + misc/tool/settings.cpp + misc/tool/threaded_updater.cpp + misc/utils.cpp + mocked_updater.cpp +) + +GENERATE_ENUM_SERIALIZATION(client_status.h) +GENERATE_ENUM_SERIALIZATION(misc/async_updater.h) +GENERATE_ENUM_SERIALIZATION(misc/last_error.h) + +END() + +RECURSE_FOR_TESTS( + examples + misc/api/dynamic_dst + ut +) diff --git a/library/cpp/tvmauth/deprecated/README.md b/library/cpp/tvmauth/deprecated/README.md index d9ea09c3c0..fffea3ae77 100644 --- a/library/cpp/tvmauth/deprecated/README.md +++ b/library/cpp/tvmauth/deprecated/README.md @@ -1,2 +1,2 @@ -Please don't use this part of library directly. -Please use [TTvmClient](https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/tvmauth/README.md) instead. +Please don't use this part of library directly. +Please use [TTvmClient](https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/tvmauth/README.md) instead. diff --git a/library/cpp/tvmauth/deprecated/service_context.cpp b/library/cpp/tvmauth/deprecated/service_context.cpp index 24822a9d53..e0976de0a6 100644 --- a/library/cpp/tvmauth/deprecated/service_context.cpp +++ b/library/cpp/tvmauth/deprecated/service_context.cpp @@ -1,37 +1,37 @@ -#include <library/cpp/tvmauth/checked_service_ticket.h> -#include <library/cpp/tvmauth/src/service_impl.h> - -namespace NTvmAuth { - static const char* EX_MSG = "ServiceContext already moved out"; - - TServiceContext::TServiceContext(TStringBuf secretBase64, TTvmId selfTvmId, TStringBuf tvmKeysResponse) - : Impl_(MakeHolder<TImpl>(secretBase64, selfTvmId, tvmKeysResponse)) - { - } - - TServiceContext::TServiceContext(TServiceContext&& o) = default; - TServiceContext& TServiceContext::operator=(TServiceContext&& o) = default; - TServiceContext::~TServiceContext() = default; - - TServiceContext TServiceContext::CheckingFactory(TTvmId selfTvmId, TStringBuf tvmKeysResponse) { - TServiceContext c; - c.Impl_ = MakeHolder<TImpl>(selfTvmId, tvmKeysResponse); - return c; - } - - TServiceContext TServiceContext::SigningFactory(TStringBuf secretBase64) { - TServiceContext c; - c.Impl_ = MakeHolder<TImpl>(secretBase64); - return c; - } - - TCheckedServiceTicket TServiceContext::Check(TStringBuf ticketBody) const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->Check(ticketBody); - } - - TString TServiceContext::SignCgiParamsForTvm(TStringBuf ts, TStringBuf dst, TStringBuf scopes) const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->SignCgiParamsForTvm(ts, dst, scopes); - } -} +#include <library/cpp/tvmauth/checked_service_ticket.h> +#include <library/cpp/tvmauth/src/service_impl.h> + +namespace NTvmAuth { + static const char* EX_MSG = "ServiceContext already moved out"; + + TServiceContext::TServiceContext(TStringBuf secretBase64, TTvmId selfTvmId, TStringBuf tvmKeysResponse) + : Impl_(MakeHolder<TImpl>(secretBase64, selfTvmId, tvmKeysResponse)) + { + } + + TServiceContext::TServiceContext(TServiceContext&& o) = default; + TServiceContext& TServiceContext::operator=(TServiceContext&& o) = default; + TServiceContext::~TServiceContext() = default; + + TServiceContext TServiceContext::CheckingFactory(TTvmId selfTvmId, TStringBuf tvmKeysResponse) { + TServiceContext c; + c.Impl_ = MakeHolder<TImpl>(selfTvmId, tvmKeysResponse); + return c; + } + + TServiceContext TServiceContext::SigningFactory(TStringBuf secretBase64) { + TServiceContext c; + c.Impl_ = MakeHolder<TImpl>(secretBase64); + return c; + } + + TCheckedServiceTicket TServiceContext::Check(TStringBuf ticketBody) const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->Check(ticketBody); + } + + TString TServiceContext::SignCgiParamsForTvm(TStringBuf ts, TStringBuf dst, TStringBuf scopes) const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->SignCgiParamsForTvm(ts, dst, scopes); + } +} diff --git a/library/cpp/tvmauth/deprecated/service_context.h b/library/cpp/tvmauth/deprecated/service_context.h index bc14d381b2..5dc836261b 100644 --- a/library/cpp/tvmauth/deprecated/service_context.h +++ b/library/cpp/tvmauth/deprecated/service_context.h @@ -1,63 +1,63 @@ -#pragma once - -#include <library/cpp/tvmauth/checked_service_ticket.h> - -#include <util/generic/ptr.h> - -namespace NTvmAuth { - class TServiceContext: public TAtomicRefCount<TServiceContext> { - public: - /*! - * Create service context. Serivce contexts are used to store TVM keys and parse service tickets. - * @param selfTvmId - * @param secretBase64 - * @param tvmKeysResponse - */ - TServiceContext(TStringBuf secretBase64, TTvmId selfTvmId, TStringBuf tvmKeysResponse); - TServiceContext(TServiceContext&&); - ~TServiceContext(); - - /*! - * Create service context only for checking service tickets - * \param[in] selfTvmId - * \param[in] tvmKeysResponse - * \return - */ - static TServiceContext CheckingFactory(TTvmId selfTvmId, TStringBuf tvmKeysResponse); - - /*! - * Create service context only for signing HTTP request to TVM-API - * \param[in] secretBase64 - * \return - */ - static TServiceContext SigningFactory(TStringBuf secretBase64); - - TServiceContext& operator=(TServiceContext&&); - - /*! - * Parse and validate service ticket body then create TCheckedServiceTicket object. - * @param ticketBody - * @return TCheckedServiceTicket object - */ - TCheckedServiceTicket Check(TStringBuf ticketBody) const; - - /*! - * Sign params for TVM API - * @param ts Param 'ts' of request to TVM - * @param dst Param 'dst' of request to TVM - * @param scopes Param 'scopes' of request to TVM - * @return Signed string - */ - TString SignCgiParamsForTvm(TStringBuf ts, TStringBuf dst, TStringBuf scopes = TStringBuf()) const; - - class TImpl; - - private: - TServiceContext() = default; - - private: - THolder<TImpl> Impl_; - }; - - using TServiceContextPtr = TIntrusiveConstPtr<TServiceContext>; -} +#pragma once + +#include <library/cpp/tvmauth/checked_service_ticket.h> + +#include <util/generic/ptr.h> + +namespace NTvmAuth { + class TServiceContext: public TAtomicRefCount<TServiceContext> { + public: + /*! + * Create service context. Serivce contexts are used to store TVM keys and parse service tickets. + * @param selfTvmId + * @param secretBase64 + * @param tvmKeysResponse + */ + TServiceContext(TStringBuf secretBase64, TTvmId selfTvmId, TStringBuf tvmKeysResponse); + TServiceContext(TServiceContext&&); + ~TServiceContext(); + + /*! + * Create service context only for checking service tickets + * \param[in] selfTvmId + * \param[in] tvmKeysResponse + * \return + */ + static TServiceContext CheckingFactory(TTvmId selfTvmId, TStringBuf tvmKeysResponse); + + /*! + * Create service context only for signing HTTP request to TVM-API + * \param[in] secretBase64 + * \return + */ + static TServiceContext SigningFactory(TStringBuf secretBase64); + + TServiceContext& operator=(TServiceContext&&); + + /*! + * Parse and validate service ticket body then create TCheckedServiceTicket object. + * @param ticketBody + * @return TCheckedServiceTicket object + */ + TCheckedServiceTicket Check(TStringBuf ticketBody) const; + + /*! + * Sign params for TVM API + * @param ts Param 'ts' of request to TVM + * @param dst Param 'dst' of request to TVM + * @param scopes Param 'scopes' of request to TVM + * @return Signed string + */ + TString SignCgiParamsForTvm(TStringBuf ts, TStringBuf dst, TStringBuf scopes = TStringBuf()) const; + + class TImpl; + + private: + TServiceContext() = default; + + private: + THolder<TImpl> Impl_; + }; + + using TServiceContextPtr = TIntrusiveConstPtr<TServiceContext>; +} diff --git a/library/cpp/tvmauth/deprecated/user_context.cpp b/library/cpp/tvmauth/deprecated/user_context.cpp index 712f622f1a..5ff7714db5 100644 --- a/library/cpp/tvmauth/deprecated/user_context.cpp +++ b/library/cpp/tvmauth/deprecated/user_context.cpp @@ -1,20 +1,20 @@ -#include <library/cpp/tvmauth/checked_user_ticket.h> -#include <library/cpp/tvmauth/src/user_impl.h> - -namespace NTvmAuth { - static const char* EX_MSG = "UserContext already moved out"; - - TUserContext::TUserContext(EBlackboxEnv env, TStringBuf tvmKeysResponse) - : Impl_(MakeHolder<TImpl>(env, tvmKeysResponse)) - { - } - - TUserContext::TUserContext(TUserContext&& o) = default; - TUserContext& TUserContext::operator=(TUserContext&& o) = default; - TUserContext::~TUserContext() = default; - - TCheckedUserTicket TUserContext::Check(TStringBuf ticketBody) const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->Check(ticketBody); - } -} +#include <library/cpp/tvmauth/checked_user_ticket.h> +#include <library/cpp/tvmauth/src/user_impl.h> + +namespace NTvmAuth { + static const char* EX_MSG = "UserContext already moved out"; + + TUserContext::TUserContext(EBlackboxEnv env, TStringBuf tvmKeysResponse) + : Impl_(MakeHolder<TImpl>(env, tvmKeysResponse)) + { + } + + TUserContext::TUserContext(TUserContext&& o) = default; + TUserContext& TUserContext::operator=(TUserContext&& o) = default; + TUserContext::~TUserContext() = default; + + TCheckedUserTicket TUserContext::Check(TStringBuf ticketBody) const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->Check(ticketBody); + } +} diff --git a/library/cpp/tvmauth/deprecated/user_context.h b/library/cpp/tvmauth/deprecated/user_context.h index f7fe67d02e..3b2503b9b1 100644 --- a/library/cpp/tvmauth/deprecated/user_context.h +++ b/library/cpp/tvmauth/deprecated/user_context.h @@ -1,30 +1,30 @@ -#pragma once - -#include <library/cpp/tvmauth/checked_user_ticket.h> - -#include <util/generic/ptr.h> - -namespace NTvmAuth { - class TUserContext: public TAtomicRefCount<TUserContext> { - public: - TUserContext(EBlackboxEnv env, TStringBuf tvmKeysResponse); - TUserContext(TUserContext&&); - ~TUserContext(); - - TUserContext& operator=(TUserContext&&); - - /*! - * Parse and validate user ticket body then create TCheckedUserTicket object. - * @param ticketBody - * @return TCheckedUserTicket object - */ - TCheckedUserTicket Check(TStringBuf ticketBody) const; - - class TImpl; - - private: - THolder<TImpl> Impl_; - }; - - using TUserContextPtr = TIntrusiveConstPtr<TUserContext>; -} +#pragma once + +#include <library/cpp/tvmauth/checked_user_ticket.h> + +#include <util/generic/ptr.h> + +namespace NTvmAuth { + class TUserContext: public TAtomicRefCount<TUserContext> { + public: + TUserContext(EBlackboxEnv env, TStringBuf tvmKeysResponse); + TUserContext(TUserContext&&); + ~TUserContext(); + + TUserContext& operator=(TUserContext&&); + + /*! + * Parse and validate user ticket body then create TCheckedUserTicket object. + * @param ticketBody + * @return TCheckedUserTicket object + */ + TCheckedUserTicket Check(TStringBuf ticketBody) const; + + class TImpl; + + private: + THolder<TImpl> Impl_; + }; + + using TUserContextPtr = TIntrusiveConstPtr<TUserContext>; +} diff --git a/library/cpp/tvmauth/exception.h b/library/cpp/tvmauth/exception.h index f528886b95..d59f03205a 100644 --- a/library/cpp/tvmauth/exception.h +++ b/library/cpp/tvmauth/exception.h @@ -4,7 +4,7 @@ #include <exception> -namespace NTvmAuth { +namespace NTvmAuth { class TTvmException: public yexception { }; class TContextException: public TTvmException { @@ -17,4 +17,4 @@ namespace NTvmAuth { }; class TNotAllowedException: public TTvmException { }; -} +} diff --git a/library/cpp/tvmauth/src/parser.cpp b/library/cpp/tvmauth/src/parser.cpp index 358de58d36..b91b96bf3b 100644 --- a/library/cpp/tvmauth/src/parser.cpp +++ b/library/cpp/tvmauth/src/parser.cpp @@ -2,26 +2,26 @@ #include "utils.h" -#include <library/cpp/tvmauth/exception.h> +#include <library/cpp/tvmauth/exception.h> #include <util/generic/strbuf.h> #include <util/string/split.h> #include <ctime> -namespace NTvmAuth { +namespace NTvmAuth { TString TParserTvmKeys::ParseStrV1(TStringBuf str) { while (str && str.back() == '\n') { str.Chop(1); } - TStringBuf ver = str.NextTok(DELIM); + TStringBuf ver = str.NextTok(DELIM); if (!str || !ver || ver != "1") { - throw TMalformedTvmKeysException() << "Malformed TVM keys"; + throw TMalformedTvmKeysException() << "Malformed TVM keys"; } TString res = NUtils::Base64url2bin(str); if (res.empty()) { - throw TMalformedTvmKeysException() << "Malformed TVM keys"; + throw TMalformedTvmKeysException() << "Malformed TVM keys"; } return res; } @@ -39,25 +39,25 @@ namespace NTvmAuth { TParserTickets::TRes TParserTickets::ParseV3(TStringBuf body, const NRw::TPublicKeys& keys, TStringBuf type) { TStrRes str = ParseStrV3(body, type); TRes res(str.Status); - if (str.Status != ETicketStatus::Ok) { + if (str.Status != ETicketStatus::Ok) { return TRes(str.Status); } if (!res.Ticket.ParseFromString(str.Proto)) { - res.Status = ETicketStatus::Malformed; + res.Status = ETicketStatus::Malformed; return res; } if (res.Ticket.expirationtime() <= time(nullptr)) { - res.Status = ETicketStatus::Expired; + res.Status = ETicketStatus::Expired; return res; } auto itKey = keys.find(res.Ticket.keyid()); if (itKey == keys.end()) { - res.Status = ETicketStatus::MissingKey; + res.Status = ETicketStatus::MissingKey; return res; } if (!itKey->second.CheckSign(str.ForCheck, str.Sign)) { - res.Status = ETicketStatus::SignBroken; + res.Status = ETicketStatus::SignBroken; return res; } return res; @@ -66,32 +66,32 @@ namespace NTvmAuth { TParserTickets::TStrRes TParserTickets::ParseStrV3(TStringBuf body, TStringBuf type) { TStringBuf forCheck = body; TStringBuf version = body.NextTok(DELIM); - if (!body || version.size() != 1) { - return {ETicketStatus::Malformed, {}, {}, {}}; - } + if (!body || version.size() != 1) { + return {ETicketStatus::Malformed, {}, {}, {}}; + } if (version != "3") { - return {ETicketStatus::UnsupportedVersion, {}, {}, {}}; + return {ETicketStatus::UnsupportedVersion, {}, {}, {}}; } TStringBuf ticketType = body.NextTok(DELIM); if (ticketType != type) { - return {ETicketStatus::InvalidTicketType, {}, {}, {}}; + return {ETicketStatus::InvalidTicketType, {}, {}, {}}; } TStringBuf proto = body.NextTok(DELIM); TStringBuf sign = body.NextTok(DELIM); if (!proto || !sign || body.size() > 0) { - return {ETicketStatus::Malformed, {}, {}, {}}; + return {ETicketStatus::Malformed, {}, {}, {}}; } TString protoBin = NUtils::Base64url2bin(proto); TString signBin = NUtils::Base64url2bin(sign); if (!protoBin || !signBin) { - return {ETicketStatus::Malformed, {}, {}, {}}; + return {ETicketStatus::Malformed, {}, {}, {}}; } - return {ETicketStatus::Ok, std::move(protoBin), std::move(signBin), forCheck.Chop(sign.size())}; + return {ETicketStatus::Ok, std::move(protoBin), std::move(signBin), forCheck.Chop(sign.size())}; } -} +} diff --git a/library/cpp/tvmauth/src/parser.h b/library/cpp/tvmauth/src/parser.h index 678e709444..5424ff1f3a 100644 --- a/library/cpp/tvmauth/src/parser.h +++ b/library/cpp/tvmauth/src/parser.h @@ -1,17 +1,17 @@ #pragma once -#include <library/cpp/tvmauth/src/protos/ticket2.pb.h> -#include <library/cpp/tvmauth/src/rw/keys.h> +#include <library/cpp/tvmauth/src/protos/ticket2.pb.h> +#include <library/cpp/tvmauth/src/rw/keys.h> -#include <library/cpp/tvmauth/ticket_status.h> +#include <library/cpp/tvmauth/ticket_status.h> #include <util/generic/fwd.h> #include <string> -namespace NTvmAuth { +namespace NTvmAuth { struct TParserTvmKeys { - static inline const char DELIM = ':'; + static inline const char DELIM = ':'; static TString ParseStrV1(TStringBuf str); }; @@ -22,12 +22,12 @@ namespace NTvmAuth { static TStringBuf ServiceFlag(); struct TRes { - TRes(ETicketStatus status) + TRes(ETicketStatus status) : Status(status) { } - ETicketStatus Status; + ETicketStatus Status; ticket2::Ticket Ticket; }; @@ -35,7 +35,7 @@ namespace NTvmAuth { // private: struct TStrRes { - const ETicketStatus Status; + const ETicketStatus Status; TString Proto; TString Sign; @@ -48,4 +48,4 @@ namespace NTvmAuth { }; static TStrRes ParseStrV3(TStringBuf body, TStringBuf type); }; -} +} diff --git a/library/cpp/tvmauth/src/protos/ticket2.proto b/library/cpp/tvmauth/src/protos/ticket2.proto index 66c00a7d01..97faf48a4f 100644 --- a/library/cpp/tvmauth/src/protos/ticket2.proto +++ b/library/cpp/tvmauth/src/protos/ticket2.proto @@ -1,8 +1,8 @@ package ticket2; -option go_package = "a.yandex-team.ru/library/cpp/tvmauth/src/protos"; - -import "library/cpp/tvmauth/src/protos/tvm_keys.proto"; +option go_package = "a.yandex-team.ru/library/cpp/tvmauth/src/protos"; + +import "library/cpp/tvmauth/src/protos/tvm_keys.proto"; message User { required uint64 uid = 1; diff --git a/library/cpp/tvmauth/src/protos/tvm_keys.proto b/library/cpp/tvmauth/src/protos/tvm_keys.proto index 9ba42dbf80..5c85fd2a70 100644 --- a/library/cpp/tvmauth/src/protos/tvm_keys.proto +++ b/library/cpp/tvmauth/src/protos/tvm_keys.proto @@ -1,9 +1,9 @@ package tvm_keys; -option go_package = "a.yandex-team.ru/library/cpp/tvmauth/src/protos"; - +option go_package = "a.yandex-team.ru/library/cpp/tvmauth/src/protos"; + enum KeyType { - RabinWilliams = 0; + RabinWilliams = 0; } enum BbEnvType { diff --git a/library/cpp/tvmauth/src/protos/ya.make b/library/cpp/tvmauth/src/protos/ya.make index c2d579dc40..78d7c812af 100644 --- a/library/cpp/tvmauth/src/protos/ya.make +++ b/library/cpp/tvmauth/src/protos/ya.make @@ -1,9 +1,9 @@ PROTO_LIBRARY() -OWNER(g:passport_infra) - -INCLUDE_TAGS(GO_PROTO) +OWNER(g:passport_infra) +INCLUDE_TAGS(GO_PROTO) + SRCS( ticket2.proto tvm_keys.proto diff --git a/library/cpp/tvmauth/src/rw/keys.cpp b/library/cpp/tvmauth/src/rw/keys.cpp index 5395287f5c..d37587c451 100644 --- a/library/cpp/tvmauth/src/rw/keys.cpp +++ b/library/cpp/tvmauth/src/rw/keys.cpp @@ -2,137 +2,137 @@ #include "rw.h" -#include <library/cpp/openssl/init/init.h> - +#include <library/cpp/openssl/init/init.h> + #include <contrib/libs/openssl/include/openssl/evp.h> #include <util/generic/strbuf.h> -#include <util/generic/yexception.h> - -namespace { - struct TInit { - TInit() { - InitOpenSSL(); - } - } INIT; -} - -namespace NTvmAuth { +#include <util/generic/yexception.h> + +namespace { + struct TInit { + TInit() { + InitOpenSSL(); + } + } INIT; +} + +namespace NTvmAuth { namespace NRw { - namespace NPrivate { - void TRwDestroyer::Destroy(TRwInternal* o) { - RwFree(o); - } - - class TArrayDestroyer { - public: - static void Destroy(unsigned char* o) { - free(o); - } - }; - } - - static TString SerializeRW(TRwKey* rw, int (*func)(const TRwKey*, unsigned char**)) { + namespace NPrivate { + void TRwDestroyer::Destroy(TRwInternal* o) { + RwFree(o); + } + + class TArrayDestroyer { + public: + static void Destroy(unsigned char* o) { + free(o); + } + }; + } + + static TString SerializeRW(TRwKey* rw, int (*func)(const TRwKey*, unsigned char**)) { unsigned char* buf = nullptr; int size = func(rw, &buf); - THolder<unsigned char, NPrivate::TArrayDestroyer> guard(buf); + THolder<unsigned char, NPrivate::TArrayDestroyer> guard(buf); return TString((char*)buf, size); } - TKeyPair GenKeyPair(size_t size) { - TRw rw(RwNew()); - RwGenerateKey(rw.Get(), size); - - TRw skey(RwPrivateKeyDup(rw.Get())); - TRw vkey(RwPublicKeyDup(rw.Get())); - - TKeyPair res; - res.Private = SerializeRW(skey.Get(), &i2d_RWPrivateKey); - res.Public = SerializeRW(vkey.Get(), &i2d_RWPublicKey); - - TRwPrivateKey prKey(res.Private, 0); - TRwPublicKey pubKey(res.Public); - - const TStringBuf msg = "Test test test test test"; - - Y_ENSURE(pubKey.CheckSign(msg, prKey.SignTicket(msg)), "Failed to gen keys"); - - return res; + TKeyPair GenKeyPair(size_t size) { + TRw rw(RwNew()); + RwGenerateKey(rw.Get(), size); + + TRw skey(RwPrivateKeyDup(rw.Get())); + TRw vkey(RwPublicKeyDup(rw.Get())); + + TKeyPair res; + res.Private = SerializeRW(skey.Get(), &i2d_RWPrivateKey); + res.Public = SerializeRW(vkey.Get(), &i2d_RWPublicKey); + + TRwPrivateKey prKey(res.Private, 0); + TRwPublicKey pubKey(res.Public); + + const TStringBuf msg = "Test test test test test"; + + Y_ENSURE(pubKey.CheckSign(msg, prKey.SignTicket(msg)), "Failed to gen keys"); + + return res; } TRwPrivateKey::TRwPrivateKey(TStringBuf body, TKeyId id) - : Id_(id) - , Rw_(Deserialize(body)) - , SignLen_(RwModSize(Rw_.Get())) + : Id_(id) + , Rw_(Deserialize(body)) + , SignLen_(RwModSize(Rw_.Get())) { - Y_ENSURE(SignLen_ > 0, "Private key has bad len: " << SignLen_); + Y_ENSURE(SignLen_ > 0, "Private key has bad len: " << SignLen_); } TKeyId TRwPrivateKey::GetId() const { - return Id_; + return Id_; } TString TRwPrivateKey::SignTicket(TStringBuf ticket) const { - TString res(SignLen_, 0x00); - - int len = RwPssrSignMsg(ticket.size(), - (const unsigned char*)ticket.data(), - (unsigned char*)res.data(), - Rw_.Get(), - (EVP_MD*)EVP_sha256()); - - Y_ENSURE(len > 0 && len <= SignLen_, "Signing failed. len: " << len); - - res.resize(len); - return res; + TString res(SignLen_, 0x00); + + int len = RwPssrSignMsg(ticket.size(), + (const unsigned char*)ticket.data(), + (unsigned char*)res.data(), + Rw_.Get(), + (EVP_MD*)EVP_sha256()); + + Y_ENSURE(len > 0 && len <= SignLen_, "Signing failed. len: " << len); + + res.resize(len); + return res; } TRw TRwPrivateKey::Deserialize(TStringBuf key) { - TRwKey* rw = nullptr; + TRwKey* rw = nullptr; auto data = reinterpret_cast<const unsigned char*>(key.data()); if (!d2i_RWPrivateKey(&rw, &data, key.size())) { - ythrow yexception() << "Private key is malformed"; + ythrow yexception() << "Private key is malformed"; } - return TRw(rw); + return TRw(rw); } TRwPublicKey::TRwPublicKey(TStringBuf body) - : Rw_(Deserialize(body)) + : Rw_(Deserialize(body)) { } bool TRwPublicKey::CheckSign(TStringBuf ticket, TStringBuf sign) const { - int result = RwPssrVerifyMsg(ticket.size(), - (const unsigned char*)ticket.data(), - (unsigned char*)sign.data(), - sign.size(), - Rw_.Get(), - (EVP_MD*)EVP_sha256()); - - Y_ENSURE(result >= 0, "Failed to check sign: " << result); + int result = RwPssrVerifyMsg(ticket.size(), + (const unsigned char*)ticket.data(), + (unsigned char*)sign.data(), + sign.size(), + Rw_.Get(), + (EVP_MD*)EVP_sha256()); + + Y_ENSURE(result >= 0, "Failed to check sign: " << result); return result; } TRw TRwPublicKey::Deserialize(TStringBuf key) { - TRwKey* rw = nullptr; + TRwKey* rw = nullptr; auto data = reinterpret_cast<const unsigned char*>(key.data()); - auto status = d2i_RWPublicKey(&rw, &data, key.size()); - - TRw res(rw); - Y_ENSURE(status, "Public key is malformed: " << key); - return res; - } - - TSecureHeap::TSecureHeap(size_t totalSize, int minChunkSize) { - CRYPTO_secure_malloc_init(totalSize, minChunkSize); - } - - TSecureHeap::~TSecureHeap() { - CRYPTO_secure_malloc_done(); - } - - void TSecureHeap::Init(size_t totalSize, int minChunkSize) { - Singleton<TSecureHeap>(totalSize, minChunkSize); + auto status = d2i_RWPublicKey(&rw, &data, key.size()); + + TRw res(rw); + Y_ENSURE(status, "Public key is malformed: " << key); + return res; } + + TSecureHeap::TSecureHeap(size_t totalSize, int minChunkSize) { + CRYPTO_secure_malloc_init(totalSize, minChunkSize); + } + + TSecureHeap::~TSecureHeap() { + CRYPTO_secure_malloc_done(); + } + + void TSecureHeap::Init(size_t totalSize, int minChunkSize) { + Singleton<TSecureHeap>(totalSize, minChunkSize); + } } } diff --git a/library/cpp/tvmauth/src/rw/keys.h b/library/cpp/tvmauth/src/rw/keys.h index e02b7e72a1..1070b78358 100644 --- a/library/cpp/tvmauth/src/rw/keys.h +++ b/library/cpp/tvmauth/src/rw/keys.h @@ -1,29 +1,29 @@ #pragma once -#include <util/generic/ptr.h> -#include <util/generic/string.h> +#include <util/generic/ptr.h> +#include <util/generic/string.h> #include <unordered_map> -struct TRwInternal; +struct TRwInternal; -namespace NTvmAuth { +namespace NTvmAuth { namespace NRw { - namespace NPrivate { - class TRwDestroyer { - public: - static void Destroy(TRwInternal* o); - }; - } - - using TRw = THolder<TRwInternal, NPrivate::TRwDestroyer>; - using TKeyId = ui32; - + namespace NPrivate { + class TRwDestroyer { + public: + static void Destroy(TRwInternal* o); + }; + } + + using TRw = THolder<TRwInternal, NPrivate::TRwDestroyer>; + using TKeyId = ui32; + struct TKeyPair { - TString Private; - TString Public; + TString Private; + TString Public; }; - TKeyPair GenKeyPair(size_t size); + TKeyPair GenKeyPair(size_t size); class TRwPrivateKey { public: @@ -35,9 +35,9 @@ namespace NTvmAuth { private: static TRw Deserialize(TStringBuf key); - TKeyId Id_; - TRw Rw_; - int SignLen_; + TKeyId Id_; + TRw Rw_; + int SignLen_; }; class TRwPublicKey { @@ -49,17 +49,17 @@ namespace NTvmAuth { private: static TRw Deserialize(TStringBuf key); - TRw Rw_; + TRw Rw_; }; using TPublicKeys = std::unordered_map<TKeyId, TRwPublicKey>; - - class TSecureHeap { - public: - TSecureHeap(size_t totalSize, int minChunkSize); - ~TSecureHeap(); - - static void Init(size_t totalSize = 16 * 1024 * 1024, int minChunkSize = 16); - }; + + class TSecureHeap { + public: + TSecureHeap(size_t totalSize, int minChunkSize); + ~TSecureHeap(); + + static void Init(size_t totalSize = 16 * 1024 * 1024, int minChunkSize = 16); + }; } } diff --git a/library/cpp/tvmauth/src/rw/rw.h b/library/cpp/tvmauth/src/rw/rw.h index cbff96b85d..1f8805dab3 100644 --- a/library/cpp/tvmauth/src/rw/rw.h +++ b/library/cpp/tvmauth/src/rw/rw.h @@ -7,79 +7,79 @@ extern "C" { #endif - typedef struct { - BIGNUM* S; - } TRwSignature; - - /*Rabin–Williams*/ - typedef struct TRwInternal TRwKey; - - typedef struct { - TRwSignature* (*RwSign)(const unsigned char* dgst, const int dlen, TRwKey* rw); - int (*RwVerify)(const unsigned char* dgst, int dgst_len, TRwSignature* sig, const TRwKey* rw); - int (*RwApply)(BIGNUM* r, BIGNUM* x, BN_CTX* ctx, const TRwKey* rw); - } TRwMethod; - - struct TRwInternal { - /* first private multiplier */ - BIGNUM* P; - /* second private multiplier */ - BIGNUM* Q; - /* n = p*q - RW modulus */ - BIGNUM* N; - /* precomputed 2^((3q-5)/8) mod q */ - BIGNUM* Twomq; - /* precomputed 2^((9p-11)/8) mod p*/ - BIGNUM* Twomp; - /* precomputed q^(p-2) == q^(-1) mod p */ - BIGNUM* Iqmp; - /* (q+1) / 8 */ - BIGNUM* Dq; - /* (p-3) / 8 */ - BIGNUM* Dp; - /* functions for working with RW */ - const TRwMethod* Meth; - }; - - TRwSignature* RwSignatureNew(void); - void RwSignatureFree(TRwSignature* a); - - /* RW signing functions */ - /* the function can put some tmp values to rw */ - int RwPssrSignHash(const unsigned char* from, unsigned char* to, TRwKey* rw, const EVP_MD* md); - int RwPssrSignMsg(const int msgLen, const unsigned char* msg, unsigned char* to, TRwKey* rw, const EVP_MD* md); - - /* RW-PSS verification functions */ - int RwPssrVerifyHash(const unsigned char* from, const unsigned char* sig, const int sig_len, const TRwKey* rw, const EVP_MD* md); - int RwPssrVerifyMsg(const int msgLen, const unsigned char* msg, const unsigned char* sig, const int sig_len, const TRwKey* rw, const EVP_MD* md); - - /* internal functions, use them only if you know what you're doing */ - int RwNoPaddingSign(int flen, const unsigned char* from, unsigned char* to, TRwKey* rw); - int RwApply(const int flen, const unsigned char* from, unsigned char* to, const TRwKey* rw); - - const TRwMethod* RwDefaultMethods(void); - - TRwKey* RwNew(void); - void RwFree(TRwKey* r); - int RwSize(const TRwKey* rw); - int RwModSize(const TRwKey* rw); - - TRwKey* RwPublicKeyDup(TRwKey* rw); - TRwKey* RwPrivateKeyDup(TRwKey* rw); - - // NOLINTNEXTLINE(readability-identifier-naming) - TRwKey* d2i_RWPublicKey(TRwKey** a, const unsigned char** pp, long length); - // NOLINTNEXTLINE(readability-identifier-naming) - TRwKey* d2i_RWPrivateKey(TRwKey** a, const unsigned char** pp, long length); - - int RwGenerateKey(TRwKey* a, int bits); - // NOLINTNEXTLINE(readability-identifier-naming) - int i2d_RWPublicKey(const TRwKey* a, unsigned char** pp); - // NOLINTNEXTLINE(readability-identifier-naming) - int i2d_RWPrivateKey(const TRwKey* a, unsigned char** pp); - - int RwPaddingAddPssr(const TRwKey* rw, unsigned char* EM, const unsigned char* mHash, const EVP_MD* Hash, int sLen); - int RwVerifyPssr(const TRwKey* rw, const unsigned char* mHash, const EVP_MD* Hash, const unsigned char* EM, int sLen); + typedef struct { + BIGNUM* S; + } TRwSignature; + + /*Rabin–Williams*/ + typedef struct TRwInternal TRwKey; + + typedef struct { + TRwSignature* (*RwSign)(const unsigned char* dgst, const int dlen, TRwKey* rw); + int (*RwVerify)(const unsigned char* dgst, int dgst_len, TRwSignature* sig, const TRwKey* rw); + int (*RwApply)(BIGNUM* r, BIGNUM* x, BN_CTX* ctx, const TRwKey* rw); + } TRwMethod; + + struct TRwInternal { + /* first private multiplier */ + BIGNUM* P; + /* second private multiplier */ + BIGNUM* Q; + /* n = p*q - RW modulus */ + BIGNUM* N; + /* precomputed 2^((3q-5)/8) mod q */ + BIGNUM* Twomq; + /* precomputed 2^((9p-11)/8) mod p*/ + BIGNUM* Twomp; + /* precomputed q^(p-2) == q^(-1) mod p */ + BIGNUM* Iqmp; + /* (q+1) / 8 */ + BIGNUM* Dq; + /* (p-3) / 8 */ + BIGNUM* Dp; + /* functions for working with RW */ + const TRwMethod* Meth; + }; + + TRwSignature* RwSignatureNew(void); + void RwSignatureFree(TRwSignature* a); + + /* RW signing functions */ + /* the function can put some tmp values to rw */ + int RwPssrSignHash(const unsigned char* from, unsigned char* to, TRwKey* rw, const EVP_MD* md); + int RwPssrSignMsg(const int msgLen, const unsigned char* msg, unsigned char* to, TRwKey* rw, const EVP_MD* md); + + /* RW-PSS verification functions */ + int RwPssrVerifyHash(const unsigned char* from, const unsigned char* sig, const int sig_len, const TRwKey* rw, const EVP_MD* md); + int RwPssrVerifyMsg(const int msgLen, const unsigned char* msg, const unsigned char* sig, const int sig_len, const TRwKey* rw, const EVP_MD* md); + + /* internal functions, use them only if you know what you're doing */ + int RwNoPaddingSign(int flen, const unsigned char* from, unsigned char* to, TRwKey* rw); + int RwApply(const int flen, const unsigned char* from, unsigned char* to, const TRwKey* rw); + + const TRwMethod* RwDefaultMethods(void); + + TRwKey* RwNew(void); + void RwFree(TRwKey* r); + int RwSize(const TRwKey* rw); + int RwModSize(const TRwKey* rw); + + TRwKey* RwPublicKeyDup(TRwKey* rw); + TRwKey* RwPrivateKeyDup(TRwKey* rw); + + // NOLINTNEXTLINE(readability-identifier-naming) + TRwKey* d2i_RWPublicKey(TRwKey** a, const unsigned char** pp, long length); + // NOLINTNEXTLINE(readability-identifier-naming) + TRwKey* d2i_RWPrivateKey(TRwKey** a, const unsigned char** pp, long length); + + int RwGenerateKey(TRwKey* a, int bits); + // NOLINTNEXTLINE(readability-identifier-naming) + int i2d_RWPublicKey(const TRwKey* a, unsigned char** pp); + // NOLINTNEXTLINE(readability-identifier-naming) + int i2d_RWPrivateKey(const TRwKey* a, unsigned char** pp); + + int RwPaddingAddPssr(const TRwKey* rw, unsigned char* EM, const unsigned char* mHash, const EVP_MD* Hash, int sLen); + int RwVerifyPssr(const TRwKey* rw, const unsigned char* mHash, const EVP_MD* Hash, const unsigned char* EM, int sLen); #ifdef __cplusplus } diff --git a/library/cpp/tvmauth/src/rw/rw_asn1.c b/library/cpp/tvmauth/src/rw/rw_asn1.c index 76682dcff4..0eb7134fdb 100644 --- a/library/cpp/tvmauth/src/rw/rw_asn1.c +++ b/library/cpp/tvmauth/src/rw/rw_asn1.c @@ -8,16 +8,16 @@ /* Override the default new methods */ /* This callback is used by OpenSSL's ASN.1 parser */ -static int SignatureCallback(int operation, ASN1_VALUE** pval, const ASN1_ITEM* it, void* exarg) { +static int SignatureCallback(int operation, ASN1_VALUE** pval, const ASN1_ITEM* it, void* exarg) { (void)it; (void)exarg; if (operation == ASN1_OP_NEW_PRE) { - TRwSignature* sig; - sig = OPENSSL_malloc(sizeof(TRwSignature)); + TRwSignature* sig; + sig = OPENSSL_malloc(sizeof(TRwSignature)); if (!sig) return 0; - sig->S = NULL; + sig->S = NULL; *pval = (ASN1_VALUE*)sig; return 2; } @@ -25,25 +25,25 @@ static int SignatureCallback(int operation, ASN1_VALUE** pval, const ASN1_ITEM* } /* ASN.1 structure representing RW signature value */ -ASN1_SEQUENCE_cb(TRwSignature, SignatureCallback) = { - ASN1_SIMPLE(TRwSignature, S, BIGNUM), -} ASN1_SEQUENCE_END_cb(TRwSignature, TRwSignature) +ASN1_SEQUENCE_cb(TRwSignature, SignatureCallback) = { + ASN1_SIMPLE(TRwSignature, S, BIGNUM), +} ASN1_SEQUENCE_END_cb(TRwSignature, TRwSignature) - /* i2d_ and d2i functions implementation for RW */ - IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(TRwSignature, TRwSignature, TRwSignature) + /* i2d_ and d2i functions implementation for RW */ + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(TRwSignature, TRwSignature, TRwSignature) /* Override the default free and new methods */ - static int RwCallback(int operation, ASN1_VALUE** pval, const ASN1_ITEM* it, void* exarg) { + static int RwCallback(int operation, ASN1_VALUE** pval, const ASN1_ITEM* it, void* exarg) { (void)it; (void)exarg; if (operation == ASN1_OP_NEW_PRE) { - *pval = (ASN1_VALUE*)RwNew(); + *pval = (ASN1_VALUE*)RwNew(); if (*pval) return 2; return 0; } else if (operation == ASN1_OP_FREE_PRE) { - RwFree((TRwKey*)*pval); + RwFree((TRwKey*)*pval); *pval = NULL; return 2; } @@ -51,31 +51,31 @@ ASN1_SEQUENCE_cb(TRwSignature, SignatureCallback) = { } /* ASN.1 representation of RW's private key */ -ASN1_SEQUENCE_cb(RWPrivateKey, RwCallback) = { - ASN1_SIMPLE(TRwKey, N, BIGNUM), - ASN1_SIMPLE(TRwKey, P, CBIGNUM), - ASN1_SIMPLE(TRwKey, Q, CBIGNUM), - ASN1_SIMPLE(TRwKey, Iqmp, CBIGNUM), - ASN1_SIMPLE(TRwKey, Dq, CBIGNUM), - ASN1_SIMPLE(TRwKey, Dp, CBIGNUM), - ASN1_SIMPLE(TRwKey, Twomp, CBIGNUM), - ASN1_SIMPLE(TRwKey, Twomq, CBIGNUM)} ASN1_SEQUENCE_END_cb(TRwKey, RWPrivateKey); +ASN1_SEQUENCE_cb(RWPrivateKey, RwCallback) = { + ASN1_SIMPLE(TRwKey, N, BIGNUM), + ASN1_SIMPLE(TRwKey, P, CBIGNUM), + ASN1_SIMPLE(TRwKey, Q, CBIGNUM), + ASN1_SIMPLE(TRwKey, Iqmp, CBIGNUM), + ASN1_SIMPLE(TRwKey, Dq, CBIGNUM), + ASN1_SIMPLE(TRwKey, Dp, CBIGNUM), + ASN1_SIMPLE(TRwKey, Twomp, CBIGNUM), + ASN1_SIMPLE(TRwKey, Twomq, CBIGNUM)} ASN1_SEQUENCE_END_cb(TRwKey, RWPrivateKey); -/* i2d_ and d2i_ functions for RW's private key */ -IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(TRwKey, RWPrivateKey, RWPrivateKey); +/* i2d_ and d2i_ functions for RW's private key */ +IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(TRwKey, RWPrivateKey, RWPrivateKey); -/* ASN.1 representation of RW public key */ -ASN1_SEQUENCE_cb(RWPublicKey, RwCallback) = { - ASN1_SIMPLE(TRwKey, N, BIGNUM), -} ASN1_SEQUENCE_END_cb(TRwKey, RWPublicKey); +/* ASN.1 representation of RW public key */ +ASN1_SEQUENCE_cb(RWPublicKey, RwCallback) = { + ASN1_SIMPLE(TRwKey, N, BIGNUM), +} ASN1_SEQUENCE_END_cb(TRwKey, RWPublicKey); -/* i2d_ and d2i functions for RW public key */ -IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(TRwKey, RWPublicKey, RWPublicKey); +/* i2d_ and d2i functions for RW public key */ +IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(TRwKey, RWPublicKey, RWPublicKey); -TRwKey* RwPublicKeyDup(TRwKey* rw) { +TRwKey* RwPublicKeyDup(TRwKey* rw) { return ASN1_item_dup(ASN1_ITEM_rptr(RWPublicKey), rw); } -TRwKey* RwPrivateKeyDup(TRwKey* rw) { +TRwKey* RwPrivateKeyDup(TRwKey* rw) { return ASN1_item_dup(ASN1_ITEM_rptr(RWPrivateKey), rw); } diff --git a/library/cpp/tvmauth/src/rw/rw_key.c b/library/cpp/tvmauth/src/rw/rw_key.c index 8375c3ca20..35a7b60112 100644 --- a/library/cpp/tvmauth/src/rw/rw_key.c +++ b/library/cpp/tvmauth/src/rw/rw_key.c @@ -2,7 +2,7 @@ #include <contrib/libs/openssl/include/openssl/rand.h> -int RwGenerateKey(TRwKey* rw, int bits) { +int RwGenerateKey(TRwKey* rw, int bits) { int ok = 0; BN_CTX* ctx = NULL; @@ -13,25 +13,25 @@ int RwGenerateKey(TRwKey* rw, int bits) { int bitsq = bits - bitsp; /* make sure that all components are not null */ - if ((ctx = BN_CTX_secure_new()) == NULL) + if ((ctx = BN_CTX_secure_new()) == NULL) goto err; if (!rw) goto err; - if (!rw->N && ((rw->N = BN_new()) == NULL)) + if (!rw->N && ((rw->N = BN_new()) == NULL)) goto err; - if (!rw->P && ((rw->P = BN_new()) == NULL)) + if (!rw->P && ((rw->P = BN_new()) == NULL)) goto err; - if (!rw->Q && ((rw->Q = BN_new()) == NULL)) + if (!rw->Q && ((rw->Q = BN_new()) == NULL)) goto err; - if (!rw->Iqmp && ((rw->Iqmp = BN_new()) == NULL)) + if (!rw->Iqmp && ((rw->Iqmp = BN_new()) == NULL)) goto err; - if (!rw->Twomq && ((rw->Twomq = BN_new()) == NULL)) + if (!rw->Twomq && ((rw->Twomq = BN_new()) == NULL)) goto err; - if (!rw->Twomp && ((rw->Twomp = BN_new()) == NULL)) + if (!rw->Twomp && ((rw->Twomp = BN_new()) == NULL)) goto err; - if (!rw->Dq && ((rw->Dq = BN_new()) == NULL)) + if (!rw->Dq && ((rw->Dq = BN_new()) == NULL)) goto err; - if (!rw->Dp && ((rw->Dp = BN_new()) == NULL)) + if (!rw->Dp && ((rw->Dp = BN_new()) == NULL)) goto err; BN_CTX_start(ctx); @@ -60,32 +60,32 @@ int RwGenerateKey(TRwKey* rw, int bits) { /* add == 8 */ /* rem == 3 */ /* safe == 0 as we don't need (p-1)/2 to be also prime */ - if (!BN_generate_prime_ex(rw->P, bitsp, 0, mod8, rem3, NULL)) + if (!BN_generate_prime_ex(rw->P, bitsp, 0, mod8, rem3, NULL)) goto err; /* generate q */ /* add == 8 */ /* rem == 7 */ /* safe == 0 */ - if (!BN_generate_prime_ex(rw->Q, bitsq, 0, mod8, rem7, NULL)) + if (!BN_generate_prime_ex(rw->Q, bitsq, 0, mod8, rem7, NULL)) goto err; /* n == p*q */ - if (!BN_mul(rw->N, rw->P, rw->Q, ctx)) + if (!BN_mul(rw->N, rw->P, rw->Q, ctx)) goto err; /* n == 5 mod 8 ? */ - if (!BN_nnmod(nmod, rw->N, mod8, ctx)) + if (!BN_nnmod(nmod, rw->N, mod8, ctx)) goto err; if (BN_ucmp(rem5, nmod) != 0) goto err; /* q^(-1) mod p */ - if (!BN_mod_inverse(rw->Iqmp, rw->Q, rw->P, ctx)) + if (!BN_mod_inverse(rw->Iqmp, rw->Q, rw->P, ctx)) goto err; /* twomqexp = (3q-5)/8 */ - if (!BN_copy(twomqexp, rw->Q)) + if (!BN_copy(twomqexp, rw->Q)) goto err; if (!BN_mul_word(twomqexp, 3)) goto err; @@ -93,11 +93,11 @@ int RwGenerateKey(TRwKey* rw, int bits) { goto err; if (!BN_rshift(twomqexp, twomqexp, 3)) goto err; - if (!BN_mod_exp(rw->Twomq, two, twomqexp, rw->Q, ctx)) + if (!BN_mod_exp(rw->Twomq, two, twomqexp, rw->Q, ctx)) goto err; /* twompexp = (9p-11)/8 */ - if (!BN_copy(twompexp, rw->P)) + if (!BN_copy(twompexp, rw->P)) goto err; if (!BN_mul_word(twompexp, 9)) goto err; @@ -105,23 +105,23 @@ int RwGenerateKey(TRwKey* rw, int bits) { goto err; if (!BN_rshift(twompexp, twompexp, 3)) goto err; - if (!BN_mod_exp(rw->Twomp, two, twompexp, rw->P, ctx)) + if (!BN_mod_exp(rw->Twomp, two, twompexp, rw->P, ctx)) goto err; /* dp = (p-3) / 8 */ - if (!BN_copy(rw->Dp, rw->P)) + if (!BN_copy(rw->Dp, rw->P)) goto err; - if (!BN_sub_word(rw->Dp, 3)) + if (!BN_sub_word(rw->Dp, 3)) goto err; - if (!BN_rshift(rw->Dp, rw->Dp, 3)) + if (!BN_rshift(rw->Dp, rw->Dp, 3)) goto err; /* dq = (q+1) / 8 */ - if (!BN_copy(rw->Dq, rw->Q)) + if (!BN_copy(rw->Dq, rw->Q)) goto err; - if (!BN_add_word(rw->Dq, 1)) + if (!BN_add_word(rw->Dq, 1)) goto err; - if (!BN_rshift(rw->Dq, rw->Dq, 3)) + if (!BN_rshift(rw->Dq, rw->Dq, 3)) goto err; ok = 1; diff --git a/library/cpp/tvmauth/src/rw/rw_lib.c b/library/cpp/tvmauth/src/rw/rw_lib.c index 94d94caa4a..d4b1e06766 100644 --- a/library/cpp/tvmauth/src/rw/rw_lib.c +++ b/library/cpp/tvmauth/src/rw/rw_lib.c @@ -4,52 +4,52 @@ #include <stdio.h> -TRwKey* RwNew(void) { - TRwKey* ret = NULL; +TRwKey* RwNew(void) { + TRwKey* ret = NULL; - ret = (TRwKey*)malloc(sizeof(TRwKey)); + ret = (TRwKey*)malloc(sizeof(TRwKey)); if (ret == NULL) { return (NULL); } - ret->Meth = RwDefaultMethods(); + ret->Meth = RwDefaultMethods(); - ret->P = NULL; - ret->Q = NULL; - ret->N = NULL; - ret->Iqmp = NULL; - ret->Twomq = NULL; - ret->Twomp = NULL; - ret->Dp = NULL; - ret->Dq = NULL; + ret->P = NULL; + ret->Q = NULL; + ret->N = NULL; + ret->Iqmp = NULL; + ret->Twomq = NULL; + ret->Twomp = NULL; + ret->Dp = NULL; + ret->Dq = NULL; return ret; } -void RwFree(TRwKey* r) { +void RwFree(TRwKey* r) { if (r == NULL) return; - if (r->P != NULL) - BN_clear_free(r->P); - if (r->Q != NULL) - BN_clear_free(r->Q); - if (r->N != NULL) - BN_clear_free(r->N); - if (r->Iqmp != NULL) - BN_clear_free(r->Iqmp); - if (r->Dp != NULL) - BN_clear_free(r->Dp); - if (r->Dq != NULL) - BN_clear_free(r->Dq); - if (r->Twomp != NULL) - BN_clear_free(r->Twomp); - if (r->Twomq != NULL) - BN_clear_free(r->Twomq); + if (r->P != NULL) + BN_clear_free(r->P); + if (r->Q != NULL) + BN_clear_free(r->Q); + if (r->N != NULL) + BN_clear_free(r->N); + if (r->Iqmp != NULL) + BN_clear_free(r->Iqmp); + if (r->Dp != NULL) + BN_clear_free(r->Dp); + if (r->Dq != NULL) + BN_clear_free(r->Dq); + if (r->Twomp != NULL) + BN_clear_free(r->Twomp); + if (r->Twomq != NULL) + BN_clear_free(r->Twomq); - free(r); + free(r); } -int RwSize(const TRwKey* r) { +int RwSize(const TRwKey* r) { int ret = 0, i = 0; ASN1_INTEGER bs; unsigned char buf[4]; /* 4 bytes looks really small. @@ -57,7 +57,7 @@ int RwSize(const TRwKey* r) { beyond the first byte, as long as the second parameter is NULL. */ - i = BN_num_bits(r->N); + i = BN_num_bits(r->N); bs.length = (i + 7) / 8; bs.data = buf; bs.type = V_ASN1_INTEGER; @@ -70,8 +70,8 @@ int RwSize(const TRwKey* r) { return ret; } -int RwModSize(const TRwKey* rw) { - if (rw == NULL || rw->N == NULL) +int RwModSize(const TRwKey* rw) { + if (rw == NULL || rw->N == NULL) return 0; - return BN_num_bytes(rw->N); + return BN_num_bytes(rw->N); } diff --git a/library/cpp/tvmauth/src/rw/rw_ossl.c b/library/cpp/tvmauth/src/rw/rw_ossl.c index 951752bdb3..cfac5eb28a 100644 --- a/library/cpp/tvmauth/src/rw/rw_ossl.c +++ b/library/cpp/tvmauth/src/rw/rw_ossl.c @@ -7,19 +7,19 @@ //#define FAULT_TOLERANCE_CHECK #ifdef RW_PRINT_DEBUG - #include <stdio.h> + #include <stdio.h> #endif -static TRwSignature* RwDoSign(const unsigned char* dgst, int dlen, TRwKey* rw); -static int RwDoVerify(const unsigned char* dgst, int dgst_len, TRwSignature* sig, const TRwKey* rw); -static int RwDoApply(BIGNUM* r, BIGNUM* x, BN_CTX* ctx, const TRwKey* rw); +static TRwSignature* RwDoSign(const unsigned char* dgst, int dlen, TRwKey* rw); +static int RwDoVerify(const unsigned char* dgst, int dgst_len, TRwSignature* sig, const TRwKey* rw); +static int RwDoApply(BIGNUM* r, BIGNUM* x, BN_CTX* ctx, const TRwKey* rw); -static TRwMethod rw_default_meth = { - RwDoSign, - RwDoVerify, - RwDoApply}; +static TRwMethod rw_default_meth = { + RwDoSign, + RwDoVerify, + RwDoApply}; -const TRwMethod* RwDefaultMethods(void) { +const TRwMethod* RwDefaultMethods(void) { return &rw_default_meth; } @@ -33,29 +33,29 @@ static void print_bn(char* name, BIGNUM* value) { OPENSSL_free(str_repr); } - #define DEBUG_PRINT_BN(s, x) \ - do { \ - print_bn((s), (x)); \ - } while (0); - #define DEBUG_PRINT_RW(r) \ - do { \ - DEBUG_PRINT_BN("rw->p", (r)->p); \ - DEBUG_PRINT_BN("rw->q", (r)->q); \ - DEBUG_PRINT_BN("rw->n", (r)->n); \ - DEBUG_PRINT_BN("rw->iqmp", (r)->iqmp); \ - DEBUG_PRINT_BN("rw->twomp", (r)->twomp); \ - DEBUG_PRINT_BN("rw->twomq", (r)->twomq); \ - DEBUG_PRINT_BN("rw->dp", (r)->dp); \ - DEBUG_PRINT_BN("rw->dq", (r)->dq); \ - } while (0); - #define DEBUG_PRINTF(s, v) \ - do { \ - printf((s), (v)); \ - } while (0); + #define DEBUG_PRINT_BN(s, x) \ + do { \ + print_bn((s), (x)); \ + } while (0); + #define DEBUG_PRINT_RW(r) \ + do { \ + DEBUG_PRINT_BN("rw->p", (r)->p); \ + DEBUG_PRINT_BN("rw->q", (r)->q); \ + DEBUG_PRINT_BN("rw->n", (r)->n); \ + DEBUG_PRINT_BN("rw->iqmp", (r)->iqmp); \ + DEBUG_PRINT_BN("rw->twomp", (r)->twomp); \ + DEBUG_PRINT_BN("rw->twomq", (r)->twomq); \ + DEBUG_PRINT_BN("rw->dp", (r)->dp); \ + DEBUG_PRINT_BN("rw->dq", (r)->dq); \ + } while (0); + #define DEBUG_PRINTF(s, v) \ + do { \ + printf((s), (v)); \ + } while (0); #else - #define DEBUG_PRINT_BN(s, x) - #define DEBUG_PRINT_RW(r) - #define DEBUG_PRINTF(s, v) + #define DEBUG_PRINT_BN(s, x) + #define DEBUG_PRINT_RW(r) + #define DEBUG_PRINTF(s, v) #endif /* @@ -73,18 +73,18 @@ static void print_bn(char* name, BIGNUM* value) { * 8. Compute s = Y^2 mod pq * 9. Fault tolerance: if efs^2 mod pq != h start over */ -static TRwSignature* RwDoSign(const unsigned char* dgst, int dlen, TRwKey* rw) { +static TRwSignature* RwDoSign(const unsigned char* dgst, int dlen, TRwKey* rw) { BIGNUM *m, *U, *V, *tmp, *m_q, *m_p, *tmp2; /* additional variables to avoid "if" statements */ BIGNUM *tmp_mp, *tmp_U, *tmp_V; - TRwSignature* ret = NULL; + TRwSignature* ret = NULL; BN_CTX* ctx = NULL; int ok = 0, e = 0, f = 0; - if (!rw || !rw->P || !rw->Q || !rw->N || !rw->Iqmp || !rw->Dp || !rw->Dq || !rw->Twomp || !rw->Twomq) + if (!rw || !rw->P || !rw->Q || !rw->N || !rw->Iqmp || !rw->Dp || !rw->Dq || !rw->Twomp || !rw->Twomq) goto err; - if ((ctx = BN_CTX_secure_new()) == NULL) + if ((ctx = BN_CTX_secure_new()) == NULL) goto err; BN_CTX_start(ctx); @@ -105,40 +105,40 @@ static TRwSignature* RwDoSign(const unsigned char* dgst, int dlen, TRwKey* rw) { if (!BN_bin2bn(dgst, dlen, m)) goto err; - if (BN_ucmp(m, rw->N) >= 0) + if (BN_ucmp(m, rw->N) >= 0) goto err; /* check if m % 16 == 12 */ - if (BN_mod_word(m, 16) != 12) + if (BN_mod_word(m, 16) != 12) goto err; DEBUG_PRINT_BN("m", m) /* TODO: optimization to avoid memory allocation? */ - if ((ret = RwSignatureNew()) == NULL) + if ((ret = RwSignatureNew()) == NULL) goto err; /* memory allocation */ - if ((ret->S = BN_new()) == NULL) + if ((ret->S = BN_new()) == NULL) goto err; /* m_q = m mod q */ - if (!BN_nnmod(m_q, m, rw->Q, ctx)) + if (!BN_nnmod(m_q, m, rw->Q, ctx)) goto err; /* m_p = m mod p */ - if (!BN_nnmod(m_p, m, rw->P, ctx)) + if (!BN_nnmod(m_p, m, rw->P, ctx)) goto err; DEBUG_PRINT_BN("m_p", m_p) DEBUG_PRINT_BN("m_q", m_q) /* U = h ** ((q+1)/8) mod q */ - if (!BN_mod_exp(U, m_q, rw->Dq, rw->Q, ctx)) + if (!BN_mod_exp(U, m_q, rw->Dq, rw->Q, ctx)) goto err; DEBUG_PRINT_BN("U", U) /* tmp = U^4 - h mod q */ - if (!BN_mod_sqr(tmp, U, rw->Q, ctx)) + if (!BN_mod_sqr(tmp, U, rw->Q, ctx)) goto err; - if (!BN_mod_sqr(tmp, tmp, rw->Q, ctx)) + if (!BN_mod_sqr(tmp, tmp, rw->Q, ctx)) goto err; DEBUG_PRINT_BN("U**4 mod q", tmp) @@ -151,35 +151,35 @@ static TRwSignature* RwDoSign(const unsigned char* dgst, int dlen, TRwKey* rw) { if e == -1: m_p = tmp_mp if e == 1: m_p = m_p */ - if (!BN_sub(tmp_mp, rw->P, m_p)) + if (!BN_sub(tmp_mp, rw->P, m_p)) goto err; m_p = (BIGNUM*)((1 - ((1 + e) >> 1)) * (BN_ULONG)tmp_mp + ((1 + e) >> 1) * (BN_ULONG)m_p); DEBUG_PRINT_BN("eh mod p", m_p) /* V = (eh) ** ((p-3)/8) */ - if (!BN_mod_exp(V, m_p, rw->Dp, rw->P, ctx)) + if (!BN_mod_exp(V, m_p, rw->Dp, rw->P, ctx)) goto err; DEBUG_PRINT_BN("V == ((eh) ** ((p-3)/8))", V) /* (eh) ** 2 */ - if (!BN_mod_sqr(tmp2, m_p, rw->P, ctx)) + if (!BN_mod_sqr(tmp2, m_p, rw->P, ctx)) goto err; DEBUG_PRINT_BN("(eh)**2", tmp2) /* V ** 4 */ - if (!BN_mod_sqr(tmp, V, rw->P, ctx)) + if (!BN_mod_sqr(tmp, V, rw->P, ctx)) goto err; - if (!BN_mod_sqr(tmp, tmp, rw->P, ctx)) + if (!BN_mod_sqr(tmp, tmp, rw->P, ctx)) goto err; DEBUG_PRINT_BN("V**4", tmp) /* V**4 * (eh)**2 */ - if (!BN_mod_mul(tmp, tmp, tmp2, rw->P, ctx)) + if (!BN_mod_mul(tmp, tmp, tmp2, rw->P, ctx)) goto err; DEBUG_PRINT_BN("tmp = (V**4 * (eh)**2) mod p", tmp) /* tmp = tmp - eh mod p */ - if (!BN_mod_sub(tmp, tmp, m_p, rw->P, ctx)) + if (!BN_mod_sub(tmp, tmp, m_p, rw->P, ctx)) goto err; /* f = 1 if zero else 2 */ @@ -198,7 +198,7 @@ static TRwSignature* RwDoSign(const unsigned char* dgst, int dlen, TRwKey* rw) { #else if (f == 2) { - if (!BN_mod_mul(U, U, rw->Twomq, rw->Q, ctx)) + if (!BN_mod_mul(U, U, rw->Twomq, rw->Q, ctx)) goto err; } @@ -207,14 +207,14 @@ static TRwSignature* RwDoSign(const unsigned char* dgst, int dlen, TRwKey* rw) { DEBUG_PRINT_BN("W", U) /* V ** 3 */ - if (!BN_mod_sqr(tmp, V, rw->P, ctx)) + if (!BN_mod_sqr(tmp, V, rw->P, ctx)) goto err; - if (!BN_mod_mul(V, V, tmp, rw->P, ctx)) + if (!BN_mod_mul(V, V, tmp, rw->P, ctx)) goto err; DEBUG_PRINT_BN("V**3", V) /* *(eh) */ - if (!BN_mod_mul(V, V, m_p, rw->P, ctx)) + if (!BN_mod_mul(V, V, m_p, rw->P, ctx)) goto err; DEBUG_PRINT_BN("V**3 * (eh) mod p", V) @@ -228,7 +228,7 @@ static TRwSignature* RwDoSign(const unsigned char* dgst, int dlen, TRwKey* rw) { #else if (f == 2) { - if (!BN_mod_mul(V, V, rw->Twomp, rw->P, ctx)) + if (!BN_mod_mul(V, V, rw->Twomp, rw->P, ctx)) goto err; } @@ -237,24 +237,24 @@ static TRwSignature* RwDoSign(const unsigned char* dgst, int dlen, TRwKey* rw) { DEBUG_PRINT_BN("X", V) /* W = U, X = V */ - if (!BN_mod_sub(V, V, U, rw->P, ctx)) + if (!BN_mod_sub(V, V, U, rw->P, ctx)) goto err; DEBUG_PRINT_BN("X - W mod p", V) - if (!BN_mod_mul(V, V, rw->Iqmp, rw->P, ctx)) + if (!BN_mod_mul(V, V, rw->Iqmp, rw->P, ctx)) goto err; DEBUG_PRINT_BN("q**(p-2) * (X-W) mod p", V) - if (!BN_mul(V, V, rw->Q, ctx)) + if (!BN_mul(V, V, rw->Q, ctx)) goto err; DEBUG_PRINT_BN("q * prev mod p", V) - if (!BN_mod_add(V, U, V, rw->N, ctx)) + if (!BN_mod_add(V, U, V, rw->N, ctx)) goto err; DEBUG_PRINT_BN("Y", V) /* now V = Y */ - if (!BN_mod_sqr(V, V, rw->N, ctx)) + if (!BN_mod_sqr(V, V, rw->N, ctx)) goto err; DEBUG_PRINT_BN("s", V) @@ -287,13 +287,13 @@ static TRwSignature* RwDoSign(const unsigned char* dgst, int dlen, TRwKey* rw) { #endif /* making the "principal square root" to be "|principal| square root" */ - if (!BN_sub(tmp, rw->N, V)) + if (!BN_sub(tmp, rw->N, V)) goto err; /* if tmp = MIN(V, rw->n - V) */ tmp = BN_ucmp(tmp, V) >= 0 ? V : tmp; - if (!BN_copy(ret->S, tmp)) + if (!BN_copy(ret->S, tmp)) goto err; ok = 1; @@ -304,23 +304,23 @@ err: BN_CTX_free(ctx); } if (!ok) { - RwSignatureFree(ret); + RwSignatureFree(ret); ret = NULL; } return ret; } -static int RwDoVerify(const unsigned char* dgst, int dgst_len, TRwSignature* sig, const TRwKey* rw) { +static int RwDoVerify(const unsigned char* dgst, int dgst_len, TRwSignature* sig, const TRwKey* rw) { BIGNUM *m = NULL, *x = NULL, *t1 = NULL, *t2 = NULL, *t1d = NULL, *t2d = NULL; BN_CTX* ctx = NULL; BN_ULONG rest1 = 0, rest2 = 0; int retval = 0; - if (!rw || !rw->N || !sig || !sig->S) + if (!rw || !rw->N || !sig || !sig->S) goto err; - if ((ctx = BN_CTX_secure_new()) == NULL) + if ((ctx = BN_CTX_secure_new()) == NULL) goto err; BN_CTX_start(ctx); @@ -333,7 +333,7 @@ static int RwDoVerify(const unsigned char* dgst, int dgst_len, TRwSignature* sig if (!BN_bin2bn(dgst, dgst_len, m)) goto err; /* dgst too big */ - if (!BN_copy(t1, rw->N)) + if (!BN_copy(t1, rw->N)) goto err; if (!BN_sub_word(t1, 1)) goto err; @@ -341,28 +341,28 @@ static int RwDoVerify(const unsigned char* dgst, int dgst_len, TRwSignature* sig goto err; /* check m and rw->n relation */ - if (BN_ucmp(m, rw->N) >= 0) + if (BN_ucmp(m, rw->N) >= 0) goto err; rest1 = BN_mod_word(m, 16); if (rest1 != 12) goto err; - if (BN_ucmp(t1, sig->S) < 0) + if (BN_ucmp(t1, sig->S) < 0) goto err; - if (BN_is_negative(sig->S)) + if (BN_is_negative(sig->S)) goto err; - if (!BN_mod_sqr(t1, sig->S, rw->N, ctx)) + if (!BN_mod_sqr(t1, sig->S, rw->N, ctx)) goto err; - if (!BN_sub(t2, rw->N, t1)) + if (!BN_sub(t2, rw->N, t1)) goto err; if (!BN_lshift1(t1d, t1)) goto err; if (!BN_lshift1(t2d, t2)) goto err; - rest1 = BN_mod_word(t1, 16); - rest2 = BN_mod_word(t2, 16); + rest1 = BN_mod_word(t1, 16); + rest2 = BN_mod_word(t2, 16); /* mod 16 */ if (rest1 == 12) { @@ -396,12 +396,12 @@ err: return retval; } -static int RwDoApply(BIGNUM* r, BIGNUM* x, BN_CTX* ctx, const TRwKey* rw) { +static int RwDoApply(BIGNUM* r, BIGNUM* x, BN_CTX* ctx, const TRwKey* rw) { BIGNUM *t1 = NULL, *t2 = NULL, *t1d = NULL, *t2d = NULL, *rs = NULL; BN_ULONG rest1 = 0, rest2 = 0; int retval = 0; - if (!rw || !rw->N || !x || !ctx || !r) + if (!rw || !rw->N || !x || !ctx || !r) goto err; DEBUG_PRINT_BN("Signature = x = ", x) @@ -414,7 +414,7 @@ static int RwDoApply(BIGNUM* r, BIGNUM* x, BN_CTX* ctx, const TRwKey* rw) { t1d = BN_CTX_get(ctx); t2d = BN_CTX_get(ctx); - if (!BN_copy(t1, rw->N)) + if (!BN_copy(t1, rw->N)) goto err; if (!BN_sub_word(t1, 1)) goto err; @@ -422,7 +422,7 @@ static int RwDoApply(BIGNUM* r, BIGNUM* x, BN_CTX* ctx, const TRwKey* rw) { goto err; /* check m and rw->n relation */ - if (BN_ucmp(x, rw->N) >= 0) + if (BN_ucmp(x, rw->N) >= 0) goto err; if (BN_ucmp(t1, x) < 0) @@ -430,11 +430,11 @@ static int RwDoApply(BIGNUM* r, BIGNUM* x, BN_CTX* ctx, const TRwKey* rw) { if (BN_is_negative(x)) goto err; - if (!BN_mod_sqr(t1, x, rw->N, ctx)) + if (!BN_mod_sqr(t1, x, rw->N, ctx)) goto err; DEBUG_PRINT_BN("x**2 mod n", t1) - if (!BN_sub(t2, rw->N, t1)) + if (!BN_sub(t2, rw->N, t1)) goto err; DEBUG_PRINT_BN("n - x**2", t2) @@ -443,8 +443,8 @@ static int RwDoApply(BIGNUM* r, BIGNUM* x, BN_CTX* ctx, const TRwKey* rw) { if (!BN_lshift1(t2d, t2)) goto err; - rest1 = BN_mod_word(t1, 16); - rest2 = BN_mod_word(t2, 16); + rest1 = BN_mod_word(t1, 16); + rest2 = BN_mod_word(t2, 16); /* mod 16 */ if (rest1 == 12) { diff --git a/library/cpp/tvmauth/src/rw/rw_pss.c b/library/cpp/tvmauth/src/rw/rw_pss.c index 3bf6e2b99a..4535cd236c 100644 --- a/library/cpp/tvmauth/src/rw/rw_pss.c +++ b/library/cpp/tvmauth/src/rw/rw_pss.c @@ -72,21 +72,21 @@ static const unsigned char zeroes[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static int PkcS1MgF1(unsigned char *mask, const int len, const unsigned char *seed, const int seedlen, const EVP_MD *dgst) { - int i, outlen = 0; +static int PkcS1MgF1(unsigned char *mask, const int len, const unsigned char *seed, const int seedlen, const EVP_MD *dgst) { + int i, outlen = 0; unsigned char cnt[4]; - EVP_MD_CTX* c = EVP_MD_CTX_create(); + EVP_MD_CTX* c = EVP_MD_CTX_create(); unsigned char md[EVP_MAX_MD_SIZE]; int mdlen; int rv = -1; - if (!c) { - return rv; - } - + if (!c) { + return rv; + } + mdlen = EVP_MD_size(dgst); - if (mdlen < 0 || seedlen < 0) + if (mdlen < 0 || seedlen < 0) goto err; for (i = 0; outlen < len; i++) { @@ -95,15 +95,15 @@ static int PkcS1MgF1(unsigned char *mask, const int len, const unsigned char *se cnt[2] = (unsigned char)((i >> 8)) & 255; cnt[3] = (unsigned char)(i & 255); - if (!EVP_DigestInit_ex(c,dgst, NULL) || !EVP_DigestUpdate(c, seed, seedlen) || !EVP_DigestUpdate(c, cnt, 4)) + if (!EVP_DigestInit_ex(c,dgst, NULL) || !EVP_DigestUpdate(c, seed, seedlen) || !EVP_DigestUpdate(c, cnt, 4)) goto err; if (outlen + mdlen <= len) { - if (!EVP_DigestFinal_ex(c, mask + outlen, NULL)) + if (!EVP_DigestFinal_ex(c, mask + outlen, NULL)) goto err; outlen += mdlen; } else { - if (!EVP_DigestFinal_ex(c, md, NULL)) + if (!EVP_DigestFinal_ex(c, md, NULL)) goto err; memcpy(mask + outlen, md, len - outlen); outlen = len; @@ -112,22 +112,22 @@ static int PkcS1MgF1(unsigned char *mask, const int len, const unsigned char *se rv = 0; err: - EVP_MD_CTX_destroy(c); + EVP_MD_CTX_destroy(c); return rv; } -int RwVerifyPssr(const TRwKey *rw, const unsigned char *mHash, const EVP_MD *Hash, const unsigned char *EM, int sLen) { +int RwVerifyPssr(const TRwKey *rw, const unsigned char *mHash, const EVP_MD *Hash, const unsigned char *EM, int sLen) { int i = 0, ret = 0, hLen = 0, maskedDBLen = 0, MSBits = 0, emLen = 0; const unsigned char *H = NULL; unsigned char *DB = NULL; - EVP_MD_CTX* ctx = NULL; + EVP_MD_CTX* ctx = NULL; unsigned char H_[EVP_MAX_MD_SIZE]; const EVP_MD *mgf1Hash = Hash; - ctx = EVP_MD_CTX_create(); - if (!ctx) { - return ret; - } + ctx = EVP_MD_CTX_create(); + if (!ctx) { + return ret; + } hLen = EVP_MD_size(Hash); if (hLen < 0) @@ -143,14 +143,14 @@ int RwVerifyPssr(const TRwKey *rw, const unsigned char *mHash, const EVP_MD *Has else if (sLen < -2) goto err; - { - int bits = BN_num_bits(rw->N); - if (bits <= 0) - goto err; - - MSBits = (bits - 1) & 0x7; - } - emLen = RwModSize(rw); + { + int bits = BN_num_bits(rw->N); + if (bits <= 0) + goto err; + + MSBits = (bits - 1) & 0x7; + } + emLen = RwModSize(rw); if (EM[0] & (0xFF << MSBits)) { goto err; @@ -164,23 +164,23 @@ int RwVerifyPssr(const TRwKey *rw, const unsigned char *mHash, const EVP_MD *Has if (emLen < (hLen + sLen + 2)) /* sLen can be small negative */ goto err; - if (emLen < 1) - goto err; - + if (emLen < 1) + goto err; + if (EM[emLen - 1] != 0xbc) goto err; maskedDBLen = emLen - hLen - 1; - if (maskedDBLen <= 0) - goto err; - + if (maskedDBLen <= 0) + goto err; + H = EM + maskedDBLen; - DB = malloc(maskedDBLen); + DB = malloc(maskedDBLen); if (!DB) goto err; - if (PkcS1MgF1(DB, maskedDBLen, H, hLen, mgf1Hash) < 0) + if (PkcS1MgF1(DB, maskedDBLen, H, hLen, mgf1Hash) < 0) goto err; for (i = 0; i < maskedDBLen; i++) @@ -197,24 +197,24 @@ int RwVerifyPssr(const TRwKey *rw, const unsigned char *mHash, const EVP_MD *Has if (sLen >= 0 && (maskedDBLen - i) != sLen) goto err; - if (!EVP_DigestInit_ex(ctx, Hash, NULL) || !EVP_DigestUpdate(ctx, zeroes, sizeof zeroes) || !EVP_DigestUpdate(ctx, mHash, hLen)) + if (!EVP_DigestInit_ex(ctx, Hash, NULL) || !EVP_DigestUpdate(ctx, zeroes, sizeof zeroes) || !EVP_DigestUpdate(ctx, mHash, hLen)) goto err; if (maskedDBLen - i) { - if (!EVP_DigestUpdate(ctx, DB + i, maskedDBLen - i)) + if (!EVP_DigestUpdate(ctx, DB + i, maskedDBLen - i)) goto err; } - if (!EVP_DigestFinal_ex(ctx, H_, NULL)) + if (!EVP_DigestFinal_ex(ctx, H_, NULL)) goto err; ret = memcmp(H, H_, hLen) ? 0 : 1; err: if (DB) - free(DB); + free(DB); - EVP_MD_CTX_destroy(ctx); + EVP_MD_CTX_destroy(ctx); return ret; } @@ -226,14 +226,14 @@ err: Hash - EVP_MD() that will be used to pad sLen - random salt len (usually == hashLen) */ -int RwPaddingAddPssr(const TRwKey *rw, unsigned char *EM, const unsigned char *mHash, const EVP_MD *Hash, int sLen) { +int RwPaddingAddPssr(const TRwKey *rw, unsigned char *EM, const unsigned char *mHash, const EVP_MD *Hash, int sLen) { int i = 0, ret = 0, hLen = 0, maskedDBLen = 0, MSBits = 0, emLen = 0; unsigned char *H = NULL, *salt = NULL, *p = NULL; const EVP_MD *mgf1Hash = Hash; - EVP_MD_CTX* ctx = EVP_MD_CTX_create(); - if (!ctx) { - return ret; - } + EVP_MD_CTX* ctx = EVP_MD_CTX_create(); + if (!ctx) { + return ret; + } hLen = EVP_MD_size(Hash); if (hLen < 0) @@ -249,20 +249,20 @@ int RwPaddingAddPssr(const TRwKey *rw, unsigned char *EM, const unsigned char *m else if (sLen < -2) goto err; - { - int bits = BN_num_bits(rw->N); - if (bits <= 0) - goto err; - MSBits = (bits - 1) & 0x7; - } - emLen = RwModSize(rw); - if (emLen <= 0) - goto err; + { + int bits = BN_num_bits(rw->N); + if (bits <= 0) + goto err; + MSBits = (bits - 1) & 0x7; + } + emLen = RwModSize(rw); + if (emLen <= 0) + goto err; if (MSBits == 0) { *EM++ = 0; emLen--; - fprintf(stderr, "MSBits == 0\n"); + fprintf(stderr, "MSBits == 0\n"); } if (sLen == -2) { @@ -272,28 +272,28 @@ int RwPaddingAddPssr(const TRwKey *rw, unsigned char *EM, const unsigned char *m goto err; if (sLen > 0) { - salt = malloc(sLen); + salt = malloc(sLen); if (!salt) goto err; if (RAND_bytes(salt, sLen) <= 0) goto err; } maskedDBLen = emLen - hLen - 1; - if (maskedDBLen < 0) - goto err; + if (maskedDBLen < 0) + goto err; H = EM + maskedDBLen; - if (!EVP_DigestInit_ex(ctx, Hash, NULL) || !EVP_DigestUpdate(ctx, zeroes, sizeof zeroes) || !EVP_DigestUpdate(ctx, mHash, hLen)) + if (!EVP_DigestInit_ex(ctx, Hash, NULL) || !EVP_DigestUpdate(ctx, zeroes, sizeof zeroes) || !EVP_DigestUpdate(ctx, mHash, hLen)) goto err; - if (sLen && !EVP_DigestUpdate(ctx, salt, sLen)) + if (sLen && !EVP_DigestUpdate(ctx, salt, sLen)) goto err; - if (!EVP_DigestFinal_ex(ctx, H, NULL)) + if (!EVP_DigestFinal_ex(ctx, H, NULL)) goto err; /* Generate dbMask in place then perform XOR on it */ - if (PkcS1MgF1(EM, maskedDBLen, H, hLen, mgf1Hash)) + if (PkcS1MgF1(EM, maskedDBLen, H, hLen, mgf1Hash)) goto err; p = EM; @@ -319,10 +319,10 @@ int RwPaddingAddPssr(const TRwKey *rw, unsigned char *EM, const unsigned char *m ret = 1; err: - EVP_MD_CTX_destroy(ctx); - + EVP_MD_CTX_destroy(ctx); + if (salt) - free(salt); + free(salt); return ret; } diff --git a/library/cpp/tvmauth/src/rw/rw_pss_sign.c b/library/cpp/tvmauth/src/rw/rw_pss_sign.c index 59897f1cf5..f1ae46f140 100644 --- a/library/cpp/tvmauth/src/rw/rw_pss_sign.c +++ b/library/cpp/tvmauth/src/rw/rw_pss_sign.c @@ -2,44 +2,44 @@ #include <contrib/libs/openssl/include/openssl/evp.h> -//#define DBG_FUZZING - -int RwApply(const int flen, const unsigned char* from, unsigned char* to, const TRwKey* rw) { +//#define DBG_FUZZING + +int RwApply(const int flen, const unsigned char* from, unsigned char* to, const TRwKey* rw) { int i, j, num, k, r = -1; BN_CTX* ctx = NULL; BIGNUM *f = NULL, *ret = NULL; - if ((ctx = BN_CTX_secure_new()) == NULL) + if ((ctx = BN_CTX_secure_new()) == NULL) goto err; BN_CTX_start(ctx); f = BN_CTX_get(ctx); ret = BN_CTX_get(ctx); - num = BN_num_bytes(rw->N); - - if (num <= 0) - goto err; + num = BN_num_bytes(rw->N); + if (num <= 0) + goto err; + if (!f || !ret) goto err; if (BN_bin2bn(from, flen, f) == NULL) goto err; - if (BN_ucmp(f, rw->N) >= 0) + if (BN_ucmp(f, rw->N) >= 0) goto err; - if (!rw->Meth->RwApply(ret, f, ctx, rw)) + if (!rw->Meth->RwApply(ret, f, ctx, rw)) goto err; j = BN_num_bytes(ret); - if (num < j || j < 0) - goto err; - - i = BN_bn2bin(ret, to + num - j); - if (i < 0 || i > num) - goto err; - + if (num < j || j < 0) + goto err; + + i = BN_bn2bin(ret, to + num - j); + if (i < 0 || i > num) + goto err; + for (k = 0; k < (num - i); k++) to[k] = 0; r = num; @@ -52,46 +52,46 @@ err: return r; } -int RwPssrSignHash(const unsigned char* from, unsigned char* to, TRwKey* rw, const EVP_MD* md) { - unsigned char* padding = NULL; +int RwPssrSignHash(const unsigned char* from, unsigned char* to, TRwKey* rw, const EVP_MD* md) { + unsigned char* padding = NULL; int result = 0; if (from == NULL || to == NULL || rw == NULL || md == NULL) return 0; - int digest_size = EVP_MD_size(md); - int sig_size = RwModSize(rw); - - if (digest_size <= 0 || sig_size <= 0) - return 0; - - int tries = 50; - do { - if (padding != NULL) { - free(padding); -#ifdef DBG_FUZZING - fprintf(stderr, "Padding regenerating required\n"); -#endif - } - - padding = malloc(sig_size); - if (padding == NULL) - return 0; - - if (!RwPaddingAddPssr(rw, padding, from, md, digest_size)) - goto err; - } while (padding[0] == 0x00 && tries-- > 0); - - result = RwNoPaddingSign(sig_size, padding, to, rw); + int digest_size = EVP_MD_size(md); + int sig_size = RwModSize(rw); + + if (digest_size <= 0 || sig_size <= 0) + return 0; + + int tries = 50; + do { + if (padding != NULL) { + free(padding); +#ifdef DBG_FUZZING + fprintf(stderr, "Padding regenerating required\n"); +#endif + } + + padding = malloc(sig_size); + if (padding == NULL) + return 0; + + if (!RwPaddingAddPssr(rw, padding, from, md, digest_size)) + goto err; + } while (padding[0] == 0x00 && tries-- > 0); + + result = RwNoPaddingSign(sig_size, padding, to, rw); err: if (padding != NULL) - free(padding); + free(padding); return result; } -int RwPssrSignMsg(const int msgLen, const unsigned char* msg, unsigned char* to, TRwKey* rw, const EVP_MD* md) { +int RwPssrSignMsg(const int msgLen, const unsigned char* msg, unsigned char* to, TRwKey* rw, const EVP_MD* md) { EVP_MD_CTX* mdctx = NULL; unsigned char* digest = NULL; unsigned int digestLen; @@ -100,7 +100,7 @@ int RwPssrSignMsg(const int msgLen, const unsigned char* msg, unsigned char* to, if (msg == NULL || to == NULL || rw == NULL || md == NULL) goto err; - if (rw->P == NULL || rw->Q == NULL) + if (rw->P == NULL || rw->Q == NULL) goto err; if ((mdctx = EVP_MD_CTX_create()) == NULL) @@ -112,63 +112,63 @@ int RwPssrSignMsg(const int msgLen, const unsigned char* msg, unsigned char* to, if (1 != EVP_DigestUpdate(mdctx, msg, msgLen)) goto err; - if ((digest = (unsigned char*)malloc(EVP_MD_size(md))) == NULL) + if ((digest = (unsigned char*)malloc(EVP_MD_size(md))) == NULL) goto err; if (1 != EVP_DigestFinal_ex(mdctx, digest, &digestLen)) goto err; - result = RwPssrSignHash(digest, to, rw, md); + result = RwPssrSignHash(digest, to, rw, md); err: if (mdctx != NULL) EVP_MD_CTX_destroy(mdctx); if (digest != NULL) - free(digest); + free(digest); return result; } -int RwPssrVerifyHash(const unsigned char* from, const unsigned char* sig, const int sig_len, const TRwKey* rw, const EVP_MD* md) { +int RwPssrVerifyHash(const unsigned char* from, const unsigned char* sig, const int sig_len, const TRwKey* rw, const EVP_MD* md) { unsigned char* buffer = NULL; int buffer_len; - int salt_size; + int salt_size; int result = 0; if (from == NULL || sig == NULL || rw == NULL || md == NULL) return 0; - if (rw->N == NULL || rw->Meth == NULL) + if (rw->N == NULL || rw->Meth == NULL) return 0; salt_size = EVP_MD_size(md); - if (salt_size <= 0) - return 0; - - buffer_len = RwModSize(rw); - if (buffer_len <= 0) - return 0; - - buffer = (unsigned char*)malloc(buffer_len); - if (buffer == NULL) - return 0; + if (salt_size <= 0) + return 0; + + buffer_len = RwModSize(rw); + if (buffer_len <= 0) + return 0; + + buffer = (unsigned char*)malloc(buffer_len); + if (buffer == NULL) + return 0; - if (RwApply(sig_len, sig, buffer, rw) <= 0) + if (RwApply(sig_len, sig, buffer, rw) <= 0) goto err; - if (RwVerifyPssr(rw, from, md, buffer, salt_size) <= 0) + if (RwVerifyPssr(rw, from, md, buffer, salt_size) <= 0) goto err; result = 1; err: if (buffer != NULL) - free(buffer); + free(buffer); return result; } -int RwPssrVerifyMsg(const int msgLen, const unsigned char* msg, const unsigned char* sig, const int sig_len, const TRwKey* rw, const EVP_MD* md) { +int RwPssrVerifyMsg(const int msgLen, const unsigned char* msg, const unsigned char* sig, const int sig_len, const TRwKey* rw, const EVP_MD* md) { EVP_MD_CTX* mdctx = NULL; unsigned char* digest = NULL; unsigned int digestLen = 0; @@ -177,7 +177,7 @@ int RwPssrVerifyMsg(const int msgLen, const unsigned char* msg, const unsigned c if (msg == NULL || msgLen == 0 || sig == NULL || rw == NULL || md == NULL) goto err; - if (rw->N == NULL) + if (rw->N == NULL) goto err; if ((mdctx = EVP_MD_CTX_create()) == NULL) @@ -186,26 +186,26 @@ int RwPssrVerifyMsg(const int msgLen, const unsigned char* msg, const unsigned c if (1 != EVP_DigestInit_ex(mdctx, md, NULL)) goto err; - int size_to_alloc = EVP_MD_size(md); - if (size_to_alloc <= 0) - goto err; - - if ((digest = (unsigned char*)malloc(size_to_alloc)) == NULL) + int size_to_alloc = EVP_MD_size(md); + if (size_to_alloc <= 0) goto err; + if ((digest = (unsigned char*)malloc(size_to_alloc)) == NULL) + goto err; + if (1 != EVP_DigestUpdate(mdctx, msg, msgLen)) goto err; if (1 != EVP_DigestFinal_ex(mdctx, digest, &digestLen)) goto err; - result = RwPssrVerifyHash(digest, sig, sig_len, rw, md); + result = RwPssrVerifyHash(digest, sig, sig_len, rw, md); err: if (mdctx != NULL) EVP_MD_CTX_destroy(mdctx); if (digest != NULL) - free(digest); + free(digest); return result; } diff --git a/library/cpp/tvmauth/src/rw/rw_sign.c b/library/cpp/tvmauth/src/rw/rw_sign.c index e320808dd3..e070d6e7c1 100644 --- a/library/cpp/tvmauth/src/rw/rw_sign.c +++ b/library/cpp/tvmauth/src/rw/rw_sign.c @@ -1,36 +1,36 @@ #include "rw.h" -TRwSignature* RwSignatureNew(void) { - TRwSignature* sig = NULL; - sig = malloc(sizeof(TRwSignature)); +TRwSignature* RwSignatureNew(void) { + TRwSignature* sig = NULL; + sig = malloc(sizeof(TRwSignature)); if (!sig) return NULL; - sig->S = NULL; + sig->S = NULL; return sig; } -void RwSignatureFree(TRwSignature* sig) { +void RwSignatureFree(TRwSignature* sig) { if (sig) { - if (sig->S) - BN_free(sig->S); - free(sig); + if (sig->S) + BN_free(sig->S); + free(sig); } } -int RwNoPaddingSign(int flen, const unsigned char* from, unsigned char* to, TRwKey* rw) { - int i = 0, r = 0, num = -1; - TRwSignature* sig = NULL; +int RwNoPaddingSign(int flen, const unsigned char* from, unsigned char* to, TRwKey* rw) { + int i = 0, r = 0, num = -1; + TRwSignature* sig = NULL; - if (!rw || !rw->N || !rw->Meth || !rw->Meth->RwSign || !from || !to) + if (!rw || !rw->N || !rw->Meth || !rw->Meth->RwSign || !from || !to) + goto err; + + if ((sig = rw->Meth->RwSign(from, flen, rw)) == NULL) goto err; + num = BN_num_bytes(rw->N); - if ((sig = rw->Meth->RwSign(from, flen, rw)) == NULL) - goto err; - num = BN_num_bytes(rw->N); - - r = BN_bn2bin(sig->S, to); - if (r < 0) - goto err; + r = BN_bn2bin(sig->S, to); + if (r < 0) + goto err; /* put zeroes to the rest of the 'to' buffer */ for (i = r; i < num; i++) { @@ -39,7 +39,7 @@ int RwNoPaddingSign(int flen, const unsigned char* from, unsigned char* to, TRwK err: if (sig != NULL) { - RwSignatureFree(sig); + RwSignatureFree(sig); } return r; diff --git a/library/cpp/tvmauth/src/rw/ut/rw_ut.cpp b/library/cpp/tvmauth/src/rw/ut/rw_ut.cpp index 73f1b1d769..bef9d9d25a 100644 --- a/library/cpp/tvmauth/src/rw/ut/rw_ut.cpp +++ b/library/cpp/tvmauth/src/rw/ut/rw_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/tvmauth/src/rw/keys.h> -#include <library/cpp/tvmauth/src/rw/rw.h> +#include <library/cpp/tvmauth/src/rw/keys.h> +#include <library/cpp/tvmauth/src/rw/rw.h> #include <library/cpp/string_utils/base64/base64.h> #include <library/cpp/testing/unittest/registar.h> @@ -7,36 +7,36 @@ #include <contrib/libs/openssl/include/openssl/bn.h> #include <contrib/libs/openssl/include/openssl/evp.h> -namespace NTvmAuth { +namespace NTvmAuth { /* returns 0 in case of error */ - int MakeKeysRw(TRwKey** skey, TRwKey** vkey) { + int MakeKeysRw(TRwKey** skey, TRwKey** vkey) { int result = 0; - TRwKey* rw = RwNew(); + TRwKey* rw = RwNew(); do { - RwGenerateKey(rw, 2048); + RwGenerateKey(rw, 2048); if (rw == nullptr) { - printf("RwGenerateKey failed\n"); + printf("RwGenerateKey failed\n"); break; /* failed */ } - printf("RW key bits: %d\n", BN_num_bits(rw->N)); + printf("RW key bits: %d\n", BN_num_bits(rw->N)); /* Set signing key */ - *skey = RwPrivateKeyDup(rw); + *skey = RwPrivateKeyDup(rw); if (*skey == nullptr) { - printf("RwPrivateKeyDup failed\n"); + printf("RwPrivateKeyDup failed\n"); break; } /* Set verifier key */ - *vkey = RwPublicKeyDup(rw); + *vkey = RwPublicKeyDup(rw); if (*vkey == nullptr) { - printf("RwPublicKeyDup failed\n"); + printf("RwPublicKeyDup failed\n"); break; } @@ -45,14 +45,14 @@ namespace NTvmAuth { } while (0); if (rw) { - RwFree(rw); + RwFree(rw); rw = nullptr; } return result; } - static void PrintIt(const char* label, const unsigned char* buff, size_t len) { + static void PrintIt(const char* label, const unsigned char* buff, size_t len) { if (!buff || !len) return; @@ -65,26 +65,26 @@ namespace NTvmAuth { printf("\n"); } - int TestSignVerify() { - TRwKey *skey = nullptr, *vkey = nullptr; + int TestSignVerify() { + TRwKey *skey = nullptr, *vkey = nullptr; const char* msg = "Test test test test test"; unsigned int msg_len = 0; int res = 0; msg_len = (unsigned int)strlen(msg); - if (MakeKeysRw(&skey, &vkey)) { - unsigned char* sign = new unsigned char[RwModSize(skey) + 10]; - int sign_len; - printf("RwModSize(skey) returned %d\n", RwModSize(skey)); - memset(sign, 0x00, RwModSize(skey) + 10); + if (MakeKeysRw(&skey, &vkey)) { + unsigned char* sign = new unsigned char[RwModSize(skey) + 10]; + int sign_len; + printf("RwModSize(skey) returned %d\n", RwModSize(skey)); + memset(sign, 0x00, RwModSize(skey) + 10); printf("--- Signing call ---\n"); - if ((sign_len = RwPssrSignMsg(msg_len, (unsigned char*)msg, sign, skey, (EVP_MD*)EVP_sha256())) != 0) { + if ((sign_len = RwPssrSignMsg(msg_len, (unsigned char*)msg, sign, skey, (EVP_MD*)EVP_sha256())) != 0) { #ifdef RW_PRINT_DEBUG BIGNUM* s = BN_new(); #endif printf("\n"); - PrintIt("Signature", sign, RwModSize(skey)); + PrintIt("Signature", sign, RwModSize(skey)); #ifdef RW_PRINT_DEBUG BN_bin2bn(sign, RW_mod_size(skey), s); @@ -95,42 +95,42 @@ namespace NTvmAuth { #endif printf("--- Verification call ---\n"); - if (RwPssrVerifyMsg(msg_len, (unsigned char*)msg, sign, sign_len, vkey, (EVP_MD*)EVP_sha256())) { + if (RwPssrVerifyMsg(msg_len, (unsigned char*)msg, sign, sign_len, vkey, (EVP_MD*)EVP_sha256())) { printf("Verification: success!\n"); res = 1; } else { printf("Verification: failed!\n"); - printf("RwPssrVerifyMsg failed!\n"); + printf("RwPssrVerifyMsg failed!\n"); return 1; } } else { - printf("RwPssrSignMsg failed!\n"); + printf("RwPssrSignMsg failed!\n"); return 1; } if (sign != nullptr) - delete[] sign; + delete[] sign; } else { - printf("MakeKeysRw failed!\n"); + printf("MakeKeysRw failed!\n"); return 1; } if (skey != nullptr) { - RwFree(skey); + RwFree(skey); } if (vkey != nullptr) - RwFree(vkey); + RwFree(vkey); return res; } } -using namespace NTvmAuth; +using namespace NTvmAuth; Y_UNIT_TEST_SUITE(Rw) { Y_UNIT_TEST(SignVerify) { for (int i = 1; i < 10; ++i) { - UNIT_ASSERT_VALUES_EQUAL(1, TestSignVerify()); + UNIT_ASSERT_VALUES_EQUAL(1, TestSignVerify()); } } @@ -142,10 +142,10 @@ Y_UNIT_TEST_SUITE(Rw) { NRw::TRwPrivateKey priv3(Base64Decode("MIICVAKBgF9t2YJGAJkRRFq6fWhi3m1TFW1UOE0f6ZrfYhHAkpqGlKlh0QVfeTNPpeJhi75xXzCe6oReRUm-0DbqDNhTShC7uGUv1INYnRBQWH6E-5Fc5XrbDFSuGQw2EYjNfHy_HefHJXxQKAqPvxBDKMKkHgV58WtM6rC8jRi9sdX_ig2NAkEAg1xBDL_UkHy347HwioMscJFP-6eKeim3LoG9rd1EvOycxkoStZ4299OdyzzEXC9cjLdq401BXe-LairiMUgZawJBALn5ziBCc2ycMaYjZDon2EN55jBEe0tJdUy4mOi0ozTV9OLcBANds0nMYPjZFOY3QymzU0LcOa_An3JknI0C2ucCQGxtwTb3h7ux5Ld8jkeRYzkNoB2Y6Is5fqCYVRIJZmz0IcQFb2iW0EX92U7_BpgVuKlvSDTP9LuaxuPfmY6WXEECQBc_OcQITm2ThjTEbIdE-whvPMYIj2lpLqmXEx0WlGaavpxbgIBrtmk5jB8bIpzG6GU2amhbhzX4E-5Mk5GgW10CQBBriCGX-pIPlvx2PhFQZY4SKf908U9FNuXQN7W7qJedk5jJQlazxt76c7lnmIuF65GW7VxpqCu98W1FXEYpAy0CQG-lpihdvxaZ8SkHqNFZGnXhELT2YesLs7GehZSTwuUwx1iTpVm88PVROLYBDZqoGM316s9aZEJBALe5zEpxQTQCQQCDMszX1cQlbBCP08isuMQ2ac3S-qNd0mfRXDCRfMm4s7iuJ5MeHU3uPUVlA_MR4ULRbg1d97TGio912z4KPgjE"), 0); - UNIT_ASSERT_EXCEPTION(NRw::TRwPrivateKey("asdzxcv", 0), yexception); + UNIT_ASSERT_EXCEPTION(NRw::TRwPrivateKey("asdzxcv", 0), yexception); UNIT_ASSERT_EXCEPTION(NRw::TRwPrivateKey(Base64Decode("AKBgF9t2YJGAJkRRFq6fWhi3m1TFW1UOE0f6ZrfYhHAkpqGlKlh0QVfeTNPpeJhi75xXzCe6oReRUm-0DbqDNhTShC7uGUv1INYnRBQWH6E-5Fc5XrbDFSuGQw2EYjNfHy_HefHJXxQKAqPvxBDKMKkHgV58WtM6rC8jRi9sdX_ig2NAkEAg1xBDL_UkHy347HwioMscJFP-6eKeim3LoG9rd1EvOycxkoStZ4299OdyzzEXC9cjLdq401BXe-LairiMUgZawJBALn5ziBCc2ycMaYjZDon2EN55jBEe0tJdUy4mOi0ozTV9OLcBANds0nMYPjZFOY3QymzU0LcOa_An3JknI0C2ucCQGxtwTb3h7ux5Ld8jkeRYzkNoB2Y6Is5fqCYVRIJZmz0IcQFb2iW0EX92U7_BpgVuKlvSDTP9LuaxuPfmY6WXEECQBc_OcQITm2ThjTEbIdE-whvPMYIj2lpLqmXEx0WlGaavpxbgIBrtmk5jB8bIpzG6GU2amhbhzX4E-5Mk5GgW10CQBBriCGX-pIPlvx2PhFQZY4SKf908U9FNuXQN7W7qJedk5jJQlazxt76c7lnmIuF65GW7VxpqCu98W1FXEYpAy0CQG-lpihdvxaZ8SkHqNFZGnXhELT2YesLs7GehZSTwuUwx1iTpVm88PVROLYBDZqoGM316s9aZEJBALe5zEpxQTQCQQCDMszX1cQlbBCP08isuMQ2ac3S-qNd0mfRXDCRfMm4s7iuJ5MeHU3uPUVlA_MR4ULRbg1d97TGio912z4KP"), 0), - yexception); + yexception); UNIT_ASSERT(!priv.SignTicket("").empty()); } @@ -155,8 +155,8 @@ Y_UNIT_TEST_SUITE(Rw) { NRw::TRwPublicKey pub2(Base64Decode("MIIBBQKCAQEA4RATOfumLD1n6ICrW5biaAl9VldinczmkNPjpUWwc3gs8PnkCrtdnPFmpBwW3gjHdSNU1OuEg5A6K1o1xiGv9sU-jd88zQBOdK6E2zwnJnkK6bNusKE2H2CLqg3aMWCmTa9JbzSy1uO7wa-xCqqNUuCko-2lyv12HhL1ICIH951SHDa4qO1U5xZhhlUAnqWi9R4tYDeMiF41WdOjwT2fg8UkbusThmxa3yjCXjD7OyjshPtukN8Tl3UyGtV_s2CLnE3f28VAi-AVW8FtgL22xbGhuyEplXRrtF1E5oV7NSqxH1FS0SYROA8ffYQGV5tfx5WDFHiXDEP6BzoVfeBDRQ==")); NRw::TRwPublicKey pub3(Base64Decode("MIGDAoGAX23ZgkYAmRFEWrp9aGLebVMVbVQ4TR_pmt9iEcCSmoaUqWHRBV95M0-l4mGLvnFfMJ7qhF5FSb7QNuoM2FNKELu4ZS_Ug1idEFBYfoT7kVzletsMVK4ZDDYRiM18fL8d58clfFAoCo-_EEMowqQeBXnxa0zqsLyNGL2x1f-KDY0=")); - UNIT_ASSERT_EXCEPTION(NRw::TRwPublicKey("asdzxcv"), yexception); - UNIT_ASSERT_EXCEPTION(NRw::TRwPublicKey(Base64Decode("AoGAX23ZgkYAmRFEWrp9aGLebVMVbVQ4TR_pmt9iEcCSmoaUqWHRBV95M0-l4mGLvnFfMJ7qhF5FSb7QNuoM2FNKELu4ZS_Ug1idEFBYfoT7kVzletsMVK40")), yexception); + UNIT_ASSERT_EXCEPTION(NRw::TRwPublicKey("asdzxcv"), yexception); + UNIT_ASSERT_EXCEPTION(NRw::TRwPublicKey(Base64Decode("AoGAX23ZgkYAmRFEWrp9aGLebVMVbVQ4TR_pmt9iEcCSmoaUqWHRBV95M0-l4mGLvnFfMJ7qhF5FSb7QNuoM2FNKELu4ZS_Ug1idEFBYfoT7kVzletsMVK40")), yexception); UNIT_ASSERT(!pub.CheckSign("~~~", "~~~")); } @@ -181,20 +181,20 @@ Y_UNIT_TEST_SUITE(Rw) { } Y_UNIT_TEST(Keygen) { - for (size_t idx = 0; idx < 100; ++idx) { - NRw::TKeyPair pair = NRw::GenKeyPair(1024); - NRw::TRwPrivateKey priv(pair.Private, 0); - NRw::TRwPublicKey pub(pair.Public); - - const TString data = "my magic data"; - TStringStream s; - s << "data='" << data << "'."; - s << "private='" << Base64Encode(pair.Private) << "'."; - s << "public='" << Base64Encode(pair.Public) << "'."; - TString sign; - UNIT_ASSERT_NO_EXCEPTION_C(sign = priv.SignTicket(data), s.Str()); - s << "sign='" << Base64Encode(sign) << "'."; - UNIT_ASSERT_C(pub.CheckSign(data, sign), s.Str()); - } + for (size_t idx = 0; idx < 100; ++idx) { + NRw::TKeyPair pair = NRw::GenKeyPair(1024); + NRw::TRwPrivateKey priv(pair.Private, 0); + NRw::TRwPublicKey pub(pair.Public); + + const TString data = "my magic data"; + TStringStream s; + s << "data='" << data << "'."; + s << "private='" << Base64Encode(pair.Private) << "'."; + s << "public='" << Base64Encode(pair.Public) << "'."; + TString sign; + UNIT_ASSERT_NO_EXCEPTION_C(sign = priv.SignTicket(data), s.Str()); + s << "sign='" << Base64Encode(sign) << "'."; + UNIT_ASSERT_C(pub.CheckSign(data, sign), s.Str()); + } } } diff --git a/library/cpp/tvmauth/src/rw/ut/ya.make b/library/cpp/tvmauth/src/rw/ut/ya.make index 81dda79641..eccbf89bc1 100644 --- a/library/cpp/tvmauth/src/rw/ut/ya.make +++ b/library/cpp/tvmauth/src/rw/ut/ya.make @@ -1,10 +1,10 @@ -UNITTEST_FOR(library/cpp/tvmauth/src/rw) +UNITTEST_FOR(library/cpp/tvmauth/src/rw) -OWNER( - g:passport_infra - e-sidorov - ezaitov -) +OWNER( + g:passport_infra + e-sidorov + ezaitov +) SRCS( rw_ut.cpp diff --git a/library/cpp/tvmauth/src/rw/ut_large/gen/main.cpp b/library/cpp/tvmauth/src/rw/ut_large/gen/main.cpp index 31a599c996..792308f48b 100644 --- a/library/cpp/tvmauth/src/rw/ut_large/gen/main.cpp +++ b/library/cpp/tvmauth/src/rw/ut_large/gen/main.cpp @@ -1,32 +1,32 @@ -#include <library/cpp/tvmauth/src/rw/keys.h> - +#include <library/cpp/tvmauth/src/rw/keys.h> + #include <library/cpp/string_utils/base64/base64.h> - -#include <util/generic/yexception.h> - -using namespace NTvmAuth; - -const TString DATA = "my magic data"; - -int main(int, char**) { - const NRw::TKeyPair pair = NRw::GenKeyPair(1024); - const NRw::TRwPrivateKey priv(pair.Private, 0); - const NRw::TRwPublicKey pub(pair.Public); - - Cout << "data='" << DATA << "'." - << "private='" << Base64Encode(pair.Private) << "'." - << "public='" << Base64Encode(pair.Public) << "'."; - - TString sign; - try { - sign = priv.SignTicket(DATA); - Cout << "sign='" << Base64Encode(sign) << "'."; - Y_ENSURE(pub.CheckSign(DATA, sign)); - } catch (const std::exception& e) { - Cout << "what='" << e.what() << "'" << Endl; - return 1; - } - Cout << Endl; - - return 0; -} + +#include <util/generic/yexception.h> + +using namespace NTvmAuth; + +const TString DATA = "my magic data"; + +int main(int, char**) { + const NRw::TKeyPair pair = NRw::GenKeyPair(1024); + const NRw::TRwPrivateKey priv(pair.Private, 0); + const NRw::TRwPublicKey pub(pair.Public); + + Cout << "data='" << DATA << "'." + << "private='" << Base64Encode(pair.Private) << "'." + << "public='" << Base64Encode(pair.Public) << "'."; + + TString sign; + try { + sign = priv.SignTicket(DATA); + Cout << "sign='" << Base64Encode(sign) << "'."; + Y_ENSURE(pub.CheckSign(DATA, sign)); + } catch (const std::exception& e) { + Cout << "what='" << e.what() << "'" << Endl; + return 1; + } + Cout << Endl; + + return 0; +} diff --git a/library/cpp/tvmauth/src/rw/ut_large/gen/ya.make b/library/cpp/tvmauth/src/rw/ut_large/gen/ya.make index 7b62d5c726..cfe165160a 100644 --- a/library/cpp/tvmauth/src/rw/ut_large/gen/ya.make +++ b/library/cpp/tvmauth/src/rw/ut_large/gen/ya.make @@ -1,14 +1,14 @@ -PROGRAM() - -OWNER(g:passport_infra) - -SRCS( - main.cpp -) - -PEERDIR( +PROGRAM() + +OWNER(g:passport_infra) + +SRCS( + main.cpp +) + +PEERDIR( library/cpp/string_utils/base64 - library/cpp/tvmauth/src/rw -) - -END() + library/cpp/tvmauth/src/rw +) + +END() diff --git a/library/cpp/tvmauth/src/rw/ut_large/test.py b/library/cpp/tvmauth/src/rw/ut_large/test.py index 0cf95d9848..8fb0c0f91c 100644 --- a/library/cpp/tvmauth/src/rw/ut_large/test.py +++ b/library/cpp/tvmauth/src/rw/ut_large/test.py @@ -1,35 +1,35 @@ -from __future__ import print_function - -import os -import subprocess -import sys - -import yatest.common as yc - - -def test_fuzzing(): - errfile = './errfile' - outfile = './outfile' - env = os.environ.copy() - - for number in range(25000): - with open(errfile, 'w') as fe: - with open(outfile, 'w') as fo: - p = subprocess.Popen( - [ - yc.build_path('library/cpp/tvmauth/src/rw/ut_large/gen/gen'), - ], - env=env, - stdout=fo, - stderr=fe, - ) - code = p.wait() - - with open(errfile) as fe: - all = fe.read() - if all != '': - with open(outfile) as fo: - print(fo.read(), file=sys.stderr) - assert all == '' - - assert code == 0 +from __future__ import print_function + +import os +import subprocess +import sys + +import yatest.common as yc + + +def test_fuzzing(): + errfile = './errfile' + outfile = './outfile' + env = os.environ.copy() + + for number in range(25000): + with open(errfile, 'w') as fe: + with open(outfile, 'w') as fo: + p = subprocess.Popen( + [ + yc.build_path('library/cpp/tvmauth/src/rw/ut_large/gen/gen'), + ], + env=env, + stdout=fo, + stderr=fe, + ) + code = p.wait() + + with open(errfile) as fe: + all = fe.read() + if all != '': + with open(outfile) as fo: + print(fo.read(), file=sys.stderr) + assert all == '' + + assert code == 0 diff --git a/library/cpp/tvmauth/src/rw/ut_large/ya.make b/library/cpp/tvmauth/src/rw/ut_large/ya.make index 54f82065e7..f4095eef29 100644 --- a/library/cpp/tvmauth/src/rw/ut_large/ya.make +++ b/library/cpp/tvmauth/src/rw/ut_large/ya.make @@ -1,17 +1,17 @@ PY2TEST() - -OWNER(g:passport_infra) - + +OWNER(g:passport_infra) + TEST_SRCS(test.py) + +DEPENDS(library/cpp/tvmauth/src/rw/ut_large/gen) + +TAG(ya:fat) -DEPENDS(library/cpp/tvmauth/src/rw/ut_large/gen) - -TAG(ya:fat) - -SIZE(LARGE) - -END() - +SIZE(LARGE) + +END() + RECURSE( gen ) diff --git a/library/cpp/tvmauth/src/rw/ya.make b/library/cpp/tvmauth/src/rw/ya.make index e2ef68d416..fffadceb30 100644 --- a/library/cpp/tvmauth/src/rw/ya.make +++ b/library/cpp/tvmauth/src/rw/ya.make @@ -1,14 +1,14 @@ LIBRARY(ticket_parser) OWNER( - g:passport_infra + g:passport_infra e-sidorov - ezaitov + ezaitov ) PEERDIR( contrib/libs/openssl - library/cpp/openssl/init + library/cpp/openssl/init ) SRCS( @@ -23,8 +23,8 @@ SRCS( ) END() - -RECURSE_FOR_TESTS( - ut - ut_large -) + +RECURSE_FOR_TESTS( + ut + ut_large +) diff --git a/library/cpp/tvmauth/src/service_impl.cpp b/library/cpp/tvmauth/src/service_impl.cpp index 528a244647..b27727494c 100644 --- a/library/cpp/tvmauth/src/service_impl.cpp +++ b/library/cpp/tvmauth/src/service_impl.cpp @@ -3,139 +3,139 @@ #include "parser.h" #include "utils.h" -#include <library/cpp/tvmauth/exception.h> -#include <library/cpp/tvmauth/ticket_status.h> +#include <library/cpp/tvmauth/exception.h> +#include <library/cpp/tvmauth/ticket_status.h> #include <util/generic/strbuf.h> #include <util/string/cast.h> #include <util/string/split.h> -namespace NTvmAuth { - static const char* EX_MSG = "Method cannot be used in non-valid ticket"; - - TCheckedServiceTicket::TImpl::operator bool() const { - return (Status_ == ETicketStatus::Ok); +namespace NTvmAuth { + static const char* EX_MSG = "Method cannot be used in non-valid ticket"; + + TCheckedServiceTicket::TImpl::operator bool() const { + return (Status_ == ETicketStatus::Ok); } - TTvmId TCheckedServiceTicket::TImpl::GetSrc() const { - Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); - return ProtobufTicket_.service().srcclientid(); + TTvmId TCheckedServiceTicket::TImpl::GetSrc() const { + Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); + return ProtobufTicket_.service().srcclientid(); } - const TScopes& TCheckedServiceTicket::TImpl::GetScopes() const { - Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); - if (CachedScopes_.empty()) { - for (const auto& el : ProtobufTicket_.service().scopes()) { - CachedScopes_.push_back(el); + const TScopes& TCheckedServiceTicket::TImpl::GetScopes() const { + Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); + if (CachedScopes_.empty()) { + for (const auto& el : ProtobufTicket_.service().scopes()) { + CachedScopes_.push_back(el); } } - return CachedScopes_; + return CachedScopes_; } - bool TCheckedServiceTicket::TImpl::HasScope(TStringBuf scopeName) const { - Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); - return std::binary_search(ProtobufTicket_.service().scopes().begin(), ProtobufTicket_.service().scopes().end(), scopeName); + bool TCheckedServiceTicket::TImpl::HasScope(TStringBuf scopeName) const { + Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); + return std::binary_search(ProtobufTicket_.service().scopes().begin(), ProtobufTicket_.service().scopes().end(), scopeName); } - ETicketStatus TCheckedServiceTicket::TImpl::GetStatus() const { - return Status_; + ETicketStatus TCheckedServiceTicket::TImpl::GetStatus() const { + return Status_; } - time_t TCheckedServiceTicket::TImpl::GetExpirationTime() const { - Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); - return ProtobufTicket_.expirationtime(); + time_t TCheckedServiceTicket::TImpl::GetExpirationTime() const { + Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); + return ProtobufTicket_.expirationtime(); } - TString TCheckedServiceTicket::TImpl::DebugInfo() const { - if (CachedDebugInfo_) { - return CachedDebugInfo_; - } - - if (Status_ == ETicketStatus::Malformed) { - CachedDebugInfo_ = "status=malformed;"; - return CachedDebugInfo_; + TString TCheckedServiceTicket::TImpl::DebugInfo() const { + if (CachedDebugInfo_) { + return CachedDebugInfo_; + } + + if (Status_ == ETicketStatus::Malformed) { + CachedDebugInfo_ = "status=malformed;"; + return CachedDebugInfo_; } - + TString targetString = "ticket_type="; - targetString.reserve(256); - if (Status_ == ETicketStatus::InvalidTicketType) { + targetString.reserve(256); + if (Status_ == ETicketStatus::InvalidTicketType) { targetString.append("not-serv;"); - CachedDebugInfo_ = targetString; + CachedDebugInfo_ = targetString; return targetString; } - + targetString.append("serv"); - if (ProtobufTicket_.has_expirationtime()) - targetString.append(";expiration_time=").append(IntToString<10>(ProtobufTicket_.expirationtime())); - if (ProtobufTicket_.service().has_srcclientid()) { - targetString.append(";src=").append(IntToString<10>(ProtobufTicket_.service().srcclientid())); - } - if (ProtobufTicket_.service().has_dstclientid()) { - targetString.append(";dst=").append(IntToString<10>(ProtobufTicket_.service().dstclientid())); - } - for (const auto& scope : ProtobufTicket_.service().scopes()) { + if (ProtobufTicket_.has_expirationtime()) + targetString.append(";expiration_time=").append(IntToString<10>(ProtobufTicket_.expirationtime())); + if (ProtobufTicket_.service().has_srcclientid()) { + targetString.append(";src=").append(IntToString<10>(ProtobufTicket_.service().srcclientid())); + } + if (ProtobufTicket_.service().has_dstclientid()) { + targetString.append(";dst=").append(IntToString<10>(ProtobufTicket_.service().dstclientid())); + } + for (const auto& scope : ProtobufTicket_.service().scopes()) { targetString.append(";scope=").append(scope); } - if (ProtobufTicket_.service().has_issueruid()) { - targetString.append(";issuer_uid=").append(IntToString<10>(ProtobufTicket_.service().GetissuerUid())); - } + if (ProtobufTicket_.service().has_issueruid()) { + targetString.append(";issuer_uid=").append(IntToString<10>(ProtobufTicket_.service().GetissuerUid())); + } targetString.append(";"); - - CachedDebugInfo_ = targetString; + + CachedDebugInfo_ = targetString; return targetString; } - TMaybe<TUid> TCheckedServiceTicket::TImpl::GetIssuerUid() const { - Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); - return ProtobufTicket_.service().has_issueruid() - ? ProtobufTicket_.service().GetissuerUid() - : TMaybe<TUid>(); - } - - void TCheckedServiceTicket::TImpl::SetStatus(ETicketStatus status) { - Status_ = status; - } - - TCheckedServiceTicket::TImpl::TImpl(ETicketStatus status, ticket2::Ticket&& protobufTicket) - : Status_(status) - , ProtobufTicket_(std::move(protobufTicket)) + TMaybe<TUid> TCheckedServiceTicket::TImpl::GetIssuerUid() const { + Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); + return ProtobufTicket_.service().has_issueruid() + ? ProtobufTicket_.service().GetissuerUid() + : TMaybe<TUid>(); + } + + void TCheckedServiceTicket::TImpl::SetStatus(ETicketStatus status) { + Status_ = status; + } + + TCheckedServiceTicket::TImpl::TImpl(ETicketStatus status, ticket2::Ticket&& protobufTicket) + : Status_(status) + , ProtobufTicket_(std::move(protobufTicket)) { } - TServiceTicketImplPtr TCheckedServiceTicket::TImpl::CreateTicketForTests(ETicketStatus status, - TTvmId src, - TMaybe<TUid> issuerUid) { - ticket2::Ticket proto; - proto.mutable_service()->set_srcclientid(src); - proto.mutable_service()->set_dstclientid(100500); - if (issuerUid) { - proto.mutable_service()->set_issueruid(*issuerUid); - } - return MakeHolder<TImpl>(status, std::move(proto)); - } - - TServiceContext::TImpl::TImpl(TStringBuf secretBase64, TTvmId selfTvmId, TStringBuf tvmKeysResponse) - : Secret_(ParseSecret(secretBase64)) - , SelfTvmId_(selfTvmId) + TServiceTicketImplPtr TCheckedServiceTicket::TImpl::CreateTicketForTests(ETicketStatus status, + TTvmId src, + TMaybe<TUid> issuerUid) { + ticket2::Ticket proto; + proto.mutable_service()->set_srcclientid(src); + proto.mutable_service()->set_dstclientid(100500); + if (issuerUid) { + proto.mutable_service()->set_issueruid(*issuerUid); + } + return MakeHolder<TImpl>(status, std::move(proto)); + } + + TServiceContext::TImpl::TImpl(TStringBuf secretBase64, TTvmId selfTvmId, TStringBuf tvmKeysResponse) + : Secret_(ParseSecret(secretBase64)) + , SelfTvmId_(selfTvmId) { ResetKeys(tvmKeysResponse); } - TServiceContext::TImpl::TImpl(TTvmId selfTvmId, TStringBuf tvmKeysResponse) - : SelfTvmId_(selfTvmId) + TServiceContext::TImpl::TImpl(TTvmId selfTvmId, TStringBuf tvmKeysResponse) + : SelfTvmId_(selfTvmId) { ResetKeys(tvmKeysResponse); } - TServiceContext::TImpl::TImpl(TStringBuf secretBase64) - : Secret_(ParseSecret(secretBase64)) - { - } - + TServiceContext::TImpl::TImpl(TStringBuf secretBase64) + : Secret_(ParseSecret(secretBase64)) + { + } + void TServiceContext::TImpl::ResetKeys(TStringBuf tvmKeysResponse) { tvm_keys::Keys protoKeys; if (!protoKeys.ParseFromString(TParserTvmKeys::ParseStrV1(tvmKeysResponse))) { - ythrow TMalformedTvmKeysException() << "Malformed TVM keys"; + ythrow TMalformedTvmKeysException() << "Malformed TVM keys"; } NRw::TPublicKeys keys; @@ -146,41 +146,41 @@ namespace NTvmAuth { } if (keys.empty()) { - ythrow TEmptyTvmKeysException() << "Empty TVM keys"; + ythrow TEmptyTvmKeysException() << "Empty TVM keys"; } - Keys_ = std::move(keys); + Keys_ = std::move(keys); } TServiceTicketImplPtr TServiceContext::TImpl::Check(TStringBuf ticketBody) const { - if (Keys_.empty()) { - ythrow TEmptyTvmKeysException() << "Empty TVM keys"; - } - - TParserTickets::TRes res = TParserTickets::ParseV3(ticketBody, Keys_, TParserTickets::ServiceFlag()); - if (res.Status != ETicketStatus::Ok) { - return MakeHolder<TCheckedServiceTicket::TImpl>(res.Status, std::move(res.Ticket)); + if (Keys_.empty()) { + ythrow TEmptyTvmKeysException() << "Empty TVM keys"; + } + + TParserTickets::TRes res = TParserTickets::ParseV3(ticketBody, Keys_, TParserTickets::ServiceFlag()); + if (res.Status != ETicketStatus::Ok) { + return MakeHolder<TCheckedServiceTicket::TImpl>(res.Status, std::move(res.Ticket)); } - const ETicketStatus status = CheckProtobufServiceTicket(res.Ticket); - return MakeHolder<TCheckedServiceTicket::TImpl>(status, std::move(res.Ticket)); + const ETicketStatus status = CheckProtobufServiceTicket(res.Ticket); + return MakeHolder<TCheckedServiceTicket::TImpl>(status, std::move(res.Ticket)); } TString TServiceContext::TImpl::SignCgiParamsForTvm(TStringBuf ts, TStringBuf dst, TStringBuf scopes) const { - if (Secret_.Value().empty()) { - ythrow TMalformedTvmSecretException() << "Malformed TVM secret: it is empty"; + if (Secret_.Value().empty()) { + ythrow TMalformedTvmSecretException() << "Malformed TVM secret: it is empty"; } - return NUtils::SignCgiParamsForTvm(Secret_, ts, dst, scopes); + return NUtils::SignCgiParamsForTvm(Secret_, ts, dst, scopes); } - ETicketStatus TServiceContext::TImpl::CheckProtobufServiceTicket(const ticket2::Ticket& ticket) const { + ETicketStatus TServiceContext::TImpl::CheckProtobufServiceTicket(const ticket2::Ticket& ticket) const { if (!ticket.has_service()) { - return ETicketStatus::Malformed; + return ETicketStatus::Malformed; } - if (ticket.service().dstclientid() != SelfTvmId_) { - return ETicketStatus::InvalidDst; + if (ticket.service().dstclientid() != SelfTvmId_) { + return ETicketStatus::InvalidDst; } - return ETicketStatus::Ok; + return ETicketStatus::Ok; } TString TServiceContext::TImpl::ParseSecret(TStringBuf secretBase64) { @@ -188,16 +188,16 @@ namespace NTvmAuth { secretBase64.Chop(1); } - if (secretBase64.empty()) { - ythrow TMalformedTvmSecretException() << "Malformed TVM secret: it is empty"; - } - + if (secretBase64.empty()) { + ythrow TMalformedTvmSecretException() << "Malformed TVM secret: it is empty"; + } + const TString secret = NUtils::Base64url2bin(secretBase64); if (secret.empty()) { - ythrow TMalformedTvmSecretException() << "Malformed TVM secret: invalid base64url"; + ythrow TMalformedTvmSecretException() << "Malformed TVM secret: invalid base64url"; } return secret; } -} +} diff --git a/library/cpp/tvmauth/src/service_impl.h b/library/cpp/tvmauth/src/service_impl.h index 18dd4ec335..1009ea094b 100644 --- a/library/cpp/tvmauth/src/service_impl.h +++ b/library/cpp/tvmauth/src/service_impl.h @@ -1,59 +1,59 @@ #pragma once -#include <library/cpp/tvmauth/src/protos/ticket2.pb.h> -#include <library/cpp/tvmauth/src/protos/tvm_keys.pb.h> -#include <library/cpp/tvmauth/src/rw/keys.h> +#include <library/cpp/tvmauth/src/protos/ticket2.pb.h> +#include <library/cpp/tvmauth/src/protos/tvm_keys.pb.h> +#include <library/cpp/tvmauth/src/rw/keys.h> -#include <library/cpp/tvmauth/type.h> -#include <library/cpp/tvmauth/deprecated/service_context.h> +#include <library/cpp/tvmauth/type.h> +#include <library/cpp/tvmauth/deprecated/service_context.h> -#include <library/cpp/charset/ci_string.h> -#include <library/cpp/string_utils/secret_string/secret_string.h> - -#include <util/generic/maybe.h> +#include <library/cpp/charset/ci_string.h> +#include <library/cpp/string_utils/secret_string/secret_string.h> +#include <util/generic/maybe.h> + #include <string> -namespace NTvmAuth { - using TServiceTicketImplPtr = THolder<TCheckedServiceTicket::TImpl>; - class TCheckedServiceTicket::TImpl { +namespace NTvmAuth { + using TServiceTicketImplPtr = THolder<TCheckedServiceTicket::TImpl>; + class TCheckedServiceTicket::TImpl { public: explicit operator bool() const; - TTvmId GetSrc() const; + TTvmId GetSrc() const; const TScopes& GetScopes() const; bool HasScope(TStringBuf scopeName) const; - ETicketStatus GetStatus() const; + ETicketStatus GetStatus() const; time_t GetExpirationTime() const; TString DebugInfo() const; - TMaybe<TUid> GetIssuerUid() const; - - void SetStatus(ETicketStatus status); + TMaybe<TUid> GetIssuerUid() const; + void SetStatus(ETicketStatus status); + /*! * Constructor for creation invalid ticket storing error status in TServiceContext * @param status * @param protobufTicket */ - TImpl(ETicketStatus status, ticket2::Ticket&& protobufTicket); - - static TServiceTicketImplPtr CreateTicketForTests(ETicketStatus status, - TTvmId src, - TMaybe<TUid> issuerUid); + TImpl(ETicketStatus status, ticket2::Ticket&& protobufTicket); + static TServiceTicketImplPtr CreateTicketForTests(ETicketStatus status, + TTvmId src, + TMaybe<TUid> issuerUid); + private: - ETicketStatus Status_; - ticket2::Ticket ProtobufTicket_; - mutable TScopes CachedScopes_; - mutable TString CachedDebugInfo_; + ETicketStatus Status_; + ticket2::Ticket ProtobufTicket_; + mutable TScopes CachedScopes_; + mutable TString CachedDebugInfo_; }; class TServiceContext::TImpl { public: - TImpl(TStringBuf secretBase64, TTvmId selfTvmId, TStringBuf tvmKeysResponse); - TImpl(TTvmId selfTvmId, TStringBuf tvmKeysResponse); - TImpl(TStringBuf secretBase64); + TImpl(TStringBuf secretBase64, TTvmId selfTvmId, TStringBuf tvmKeysResponse); + TImpl(TTvmId selfTvmId, TStringBuf tvmKeysResponse); + TImpl(TStringBuf secretBase64); void ResetKeys(TStringBuf tvmKeysResponse); @@ -61,17 +61,17 @@ namespace NTvmAuth { TString SignCgiParamsForTvm(TStringBuf ts, TStringBuf dst, TStringBuf scopes = TStringBuf()) const; const NRw::TPublicKeys& GetKeys() const { // for tests - return Keys_; + return Keys_; } private: - ETicketStatus CheckProtobufServiceTicket(const ticket2::Ticket& ticket) const; + ETicketStatus CheckProtobufServiceTicket(const ticket2::Ticket& ticket) const; static TString ParseSecret(TStringBuf secretBase64); - NRw::TPublicKeys Keys_; - const NSecretString::TSecretString Secret_; - const TTvmId SelfTvmId_ = 0; + NRw::TPublicKeys Keys_; + const NSecretString::TSecretString Secret_; + const TTvmId SelfTvmId_ = 0; - ::google::protobuf::LogSilencer LogSilencer_; + ::google::protobuf::LogSilencer LogSilencer_; }; -} +} diff --git a/library/cpp/tvmauth/src/service_ticket.cpp b/library/cpp/tvmauth/src/service_ticket.cpp index 077049ef3a..70e9e60f66 100644 --- a/library/cpp/tvmauth/src/service_ticket.cpp +++ b/library/cpp/tvmauth/src/service_ticket.cpp @@ -1,41 +1,41 @@ -#include "service_impl.h" - -#include <library/cpp/tvmauth/checked_service_ticket.h> - -namespace NTvmAuth { - static const char* EX_MSG = "Ticket already moved out"; - - TCheckedServiceTicket::TCheckedServiceTicket(THolder<TImpl> impl) - : Impl_(std::move(impl)) - { - } - - TCheckedServiceTicket::TCheckedServiceTicket(TCheckedServiceTicket&& o) = default; - TCheckedServiceTicket& TCheckedServiceTicket::operator=(TCheckedServiceTicket&& o) = default; - TCheckedServiceTicket::~TCheckedServiceTicket() = default; - - TCheckedServiceTicket::operator bool() const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->operator bool(); - } - - TTvmId TCheckedServiceTicket::GetSrc() const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->GetSrc(); - } - - ETicketStatus TCheckedServiceTicket::GetStatus() const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->GetStatus(); - } - - TString TCheckedServiceTicket::DebugInfo() const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->DebugInfo(); - } - - TMaybe<TUid> TCheckedServiceTicket::GetIssuerUid() const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->GetIssuerUid(); - } -} +#include "service_impl.h" + +#include <library/cpp/tvmauth/checked_service_ticket.h> + +namespace NTvmAuth { + static const char* EX_MSG = "Ticket already moved out"; + + TCheckedServiceTicket::TCheckedServiceTicket(THolder<TImpl> impl) + : Impl_(std::move(impl)) + { + } + + TCheckedServiceTicket::TCheckedServiceTicket(TCheckedServiceTicket&& o) = default; + TCheckedServiceTicket& TCheckedServiceTicket::operator=(TCheckedServiceTicket&& o) = default; + TCheckedServiceTicket::~TCheckedServiceTicket() = default; + + TCheckedServiceTicket::operator bool() const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->operator bool(); + } + + TTvmId TCheckedServiceTicket::GetSrc() const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->GetSrc(); + } + + ETicketStatus TCheckedServiceTicket::GetStatus() const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->GetStatus(); + } + + TString TCheckedServiceTicket::DebugInfo() const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->DebugInfo(); + } + + TMaybe<TUid> TCheckedServiceTicket::GetIssuerUid() const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->GetIssuerUid(); + } +} diff --git a/library/cpp/tvmauth/src/status.cpp b/library/cpp/tvmauth/src/status.cpp index 1b08fc098f..fb871b40dc 100644 --- a/library/cpp/tvmauth/src/status.cpp +++ b/library/cpp/tvmauth/src/status.cpp @@ -1,32 +1,32 @@ -#include <library/cpp/tvmauth/ticket_status.h> +#include <library/cpp/tvmauth/ticket_status.h> -#include <util/generic/yexception.h> - -namespace NTvmAuth { - TStringBuf StatusToString(ETicketStatus st) { +#include <util/generic/yexception.h> + +namespace NTvmAuth { + TStringBuf StatusToString(ETicketStatus st) { switch (st) { - case ETicketStatus::Ok: + case ETicketStatus::Ok: return "OK"; - case ETicketStatus::Expired: + case ETicketStatus::Expired: return "Expired ticket"; - case ETicketStatus::InvalidBlackboxEnv: + case ETicketStatus::InvalidBlackboxEnv: return "Invalid BlackBox environment"; - case ETicketStatus::InvalidDst: + case ETicketStatus::InvalidDst: return "Invalid ticket destination"; - case ETicketStatus::InvalidTicketType: + case ETicketStatus::InvalidTicketType: return "Invalid ticket type"; - case ETicketStatus::Malformed: + case ETicketStatus::Malformed: return "Malformed ticket"; - case ETicketStatus::MissingKey: - return "Context does not have required key to check ticket: public keys are too old"; - case ETicketStatus::SignBroken: + case ETicketStatus::MissingKey: + return "Context does not have required key to check ticket: public keys are too old"; + case ETicketStatus::SignBroken: return "Invalid ticket signature"; - case ETicketStatus::UnsupportedVersion: + case ETicketStatus::UnsupportedVersion: return "Unsupported ticket version"; - case ETicketStatus::NoRoles: - return "Subject (src or defaultUid) does not have any roles in IDM"; + case ETicketStatus::NoRoles: + return "Subject (src or defaultUid) does not have any roles in IDM"; } - ythrow yexception() << "Unexpected status: " << static_cast<int>(st); + ythrow yexception() << "Unexpected status: " << static_cast<int>(st); } -} +} diff --git a/library/cpp/tvmauth/src/unittest.cpp b/library/cpp/tvmauth/src/unittest.cpp index 5133d79ea9..c0191d3fc6 100644 --- a/library/cpp/tvmauth/src/unittest.cpp +++ b/library/cpp/tvmauth/src/unittest.cpp @@ -1,14 +1,14 @@ -#include "service_impl.h" -#include "user_impl.h" - -#include <library/cpp/tvmauth/unittest.h> - -namespace NTvmAuth::NUnittest { - TCheckedServiceTicket CreateServiceTicket(ETicketStatus status, TTvmId src, TMaybe<TUid> issuerUid) { - return TCheckedServiceTicket(TCheckedServiceTicket::TImpl::CreateTicketForTests(status, src, issuerUid)); - } - - TCheckedUserTicket CreateUserTicket(ETicketStatus status, TUid defaultUid, const TScopes& scopes, const TUids& uids, EBlackboxEnv env) { - return TCheckedUserTicket(TCheckedUserTicket::TImpl::CreateTicketForTests(status, defaultUid, scopes, uids, env)); - } -} +#include "service_impl.h" +#include "user_impl.h" + +#include <library/cpp/tvmauth/unittest.h> + +namespace NTvmAuth::NUnittest { + TCheckedServiceTicket CreateServiceTicket(ETicketStatus status, TTvmId src, TMaybe<TUid> issuerUid) { + return TCheckedServiceTicket(TCheckedServiceTicket::TImpl::CreateTicketForTests(status, src, issuerUid)); + } + + TCheckedUserTicket CreateUserTicket(ETicketStatus status, TUid defaultUid, const TScopes& scopes, const TUids& uids, EBlackboxEnv env) { + return TCheckedUserTicket(TCheckedUserTicket::TImpl::CreateTicketForTests(status, defaultUid, scopes, uids, env)); + } +} diff --git a/library/cpp/tvmauth/src/user_impl.cpp b/library/cpp/tvmauth/src/user_impl.cpp index 33002968d2..2cd24f07aa 100644 --- a/library/cpp/tvmauth/src/user_impl.cpp +++ b/library/cpp/tvmauth/src/user_impl.cpp @@ -2,8 +2,8 @@ #include "parser.h" -#include <library/cpp/tvmauth/exception.h> -#include <library/cpp/tvmauth/ticket_status.h> +#include <library/cpp/tvmauth/exception.h> +#include <library/cpp/tvmauth/ticket_status.h> #include <util/generic/strbuf.h> #include <util/string/cast.h> @@ -11,9 +11,9 @@ #include <algorithm> -namespace NTvmAuth { - static const char* EX_MSG = "Method cannot be used in non-valid ticket"; - +namespace NTvmAuth { + static const char* EX_MSG = "Method cannot be used in non-valid ticket"; + TStringBuf GetBlackboxEnvAsString(EBlackboxEnv environment) { switch (environment) { case (EBlackboxEnv::Prod): @@ -31,77 +31,77 @@ namespace NTvmAuth { } } - TCheckedUserTicket::TImpl::operator bool() const { - return (Status_ == ETicketStatus::Ok); + TCheckedUserTicket::TImpl::operator bool() const { + return (Status_ == ETicketStatus::Ok); } - TUid TCheckedUserTicket::TImpl::GetDefaultUid() const { - Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); - return ProtobufTicket_.user().defaultuid(); + TUid TCheckedUserTicket::TImpl::GetDefaultUid() const { + Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); + return ProtobufTicket_.user().defaultuid(); } - time_t TCheckedUserTicket::TImpl::GetExpirationTime() const { - Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); - return ProtobufTicket_.expirationtime(); + time_t TCheckedUserTicket::TImpl::GetExpirationTime() const { + Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); + return ProtobufTicket_.expirationtime(); } - const TScopes& TCheckedUserTicket::TImpl::GetScopes() const { - Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); - if (CachedScopes_.empty()) { - for (const auto& el : ProtobufTicket_.user().scopes()) { - CachedScopes_.push_back(el); + const TScopes& TCheckedUserTicket::TImpl::GetScopes() const { + Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); + if (CachedScopes_.empty()) { + for (const auto& el : ProtobufTicket_.user().scopes()) { + CachedScopes_.push_back(el); } } - return CachedScopes_; + return CachedScopes_; } - bool TCheckedUserTicket::TImpl::HasScope(TStringBuf scopeName) const { - Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); - return std::binary_search(ProtobufTicket_.user().scopes().begin(), ProtobufTicket_.user().scopes().end(), scopeName); + bool TCheckedUserTicket::TImpl::HasScope(TStringBuf scopeName) const { + Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); + return std::binary_search(ProtobufTicket_.user().scopes().begin(), ProtobufTicket_.user().scopes().end(), scopeName); } - ETicketStatus TCheckedUserTicket::TImpl::GetStatus() const { - return Status_; + ETicketStatus TCheckedUserTicket::TImpl::GetStatus() const { + return Status_; } - const TUids& TCheckedUserTicket::TImpl::GetUids() const { - Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); - if (CachedUids_.empty()) { - for (const auto& user : ProtobufTicket_.user().users()) { - CachedUids_.push_back(user.uid()); + const TUids& TCheckedUserTicket::TImpl::GetUids() const { + Y_ENSURE_EX(bool(*this), TNotAllowedException() << EX_MSG); + if (CachedUids_.empty()) { + for (const auto& user : ProtobufTicket_.user().users()) { + CachedUids_.push_back(user.uid()); } } - return CachedUids_; + return CachedUids_; } - TString TCheckedUserTicket::TImpl::DebugInfo() const { - if (CachedDebugInfo_) { - return CachedDebugInfo_; - } - - if (Status_ == ETicketStatus::Malformed) { - CachedDebugInfo_ = "status=malformed;"; - return CachedDebugInfo_; + TString TCheckedUserTicket::TImpl::DebugInfo() const { + if (CachedDebugInfo_) { + return CachedDebugInfo_; + } + + if (Status_ == ETicketStatus::Malformed) { + CachedDebugInfo_ = "status=malformed;"; + return CachedDebugInfo_; } - + TString targetString = "ticket_type="; - targetString.reserve(256); - if (Status_ == ETicketStatus::InvalidTicketType) { + targetString.reserve(256); + if (Status_ == ETicketStatus::InvalidTicketType) { targetString.append("not-user;"); - CachedDebugInfo_ = targetString; + CachedDebugInfo_ = targetString; return targetString; } - + targetString.append("user"); - if (ProtobufTicket_.expirationtime() > 0) - targetString.append(";expiration_time=").append(IntToString<10>(ProtobufTicket_.expirationtime())); - for (const auto& scope : ProtobufTicket_.user().scopes()) { + if (ProtobufTicket_.expirationtime() > 0) + targetString.append(";expiration_time=").append(IntToString<10>(ProtobufTicket_.expirationtime())); + for (const auto& scope : ProtobufTicket_.user().scopes()) { targetString.append(";scope=").append(scope); } - - if (ProtobufTicket_.user().defaultuid() > 0) - targetString.append(";default_uid=").append(IntToString<10>(ProtobufTicket_.user().defaultuid())); - for (const auto& user : ProtobufTicket_.user().users()) { + + if (ProtobufTicket_.user().defaultuid() > 0) + targetString.append(";default_uid=").append(IntToString<10>(ProtobufTicket_.user().defaultuid())); + for (const auto& user : ProtobufTicket_.user().users()) { targetString.append(";uid=").append(IntToString<10>(user.uid())); } @@ -109,66 +109,66 @@ namespace NTvmAuth { EBlackboxEnv environment = static_cast<EBlackboxEnv>(ProtobufTicket_.user().env()); targetString.append(GetBlackboxEnvAsString(environment)); targetString.append(";"); - - CachedDebugInfo_ = targetString; + + CachedDebugInfo_ = targetString; return targetString; } - EBlackboxEnv TCheckedUserTicket::TImpl::GetEnv() const { - return (EBlackboxEnv)ProtobufTicket_.user().env(); - } - - void TCheckedUserTicket::TImpl::SetStatus(ETicketStatus status) { - Status_ = status; - } - - TCheckedUserTicket::TImpl::TImpl(ETicketStatus status, ticket2::Ticket&& protobufTicket) - : Status_(status) - , ProtobufTicket_(std::move(protobufTicket)) + EBlackboxEnv TCheckedUserTicket::TImpl::GetEnv() const { + return (EBlackboxEnv)ProtobufTicket_.user().env(); + } + + void TCheckedUserTicket::TImpl::SetStatus(ETicketStatus status) { + Status_ = status; + } + + TCheckedUserTicket::TImpl::TImpl(ETicketStatus status, ticket2::Ticket&& protobufTicket) + : Status_(status) + , ProtobufTicket_(std::move(protobufTicket)) { } - TUserTicketImplPtr TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus status, - TUid defaultUid, - TScopes scopes, - TUids uids, - EBlackboxEnv env) { - auto prepareCont = [](auto& cont) { - std::sort(cont.begin(), cont.end()); - cont.erase(std::unique(cont.begin(), cont.end()), cont.end()); - }; - auto erase = [](auto& cont, auto val) { - auto it = std::find(cont.begin(), cont.end(), val); - if (it != cont.end()) { - cont.erase(it); - } - }; - - prepareCont(scopes); - erase(scopes, ""); - - uids.push_back(defaultUid); - prepareCont(uids); - erase(uids, 0); - Y_ENSURE(!uids.empty(), "User ticket cannot contain empty uid list"); - - ticket2::Ticket proto; - for (TUid uid : uids) { - proto.mutable_user()->add_users()->set_uid(uid); - } - proto.mutable_user()->set_defaultuid(defaultUid); - proto.mutable_user()->set_entrypoint(100500); - for (TStringBuf scope : scopes) { - proto.mutable_user()->add_scopes(TString(scope)); - } - - proto.mutable_user()->set_env((tvm_keys::BbEnvType)env); - - return MakeHolder<TImpl>(status, std::move(proto)); - } - + TUserTicketImplPtr TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus status, + TUid defaultUid, + TScopes scopes, + TUids uids, + EBlackboxEnv env) { + auto prepareCont = [](auto& cont) { + std::sort(cont.begin(), cont.end()); + cont.erase(std::unique(cont.begin(), cont.end()), cont.end()); + }; + auto erase = [](auto& cont, auto val) { + auto it = std::find(cont.begin(), cont.end(), val); + if (it != cont.end()) { + cont.erase(it); + } + }; + + prepareCont(scopes); + erase(scopes, ""); + + uids.push_back(defaultUid); + prepareCont(uids); + erase(uids, 0); + Y_ENSURE(!uids.empty(), "User ticket cannot contain empty uid list"); + + ticket2::Ticket proto; + for (TUid uid : uids) { + proto.mutable_user()->add_users()->set_uid(uid); + } + proto.mutable_user()->set_defaultuid(defaultUid); + proto.mutable_user()->set_entrypoint(100500); + for (TStringBuf scope : scopes) { + proto.mutable_user()->add_scopes(TString(scope)); + } + + proto.mutable_user()->set_env((tvm_keys::BbEnvType)env); + + return MakeHolder<TImpl>(status, std::move(proto)); + } + TUserContext::TImpl::TImpl(EBlackboxEnv env, TStringBuf tvmKeysResponse) - : Env_(env) + : Env_(env) { ResetKeys(tvmKeysResponse); } @@ -176,66 +176,66 @@ namespace NTvmAuth { void TUserContext::TImpl::ResetKeys(TStringBuf tvmKeysResponse) { tvm_keys::Keys protoKeys; if (!protoKeys.ParseFromString(TParserTvmKeys::ParseStrV1(tvmKeysResponse))) { - ythrow TMalformedTvmKeysException() << "Malformed TVM keys"; + ythrow TMalformedTvmKeysException() << "Malformed TVM keys"; } NRw::TPublicKeys keys; for (int idx = 0; idx < protoKeys.bb_size(); ++idx) { const tvm_keys::BbKey& k = protoKeys.bb(idx); - if (IsAllowed(k.env())) { + if (IsAllowed(k.env())) { keys.emplace(k.gen().id(), k.gen().body()); } } if (keys.empty()) { - ythrow TEmptyTvmKeysException() << "Empty TVM keys"; + ythrow TEmptyTvmKeysException() << "Empty TVM keys"; } - Keys_ = std::move(keys); + Keys_ = std::move(keys); } TUserTicketImplPtr TUserContext::TImpl::Check(TStringBuf ticketBody) const { - TParserTickets::TRes res = TParserTickets::ParseV3(ticketBody, Keys_, TParserTickets::UserFlag()); - ETicketStatus status = CheckProtobufUserTicket(res.Ticket); + TParserTickets::TRes res = TParserTickets::ParseV3(ticketBody, Keys_, TParserTickets::UserFlag()); + ETicketStatus status = CheckProtobufUserTicket(res.Ticket); - if (res.Status != ETicketStatus::Ok && !(res.Status == ETicketStatus::MissingKey && status == ETicketStatus::InvalidBlackboxEnv)) { + if (res.Status != ETicketStatus::Ok && !(res.Status == ETicketStatus::MissingKey && status == ETicketStatus::InvalidBlackboxEnv)) { status = res.Status; } - return MakeHolder<TCheckedUserTicket::TImpl>(status, std::move(res.Ticket)); + return MakeHolder<TCheckedUserTicket::TImpl>(status, std::move(res.Ticket)); } - ETicketStatus TUserContext::TImpl::CheckProtobufUserTicket(const ticket2::Ticket& ticket) const { + ETicketStatus TUserContext::TImpl::CheckProtobufUserTicket(const ticket2::Ticket& ticket) const { if (!ticket.has_user()) { - return ETicketStatus::Malformed; + return ETicketStatus::Malformed; } - if (!IsAllowed(ticket.user().env())) { - return ETicketStatus::InvalidBlackboxEnv; + if (!IsAllowed(ticket.user().env())) { + return ETicketStatus::InvalidBlackboxEnv; } - return ETicketStatus::Ok; + return ETicketStatus::Ok; } const NRw::TPublicKeys& TUserContext::TImpl::GetKeys() const { - return Keys_; + return Keys_; } - bool TUserContext::TImpl::IsAllowed(tvm_keys::BbEnvType env) const { - if (env == tvm_keys::Prod && (Env_ == EBlackboxEnv::Prod || Env_ == EBlackboxEnv::Stress)) { + bool TUserContext::TImpl::IsAllowed(tvm_keys::BbEnvType env) const { + if (env == tvm_keys::Prod && (Env_ == EBlackboxEnv::Prod || Env_ == EBlackboxEnv::Stress)) { return true; } - if (env == tvm_keys::ProdYateam && Env_ == EBlackboxEnv::ProdYateam) { + if (env == tvm_keys::ProdYateam && Env_ == EBlackboxEnv::ProdYateam) { return true; } - if (env == tvm_keys::Test && Env_ == EBlackboxEnv::Test) { + if (env == tvm_keys::Test && Env_ == EBlackboxEnv::Test) { return true; } - if (env == tvm_keys::TestYateam && Env_ == EBlackboxEnv::TestYateam) { + if (env == tvm_keys::TestYateam && Env_ == EBlackboxEnv::TestYateam) { return true; } - if (env == tvm_keys::Stress && Env_ == EBlackboxEnv::Stress) { + if (env == tvm_keys::Stress && Env_ == EBlackboxEnv::Stress) { return true; } return false; } -} +} diff --git a/library/cpp/tvmauth/src/user_impl.h b/library/cpp/tvmauth/src/user_impl.h index e3f1099b90..7be3b9b4ea 100644 --- a/library/cpp/tvmauth/src/user_impl.h +++ b/library/cpp/tvmauth/src/user_impl.h @@ -1,18 +1,18 @@ #pragma once -#include <library/cpp/tvmauth/src/protos/ticket2.pb.h> -#include <library/cpp/tvmauth/src/protos/tvm_keys.pb.h> -#include <library/cpp/tvmauth/src/rw/keys.h> +#include <library/cpp/tvmauth/src/protos/ticket2.pb.h> +#include <library/cpp/tvmauth/src/protos/tvm_keys.pb.h> +#include <library/cpp/tvmauth/src/rw/keys.h> -#include <library/cpp/tvmauth/deprecated/user_context.h> +#include <library/cpp/tvmauth/deprecated/user_context.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <unordered_map> -namespace NTvmAuth { - using TUserTicketImplPtr = THolder<TCheckedUserTicket::TImpl>; - class TCheckedUserTicket::TImpl { +namespace NTvmAuth { + using TUserTicketImplPtr = THolder<TCheckedUserTicket::TImpl>; + class TCheckedUserTicket::TImpl { public: explicit operator bool() const; @@ -20,36 +20,36 @@ namespace NTvmAuth { time_t GetExpirationTime() const; const TScopes& GetScopes() const; bool HasScope(TStringBuf scopeName) const; - ETicketStatus GetStatus() const; + ETicketStatus GetStatus() const; const TUids& GetUids() const; TString DebugInfo() const; - EBlackboxEnv GetEnv() const; - - void SetStatus(ETicketStatus status); - + EBlackboxEnv GetEnv() const; + + void SetStatus(ETicketStatus status); + /*! * Constructor for creation invalid ticket storing error status in TServiceContext * @param status * @param protobufTicket */ - TImpl(ETicketStatus status, ticket2::Ticket&& protobufTicket); - - static TUserTicketImplPtr CreateTicketForTests(ETicketStatus status, - TUid defaultUid, - TScopes scopes, - TUids uids, - EBlackboxEnv env = EBlackboxEnv::Test); - + TImpl(ETicketStatus status, ticket2::Ticket&& protobufTicket); + + static TUserTicketImplPtr CreateTicketForTests(ETicketStatus status, + TUid defaultUid, + TScopes scopes, + TUids uids, + EBlackboxEnv env = EBlackboxEnv::Test); + private: static const int MaxUserCount = 15; - ETicketStatus Status_; - ticket2::Ticket ProtobufTicket_; - mutable TScopes CachedScopes_; - mutable TUids CachedUids_; - mutable TString CachedDebugInfo_; + ETicketStatus Status_; + ticket2::Ticket ProtobufTicket_; + mutable TScopes CachedScopes_; + mutable TUids CachedUids_; + mutable TString CachedDebugInfo_; }; class TUserContext::TImpl { @@ -60,13 +60,13 @@ namespace NTvmAuth { TUserTicketImplPtr Check(TStringBuf ticketBody) const; const NRw::TPublicKeys& GetKeys() const; - bool IsAllowed(tvm_keys::BbEnvType env) const; + bool IsAllowed(tvm_keys::BbEnvType env) const; private: - ETicketStatus CheckProtobufUserTicket(const ticket2::Ticket& ticket) const; + ETicketStatus CheckProtobufUserTicket(const ticket2::Ticket& ticket) const; - NRw::TPublicKeys Keys_; - EBlackboxEnv Env_; - ::google::protobuf::LogSilencer LogSilencer_; + NRw::TPublicKeys Keys_; + EBlackboxEnv Env_; + ::google::protobuf::LogSilencer LogSilencer_; }; -} +} diff --git a/library/cpp/tvmauth/src/user_ticket.cpp b/library/cpp/tvmauth/src/user_ticket.cpp index 3e4e0c0364..0df1d5157a 100644 --- a/library/cpp/tvmauth/src/user_ticket.cpp +++ b/library/cpp/tvmauth/src/user_ticket.cpp @@ -1,56 +1,56 @@ -#include "user_impl.h" - -#include <library/cpp/tvmauth/checked_user_ticket.h> - -namespace NTvmAuth { - static const char* EX_MSG = "Ticket already moved out"; - - TCheckedUserTicket::TCheckedUserTicket(THolder<TCheckedUserTicket::TImpl> impl) - : Impl_(std::move(impl)) - { - } - - TCheckedUserTicket::TCheckedUserTicket(TCheckedUserTicket&& o) = default; - TCheckedUserTicket::~TCheckedUserTicket() = default; - TCheckedUserTicket& TCheckedUserTicket::operator=(TCheckedUserTicket&& o) = default; - - TCheckedUserTicket::operator bool() const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->operator bool(); - } - - const TUids& TCheckedUserTicket::GetUids() const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->GetUids(); - } - - TUid TCheckedUserTicket::GetDefaultUid() const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->GetDefaultUid(); - } - - const TScopes& TCheckedUserTicket::GetScopes() const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->GetScopes(); - } - - bool TCheckedUserTicket::HasScope(TStringBuf scopeName) const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->HasScope(scopeName); - } - - ETicketStatus TCheckedUserTicket::GetStatus() const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->GetStatus(); - } - - TString TCheckedUserTicket::DebugInfo() const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->DebugInfo(); - } - - EBlackboxEnv TCheckedUserTicket::GetEnv() const { - Y_ENSURE(Impl_, EX_MSG); - return Impl_->GetEnv(); - } -} +#include "user_impl.h" + +#include <library/cpp/tvmauth/checked_user_ticket.h> + +namespace NTvmAuth { + static const char* EX_MSG = "Ticket already moved out"; + + TCheckedUserTicket::TCheckedUserTicket(THolder<TCheckedUserTicket::TImpl> impl) + : Impl_(std::move(impl)) + { + } + + TCheckedUserTicket::TCheckedUserTicket(TCheckedUserTicket&& o) = default; + TCheckedUserTicket::~TCheckedUserTicket() = default; + TCheckedUserTicket& TCheckedUserTicket::operator=(TCheckedUserTicket&& o) = default; + + TCheckedUserTicket::operator bool() const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->operator bool(); + } + + const TUids& TCheckedUserTicket::GetUids() const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->GetUids(); + } + + TUid TCheckedUserTicket::GetDefaultUid() const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->GetDefaultUid(); + } + + const TScopes& TCheckedUserTicket::GetScopes() const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->GetScopes(); + } + + bool TCheckedUserTicket::HasScope(TStringBuf scopeName) const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->HasScope(scopeName); + } + + ETicketStatus TCheckedUserTicket::GetStatus() const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->GetStatus(); + } + + TString TCheckedUserTicket::DebugInfo() const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->DebugInfo(); + } + + EBlackboxEnv TCheckedUserTicket::GetEnv() const { + Y_ENSURE(Impl_, EX_MSG); + return Impl_->GetEnv(); + } +} diff --git a/library/cpp/tvmauth/src/ut/parser_ut.cpp b/library/cpp/tvmauth/src/ut/parser_ut.cpp index 530f45331a..b6c6ef467b 100644 --- a/library/cpp/tvmauth/src/ut/parser_ut.cpp +++ b/library/cpp/tvmauth/src/ut/parser_ut.cpp @@ -1,13 +1,13 @@ -#include <library/cpp/tvmauth/src/parser.h> -#include <library/cpp/tvmauth/src/utils.h> +#include <library/cpp/tvmauth/src/parser.h> +#include <library/cpp/tvmauth/src/utils.h> -#include <library/cpp/tvmauth/exception.h> -#include <library/cpp/tvmauth/ticket_status.h> +#include <library/cpp/tvmauth/exception.h> +#include <library/cpp/tvmauth/ticket_status.h> #include <library/cpp/testing/unittest/registar.h> - + Y_UNIT_TEST_SUITE(ParserTestSuite) { - using namespace NTvmAuth; + using namespace NTvmAuth; Y_UNIT_TEST(Keys) { UNIT_ASSERT_EXCEPTION(TParserTvmKeys::ParseStrV1("2:asds"), TMalformedTvmKeysException); @@ -18,69 +18,69 @@ Y_UNIT_TEST_SUITE(ParserTestSuite) { } Y_UNIT_TEST(TicketsStrV3) { - UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Ok, + UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Ok, NUtils::Base64url2bin("CgYIDRCUkQYQDBgcIgdiYjpzZXNzIghiYjpzZXNzMg"), NUtils::Base64url2bin("ERmeH_yzC7K_QsoHTyw7llCsyExEz3CoEopPIuivA0ZAtTaFq_Pa0l9Fhhx_NX9WpOp2CPyY5cFc4PXhcO83jCB7-EGvHNxGN-j2NQalERzPiKqkDCO0Q5etLzSzrfTlvMz7sXDvELNBHyA0PkAQnbz4supY0l-0Q6JBYSEF3zOVMjjE-HeQIFL3ats3_PakaUMWRvgQQ88pVdYZqAtbDw9PlTla7ommygVZQjcfNFXV1pJKRgOCLs-YyCjOJHLKL04zYj0X6KsOCTUeqhj7ml96wLZ-g1X9tyOR2WAr2Ctq7wIEHwqhxOLgOSKqm05xH6Vi3E_hekf50oe2jPfKEA"), "3:serv:CgYIDRCUkQYQDBgcIgdiYjpzZXNzIghiYjpzZXNzMg:"}), TParserTickets::ParseStrV3("3:serv:CgYIDRCUkQYQDBgcIgdiYjpzZXNzIghiYjpzZXNzMg:ERmeH_yzC7K_QsoHTyw7llCsyExEz3CoEopPIuivA0ZAtTaFq_Pa0l9Fhhx_NX9WpOp2CPyY5cFc4PXhcO83jCB7-EGvHNxGN-j2NQalERzPiKqkDCO0Q5etLzSzrfTlvMz7sXDvELNBHyA0PkAQnbz4supY0l-0Q6JBYSEF3zOVMjjE-HeQIFL3ats3_PakaUMWRvgQQ88pVdYZqAtbDw9PlTla7ommygVZQjcfNFXV1pJKRgOCLs-YyCjOJHLKL04zYj0X6KsOCTUeqhj7ml96wLZ-g1X9tyOR2WAr2Ctq7wIEHwqhxOLgOSKqm05xH6Vi3E_hekf50oe2jPfKEA", TParserTickets::ServiceFlag())); - UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::UnsupportedVersion, + UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::UnsupportedVersion, {}, {}, {}}), TParserTickets::ParseStrV3("2:serv:CgYIDRCUkQYQDBgcIgdiYjpzZXNzIghiYjpzZXNzMg:ERmeH_yzC7K_QsoHTyw7llCsyExEz3CoEopPIuivA0ZAtTaFq_Pa0l9Fhhx_NX9WpOp2CPyY5cFc4PXhcO83jCB7-EGvHNxGN-j2NQalERzPiKqkDCO0Q5etLzSzrfTlvMz7sXDvELNBHyA0PkAQnbz4supY0l-0Q6JBYSEF3zOVMjjE-HeQIFL3ats3_PakaUMWRvgQQ88pVdYZqAtbDw9PlTla7ommygVZQjcfNFXV1pJKRgOCLs-YyCjOJHLKL04zYj0X6KsOCTUeqhj7ml96wLZ-g1X9tyOR2WAr2Ctq7wIEHwqhxOLgOSKqm05xH6Vi3E_hekf50oe2jPfKEA", TParserTickets::ServiceFlag())); - UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::InvalidTicketType, + UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::InvalidTicketType, {}, {}, {}}), TParserTickets::ParseStrV3("3:serv:CgYIDRCUkQYQDBgcIgdiYjpzZXNzIghiYjpzZXNzMg:ERmeH_yzC7K_QsoHTyw7llCsyExEz3CoEopPIuivA0ZAtTaFq_Pa0l9Fhhx_NX9WpOp2CPyY5cFc4PXhcO83jCB7-EGvHNxGN-j2NQalERzPiKqkDCO0Q5etLzSzrfTlvMz7sXDvELNBHyA0PkAQnbz4supY0l-0Q6JBYSEF3zOVMjjE-HeQIFL3ats3_PakaUMWRvgQQ88pVdYZqAtbDw9PlTla7ommygVZQjcfNFXV1pJKRgOCLs-YyCjOJHLKL04zYj0X6KsOCTUeqhj7ml96wLZ-g1X9tyOR2WAr2Ctq7wIEHwqhxOLgOSKqm05xH6Vi3E_hekf50oe2jPfKEA", TParserTickets::UserFlag())); - UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, + UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, {}, {}, {}}), TParserTickets::ParseStrV3("3:serv::ERmeH_yzC7K_QsoHTyw7llCsyExEz3CoEopPIuivA0ZAtTaFq_Pa0l9Fhhx_NX9WpOp2CPyY5cFc4PXhcO83jCB7-EGvHNxGN-j2NQalERzPiKqkDCO0Q5etLzSzrfTlvMz7sXDvELNBHyA0PkAQnbz4supY0l-0Q6JBYSEF3zOVMjjE-HeQIFL3ats3_PakaUMWRvgQQ88pVdYZqAtbDw9PlTla7ommygVZQjcfNFXV1pJKRgOCLs-YyCjOJHLKL04zYj0X6KsOCTUeqhj7ml96wLZ-g1X9tyOR2WAr2Ctq7wIEHwqhxOLgOSKqm05xH6Vi3E_hekf50oe2jPfKEA", TParserTickets::ServiceFlag())); - UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, + UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, {}, {}, {}}), TParserTickets::ParseStrV3("3:serv:CgYIDRCUkQYQDBgcIgdiYjpzZXNzIghiYjpzZXNzMg:", TParserTickets::ServiceFlag())); - UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, + UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, {}, {}, {}}), TParserTickets::ParseStrV3("3:serv:CgYIDRCUkQYQDBgcIgdiYjpzZXNzIghiYjpzZXNzMg:ERmeH_yzC7K_QsoHTyw7llCsyExEz3CoEopPIuivA0ZAtTaFq_Pa0l9Fhhx_NX9WpOp2CPyY5cFc4PXhcO83jCB7-EGvHNxGN-j2NQalERzPiKqkDCO0Q5etLzSzrfTlvMz7sXDvELNBHyA0PkAQnbz4supY0l-0Q6JBYSEF3zOVMjjE-HeQIFL3ats3_PakaUMWRvgQQ88pVdYZqAtbDw9PlTla7ommygVZQjcfNFXV1pJKRgOCLs-YyCjOJHLKL04zYj0X6KsOCTUeqhj7ml96wLZ-g1X9tyOR2WAr2Ctq7wIEHwqhxOLgOSKqm05xH6Vi3E_hekf50oe2jPfKEA:asd", TParserTickets::ServiceFlag())); - UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, + UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, {}, {}, {}}), TParserTickets::ParseStrV3("3:serv:CgY+-*/IDRCUkQYQDBgcIgdiYjpzZXNzIghiYjpzZXNzMg:ERmeH_yzC7K_QsoHTyw7llCsyExEz3CoEopPIuivA0ZAtTaFq_Pa0l9Fhhx_NX9WpOp2CPyY5cFc4PXhcO83jCB7-EGvHNxGN-j2NQalERzPiKqkDCO0Q5etLzSzrfTlvMz7sXDvELNBHyA0PkAQnbz4supY0l-0Q6JBYSEF3zOVMjjE-HeQIFL3ats3_PakaUMWRvgQQ88pVdYZqAtbDw9PlTla7ommygVZQjcfNFXV1pJKRgOCLs-YyCjOJHLKL04zYj0X6KsOCTUeqhj7ml96wLZ-g1X9tyOR2WAr2Ctq7wIEHwqhxOLgOSKqm05xH6Vi3E_hekf50oe2jPfKEA", TParserTickets::ServiceFlag())); - UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, + UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, {}, {}, {}}), TParserTickets::ParseStrV3("3:serv:CgYIDRCUkQYQDBgcIgdiYjpzZXNzIghiYjpzZXNzMg:ERme/*-+H_yzC7K_QsoHTyw7llCsyExEz3CoEopPIuivA0ZAtTaFq_Pa0l9Fhhx_NX9WpOp2CPyY5cFc4PXhcO83jCB7-EGvHNxGN-j2NQalERzPiKqkDCO0Q5etLzSzrfTlvMz7sXDvELNBHyA0PkAQnbz4supY0l-0Q6JBYSEF3zOVMjjE-HeQIFL3ats3_PakaUMWRvgQQ88pVdYZqAtbDw9PlTla7ommygVZQjcfNFXV1pJKRgOCLs-YyCjOJHLKL04zYj0X6KsOCTUeqhj7ml96wLZ-g1X9tyOR2WAr2Ctq7wIEHwqhxOLgOSKqm05xH6Vi3E_hekf50oe2jPfKEA", TParserTickets::ServiceFlag())); - UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, - {}, - {}, - {}}), - TParserTickets::ParseStrV3("", - TParserTickets::ServiceFlag())); - UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, - {}, - {}, - {}}), - TParserTickets::ParseStrV3("'", - TParserTickets::ServiceFlag())); + UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, + {}, + {}, + {}}), + TParserTickets::ParseStrV3("", + TParserTickets::ServiceFlag())); + UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Malformed, + {}, + {}, + {}}), + TParserTickets::ParseStrV3("'", + TParserTickets::ServiceFlag())); // Invalid proto - UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Ok, + UNIT_ASSERT_EQUAL(TParserTickets::TStrRes({ETicketStatus::Ok, NUtils::Base64url2bin("YIDRCUkQYBgcIgdiYjpzZXNzIghiYjpzZXNzMg"), NUtils::Base64url2bin("ERmeH_yzC7K_QsoHTyw7llCsyExEz3CoEopPIuivA0ZAtTaFq_Pa0l9Fhhx_NX9WpOp2CPyY5cFc4PXhcO83jCB7-EGvHNxGN-j2NQalERzPiKqkDCO0Q5etLzSzrfTlvMz7sXDvELNBHyA0PkAQnbz4supY0l-0Q6JBYSEF3zOVMjjE-HeQIFL3ats3_PakaUMWRvgQQ88pVdYZqAtbDw9PlTla7ommygVZQjcfNFXV1pJKRgOCLs-YyCjOJHLKL04zYj0X6KsOCTUeqhj7ml96wLZ-g1X9tyOR2WAr2Ctq7wIEHwqhxOLgOSKqm05xH6Vi3E_hekf50oe2jPfKEA"), "3:serv:YIDRCUkQYBgcIgdiYjpzZXNzIghiYjpzZXNzMg:"}), @@ -91,50 +91,50 @@ Y_UNIT_TEST_SUITE(ParserTestSuite) { Y_UNIT_TEST(TicketsV3) { NRw::TPublicKeys pub; - UNIT_ASSERT_EQUAL(ETicketStatus::Malformed, + UNIT_ASSERT_EQUAL(ETicketStatus::Malformed, TParserTickets::ParseV3("3:serv:CgYIDRCUkQYQDBgcIgdiYjpzZXNzIghiYjpzZXNzMg:ERme/*-+H_yzC7K_QsoHTyw7llCsyExEz3CoEopPIuivA0ZAtTaFq_Pa0l9Fhhx_NX9WpOp2CPyY5cFc4PXhcO83jCB7-EGvHNxGN-j2NQalERzPiKqkDCO0Q5etLzSzrfTlvMz7sXDvELNBHyA0PkAQnbz4supY0l-0Q6JBYSEF3zOVMjjE-HeQIFL3ats3_PakaUMWRvgQQ88pVdYZqAtbDw9PlTla7ommygVZQjcfNFXV1pJKRgOCLs-YyCjOJHLKL04zYj0X6KsOCTUeqhj7ml96wLZ-g1X9tyOR2WAr2Ctq7wIEHwqhxOLgOSKqm05xH6Vi3E_hekf50oe2jPfKEA", pub, TParserTickets::ServiceFlag()) .Status); // Invalid proto - UNIT_ASSERT_EQUAL(ETicketStatus::Malformed, + UNIT_ASSERT_EQUAL(ETicketStatus::Malformed, TParserTickets::ParseV3("3:serv:YIDRCUkQYBgcIgdiYjpzZXNzIghiYjpzZXNzMg:ERmeH_yzC7K_QsoHTyw7llCsyExEz3CoEopPIuivA0ZAtTaFq_Pa0l9Fhhx_NX9WpOp2CPyY5cFc4PXhcO83jCB7-EGvHNxGN-j2NQalERzPiKqkDCO0Q5etLzSzrfTlvMz7sXDvELNBHyA0PkAQnbz4supY0l-0Q6JBYSEF3zOVMjjE-HeQIFL3ats3_PakaUMWRvgQQ88pVdYZqAtbDw9PlTla7ommygVZQjcfNFXV1pJKRgOCLs-YyCjOJHLKL04zYj0X6KsOCTUeqhj7ml96wLZ-g1X9tyOR2WAr2Ctq7wIEHwqhxOLgOSKqm05xH6Vi3E_hekf50oe2jPfKEA", pub, TParserTickets::ServiceFlag()) .Status); // Expire time == 100500 - UNIT_ASSERT_EQUAL(ETicketStatus::Expired, + UNIT_ASSERT_EQUAL(ETicketStatus::Expired, TParserTickets::ParseV3("3:serv:CBAQlJEGIhcIDBAcGgdiYjpzZXNzGghiYjpzZXNzMg:HEzPbsjULegBvgX3nqwFX0GfVhESmN1kEWyeT7U03KAR-sQnNYgm6IuN-b9-lQYQKAJSW6p8ffyucC1yDrWSWRxXVzHJUxAVW4hnbiFDtXrurnEdpMK3izKbmTY25PJ4vH3_TkRXk-_oSAE8RvIFKXlh-aw1tezbXBUpJKvyJ0w", pub, TParserTickets::ServiceFlag()) .Status); - UNIT_ASSERT_EQUAL(ETicketStatus::MissingKey, + UNIT_ASSERT_EQUAL(ETicketStatus::MissingKey, TParserTickets::ParseV3("3:serv:CBAQ__________9_IhcIDBAcGgdiYjpzZXNzGghiYjpzZXNzMg:OKjKEbygehEZWH0XEeLzvf0q0aS0VvSk_CKSXGdpqxPbE4RzU70jeM-X9rXVpbYjt76VgBLlBpumJdyiclulfGPDPiL8nwJuu8AnWIR_o-QqyXbsloo2_syE6w2aYw2Yw_5_qjnipYdxGUWegHAGCj3yeMde6O2BmNZ0OCfg6qU", pub, TParserTickets::ServiceFlag()) .Status); pub.emplace(16, NRw::TRwPublicKey(NUtils::Base64url2bin("MIGEAoGBALhrihbf3EpjDQS2sCQHazoFgN0nBbE9eesnnFTfzQELXb2gnJU9enmV_aDqaHKjgtLIPpCgn40lHrn5k6mvH5OdedyI6cCzE-N-GFp3nAq0NDJyMe0fhtIRD__CbT0ulcvkeow65ubXWfw6dBC2gR_34rdMe_L_TGRLMWjDULbN"))); - UNIT_ASSERT_EQUAL(ETicketStatus::SignBroken, + UNIT_ASSERT_EQUAL(ETicketStatus::SignBroken, TParserTickets::ParseV3("3:serv:CBAQ__________9_IhcIDBAcGgdiYjpzZXNzGghiYjpzZXNzMa:OKjKEbygehEZWH0XEeLzvf0q0aS0VvSk_CKSXGdpqxPbE4RzU70jeM-X9rXVpbYjt76VgBLlBpumJdyiclulfGPDPiL8nwJuu8AnWIR_o-QqyXbsloo2_syE6w2aYw2Yw_5_qjnipYdxGUWegHAGCj3yeMde6O2BmNZ0OCfg6qU", pub, TParserTickets::ServiceFlag()) .Status); - UNIT_ASSERT_EQUAL(ETicketStatus::SignBroken, + UNIT_ASSERT_EQUAL(ETicketStatus::SignBroken, TParserTickets::ParseV3("3:serv:CBAQ__________9_IhcIDBAcGgdiYjpzZXNzGghiYjpzZXNzMg:OKjKEbygehEZWH0XEeLzvf0q0aS0VvSk_CKSXGdpqxPbE4RzU70jeM-X9rXVpbYjt76VgBLlBpumJdyiclulfGPDPiL8nwJuu8AnWIR_o-QqyXbsloo2_syE6w2aYw2Yw_5_qjnipYdxGUWegHAGCj3yeMde6O2BmNZ0OCfg6qa", pub, TParserTickets::ServiceFlag()) .Status); - UNIT_ASSERT_EQUAL(ETicketStatus::SignBroken, - TParserTickets::ParseV3("3:serv:CBAQ__________9_IhcIDBAcGgdiYjpzZXNzGghiYjpzZXNzMg:EbygehEZWH0XEeLzvf0q0aS0VvSk_CKSXGdpqxPbE4RzU70jeM-X9rXVpbYjt76VgBLlBpumJdyiclulfGPDPiL8nwJuu8AnWIR_o-QqyXbsloo2_syE6w2aYw2Yw_5_qjnipYdxGUWegHAGCj3yeMde6O2BmNZ0OCfg6qU", + UNIT_ASSERT_EQUAL(ETicketStatus::SignBroken, + TParserTickets::ParseV3("3:serv:CBAQ__________9_IhcIDBAcGgdiYjpzZXNzGghiYjpzZXNzMg:EbygehEZWH0XEeLzvf0q0aS0VvSk_CKSXGdpqxPbE4RzU70jeM-X9rXVpbYjt76VgBLlBpumJdyiclulfGPDPiL8nwJuu8AnWIR_o-QqyXbsloo2_syE6w2aYw2Yw_5_qjnipYdxGUWegHAGCj3yeMde6O2BmNZ0OCfg6qU", pub, TParserTickets::ServiceFlag()) .Status); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, TParserTickets::ParseV3("3:serv:CBAQ__________9_IhcIDBAcGgdiYjpzZXNzGghiYjpzZXNzMg:OKjKEbygehEZWH0XEeLzvf0q0aS0VvSk_CKSXGdpqxPbE4RzU70jeM-X9rXVpbYjt76VgBLlBpumJdyiclulfGPDPiL8nwJuu8AnWIR_o-QqyXbsloo2_syE6w2aYw2Yw_5_qjnipYdxGUWegHAGCj3yeMde6O2BmNZ0OCfg6qU", pub, TParserTickets::ServiceFlag()) diff --git a/library/cpp/tvmauth/src/ut/public_ut.cpp b/library/cpp/tvmauth/src/ut/public_ut.cpp index 74a483d57b..ba7c5afa86 100644 --- a/library/cpp/tvmauth/src/ut/public_ut.cpp +++ b/library/cpp/tvmauth/src/ut/public_ut.cpp @@ -1,197 +1,197 @@ -// DO_NOT_STYLE -#include <library/cpp/tvmauth/src/service_impl.h> -#include <library/cpp/tvmauth/src/user_impl.h> +// DO_NOT_STYLE +#include <library/cpp/tvmauth/src/service_impl.h> +#include <library/cpp/tvmauth/src/user_impl.h> -#include <library/cpp/tvmauth/exception.h> -#include <library/cpp/tvmauth/ticket_status.h> -#include <library/cpp/tvmauth/unittest.h> +#include <library/cpp/tvmauth/exception.h> +#include <library/cpp/tvmauth/ticket_status.h> +#include <library/cpp/tvmauth/unittest.h> #include <library/cpp/testing/unittest/registar.h> - -using namespace NTvmAuth; - + +using namespace NTvmAuth; + Y_UNIT_TEST_SUITE(CommonPublicInterfaceTestSuite){ Y_UNIT_TEST(StatusTest){ UNIT_ASSERT_VALUES_EQUAL("OK", - StatusToString(ETicketStatus::Ok)); + StatusToString(ETicketStatus::Ok)); UNIT_ASSERT_VALUES_EQUAL("Expired ticket", - StatusToString(ETicketStatus::Expired)); + StatusToString(ETicketStatus::Expired)); UNIT_ASSERT_VALUES_EQUAL("Invalid BlackBox environment", - StatusToString(ETicketStatus::InvalidBlackboxEnv)); + StatusToString(ETicketStatus::InvalidBlackboxEnv)); UNIT_ASSERT_VALUES_EQUAL("Invalid ticket destination", - StatusToString(ETicketStatus::InvalidDst)); + StatusToString(ETicketStatus::InvalidDst)); UNIT_ASSERT_VALUES_EQUAL("Invalid ticket type", - StatusToString(ETicketStatus::InvalidTicketType)); + StatusToString(ETicketStatus::InvalidTicketType)); UNIT_ASSERT_VALUES_EQUAL("Malformed ticket", - StatusToString(ETicketStatus::Malformed)); + StatusToString(ETicketStatus::Malformed)); UNIT_ASSERT_VALUES_EQUAL("Invalid ticket signature", - StatusToString(ETicketStatus::SignBroken)); + StatusToString(ETicketStatus::SignBroken)); UNIT_ASSERT_VALUES_EQUAL("Context does not have required key to check ticket: public keys are too old", - StatusToString(ETicketStatus::MissingKey)); + StatusToString(ETicketStatus::MissingKey)); UNIT_ASSERT_VALUES_EQUAL("Unsupported ticket version", - StatusToString(ETicketStatus::UnsupportedVersion)); + StatusToString(ETicketStatus::UnsupportedVersion)); } -} +} Y_UNIT_TEST_SUITE(PublicInterfaceServiceTestSuite) { static const TString EMPTY_TVM_KEYS = "1:CpgCCpMCCAEQABqIAjCCAQQCggEAcLEXeH67FQESFUn4_7wnX7wN0PUrBoUsm3QQ4W5vC-qz6sXaEjSwnTV8w1o-z6X9KPLlhzMQvuS38NCNfK4uvJ4Zvfp3YsXJ25-rYtbnrYJHNvHohD-kPCCw_yZpMp21JdWigzQGuV7CtrxUhF-NNrsnUaJrE5-OpEWNt4X6nCItKIYeVcSK6XJUbEWbrNCRbvkSc4ak2ymFeMuHYJVjxh4eQbk7_ZPzodP0WvF6eUYrYeb42imVEOR8ofVLQWE5DVnb1z_TqZm4i1XkS7jMwZuBxBRw8DGdYei0lT_sAf7KST2jC0590NySB3vsBgWEVs1OdUUWA6r-Dvx9dsOQtSCVkQYQAAqZAgqUAggCEAAaiQIwggEFAoIBAQDhEBM5-6YsPWfogKtbluJoCX1WV2KdzOaQ0-OlRbBzeCzw-eQKu12c8WakHBbeCMd1I1TU64SDkDorWjXGIa_2xT6N3zzNAE50roTbPCcmeQrps26woTYfYIuqDdoxYKZNr0lvNLLW47vBr7EKqo1S4KSj7aXK_XYeEvUgIgf3nVIcNrio7VTnFmGGVQCepaL1Hi1gN4yIXjVZ06PBPZ-DxSRu6xOGbFrfKMJeMPs7KOyE-26Q3xOXdTIa1X-zYIucTd_bxUCL4BVbwW2AvbbFsaG7ISmVdGu0XUTmhXs1KrEfUVLRJhE4Dx99hAZXm1_HlYMUeJcMQ_oHOhV94ENFIJaRBhACCpYBCpEBCAMQABqGATCBgwKBgF9t2YJGAJkRRFq6fWhi3m1TFW1UOE0f6ZrfYhHAkpqGlKlh0QVfeTNPpeJhi75xXzCe6oReRUm-0DbqDNhTShC7uGUv1INYnRBQWH6E-5Fc5XrbDFSuGQw2EYjNfHy_HefHJXxQKAqPvxBDKMKkHgV58WtM6rC8jRi9sdX_ig2NIJeRBhABCpYBCpEBCAQQABqGATCBgwKBgGB4d6eLGUBv-Q6EPLehC4S-yuE2HB-_rJ7WkeYwyp-xIPolPrd-PQme2utHB4ZgpXHIu_OFksDe_0bPgZniNRSVRbl7W49DgS5Ya3kMfrYB4DnF5Fta5tn1oV6EwxYD4JONpFTenOJALPGTPawxXEfon_peiHOSBuQMu3_Vn-l1IJiRBhADCpcBCpIBCAUQABqHATCBhAKBgQCTJMKIfmfeZpaI7Q9rnsc29gdWawK7TnpVKRHws1iY7EUlYROeVcMdAwEqVM6f8BVCKLGgzQ7Gar_uuxfUGKwqEQzoppDraw4F75J464-7D5f6_oJQuGIBHZxqbMONtLjBCXRUhQW5szBLmTQ_R3qaJb5vf-h0APZfkYhq1cTttSCZkQYQBAqWAQqRAQgLEAAahgEwgYMCgYBvvGVH_M2H8qxxv94yaDYUTWbRnJ1uiIYc59KIQlfFimMPhSS7x2tqUa2-hI55JiII0Xym6GNkwLhyc1xtWChpVuIdSnbvttbrt4weDMLHqTwNOF6qAsVKGKT1Yh8yf-qb-DSmicgvFc74mBQm_6gAY1iQsf33YX8578ClhKBWHSCVkQYQAAqXAQqSAQgMEAAahwEwgYQCgYEAkuzFcd5TJu7lYWYe2hQLFfUWIIj91BvQQLa_Thln4YtGCO8gG1KJqJm-YlmJOWQG0B7H_5RVhxUxV9KpmFnsDVkzUFKOsCBaYGXc12xPVioawUlAwp5qp3QQtZyx_se97YIoLzuLr46UkLcLnkIrp-Jo46QzYi_QHq45WTm8MQ0glpEGEAIKlwEKkgEIDRAAGocBMIGEAoGBAIUzbxOknXf_rNt17_ir8JlWvrtnCWsQd1MAnl5mgArvavDtKeBYHzi5_Ak7DHlLzuA6YE8W175FxLFKpN2hkz-l-M7ltUSd8N1BvJRhK4t6WffWfC_1wPyoAbeSN2Yb1jygtZJQ8wGoXHcJQUXiMit3eFNyylwsJFj1gzAR4JCdIJeRBhABCpYBCpEBCA4QABqGATCBgwKBgFMcbEpl9ukVR6AO_R6sMyiU11I8b8MBSUCEC15iKsrVO8v_m47_TRRjWPYtQ9eZ7o1ocNJHaGUU7qqInFqtFaVnIceP6NmCsXhjs3MLrWPS8IRAy4Zf4FKmGOx3N9O2vemjUygZ9vUiSkULdVrecinRaT8JQ5RG4bUMY04XGIwFIJiRBhADCpYBCpEBCA8QABqGATCBgwKBgGpCkW-NR3li8GlRvqpq2YZGSIgm_PTyDI2Zwfw69grsBmPpVFW48Vw7xoMN35zcrojEpialB_uQzlpLYOvsMl634CRIuj-n1QE3-gaZTTTE8mg-AR4mcxnTKThPnRQpbuOlYAnriwiasWiQEMbGjq_HmWioYYxFo9USlklQn4-9IJmRBhAE"; static const TString EXPIRED_SERVICE_TICKET = "3:serv:CBAQACIZCOUBEBwaCGJiOnNlc3MxGghiYjpzZXNzMg:IwfMNJYEqStY_SixwqJnyHOMCPR7-3HHk4uylB2oVRkthtezq-OOA7QizDvx7VABLs_iTlXuD1r5IjufNei_EiV145eaa3HIg4xCdJXCojMexf2UYJz8mF2b0YzFAy6_KWagU7xo13CyKAqzJuQf5MJcSUf0ecY9hVh36cJ51aw"; static const TString MALFORMED_TVM_KEYS = "1:CpgCCpMCCAEQABqIAjCCAQQCggEAcLEXeH67FQESFUn4_7wnX7wN0PUrBoUsm3QQ4W5vC-qz6sXaEjSwnTV8w1o-z6X9KPLlhzMQvuS38NCNfK4uvJ4Zvfp3YsXJ25-rYtbnrYJHNvHohD-kPCCw_yZpMp21JdWigzQGuV7CtrxUhF-NNrsnUaJrE5-OpEWNt4X6nCItKIYeVcSK6XJUbEWbrNCRbvkSc4ak2ymFeMuHYJVjxh4eQbk7_ZPzodP0WvF6eUYrYeb42imVEOR8ofVLQWE5DVnb1z_TqZm4i1XkS7jMwZuBxBRw8DGdYei0lT_sAf7KST2jC0590NySB3vsBgWEVs1OdUUWA6r-Dvx9dsOQtSCVkQYQAAqZAgqUAggCEAAaiQIwggEFAoIBAQDhEBM5-6YsPWfogKtbluJoCX1WV2KdzOaQ0-OlRbBzeCzw-eQKu12c8WakHBbeCMd1I1TU64SDkDorWjXGIa_2xT6N3zzNAE50roTbPCcmeQrps26woTYfYIuqDdoxYKZNr0lvNLLW47vBr7EKqo1S4KSj7aXK_XYeEvUgIgf3nVIcNrio7VTnFmGGVQCepaL1Hi1gN4yIXjVZ06PBPZ-DxSRu6xOGbFrfKMJeMPs7KOyE-26Q3xOXdTIa1X-zYIucTd_bxUCL4BVbwW2AvbbFsaG7ISmVdGu0XUTmhXs1KrEfUVLRJhE4Dx99hAZXm1_HlYMUeJcMQ_oHOhV94ENFIJaRBhACCpYBCpEBCAMQABqGATCBgwKBgF9t2YJGAJkRRFq6fWhi3m1TFW1UOE0f6ZrfYhHAkpqGlKlh0QVfeTNPpeJhi75xXzCe6oReRUm-0DbqDNhTShC7uGUv1INYnRBQWH6E-5Fc5XrbDFSuGQw2EYjNfHy_HefHJXxQKAqPvxBDKMKkHgV58WtM6rC8jRi9sdX_ig2NIJeRBhABCpYBCpEBCAQQABqGATCBgwKBgGB4d6eLGUBv-Q6EPLehC4S-yuE2HB-_rJ7WkeYwyp-xIPolPrd-PQme2utHB4ZgpXHIu_OFksDe_0bPgZniNRSVRbl7W49DgS5Ya3kMfrYB4DnF5Fta5tn1oV6EwxYD4JONpFTenOJALPGTPawxXEfon_peiHOSBuQMu3_Vn-l1IJiRBhADCpcBCpIBCAUQABqHATCBhAKBgQCTJMKIfmfeZpaI7Q9rnsc29gdWawK7TnpVKRHws1iY7EUlYROeVcMdAwEqVM6f8BVCKLGgzQ7Gar_uuxfUGKwqEQzoppDraw4F75J464-7D5f6_oJQuGIBHZxqbMONtLjBCXRUhQW5szBLmTQ_R3qaJb5vf-h0APZfkYhq1cTttSCZkQYQBAqWAQqRAQgLEAAahgEwgYMCgYBvvGVH_M2H8qxxv94yaDYUTWbRnJ1uiIYc59KIQlfFimMPhSS7x2tqUa2-hI55JiII0Xym6GNkwLhyc1xtWChpVuIdSnbvttbrt4weDMLHqTwNOF6qAsVKGKT1Yh8yf-qb-DSmicgvFc74mBQm_6gAY1iQsf33YX8578ClhKBWHSCVkQYQAAqXAQqSAQgMEAAahwEwgYQCgYEAkuzFcd5TJu7lYWYe2hQLFfUWIIj91BvQQLa_Thln4YtGCO8gG1KJqJm-YlmJOWQG0B7H_5RVhxUxV9KpmFnsDVkzUFKOsCBaYGXc12xPVioawUlAwp5qp3QQtZyx_se97YIoLzuLr46UkLcLnkIrp-Jo46QzYi_QHq45WTm8MQ0glpEGEAIKlwEKkgEIDRAAGocBMIGEAoGBAIUzbxOknXf_rNt17_ir8JlWvrtnCWsQd1MAnl5mgArvavDtKeBYHzi5_Ak7DHlLzuA6YE8W175FxLFKpN2hkz-l-M7ltUSd8N1BvJRhK4t6WffWfC_1wPyoAbeSN2Yb1jygtZJQ8wGoXHcJQUXiMit3eFNyylwsJFj1gzAR4JCdIJeRBhABCpYBCpEBCA4QABqGATCBgwKBgFMcbEpl9ukVR6AO_R6sMyiU11I8b8MBSUCEC15iKsrVO8v_m47_TRRjWPYtQ9eZ7o1ocNJHaGUU7qqInFqtFaVnIceP6NmCsXhjs3MLrWPS8IRAy4Zf4FKmGOx3N9O2vemjUygZ9vUiSkULdVrecinRaT8JQ5RG4bUMY04XGIwFIJiRBhADCpYBCpEBCA8QABqGATCBgwKBgGpCkW-NR3li8GlRvqpq2YZGSIgm_PTyDI2Zwfw69grsBmPpVFW48Vw7xoMN35zcrojEpialB_uQzlpLYOvsMl634CRIuj-n1QE3-gaZTTTE8mg-AR4mcxnTKThPnRQpbuOlYAnriwiasWiQEMbGjq_HmWioYYxFo9USlklQn4-9IJmRBhAEEpUBCpIBCAYQABqHATCBhAKBgQCoZkFGm9oLTqjeXZAq6j5S6i7K20V0lNdBBLqfmFBIRuTkYxhs4vUYnWjZrKRAd5bp6_py0csmFmpl_5Yh0b-2pdo_E5PNP7LGRzKyKSiFddyykKKzVOazH8YYldDAfE8Z5HoS9e48an5JsPg0jr-TPu34DnJq3yv2a6dqiKL9zSCakQYSlQEKkgEIEBAAGocBMIGEAoGBALhrihbf3EpjDQS2sCQHazoFgN0nBbE9eesnnFTfzQELXb2gnJU9enmV_aDqaHKjgtLIPpCgn40lHrn5k6mvH5OdedyI6cCzE-N-GFp3nAq0NDJyMe0fhtIRD__CbT0ulcvkeow65ubXWfw6dBC2gR_34rdMe_L_TGRLMWjDULbNIJ"; static const TString MALFORMED_TVM_SECRET = "adcvxcv./-+"; - static const TTvmId NOT_OUR_ID = 27; - static const TTvmId OUR_ID = 28; + static const TTvmId NOT_OUR_ID = 27; + static const TTvmId OUR_ID = 28; static const TString SECRET = "GRMJrKnj4fOVnvOqe-WyD1"; static const TString SERVICE_TICKET_PROTOBUF = "CBAQ__________9_IhkI5QEQHBoIYmI6c2VzczEaCGJiOnNlc3My"; - static const TTvmId SRC_ID = 229; + static const TTvmId SRC_ID = 229; static const TString UNSUPPORTED_VERSION_SERVICE_TICKET = "2:serv:CBAQ__________9_IhkI5QEQHBoIYmI6c2VzczEaCGJiOnNlc3My:WUPx1cTf05fjD1exB35T5j2DCHWH1YaLJon_a4rN-D7JfXHK1Ai4wM4uSfboHD9xmGQH7extqtlEk1tCTCGm5qbRVloJwWzCZBXo3zKX6i1oBYP_89WcjCNPVe1e8jwGdLsnu6PpxL5cn0xCksiStILH5UmDR6xfkJdnmMG94o8"; static const TString VALID_SERVICE_TICKET_1 = "3:serv:CBAQ__________9_IhkI5QEQHBoIYmI6c2VzczEaCGJiOnNlc3My:WUPx1cTf05fjD1exB35T5j2DCHWH1YaLJon_a4rN-D7JfXHK1Ai4wM4uSfboHD9xmGQH7extqtlEk1tCTCGm5qbRVloJwWzCZBXo3zKX6i1oBYP_89WcjCNPVe1e8jwGdLsnu6PpxL5cn0xCksiStILH5UmDR6xfkJdnmMG94o8"; static const TString VALID_SERVICE_TICKET_2 = "3:serv:CBAQ__________9_IskICOUBEBwaCGJiOnNlc3MxGgliYjpzZXNzMTAaCmJiOnNlc3MxMDAaCWJiOnNlc3MxMRoJYmI6c2VzczEyGgliYjpzZXNzMTMaCWJiOnNlc3MxNBoJYmI6c2VzczE1GgliYjpzZXNzMTYaCWJiOnNlc3MxNxoJYmI6c2VzczE4GgliYjpzZXNzMTkaCGJiOnNlc3MyGgliYjpzZXNzMjAaCWJiOnNlc3MyMRoJYmI6c2VzczIyGgliYjpzZXNzMjMaCWJiOnNlc3MyNBoJYmI6c2VzczI1GgliYjpzZXNzMjYaCWJiOnNlc3MyNxoJYmI6c2VzczI4GgliYjpzZXNzMjkaCGJiOnNlc3MzGgliYjpzZXNzMzAaCWJiOnNlc3MzMRoJYmI6c2VzczMyGgliYjpzZXNzMzMaCWJiOnNlc3MzNBoJYmI6c2VzczM1GgliYjpzZXNzMzYaCWJiOnNlc3MzNxoJYmI6c2VzczM4GgliYjpzZXNzMzkaCGJiOnNlc3M0GgliYjpzZXNzNDAaCWJiOnNlc3M0MRoJYmI6c2VzczQyGgliYjpzZXNzNDMaCWJiOnNlc3M0NBoJYmI6c2VzczQ1GgliYjpzZXNzNDYaCWJiOnNlc3M0NxoJYmI6c2VzczQ4GgliYjpzZXNzNDkaCGJiOnNlc3M1GgliYjpzZXNzNTAaCWJiOnNlc3M1MRoJYmI6c2VzczUyGgliYjpzZXNzNTMaCWJiOnNlc3M1NBoJYmI6c2VzczU1GgliYjpzZXNzNTYaCWJiOnNlc3M1NxoJYmI6c2VzczU4GgliYjpzZXNzNTkaCGJiOnNlc3M2GgliYjpzZXNzNjAaCWJiOnNlc3M2MRoJYmI6c2VzczYyGgliYjpzZXNzNjMaCWJiOnNlc3M2NBoJYmI6c2VzczY1GgliYjpzZXNzNjYaCWJiOnNlc3M2NxoJYmI6c2VzczY4GgliYjpzZXNzNjkaCGJiOnNlc3M3GgliYjpzZXNzNzAaCWJiOnNlc3M3MRoJYmI6c2VzczcyGgliYjpzZXNzNzMaCWJiOnNlc3M3NBoJYmI6c2Vzczc1GgliYjpzZXNzNzYaCWJiOnNlc3M3NxoJYmI6c2Vzczc4GgliYjpzZXNzNzkaCGJiOnNlc3M4GgliYjpzZXNzODAaCWJiOnNlc3M4MRoJYmI6c2VzczgyGgliYjpzZXNzODMaCWJiOnNlc3M4NBoJYmI6c2Vzczg1GgliYjpzZXNzODYaCWJiOnNlc3M4NxoJYmI6c2Vzczg4GgliYjpzZXNzODkaCGJiOnNlc3M5GgliYjpzZXNzOTAaCWJiOnNlc3M5MRoJYmI6c2VzczkyGgliYjpzZXNzOTMaCWJiOnNlc3M5NBoJYmI6c2Vzczk1GgliYjpzZXNzOTYaCWJiOnNlc3M5NxoJYmI6c2Vzczk4GgliYjpzZXNzOTk:JYmABAVLM6y7_T4n1pRcwBfwDfzMV4JJ3cpbEG617zdGgKRZwL7MalsYn5bq1F2ibujMrsF9nzZf8l4s_e-Ivjkz_xu4KMzSp-pUh9V7XIF_smj0WHYpv6gOvWNuK8uIvlZTTKwtQX0qZOL9m-MEeZiHoQPKZGCfJ_qxMUp-J8I"; static const TString VALID_SERVICE_TICKET_3 = "3:serv:CBAQ__________9_IgUI5QEQHA:Sd6tmA1CNy2Nf7XevC3x7zr2DrGNRmcl-TxUsDtDW2xI3YXyCxBltWeg0-KtDlqyYuPOP5Jd_-XXNA12KlOPnNzrz3jm-5z8uQl6CjCcrVHUHJ75pGC8r9UOlS8cOgeXQB5dYP-fOWyo5CNadlozx1S2meCIxncbQRV1kCBi4KU"; - Y_UNIT_TEST(BlackboxTvmIdTest) { - UNIT_ASSERT_VALUES_EQUAL("222", NBlackboxTvmId::Prod); - UNIT_ASSERT_VALUES_EQUAL("224", NBlackboxTvmId::Test); - UNIT_ASSERT_VALUES_EQUAL("223", NBlackboxTvmId::ProdYateam); - UNIT_ASSERT_VALUES_EQUAL("225", NBlackboxTvmId::TestYateam); - UNIT_ASSERT_VALUES_EQUAL("226", NBlackboxTvmId::Stress); - UNIT_ASSERT_VALUES_EQUAL("239", NBlackboxTvmId::Mimino); - } + Y_UNIT_TEST(BlackboxTvmIdTest) { + UNIT_ASSERT_VALUES_EQUAL("222", NBlackboxTvmId::Prod); + UNIT_ASSERT_VALUES_EQUAL("224", NBlackboxTvmId::Test); + UNIT_ASSERT_VALUES_EQUAL("223", NBlackboxTvmId::ProdYateam); + UNIT_ASSERT_VALUES_EQUAL("225", NBlackboxTvmId::TestYateam); + UNIT_ASSERT_VALUES_EQUAL("226", NBlackboxTvmId::Stress); + UNIT_ASSERT_VALUES_EQUAL("239", NBlackboxTvmId::Mimino); + } Y_UNIT_TEST(Case1Test) { - TServiceContext context1(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext context1(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); TServiceContext context2 = std::move(context1); TServiceContext context3(std::move(context2)); - TCheckedServiceTicket checkedTicket1 = context3.Check(VALID_SERVICE_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket1.GetStatus()); - TCheckedServiceTicket checkedTicket2 = std::move(checkedTicket1); - TCheckedServiceTicket checkedTicket3(std::move(checkedTicket2)); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket3.GetStatus()); + TCheckedServiceTicket checkedTicket1 = context3.Check(VALID_SERVICE_TICKET_1); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket1.GetStatus()); + TCheckedServiceTicket checkedTicket2 = std::move(checkedTicket1); + TCheckedServiceTicket checkedTicket3(std::move(checkedTicket2)); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket3.GetStatus()); } Y_UNIT_TEST(ContextExceptionsTest) { - UNIT_ASSERT_EXCEPTION(TServiceContext(SECRET, OUR_ID, MALFORMED_TVM_KEYS), TMalformedTvmKeysException); - UNIT_ASSERT_EXCEPTION(TServiceContext(SECRET, OUR_ID, EMPTY_TVM_KEYS), TEmptyTvmKeysException); - UNIT_ASSERT_EXCEPTION(TServiceContext(MALFORMED_TVM_SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS), TMalformedTvmSecretException); - } + UNIT_ASSERT_EXCEPTION(TServiceContext(SECRET, OUR_ID, MALFORMED_TVM_KEYS), TMalformedTvmKeysException); + UNIT_ASSERT_EXCEPTION(TServiceContext(SECRET, OUR_ID, EMPTY_TVM_KEYS), TEmptyTvmKeysException); + UNIT_ASSERT_EXCEPTION(TServiceContext(MALFORMED_TVM_SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS), TMalformedTvmSecretException); + } Y_UNIT_TEST(ContextSignTest) { - TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); UNIT_ASSERT_VALUES_EQUAL( "NsPTYak4Cfk-4vgau5lab3W4GPiTtb2etuj3y4MDPrk", - context.SignCgiParamsForTvm(IntToString<10>(std::numeric_limits<time_t>::max()), "13,28", "")); - } + context.SignCgiParamsForTvm(IntToString<10>(std::numeric_limits<time_t>::max()), "13,28", "")); + } Y_UNIT_TEST(ContextSignExceptionTest) { - TServiceContext context = TServiceContext::CheckingFactory(OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext context = TServiceContext::CheckingFactory(OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); UNIT_ASSERT_EXCEPTION( context.SignCgiParamsForTvm(IntToString<10>(std::numeric_limits<time_t>::max()), "13,28", ""), TMalformedTvmSecretException ); - - context = TServiceContext::SigningFactory(SECRET); - UNIT_ASSERT_NO_EXCEPTION( - context.SignCgiParamsForTvm(IntToString<10>(std::numeric_limits<time_t>::max()), "13,28", "") - ); - } + + context = TServiceContext::SigningFactory(SECRET); + UNIT_ASSERT_NO_EXCEPTION( + context.SignCgiParamsForTvm(IntToString<10>(std::numeric_limits<time_t>::max()), "13,28", "") + ); + } Y_UNIT_TEST(ContextCheckExceptionTest) { - TServiceContext context = TServiceContext::CheckingFactory(OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); - UNIT_ASSERT_NO_EXCEPTION( - context.Check("ABCDE") - ); - - context = TServiceContext::SigningFactory(SECRET); - UNIT_ASSERT_EXCEPTION( - context.Check("ABCDE"), - TEmptyTvmKeysException - ); - } - - + TServiceContext context = TServiceContext::CheckingFactory(OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + UNIT_ASSERT_NO_EXCEPTION( + context.Check("ABCDE") + ); + + context = TServiceContext::SigningFactory(SECRET); + UNIT_ASSERT_EXCEPTION( + context.Check("ABCDE"), + TEmptyTvmKeysException + ); + } + + Y_UNIT_TEST(ContextTest) { - TServiceContext context1(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); - TServiceContext context2 = TServiceContext::CheckingFactory(OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); - } + TServiceContext context1(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext context2 = TServiceContext::CheckingFactory(OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + } Y_UNIT_TEST(Ticket1Test) { - TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_SERVICE_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); UNIT_ASSERT_EQUAL(SRC_ID, checkedTicket.GetSrc()); - UNIT_ASSERT_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;scope=bb:sess1;scope=bb:sess2;", checkedTicket.DebugInfo()); - } + UNIT_ASSERT_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;scope=bb:sess1;scope=bb:sess2;", checkedTicket.DebugInfo()); + } Y_UNIT_TEST(Ticket2Test) { - TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_SERVICE_TICKET_2); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;scope=bb:sess1;scope=bb:sess10;scope=bb:sess100;scope=bb:sess11;scope=bb:sess12;scope=bb:sess13;scope=bb:sess14;scope=bb:sess15;scope=bb:sess16;scope=bb:sess17;scope=bb:sess18;scope=bb:sess19;scope=bb:sess2;scope=bb:sess20;scope=bb:sess21;scope=bb:sess22;scope=bb:sess23;scope=bb:sess24;scope=bb:sess25;scope=bb:sess26;scope=bb:sess27;scope=bb:sess28;scope=bb:sess29;scope=bb:sess3;scope=bb:sess30;scope=bb:sess31;scope=bb:sess32;scope=bb:sess33;scope=bb:sess34;scope=bb:sess35;scope=bb:sess36;scope=bb:sess37;scope=bb:sess38;scope=bb:sess39;scope=bb:sess4;scope=bb:sess40;scope=bb:sess41;scope=bb:sess42;scope=bb:sess43;scope=bb:sess44;scope=bb:sess45;scope=bb:sess46;scope=bb:sess47;scope=bb:sess48;scope=bb:sess49;scope=bb:sess5;scope=bb:sess50;scope=bb:sess51;scope=bb:sess52;scope=bb:sess53;scope=bb:sess54;scope=bb:sess55;scope=bb:sess56;scope=bb:sess57;scope=bb:sess58;scope=bb:sess59;scope=bb:sess6;scope=bb:sess60;scope=bb:sess61;scope=bb:sess62;scope=bb:sess63;scope=bb:sess64;scope=bb:sess65;scope=bb:sess66;scope=bb:sess67;scope=bb:sess68;scope=bb:sess69;scope=bb:sess7;scope=bb:sess70;scope=bb:sess71;scope=bb:sess72;scope=bb:sess73;scope=bb:sess74;scope=bb:sess75;scope=bb:sess76;scope=bb:sess77;scope=bb:sess78;scope=bb:sess79;scope=bb:sess8;scope=bb:sess80;scope=bb:sess81;scope=bb:sess82;scope=bb:sess83;scope=bb:sess84;scope=bb:sess85;scope=bb:sess86;scope=bb:sess87;scope=bb:sess88;scope=bb:sess89;scope=bb:sess9;scope=bb:sess90;scope=bb:sess91;scope=bb:sess92;scope=bb:sess93;scope=bb:sess94;scope=bb:sess95;scope=bb:sess96;scope=bb:sess97;scope=bb:sess98;scope=bb:sess99;", checkedTicket.DebugInfo()); - } - + } + Y_UNIT_TEST(Ticket3Test) { - TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_SERVICE_TICKET_3); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;", checkedTicket.DebugInfo()); - } + } Y_UNIT_TEST(TicketCheckingTest) { - TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto ticket = context.Check(VALID_SERVICE_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, ticket.GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, ticket.GetStatus()); UNIT_ASSERT_EQUAL(SRC_ID, ticket.GetSrc()); - } + } Y_UNIT_TEST(TicketErrorsTest) { - TServiceContext context(SECRET, NOT_OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext context(SECRET, NOT_OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket1 = context.Check(VALID_SERVICE_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::InvalidDst, checkedTicket1.GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::InvalidDst, checkedTicket1.GetStatus()); auto checkedTicket2 = context.Check(UNSUPPORTED_VERSION_SERVICE_TICKET); - UNIT_ASSERT_EQUAL(ETicketStatus::UnsupportedVersion, checkedTicket2.GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::UnsupportedVersion, checkedTicket2.GetStatus()); auto checkedTicket3 = context.Check(EXPIRED_SERVICE_TICKET); - UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket3.GetStatus()); - } + UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket3.GetStatus()); + } Y_UNIT_TEST(TicketExceptionsTest) { - TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(EXPIRED_SERVICE_TICKET); - UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket.GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket.GetStatus()); UNIT_ASSERT(!bool(checkedTicket)); UNIT_ASSERT_EXCEPTION(checkedTicket.GetSrc(), TNotAllowedException); UNIT_ASSERT_NO_EXCEPTION(bool(checkedTicket)); UNIT_ASSERT_NO_EXCEPTION(checkedTicket.DebugInfo()); UNIT_ASSERT_NO_EXCEPTION(checkedTicket.GetStatus()); - } + } Y_UNIT_TEST(RemoveSignatureTest) { UNIT_ASSERT_VALUES_EQUAL("1:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", - NUtils::RemoveTicketSignature("1:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); + NUtils::RemoveTicketSignature("1:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); UNIT_ASSERT_VALUES_EQUAL("2:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", - NUtils::RemoveTicketSignature("2:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); + NUtils::RemoveTicketSignature("2:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); UNIT_ASSERT_VALUES_EQUAL("4:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", - NUtils::RemoveTicketSignature("4:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); + NUtils::RemoveTicketSignature("4:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); UNIT_ASSERT_VALUES_EQUAL("3.serv.ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds", - NUtils::RemoveTicketSignature("3.serv.ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds")); + NUtils::RemoveTicketSignature("3.serv.ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds")); UNIT_ASSERT_VALUES_EQUAL("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:", - NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); + NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); UNIT_ASSERT_VALUES_EQUAL("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:", - NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); + NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); UNIT_ASSERT_VALUES_EQUAL("3:serv:", - NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds")); + NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds")); UNIT_ASSERT_VALUES_EQUAL("asdxcbvfgdsgfasdfxczvdsgfxcdvbcbvf", - NUtils::RemoveTicketSignature("asdxcbvfgdsgfasdfxczvdsgfxcdvbcbvf")); - } + NUtils::RemoveTicketSignature("asdxcbvfgdsgfasdfxczvdsgfxcdvbcbvf")); + } Y_UNIT_TEST(ResetKeysTest) { - TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); - TCheckedServiceTicket checkedTicket = context.Check(VALID_SERVICE_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); - } -} + TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TCheckedServiceTicket checkedTicket = context.Check(VALID_SERVICE_TICKET_1); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); + } +} Y_UNIT_TEST_SUITE(PublicInterfaceUserTestSuite) { static const TString EMPTY_TVM_KEYS = "1:EpUBCpIBCAYQABqHATCBhAKBgQCoZkFGm9oLTqjeXZAq6j5S6i7K20V0lNdBBLqfmFBIRuTkYxhs4vUYnWjZrKRAd5bp6_py0csmFmpl_5Yh0b-2pdo_E5PNP7LGRzKyKSiFddyykKKzVOazH8YYldDAfE8Z5HoS9e48an5JsPg0jr-TPu34DnJq3yv2a6dqiKL9zSCakQY"; @@ -204,34 +204,34 @@ Y_UNIT_TEST_SUITE(PublicInterfaceUserTestSuite) { static const TString VALID_USER_TICKET_3 = "3:user:CA0Q__________9_Go8bCgIIAAoCCAEKAggCCgIIAwoCCAQKAggFCgIIBgoCCAcKAggICgIICQoCCAoKAggLCgIIDAoCCA0KAggOCgIIDwoCCBAKAggRCgIIEgoCCBMKAggUCgIIFQoCCBYKAggXCgIIGAoCCBkKAggaCgIIGwoCCBwKAggdCgIIHgoCCB8KAgggCgIIIQoCCCIKAggjCgIIJAoCCCUKAggmCgIIJwoCCCgKAggpCgIIKgoCCCsKAggsCgIILQoCCC4KAggvCgIIMAoCCDEKAggyCgIIMwoCCDQKAgg1CgIINgoCCDcKAgg4CgIIOQoCCDoKAgg7CgIIPAoCCD0KAgg-CgIIPwoCCEAKAghBCgIIQgoCCEMKAghECgIIRQoCCEYKAghHCgIISAoCCEkKAghKCgIISwoCCEwKAghNCgIITgoCCE8KAghQCgIIUQoCCFIKAghTCgIIVAoCCFUKAghWCgIIVwoCCFgKAghZCgIIWgoCCFsKAghcCgIIXQoCCF4KAghfCgIIYAoCCGEKAghiCgIIYwoCCGQKAghlCgIIZgoCCGcKAghoCgIIaQoCCGoKAghrCgIIbAoCCG0KAghuCgIIbwoCCHAKAghxCgIIcgoCCHMKAgh0CgIIdQoCCHYKAgh3CgIIeAoCCHkKAgh6CgIIewoCCHwKAgh9CgIIfgoCCH8KAwiAAQoDCIEBCgMIggEKAwiDAQoDCIQBCgMIhQEKAwiGAQoDCIcBCgMIiAEKAwiJAQoDCIoBCgMIiwEKAwiMAQoDCI0BCgMIjgEKAwiPAQoDCJABCgMIkQEKAwiSAQoDCJMBCgMIlAEKAwiVAQoDCJYBCgMIlwEKAwiYAQoDCJkBCgMImgEKAwibAQoDCJwBCgMInQEKAwieAQoDCJ8BCgMIoAEKAwihAQoDCKIBCgMIowEKAwikAQoDCKUBCgMIpgEKAwinAQoDCKgBCgMIqQEKAwiqAQoDCKsBCgMIrAEKAwitAQoDCK4BCgMIrwEKAwiwAQoDCLEBCgMIsgEKAwizAQoDCLQBCgMItQEKAwi2AQoDCLcBCgMIuAEKAwi5AQoDCLoBCgMIuwEKAwi8AQoDCL0BCgMIvgEKAwi_AQoDCMABCgMIwQEKAwjCAQoDCMMBCgMIxAEKAwjFAQoDCMYBCgMIxwEKAwjIAQoDCMkBCgMIygEKAwjLAQoDCMwBCgMIzQEKAwjOAQoDCM8BCgMI0AEKAwjRAQoDCNIBCgMI0wEKAwjUAQoDCNUBCgMI1gEKAwjXAQoDCNgBCgMI2QEKAwjaAQoDCNsBCgMI3AEKAwjdAQoDCN4BCgMI3wEKAwjgAQoDCOEBCgMI4gEKAwjjAQoDCOQBCgMI5QEKAwjmAQoDCOcBCgMI6AEKAwjpAQoDCOoBCgMI6wEKAwjsAQoDCO0BCgMI7gEKAwjvAQoDCPABCgMI8QEKAwjyAQoDCPMBCgMI9AEKAwj1AQoDCPYBCgMI9wEKAwj4AQoDCPkBCgMI-gEKAwj7AQoDCPwBCgMI_QEKAwj-AQoDCP8BCgMIgAIKAwiBAgoDCIICCgMIgwIKAwiEAgoDCIUCCgMIhgIKAwiHAgoDCIgCCgMIiQIKAwiKAgoDCIsCCgMIjAIKAwiNAgoDCI4CCgMIjwIKAwiQAgoDCJECCgMIkgIKAwiTAgoDCJQCCgMIlQIKAwiWAgoDCJcCCgMImAIKAwiZAgoDCJoCCgMImwIKAwicAgoDCJ0CCgMIngIKAwifAgoDCKACCgMIoQIKAwiiAgoDCKMCCgMIpAIKAwilAgoDCKYCCgMIpwIKAwioAgoDCKkCCgMIqgIKAwirAgoDCKwCCgMIrQIKAwiuAgoDCK8CCgMIsAIKAwixAgoDCLICCgMIswIKAwi0AgoDCLUCCgMItgIKAwi3AgoDCLgCCgMIuQIKAwi6AgoDCLsCCgMIvAIKAwi9AgoDCL4CCgMIvwIKAwjAAgoDCMECCgMIwgIKAwjDAgoDCMQCCgMIxQIKAwjGAgoDCMcCCgMIyAIKAwjJAgoDCMoCCgMIywIKAwjMAgoDCM0CCgMIzgIKAwjPAgoDCNACCgMI0QIKAwjSAgoDCNMCCgMI1AIKAwjVAgoDCNYCCgMI1wIKAwjYAgoDCNkCCgMI2gIKAwjbAgoDCNwCCgMI3QIKAwjeAgoDCN8CCgMI4AIKAwjhAgoDCOICCgMI4wIKAwjkAgoDCOUCCgMI5gIKAwjnAgoDCOgCCgMI6QIKAwjqAgoDCOsCCgMI7AIKAwjtAgoDCO4CCgMI7wIKAwjwAgoDCPECCgMI8gIKAwjzAgoDCPQCCgMI9QIKAwj2AgoDCPcCCgMI-AIKAwj5AgoDCPoCCgMI-wIKAwj8AgoDCP0CCgMI_gIKAwj_AgoDCIADCgMIgQMKAwiCAwoDCIMDCgMIhAMKAwiFAwoDCIYDCgMIhwMKAwiIAwoDCIkDCgMIigMKAwiLAwoDCIwDCgMIjQMKAwiOAwoDCI8DCgMIkAMKAwiRAwoDCJIDCgMIkwMKAwiUAwoDCJUDCgMIlgMKAwiXAwoDCJgDCgMImQMKAwiaAwoDCJsDCgMInAMKAwidAwoDCJ4DCgMInwMKAwigAwoDCKEDCgMIogMKAwijAwoDCKQDCgMIpQMKAwimAwoDCKcDCgMIqAMKAwipAwoDCKoDCgMIqwMKAwisAwoDCK0DCgMIrgMKAwivAwoDCLADCgMIsQMKAwiyAwoDCLMDCgMItAMKAwi1AwoDCLYDCgMItwMKAwi4AwoDCLkDCgMIugMKAwi7AwoDCLwDCgMIvQMKAwi-AwoDCL8DCgMIwAMKAwjBAwoDCMIDCgMIwwMKAwjEAwoDCMUDCgMIxgMKAwjHAwoDCMgDCgMIyQMKAwjKAwoDCMsDCgMIzAMKAwjNAwoDCM4DCgMIzwMKAwjQAwoDCNEDCgMI0gMKAwjTAwoDCNQDCgMI1QMKAwjWAwoDCNcDCgMI2AMKAwjZAwoDCNoDCgMI2wMKAwjcAwoDCN0DCgMI3gMKAwjfAwoDCOADCgMI4QMKAwjiAwoDCOMDCgMI5AMKAwjlAwoDCOYDCgMI5wMKAwjoAwoDCOkDCgMI6gMKAwjrAwoDCOwDCgMI7QMKAwjuAwoDCO8DCgMI8AMKAwjxAwoDCPIDCgMI8wMQyAMaCGJiOnNlc3MxGgliYjpzZXNzMTAaCmJiOnNlc3MxMDAaCWJiOnNlc3MxMRoJYmI6c2VzczEyGgliYjpzZXNzMTMaCWJiOnNlc3MxNBoJYmI6c2VzczE1GgliYjpzZXNzMTYaCWJiOnNlc3MxNxoJYmI6c2VzczE4GgliYjpzZXNzMTkaCGJiOnNlc3MyGgliYjpzZXNzMjAaCWJiOnNlc3MyMRoJYmI6c2VzczIyGgliYjpzZXNzMjMaCWJiOnNlc3MyNBoJYmI6c2VzczI1GgliYjpzZXNzMjYaCWJiOnNlc3MyNxoJYmI6c2VzczI4GgliYjpzZXNzMjkaCGJiOnNlc3MzGgliYjpzZXNzMzAaCWJiOnNlc3MzMRoJYmI6c2VzczMyGgliYjpzZXNzMzMaCWJiOnNlc3MzNBoJYmI6c2VzczM1GgliYjpzZXNzMzYaCWJiOnNlc3MzNxoJYmI6c2VzczM4GgliYjpzZXNzMzkaCGJiOnNlc3M0GgliYjpzZXNzNDAaCWJiOnNlc3M0MRoJYmI6c2VzczQyGgliYjpzZXNzNDMaCWJiOnNlc3M0NBoJYmI6c2VzczQ1GgliYjpzZXNzNDYaCWJiOnNlc3M0NxoJYmI6c2VzczQ4GgliYjpzZXNzNDkaCGJiOnNlc3M1GgliYjpzZXNzNTAaCWJiOnNlc3M1MRoJYmI6c2VzczUyGgliYjpzZXNzNTMaCWJiOnNlc3M1NBoJYmI6c2VzczU1GgliYjpzZXNzNTYaCWJiOnNlc3M1NxoJYmI6c2VzczU4GgliYjpzZXNzNTkaCGJiOnNlc3M2GgliYjpzZXNzNjAaCWJiOnNlc3M2MRoJYmI6c2VzczYyGgliYjpzZXNzNjMaCWJiOnNlc3M2NBoJYmI6c2VzczY1GgliYjpzZXNzNjYaCWJiOnNlc3M2NxoJYmI6c2VzczY4GgliYjpzZXNzNjkaCGJiOnNlc3M3GgliYjpzZXNzNzAaCWJiOnNlc3M3MRoJYmI6c2VzczcyGgliYjpzZXNzNzMaCWJiOnNlc3M3NBoJYmI6c2Vzczc1GgliYjpzZXNzNzYaCWJiOnNlc3M3NxoJYmI6c2Vzczc4GgliYjpzZXNzNzkaCGJiOnNlc3M4GgliYjpzZXNzODAaCWJiOnNlc3M4MRoJYmI6c2VzczgyGgliYjpzZXNzODMaCWJiOnNlc3M4NBoJYmI6c2Vzczg1GgliYjpzZXNzODYaCWJiOnNlc3M4NxoJYmI6c2Vzczg4GgliYjpzZXNzODkaCGJiOnNlc3M5GgliYjpzZXNzOTAaCWJiOnNlc3M5MRoJYmI6c2VzczkyGgliYjpzZXNzOTMaCWJiOnNlc3M5NBoJYmI6c2Vzczk1GgliYjpzZXNzOTYaCWJiOnNlc3M5NxoJYmI6c2Vzczk4GgliYjpzZXNzOTkgEigB:CX8PIOrxJnQqFXl7wAsiHJ_1VGjoI-asNlCXb8SE8jtI2vdh9x6CqbAurSgIlAAEgotVP-nuUR38x_a9YJuXzmG5AvJ458apWQtODHIDIX6ZaIwMxjS02R7S5LNqXa0gAuU_R6bCWpZdWe2uLMkdpu5KHbDgW08g-uaP_nceDOk"; Y_UNIT_TEST(Case1Test) { - TUserContext context1(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext context1(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); - TCheckedUserTicket checkedTicket1 = context1.Check("2:serv:CgYIDRCUkQYQDBgcIgdiYjpzZXNzIghiYjpzZXNzMg:ERmeH_yzC7K_QsoHTyw7llCsyExEz3CoEopPIuivA0ZAtTaFq_Pa0l9Fhhx_NX9WpOp2CPyY5cFc4PXhcO83jCB7-EGvHNxGN-j2NQalERzPiKqkDCO0Q5etLzSzrfTlvMz7sXDvELNBHyA0PkAQnbz4supY0l-0Q6JBYSEF3zOVMjjE-HeQIFL3ats3_PakaUMWRvgQQ88pVdYZqAtbDw9PlTla7ommygVZQjcfNFXV1pJKRgOCLs-YyCjOJHLKL04zYj0X6KsOCTUeqhj7ml96wLZ-g1X9tyOR2WAr2Ctq7wIEHwqhxOLgOSKqm05xH6Vi3E_hekf50oe2jPfKEA"); - UNIT_ASSERT_EQUAL(ETicketStatus::UnsupportedVersion, checkedTicket1.GetStatus()); + TCheckedUserTicket checkedTicket1 = context1.Check("2:serv:CgYIDRCUkQYQDBgcIgdiYjpzZXNzIghiYjpzZXNzMg:ERmeH_yzC7K_QsoHTyw7llCsyExEz3CoEopPIuivA0ZAtTaFq_Pa0l9Fhhx_NX9WpOp2CPyY5cFc4PXhcO83jCB7-EGvHNxGN-j2NQalERzPiKqkDCO0Q5etLzSzrfTlvMz7sXDvELNBHyA0PkAQnbz4supY0l-0Q6JBYSEF3zOVMjjE-HeQIFL3ats3_PakaUMWRvgQQ88pVdYZqAtbDw9PlTla7ommygVZQjcfNFXV1pJKRgOCLs-YyCjOJHLKL04zYj0X6KsOCTUeqhj7ml96wLZ-g1X9tyOR2WAr2Ctq7wIEHwqhxOLgOSKqm05xH6Vi3E_hekf50oe2jPfKEA"); + UNIT_ASSERT_EQUAL(ETicketStatus::UnsupportedVersion, checkedTicket1.GetStatus()); UNIT_ASSERT(!checkedTicket1); TUserContext context2 = std::move(context1); TUserContext context3(std::move(context2)); - TCheckedUserTicket checkedTicket2 = context3.Check(VALID_USER_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket2.GetStatus()); - TCheckedUserTicket checkedTicket3 = std::move(checkedTicket2); - TCheckedUserTicket checkedTicket4(std::move(checkedTicket3)); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket4.GetStatus()); - } + TCheckedUserTicket checkedTicket2 = context3.Check(VALID_USER_TICKET_1); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket2.GetStatus()); + TCheckedUserTicket checkedTicket3 = std::move(checkedTicket2); + TCheckedUserTicket checkedTicket4(std::move(checkedTicket3)); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket4.GetStatus()); + } Y_UNIT_TEST(ContextTest) { - TUserContext context(EBlackboxEnv::Prod, NUnittest::TVMKNIFE_PUBLIC_KEYS); - } + TUserContext context(EBlackboxEnv::Prod, NUnittest::TVMKNIFE_PUBLIC_KEYS); + } Y_UNIT_TEST(ContextExceptionsTest) { UNIT_ASSERT_EXCEPTION(TUserContext(EBlackboxEnv::Prod, EMPTY_TVM_KEYS), TEmptyTvmKeysException); UNIT_ASSERT_EXCEPTION(TUserContext(EBlackboxEnv::Prod, MALFORMED_TVM_KEYS), TMalformedTvmKeysException); - } + } Y_UNIT_TEST(Ticket1Test) { - TUserContext context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_USER_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); UNIT_ASSERT_EQUAL(TUids({456, 123}), checkedTicket.GetUids()); UNIT_ASSERT_EQUAL(456, checkedTicket.GetDefaultUid()); UNIT_ASSERT_EQUAL(TScopes({"bb:sess1", "bb:sess2"}), checkedTicket.GetScopes()); @@ -239,39 +239,39 @@ Y_UNIT_TEST_SUITE(PublicInterfaceUserTestSuite) { UNIT_ASSERT(checkedTicket.HasScope("bb:sess2")); UNIT_ASSERT(!checkedTicket.HasScope("bb:sess3")); UNIT_ASSERT_EQUAL("ticket_type=user;expiration_time=9223372036854775807;scope=bb:sess1;scope=bb:sess2;default_uid=456;uid=456;uid=123;env=Test;", checkedTicket.DebugInfo()); - } - + } + Y_UNIT_TEST(Ticket2Test) { - TUserContext context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_USER_TICKET_2); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); UNIT_ASSERT_VALUES_EQUAL("ticket_type=user;expiration_time=9223372036854775807;default_uid=456;uid=456;uid=123;env=Test;", checkedTicket.DebugInfo()); - } + } Y_UNIT_TEST(Ticket3Test) { - TUserContext context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_USER_TICKET_3); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); UNIT_ASSERT_VALUES_EQUAL("ticket_type=user;expiration_time=9223372036854775807;scope=bb:sess1;scope=bb:sess10;scope=bb:sess100;scope=bb:sess11;scope=bb:sess12;scope=bb:sess13;scope=bb:sess14;scope=bb:sess15;scope=bb:sess16;scope=bb:sess17;scope=bb:sess18;scope=bb:sess19;scope=bb:sess2;scope=bb:sess20;scope=bb:sess21;scope=bb:sess22;scope=bb:sess23;scope=bb:sess24;scope=bb:sess25;scope=bb:sess26;scope=bb:sess27;scope=bb:sess28;scope=bb:sess29;scope=bb:sess3;scope=bb:sess30;scope=bb:sess31;scope=bb:sess32;scope=bb:sess33;scope=bb:sess34;scope=bb:sess35;scope=bb:sess36;scope=bb:sess37;scope=bb:sess38;scope=bb:sess39;scope=bb:sess4;scope=bb:sess40;scope=bb:sess41;scope=bb:sess42;scope=bb:sess43;scope=bb:sess44;scope=bb:sess45;scope=bb:sess46;scope=bb:sess47;scope=bb:sess48;scope=bb:sess49;scope=bb:sess5;scope=bb:sess50;scope=bb:sess51;scope=bb:sess52;scope=bb:sess53;scope=bb:sess54;scope=bb:sess55;scope=bb:sess56;scope=bb:sess57;scope=bb:sess58;scope=bb:sess59;scope=bb:sess6;scope=bb:sess60;scope=bb:sess61;scope=bb:sess62;scope=bb:sess63;scope=bb:sess64;scope=bb:sess65;scope=bb:sess66;scope=bb:sess67;scope=bb:sess68;scope=bb:sess69;scope=bb:sess7;scope=bb:sess70;scope=bb:sess71;scope=bb:sess72;scope=bb:sess73;scope=bb:sess74;scope=bb:sess75;scope=bb:sess76;scope=bb:sess77;scope=bb:sess78;scope=bb:sess79;scope=bb:sess8;scope=bb:sess80;scope=bb:sess81;scope=bb:sess82;scope=bb:sess83;scope=bb:sess84;scope=bb:sess85;scope=bb:sess86;scope=bb:sess87;scope=bb:sess88;scope=bb:sess89;scope=bb:sess9;scope=bb:sess90;scope=bb:sess91;scope=bb:sess92;scope=bb:sess93;scope=bb:sess94;scope=bb:sess95;scope=bb:sess96;scope=bb:sess97;scope=bb:sess98;scope=bb:sess99;default_uid=456;uid=0;uid=1;uid=2;uid=3;uid=4;uid=5;uid=6;uid=7;uid=8;uid=9;uid=10;uid=11;uid=12;uid=13;uid=14;uid=15;uid=16;uid=17;uid=18;uid=19;uid=20;uid=21;uid=22;uid=23;uid=24;uid=25;uid=26;uid=27;uid=28;uid=29;uid=30;uid=31;uid=32;uid=33;uid=34;uid=35;uid=36;uid=37;uid=38;uid=39;uid=40;uid=41;uid=42;uid=43;uid=44;uid=45;uid=46;uid=47;uid=48;uid=49;uid=50;uid=51;uid=52;uid=53;uid=54;uid=55;uid=56;uid=57;uid=58;uid=59;uid=60;uid=61;uid=62;uid=63;uid=64;uid=65;uid=66;uid=67;uid=68;uid=69;uid=70;uid=71;uid=72;uid=73;uid=74;uid=75;uid=76;uid=77;uid=78;uid=79;uid=80;uid=81;uid=82;uid=83;uid=84;uid=85;uid=86;uid=87;uid=88;uid=89;uid=90;uid=91;uid=92;uid=93;uid=94;uid=95;uid=96;uid=97;uid=98;uid=99;uid=100;uid=101;uid=102;uid=103;uid=104;uid=105;uid=106;uid=107;uid=108;uid=109;uid=110;uid=111;uid=112;uid=113;uid=114;uid=115;uid=116;uid=117;uid=118;uid=119;uid=120;uid=121;uid=122;uid=123;uid=124;uid=125;uid=126;uid=127;uid=128;uid=129;uid=130;uid=131;uid=132;uid=133;uid=134;uid=135;uid=136;uid=137;uid=138;uid=139;uid=140;uid=141;uid=142;uid=143;uid=144;uid=145;uid=146;uid=147;uid=148;uid=149;uid=150;uid=151;uid=152;uid=153;uid=154;uid=155;uid=156;uid=157;uid=158;uid=159;uid=160;uid=161;uid=162;uid=163;uid=164;uid=165;uid=166;uid=167;uid=168;uid=169;uid=170;uid=171;uid=172;uid=173;uid=174;uid=175;uid=176;uid=177;uid=178;uid=179;uid=180;uid=181;uid=182;uid=183;uid=184;uid=185;uid=186;uid=187;uid=188;uid=189;uid=190;uid=191;uid=192;uid=193;uid=194;uid=195;uid=196;uid=197;uid=198;uid=199;uid=200;uid=201;uid=202;uid=203;uid=204;uid=205;uid=206;uid=207;uid=208;uid=209;uid=210;uid=211;uid=212;uid=213;uid=214;uid=215;uid=216;uid=217;uid=218;uid=219;uid=220;uid=221;uid=222;uid=223;uid=224;uid=225;uid=226;uid=227;uid=228;uid=229;uid=230;uid=231;uid=232;uid=233;uid=234;uid=235;uid=236;uid=237;uid=238;uid=239;uid=240;uid=241;uid=242;uid=243;uid=244;uid=245;uid=246;uid=247;uid=248;uid=249;uid=250;uid=251;uid=252;uid=253;uid=254;uid=255;uid=256;uid=257;uid=258;uid=259;uid=260;uid=261;uid=262;uid=263;uid=264;uid=265;uid=266;uid=267;uid=268;uid=269;uid=270;uid=271;uid=272;uid=273;uid=274;uid=275;uid=276;uid=277;uid=278;uid=279;uid=280;uid=281;uid=282;uid=283;uid=284;uid=285;uid=286;uid=287;uid=288;uid=289;uid=290;uid=291;uid=292;uid=293;uid=294;uid=295;uid=296;uid=297;uid=298;uid=299;uid=300;uid=301;uid=302;uid=303;uid=304;uid=305;uid=306;uid=307;uid=308;uid=309;uid=310;uid=311;uid=312;uid=313;uid=314;uid=315;uid=316;uid=317;uid=318;uid=319;uid=320;uid=321;uid=322;uid=323;uid=324;uid=325;uid=326;uid=327;uid=328;uid=329;uid=330;uid=331;uid=332;uid=333;uid=334;uid=335;uid=336;uid=337;uid=338;uid=339;uid=340;uid=341;uid=342;uid=343;uid=344;uid=345;uid=346;uid=347;uid=348;uid=349;uid=350;uid=351;uid=352;uid=353;uid=354;uid=355;uid=356;uid=357;uid=358;uid=359;uid=360;uid=361;uid=362;uid=363;uid=364;uid=365;uid=366;uid=367;uid=368;uid=369;uid=370;uid=371;uid=372;uid=373;uid=374;uid=375;uid=376;uid=377;uid=378;uid=379;uid=380;uid=381;uid=382;uid=383;uid=384;uid=385;uid=386;uid=387;uid=388;uid=389;uid=390;uid=391;uid=392;uid=393;uid=394;uid=395;uid=396;uid=397;uid=398;uid=399;uid=400;uid=401;uid=402;uid=403;uid=404;uid=405;uid=406;uid=407;uid=408;uid=409;uid=410;uid=411;uid=412;uid=413;uid=414;uid=415;uid=416;uid=417;uid=418;uid=419;uid=420;uid=421;uid=422;uid=423;uid=424;uid=425;uid=426;uid=427;uid=428;uid=429;uid=430;uid=431;uid=432;uid=433;uid=434;uid=435;uid=436;uid=437;uid=438;uid=439;uid=440;uid=441;uid=442;uid=443;uid=444;uid=445;uid=446;uid=447;uid=448;uid=449;uid=450;uid=451;uid=452;uid=453;uid=454;uid=455;uid=456;uid=457;uid=458;uid=459;uid=460;uid=461;uid=462;uid=463;uid=464;uid=465;uid=466;uid=467;uid=468;uid=469;uid=470;uid=471;uid=472;uid=473;uid=474;uid=475;uid=476;uid=477;uid=478;uid=479;uid=480;uid=481;uid=482;uid=483;uid=484;uid=485;uid=486;uid=487;uid=488;uid=489;uid=490;uid=491;uid=492;uid=493;uid=494;uid=495;uid=496;uid=497;uid=498;uid=499;env=Test;", checkedTicket.DebugInfo()); - } + } Y_UNIT_TEST(TicketErrorsTest) { - TUserContext contextTest(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext contextTest(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket1 = contextTest.Check(UNSUPPORTED_VERSION_USER_TICKET); - UNIT_ASSERT_EQUAL(ETicketStatus::UnsupportedVersion, checkedTicket1.GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::UnsupportedVersion, checkedTicket1.GetStatus()); auto checkedTicket2 = contextTest.Check(EXPIRED_USER_TICKET); - UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket2.GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket2.GetStatus()); - TUserContext contextProd(EBlackboxEnv::Prod, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext contextProd(EBlackboxEnv::Prod, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket3 = contextProd.Check(VALID_USER_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::InvalidBlackboxEnv, checkedTicket3.GetStatus()); - } + UNIT_ASSERT_EQUAL(ETicketStatus::InvalidBlackboxEnv, checkedTicket3.GetStatus()); + } Y_UNIT_TEST(TicketExceptionsTest) { - TUserContext contextTest(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext contextTest(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = contextTest.Check(EXPIRED_USER_TICKET); - UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket.GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket.GetStatus()); UNIT_ASSERT_EXCEPTION(checkedTicket.GetDefaultUid(), TNotAllowedException); UNIT_ASSERT_EXCEPTION(checkedTicket.GetUids(), TNotAllowedException); @@ -280,11 +280,11 @@ Y_UNIT_TEST_SUITE(PublicInterfaceUserTestSuite) { UNIT_ASSERT_NO_EXCEPTION(bool(checkedTicket)); UNIT_ASSERT_NO_EXCEPTION(checkedTicket.DebugInfo()); UNIT_ASSERT_NO_EXCEPTION(checkedTicket.GetStatus()); - } + } Y_UNIT_TEST(ResetKeysTest) { - TUserContext context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_USER_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); - } -} + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); + } +} diff --git a/library/cpp/tvmauth/src/ut/service_ut.cpp b/library/cpp/tvmauth/src/ut/service_ut.cpp index 5b6b5143bd..a632379ddc 100644 --- a/library/cpp/tvmauth/src/ut/service_ut.cpp +++ b/library/cpp/tvmauth/src/ut/service_ut.cpp @@ -1,21 +1,21 @@ -#include <library/cpp/tvmauth/src/service_impl.h> -#include <library/cpp/tvmauth/src/utils.h> +#include <library/cpp/tvmauth/src/service_impl.h> +#include <library/cpp/tvmauth/src/utils.h> -#include <library/cpp/tvmauth/exception.h> -#include <library/cpp/tvmauth/unittest.h> +#include <library/cpp/tvmauth/exception.h> +#include <library/cpp/tvmauth/unittest.h> #include <library/cpp/testing/unittest/registar.h> - + #include <util/string/cast.h> -using namespace NTvmAuth; +using namespace NTvmAuth; Y_UNIT_TEST_SUITE(ServiceTestSuite) { Y_UNIT_TEST_DECLARE(TicketProtoTest); -} +} -class TTestServiceTicketImpl: public TCheckedServiceTicket::TImpl { - using TCheckedServiceTicket::TImpl::TImpl; +class TTestServiceTicketImpl: public TCheckedServiceTicket::TImpl { + using TCheckedServiceTicket::TImpl::TImpl; Y_UNIT_TEST_FRIEND(ServiceTestSuite, TicketProtoTest); }; @@ -24,133 +24,133 @@ Y_UNIT_TEST_SUITE_IMPLEMENTATION(ServiceTestSuite) { static const TString EXPIRED_SERVICE_TICKET = "3:serv:CBAQACIZCOUBEBwaCGJiOnNlc3MxGghiYjpzZXNzMg:IwfMNJYEqStY_SixwqJnyHOMCPR7-3HHk4uylB2oVRkthtezq-OOA7QizDvx7VABLs_iTlXuD1r5IjufNei_EiV145eaa3HIg4xCdJXCojMexf2UYJz8mF2b0YzFAy6_KWagU7xo13CyKAqzJuQf5MJcSUf0ecY9hVh36cJ51aw"; static const TString MALFORMED_TVM_KEYS = "1:CpgCCpMCCAEQABqIAjCCAQQCggEAcLEXeH67FQESFUn4_7wnX7wN0PUrBoUsm3QQ4W5vC-qz6sXaEjSwnTV8w1o-z6X9KPLlhzMQvuS38NCNfK4uvJ4Zvfp3YsXJ25-rYtbnrYJHNvHohD-kPCCw_yZpMp21JdWigzQGuV7CtrxUhF-NNrsnUaJrE5-OpEWNt4X6nCItKIYeVcSK6XJUbEWbrNCRbvkSc4ak2ymFeMuHYJVjxh4eQbk7_ZPzodP0WvF6eUYrYeb42imVEOR8ofVLQWE5DVnb1z_TqZm4i1XkS7jMwZuBxBRw8DGdYei0lT_sAf7KST2jC0590NySB3vsBgWEVs1OdUUWA6r-Dvx9dsOQtSCVkQYQAAqZAgqUAggCEAAaiQIwggEFAoIBAQDhEBM5-6YsPWfogKtbluJoCX1WV2KdzOaQ0-OlRbBzeCzw-eQKu12c8WakHBbeCMd1I1TU64SDkDorWjXGIa_2xT6N3zzNAE50roTbPCcmeQrps26woTYfYIuqDdoxYKZNr0lvNLLW47vBr7EKqo1S4KSj7aXK_XYeEvUgIgf3nVIcNrio7VTnFmGGVQCepaL1Hi1gN4yIXjVZ06PBPZ-DxSRu6xOGbFrfKMJeMPs7KOyE-26Q3xOXdTIa1X-zYIucTd_bxUCL4BVbwW2AvbbFsaG7ISmVdGu0XUTmhXs1KrEfUVLRJhE4Dx99hAZXm1_HlYMUeJcMQ_oHOhV94ENFIJaRBhACCpYBCpEBCAMQABqGATCBgwKBgF9t2YJGAJkRRFq6fWhi3m1TFW1UOE0f6ZrfYhHAkpqGlKlh0QVfeTNPpeJhi75xXzCe6oReRUm-0DbqDNhTShC7uGUv1INYnRBQWH6E-5Fc5XrbDFSuGQw2EYjNfHy_HefHJXxQKAqPvxBDKMKkHgV58WtM6rC8jRi9sdX_ig2NIJeRBhABCpYBCpEBCAQQABqGATCBgwKBgGB4d6eLGUBv-Q6EPLehC4S-yuE2HB-_rJ7WkeYwyp-xIPolPrd-PQme2utHB4ZgpXHIu_OFksDe_0bPgZniNRSVRbl7W49DgS5Ya3kMfrYB4DnF5Fta5tn1oV6EwxYD4JONpFTenOJALPGTPawxXEfon_peiHOSBuQMu3_Vn-l1IJiRBhADCpcBCpIBCAUQABqHATCBhAKBgQCTJMKIfmfeZpaI7Q9rnsc29gdWawK7TnpVKRHws1iY7EUlYROeVcMdAwEqVM6f8BVCKLGgzQ7Gar_uuxfUGKwqEQzoppDraw4F75J464-7D5f6_oJQuGIBHZxqbMONtLjBCXRUhQW5szBLmTQ_R3qaJb5vf-h0APZfkYhq1cTttSCZkQYQBAqWAQqRAQgLEAAahgEwgYMCgYBvvGVH_M2H8qxxv94yaDYUTWbRnJ1uiIYc59KIQlfFimMPhSS7x2tqUa2-hI55JiII0Xym6GNkwLhyc1xtWChpVuIdSnbvttbrt4weDMLHqTwNOF6qAsVKGKT1Yh8yf-qb-DSmicgvFc74mBQm_6gAY1iQsf33YX8578ClhKBWHSCVkQYQAAqXAQqSAQgMEAAahwEwgYQCgYEAkuzFcd5TJu7lYWYe2hQLFfUWIIj91BvQQLa_Thln4YtGCO8gG1KJqJm-YlmJOWQG0B7H_5RVhxUxV9KpmFnsDVkzUFKOsCBaYGXc12xPVioawUlAwp5qp3QQtZyx_se97YIoLzuLr46UkLcLnkIrp-Jo46QzYi_QHq45WTm8MQ0glpEGEAIKlwEKkgEIDRAAGocBMIGEAoGBAIUzbxOknXf_rNt17_ir8JlWvrtnCWsQd1MAnl5mgArvavDtKeBYHzi5_Ak7DHlLzuA6YE8W175FxLFKpN2hkz-l-M7ltUSd8N1BvJRhK4t6WffWfC_1wPyoAbeSN2Yb1jygtZJQ8wGoXHcJQUXiMit3eFNyylwsJFj1gzAR4JCdIJeRBhABCpYBCpEBCA4QABqGATCBgwKBgFMcbEpl9ukVR6AO_R6sMyiU11I8b8MBSUCEC15iKsrVO8v_m47_TRRjWPYtQ9eZ7o1ocNJHaGUU7qqInFqtFaVnIceP6NmCsXhjs3MLrWPS8IRAy4Zf4FKmGOx3N9O2vemjUygZ9vUiSkULdVrecinRaT8JQ5RG4bUMY04XGIwFIJiRBhADCpYBCpEBCA8QABqGATCBgwKBgGpCkW-NR3li8GlRvqpq2YZGSIgm_PTyDI2Zwfw69grsBmPpVFW48Vw7xoMN35zcrojEpialB_uQzlpLYOvsMl634CRIuj-n1QE3-gaZTTTE8mg-AR4mcxnTKThPnRQpbuOlYAnriwiasWiQEMbGjq_HmWioYYxFo9USlklQn4-9IJmRBhAEEpUBCpIBCAYQABqHATCBhAKBgQCoZkFGm9oLTqjeXZAq6j5S6i7K20V0lNdBBLqfmFBIRuTkYxhs4vUYnWjZrKRAd5bp6_py0csmFmpl_5Yh0b-2pdo_E5PNP7LGRzKyKSiFddyykKKzVOazH8YYldDAfE8Z5HoS9e48an5JsPg0jr-TPu34DnJq3yv2a6dqiKL9zSCakQYSlQEKkgEIEBAAGocBMIGEAoGBALhrihbf3EpjDQS2sCQHazoFgN0nBbE9eesnnFTfzQELXb2gnJU9enmV_aDqaHKjgtLIPpCgn40lHrn5k6mvH5OdedyI6cCzE-N-GFp3nAq0NDJyMe0fhtIRD__CbT0ulcvkeow65ubXWfw6dBC2gR_34rdMe_L_TGRLMWjDULbNIJ"; static const TString MALFORMED_TVM_SECRET = "adcvxcv./-+"; - static const TTvmId NOT_OUR_ID = 27; - static const TTvmId OUR_ID = 28; + static const TTvmId NOT_OUR_ID = 27; + static const TTvmId OUR_ID = 28; static const TString SECRET = "GRMJrKnj4fOVnvOqe-WyD1"; static const TString SERVICE_TICKET_PROTOBUF = "CBAQ__________9_IhkI5QEQHBoIYmI6c2VzczEaCGJiOnNlc3My"; - static const TTvmId SRC_ID = 229; + static const TTvmId SRC_ID = 229; static const TString UNSUPPORTED_VERSION_SERVICE_TICKET = "2:serv:CBAQ__________9_IhkI5QEQHBoIYmI6c2VzczEaCGJiOnNlc3My:WUPx1cTf05fjD1exB35T5j2DCHWH1YaLJon_a4rN-D7JfXHK1Ai4wM4uSfboHD9xmGQH7extqtlEk1tCTCGm5qbRVloJwWzCZBXo3zKX6i1oBYP_89WcjCNPVe1e8jwGdLsnu6PpxL5cn0xCksiStILH5UmDR6xfkJdnmMG94o8"; static const TString VALID_SERVICE_TICKET_1 = "3:serv:CBAQ__________9_IhkI5QEQHBoIYmI6c2VzczEaCGJiOnNlc3My:WUPx1cTf05fjD1exB35T5j2DCHWH1YaLJon_a4rN-D7JfXHK1Ai4wM4uSfboHD9xmGQH7extqtlEk1tCTCGm5qbRVloJwWzCZBXo3zKX6i1oBYP_89WcjCNPVe1e8jwGdLsnu6PpxL5cn0xCksiStILH5UmDR6xfkJdnmMG94o8"; static const TString VALID_SERVICE_TICKET_2 = "3:serv:CBAQ__________9_IskICOUBEBwaCGJiOnNlc3MxGgliYjpzZXNzMTAaCmJiOnNlc3MxMDAaCWJiOnNlc3MxMRoJYmI6c2VzczEyGgliYjpzZXNzMTMaCWJiOnNlc3MxNBoJYmI6c2VzczE1GgliYjpzZXNzMTYaCWJiOnNlc3MxNxoJYmI6c2VzczE4GgliYjpzZXNzMTkaCGJiOnNlc3MyGgliYjpzZXNzMjAaCWJiOnNlc3MyMRoJYmI6c2VzczIyGgliYjpzZXNzMjMaCWJiOnNlc3MyNBoJYmI6c2VzczI1GgliYjpzZXNzMjYaCWJiOnNlc3MyNxoJYmI6c2VzczI4GgliYjpzZXNzMjkaCGJiOnNlc3MzGgliYjpzZXNzMzAaCWJiOnNlc3MzMRoJYmI6c2VzczMyGgliYjpzZXNzMzMaCWJiOnNlc3MzNBoJYmI6c2VzczM1GgliYjpzZXNzMzYaCWJiOnNlc3MzNxoJYmI6c2VzczM4GgliYjpzZXNzMzkaCGJiOnNlc3M0GgliYjpzZXNzNDAaCWJiOnNlc3M0MRoJYmI6c2VzczQyGgliYjpzZXNzNDMaCWJiOnNlc3M0NBoJYmI6c2VzczQ1GgliYjpzZXNzNDYaCWJiOnNlc3M0NxoJYmI6c2VzczQ4GgliYjpzZXNzNDkaCGJiOnNlc3M1GgliYjpzZXNzNTAaCWJiOnNlc3M1MRoJYmI6c2VzczUyGgliYjpzZXNzNTMaCWJiOnNlc3M1NBoJYmI6c2VzczU1GgliYjpzZXNzNTYaCWJiOnNlc3M1NxoJYmI6c2VzczU4GgliYjpzZXNzNTkaCGJiOnNlc3M2GgliYjpzZXNzNjAaCWJiOnNlc3M2MRoJYmI6c2VzczYyGgliYjpzZXNzNjMaCWJiOnNlc3M2NBoJYmI6c2VzczY1GgliYjpzZXNzNjYaCWJiOnNlc3M2NxoJYmI6c2VzczY4GgliYjpzZXNzNjkaCGJiOnNlc3M3GgliYjpzZXNzNzAaCWJiOnNlc3M3MRoJYmI6c2VzczcyGgliYjpzZXNzNzMaCWJiOnNlc3M3NBoJYmI6c2Vzczc1GgliYjpzZXNzNzYaCWJiOnNlc3M3NxoJYmI6c2Vzczc4GgliYjpzZXNzNzkaCGJiOnNlc3M4GgliYjpzZXNzODAaCWJiOnNlc3M4MRoJYmI6c2VzczgyGgliYjpzZXNzODMaCWJiOnNlc3M4NBoJYmI6c2Vzczg1GgliYjpzZXNzODYaCWJiOnNlc3M4NxoJYmI6c2Vzczg4GgliYjpzZXNzODkaCGJiOnNlc3M5GgliYjpzZXNzOTAaCWJiOnNlc3M5MRoJYmI6c2VzczkyGgliYjpzZXNzOTMaCWJiOnNlc3M5NBoJYmI6c2Vzczk1GgliYjpzZXNzOTYaCWJiOnNlc3M5NxoJYmI6c2Vzczk4GgliYjpzZXNzOTk:JYmABAVLM6y7_T4n1pRcwBfwDfzMV4JJ3cpbEG617zdGgKRZwL7MalsYn5bq1F2ibujMrsF9nzZf8l4s_e-Ivjkz_xu4KMzSp-pUh9V7XIF_smj0WHYpv6gOvWNuK8uIvlZTTKwtQX0qZOL9m-MEeZiHoQPKZGCfJ_qxMUp-J8I"; static const TString VALID_SERVICE_TICKET_3 = "3:serv:CBAQ__________9_IgUI5QEQHA:Sd6tmA1CNy2Nf7XevC3x7zr2DrGNRmcl-TxUsDtDW2xI3YXyCxBltWeg0-KtDlqyYuPOP5Jd_-XXNA12KlOPnNzrz3jm-5z8uQl6CjCcrVHUHJ75pGC8r9UOlS8cOgeXQB5dYP-fOWyo5CNadlozx1S2meCIxncbQRV1kCBi4KU"; - static const TString VALID_SERVICE_TICKET_ISSUER = "3:serv:CBAQ__________9_IgsI5QEQHCDr1MT4Ag:Gu66XJT_nKnIRJjFy1561wFhIqkJItcSTGftLo7Yvi7i5wIdV-QuKT_-IMPpgjxnnGbt1Dy3Ys2TEoeJAb0TdaCYG1uy3vpoLONmTx9AenN5dx1HHf46cypLK5D3OdiTjxvqI9uGmSIKrSdRxU8gprpu5QiBDPZqVCWhM60FVSY"; + static const TString VALID_SERVICE_TICKET_ISSUER = "3:serv:CBAQ__________9_IgsI5QEQHCDr1MT4Ag:Gu66XJT_nKnIRJjFy1561wFhIqkJItcSTGftLo7Yvi7i5wIdV-QuKT_-IMPpgjxnnGbt1Dy3Ys2TEoeJAb0TdaCYG1uy3vpoLONmTx9AenN5dx1HHf46cypLK5D3OdiTjxvqI9uGmSIKrSdRxU8gprpu5QiBDPZqVCWhM60FVSY"; Y_UNIT_TEST(ContextExceptionsTest) { - UNIT_ASSERT_EXCEPTION(TServiceContext::TImpl(SECRET, OUR_ID, MALFORMED_TVM_KEYS), TMalformedTvmKeysException); - UNIT_ASSERT_EXCEPTION(TServiceContext::TImpl(SECRET, OUR_ID, EMPTY_TVM_KEYS), TEmptyTvmKeysException); - UNIT_ASSERT_EXCEPTION(TServiceContext::TImpl(MALFORMED_TVM_SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS), TMalformedTvmSecretException); - } + UNIT_ASSERT_EXCEPTION(TServiceContext::TImpl(SECRET, OUR_ID, MALFORMED_TVM_KEYS), TMalformedTvmKeysException); + UNIT_ASSERT_EXCEPTION(TServiceContext::TImpl(SECRET, OUR_ID, EMPTY_TVM_KEYS), TEmptyTvmKeysException); + UNIT_ASSERT_EXCEPTION(TServiceContext::TImpl(MALFORMED_TVM_SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS), TMalformedTvmSecretException); + } Y_UNIT_TEST(ContextSignTest) { - TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); UNIT_ASSERT_VALUES_EQUAL( "NsPTYak4Cfk-4vgau5lab3W4GPiTtb2etuj3y4MDPrk", - context.SignCgiParamsForTvm(IntToString<10>(std::numeric_limits<time_t>::max()), "13,28", "")); - } + context.SignCgiParamsForTvm(IntToString<10>(std::numeric_limits<time_t>::max()), "13,28", "")); + } Y_UNIT_TEST(Ticket1Test) { - TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_SERVICE_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); UNIT_ASSERT_EQUAL(std::numeric_limits<time_t>::max(), checkedTicket->GetExpirationTime()); UNIT_ASSERT_EQUAL(SRC_ID, checkedTicket->GetSrc()); UNIT_ASSERT_EQUAL(TScopes({"bb:sess1", "bb:sess2"}), checkedTicket->GetScopes()); UNIT_ASSERT(checkedTicket->HasScope("bb:sess1")); UNIT_ASSERT(checkedTicket->HasScope("bb:sess2")); UNIT_ASSERT(!checkedTicket->HasScope("bb:sess3")); - UNIT_ASSERT_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;scope=bb:sess1;scope=bb:sess2;", checkedTicket->DebugInfo()); - UNIT_ASSERT(!checkedTicket->GetIssuerUid()); - } + UNIT_ASSERT_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;scope=bb:sess1;scope=bb:sess2;", checkedTicket->DebugInfo()); + UNIT_ASSERT(!checkedTicket->GetIssuerUid()); + } Y_UNIT_TEST(Ticket2Test) { - TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_SERVICE_TICKET_2); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;scope=bb:sess1;scope=bb:sess10;scope=bb:sess100;scope=bb:sess11;scope=bb:sess12;scope=bb:sess13;scope=bb:sess14;scope=bb:sess15;scope=bb:sess16;scope=bb:sess17;scope=bb:sess18;scope=bb:sess19;scope=bb:sess2;scope=bb:sess20;scope=bb:sess21;scope=bb:sess22;scope=bb:sess23;scope=bb:sess24;scope=bb:sess25;scope=bb:sess26;scope=bb:sess27;scope=bb:sess28;scope=bb:sess29;scope=bb:sess3;scope=bb:sess30;scope=bb:sess31;scope=bb:sess32;scope=bb:sess33;scope=bb:sess34;scope=bb:sess35;scope=bb:sess36;scope=bb:sess37;scope=bb:sess38;scope=bb:sess39;scope=bb:sess4;scope=bb:sess40;scope=bb:sess41;scope=bb:sess42;scope=bb:sess43;scope=bb:sess44;scope=bb:sess45;scope=bb:sess46;scope=bb:sess47;scope=bb:sess48;scope=bb:sess49;scope=bb:sess5;scope=bb:sess50;scope=bb:sess51;scope=bb:sess52;scope=bb:sess53;scope=bb:sess54;scope=bb:sess55;scope=bb:sess56;scope=bb:sess57;scope=bb:sess58;scope=bb:sess59;scope=bb:sess6;scope=bb:sess60;scope=bb:sess61;scope=bb:sess62;scope=bb:sess63;scope=bb:sess64;scope=bb:sess65;scope=bb:sess66;scope=bb:sess67;scope=bb:sess68;scope=bb:sess69;scope=bb:sess7;scope=bb:sess70;scope=bb:sess71;scope=bb:sess72;scope=bb:sess73;scope=bb:sess74;scope=bb:sess75;scope=bb:sess76;scope=bb:sess77;scope=bb:sess78;scope=bb:sess79;scope=bb:sess8;scope=bb:sess80;scope=bb:sess81;scope=bb:sess82;scope=bb:sess83;scope=bb:sess84;scope=bb:sess85;scope=bb:sess86;scope=bb:sess87;scope=bb:sess88;scope=bb:sess89;scope=bb:sess9;scope=bb:sess90;scope=bb:sess91;scope=bb:sess92;scope=bb:sess93;scope=bb:sess94;scope=bb:sess95;scope=bb:sess96;scope=bb:sess97;scope=bb:sess98;scope=bb:sess99;", checkedTicket->DebugInfo()); - UNIT_ASSERT(!checkedTicket->GetIssuerUid()); - } + UNIT_ASSERT(!checkedTicket->GetIssuerUid()); + } Y_UNIT_TEST(Ticket3Test) { - TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_SERVICE_TICKET_3); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;", checkedTicket->DebugInfo()); - UNIT_ASSERT(!checkedTicket->GetIssuerUid()); - } + UNIT_ASSERT(!checkedTicket->GetIssuerUid()); + } Y_UNIT_TEST(TicketIssuerTest) { - TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); - auto checkedTicket = context.Check(VALID_SERVICE_TICKET_ISSUER); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); + TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + auto checkedTicket = context.Check(VALID_SERVICE_TICKET_ISSUER); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;issuer_uid=789654123;", - checkedTicket->DebugInfo()); - UNIT_ASSERT(checkedTicket->GetIssuerUid()); - UNIT_ASSERT_VALUES_EQUAL(789654123, *checkedTicket->GetIssuerUid()); - } - + checkedTicket->DebugInfo()); + UNIT_ASSERT(checkedTicket->GetIssuerUid()); + UNIT_ASSERT_VALUES_EQUAL(789654123, *checkedTicket->GetIssuerUid()); + } + Y_UNIT_TEST(TicketErrorsTest) { - TServiceContext::TImpl context(SECRET, NOT_OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext::TImpl context(SECRET, NOT_OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket1 = context.Check(VALID_SERVICE_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::InvalidDst, checkedTicket1->GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::InvalidDst, checkedTicket1->GetStatus()); auto checkedTicket2 = context.Check(UNSUPPORTED_VERSION_SERVICE_TICKET); - UNIT_ASSERT_EQUAL(ETicketStatus::UnsupportedVersion, checkedTicket2->GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::UnsupportedVersion, checkedTicket2->GetStatus()); auto checkedTicket3 = context.Check(EXPIRED_SERVICE_TICKET); - UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket3->GetStatus()); - } + UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket3->GetStatus()); + } Y_UNIT_TEST(TicketExceptionTest) { - TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(EXPIRED_SERVICE_TICKET); - UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket->GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket->GetStatus()); UNIT_ASSERT_EXCEPTION(checkedTicket->GetScopes(), TNotAllowedException); UNIT_ASSERT_EXCEPTION(checkedTicket->GetSrc(), TNotAllowedException); UNIT_ASSERT_EXCEPTION(checkedTicket->HasScope(""), TNotAllowedException); UNIT_ASSERT_NO_EXCEPTION(bool(*checkedTicket)); UNIT_ASSERT_NO_EXCEPTION(checkedTicket->DebugInfo()); - } + } Y_UNIT_TEST(TicketProtoTest) { ticket2::Ticket protobufTicket; UNIT_ASSERT(protobufTicket.ParseFromString(NUtils::Base64url2bin(SERVICE_TICKET_PROTOBUF))); - TTestServiceTicketImpl checkedTicket(ETicketStatus::Ok, std::move(protobufTicket)); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); + TTestServiceTicketImpl checkedTicket(ETicketStatus::Ok, std::move(protobufTicket)); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); UNIT_ASSERT_VALUES_EQUAL(std::numeric_limits<time_t>::max(), checkedTicket.GetExpirationTime()); UNIT_ASSERT_EQUAL(SRC_ID, checkedTicket.GetSrc()); - } + } Y_UNIT_TEST(ResetKeysTest) { - TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); - context.ResetKeys(NUnittest::TVMKNIFE_PUBLIC_KEYS); + TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); + context.ResetKeys(NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_SERVICE_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); - } - - Y_UNIT_TEST(CreateTicketForTests) { - TCheckedServiceTicket t = NTvmAuth::NUnittest::CreateServiceTicket(ETicketStatus::Ok, 42); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, t.GetStatus()); - UNIT_ASSERT_EQUAL(42, t.GetSrc()); - UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;src=42;dst=100500;", t.DebugInfo()); - } - - Y_UNIT_TEST(CreateForTests) { - auto t = TCheckedServiceTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 456, {}); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, t->GetStatus()); - UNIT_ASSERT_VALUES_EQUAL(456, t->GetSrc()); - UNIT_ASSERT(!t->GetIssuerUid()); - - t = TCheckedServiceTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 456, 100800); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, t->GetStatus()); - UNIT_ASSERT_VALUES_EQUAL(456, t->GetSrc()); - UNIT_ASSERT(t->GetIssuerUid()); - UNIT_ASSERT_VALUES_EQUAL(*t->GetIssuerUid(), 100800); - - t = TCheckedServiceTicket::TImpl::CreateTicketForTests(ETicketStatus::Expired, 456, {}); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Expired, t->GetStatus()); - UNIT_ASSERT_EXCEPTION_CONTAINS(t->GetSrc(), TNotAllowedException, "Method cannot be used in non-valid ticket"); - UNIT_ASSERT_EXCEPTION_CONTAINS(t->GetIssuerUid(), TNotAllowedException, "Method cannot be used in non-valid ticket"); - } -} + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); + } + + Y_UNIT_TEST(CreateTicketForTests) { + TCheckedServiceTicket t = NTvmAuth::NUnittest::CreateServiceTicket(ETicketStatus::Ok, 42); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, t.GetStatus()); + UNIT_ASSERT_EQUAL(42, t.GetSrc()); + UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;src=42;dst=100500;", t.DebugInfo()); + } + + Y_UNIT_TEST(CreateForTests) { + auto t = TCheckedServiceTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 456, {}); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, t->GetStatus()); + UNIT_ASSERT_VALUES_EQUAL(456, t->GetSrc()); + UNIT_ASSERT(!t->GetIssuerUid()); + + t = TCheckedServiceTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 456, 100800); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, t->GetStatus()); + UNIT_ASSERT_VALUES_EQUAL(456, t->GetSrc()); + UNIT_ASSERT(t->GetIssuerUid()); + UNIT_ASSERT_VALUES_EQUAL(*t->GetIssuerUid(), 100800); + + t = TCheckedServiceTicket::TImpl::CreateTicketForTests(ETicketStatus::Expired, 456, {}); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Expired, t->GetStatus()); + UNIT_ASSERT_EXCEPTION_CONTAINS(t->GetSrc(), TNotAllowedException, "Method cannot be used in non-valid ticket"); + UNIT_ASSERT_EXCEPTION_CONTAINS(t->GetIssuerUid(), TNotAllowedException, "Method cannot be used in non-valid ticket"); + } +} diff --git a/library/cpp/tvmauth/src/ut/user_ut.cpp b/library/cpp/tvmauth/src/ut/user_ut.cpp index c040e94974..e4b05d261b 100644 --- a/library/cpp/tvmauth/src/ut/user_ut.cpp +++ b/library/cpp/tvmauth/src/ut/user_ut.cpp @@ -1,19 +1,19 @@ -#include <library/cpp/tvmauth/src/user_impl.h> -#include <library/cpp/tvmauth/src/utils.h> +#include <library/cpp/tvmauth/src/user_impl.h> +#include <library/cpp/tvmauth/src/utils.h> -#include <library/cpp/tvmauth/exception.h> -#include <library/cpp/tvmauth/unittest.h> +#include <library/cpp/tvmauth/exception.h> +#include <library/cpp/tvmauth/unittest.h> #include <library/cpp/testing/unittest/registar.h> - -using namespace NTvmAuth; + +using namespace NTvmAuth; Y_UNIT_TEST_SUITE(UserTestSuite) { Y_UNIT_TEST_DECLARE(TicketProtoTest); -} +} -class TTestUserTicketImpl: TCheckedUserTicket::TImpl { - using TCheckedUserTicket::TImpl::TImpl; +class TTestUserTicketImpl: TCheckedUserTicket::TImpl { + using TCheckedUserTicket::TImpl::TImpl; Y_UNIT_TEST_FRIEND(UserTestSuite, TicketProtoTest); }; @@ -28,64 +28,64 @@ Y_UNIT_TEST_SUITE_IMPLEMENTATION(UserTestSuite) { static const TString VALID_USER_TICKET_3 = "3:user:CA0Q__________9_Go8bCgIIAAoCCAEKAggCCgIIAwoCCAQKAggFCgIIBgoCCAcKAggICgIICQoCCAoKAggLCgIIDAoCCA0KAggOCgIIDwoCCBAKAggRCgIIEgoCCBMKAggUCgIIFQoCCBYKAggXCgIIGAoCCBkKAggaCgIIGwoCCBwKAggdCgIIHgoCCB8KAgggCgIIIQoCCCIKAggjCgIIJAoCCCUKAggmCgIIJwoCCCgKAggpCgIIKgoCCCsKAggsCgIILQoCCC4KAggvCgIIMAoCCDEKAggyCgIIMwoCCDQKAgg1CgIINgoCCDcKAgg4CgIIOQoCCDoKAgg7CgIIPAoCCD0KAgg-CgIIPwoCCEAKAghBCgIIQgoCCEMKAghECgIIRQoCCEYKAghHCgIISAoCCEkKAghKCgIISwoCCEwKAghNCgIITgoCCE8KAghQCgIIUQoCCFIKAghTCgIIVAoCCFUKAghWCgIIVwoCCFgKAghZCgIIWgoCCFsKAghcCgIIXQoCCF4KAghfCgIIYAoCCGEKAghiCgIIYwoCCGQKAghlCgIIZgoCCGcKAghoCgIIaQoCCGoKAghrCgIIbAoCCG0KAghuCgIIbwoCCHAKAghxCgIIcgoCCHMKAgh0CgIIdQoCCHYKAgh3CgIIeAoCCHkKAgh6CgIIewoCCHwKAgh9CgIIfgoCCH8KAwiAAQoDCIEBCgMIggEKAwiDAQoDCIQBCgMIhQEKAwiGAQoDCIcBCgMIiAEKAwiJAQoDCIoBCgMIiwEKAwiMAQoDCI0BCgMIjgEKAwiPAQoDCJABCgMIkQEKAwiSAQoDCJMBCgMIlAEKAwiVAQoDCJYBCgMIlwEKAwiYAQoDCJkBCgMImgEKAwibAQoDCJwBCgMInQEKAwieAQoDCJ8BCgMIoAEKAwihAQoDCKIBCgMIowEKAwikAQoDCKUBCgMIpgEKAwinAQoDCKgBCgMIqQEKAwiqAQoDCKsBCgMIrAEKAwitAQoDCK4BCgMIrwEKAwiwAQoDCLEBCgMIsgEKAwizAQoDCLQBCgMItQEKAwi2AQoDCLcBCgMIuAEKAwi5AQoDCLoBCgMIuwEKAwi8AQoDCL0BCgMIvgEKAwi_AQoDCMABCgMIwQEKAwjCAQoDCMMBCgMIxAEKAwjFAQoDCMYBCgMIxwEKAwjIAQoDCMkBCgMIygEKAwjLAQoDCMwBCgMIzQEKAwjOAQoDCM8BCgMI0AEKAwjRAQoDCNIBCgMI0wEKAwjUAQoDCNUBCgMI1gEKAwjXAQoDCNgBCgMI2QEKAwjaAQoDCNsBCgMI3AEKAwjdAQoDCN4BCgMI3wEKAwjgAQoDCOEBCgMI4gEKAwjjAQoDCOQBCgMI5QEKAwjmAQoDCOcBCgMI6AEKAwjpAQoDCOoBCgMI6wEKAwjsAQoDCO0BCgMI7gEKAwjvAQoDCPABCgMI8QEKAwjyAQoDCPMBCgMI9AEKAwj1AQoDCPYBCgMI9wEKAwj4AQoDCPkBCgMI-gEKAwj7AQoDCPwBCgMI_QEKAwj-AQoDCP8BCgMIgAIKAwiBAgoDCIICCgMIgwIKAwiEAgoDCIUCCgMIhgIKAwiHAgoDCIgCCgMIiQIKAwiKAgoDCIsCCgMIjAIKAwiNAgoDCI4CCgMIjwIKAwiQAgoDCJECCgMIkgIKAwiTAgoDCJQCCgMIlQIKAwiWAgoDCJcCCgMImAIKAwiZAgoDCJoCCgMImwIKAwicAgoDCJ0CCgMIngIKAwifAgoDCKACCgMIoQIKAwiiAgoDCKMCCgMIpAIKAwilAgoDCKYCCgMIpwIKAwioAgoDCKkCCgMIqgIKAwirAgoDCKwCCgMIrQIKAwiuAgoDCK8CCgMIsAIKAwixAgoDCLICCgMIswIKAwi0AgoDCLUCCgMItgIKAwi3AgoDCLgCCgMIuQIKAwi6AgoDCLsCCgMIvAIKAwi9AgoDCL4CCgMIvwIKAwjAAgoDCMECCgMIwgIKAwjDAgoDCMQCCgMIxQIKAwjGAgoDCMcCCgMIyAIKAwjJAgoDCMoCCgMIywIKAwjMAgoDCM0CCgMIzgIKAwjPAgoDCNACCgMI0QIKAwjSAgoDCNMCCgMI1AIKAwjVAgoDCNYCCgMI1wIKAwjYAgoDCNkCCgMI2gIKAwjbAgoDCNwCCgMI3QIKAwjeAgoDCN8CCgMI4AIKAwjhAgoDCOICCgMI4wIKAwjkAgoDCOUCCgMI5gIKAwjnAgoDCOgCCgMI6QIKAwjqAgoDCOsCCgMI7AIKAwjtAgoDCO4CCgMI7wIKAwjwAgoDCPECCgMI8gIKAwjzAgoDCPQCCgMI9QIKAwj2AgoDCPcCCgMI-AIKAwj5AgoDCPoCCgMI-wIKAwj8AgoDCP0CCgMI_gIKAwj_AgoDCIADCgMIgQMKAwiCAwoDCIMDCgMIhAMKAwiFAwoDCIYDCgMIhwMKAwiIAwoDCIkDCgMIigMKAwiLAwoDCIwDCgMIjQMKAwiOAwoDCI8DCgMIkAMKAwiRAwoDCJIDCgMIkwMKAwiUAwoDCJUDCgMIlgMKAwiXAwoDCJgDCgMImQMKAwiaAwoDCJsDCgMInAMKAwidAwoDCJ4DCgMInwMKAwigAwoDCKEDCgMIogMKAwijAwoDCKQDCgMIpQMKAwimAwoDCKcDCgMIqAMKAwipAwoDCKoDCgMIqwMKAwisAwoDCK0DCgMIrgMKAwivAwoDCLADCgMIsQMKAwiyAwoDCLMDCgMItAMKAwi1AwoDCLYDCgMItwMKAwi4AwoDCLkDCgMIugMKAwi7AwoDCLwDCgMIvQMKAwi-AwoDCL8DCgMIwAMKAwjBAwoDCMIDCgMIwwMKAwjEAwoDCMUDCgMIxgMKAwjHAwoDCMgDCgMIyQMKAwjKAwoDCMsDCgMIzAMKAwjNAwoDCM4DCgMIzwMKAwjQAwoDCNEDCgMI0gMKAwjTAwoDCNQDCgMI1QMKAwjWAwoDCNcDCgMI2AMKAwjZAwoDCNoDCgMI2wMKAwjcAwoDCN0DCgMI3gMKAwjfAwoDCOADCgMI4QMKAwjiAwoDCOMDCgMI5AMKAwjlAwoDCOYDCgMI5wMKAwjoAwoDCOkDCgMI6gMKAwjrAwoDCOwDCgMI7QMKAwjuAwoDCO8DCgMI8AMKAwjxAwoDCPIDCgMI8wMQyAMaCGJiOnNlc3MxGgliYjpzZXNzMTAaCmJiOnNlc3MxMDAaCWJiOnNlc3MxMRoJYmI6c2VzczEyGgliYjpzZXNzMTMaCWJiOnNlc3MxNBoJYmI6c2VzczE1GgliYjpzZXNzMTYaCWJiOnNlc3MxNxoJYmI6c2VzczE4GgliYjpzZXNzMTkaCGJiOnNlc3MyGgliYjpzZXNzMjAaCWJiOnNlc3MyMRoJYmI6c2VzczIyGgliYjpzZXNzMjMaCWJiOnNlc3MyNBoJYmI6c2VzczI1GgliYjpzZXNzMjYaCWJiOnNlc3MyNxoJYmI6c2VzczI4GgliYjpzZXNzMjkaCGJiOnNlc3MzGgliYjpzZXNzMzAaCWJiOnNlc3MzMRoJYmI6c2VzczMyGgliYjpzZXNzMzMaCWJiOnNlc3MzNBoJYmI6c2VzczM1GgliYjpzZXNzMzYaCWJiOnNlc3MzNxoJYmI6c2VzczM4GgliYjpzZXNzMzkaCGJiOnNlc3M0GgliYjpzZXNzNDAaCWJiOnNlc3M0MRoJYmI6c2VzczQyGgliYjpzZXNzNDMaCWJiOnNlc3M0NBoJYmI6c2VzczQ1GgliYjpzZXNzNDYaCWJiOnNlc3M0NxoJYmI6c2VzczQ4GgliYjpzZXNzNDkaCGJiOnNlc3M1GgliYjpzZXNzNTAaCWJiOnNlc3M1MRoJYmI6c2VzczUyGgliYjpzZXNzNTMaCWJiOnNlc3M1NBoJYmI6c2VzczU1GgliYjpzZXNzNTYaCWJiOnNlc3M1NxoJYmI6c2VzczU4GgliYjpzZXNzNTkaCGJiOnNlc3M2GgliYjpzZXNzNjAaCWJiOnNlc3M2MRoJYmI6c2VzczYyGgliYjpzZXNzNjMaCWJiOnNlc3M2NBoJYmI6c2VzczY1GgliYjpzZXNzNjYaCWJiOnNlc3M2NxoJYmI6c2VzczY4GgliYjpzZXNzNjkaCGJiOnNlc3M3GgliYjpzZXNzNzAaCWJiOnNlc3M3MRoJYmI6c2VzczcyGgliYjpzZXNzNzMaCWJiOnNlc3M3NBoJYmI6c2Vzczc1GgliYjpzZXNzNzYaCWJiOnNlc3M3NxoJYmI6c2Vzczc4GgliYjpzZXNzNzkaCGJiOnNlc3M4GgliYjpzZXNzODAaCWJiOnNlc3M4MRoJYmI6c2VzczgyGgliYjpzZXNzODMaCWJiOnNlc3M4NBoJYmI6c2Vzczg1GgliYjpzZXNzODYaCWJiOnNlc3M4NxoJYmI6c2Vzczg4GgliYjpzZXNzODkaCGJiOnNlc3M5GgliYjpzZXNzOTAaCWJiOnNlc3M5MRoJYmI6c2VzczkyGgliYjpzZXNzOTMaCWJiOnNlc3M5NBoJYmI6c2Vzczk1GgliYjpzZXNzOTYaCWJiOnNlc3M5NxoJYmI6c2Vzczk4GgliYjpzZXNzOTkgEigB:CX8PIOrxJnQqFXl7wAsiHJ_1VGjoI-asNlCXb8SE8jtI2vdh9x6CqbAurSgIlAAEgotVP-nuUR38x_a9YJuXzmG5AvJ458apWQtODHIDIX6ZaIwMxjS02R7S5LNqXa0gAuU_R6bCWpZdWe2uLMkdpu5KHbDgW08g-uaP_nceDOk"; Y_UNIT_TEST(ContextText) { - TUserContext::TImpl context(EBlackboxEnv::Prod, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext::TImpl context(EBlackboxEnv::Prod, NUnittest::TVMKNIFE_PUBLIC_KEYS); UNIT_ASSERT_EQUAL(2, context.GetKeys().size()); - UNIT_ASSERT_NO_EXCEPTION(context.ResetKeys(NUnittest::TVMKNIFE_PUBLIC_KEYS)); + UNIT_ASSERT_NO_EXCEPTION(context.ResetKeys(NUnittest::TVMKNIFE_PUBLIC_KEYS)); UNIT_ASSERT_EQUAL(2, context.GetKeys().size()); - } + } Y_UNIT_TEST(ContextEnvTest) { - TUserContext::TImpl p(EBlackboxEnv::Prod, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext::TImpl p(EBlackboxEnv::Prod, NUnittest::TVMKNIFE_PUBLIC_KEYS); UNIT_ASSERT_EQUAL(2, p.GetKeys().size()); - UNIT_ASSERT(p.IsAllowed(tvm_keys::Prod)); - UNIT_ASSERT(!p.IsAllowed(tvm_keys::ProdYateam)); - UNIT_ASSERT(!p.IsAllowed(tvm_keys::Test)); - UNIT_ASSERT(!p.IsAllowed(tvm_keys::TestYateam)); - UNIT_ASSERT(!p.IsAllowed(tvm_keys::Stress)); + UNIT_ASSERT(p.IsAllowed(tvm_keys::Prod)); + UNIT_ASSERT(!p.IsAllowed(tvm_keys::ProdYateam)); + UNIT_ASSERT(!p.IsAllowed(tvm_keys::Test)); + UNIT_ASSERT(!p.IsAllowed(tvm_keys::TestYateam)); + UNIT_ASSERT(!p.IsAllowed(tvm_keys::Stress)); - TUserContext::TImpl pt(EBlackboxEnv::ProdYateam, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext::TImpl pt(EBlackboxEnv::ProdYateam, NUnittest::TVMKNIFE_PUBLIC_KEYS); UNIT_ASSERT_EQUAL(2, pt.GetKeys().size()); - UNIT_ASSERT(!pt.IsAllowed(tvm_keys::Prod)); - UNIT_ASSERT(pt.IsAllowed(tvm_keys::ProdYateam)); - UNIT_ASSERT(!pt.IsAllowed(tvm_keys::Test)); - UNIT_ASSERT(!pt.IsAllowed(tvm_keys::TestYateam)); - UNIT_ASSERT(!pt.IsAllowed(tvm_keys::Stress)); + UNIT_ASSERT(!pt.IsAllowed(tvm_keys::Prod)); + UNIT_ASSERT(pt.IsAllowed(tvm_keys::ProdYateam)); + UNIT_ASSERT(!pt.IsAllowed(tvm_keys::Test)); + UNIT_ASSERT(!pt.IsAllowed(tvm_keys::TestYateam)); + UNIT_ASSERT(!pt.IsAllowed(tvm_keys::Stress)); - TUserContext::TImpl t(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext::TImpl t(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); UNIT_ASSERT_EQUAL(2, t.GetKeys().size()); - UNIT_ASSERT(!t.IsAllowed(tvm_keys::Prod)); - UNIT_ASSERT(!t.IsAllowed(tvm_keys::ProdYateam)); - UNIT_ASSERT(t.IsAllowed(tvm_keys::Test)); - UNIT_ASSERT(!t.IsAllowed(tvm_keys::TestYateam)); - UNIT_ASSERT(!t.IsAllowed(tvm_keys::Stress)); + UNIT_ASSERT(!t.IsAllowed(tvm_keys::Prod)); + UNIT_ASSERT(!t.IsAllowed(tvm_keys::ProdYateam)); + UNIT_ASSERT(t.IsAllowed(tvm_keys::Test)); + UNIT_ASSERT(!t.IsAllowed(tvm_keys::TestYateam)); + UNIT_ASSERT(!t.IsAllowed(tvm_keys::Stress)); - TUserContext::TImpl tt(EBlackboxEnv::TestYateam, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext::TImpl tt(EBlackboxEnv::TestYateam, NUnittest::TVMKNIFE_PUBLIC_KEYS); UNIT_ASSERT_EQUAL(2, tt.GetKeys().size()); - UNIT_ASSERT(!tt.IsAllowed(tvm_keys::Prod)); - UNIT_ASSERT(!tt.IsAllowed(tvm_keys::ProdYateam)); - UNIT_ASSERT(!tt.IsAllowed(tvm_keys::Test)); - UNIT_ASSERT(tt.IsAllowed(tvm_keys::TestYateam)); - UNIT_ASSERT(!tt.IsAllowed(tvm_keys::Stress)); + UNIT_ASSERT(!tt.IsAllowed(tvm_keys::Prod)); + UNIT_ASSERT(!tt.IsAllowed(tvm_keys::ProdYateam)); + UNIT_ASSERT(!tt.IsAllowed(tvm_keys::Test)); + UNIT_ASSERT(tt.IsAllowed(tvm_keys::TestYateam)); + UNIT_ASSERT(!tt.IsAllowed(tvm_keys::Stress)); - TUserContext::TImpl s(EBlackboxEnv::Stress, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext::TImpl s(EBlackboxEnv::Stress, NUnittest::TVMKNIFE_PUBLIC_KEYS); UNIT_ASSERT_EQUAL(4, s.GetKeys().size()); - UNIT_ASSERT(s.IsAllowed(tvm_keys::Prod)); - UNIT_ASSERT(!s.IsAllowed(tvm_keys::ProdYateam)); - UNIT_ASSERT(!s.IsAllowed(tvm_keys::Test)); - UNIT_ASSERT(!s.IsAllowed(tvm_keys::TestYateam)); - UNIT_ASSERT(s.IsAllowed(tvm_keys::Stress)); - } + UNIT_ASSERT(s.IsAllowed(tvm_keys::Prod)); + UNIT_ASSERT(!s.IsAllowed(tvm_keys::ProdYateam)); + UNIT_ASSERT(!s.IsAllowed(tvm_keys::Test)); + UNIT_ASSERT(!s.IsAllowed(tvm_keys::TestYateam)); + UNIT_ASSERT(s.IsAllowed(tvm_keys::Stress)); + } Y_UNIT_TEST(ContextExceptionsText) { UNIT_ASSERT_EXCEPTION(TUserContext::TImpl(EBlackboxEnv::Prod, EMPTY_TVM_KEYS), TEmptyTvmKeysException); UNIT_ASSERT_EXCEPTION(TUserContext::TImpl(EBlackboxEnv::Prod, MALFORMED_TVM_KEYS), TMalformedTvmKeysException); UNIT_ASSERT_EXCEPTION(TUserContext::TImpl(EBlackboxEnv::Prod, "adcvxcv./-+"), TMalformedTvmKeysException); - } + } Y_UNIT_TEST(Ticket1Test) { - TUserContext::TImpl context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext::TImpl context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_USER_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); UNIT_ASSERT_EQUAL(std::numeric_limits<time_t>::max(), checkedTicket->GetExpirationTime()); UNIT_ASSERT_EQUAL(TUids({456, 123}), checkedTicket->GetUids()); UNIT_ASSERT_EQUAL(456, checkedTicket->GetDefaultUid()); @@ -94,33 +94,33 @@ Y_UNIT_TEST_SUITE_IMPLEMENTATION(UserTestSuite) { UNIT_ASSERT(checkedTicket->HasScope("bb:sess2")); UNIT_ASSERT(!checkedTicket->HasScope("bb:sess3")); UNIT_ASSERT_EQUAL("ticket_type=user;expiration_time=9223372036854775807;scope=bb:sess1;scope=bb:sess2;default_uid=456;uid=456;uid=123;env=Test;", checkedTicket->DebugInfo()); - } + } Y_UNIT_TEST(Ticket2Test) { - TUserContext::TImpl context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext::TImpl context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_USER_TICKET_2); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); UNIT_ASSERT_VALUES_EQUAL("ticket_type=user;expiration_time=9223372036854775807;default_uid=456;uid=456;uid=123;env=Test;", checkedTicket->DebugInfo()); - } + } Y_UNIT_TEST(Ticket3Test) { - TUserContext::TImpl context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext::TImpl context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_USER_TICKET_3); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); UNIT_ASSERT_VALUES_EQUAL("ticket_type=user;expiration_time=9223372036854775807;scope=bb:sess1;scope=bb:sess10;scope=bb:sess100;scope=bb:sess11;scope=bb:sess12;scope=bb:sess13;scope=bb:sess14;scope=bb:sess15;scope=bb:sess16;scope=bb:sess17;scope=bb:sess18;scope=bb:sess19;scope=bb:sess2;scope=bb:sess20;scope=bb:sess21;scope=bb:sess22;scope=bb:sess23;scope=bb:sess24;scope=bb:sess25;scope=bb:sess26;scope=bb:sess27;scope=bb:sess28;scope=bb:sess29;scope=bb:sess3;scope=bb:sess30;scope=bb:sess31;scope=bb:sess32;scope=bb:sess33;scope=bb:sess34;scope=bb:sess35;scope=bb:sess36;scope=bb:sess37;scope=bb:sess38;scope=bb:sess39;scope=bb:sess4;scope=bb:sess40;scope=bb:sess41;scope=bb:sess42;scope=bb:sess43;scope=bb:sess44;scope=bb:sess45;scope=bb:sess46;scope=bb:sess47;scope=bb:sess48;scope=bb:sess49;scope=bb:sess5;scope=bb:sess50;scope=bb:sess51;scope=bb:sess52;scope=bb:sess53;scope=bb:sess54;scope=bb:sess55;scope=bb:sess56;scope=bb:sess57;scope=bb:sess58;scope=bb:sess59;scope=bb:sess6;scope=bb:sess60;scope=bb:sess61;scope=bb:sess62;scope=bb:sess63;scope=bb:sess64;scope=bb:sess65;scope=bb:sess66;scope=bb:sess67;scope=bb:sess68;scope=bb:sess69;scope=bb:sess7;scope=bb:sess70;scope=bb:sess71;scope=bb:sess72;scope=bb:sess73;scope=bb:sess74;scope=bb:sess75;scope=bb:sess76;scope=bb:sess77;scope=bb:sess78;scope=bb:sess79;scope=bb:sess8;scope=bb:sess80;scope=bb:sess81;scope=bb:sess82;scope=bb:sess83;scope=bb:sess84;scope=bb:sess85;scope=bb:sess86;scope=bb:sess87;scope=bb:sess88;scope=bb:sess89;scope=bb:sess9;scope=bb:sess90;scope=bb:sess91;scope=bb:sess92;scope=bb:sess93;scope=bb:sess94;scope=bb:sess95;scope=bb:sess96;scope=bb:sess97;scope=bb:sess98;scope=bb:sess99;default_uid=456;uid=0;uid=1;uid=2;uid=3;uid=4;uid=5;uid=6;uid=7;uid=8;uid=9;uid=10;uid=11;uid=12;uid=13;uid=14;uid=15;uid=16;uid=17;uid=18;uid=19;uid=20;uid=21;uid=22;uid=23;uid=24;uid=25;uid=26;uid=27;uid=28;uid=29;uid=30;uid=31;uid=32;uid=33;uid=34;uid=35;uid=36;uid=37;uid=38;uid=39;uid=40;uid=41;uid=42;uid=43;uid=44;uid=45;uid=46;uid=47;uid=48;uid=49;uid=50;uid=51;uid=52;uid=53;uid=54;uid=55;uid=56;uid=57;uid=58;uid=59;uid=60;uid=61;uid=62;uid=63;uid=64;uid=65;uid=66;uid=67;uid=68;uid=69;uid=70;uid=71;uid=72;uid=73;uid=74;uid=75;uid=76;uid=77;uid=78;uid=79;uid=80;uid=81;uid=82;uid=83;uid=84;uid=85;uid=86;uid=87;uid=88;uid=89;uid=90;uid=91;uid=92;uid=93;uid=94;uid=95;uid=96;uid=97;uid=98;uid=99;uid=100;uid=101;uid=102;uid=103;uid=104;uid=105;uid=106;uid=107;uid=108;uid=109;uid=110;uid=111;uid=112;uid=113;uid=114;uid=115;uid=116;uid=117;uid=118;uid=119;uid=120;uid=121;uid=122;uid=123;uid=124;uid=125;uid=126;uid=127;uid=128;uid=129;uid=130;uid=131;uid=132;uid=133;uid=134;uid=135;uid=136;uid=137;uid=138;uid=139;uid=140;uid=141;uid=142;uid=143;uid=144;uid=145;uid=146;uid=147;uid=148;uid=149;uid=150;uid=151;uid=152;uid=153;uid=154;uid=155;uid=156;uid=157;uid=158;uid=159;uid=160;uid=161;uid=162;uid=163;uid=164;uid=165;uid=166;uid=167;uid=168;uid=169;uid=170;uid=171;uid=172;uid=173;uid=174;uid=175;uid=176;uid=177;uid=178;uid=179;uid=180;uid=181;uid=182;uid=183;uid=184;uid=185;uid=186;uid=187;uid=188;uid=189;uid=190;uid=191;uid=192;uid=193;uid=194;uid=195;uid=196;uid=197;uid=198;uid=199;uid=200;uid=201;uid=202;uid=203;uid=204;uid=205;uid=206;uid=207;uid=208;uid=209;uid=210;uid=211;uid=212;uid=213;uid=214;uid=215;uid=216;uid=217;uid=218;uid=219;uid=220;uid=221;uid=222;uid=223;uid=224;uid=225;uid=226;uid=227;uid=228;uid=229;uid=230;uid=231;uid=232;uid=233;uid=234;uid=235;uid=236;uid=237;uid=238;uid=239;uid=240;uid=241;uid=242;uid=243;uid=244;uid=245;uid=246;uid=247;uid=248;uid=249;uid=250;uid=251;uid=252;uid=253;uid=254;uid=255;uid=256;uid=257;uid=258;uid=259;uid=260;uid=261;uid=262;uid=263;uid=264;uid=265;uid=266;uid=267;uid=268;uid=269;uid=270;uid=271;uid=272;uid=273;uid=274;uid=275;uid=276;uid=277;uid=278;uid=279;uid=280;uid=281;uid=282;uid=283;uid=284;uid=285;uid=286;uid=287;uid=288;uid=289;uid=290;uid=291;uid=292;uid=293;uid=294;uid=295;uid=296;uid=297;uid=298;uid=299;uid=300;uid=301;uid=302;uid=303;uid=304;uid=305;uid=306;uid=307;uid=308;uid=309;uid=310;uid=311;uid=312;uid=313;uid=314;uid=315;uid=316;uid=317;uid=318;uid=319;uid=320;uid=321;uid=322;uid=323;uid=324;uid=325;uid=326;uid=327;uid=328;uid=329;uid=330;uid=331;uid=332;uid=333;uid=334;uid=335;uid=336;uid=337;uid=338;uid=339;uid=340;uid=341;uid=342;uid=343;uid=344;uid=345;uid=346;uid=347;uid=348;uid=349;uid=350;uid=351;uid=352;uid=353;uid=354;uid=355;uid=356;uid=357;uid=358;uid=359;uid=360;uid=361;uid=362;uid=363;uid=364;uid=365;uid=366;uid=367;uid=368;uid=369;uid=370;uid=371;uid=372;uid=373;uid=374;uid=375;uid=376;uid=377;uid=378;uid=379;uid=380;uid=381;uid=382;uid=383;uid=384;uid=385;uid=386;uid=387;uid=388;uid=389;uid=390;uid=391;uid=392;uid=393;uid=394;uid=395;uid=396;uid=397;uid=398;uid=399;uid=400;uid=401;uid=402;uid=403;uid=404;uid=405;uid=406;uid=407;uid=408;uid=409;uid=410;uid=411;uid=412;uid=413;uid=414;uid=415;uid=416;uid=417;uid=418;uid=419;uid=420;uid=421;uid=422;uid=423;uid=424;uid=425;uid=426;uid=427;uid=428;uid=429;uid=430;uid=431;uid=432;uid=433;uid=434;uid=435;uid=436;uid=437;uid=438;uid=439;uid=440;uid=441;uid=442;uid=443;uid=444;uid=445;uid=446;uid=447;uid=448;uid=449;uid=450;uid=451;uid=452;uid=453;uid=454;uid=455;uid=456;uid=457;uid=458;uid=459;uid=460;uid=461;uid=462;uid=463;uid=464;uid=465;uid=466;uid=467;uid=468;uid=469;uid=470;uid=471;uid=472;uid=473;uid=474;uid=475;uid=476;uid=477;uid=478;uid=479;uid=480;uid=481;uid=482;uid=483;uid=484;uid=485;uid=486;uid=487;uid=488;uid=489;uid=490;uid=491;uid=492;uid=493;uid=494;uid=495;uid=496;uid=497;uid=498;uid=499;env=Test;", checkedTicket->DebugInfo()); - } + } Y_UNIT_TEST(TicketExceptionsTest) { - TUserContext::TImpl contextTest(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext::TImpl contextTest(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket1 = contextTest.Check(UNSUPPORTED_VERSION_USER_TICKET); - UNIT_ASSERT_EQUAL(ETicketStatus::UnsupportedVersion, checkedTicket1->GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::UnsupportedVersion, checkedTicket1->GetStatus()); auto checkedTicket2 = contextTest.Check(EXPIRED_USER_TICKET); - UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket2->GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::Expired, checkedTicket2->GetStatus()); - TUserContext::TImpl contextProd(EBlackboxEnv::Prod, NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext::TImpl contextProd(EBlackboxEnv::Prod, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket3 = contextProd.Check(VALID_USER_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::InvalidBlackboxEnv, checkedTicket3->GetStatus()); + UNIT_ASSERT_EQUAL(ETicketStatus::InvalidBlackboxEnv, checkedTicket3->GetStatus()); UNIT_ASSERT_EXCEPTION(checkedTicket3->GetDefaultUid(), TNotAllowedException); UNIT_ASSERT_EXCEPTION(checkedTicket3->GetUids(), TNotAllowedException); @@ -129,13 +129,13 @@ Y_UNIT_TEST_SUITE_IMPLEMENTATION(UserTestSuite) { UNIT_ASSERT_NO_EXCEPTION(bool(*checkedTicket3)); UNIT_ASSERT_NO_EXCEPTION(checkedTicket3->DebugInfo()); UNIT_ASSERT_NO_EXCEPTION(checkedTicket3->GetStatus()); - } + } Y_UNIT_TEST(TicketProtoTest) { ticket2::Ticket protobufTicket; UNIT_ASSERT(protobufTicket.ParseFromString(NUtils::Base64url2bin(USER_TICKET_PROTOBUF))); - TTestUserTicketImpl userTicket(ETicketStatus::Ok, std::move(protobufTicket)); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, userTicket.GetStatus()); + TTestUserTicketImpl userTicket(ETicketStatus::Ok, std::move(protobufTicket)); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, userTicket.GetStatus()); UNIT_ASSERT_EQUAL(std::numeric_limits<time_t>::max(), userTicket.GetExpirationTime()); UNIT_ASSERT_EQUAL(TUids({456, 123}), userTicket.GetUids()); UNIT_ASSERT_EQUAL(456, userTicket.GetDefaultUid()); @@ -143,74 +143,74 @@ Y_UNIT_TEST_SUITE_IMPLEMENTATION(UserTestSuite) { UNIT_ASSERT(userTicket.HasScope("bb:sess1")); UNIT_ASSERT(userTicket.HasScope("bb:sess2")); UNIT_ASSERT(!userTicket.HasScope("bb:sess3")); - } + } Y_UNIT_TEST(ResetKeysTest) { - TUserContext::TImpl context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); - context.ResetKeys(NUnittest::TVMKNIFE_PUBLIC_KEYS); + TUserContext::TImpl context(EBlackboxEnv::Test, NUnittest::TVMKNIFE_PUBLIC_KEYS); + context.ResetKeys(NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_USER_TICKET_1); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); - } - - Y_UNIT_TEST(CreateTicketForTests) { - TCheckedUserTicket t = NTvmAuth::NUnittest::CreateUserTicket(ETicketStatus::Ok, 42, {"qwerty", "omg"}, {43, 55, 47}); - UNIT_ASSERT_EQUAL(ETicketStatus::Ok, t.GetStatus()); - UNIT_ASSERT_EQUAL(42, t.GetDefaultUid()); - UNIT_ASSERT_EQUAL(TUids({42, 43, 47, 55}), t.GetUids()); - UNIT_ASSERT_EQUAL(TScopes({"omg", "qwerty"}), t.GetScopes()); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); + } + + Y_UNIT_TEST(CreateTicketForTests) { + TCheckedUserTicket t = NTvmAuth::NUnittest::CreateUserTicket(ETicketStatus::Ok, 42, {"qwerty", "omg"}, {43, 55, 47}); + UNIT_ASSERT_EQUAL(ETicketStatus::Ok, t.GetStatus()); + UNIT_ASSERT_EQUAL(42, t.GetDefaultUid()); + UNIT_ASSERT_EQUAL(TUids({42, 43, 47, 55}), t.GetUids()); + UNIT_ASSERT_EQUAL(TScopes({"omg", "qwerty"}), t.GetScopes()); UNIT_ASSERT_VALUES_EQUAL("ticket_type=user;scope=omg;scope=qwerty;default_uid=42;uid=42;uid=43;uid=47;uid=55;env=Test;", t.DebugInfo()); - } - - Y_UNIT_TEST(CreateForTests) { - TUids uids{456}; - TScopes scopes{"scope1", "scope2", "scope3"}; - TScopes scopesIn{"scope1", "scope2", "scope3", "scope1", ""}; - auto t = TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 456, scopesIn, {}); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, t->GetStatus()); - UNIT_ASSERT_VALUES_EQUAL(456, t->GetDefaultUid()); - UNIT_ASSERT_VALUES_EQUAL(uids, t->GetUids()); - UNIT_ASSERT_VALUES_EQUAL(scopes, t->GetScopes()); - - t = TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 456, scopesIn, {123, 456, 789}); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, t->GetStatus()); - UNIT_ASSERT_VALUES_EQUAL(456, t->GetDefaultUid()); - uids = TUids{123, 456, 789}; - UNIT_ASSERT_VALUES_EQUAL(uids, t->GetUids()); - UNIT_ASSERT_VALUES_EQUAL(scopes, t->GetScopes()); - - t = TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 456, scopesIn, {123, 789}); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, t->GetStatus()); - UNIT_ASSERT_VALUES_EQUAL(456, t->GetDefaultUid()); - uids = TUids{123, 456, 789}; - UNIT_ASSERT_VALUES_EQUAL(uids, t->GetUids()); - UNIT_ASSERT_VALUES_EQUAL(scopes, t->GetScopes()); - - t = TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 0, scopesIn, {123, 789}); - UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, t->GetStatus()); - UNIT_ASSERT_VALUES_EQUAL(0, t->GetDefaultUid()); - uids = TUids{123, 789}; - UNIT_ASSERT_VALUES_EQUAL(uids, t->GetUids()); - UNIT_ASSERT_VALUES_EQUAL(scopes, t->GetScopes()); - - UNIT_ASSERT_EXCEPTION_CONTAINS(TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 0, scopesIn, {}), - yexception, - "User ticket cannot contain empty uid list"); - UNIT_ASSERT_EXCEPTION_CONTAINS(TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 0, scopesIn, {0}), - yexception, - "User ticket cannot contain empty uid list"); - } -} - -template <> -void Out<NTvmAuth::TUids>(IOutputStream& o, const NTvmAuth::TUids& v) { - for (const auto& uid : v) { - o << uid << ","; - } -} - -template <> -void Out<NTvmAuth::TScopes>(IOutputStream& o, const NTvmAuth::TScopes& v) { - for (const auto& scope : v) { - o << scope << ","; - } -} + } + + Y_UNIT_TEST(CreateForTests) { + TUids uids{456}; + TScopes scopes{"scope1", "scope2", "scope3"}; + TScopes scopesIn{"scope1", "scope2", "scope3", "scope1", ""}; + auto t = TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 456, scopesIn, {}); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, t->GetStatus()); + UNIT_ASSERT_VALUES_EQUAL(456, t->GetDefaultUid()); + UNIT_ASSERT_VALUES_EQUAL(uids, t->GetUids()); + UNIT_ASSERT_VALUES_EQUAL(scopes, t->GetScopes()); + + t = TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 456, scopesIn, {123, 456, 789}); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, t->GetStatus()); + UNIT_ASSERT_VALUES_EQUAL(456, t->GetDefaultUid()); + uids = TUids{123, 456, 789}; + UNIT_ASSERT_VALUES_EQUAL(uids, t->GetUids()); + UNIT_ASSERT_VALUES_EQUAL(scopes, t->GetScopes()); + + t = TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 456, scopesIn, {123, 789}); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, t->GetStatus()); + UNIT_ASSERT_VALUES_EQUAL(456, t->GetDefaultUid()); + uids = TUids{123, 456, 789}; + UNIT_ASSERT_VALUES_EQUAL(uids, t->GetUids()); + UNIT_ASSERT_VALUES_EQUAL(scopes, t->GetScopes()); + + t = TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 0, scopesIn, {123, 789}); + UNIT_ASSERT_VALUES_EQUAL(ETicketStatus::Ok, t->GetStatus()); + UNIT_ASSERT_VALUES_EQUAL(0, t->GetDefaultUid()); + uids = TUids{123, 789}; + UNIT_ASSERT_VALUES_EQUAL(uids, t->GetUids()); + UNIT_ASSERT_VALUES_EQUAL(scopes, t->GetScopes()); + + UNIT_ASSERT_EXCEPTION_CONTAINS(TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 0, scopesIn, {}), + yexception, + "User ticket cannot contain empty uid list"); + UNIT_ASSERT_EXCEPTION_CONTAINS(TCheckedUserTicket::TImpl::CreateTicketForTests(ETicketStatus::Ok, 0, scopesIn, {0}), + yexception, + "User ticket cannot contain empty uid list"); + } +} + +template <> +void Out<NTvmAuth::TUids>(IOutputStream& o, const NTvmAuth::TUids& v) { + for (const auto& uid : v) { + o << uid << ","; + } +} + +template <> +void Out<NTvmAuth::TScopes>(IOutputStream& o, const NTvmAuth::TScopes& v) { + for (const auto& scope : v) { + o << scope << ","; + } +} diff --git a/library/cpp/tvmauth/src/ut/utils_ut.cpp b/library/cpp/tvmauth/src/ut/utils_ut.cpp index c9cb81c36f..ebf459a344 100644 --- a/library/cpp/tvmauth/src/ut/utils_ut.cpp +++ b/library/cpp/tvmauth/src/ut/utils_ut.cpp @@ -1,13 +1,13 @@ -#include <library/cpp/tvmauth/src/utils.h> - +#include <library/cpp/tvmauth/src/utils.h> + #include <library/cpp/testing/unittest/registar.h> - -#include <util/generic/maybe.h> - + +#include <util/generic/maybe.h> + Y_UNIT_TEST_SUITE(UtilsTestSuite) { - static const TString VALID_SERVICE_TICKET_1 = "3:serv:CBAQ__________9_IhkI5QEQHBoIYmI6c2VzczEaCGJiOnNlc3My:WUPx1cTf05fjD1exB35T5j2DCHWH1YaLJon_a4rN-D7JfXHK1Ai4wM4uSfboHD9xmGQH7extqtlEk1tCTCGm5qbRVloJwWzCZBXo3zKX6i1oBYP_89WcjCNPVe1e8jwGdLsnu6PpxL5cn0xCksiStILH5UmDR6xfkJdnmMG94o8"; - static const TString EXPIRED_SERVICE_TICKET = "3:serv:CBAQACIZCOUBEBwaCGJiOnNlc3MxGghiYjpzZXNzMg:IwfMNJYEqStY_SixwqJnyHOMCPR7-3HHk4uylB2oVRkthtezq-OOA7QizDvx7VABLs_iTlXuD1r5IjufNei_EiV145eaa3HIg4xCdJXCojMexf2UYJz8mF2b0YzFAy6_KWagU7xo13CyKAqzJuQf5MJcSUf0ecY9hVh36cJ51aw"; - using namespace NTvmAuth; + static const TString VALID_SERVICE_TICKET_1 = "3:serv:CBAQ__________9_IhkI5QEQHBoIYmI6c2VzczEaCGJiOnNlc3My:WUPx1cTf05fjD1exB35T5j2DCHWH1YaLJon_a4rN-D7JfXHK1Ai4wM4uSfboHD9xmGQH7extqtlEk1tCTCGm5qbRVloJwWzCZBXo3zKX6i1oBYP_89WcjCNPVe1e8jwGdLsnu6PpxL5cn0xCksiStILH5UmDR6xfkJdnmMG94o8"; + static const TString EXPIRED_SERVICE_TICKET = "3:serv:CBAQACIZCOUBEBwaCGJiOnNlc3MxGghiYjpzZXNzMg:IwfMNJYEqStY_SixwqJnyHOMCPR7-3HHk4uylB2oVRkthtezq-OOA7QizDvx7VABLs_iTlXuD1r5IjufNei_EiV145eaa3HIg4xCdJXCojMexf2UYJz8mF2b0YzFAy6_KWagU7xo13CyKAqzJuQf5MJcSUf0ecY9hVh36cJ51aw"; + using namespace NTvmAuth; Y_UNIT_TEST(base64Test) { UNIT_ASSERT_VALUES_EQUAL("-hHx", NUtils::Bin2base64url("\xfa\x11\xf1")); @@ -27,69 +27,69 @@ Y_UNIT_TEST_SUITE(UtilsTestSuite) { UNIT_ASSERT_VALUES_EQUAL("\xfa\x11\xf1\xfe\xff", NUtils::Base64url2bin("-hHx_v8=")); UNIT_ASSERT_VALUES_EQUAL("SGVsbG8sIGV2ZXJ5Ym9keSE", - NUtils::Bin2base64url(("Hello, everybody!"))); + NUtils::Bin2base64url(("Hello, everybody!"))); UNIT_ASSERT_VALUES_EQUAL("Hello, everybody!", - NUtils::Base64url2bin(("SGVsbG8sIGV2ZXJ5Ym9keSE"))); + NUtils::Base64url2bin(("SGVsbG8sIGV2ZXJ5Ym9keSE"))); UNIT_ASSERT_VALUES_EQUAL("VGhlIE1hZ2ljIFdvcmRzIGFyZSBTcXVlYW1pc2ggT3NzaWZyYWdl", - NUtils::Bin2base64url(("The Magic Words are Squeamish Ossifrage"))); + NUtils::Bin2base64url(("The Magic Words are Squeamish Ossifrage"))); UNIT_ASSERT_VALUES_EQUAL("The Magic Words are Squeamish Ossifrage", - NUtils::Base64url2bin(("VGhlIE1hZ2ljIFdvcmRzIGFyZSBTcXVlYW1pc2ggT3NzaWZyYWdl"))); + NUtils::Base64url2bin(("VGhlIE1hZ2ljIFdvcmRzIGFyZSBTcXVlYW1pc2ggT3NzaWZyYWdl"))); } Y_UNIT_TEST(sign) { UNIT_ASSERT_VALUES_EQUAL("wkGfeuopf709ozPAeGcDMqtZXPzsWvuNJ1BL586dSug", - NUtils::SignCgiParamsForTvm(NUtils::Base64url2bin("GRMJrKnj4fOVnvOqe-WyD1"), - "1490000000", - "13,19", - "bb:sess,bb:sess2")); + NUtils::SignCgiParamsForTvm(NUtils::Base64url2bin("GRMJrKnj4fOVnvOqe-WyD1"), + "1490000000", + "13,19", + "bb:sess,bb:sess2")); UNIT_ASSERT_VALUES_EQUAL("HANDYrA4ApQMQ5cfSWZk_InHWJffoXAa57P_X_B5s4M", - NUtils::SignCgiParamsForTvm(NUtils::Base64url2bin("GRMJrKnj4fOasvOqe-WyD1"), - "1490000000", - "13,19", - "bb:sess,bb:sess2")); + NUtils::SignCgiParamsForTvm(NUtils::Base64url2bin("GRMJrKnj4fOasvOqe-WyD1"), + "1490000000", + "13,19", + "bb:sess,bb:sess2")); UNIT_ASSERT_VALUES_EQUAL("T-M-3_qtjRM1dR_3hS1CRlHBTZRKK04doHXBJw-5VRk", - NUtils::SignCgiParamsForTvm(NUtils::Base64url2bin("GRMJrKnj4fOasvOqe-WyD1"), - "1490000001", - "13,19", - "bb:sess,bb:sess2")); + NUtils::SignCgiParamsForTvm(NUtils::Base64url2bin("GRMJrKnj4fOasvOqe-WyD1"), + "1490000001", + "13,19", + "bb:sess,bb:sess2")); UNIT_ASSERT_VALUES_EQUAL("gwB6M_9Jij50ZADmlDMnoyLc6AhQmtq6MClgGzO1PBE", - NUtils::SignCgiParamsForTvm(NUtils::Base64url2bin("GRMJrKnj4fOasvOqe-WyD1"), - "1490000001", - "13,19", - "")); - } - - Y_UNIT_TEST(GetExpirationTime) { - UNIT_ASSERT(!NTvmAuth::NInternal::TCanningKnife::GetExpirationTime("3:aadasdasdasdas")); - - UNIT_ASSERT(NTvmAuth::NInternal::TCanningKnife::GetExpirationTime(VALID_SERVICE_TICKET_1)); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(std::numeric_limits<time_t>::max()), - *NTvmAuth::NInternal::TCanningKnife::GetExpirationTime(VALID_SERVICE_TICKET_1)); - - UNIT_ASSERT(NTvmAuth::NInternal::TCanningKnife::GetExpirationTime(EXPIRED_SERVICE_TICKET)); - UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(0), - *NTvmAuth::NInternal::TCanningKnife::GetExpirationTime(EXPIRED_SERVICE_TICKET)); - } - - Y_UNIT_TEST(RemoveSignatureTest) { - UNIT_ASSERT_VALUES_EQUAL("1:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", - NUtils::RemoveTicketSignature("1:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("2:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", - NUtils::RemoveTicketSignature("2:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("4:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", - NUtils::RemoveTicketSignature("4:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("3.serv.ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds", - NUtils::RemoveTicketSignature("3.serv.ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:", - NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:", - NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("3:serv:", - NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("asdxcbvfgdsgfasdfxczvdsgfxcdvbcbvf", - NUtils::RemoveTicketSignature("asdxcbvfgdsgfasdfxczvdsgfxcdvbcbvf")); + NUtils::SignCgiParamsForTvm(NUtils::Base64url2bin("GRMJrKnj4fOasvOqe-WyD1"), + "1490000001", + "13,19", + "")); } + + Y_UNIT_TEST(GetExpirationTime) { + UNIT_ASSERT(!NTvmAuth::NInternal::TCanningKnife::GetExpirationTime("3:aadasdasdasdas")); + + UNIT_ASSERT(NTvmAuth::NInternal::TCanningKnife::GetExpirationTime(VALID_SERVICE_TICKET_1)); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(std::numeric_limits<time_t>::max()), + *NTvmAuth::NInternal::TCanningKnife::GetExpirationTime(VALID_SERVICE_TICKET_1)); + + UNIT_ASSERT(NTvmAuth::NInternal::TCanningKnife::GetExpirationTime(EXPIRED_SERVICE_TICKET)); + UNIT_ASSERT_VALUES_EQUAL(TInstant::Seconds(0), + *NTvmAuth::NInternal::TCanningKnife::GetExpirationTime(EXPIRED_SERVICE_TICKET)); + } + + Y_UNIT_TEST(RemoveSignatureTest) { + UNIT_ASSERT_VALUES_EQUAL("1:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", + NUtils::RemoveTicketSignature("1:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); + UNIT_ASSERT_VALUES_EQUAL("2:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", + NUtils::RemoveTicketSignature("2:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); + UNIT_ASSERT_VALUES_EQUAL("4:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", + NUtils::RemoveTicketSignature("4:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); + UNIT_ASSERT_VALUES_EQUAL("3.serv.ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds", + NUtils::RemoveTicketSignature("3.serv.ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds")); + UNIT_ASSERT_VALUES_EQUAL("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:", + NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); + UNIT_ASSERT_VALUES_EQUAL("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:", + NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); + UNIT_ASSERT_VALUES_EQUAL("3:serv:", + NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds")); + UNIT_ASSERT_VALUES_EQUAL("asdxcbvfgdsgfasdfxczvdsgfxcdvbcbvf", + NUtils::RemoveTicketSignature("asdxcbvfgdsgfasdfxczvdsgfxcdvbcbvf")); + } } diff --git a/library/cpp/tvmauth/src/ut/version_ut.cpp b/library/cpp/tvmauth/src/ut/version_ut.cpp index eeb95d1cde..f13d4683e2 100644 --- a/library/cpp/tvmauth/src/ut/version_ut.cpp +++ b/library/cpp/tvmauth/src/ut/version_ut.cpp @@ -1,18 +1,18 @@ -#include <library/cpp/tvmauth/version.h> - -#include <library/cpp/testing/unittest/registar.h> - -#include <regex> - -using namespace NTvmAuth; - -Y_UNIT_TEST_SUITE(VersionTest) { - Y_UNIT_TEST(base64Test) { - const std::regex re(R"(^\d+\.\d+\.\d+$)"); - - for (size_t idx = 0; idx < 2; ++idx) { - TStringBuf ver = LibVersion(); - UNIT_ASSERT(std::regex_match(ver.begin(), ver.end(), re)); - } - } -} +#include <library/cpp/tvmauth/version.h> + +#include <library/cpp/testing/unittest/registar.h> + +#include <regex> + +using namespace NTvmAuth; + +Y_UNIT_TEST_SUITE(VersionTest) { + Y_UNIT_TEST(base64Test) { + const std::regex re(R"(^\d+\.\d+\.\d+$)"); + + for (size_t idx = 0; idx < 2; ++idx) { + TStringBuf ver = LibVersion(); + UNIT_ASSERT(std::regex_match(ver.begin(), ver.end(), re)); + } + } +} diff --git a/library/cpp/tvmauth/src/ut/ya.make b/library/cpp/tvmauth/src/ut/ya.make index 9f510a8363..7207f503c5 100644 --- a/library/cpp/tvmauth/src/ut/ya.make +++ b/library/cpp/tvmauth/src/ut/ya.make @@ -1,6 +1,6 @@ -UNITTEST_FOR(library/cpp/tvmauth) +UNITTEST_FOR(library/cpp/tvmauth) -OWNER(g:passport_infra) +OWNER(g:passport_infra) SRCS( parser_ut.cpp @@ -8,7 +8,7 @@ SRCS( service_ut.cpp user_ut.cpp utils_ut.cpp - version_ut.cpp + version_ut.cpp ) END() diff --git a/library/cpp/tvmauth/src/utils.cpp b/library/cpp/tvmauth/src/utils.cpp index d49efa28b5..7f5346ec29 100644 --- a/library/cpp/tvmauth/src/utils.cpp +++ b/library/cpp/tvmauth/src/utils.cpp @@ -1,162 +1,162 @@ #include "utils.h" -#include "parser.h" - +#include "parser.h" + #include <contrib/libs/openssl/include/openssl/evp.h> #include <contrib/libs/openssl/include/openssl/hmac.h> #include <contrib/libs/openssl/include/openssl/md5.h> #include <contrib/libs/openssl/include/openssl/sha.h> -#include <util/generic/maybe.h> +#include <util/generic/maybe.h> #include <util/generic/strbuf.h> -#include <array> - +#include <array> + namespace { - constexpr const unsigned char b64_encode[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; - - constexpr std::array<unsigned char, 256> B64Init() { - std::array<unsigned char, 256> buf{}; - for (auto& i : buf) + constexpr const unsigned char b64_encode[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + + constexpr std::array<unsigned char, 256> B64Init() { + std::array<unsigned char, 256> buf{}; + for (auto& i : buf) i = 0xff; for (int i = 0; i < 64; ++i) - buf[b64_encode[i]] = i; + buf[b64_encode[i]] = i; - return buf; + return buf; } - constexpr std::array<unsigned char, 256> b64_decode = B64Init(); -} - -namespace NTvmAuth::NUtils { - TString Bin2base64url(TStringBuf buf) { - if (!buf) { - return TString(); - } - - TString res; - res.resize(((buf.size() + 2) / 3) << 2, 0); - - const unsigned char* pB = (const unsigned char*)buf.data(); - const unsigned char* pE = (const unsigned char*)buf.data() + buf.size(); - unsigned char* p = (unsigned char*)res.data(); - for (; pB + 2 < pE; pB += 3) { - const unsigned char a = *pB; - *p++ = b64_encode[(a >> 2) & 0x3F]; - const unsigned char b = *(pB + 1); - *p++ = b64_encode[((a & 0x3) << 4) | ((b & 0xF0) >> 4)]; - const unsigned char c = *(pB + 2); - *p++ = b64_encode[((b & 0xF) << 2) | ((c & 0xC0) >> 6)]; - *p++ = b64_encode[c & 0x3F]; + constexpr std::array<unsigned char, 256> b64_decode = B64Init(); +} + +namespace NTvmAuth::NUtils { + TString Bin2base64url(TStringBuf buf) { + if (!buf) { + return TString(); + } + + TString res; + res.resize(((buf.size() + 2) / 3) << 2, 0); + + const unsigned char* pB = (const unsigned char*)buf.data(); + const unsigned char* pE = (const unsigned char*)buf.data() + buf.size(); + unsigned char* p = (unsigned char*)res.data(); + for (; pB + 2 < pE; pB += 3) { + const unsigned char a = *pB; + *p++ = b64_encode[(a >> 2) & 0x3F]; + const unsigned char b = *(pB + 1); + *p++ = b64_encode[((a & 0x3) << 4) | ((b & 0xF0) >> 4)]; + const unsigned char c = *(pB + 2); + *p++ = b64_encode[((b & 0xF) << 2) | ((c & 0xC0) >> 6)]; + *p++ = b64_encode[c & 0x3F]; + } + + if (pB < pE) { + const unsigned char a = *pB; + *p++ = b64_encode[(a >> 2) & 0x3F]; + + if (pB == (pE - 1)) { + *p++ = b64_encode[((a & 0x3) << 4)]; + } else { + const unsigned char b = *(pB + 1); + *p++ = b64_encode[((a & 0x3) << 4) | + ((int)(b & 0xF0) >> 4)]; + *p++ = b64_encode[((b & 0xF) << 2)]; + } } - if (pB < pE) { - const unsigned char a = *pB; - *p++ = b64_encode[(a >> 2) & 0x3F]; - - if (pB == (pE - 1)) { - *p++ = b64_encode[((a & 0x3) << 4)]; - } else { - const unsigned char b = *(pB + 1); - *p++ = b64_encode[((a & 0x3) << 4) | - ((int)(b & 0xF0) >> 4)]; - *p++ = b64_encode[((b & 0xF) << 2)]; - } - } - - res.resize(p - (unsigned char*)res.data()); - return res; + res.resize(p - (unsigned char*)res.data()); + return res; } - TString Base64url2bin(TStringBuf buf) { - const unsigned char* bufin = (const unsigned char*)buf.data(); - if (!buf || b64_decode[*bufin] > 63) { - return TString(); - } - const unsigned char* bufend = (const unsigned char*)buf.data() + buf.size(); - while (++bufin < bufend && b64_decode[*bufin] < 64) - ; - int nprbytes = (bufin - (const unsigned char*)buf.data()); - int nbytesdecoded = ((nprbytes + 3) / 4) * 3; - - if (nprbytes < static_cast<int>(buf.size())) { - int left = buf.size() - nprbytes; - while (left--) { - if (*(bufin++) != '=') - return TString(); - } - } - - TString res; - res.resize(nbytesdecoded); - - unsigned char* bufout = (unsigned char*)res.data(); - bufin = (const unsigned char*)buf.data(); - - while (nprbytes > 4) { - unsigned char a = b64_decode[*bufin]; - unsigned char b = b64_decode[bufin[1]]; - *(bufout++) = (unsigned char)(a << 2 | b >> 4); - unsigned char c = b64_decode[bufin[2]]; - *(bufout++) = (unsigned char)(b << 4 | c >> 2); - unsigned char d = b64_decode[bufin[3]]; - *(bufout++) = (unsigned char)(c << 6 | d); - bufin += 4; - nprbytes -= 4; - } - - if (nprbytes == 1) { - return {}; // Impossible + TString Base64url2bin(TStringBuf buf) { + const unsigned char* bufin = (const unsigned char*)buf.data(); + if (!buf || b64_decode[*bufin] > 63) { + return TString(); } - if (nprbytes > 1) { - *(bufout++) = (unsigned char)(b64_decode[*bufin] << 2 | b64_decode[bufin[1]] >> 4); - } - if (nprbytes > 2) { - *(bufout++) = (unsigned char)(b64_decode[bufin[1]] << 4 | b64_decode[bufin[2]] >> 2); - } - if (nprbytes > 3) { - *(bufout++) = (unsigned char)(b64_decode[bufin[2]] << 6 | b64_decode[bufin[3]]); - } - - int diff = (4 - nprbytes) & 3; - if (diff) { - nbytesdecoded -= (4 - nprbytes) & 3; - res.resize(nbytesdecoded); - } - - return res; + const unsigned char* bufend = (const unsigned char*)buf.data() + buf.size(); + while (++bufin < bufend && b64_decode[*bufin] < 64) + ; + int nprbytes = (bufin - (const unsigned char*)buf.data()); + int nbytesdecoded = ((nprbytes + 3) / 4) * 3; + + if (nprbytes < static_cast<int>(buf.size())) { + int left = buf.size() - nprbytes; + while (left--) { + if (*(bufin++) != '=') + return TString(); + } + } + + TString res; + res.resize(nbytesdecoded); + + unsigned char* bufout = (unsigned char*)res.data(); + bufin = (const unsigned char*)buf.data(); + + while (nprbytes > 4) { + unsigned char a = b64_decode[*bufin]; + unsigned char b = b64_decode[bufin[1]]; + *(bufout++) = (unsigned char)(a << 2 | b >> 4); + unsigned char c = b64_decode[bufin[2]]; + *(bufout++) = (unsigned char)(b << 4 | c >> 2); + unsigned char d = b64_decode[bufin[3]]; + *(bufout++) = (unsigned char)(c << 6 | d); + bufin += 4; + nprbytes -= 4; + } + + if (nprbytes == 1) { + return {}; // Impossible + } + if (nprbytes > 1) { + *(bufout++) = (unsigned char)(b64_decode[*bufin] << 2 | b64_decode[bufin[1]] >> 4); + } + if (nprbytes > 2) { + *(bufout++) = (unsigned char)(b64_decode[bufin[1]] << 4 | b64_decode[bufin[2]] >> 2); + } + if (nprbytes > 3) { + *(bufout++) = (unsigned char)(b64_decode[bufin[2]] << 6 | b64_decode[bufin[3]]); + } + + int diff = (4 - nprbytes) & 3; + if (diff) { + nbytesdecoded -= (4 - nprbytes) & 3; + res.resize(nbytesdecoded); + } + + return res; } - TString SignCgiParamsForTvm(TStringBuf secret, TStringBuf ts, TStringBuf dstTvmId, TStringBuf scopes) { - TString data; - data.reserve(ts.size() + dstTvmId.size() + scopes.size() + 3); - const char DELIM = '|'; - data.append(ts).push_back(DELIM); - data.append(dstTvmId).push_back(DELIM); - data.append(scopes).push_back(DELIM); - - TString value(EVP_MAX_MD_SIZE, 0); - unsigned macLen = 0; - - if (!::HMAC(EVP_sha256(), secret.data(), secret.size(), (unsigned char*)data.data(), data.size(), - (unsigned char*)value.data(), &macLen)) - { - return {}; - } - - if (macLen != EVP_MAX_MD_SIZE) { - value.resize(macLen); - } - return Bin2base64url(value); - } -} - -namespace NTvmAuth::NInternal { - TMaybe<TInstant> TCanningKnife::GetExpirationTime(TStringBuf ticket) { - const TParserTickets::TRes res = TParserTickets::ParseV3(ticket, {}, TParserTickets::ServiceFlag()); - - return res.Status == ETicketStatus::MissingKey || res.Status == ETicketStatus::Expired - ? TInstant::Seconds(res.Ticket.expirationtime()) - : TMaybe<TInstant>(); + TString SignCgiParamsForTvm(TStringBuf secret, TStringBuf ts, TStringBuf dstTvmId, TStringBuf scopes) { + TString data; + data.reserve(ts.size() + dstTvmId.size() + scopes.size() + 3); + const char DELIM = '|'; + data.append(ts).push_back(DELIM); + data.append(dstTvmId).push_back(DELIM); + data.append(scopes).push_back(DELIM); + + TString value(EVP_MAX_MD_SIZE, 0); + unsigned macLen = 0; + + if (!::HMAC(EVP_sha256(), secret.data(), secret.size(), (unsigned char*)data.data(), data.size(), + (unsigned char*)value.data(), &macLen)) + { + return {}; + } + + if (macLen != EVP_MAX_MD_SIZE) { + value.resize(macLen); + } + return Bin2base64url(value); } } + +namespace NTvmAuth::NInternal { + TMaybe<TInstant> TCanningKnife::GetExpirationTime(TStringBuf ticket) { + const TParserTickets::TRes res = TParserTickets::ParseV3(ticket, {}, TParserTickets::ServiceFlag()); + + return res.Status == ETicketStatus::MissingKey || res.Status == ETicketStatus::Expired + ? TInstant::Seconds(res.Ticket.expirationtime()) + : TMaybe<TInstant>(); + } +} diff --git a/library/cpp/tvmauth/src/utils.h b/library/cpp/tvmauth/src/utils.h index e5847ac89f..7a457affb8 100644 --- a/library/cpp/tvmauth/src/utils.h +++ b/library/cpp/tvmauth/src/utils.h @@ -1,30 +1,30 @@ #pragma once -#include <library/cpp/tvmauth/checked_service_ticket.h> -#include <library/cpp/tvmauth/checked_user_ticket.h> -#include <library/cpp/tvmauth/ticket_status.h> +#include <library/cpp/tvmauth/checked_service_ticket.h> +#include <library/cpp/tvmauth/checked_user_ticket.h> +#include <library/cpp/tvmauth/ticket_status.h> -#include <util/datetime/base.h> +#include <util/datetime/base.h> #include <util/generic/fwd.h> -namespace NTvmAuth::NUtils { - TString Bin2base64url(TStringBuf buf); - TString Base64url2bin(TStringBuf buf); +namespace NTvmAuth::NUtils { + TString Bin2base64url(TStringBuf buf); + TString Base64url2bin(TStringBuf buf); - TString SignCgiParamsForTvm(TStringBuf secret, TStringBuf ts, TStringBuf dstTvmId, TStringBuf scopes); -} - -namespace NTvmAuth::NInternal { - class TCanningKnife { - public: - static TCheckedServiceTicket::TImpl* GetS(TCheckedServiceTicket& t) { - return t.Impl_.Release(); - } - - static TCheckedUserTicket::TImpl* GetU(TCheckedUserTicket& t) { - return t.Impl_.Release(); - } - - static TMaybe<TInstant> GetExpirationTime(TStringBuf ticket); - }; -} + TString SignCgiParamsForTvm(TStringBuf secret, TStringBuf ts, TStringBuf dstTvmId, TStringBuf scopes); +} + +namespace NTvmAuth::NInternal { + class TCanningKnife { + public: + static TCheckedServiceTicket::TImpl* GetS(TCheckedServiceTicket& t) { + return t.Impl_.Release(); + } + + static TCheckedUserTicket::TImpl* GetU(TCheckedUserTicket& t) { + return t.Impl_.Release(); + } + + static TMaybe<TInstant> GetExpirationTime(TStringBuf ticket); + }; +} diff --git a/library/cpp/tvmauth/src/version b/library/cpp/tvmauth/src/version index 15a2799817..1bcf861c56 100644 --- a/library/cpp/tvmauth/src/version +++ b/library/cpp/tvmauth/src/version @@ -1 +1 @@ -3.3.0 +3.3.0 diff --git a/library/cpp/tvmauth/src/version.cpp b/library/cpp/tvmauth/src/version.cpp index 6b389213d0..05709c3929 100644 --- a/library/cpp/tvmauth/src/version.cpp +++ b/library/cpp/tvmauth/src/version.cpp @@ -1,26 +1,26 @@ -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> + +#include <util/string/strip.h> -#include <util/string/strip.h> - -namespace { - class TBuiltinVersion { - public: - TBuiltinVersion() { - Version_ = NResource::Find("/builtin/version"); - StripInPlace(Version_); - } - - TStringBuf Get() const { - return Version_; - } - - private: - TString Version_; - }; -} - -namespace NTvmAuth { +namespace { + class TBuiltinVersion { + public: + TBuiltinVersion() { + Version_ = NResource::Find("/builtin/version"); + StripInPlace(Version_); + } + + TStringBuf Get() const { + return Version_; + } + + private: + TString Version_; + }; +} + +namespace NTvmAuth { TStringBuf LibVersion() { - return Singleton<TBuiltinVersion>()->Get(); + return Singleton<TBuiltinVersion>()->Get(); } -} +} diff --git a/library/cpp/tvmauth/test_all/ya.make b/library/cpp/tvmauth/test_all/ya.make index bb5bb9e5ef..5ae50c1092 100644 --- a/library/cpp/tvmauth/test_all/ya.make +++ b/library/cpp/tvmauth/test_all/ya.make @@ -1,21 +1,21 @@ -RECURSE_ROOT_RELATIVE( - library/cpp/tvmauth - library/cpp/tvmauth/client - library/go/yandex/tvm - library/go/yandex/tvm/tvmauth - library/java/ticket_parser2 - library/java/tvmauth - library/python/deprecated/ticket_parser2 - library/python/tvmauth -) - -IF (NOT OS_WINDOWS) - RECURSE_ROOT_RELATIVE( - library/c/tvmauth/src/ut - ) - IF (NOT SANITIZER_TYPE) - RECURSE_ROOT_RELATIVE( - library/c/tvmauth/src/ut_export - ) - ENDIF() -ENDIF() +RECURSE_ROOT_RELATIVE( + library/cpp/tvmauth + library/cpp/tvmauth/client + library/go/yandex/tvm + library/go/yandex/tvm/tvmauth + library/java/ticket_parser2 + library/java/tvmauth + library/python/deprecated/ticket_parser2 + library/python/tvmauth +) + +IF (NOT OS_WINDOWS) + RECURSE_ROOT_RELATIVE( + library/c/tvmauth/src/ut + ) + IF (NOT SANITIZER_TYPE) + RECURSE_ROOT_RELATIVE( + library/c/tvmauth/src/ut_export + ) + ENDIF() +ENDIF() diff --git a/library/cpp/tvmauth/ticket_status.h b/library/cpp/tvmauth/ticket_status.h index 532d4de56e..2f413aef3f 100644 --- a/library/cpp/tvmauth/ticket_status.h +++ b/library/cpp/tvmauth/ticket_status.h @@ -2,11 +2,11 @@ #include <util/generic/strbuf.h> -namespace NTvmAuth { - /*! - * Status mean result of ticket check - */ - enum class ETicketStatus { +namespace NTvmAuth { + /*! + * Status mean result of ticket check + */ + enum class ETicketStatus { Ok, Expired, InvalidBlackboxEnv, @@ -16,8 +16,8 @@ namespace NTvmAuth { MissingKey, SignBroken, UnsupportedVersion, - NoRoles, + NoRoles, }; - TStringBuf StatusToString(ETicketStatus st); + TStringBuf StatusToString(ETicketStatus st); } diff --git a/library/cpp/tvmauth/type.h b/library/cpp/tvmauth/type.h index 7f4ce2b700..186714cd8b 100644 --- a/library/cpp/tvmauth/type.h +++ b/library/cpp/tvmauth/type.h @@ -2,10 +2,10 @@ #include <library/cpp/containers/stack_vector/stack_vec.h> -namespace NTvmAuth { +namespace NTvmAuth { using TScopes = TSmallVec<TStringBuf>; - using TTvmId = ui32; - using TUid = ui64; + using TTvmId = ui32; + using TUid = ui64; using TUids = TSmallVec<TUid>; - using TAlias = TString; + using TAlias = TString; } diff --git a/library/cpp/tvmauth/unittest.h b/library/cpp/tvmauth/unittest.h index efa651befa..50cc6f3b12 100644 --- a/library/cpp/tvmauth/unittest.h +++ b/library/cpp/tvmauth/unittest.h @@ -1,20 +1,20 @@ -#pragma once - -#include "checked_service_ticket.h" -#include "checked_user_ticket.h" - -#include <util/generic/maybe.h> - -namespace NTvmAuth::NUnittest { - static const TString TVMKNIFE_PUBLIC_KEYS = "1:CpgCCpMCCAEQABqIAjCCAQQCggEAcLEXeH67FQESFUn4_7wnX7wN0PUrBoUsm3QQ4W5vC-qz6sXaEjSwnTV8w1o-z6X9KPLlhzMQvuS38NCNfK4uvJ4Zvfp3YsXJ25-rYtbnrYJHNvHohD-kPCCw_yZpMp21JdWigzQGuV7CtrxUhF-NNrsnUaJrE5-OpEWNt4X6nCItKIYeVcSK6XJUbEWbrNCRbvkSc4ak2ymFeMuHYJVjxh4eQbk7_ZPzodP0WvF6eUYrYeb42imVEOR8ofVLQWE5DVnb1z_TqZm4i1XkS7jMwZuBxBRw8DGdYei0lT_sAf7KST2jC0590NySB3vsBgWEVs1OdUUWA6r-Dvx9dsOQtSCVkQYQAAqZAgqUAggCEAAaiQIwggEFAoIBAQDhEBM5-6YsPWfogKtbluJoCX1WV2KdzOaQ0-OlRbBzeCzw-eQKu12c8WakHBbeCMd1I1TU64SDkDorWjXGIa_2xT6N3zzNAE50roTbPCcmeQrps26woTYfYIuqDdoxYKZNr0lvNLLW47vBr7EKqo1S4KSj7aXK_XYeEvUgIgf3nVIcNrio7VTnFmGGVQCepaL1Hi1gN4yIXjVZ06PBPZ-DxSRu6xOGbFrfKMJeMPs7KOyE-26Q3xOXdTIa1X-zYIucTd_bxUCL4BVbwW2AvbbFsaG7ISmVdGu0XUTmhXs1KrEfUVLRJhE4Dx99hAZXm1_HlYMUeJcMQ_oHOhV94ENFIJaRBhACCpYBCpEBCAMQABqGATCBgwKBgF9t2YJGAJkRRFq6fWhi3m1TFW1UOE0f6ZrfYhHAkpqGlKlh0QVfeTNPpeJhi75xXzCe6oReRUm-0DbqDNhTShC7uGUv1INYnRBQWH6E-5Fc5XrbDFSuGQw2EYjNfHy_HefHJXxQKAqPvxBDKMKkHgV58WtM6rC8jRi9sdX_ig2NIJeRBhABCpYBCpEBCAQQABqGATCBgwKBgGB4d6eLGUBv-Q6EPLehC4S-yuE2HB-_rJ7WkeYwyp-xIPolPrd-PQme2utHB4ZgpXHIu_OFksDe_0bPgZniNRSVRbl7W49DgS5Ya3kMfrYB4DnF5Fta5tn1oV6EwxYD4JONpFTenOJALPGTPawxXEfon_peiHOSBuQMu3_Vn-l1IJiRBhADCpcBCpIBCAUQABqHATCBhAKBgQCTJMKIfmfeZpaI7Q9rnsc29gdWawK7TnpVKRHws1iY7EUlYROeVcMdAwEqVM6f8BVCKLGgzQ7Gar_uuxfUGKwqEQzoppDraw4F75J464-7D5f6_oJQuGIBHZxqbMONtLjBCXRUhQW5szBLmTQ_R3qaJb5vf-h0APZfkYhq1cTttSCZkQYQBAqWAQqRAQgLEAAahgEwgYMCgYBvvGVH_M2H8qxxv94yaDYUTWbRnJ1uiIYc59KIQlfFimMPhSS7x2tqUa2-hI55JiII0Xym6GNkwLhyc1xtWChpVuIdSnbvttbrt4weDMLHqTwNOF6qAsVKGKT1Yh8yf-qb-DSmicgvFc74mBQm_6gAY1iQsf33YX8578ClhKBWHSCVkQYQAAqXAQqSAQgMEAAahwEwgYQCgYEAkuzFcd5TJu7lYWYe2hQLFfUWIIj91BvQQLa_Thln4YtGCO8gG1KJqJm-YlmJOWQG0B7H_5RVhxUxV9KpmFnsDVkzUFKOsCBaYGXc12xPVioawUlAwp5qp3QQtZyx_se97YIoLzuLr46UkLcLnkIrp-Jo46QzYi_QHq45WTm8MQ0glpEGEAIKlwEKkgEIDRAAGocBMIGEAoGBAIUzbxOknXf_rNt17_ir8JlWvrtnCWsQd1MAnl5mgArvavDtKeBYHzi5_Ak7DHlLzuA6YE8W175FxLFKpN2hkz-l-M7ltUSd8N1BvJRhK4t6WffWfC_1wPyoAbeSN2Yb1jygtZJQ8wGoXHcJQUXiMit3eFNyylwsJFj1gzAR4JCdIJeRBhABCpYBCpEBCA4QABqGATCBgwKBgFMcbEpl9ukVR6AO_R6sMyiU11I8b8MBSUCEC15iKsrVO8v_m47_TRRjWPYtQ9eZ7o1ocNJHaGUU7qqInFqtFaVnIceP6NmCsXhjs3MLrWPS8IRAy4Zf4FKmGOx3N9O2vemjUygZ9vUiSkULdVrecinRaT8JQ5RG4bUMY04XGIwFIJiRBhADCpYBCpEBCA8QABqGATCBgwKBgGpCkW-NR3li8GlRvqpq2YZGSIgm_PTyDI2Zwfw69grsBmPpVFW48Vw7xoMN35zcrojEpialB_uQzlpLYOvsMl634CRIuj-n1QE3-gaZTTTE8mg-AR4mcxnTKThPnRQpbuOlYAnriwiasWiQEMbGjq_HmWioYYxFo9USlklQn4-9IJmRBhAEEpUBCpIBCAYQABqHATCBhAKBgQCoZkFGm9oLTqjeXZAq6j5S6i7K20V0lNdBBLqfmFBIRuTkYxhs4vUYnWjZrKRAd5bp6_py0csmFmpl_5Yh0b-2pdo_E5PNP7LGRzKyKSiFddyykKKzVOazH8YYldDAfE8Z5HoS9e48an5JsPg0jr-TPu34DnJq3yv2a6dqiKL9zSCakQYSlQEKkgEIEBAAGocBMIGEAoGBALhrihbf3EpjDQS2sCQHazoFgN0nBbE9eesnnFTfzQELXb2gnJU9enmV_aDqaHKjgtLIPpCgn40lHrn5k6mvH5OdedyI6cCzE-N-GFp3nAq0NDJyMe0fhtIRD__CbT0ulcvkeow65ubXWfw6dBC2gR_34rdMe_L_TGRLMWjDULbNIJqRBg"; - - TCheckedServiceTicket CreateServiceTicket(ETicketStatus status, - TTvmId src, - TMaybe<TUid> issuerUid = TMaybe<TUid>()); - - TCheckedUserTicket CreateUserTicket(ETicketStatus status, - TUid defaultUid, - const TScopes& scopes, - const TUids& uids = TUids(), - EBlackboxEnv env = EBlackboxEnv::Test); -} +#pragma once + +#include "checked_service_ticket.h" +#include "checked_user_ticket.h" + +#include <util/generic/maybe.h> + +namespace NTvmAuth::NUnittest { + static const TString TVMKNIFE_PUBLIC_KEYS = "1:CpgCCpMCCAEQABqIAjCCAQQCggEAcLEXeH67FQESFUn4_7wnX7wN0PUrBoUsm3QQ4W5vC-qz6sXaEjSwnTV8w1o-z6X9KPLlhzMQvuS38NCNfK4uvJ4Zvfp3YsXJ25-rYtbnrYJHNvHohD-kPCCw_yZpMp21JdWigzQGuV7CtrxUhF-NNrsnUaJrE5-OpEWNt4X6nCItKIYeVcSK6XJUbEWbrNCRbvkSc4ak2ymFeMuHYJVjxh4eQbk7_ZPzodP0WvF6eUYrYeb42imVEOR8ofVLQWE5DVnb1z_TqZm4i1XkS7jMwZuBxBRw8DGdYei0lT_sAf7KST2jC0590NySB3vsBgWEVs1OdUUWA6r-Dvx9dsOQtSCVkQYQAAqZAgqUAggCEAAaiQIwggEFAoIBAQDhEBM5-6YsPWfogKtbluJoCX1WV2KdzOaQ0-OlRbBzeCzw-eQKu12c8WakHBbeCMd1I1TU64SDkDorWjXGIa_2xT6N3zzNAE50roTbPCcmeQrps26woTYfYIuqDdoxYKZNr0lvNLLW47vBr7EKqo1S4KSj7aXK_XYeEvUgIgf3nVIcNrio7VTnFmGGVQCepaL1Hi1gN4yIXjVZ06PBPZ-DxSRu6xOGbFrfKMJeMPs7KOyE-26Q3xOXdTIa1X-zYIucTd_bxUCL4BVbwW2AvbbFsaG7ISmVdGu0XUTmhXs1KrEfUVLRJhE4Dx99hAZXm1_HlYMUeJcMQ_oHOhV94ENFIJaRBhACCpYBCpEBCAMQABqGATCBgwKBgF9t2YJGAJkRRFq6fWhi3m1TFW1UOE0f6ZrfYhHAkpqGlKlh0QVfeTNPpeJhi75xXzCe6oReRUm-0DbqDNhTShC7uGUv1INYnRBQWH6E-5Fc5XrbDFSuGQw2EYjNfHy_HefHJXxQKAqPvxBDKMKkHgV58WtM6rC8jRi9sdX_ig2NIJeRBhABCpYBCpEBCAQQABqGATCBgwKBgGB4d6eLGUBv-Q6EPLehC4S-yuE2HB-_rJ7WkeYwyp-xIPolPrd-PQme2utHB4ZgpXHIu_OFksDe_0bPgZniNRSVRbl7W49DgS5Ya3kMfrYB4DnF5Fta5tn1oV6EwxYD4JONpFTenOJALPGTPawxXEfon_peiHOSBuQMu3_Vn-l1IJiRBhADCpcBCpIBCAUQABqHATCBhAKBgQCTJMKIfmfeZpaI7Q9rnsc29gdWawK7TnpVKRHws1iY7EUlYROeVcMdAwEqVM6f8BVCKLGgzQ7Gar_uuxfUGKwqEQzoppDraw4F75J464-7D5f6_oJQuGIBHZxqbMONtLjBCXRUhQW5szBLmTQ_R3qaJb5vf-h0APZfkYhq1cTttSCZkQYQBAqWAQqRAQgLEAAahgEwgYMCgYBvvGVH_M2H8qxxv94yaDYUTWbRnJ1uiIYc59KIQlfFimMPhSS7x2tqUa2-hI55JiII0Xym6GNkwLhyc1xtWChpVuIdSnbvttbrt4weDMLHqTwNOF6qAsVKGKT1Yh8yf-qb-DSmicgvFc74mBQm_6gAY1iQsf33YX8578ClhKBWHSCVkQYQAAqXAQqSAQgMEAAahwEwgYQCgYEAkuzFcd5TJu7lYWYe2hQLFfUWIIj91BvQQLa_Thln4YtGCO8gG1KJqJm-YlmJOWQG0B7H_5RVhxUxV9KpmFnsDVkzUFKOsCBaYGXc12xPVioawUlAwp5qp3QQtZyx_se97YIoLzuLr46UkLcLnkIrp-Jo46QzYi_QHq45WTm8MQ0glpEGEAIKlwEKkgEIDRAAGocBMIGEAoGBAIUzbxOknXf_rNt17_ir8JlWvrtnCWsQd1MAnl5mgArvavDtKeBYHzi5_Ak7DHlLzuA6YE8W175FxLFKpN2hkz-l-M7ltUSd8N1BvJRhK4t6WffWfC_1wPyoAbeSN2Yb1jygtZJQ8wGoXHcJQUXiMit3eFNyylwsJFj1gzAR4JCdIJeRBhABCpYBCpEBCA4QABqGATCBgwKBgFMcbEpl9ukVR6AO_R6sMyiU11I8b8MBSUCEC15iKsrVO8v_m47_TRRjWPYtQ9eZ7o1ocNJHaGUU7qqInFqtFaVnIceP6NmCsXhjs3MLrWPS8IRAy4Zf4FKmGOx3N9O2vemjUygZ9vUiSkULdVrecinRaT8JQ5RG4bUMY04XGIwFIJiRBhADCpYBCpEBCA8QABqGATCBgwKBgGpCkW-NR3li8GlRvqpq2YZGSIgm_PTyDI2Zwfw69grsBmPpVFW48Vw7xoMN35zcrojEpialB_uQzlpLYOvsMl634CRIuj-n1QE3-gaZTTTE8mg-AR4mcxnTKThPnRQpbuOlYAnriwiasWiQEMbGjq_HmWioYYxFo9USlklQn4-9IJmRBhAEEpUBCpIBCAYQABqHATCBhAKBgQCoZkFGm9oLTqjeXZAq6j5S6i7K20V0lNdBBLqfmFBIRuTkYxhs4vUYnWjZrKRAd5bp6_py0csmFmpl_5Yh0b-2pdo_E5PNP7LGRzKyKSiFddyykKKzVOazH8YYldDAfE8Z5HoS9e48an5JsPg0jr-TPu34DnJq3yv2a6dqiKL9zSCakQYSlQEKkgEIEBAAGocBMIGEAoGBALhrihbf3EpjDQS2sCQHazoFgN0nBbE9eesnnFTfzQELXb2gnJU9enmV_aDqaHKjgtLIPpCgn40lHrn5k6mvH5OdedyI6cCzE-N-GFp3nAq0NDJyMe0fhtIRD__CbT0ulcvkeow65ubXWfw6dBC2gR_34rdMe_L_TGRLMWjDULbNIJqRBg"; + + TCheckedServiceTicket CreateServiceTicket(ETicketStatus status, + TTvmId src, + TMaybe<TUid> issuerUid = TMaybe<TUid>()); + + TCheckedUserTicket CreateUserTicket(ETicketStatus status, + TUid defaultUid, + const TScopes& scopes, + const TUids& uids = TUids(), + EBlackboxEnv env = EBlackboxEnv::Test); +} diff --git a/library/cpp/tvmauth/utils.cpp b/library/cpp/tvmauth/utils.cpp index a06cd6f5ba..16e9cb63b9 100644 --- a/library/cpp/tvmauth/utils.cpp +++ b/library/cpp/tvmauth/utils.cpp @@ -1,18 +1,18 @@ -#include "utils.h" - -namespace NTvmAuth::NUtils { - TStringBuf RemoveTicketSignature(TStringBuf ticketBody) { - if (ticketBody.size() < 2 || - ticketBody[0] != '3' || - ticketBody[1] != ':') { - return ticketBody; - } - - size_t pos = ticketBody.rfind(':'); - if (pos == TStringBuf::npos) { // impossible - return ticketBody; - } - - return ticketBody.substr(0, pos + 1); - } -} +#include "utils.h" + +namespace NTvmAuth::NUtils { + TStringBuf RemoveTicketSignature(TStringBuf ticketBody) { + if (ticketBody.size() < 2 || + ticketBody[0] != '3' || + ticketBody[1] != ':') { + return ticketBody; + } + + size_t pos = ticketBody.rfind(':'); + if (pos == TStringBuf::npos) { // impossible + return ticketBody; + } + + return ticketBody.substr(0, pos + 1); + } +} diff --git a/library/cpp/tvmauth/utils.h b/library/cpp/tvmauth/utils.h index ad8950cab5..e7af712c87 100644 --- a/library/cpp/tvmauth/utils.h +++ b/library/cpp/tvmauth/utils.h @@ -1,12 +1,12 @@ -#pragma once - -#include <util/generic/strbuf.h> - -namespace NTvmAuth::NUtils { - /*! - * Remove signature from ticket string - rest part can be parsed later with `tvmknife parse_ticket ...` - * @param ticketBody Raw ticket body - * @return safe for logging part of ticket - */ - TStringBuf RemoveTicketSignature(TStringBuf ticketBody); -} +#pragma once + +#include <util/generic/strbuf.h> + +namespace NTvmAuth::NUtils { + /*! + * Remove signature from ticket string - rest part can be parsed later with `tvmknife parse_ticket ...` + * @param ticketBody Raw ticket body + * @return safe for logging part of ticket + */ + TStringBuf RemoveTicketSignature(TStringBuf ticketBody); +} diff --git a/library/cpp/tvmauth/version.h b/library/cpp/tvmauth/version.h index 48ec279829..82bbef2b46 100644 --- a/library/cpp/tvmauth/version.h +++ b/library/cpp/tvmauth/version.h @@ -2,6 +2,6 @@ #include <util/generic/strbuf.h> -namespace NTvmAuth { +namespace NTvmAuth { TStringBuf LibVersion(); } diff --git a/library/cpp/tvmauth/ya.make b/library/cpp/tvmauth/ya.make index 655336c902..df422bbf39 100644 --- a/library/cpp/tvmauth/ya.make +++ b/library/cpp/tvmauth/ya.make @@ -1,40 +1,40 @@ -LIBRARY() +LIBRARY() -OWNER(g:passport_infra) +OWNER(g:passport_infra) PEERDIR( - library/cpp/string_utils/secret_string - library/cpp/tvmauth/src/protos - library/cpp/tvmauth/src/rw + library/cpp/string_utils/secret_string + library/cpp/tvmauth/src/protos + library/cpp/tvmauth/src/rw ) SRCS( - deprecated/service_context.cpp - deprecated/user_context.cpp + deprecated/service_context.cpp + deprecated/user_context.cpp src/parser.cpp src/service_impl.cpp - src/service_ticket.cpp + src/service_ticket.cpp src/status.cpp - src/unittest.cpp + src/unittest.cpp src/user_impl.cpp - src/user_ticket.cpp + src/user_ticket.cpp src/utils.cpp src/version.cpp - utils.cpp -) - -GENERATE_ENUM_SERIALIZATION(checked_user_ticket.h) -GENERATE_ENUM_SERIALIZATION(ticket_status.h) - -RESOURCE( - src/version /builtin/version + utils.cpp ) +GENERATE_ENUM_SERIALIZATION(checked_user_ticket.h) +GENERATE_ENUM_SERIALIZATION(ticket_status.h) + +RESOURCE( + src/version /builtin/version +) + END() - -RECURSE( + +RECURSE( client - src/rw - src/ut - test_all -) + src/rw + src/ut + test_all +) diff --git a/library/cpp/unicode/normalization/custom_encoder.h b/library/cpp/unicode/normalization/custom_encoder.h index ef4d5b7f65..5bd6c0d302 100644 --- a/library/cpp/unicode/normalization/custom_encoder.h +++ b/library/cpp/unicode/normalization/custom_encoder.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/charset/codepage.h> +#include <library/cpp/charset/codepage.h> struct TCustomEncoder: public Encoder { void Create(const CodePage* target, bool extended = false); diff --git a/library/cpp/unicode/normalization/generated/composition.cpp b/library/cpp/unicode/normalization/generated/composition.cpp index 7cc4dc7b75..8e31838961 100644 --- a/library/cpp/unicode/normalization/generated/composition.cpp +++ b/library/cpp/unicode/normalization/generated/composition.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/unicode/normalization/normalization.h> +#include <library/cpp/unicode/normalization/normalization.h> const NUnicode::NPrivate::TComposition::TRawData NUnicode::NPrivate::TComposition::RawData[] = { { 0x41, 0x300, 0xC0 }, diff --git a/library/cpp/unicode/normalization/generated/decomposition.cpp b/library/cpp/unicode/normalization/generated/decomposition.cpp index 9ac6a5f92a..0ee604a19c 100644 --- a/library/cpp/unicode/normalization/generated/decomposition.cpp +++ b/library/cpp/unicode/normalization/generated/decomposition.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/unicode/normalization/decomposition_table.h> +#include <library/cpp/unicode/normalization/decomposition_table.h> namespace { namespace NCannonDecompositionTableGenerated { using TV = const NUnicode::NPrivate::TDecompositionTable::TStored; diff --git a/library/cpp/unicode/normalization/ut/normalization_ut.cpp b/library/cpp/unicode/normalization/ut/normalization_ut.cpp index 54d4940a26..c922c1b302 100644 --- a/library/cpp/unicode/normalization/ut/normalization_ut.cpp +++ b/library/cpp/unicode/normalization/ut/normalization_ut.cpp @@ -2,7 +2,7 @@ #include <util/charset/wide.h> -#include <library/cpp/unicode/normalization/normalization.h> +#include <library/cpp/unicode/normalization/normalization.h> Y_UNIT_TEST_SUITE(TUnicodeNormalizationTest) { template <NUnicode::ENormalization NormType> diff --git a/library/cpp/unicode/normalization/ut/ya.make b/library/cpp/unicode/normalization/ut/ya.make index a74372d9e1..57ac24a472 100644 --- a/library/cpp/unicode/normalization/ut/ya.make +++ b/library/cpp/unicode/normalization/ut/ya.make @@ -3,7 +3,7 @@ UNITTEST() OWNER(mvel) PEERDIR( - library/cpp/unicode/normalization + library/cpp/unicode/normalization ) SRCS( diff --git a/library/cpp/unicode/normalization/ya.make b/library/cpp/unicode/normalization/ya.make index 95bc93f297..0b0fb5f9ac 100644 --- a/library/cpp/unicode/normalization/ya.make +++ b/library/cpp/unicode/normalization/ya.make @@ -16,7 +16,7 @@ IF(NOT CATBOOST_OPENSOURCE) custom_encoder.cpp ) PEERDIR( - library/cpp/charset + library/cpp/charset ) GENERATE_ENUM_SERIALIZATION(normalization.h) ENDIF() diff --git a/library/cpp/unicode/punycode/ut/ya.make b/library/cpp/unicode/punycode/ut/ya.make index 74272102a8..ca8b0a97e8 100644 --- a/library/cpp/unicode/punycode/ut/ya.make +++ b/library/cpp/unicode/punycode/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/unicode/punycode) +UNITTEST_FOR(library/cpp/unicode/punycode) OWNER( g:base diff --git a/library/cpp/unicode/ya.make b/library/cpp/unicode/ya.make index 4fcd9caacc..894187924e 100644 --- a/library/cpp/unicode/ya.make +++ b/library/cpp/unicode/ya.make @@ -1,14 +1,14 @@ RECURSE( - folding - folding/ut - normalization - normalization/ut - punycode - punycode/ut + folding + folding/ut + normalization + normalization/ut + punycode + punycode/ut set set/ut - utf8_char - utf8_char/ut - utf8_iter - utf8_iter/ut + utf8_char + utf8_char/ut + utf8_iter + utf8_iter/ut ) diff --git a/library/cpp/uri/assign.cpp b/library/cpp/uri/assign.cpp index ae9125c727..f9cb87b5dc 100644 --- a/library/cpp/uri/assign.cpp +++ b/library/cpp/uri/assign.cpp @@ -3,7 +3,7 @@ #include <contrib/libs/libidn/idna.h> -#include <library/cpp/charset/recyr.hh> +#include <library/cpp/charset/recyr.hh> #include <util/charset/wide.h> #include <util/memory/tempbuf.h> #include <util/string/cast.h> diff --git a/library/cpp/uri/encodefsm.rl6 b/library/cpp/uri/encodefsm.rl6 index 6a323aa85a..3a5d90a98d 100644 --- a/library/cpp/uri/encodefsm.rl6 +++ b/library/cpp/uri/encodefsm.rl6 @@ -1,4 +1,4 @@ -#include <library/cpp/uri/encode.h> +#include <library/cpp/uri/encode.h> #ifdef __clang__ #pragma clang diagnostic ignored "-Wunused-variable" diff --git a/library/cpp/uri/parse.h b/library/cpp/uri/parse.h index ca2358e572..065f2265ef 100644 --- a/library/cpp/uri/parse.h +++ b/library/cpp/uri/parse.h @@ -6,7 +6,7 @@ #include "common.h" -#include <library/cpp/charset/doccodes.h> +#include <library/cpp/charset/doccodes.h> #include <util/generic/strbuf.h> #include <util/stream/output.h> #include <util/string/cast.h> diff --git a/library/cpp/uri/parsefsm.rl6 b/library/cpp/uri/parsefsm.rl6 index 7097723650..51c5bb6237 100644 --- a/library/cpp/uri/parsefsm.rl6 +++ b/library/cpp/uri/parsefsm.rl6 @@ -1,4 +1,4 @@ -#include <library/cpp/uri/parse.h> +#include <library/cpp/uri/parse.h> #ifdef __clang__ #pragma clang diagnostic ignored "-Wunused-variable" diff --git a/library/cpp/uri/uri-ru_ut.cpp b/library/cpp/uri/uri-ru_ut.cpp index ec35a164d2..945dd005a5 100644 --- a/library/cpp/uri/uri-ru_ut.cpp +++ b/library/cpp/uri/uri-ru_ut.cpp @@ -1,6 +1,6 @@ #include "uri_ut.h" -#include <library/cpp/charset/recyr.hh> -#include <library/cpp/html/entity/htmlentity.h> +#include <library/cpp/charset/recyr.hh> +#include <library/cpp/html/entity/htmlentity.h> #include <util/system/maxlen.h> namespace NUri { diff --git a/library/cpp/uri/uri.h b/library/cpp/uri/uri.h index 3b6c19fe4a..1171aa80a5 100644 --- a/library/cpp/uri/uri.h +++ b/library/cpp/uri/uri.h @@ -3,7 +3,7 @@ #include "common.h" #include "encode.h" -#include <library/cpp/charset/doccodes.h> +#include <library/cpp/charset/doccodes.h> #include <util/generic/buffer.h> #include <util/generic/ptr.h> #include <util/generic/singleton.h> diff --git a/library/cpp/uri/uri_ut.cpp b/library/cpp/uri/uri_ut.cpp index 2ebd83fc93..531968a9b3 100644 --- a/library/cpp/uri/uri_ut.cpp +++ b/library/cpp/uri/uri_ut.cpp @@ -1,7 +1,7 @@ #include "uri_ut.h" #include "other.h" #include "qargs.h" -#include <library/cpp/html/entity/htmlentity.h> +#include <library/cpp/html/entity/htmlentity.h> #include <util/system/maxlen.h> diff --git a/library/cpp/uri/ut/ya.make b/library/cpp/uri/ut/ya.make index b2b2c1291a..37df1e97a1 100644 --- a/library/cpp/uri/ut/ya.make +++ b/library/cpp/uri/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/uri) +UNITTEST_FOR(library/cpp/uri) OWNER(leo) @@ -7,7 +7,7 @@ NO_OPTIMIZE() NO_WSHADOW() PEERDIR( - library/cpp/html/entity + library/cpp/html/entity ) SRCS( diff --git a/library/cpp/uri/ya.make b/library/cpp/uri/ya.make index 8fc808a6af..06a6423b4b 100644 --- a/library/cpp/uri/ya.make +++ b/library/cpp/uri/ya.make @@ -21,7 +21,7 @@ SRCS( PEERDIR( contrib/libs/libidn - library/cpp/charset + library/cpp/charset ) END() diff --git a/library/cpp/xml/document/README b/library/cpp/xml/document/README index b2649523d8..a3651354c1 100644 --- a/library/cpp/xml/document/README +++ b/library/cpp/xml/document/README @@ -2,7 +2,7 @@ A wrapper around the DOM interface of libxml2. The standard way to use it is as follows: - #include <library/cpp/xml/document/xml-document.h> + #include <library/cpp/xml/document/xml-document.h> ... // open a document diff --git a/library/cpp/xml/document/libxml-guards.h b/library/cpp/xml/document/libxml-guards.h index 4188cecff1..9fcfd69ad0 100644 --- a/library/cpp/xml/document/libxml-guards.h +++ b/library/cpp/xml/document/libxml-guards.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/xml/init/ptr.h> +#include <library/cpp/xml/init/ptr.h> #include <util/generic/ptr.h> #include <libxml/xmlstring.h> #include <libxml/tree.h> diff --git a/library/cpp/xml/document/ut/ya.make b/library/cpp/xml/document/ut/ya.make index e955448c66..20fb884d16 100644 --- a/library/cpp/xml/document/ut/ya.make +++ b/library/cpp/xml/document/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/xml/document) +UNITTEST_FOR(library/cpp/xml/document) OWNER(finder) diff --git a/library/cpp/xml/document/xml-document.cpp b/library/cpp/xml/document/xml-document.cpp index 18a554d732..527386f12b 100644 --- a/library/cpp/xml/document/xml-document.cpp +++ b/library/cpp/xml/document/xml-document.cpp @@ -3,7 +3,7 @@ #include <libxml/xinclude.h> #include <libxml/xpathInternals.h> -#include <library/cpp/xml/init/init.h> +#include <library/cpp/xml/init/init.h> #include <util/generic/yexception.h> #include <util/folder/dirut.h> diff --git a/library/cpp/xml/document/ya.make b/library/cpp/xml/document/ya.make index 86bbd639cf..4de943a4d2 100644 --- a/library/cpp/xml/document/ya.make +++ b/library/cpp/xml/document/ya.make @@ -9,7 +9,7 @@ SRCS( ) PEERDIR( - library/cpp/xml/init + library/cpp/xml/init contrib/libs/libxml library/cpp/string_utils/ztstrbuf ) diff --git a/library/cpp/xml/init/init.cpp b/library/cpp/xml/init/init.cpp index aa96c2dd31..7d28fb579c 100644 --- a/library/cpp/xml/init/init.cpp +++ b/library/cpp/xml/init/init.cpp @@ -5,7 +5,7 @@ #include <libxml/parserInternals.h> #include <libxml/tree.h> -#include <library/cpp/charset/recyr.hh> +#include <library/cpp/charset/recyr.hh> #include <util/generic/singleton.h> namespace { diff --git a/library/cpp/xml/init/ptr.h b/library/cpp/xml/init/ptr.h index 7387c7cc40..59eb1057f7 100644 --- a/library/cpp/xml/init/ptr.h +++ b/library/cpp/xml/init/ptr.h @@ -61,8 +61,8 @@ namespace NXml { DEF_PTR(xmlNode, xmlFreeNode); DEF_PTR(xmlParserCtxt, xmlFreeParserCtxt); DEF_PTR(xmlParserInputBuffer, xmlFreeParserInputBuffer); - DEF_PTR(xmlDtd, xmlFreeDtd); - DEF_PTR(xmlValidCtxt, xmlFreeValidCtxt); + DEF_PTR(xmlDtd, xmlFreeDtd); + DEF_PTR(xmlValidCtxt, xmlFreeValidCtxt); #undef DEF_HOLDER #undef DEF_PTR diff --git a/library/cpp/xml/init/ya.make b/library/cpp/xml/init/ya.make index 5f3883c2c9..5e9a974d6d 100644 --- a/library/cpp/xml/init/ya.make +++ b/library/cpp/xml/init/ya.make @@ -4,7 +4,7 @@ OWNER(pg) PEERDIR( contrib/libs/libxml - library/cpp/charset + library/cpp/charset ) SRCS( diff --git a/library/cpp/ya.make b/library/cpp/ya.make index 8c1193b007..1cba71c7ea 100644 --- a/library/cpp/ya.make +++ b/library/cpp/ya.make @@ -1,450 +1,450 @@ OWNER(g:cpp-contrib) RECURSE( - accurate_accumulate - accurate_accumulate/benchmark - accurate_accumulate/benchmark/metrics + accurate_accumulate + accurate_accumulate/benchmark + accurate_accumulate/benchmark/metrics actors actors/ut - aio - any - any/ut - archive/ut - auth_client_parser - barcode - barcode/ut - binsaver + aio + any + any/ut + archive/ut + auth_client_parser + barcode + barcode/ut + binsaver binsaver/ut - binsaver/ut_util - bit_io - bit_io/ut - blackbox2 - blob_cache - blob_cache/ut - blockcodecs - blockcodecs/fuzz - bloom_filter - bloom_filter/benchmark - bloom_filter/ut - bucket_quoter - build_info + binsaver/ut_util + bit_io + bit_io/ut + blackbox2 + blob_cache + blob_cache/ut + blockcodecs + blockcodecs/fuzz + bloom_filter + bloom_filter/benchmark + bloom_filter/ut + bucket_quoter + build_info cache case_insensitive_string cgiparam cgiparam/fuzz cgiparam/ut - charset - charset/ut + charset + charset/ut chromium_trace clang_tidy - clickhouse - clustered_hnsw - clustered_hnsw/ut - codecs + clickhouse + clustered_hnsw + clustered_hnsw/ut + codecs codecs/float_huffman_bench - codecs/greedy_dict/ut - codecs/static/tools - codecs/static/tools/tests - codecs/static/ut - codecs/ut - colorizer - colorizer/ut - compproto - compproto/ut - comptable - comptable/usage - comptable/ut - compute_graph - compute_rt_graph - compute_rt_graph/ut - config - config/extra - config/ut + codecs/greedy_dict/ut + codecs/static/tools + codecs/static/tools/tests + codecs/static/ut + codecs/ut + colorizer + colorizer/ut + compproto + compproto/ut + comptable + comptable/usage + comptable/ut + compute_graph + compute_rt_graph + compute_rt_graph/ut + config + config/extra + config/ut consistent_hash_ring consistent_hash_ring/ut consistent_hashing consistent_hashing/ut containers - coroutine - cppparser - cpuid_check - cpuload - dbg_output - dbg_output/ut - deprecated + coroutine + cppparser + cpuid_check + cpuload + dbg_output + dbg_output/ut + deprecated diff diff/ut - digest - disjoint_sets - disjoint_sets/ut - dns - dns/ut - dolbilo - dolbilo/ut - domtree - domtree/tool + digest + disjoint_sets + disjoint_sets/ut + dns + dns/ut + dolbilo + dolbilo/ut + domtree + domtree/tool dot_product dot_product/bench dot_product/ut dwarf_backtrace dwarf_backtrace/registry - edit_distance - edit_distance/ut - enumbitset - enumbitset/ut + edit_distance + edit_distance/ut + enumbitset + enumbitset/ut erasure erasure/benchmark erasure/ut - eventlog - eventlog/dumper - eventlog/dumper/ut - eventlog/rt - eventlog/rt/tool - eventlog/test - eventlog/ut - eventlog/yt - exception_counter - execprofile - execprofile/autostart - expression - expression/ut - ext - ext/ut - fast_exp - fast_exp/benchmark - fast_exp/ut - fast_log - fieldcalc - fieldcalc/ut - file_checker - file_checker/test - file_checker/test/tests - file_checker/ut + eventlog + eventlog/dumper + eventlog/dumper/ut + eventlog/rt + eventlog/rt/tool + eventlog/test + eventlog/ut + eventlog/yt + exception_counter + execprofile + execprofile/autostart + expression + expression/ut + ext + ext/ut + fast_exp + fast_exp/benchmark + fast_exp/ut + fast_log + fieldcalc + fieldcalc/ut + file_checker + file_checker/test + file_checker/test/tests + file_checker/ut flatbuffers64_introspection flatbuffers64_introspection/example float16 float16/ut - framing - framing/ut - fuid - fuid/ut - function_tracer + framing + framing/ut + fuid + fuid/ut + function_tracer geo - geobase - geobase/ut + geobase + geobase/ut geohash geohash/tile geohash/tile/ut geohash/ut geolocation - geotarget + geotarget getopt getopt/last_getopt_demo getopt/small getopt/ut getoptpb - gettimeofday - gradient_optimize - gradient_optimize/ut - graph - grid_creator - grid_creator/fuzz - grid_creator/ut - grpc - histogram - hnsw + gettimeofday + gradient_optimize + gradient_optimize/ut + graph + grid_creator + grid_creator/fuzz + grid_creator/ut + grpc + histogram + hnsw html - html/dehtml/ut - http - hyperloglog - hyperloglog/ut - inf_buffer - infected_masks - infected_masks/tools - infected_masks/ut - int128 - int128/ut + html/dehtml/ut + http + hyperloglog + hyperloglog/ut + inf_buffer + infected_masks + infected_masks/tools + infected_masks/ut + int128 + int128/ut introspection - ipmath + ipmath ipreg ipreg/ut - ipv6_address - ipv6_address/ut - iterator - json + ipv6_address + ipv6_address/ut + iterator + json json/fast_sax - json/flex_buffers - json/flex_buffers/ut - json/fuzzy_test - json/ut - json/writer/ut - json/yson - json/yson/ut - kmeans_hnsw - kmeans_hnsw/ut - knn_index - knn_index/bench - knn_index/ut - l1_distance - l1_distance/bench - l1_distance/ut - l2_distance - l2_distance/bench - l2_distance/ut - langmask - langmask/proto - langmask/serialization - langmask/ut + json/flex_buffers + json/flex_buffers/ut + json/fuzzy_test + json/ut + json/writer/ut + json/yson + json/yson/ut + kmeans_hnsw + kmeans_hnsw/ut + knn_index + knn_index/bench + knn_index/ut + l1_distance + l1_distance/bench + l1_distance/ut + l2_distance + l2_distance/bench + l2_distance/ut + langmask + langmask/proto + langmask/serialization + langmask/ut langs langs/ut - lcookie - lcookie/ut - lcs - lcs/ut - lfalloc - lfalloc/dbg - lfalloc/dbg_info - lfalloc/yt + lcookie + lcookie/ut + lcs + lcs/ut + lfalloc + lfalloc/dbg + lfalloc/dbg_info + lfalloc/yt libgit2_wrapper - linear_regression - linear_regression/benchmark - linear_regression/ut - logger - logger/global - logger/global/ut - logger/ut - lua - lua/check - lua/check/ut - lua/sandbox/ut - lua/ut - lwtrace - lwtrace/example1 - lwtrace/example2 - lwtrace/example3 - lwtrace/example4 - lwtrace/example5 - lwtrace/tests - lwtrace/ut - malloc - map_text_file - map_text_file/ut - matrix - matrix/test - md5_checker - md5_checker/ut - mediator - mediator/ut - messagebus/all - messagebus/test - microbdb - microbdb/ut - mime - minhash - minhash/tools - minhash/ut + linear_regression + linear_regression/benchmark + linear_regression/ut + logger + logger/global + logger/global/ut + logger/ut + lua + lua/check + lua/check/ut + lua/sandbox/ut + lua/ut + lwtrace + lwtrace/example1 + lwtrace/example2 + lwtrace/example3 + lwtrace/example4 + lwtrace/example5 + lwtrace/tests + lwtrace/ut + malloc + map_text_file + map_text_file/ut + matrix + matrix/test + md5_checker + md5_checker/ut + mediator + mediator/ut + messagebus/all + messagebus/test + microbdb + microbdb/ut + mime + minhash + minhash/tools + minhash/ut mongo monlib - msgpack - msgpack2json - msgpack2json/ut - neh - neh/asio/ut - neh/ut - netliba - nirvana - nth_elements - nth_elements/fuzz - nth_elements/ut - numerator - numerator/blob - oauth - object_factory - object_factory/ut - offroad + msgpack + msgpack2json + msgpack2json/ut + neh + neh/asio/ut + neh/ut + netliba + nirvana + nth_elements + nth_elements/fuzz + nth_elements/ut + numerator + numerator/blob + oauth + object_factory + object_factory/ut + offroad on_disk - online_hnsw - online_hnsw/ut - openssl - os_family - os_family/protos - os_family/ut - packedtypes/ut - packers - packers/ut - par - perceptron + online_hnsw + online_hnsw/ut + openssl + os_family + os_family/protos + os_family/ut + packedtypes/ut + packers + packers/ut + par + perceptron pop_count pop_count/benchmark pop_count/ut presort presort/ut - prob_counter - prob_counter/ut - progress_bar - proto_config - proto_config/codegen - proto_config/exec_test - proto_config/exec_test/tool - proto_config/exec_test/tool_resource - proto_config/plugin - proto_config/protos - proto_config/ut + prob_counter + prob_counter/ut + progress_bar + proto_config + proto_config/codegen + proto_config/exec_test + proto_config/exec_test/tool + proto_config/exec_test/tool_resource + proto_config/plugin + proto_config/protos + proto_config/ut protobuf - pybind - pybind/example - pybind/example/dynamic - pybind/example/static - pybind/example/ut - query_marker - randomforest - regex - region - region/ut - resource - resource/ut - retry - retry/protos - retry/ut - reverse_geocoder - robots_txt - robots_txt/ut - safe_stats - safe_stats/ut - sampling - sampling/benchmark - sampling/benchmark/metrics - sampling/bin - sampling/ut - scheme - scheme/tests - scheme/ut_utils - scores - scores/ut + pybind + pybind/example + pybind/example/dynamic + pybind/example/static + pybind/example/ut + query_marker + randomforest + regex + region + region/ut + resource + resource/ut + retry + retry/protos + retry/ut + reverse_geocoder + robots_txt + robots_txt/ut + safe_stats + safe_stats/ut + sampling + sampling/benchmark + sampling/benchmark/metrics + sampling/bin + sampling/ut + scheme + scheme/tests + scheme/ut_utils + scores + scores/ut select_in_word select_in_word/bench select_in_word/ut - semver - semver/ut - shingles - shingles/ut - sighandler - simhash - simhash/ut + semver + semver/ut + shingles + shingles/ut + sighandler + simhash + simhash/ut skiff - sliding_window - sliding_window/ut - solve_ambig - solve_ambig/ut - sorter - sorter/ut + sliding_window + sliding_window/ut + solve_ambig + solve_ambig/ut + sorter + sorter/ut sqlite3 sqlite3/ut sse - ssh + ssh ssh/ut - ssh_sign - ssh_sign/ut - stat-handle - stat-handle/ut - statistics - statistics/ut - stopwords - stopwords/ut - streams - string_utils - succinct_arrays - succinct_arrays/ut - svnversion + ssh_sign + ssh_sign/ut + stat-handle + stat-handle/ut + statistics + statistics/ut + stopwords + stopwords/ut + streams + string_utils + succinct_arrays + succinct_arrays/ut + svnversion telfinder telfinder/ut terminate_handler terminate_handler/sample - testing - text_processing + testing + text_processing threading - timezone_conversion - timezone_conversion/ut - tld - tld/ut - token + timezone_conversion + timezone_conversion/ut + tld + tld/ut + token token/lite - token/serialization - token/serialization/ut - token/ut + token/serialization + token/serialization/ut + token/ut tokenclassifiers tokenizer tokenizer/ut - trace_usage - trace_usage/benchmark - trace_usage/ut - tvmauth - tvmknife + trace_usage + trace_usage/benchmark + trace_usage/ut + tvmauth + tvmknife type_info type_info/bench ucompress - udp - uilangdetect - uilangdetect/ut + udp + uilangdetect + uilangdetect/ut unicode - unistat - unistat/ut - uri - user_agent - vec4 - vec4/ut - vl_feat + unistat + unistat/ut + uri + user_agent + vec4 + vec4/ut + vl_feat vowpalwabbit vowpalwabbit/tools vowpalwabbit/ut - watchdog + watchdog watchdog/timeout/ut - wordlistreader - xml - xmlrpc - xsltransform - xsltransform/ut + wordlistreader + xml + xmlrpc + xsltransform + xsltransform/ut yaml - yappy - yconf - yconf/patcher - yconf/patcher/ut - yconf/ut + yappy + yconf + yconf/patcher + yconf/patcher/ut + yconf/ut yson yson/json yson/node yson/node/pybind - yson_pull - yson_pull/ut + yson_pull + yson_pull/ut yt zipatch ) - -IF (OS_LINUX) - RECURSE( - balloc/test - balloc/aba_agri_test - balloc_market/test - balloc_market/aba_agri_test + +IF (OS_LINUX) + RECURSE( + balloc/test + balloc/aba_agri_test + balloc_market/test + balloc_market/aba_agri_test ytalloc rseq - ) -ENDIF() - -IF (OS_WINDOWS) - RECURSE( - winservice - ) -ELSE() - RECURSE( + ) +ENDIF() + +IF (OS_WINDOWS) + RECURSE( + winservice + ) +ELSE() + RECURSE( fuse sse/ut - tf + tf xdelta3 - zookeeper - ) -ENDIF() - -IF (HAVE_CUDA) - RECURSE(cuda) -ENDIF() + zookeeper + ) +ENDIF() + +IF (HAVE_CUDA) + RECURSE(cuda) +ENDIF() diff --git a/library/cpp/yaml/ya.make b/library/cpp/yaml/ya.make index e9689fe65b..1c7d14f25d 100644 --- a/library/cpp/yaml/ya.make +++ b/library/cpp/yaml/ya.make @@ -1,4 +1,4 @@ RECURSE( as - scheme + scheme ) diff --git a/library/cpp/yson/json/json_writer.cpp b/library/cpp/yson/json/json_writer.cpp index 87481256ec..0b7aa4b57d 100644 --- a/library/cpp/yson/json/json_writer.cpp +++ b/library/cpp/yson/json/json_writer.cpp @@ -1,6 +1,6 @@ #include "json_writer.h" -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_writer.h> namespace NYT { //////////////////////////////////////////////////////////////////////////////// diff --git a/library/cpp/yson/json/json_writer.h b/library/cpp/yson/json/json_writer.h index d84ac0de53..3abfa00a01 100644 --- a/library/cpp/yson/json/json_writer.h +++ b/library/cpp/yson/json/json_writer.h @@ -3,7 +3,7 @@ #include <library/cpp/yson/public.h> #include <library/cpp/yson/consumer.h> -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_writer.h> #include <util/generic/vector.h> diff --git a/library/cpp/yson/json/yson2json_adapter.h b/library/cpp/yson/json/yson2json_adapter.h index da1bf5ba70..8d23ba8e2e 100644 --- a/library/cpp/yson/json/yson2json_adapter.h +++ b/library/cpp/yson/json/yson2json_adapter.h @@ -2,7 +2,7 @@ #include <library/cpp/yson/consumer.h> -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> #include <util/generic/stack.h> diff --git a/library/cpp/yson/node/node_builder.h b/library/cpp/yson/node/node_builder.h index 69800016e0..5d0b2c07e4 100644 --- a/library/cpp/yson/node/node_builder.h +++ b/library/cpp/yson/node/node_builder.h @@ -2,7 +2,7 @@ #include "node.h" -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> #include <library/cpp/yson/consumer.h> diff --git a/library/cpp/yson/node/node_io.cpp b/library/cpp/yson/node/node_io.cpp index 294a7f7217..c0993d4e64 100644 --- a/library/cpp/yson/node/node_io.cpp +++ b/library/cpp/yson/node/node_io.cpp @@ -8,8 +8,8 @@ #include <library/cpp/yson/writer.h> #include <library/cpp/yson/json/yson2json_adapter.h> -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_value.h> #include <util/stream/input.h> #include <util/stream/output.h> diff --git a/library/cpp/yson/node/pybind/node.cpp b/library/cpp/yson/node/pybind/node.cpp index 79beba3647..bd2e98379f 100644 --- a/library/cpp/yson/node/pybind/node.cpp +++ b/library/cpp/yson/node/pybind/node.cpp @@ -2,7 +2,7 @@ #include <library/cpp/yson/node/node.h> -#include <library/cpp/pybind/cast.h> +#include <library/cpp/pybind/cast.h> #include <Python.h> diff --git a/library/cpp/yson/node/pybind/ya.make b/library/cpp/yson/node/pybind/ya.make index 97b7583e96..67275fc1c8 100644 --- a/library/cpp/yson/node/pybind/ya.make +++ b/library/cpp/yson/node/pybind/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/pybind + library/cpp/pybind library/cpp/yson/node ) SRCS( diff --git a/library/cpp/yson_pull/consumer.cpp b/library/cpp/yson_pull/consumer.cpp index c238e0a6fb..cc9c043e3d 100644 --- a/library/cpp/yson_pull/consumer.cpp +++ b/library/cpp/yson_pull/consumer.cpp @@ -1,6 +1,6 @@ #include "consumer.h" -#include <library/cpp/yson_pull/detail/macros.h> +#include <library/cpp/yson_pull/detail/macros.h> using namespace NYsonPull; diff --git a/library/cpp/yson_pull/detail/byte_reader.h b/library/cpp/yson_pull/detail/byte_reader.h index 7cea50d323..5d421d964c 100644 --- a/library/cpp/yson_pull/detail/byte_reader.h +++ b/library/cpp/yson_pull/detail/byte_reader.h @@ -4,7 +4,7 @@ #include "fail.h" #include "stream_counter.h" -#include <library/cpp/yson_pull/input.h> +#include <library/cpp/yson_pull/input.h> namespace NYsonPull { namespace NDetail { diff --git a/library/cpp/yson_pull/detail/byte_writer.h b/library/cpp/yson_pull/detail/byte_writer.h index dc1d4b4b96..d76c865658 100644 --- a/library/cpp/yson_pull/detail/byte_writer.h +++ b/library/cpp/yson_pull/detail/byte_writer.h @@ -2,7 +2,7 @@ #include "macros.h" -#include <library/cpp/yson_pull/output.h> +#include <library/cpp/yson_pull/output.h> #include <util/system/types.h> diff --git a/library/cpp/yson_pull/detail/fail.h b/library/cpp/yson_pull/detail/fail.h index 6937612d0b..1d69b2d131 100644 --- a/library/cpp/yson_pull/detail/fail.h +++ b/library/cpp/yson_pull/detail/fail.h @@ -3,8 +3,8 @@ #include "format_string.h" #include "macros.h" -#include <library/cpp/yson_pull/exceptions.h> -#include <library/cpp/yson_pull/position_info.h> +#include <library/cpp/yson_pull/exceptions.h> +#include <library/cpp/yson_pull/position_info.h> namespace NYsonPull { namespace NDetail { diff --git a/library/cpp/yson_pull/detail/input/buffered.h b/library/cpp/yson_pull/detail/input/buffered.h index 9b1482577f..bbf1684b04 100644 --- a/library/cpp/yson_pull/detail/input/buffered.h +++ b/library/cpp/yson_pull/detail/input/buffered.h @@ -1,9 +1,9 @@ #pragma once -#include <library/cpp/yson_pull/detail/macros.h> +#include <library/cpp/yson_pull/detail/macros.h> -#include <library/cpp/yson_pull/exceptions.h> -#include <library/cpp/yson_pull/input.h> +#include <library/cpp/yson_pull/exceptions.h> +#include <library/cpp/yson_pull/input.h> #include <cstdio> #include <memory> diff --git a/library/cpp/yson_pull/detail/input/stdio_file.h b/library/cpp/yson_pull/detail/input/stdio_file.h index c412b7e59b..5c5941503b 100644 --- a/library/cpp/yson_pull/detail/input/stdio_file.h +++ b/library/cpp/yson_pull/detail/input/stdio_file.h @@ -2,10 +2,10 @@ #include "buffered.h" -#include <library/cpp/yson_pull/detail/macros.h> +#include <library/cpp/yson_pull/detail/macros.h> -#include <library/cpp/yson_pull/exceptions.h> -#include <library/cpp/yson_pull/input.h> +#include <library/cpp/yson_pull/exceptions.h> +#include <library/cpp/yson_pull/input.h> #include <cstdio> #include <memory> diff --git a/library/cpp/yson_pull/detail/input/stream.h b/library/cpp/yson_pull/detail/input/stream.h index 791cd5a3f5..c9c96ed9bd 100644 --- a/library/cpp/yson_pull/detail/input/stream.h +++ b/library/cpp/yson_pull/detail/input/stream.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/yson_pull/detail/macros.h> +#include <library/cpp/yson_pull/detail/macros.h> -#include <library/cpp/yson_pull/input.h> +#include <library/cpp/yson_pull/input.h> #include <util/stream/buffered.h> #include <util/stream/file.h> diff --git a/library/cpp/yson_pull/detail/output/buffered.h b/library/cpp/yson_pull/detail/output/buffered.h index 475cf34785..669eabba0d 100644 --- a/library/cpp/yson_pull/detail/output/buffered.h +++ b/library/cpp/yson_pull/detail/output/buffered.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/yson_pull/detail/macros.h> +#include <library/cpp/yson_pull/detail/macros.h> -#include <library/cpp/yson_pull/output.h> +#include <library/cpp/yson_pull/output.h> #include <util/generic/strbuf.h> diff --git a/library/cpp/yson_pull/detail/output/stdio_file.h b/library/cpp/yson_pull/detail/output/stdio_file.h index 03f2b40dc5..8f281447c1 100644 --- a/library/cpp/yson_pull/detail/output/stdio_file.h +++ b/library/cpp/yson_pull/detail/output/stdio_file.h @@ -2,9 +2,9 @@ #include "buffered.h" -#include <library/cpp/yson_pull/detail/macros.h> +#include <library/cpp/yson_pull/detail/macros.h> -#include <library/cpp/yson_pull/exceptions.h> +#include <library/cpp/yson_pull/exceptions.h> #include <cstdio> diff --git a/library/cpp/yson_pull/detail/output/stream.h b/library/cpp/yson_pull/detail/output/stream.h index d4810f3353..2c4b6780ab 100644 --- a/library/cpp/yson_pull/detail/output/stream.h +++ b/library/cpp/yson_pull/detail/output/stream.h @@ -2,8 +2,8 @@ #include "buffered.h" -#include <library/cpp/yson_pull/detail/macros.h> -#include <library/cpp/yson_pull/exceptions.h> +#include <library/cpp/yson_pull/detail/macros.h> +#include <library/cpp/yson_pull/exceptions.h> #include <util/stream/output.h> #include <util/stream/file.h> diff --git a/library/cpp/yson_pull/detail/reader.h b/library/cpp/yson_pull/detail/reader.h index 0e02396358..625b524908 100644 --- a/library/cpp/yson_pull/detail/reader.h +++ b/library/cpp/yson_pull/detail/reader.h @@ -3,7 +3,7 @@ #include "lexer_base.h" #include "symbols.h" -#include <library/cpp/yson_pull/reader.h> +#include <library/cpp/yson_pull/reader.h> #include <util/generic/maybe.h> #include <util/generic/vector.h> diff --git a/library/cpp/yson_pull/detail/stream_counter.h b/library/cpp/yson_pull/detail/stream_counter.h index 3b41b27eb6..0f72cda0a2 100644 --- a/library/cpp/yson_pull/detail/stream_counter.h +++ b/library/cpp/yson_pull/detail/stream_counter.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/yson_pull/position_info.h> +#include <library/cpp/yson_pull/position_info.h> #include <cstddef> diff --git a/library/cpp/yson_pull/detail/writer.h b/library/cpp/yson_pull/detail/writer.h index b24b994292..1e01e56870 100644 --- a/library/cpp/yson_pull/detail/writer.h +++ b/library/cpp/yson_pull/detail/writer.h @@ -7,11 +7,11 @@ #include "symbols.h" #include "varint.h" -#include <library/cpp/yson_pull/consumer.h> -#include <library/cpp/yson_pull/event.h> -#include <library/cpp/yson_pull/output.h> -#include <library/cpp/yson_pull/stream_type.h> -#include <library/cpp/yson_pull/writer.h> +#include <library/cpp/yson_pull/consumer.h> +#include <library/cpp/yson_pull/event.h> +#include <library/cpp/yson_pull/output.h> +#include <library/cpp/yson_pull/stream_type.h> +#include <library/cpp/yson_pull/writer.h> #include <util/generic/vector.h> #include <util/system/yassert.h> diff --git a/library/cpp/yson_pull/event.cpp b/library/cpp/yson_pull/event.cpp index b7ede494b6..b9e25553ec 100644 --- a/library/cpp/yson_pull/event.cpp +++ b/library/cpp/yson_pull/event.cpp @@ -1,6 +1,6 @@ #include "event.h" -#include <library/cpp/yson_pull/detail/cescape.h> +#include <library/cpp/yson_pull/detail/cescape.h> #include <util/stream/output.h> diff --git a/library/cpp/yson_pull/input.cpp b/library/cpp/yson_pull/input.cpp index 1373c89868..28df205174 100644 --- a/library/cpp/yson_pull/input.cpp +++ b/library/cpp/yson_pull/input.cpp @@ -1,7 +1,7 @@ #include "input.h" -#include <library/cpp/yson_pull/detail/input/stdio_file.h> -#include <library/cpp/yson_pull/detail/input/stream.h> +#include <library/cpp/yson_pull/detail/input/stdio_file.h> +#include <library/cpp/yson_pull/detail/input/stream.h> #include <util/generic/ptr.h> #include <util/stream/file.h> diff --git a/library/cpp/yson_pull/output.cpp b/library/cpp/yson_pull/output.cpp index 27c9ef9e69..fc5f09d411 100644 --- a/library/cpp/yson_pull/output.cpp +++ b/library/cpp/yson_pull/output.cpp @@ -1,7 +1,7 @@ #include "output.h" -#include <library/cpp/yson_pull/detail/output/stdio_file.h> -#include <library/cpp/yson_pull/detail/output/stream.h> +#include <library/cpp/yson_pull/detail/output/stdio_file.h> +#include <library/cpp/yson_pull/detail/output/stream.h> #include <util/generic/ptr.h> #include <util/stream/file.h> diff --git a/library/cpp/yson_pull/reader.cpp b/library/cpp/yson_pull/reader.cpp index ea26852756..9c732b8ea8 100644 --- a/library/cpp/yson_pull/reader.cpp +++ b/library/cpp/yson_pull/reader.cpp @@ -1,5 +1,5 @@ #include "reader.h" -#include <library/cpp/yson_pull/detail/reader.h> +#include <library/cpp/yson_pull/detail/reader.h> using namespace NYsonPull; diff --git a/library/cpp/yson_pull/scalar.cpp b/library/cpp/yson_pull/scalar.cpp index 4325542e7a..201ba57bbe 100644 --- a/library/cpp/yson_pull/scalar.cpp +++ b/library/cpp/yson_pull/scalar.cpp @@ -1,6 +1,6 @@ #include "scalar.h" -#include <library/cpp/yson_pull/detail/cescape.h> +#include <library/cpp/yson_pull/detail/cescape.h> #include <util/stream/output.h> diff --git a/library/cpp/yson_pull/ut/cescape_ut.cpp b/library/cpp/yson_pull/ut/cescape_ut.cpp index 6628ba1d15..8c533f04a6 100644 --- a/library/cpp/yson_pull/ut/cescape_ut.cpp +++ b/library/cpp/yson_pull/ut/cescape_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/yson_pull/detail/cescape.h> +#include <library/cpp/yson_pull/detail/cescape.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/yson_pull/ut/loop_ut.cpp b/library/cpp/yson_pull/ut/loop_ut.cpp index 8c7b11dd1c..bbd4453b3b 100644 --- a/library/cpp/yson_pull/ut/loop_ut.cpp +++ b/library/cpp/yson_pull/ut/loop_ut.cpp @@ -1,7 +1,7 @@ -#include <library/cpp/yson_pull/input.h> -#include <library/cpp/yson_pull/output.h> -#include <library/cpp/yson_pull/reader.h> -#include <library/cpp/yson_pull/writer.h> +#include <library/cpp/yson_pull/input.h> +#include <library/cpp/yson_pull/output.h> +#include <library/cpp/yson_pull/reader.h> +#include <library/cpp/yson_pull/writer.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/yson_pull/ut/reader_ut.cpp b/library/cpp/yson_pull/ut/reader_ut.cpp index 1184265ddb..089bfa01cc 100644 --- a/library/cpp/yson_pull/ut/reader_ut.cpp +++ b/library/cpp/yson_pull/ut/reader_ut.cpp @@ -1,8 +1,8 @@ -#include <library/cpp/yson_pull/exceptions.h> -#include <library/cpp/yson_pull/range.h> -#include <library/cpp/yson_pull/reader.h> -#include <library/cpp/yson_pull/detail/cescape.h> -#include <library/cpp/yson_pull/detail/macros.h> +#include <library/cpp/yson_pull/exceptions.h> +#include <library/cpp/yson_pull/range.h> +#include <library/cpp/yson_pull/reader.h> +#include <library/cpp/yson_pull/detail/cescape.h> +#include <library/cpp/yson_pull/detail/macros.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/yson_pull/ut/writer_ut.cpp b/library/cpp/yson_pull/ut/writer_ut.cpp index 5c304bad0f..f191b581fb 100644 --- a/library/cpp/yson_pull/ut/writer_ut.cpp +++ b/library/cpp/yson_pull/ut/writer_ut.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/yson_pull/scalar.h> -#include <library/cpp/yson_pull/detail/writer.h> +#include <library/cpp/yson_pull/scalar.h> +#include <library/cpp/yson_pull/detail/writer.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/library/cpp/yson_pull/ut/ya.make b/library/cpp/yson_pull/ut/ya.make index a269dfd2ad..c2f7e11ea7 100644 --- a/library/cpp/yson_pull/ut/ya.make +++ b/library/cpp/yson_pull/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/yson_pull) +UNITTEST_FOR(library/cpp/yson_pull) OWNER(borman) diff --git a/library/cpp/yson_pull/writer.cpp b/library/cpp/yson_pull/writer.cpp index 1df92bf40f..eb0edc18b3 100644 --- a/library/cpp/yson_pull/writer.cpp +++ b/library/cpp/yson_pull/writer.cpp @@ -1,5 +1,5 @@ #include "writer.h" -#include <library/cpp/yson_pull/detail/writer.h> +#include <library/cpp/yson_pull/detail/writer.h> using namespace NYsonPull; diff --git a/library/python/runtime_py3/__res.pyx b/library/python/runtime_py3/__res.pyx index 97190d9f29..921bf50ce3 100644 --- a/library/python/runtime_py3/__res.pyx +++ b/library/python/runtime_py3/__res.pyx @@ -5,7 +5,7 @@ from libcpp cimport bool from util.generic.string cimport TString, TStringBuf -cdef extern from "library/cpp/resource/resource.h" namespace "NResource": +cdef extern from "library/cpp/resource/resource.h" namespace "NResource": cdef size_t Count() except + cdef TStringBuf KeyByIndex(size_t idx) except + cdef bool FindExact(const TStringBuf key, TString* result) nogil except + diff --git a/library/python/runtime_py3/ya.make b/library/python/runtime_py3/ya.make index fa5c11341a..bd3dc06be6 100644 --- a/library/python/runtime_py3/ya.make +++ b/library/python/runtime_py3/ya.make @@ -11,7 +11,7 @@ NO_WSHADOW() PEERDIR( contrib/tools/python3/src contrib/tools/python3/lib/py - library/cpp/resource + library/cpp/resource ) CFLAGS(-DCYTHON_REGISTER_ABCS=0) diff --git a/library/python/svn_version/__svn_version.pyx b/library/python/svn_version/__svn_version.pyx index d66bc09d24..0ec94ca01c 100644 --- a/library/python/svn_version/__svn_version.pyx +++ b/library/python/svn_version/__svn_version.pyx @@ -1,6 +1,6 @@ import future.utils as fu -cdef extern from "library/cpp/svnversion/svnversion.h": +cdef extern from "library/cpp/svnversion/svnversion.h": cdef const char* GetProgramSvnVersion() except +; cdef int GetProgramSvnRevision() except +; cdef int GetArcadiaLastChangeNum() except +; diff --git a/library/python/svn_version/ya.make b/library/python/svn_version/ya.make index 747a663f00..63d38572cf 100644 --- a/library/python/svn_version/ya.make +++ b/library/python/svn_version/ya.make @@ -3,7 +3,7 @@ PY23_LIBRARY() OWNER(pg) PEERDIR( - library/cpp/svnversion + library/cpp/svnversion contrib/python/future ) diff --git a/library/python/testing/ya.make b/library/python/testing/ya.make index 883bc8d7ab..ad310e375b 100644 --- a/library/python/testing/ya.make +++ b/library/python/testing/ya.make @@ -8,12 +8,12 @@ RECURSE( gtest gtest/test gtest/test/gtest - pyremock + pyremock pytest_runner pytest_runner/example pytest_runner/test recipe - system_info + system_info types_test yapackage yapackage/test diff --git a/library/python/ya.make b/library/python/ya.make index 2e1eb6e0e1..aa7a5acd99 100644 --- a/library/python/ya.make +++ b/library/python/ya.make @@ -9,7 +9,7 @@ RECURSE( archive/test/data asgi_yauth async_clients - auth_client_parser + auth_client_parser awssdk-extensions awssdk_async_extensions base64 @@ -27,7 +27,7 @@ RECURSE( celery_dashboard certifi cgroups - charset + charset charts_notes charts_notes/example cityhash @@ -51,7 +51,7 @@ RECURSE( cyson/pymodule cyson/ut deploy_formatter - deprecated + deprecated dir-sync django django/example @@ -66,7 +66,7 @@ RECURSE( django_tools_log_context dssclient dump_dict - edit_distance + edit_distance errorboosterclient filelock filelock/ut @@ -93,11 +93,11 @@ RECURSE( guid/test guid/at_fork_test gunicorn - hnsw + hnsw ids import_test - infected_masks - infected_masks/ut + infected_masks + infected_masks/ut init_log init_log/example intrasearch_fetcher @@ -108,16 +108,16 @@ RECURSE( json/test/py2 json/test/py3 langdetect - langmask - langs + langmask + langs luigi luigi/data luigi/example luigi/luigid_static maths - messagebus + messagebus metrics_framework - mime_types + mime_types monitoring monlib monlib/examples @@ -194,7 +194,7 @@ RECURSE( thread thread/test tskv - tvmauth + tvmauth tvm2 tvm2/tests type_info diff --git a/library/ya.make b/library/ya.make index 86f833bd02..4ff52f80be 100644 --- a/library/ya.make +++ b/library/ya.make @@ -1,10 +1,10 @@ OWNER(g:cpp-contrib) RECURSE( - c + c cpp python - recipes + recipes #lemmer/byk/ut ) diff --git a/tools/archiver/alignment_test/alignment_ut.cpp b/tools/archiver/alignment_test/alignment_ut.cpp index 88b07e19b0..c5c5c04a40 100644 --- a/tools/archiver/alignment_test/alignment_ut.cpp +++ b/tools/archiver/alignment_test/alignment_ut.cpp @@ -1,5 +1,5 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/archive/yarchive.h> +#include <library/cpp/archive/yarchive.h> #include <util/memory/blob.h> extern "C" { diff --git a/tools/archiver/alignment_test/ya.make b/tools/archiver/alignment_test/ya.make index 459ba58881..79160ca501 100644 --- a/tools/archiver/alignment_test/ya.make +++ b/tools/archiver/alignment_test/ya.make @@ -23,7 +23,7 @@ ARCHIVE( PEERDIR( - library/cpp/archive + library/cpp/archive ) diff --git a/tools/archiver/main.cpp b/tools/archiver/main.cpp index 6cda54c1ea..9ee6712e32 100644 --- a/tools/archiver/main.cpp +++ b/tools/archiver/main.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/archive/yarchive.h> -#include <library/cpp/deprecated/mapped_file/mapped_file.h> -#include <library/cpp/digest/md5/md5.h> +#include <library/cpp/archive/yarchive.h> +#include <library/cpp/deprecated/mapped_file/mapped_file.h> +#include <library/cpp/digest/md5/md5.h> #include <library/cpp/getopt/small/last_getopt.h> #include <util/folder/dirut.h> diff --git a/tools/archiver/ya.make b/tools/archiver/ya.make index 757378c1b3..60f4c49611 100644 --- a/tools/archiver/ya.make +++ b/tools/archiver/ya.make @@ -6,8 +6,8 @@ OWNER( ) PEERDIR( - library/cpp/archive - library/cpp/digest/md5 + library/cpp/archive + library/cpp/digest/md5 library/cpp/getopt/small ) diff --git a/tools/enum_parser/enum_parser/main.cpp b/tools/enum_parser/enum_parser/main.cpp index 0943c69c1d..c10a10d646 100644 --- a/tools/enum_parser/enum_parser/main.cpp +++ b/tools/enum_parser/enum_parser/main.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/json/writer/json_value.h> -#include <library/cpp/json/writer/json.h> +#include <library/cpp/json/writer/json_value.h> +#include <library/cpp/json/writer/json.h> #include <library/cpp/getopt/small/last_getopt.h> #include <tools/enum_parser/parse_enum/parse_enum.h> diff --git a/tools/rescompressor/main.cpp b/tools/rescompressor/main.cpp index 9aba1002c5..c55b61e8ae 100644 --- a/tools/rescompressor/main.cpp +++ b/tools/rescompressor/main.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/resource/registry.h> +#include <library/cpp/resource/registry.h> #include <util/stream/file.h> #include <util/folder/path.h> diff --git a/tools/rorescompiler/main.cpp b/tools/rorescompiler/main.cpp index 7ca5346e4c..4ad8ebd8d9 100644 --- a/tools/rorescompiler/main.cpp +++ b/tools/rorescompiler/main.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/resource/registry.h> +#include <library/cpp/resource/registry.h> #include <util/digest/city.h> #include <util/stream/output.h> @@ -29,7 +29,7 @@ int main(int argc, char** argv) { TFixedBufferFileOutput out(argv[1]); argv = argv + 2; - out << "#include <library/cpp/resource/registry.h>\n\n"; + out << "#include <library/cpp/resource/registry.h>\n\n"; while (*argv) { TVector<TString> items = StringSplitter(TString(*(argv))).Split('=').Limit(2).ToList<TString>(); diff --git a/util/datetime/base.pxd b/util/datetime/base.pxd index 1d863b1bd8..71ce555f17 100644 --- a/util/datetime/base.pxd +++ b/util/datetime/base.pxd @@ -1,81 +1,81 @@ -from libc.stdint cimport uint32_t -from libc.stdint cimport uint64_t -from libcpp cimport bool as bool_t -from posix.types cimport time_t - +from libc.stdint cimport uint32_t +from libc.stdint cimport uint64_t +from libcpp cimport bool as bool_t +from posix.types cimport time_t + from util.generic.string cimport TString, TStringBuf - - -cdef extern from "<util/datetime/base.h>" nogil: - - cdef cppclass TTimeBase: - TTimeBase() - TTimeBase(uint64_t) - - uint64_t GetValue() - double SecondsFloat() - uint64_t MicroSeconds() - uint64_t MilliSeconds() - uint64_t Seconds() - uint64_t Minutes() - uint64_t Hours() - uint64_t Days() - uint64_t NanoSeconds() - uint32_t MicroSecondsOfSecond() - uint32_t MilliSecondsOfSecond() - uint32_t NanoSecondsOfSecond() - - - cdef cppclass TInstant(TTimeBase): - TInstant() - TInstant(uint64_t) - - @staticmethod - TInstant Now() except + - @staticmethod - TInstant Max() - @staticmethod - TInstant Zero() - @staticmethod - TInstant MicroSeconds(uint64_t) - @staticmethod - TInstant MilliSeconds(uint64_t) - @staticmethod - TInstant Seconds(uint64_t) - @staticmethod - TInstant Minutes(uint64_t) - @staticmethod - TInstant Hours(uint64_t) - @staticmethod - TInstant Days(uint64_t) - - time_t TimeT() - - TString ToString() except + - TString ToStringUpToSeconds() except + - TString ToStringLocal() except + - TString ToStringLocalUpToSeconds() except + - TString FormatLocalTime(const char*) - TString FormatGmTime(const char* format) - - @staticmethod - TInstant ParseIso8601(const TStringBuf) except + - @staticmethod - TInstant ParseRfc822(const TStringBuf) except + - @staticmethod - TInstant ParseHttp(const TStringBuf) except + - @staticmethod - TInstant ParseX509Validity(const TStringBuf) except + - - @staticmethod - bool_t TryParseIso8601(const TStringBuf, TInstant&) except + - @staticmethod - bool_t TryParseRfc822(const TStringBuf, TInstant&) except + - @staticmethod - bool_t TryParseHttp(const TStringBuf, TInstant&) except + - @staticmethod - bool_t TryParseX509(const TStringBuf, TInstant&) except + - + + +cdef extern from "<util/datetime/base.h>" nogil: + + cdef cppclass TTimeBase: + TTimeBase() + TTimeBase(uint64_t) + + uint64_t GetValue() + double SecondsFloat() + uint64_t MicroSeconds() + uint64_t MilliSeconds() + uint64_t Seconds() + uint64_t Minutes() + uint64_t Hours() + uint64_t Days() + uint64_t NanoSeconds() + uint32_t MicroSecondsOfSecond() + uint32_t MilliSecondsOfSecond() + uint32_t NanoSecondsOfSecond() + + + cdef cppclass TInstant(TTimeBase): + TInstant() + TInstant(uint64_t) + + @staticmethod + TInstant Now() except + + @staticmethod + TInstant Max() + @staticmethod + TInstant Zero() + @staticmethod + TInstant MicroSeconds(uint64_t) + @staticmethod + TInstant MilliSeconds(uint64_t) + @staticmethod + TInstant Seconds(uint64_t) + @staticmethod + TInstant Minutes(uint64_t) + @staticmethod + TInstant Hours(uint64_t) + @staticmethod + TInstant Days(uint64_t) + + time_t TimeT() + + TString ToString() except + + TString ToStringUpToSeconds() except + + TString ToStringLocal() except + + TString ToStringLocalUpToSeconds() except + + TString FormatLocalTime(const char*) + TString FormatGmTime(const char* format) + + @staticmethod + TInstant ParseIso8601(const TStringBuf) except + + @staticmethod + TInstant ParseRfc822(const TStringBuf) except + + @staticmethod + TInstant ParseHttp(const TStringBuf) except + + @staticmethod + TInstant ParseX509Validity(const TStringBuf) except + + + @staticmethod + bool_t TryParseIso8601(const TStringBuf, TInstant&) except + + @staticmethod + bool_t TryParseRfc822(const TStringBuf, TInstant&) except + + @staticmethod + bool_t TryParseHttp(const TStringBuf, TInstant&) except + + @staticmethod + bool_t TryParseX509(const TStringBuf, TInstant&) except + + @staticmethod TInstant ParseIso8601Deprecated(const TStringBuf) except + @staticmethod @@ -84,7 +84,7 @@ cdef extern from "<util/datetime/base.h>" nogil: TInstant ParseHttpDeprecated(const TStringBuf) except + @staticmethod TInstant ParseX509ValidityDeprecated(const TStringBuf) except + - + @staticmethod bool_t TryParseIso8601Deprecated(const TStringBuf, TInstant&) except + @staticmethod @@ -95,32 +95,32 @@ cdef extern from "<util/datetime/base.h>" nogil: bool_t TryParseX509Deprecated(const TStringBuf, TInstant&) except + - cdef cppclass TDuration(TTimeBase): - TDuration() - TDuration(uint64_t) - - @staticmethod - TDuration MicroSeconds(uint64_t) - - TInstant ToDeadLine() except + - TInstant ToDeadLine(TInstant) except + - - @staticmethod - TDuration Max() - @staticmethod - TDuration Zero() - @staticmethod - TDuration Seconds(uint64_t) - @staticmethod - TDuration Minutes(uint64_t) - @staticmethod - TDuration Hours(uint64_t) - @staticmethod - TDuration Days(uint64_t) - - @staticmethod - TDuration Parse(const TStringBuf) - @staticmethod - bool_t TryParse(const TStringBuf, TDuration&) - - TString ToString() except + + cdef cppclass TDuration(TTimeBase): + TDuration() + TDuration(uint64_t) + + @staticmethod + TDuration MicroSeconds(uint64_t) + + TInstant ToDeadLine() except + + TInstant ToDeadLine(TInstant) except + + + @staticmethod + TDuration Max() + @staticmethod + TDuration Zero() + @staticmethod + TDuration Seconds(uint64_t) + @staticmethod + TDuration Minutes(uint64_t) + @staticmethod + TDuration Hours(uint64_t) + @staticmethod + TDuration Days(uint64_t) + + @staticmethod + TDuration Parse(const TStringBuf) + @staticmethod + bool_t TryParse(const TStringBuf, TDuration&) + + TString ToString() except + diff --git a/util/generic/benchmark/log2/main.cpp b/util/generic/benchmark/log2/main.cpp index 969f09a309..c670f24adf 100644 --- a/util/generic/benchmark/log2/main.cpp +++ b/util/generic/benchmark/log2/main.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/benchmark/bench.h> -#include <library/cpp/fast_log/fast_log.h> +#include <library/cpp/fast_log/fast_log.h> #include <util/generic/singleton.h> #include <util/generic/vector.h> diff --git a/util/generic/benchmark/log2/ya.make b/util/generic/benchmark/log2/ya.make index 45d751909e..3a5d702240 100644 --- a/util/generic/benchmark/log2/ya.make +++ b/util/generic/benchmark/log2/ya.make @@ -11,7 +11,7 @@ SRCS( ) PEERDIR( - library/cpp/fast_log + library/cpp/fast_log ) END() diff --git a/util/generic/ptr.h b/util/generic/ptr.h index 19db0e3ec5..acd7949767 100644 --- a/util/generic/ptr.h +++ b/util/generic/ptr.h @@ -686,10 +686,10 @@ public: TIntrusiveConstPtr(nullptr).Swap(*this); } - inline long RefCount() const noexcept { - return T_ ? Ops::RefCount(T_) : 0; - } - + inline long RefCount() const noexcept { + return T_ ? Ops::RefCount(T_) : 0; + } + #ifdef __cpp_impl_three_way_comparison template <class Other> inline bool operator==(const Other& p) const noexcept { diff --git a/util/generic/strbase.h b/util/generic/strbase.h index ab39fc7537..2f74e8d898 100644 --- a/util/generic/strbase.h +++ b/util/generic/strbase.h @@ -51,61 +51,61 @@ public: using const_iterator = const TCharType*; using const_reference = const TCharType&; - template <typename TBase> - struct TReverseIteratorBase { - constexpr TReverseIteratorBase() noexcept = default; - explicit constexpr TReverseIteratorBase(TBase p) - : P_(p) - { - } - - TReverseIteratorBase operator++() noexcept { - --P_; - return *this; - } - - TReverseIteratorBase operator++(int) noexcept { - TReverseIteratorBase old(*this); - --P_; - return old; - } - - TReverseIteratorBase& operator--() noexcept { - ++P_; - return *this; - } - - TReverseIteratorBase operator--(int) noexcept { - TReverseIteratorBase old(*this); - ++P_; - return old; - } - - constexpr auto operator*() const noexcept -> std::remove_pointer_t<TBase>& { - return *TBase(*this); - } - - explicit constexpr operator TBase() const noexcept { - return TBase(P_ - 1); - } - - constexpr auto operator-(const TReverseIteratorBase o) const noexcept { - return o.P_ - P_; - } - - constexpr bool operator==(const TReverseIteratorBase o) const noexcept { - return P_ == o.P_; - } - - constexpr bool operator!=(const TReverseIteratorBase o) const noexcept { - return !(*this == o); - } - - private: - TBase P_ = nullptr; - }; - using const_reverse_iterator = TReverseIteratorBase<const_iterator>; - + template <typename TBase> + struct TReverseIteratorBase { + constexpr TReverseIteratorBase() noexcept = default; + explicit constexpr TReverseIteratorBase(TBase p) + : P_(p) + { + } + + TReverseIteratorBase operator++() noexcept { + --P_; + return *this; + } + + TReverseIteratorBase operator++(int) noexcept { + TReverseIteratorBase old(*this); + --P_; + return old; + } + + TReverseIteratorBase& operator--() noexcept { + ++P_; + return *this; + } + + TReverseIteratorBase operator--(int) noexcept { + TReverseIteratorBase old(*this); + ++P_; + return old; + } + + constexpr auto operator*() const noexcept -> std::remove_pointer_t<TBase>& { + return *TBase(*this); + } + + explicit constexpr operator TBase() const noexcept { + return TBase(P_ - 1); + } + + constexpr auto operator-(const TReverseIteratorBase o) const noexcept { + return o.P_ - P_; + } + + constexpr bool operator==(const TReverseIteratorBase o) const noexcept { + return P_ == o.P_; + } + + constexpr bool operator!=(const TReverseIteratorBase o) const noexcept { + return !(*this == o); + } + + private: + TBase P_ = nullptr; + }; + using const_reverse_iterator = TReverseIteratorBase<const_iterator>; + static constexpr size_t StrLen(const TCharType* s) noexcept { if (Y_LIKELY(s)) { return TTraits::length(s); @@ -151,22 +151,22 @@ public: return end(); } - inline const_reverse_iterator rbegin() const noexcept { - return const_reverse_iterator(Ptr() + size()); - } - - inline const_reverse_iterator rend() const noexcept { - return const_reverse_iterator(Ptr()); - } - - inline const_reverse_iterator crbegin() const noexcept { - return rbegin(); - } - - inline const_reverse_iterator crend() const noexcept { - return rend(); - } - + inline const_reverse_iterator rbegin() const noexcept { + return const_reverse_iterator(Ptr() + size()); + } + + inline const_reverse_iterator rend() const noexcept { + return const_reverse_iterator(Ptr()); + } + + inline const_reverse_iterator crbegin() const noexcept { + return rbegin(); + } + + inline const_reverse_iterator crend() const noexcept { + return rend(); + } + inline TCharType back() const noexcept { Y_ASSERT(!this->empty()); return Ptr()[Len() - 1]; diff --git a/util/generic/string.h b/util/generic/string.h index 8cd8aa6917..aa51327b6f 100644 --- a/util/generic/string.h +++ b/util/generic/string.h @@ -315,22 +315,22 @@ public: return &*MutRef().end(); } - reverse_iterator rbegin() { + reverse_iterator rbegin() { return reverse_iterator(vend()); - } - - reverse_iterator rend() { + } + + reverse_iterator rend() { return reverse_iterator(begin()); - } - + } + using TBase::begin; //!< const_iterator TStringBase::begin() const using TBase::cbegin; //!< const_iterator TStringBase::cbegin() const using TBase::cend; //!< const_iterator TStringBase::cend() const - using TBase::crbegin; //!< const_reverse_iterator TStringBase::crbegin() const - using TBase::crend; //!< const_reverse_iterator TStringBase::crend() const + using TBase::crbegin; //!< const_reverse_iterator TStringBase::crbegin() const + using TBase::crend; //!< const_reverse_iterator TStringBase::crend() const using TBase::end; //!< const_iterator TStringBase::end() const using TBase::rbegin; //!< const_reverse_iterator TStringBase::rbegin() const - using TBase::rend; //!< const_reverse_iterator TStringBase::rend() const + using TBase::rend; //!< const_reverse_iterator TStringBase::rend() const inline size_t capacity() const noexcept { #ifdef TSTRING_IS_STD_STRING diff --git a/util/generic/string_transparent_hash_ut.cpp b/util/generic/string_transparent_hash_ut.cpp index b87fa2843e..0e0dbf8546 100644 --- a/util/generic/string_transparent_hash_ut.cpp +++ b/util/generic/string_transparent_hash_ut.cpp @@ -3,7 +3,7 @@ #include "strbuf.h" #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/containers/absl_flat_hash/flat_hash_set.h> +#include <library/cpp/containers/absl_flat_hash/flat_hash_set.h> #include <util/str_stl.h> diff --git a/util/generic/string_ut.h b/util/generic/string_ut.h index 44bb10bdeb..b4768cc633 100644 --- a/util/generic/string_ut.h +++ b/util/generic/string_ut.h @@ -1074,83 +1074,83 @@ public: UNIT_ASSERT_VALUES_EQUAL(constStr.front(), (ui8)'f'); UNIT_ASSERT_VALUES_EQUAL(str.front(), (ui8)'r'); } - + void TestIterators() { - const char_type chars[] = {'f', 'o', 0}; - - TStringType str = chars; - const TStringType constStr = str; - - typename TStringType::const_iterator itBegin = str.begin(); - typename TStringType::const_iterator itEnd = str.end(); - typename TStringType::const_iterator citBegin = constStr.begin(); - typename TStringType::const_iterator citEnd = constStr.end(); - + const char_type chars[] = {'f', 'o', 0}; + + TStringType str = chars; + const TStringType constStr = str; + + typename TStringType::const_iterator itBegin = str.begin(); + typename TStringType::const_iterator itEnd = str.end(); + typename TStringType::const_iterator citBegin = constStr.begin(); + typename TStringType::const_iterator citEnd = constStr.end(); + UNIT_ASSERT_VALUES_EQUAL(*itBegin, (ui8)'f'); UNIT_ASSERT_VALUES_EQUAL(*citBegin, (ui8)'f'); - - str.front() = 'r'; + + str.front() = 'r'; UNIT_ASSERT_VALUES_EQUAL(*itBegin, (ui8)'r'); UNIT_ASSERT_VALUES_EQUAL(*citBegin, (ui8)'f'); - - UNIT_ASSERT_VALUES_EQUAL(2, itEnd - itBegin); - UNIT_ASSERT_VALUES_EQUAL(2, citEnd - citBegin); - + + UNIT_ASSERT_VALUES_EQUAL(2, itEnd - itBegin); + UNIT_ASSERT_VALUES_EQUAL(2, citEnd - citBegin); + UNIT_ASSERT_VALUES_EQUAL(*(++itBegin), (ui8)'o'); UNIT_ASSERT_VALUES_EQUAL(*(++citBegin), (ui8)'o'); - + UNIT_ASSERT_VALUES_EQUAL(*(--itBegin), (ui8)'r'); UNIT_ASSERT_VALUES_EQUAL(*(--citBegin), (ui8)'f'); - + UNIT_ASSERT_VALUES_EQUAL(*(itBegin++), (ui8)'r'); UNIT_ASSERT_VALUES_EQUAL(*(citBegin++), (ui8)'f'); UNIT_ASSERT_VALUES_EQUAL(*itBegin, (ui8)'o'); UNIT_ASSERT_VALUES_EQUAL(*citBegin, (ui8)'o'); - + UNIT_ASSERT_VALUES_EQUAL(*(itBegin--), (ui8)'o'); UNIT_ASSERT_VALUES_EQUAL(*(citBegin--), (ui8)'o'); UNIT_ASSERT_VALUES_EQUAL(*itBegin, (ui8)'r'); UNIT_ASSERT_VALUES_EQUAL(*citBegin, (ui8)'f'); - } - + } + void TestReverseIterators() { - const char_type chars[] = {'f', 'o', 0}; - - TStringType str = chars; - const TStringType constStr = str; - - typename TStringType::reverse_iterator ritBegin = str.rbegin(); - typename TStringType::reverse_iterator ritEnd = str.rend(); - typename TStringType::const_reverse_iterator critBegin = constStr.rbegin(); - typename TStringType::const_reverse_iterator critEnd = constStr.rend(); - + const char_type chars[] = {'f', 'o', 0}; + + TStringType str = chars; + const TStringType constStr = str; + + typename TStringType::reverse_iterator ritBegin = str.rbegin(); + typename TStringType::reverse_iterator ritEnd = str.rend(); + typename TStringType::const_reverse_iterator critBegin = constStr.rbegin(); + typename TStringType::const_reverse_iterator critEnd = constStr.rend(); + UNIT_ASSERT_VALUES_EQUAL(*ritBegin, (ui8)'o'); UNIT_ASSERT_VALUES_EQUAL(*critBegin, (ui8)'o'); - + str.back() = (ui8)'r'; UNIT_ASSERT_VALUES_EQUAL(*ritBegin, (ui8)'r'); UNIT_ASSERT_VALUES_EQUAL(*critBegin, (ui8)'o'); - - UNIT_ASSERT_VALUES_EQUAL(2, ritEnd - ritBegin); - UNIT_ASSERT_VALUES_EQUAL(2, critEnd - critBegin); - + + UNIT_ASSERT_VALUES_EQUAL(2, ritEnd - ritBegin); + UNIT_ASSERT_VALUES_EQUAL(2, critEnd - critBegin); + UNIT_ASSERT_VALUES_EQUAL(*(++ritBegin), (ui8)'f'); UNIT_ASSERT_VALUES_EQUAL(*(++critBegin), (ui8)'f'); - + UNIT_ASSERT_VALUES_EQUAL(*(--ritBegin), (ui8)'r'); UNIT_ASSERT_VALUES_EQUAL(*(--critBegin), (ui8)'o'); - + UNIT_ASSERT_VALUES_EQUAL(*(ritBegin++), (ui8)'r'); UNIT_ASSERT_VALUES_EQUAL(*(critBegin++), (ui8)'o'); UNIT_ASSERT_VALUES_EQUAL(*ritBegin, (ui8)'f'); UNIT_ASSERT_VALUES_EQUAL(*critBegin, (ui8)'f'); - + UNIT_ASSERT_VALUES_EQUAL(*(ritBegin--), (ui8)'f'); UNIT_ASSERT_VALUES_EQUAL(*(critBegin--), (ui8)'f'); UNIT_ASSERT_VALUES_EQUAL(*ritBegin, (ui8)'r'); UNIT_ASSERT_VALUES_EQUAL(*critBegin, (ui8)'o'); - + *ritBegin = (ui8)'e'; UNIT_ASSERT_VALUES_EQUAL(*ritBegin, (ui8)'e'); - } + } }; diff --git a/util/generic/ut/ya.make b/util/generic/ut/ya.make index 6eaf24cc5f..3f451731a0 100644 --- a/util/generic/ut/ya.make +++ b/util/generic/ut/ya.make @@ -62,7 +62,7 @@ IF (NOT OS_IOS AND NOT ARCH_PPC64LE) # Abseil fails to build (with linkage error) on ios and with compilation error on PowerPC # (somewhere in unscaledcycleclock.cc). PEERDIR( - library/cpp/containers/absl_flat_hash + library/cpp/containers/absl_flat_hash ) SRCS( diff --git a/util/network/socket.cpp b/util/network/socket.cpp index 4f6e804346..6a7d3a9d28 100644 --- a/util/network/socket.cpp +++ b/util/network/socket.cpp @@ -490,44 +490,44 @@ void SetTcpFastOpen(SOCKET s, int qlen) { #endif } -static bool IsBlocked(int lasterr) noexcept { - return lasterr == EAGAIN || lasterr == EWOULDBLOCK; -} - -struct TUnblockingGuard { - SOCKET S_; - - TUnblockingGuard(SOCKET s) - : S_(s) - { - SetNonBlock(S_, true); - } - - ~TUnblockingGuard() { - SetNonBlock(S_, false); - } -}; - -static int MsgPeek(SOCKET s) { - int flags = MSG_PEEK; - +static bool IsBlocked(int lasterr) noexcept { + return lasterr == EAGAIN || lasterr == EWOULDBLOCK; +} + +struct TUnblockingGuard { + SOCKET S_; + + TUnblockingGuard(SOCKET s) + : S_(s) + { + SetNonBlock(S_, true); + } + + ~TUnblockingGuard() { + SetNonBlock(S_, false); + } +}; + +static int MsgPeek(SOCKET s) { + int flags = MSG_PEEK; + #if defined(_win_) - TUnblockingGuard unblocker(s); - Y_UNUSED(unblocker); -#else - flags |= MSG_DONTWAIT; -#endif - - char c; - return recv(s, &c, 1, flags); -} - -bool IsNotSocketClosedByOtherSide(SOCKET s) { + TUnblockingGuard unblocker(s); + Y_UNUSED(unblocker); +#else + flags |= MSG_DONTWAIT; +#endif + + char c; + return recv(s, &c, 1, flags); +} + +bool IsNotSocketClosedByOtherSide(SOCKET s) { return HasSocketDataToRead(s) != ESocketReadStatus::SocketClosed; } ESocketReadStatus HasSocketDataToRead(SOCKET s) { - const int r = MsgPeek(s); + const int r = MsgPeek(s); if (r == -1 && IsBlocked(LastSystemError())) { return ESocketReadStatus::NoData; } @@ -535,9 +535,9 @@ ESocketReadStatus HasSocketDataToRead(SOCKET s) { return ESocketReadStatus::HasData; } return ESocketReadStatus::SocketClosed; -} - -#if defined(_win_) +} + +#if defined(_win_) static ssize_t DoSendMsg(SOCKET sock, const struct iovec* iov, int iovcnt) { return writev(sock, iov, iovcnt); } @@ -1097,15 +1097,15 @@ TNetworkResolutionError::TNetworkResolutionError(int error) { #else errMsg = gai_strerror(error); #endif - (*this) << errMsg << "(" << error; - -#if defined(_unix_) - if (error == EAI_SYSTEM) { - (*this) << "; errno=" << LastSystemError(); - } -#endif - - (*this) << "): "; + (*this) << errMsg << "(" << error; + +#if defined(_unix_) + if (error == EAI_SYSTEM) { + (*this) << "; errno=" << LastSystemError(); + } +#endif + + (*this) << "): "; } #if defined(_unix_) diff --git a/util/network/socket.h b/util/network/socket.h index 40c8648b40..f5c3279e5e 100644 --- a/util/network/socket.h +++ b/util/network/socket.h @@ -120,14 +120,14 @@ void SetSocketPriority(SOCKET s, int priority); void SetTcpFastOpen(SOCKET s, int qlen); /** * Deprecated, consider using HasSocketDataToRead instead. - **/ -bool IsNotSocketClosedByOtherSide(SOCKET s); + **/ +bool IsNotSocketClosedByOtherSide(SOCKET s); enum class ESocketReadStatus { HasData, NoData, SocketClosed }; -/** +/** * Useful for keep-alive connections. **/ ESocketReadStatus HasSocketDataToRead(SOCKET s); diff --git a/util/network/socket_ut.cpp b/util/network/socket_ut.cpp index 6b20e11f70..00f27fce4b 100644 --- a/util/network/socket_ut.cpp +++ b/util/network/socket_ut.cpp @@ -22,7 +22,7 @@ class TSockTest: public TTestBase { UNIT_TEST_EXCEPTION(TestConnectionRefused, yexception); #endif UNIT_TEST(TestNetworkResolutionError); - UNIT_TEST(TestNetworkResolutionErrorMessage); + UNIT_TEST(TestNetworkResolutionErrorMessage); UNIT_TEST(TestBrokenPipe); UNIT_TEST(TestClose); UNIT_TEST(TestReusePortAvailCheck); @@ -33,7 +33,7 @@ public: void TestTimeout(); void TestConnectionRefused(); void TestNetworkResolutionError(); - void TestNetworkResolutionErrorMessage(); + void TestNetworkResolutionErrorMessage(); void TestBrokenPipe(); void TestClose(); void TestReusePortAvailCheck(); @@ -92,42 +92,42 @@ void TSockTest::TestNetworkResolutionError() { } } -void TSockTest::TestNetworkResolutionErrorMessage() { -#ifdef _unix_ - auto str = [](int code) -> TString { - return TNetworkResolutionError(code).what(); - }; - - auto expected = [](int code) -> TString { - return gai_strerror(code); - }; - - struct TErrnoGuard { - TErrnoGuard() +void TSockTest::TestNetworkResolutionErrorMessage() { +#ifdef _unix_ + auto str = [](int code) -> TString { + return TNetworkResolutionError(code).what(); + }; + + auto expected = [](int code) -> TString { + return gai_strerror(code); + }; + + struct TErrnoGuard { + TErrnoGuard() : PrevValue_(errno) - { - } - - ~TErrnoGuard() { + { + } + + ~TErrnoGuard() { errno = PrevValue_; - } - - private: + } + + private: int PrevValue_; - } g; - - UNIT_ASSERT_VALUES_EQUAL(expected(0) + "(0): ", str(0)); - UNIT_ASSERT_VALUES_EQUAL(expected(-9) + "(-9): ", str(-9)); - - errno = 0; - UNIT_ASSERT_VALUES_EQUAL(expected(EAI_SYSTEM) + "(" + IntToString<10>(EAI_SYSTEM) + "; errno=0): ", - str(EAI_SYSTEM)); - errno = 110; - UNIT_ASSERT_VALUES_EQUAL(expected(EAI_SYSTEM) + "(" + IntToString<10>(EAI_SYSTEM) + "; errno=110): ", - str(EAI_SYSTEM)); -#endif -} - + } g; + + UNIT_ASSERT_VALUES_EQUAL(expected(0) + "(0): ", str(0)); + UNIT_ASSERT_VALUES_EQUAL(expected(-9) + "(-9): ", str(-9)); + + errno = 0; + UNIT_ASSERT_VALUES_EQUAL(expected(EAI_SYSTEM) + "(" + IntToString<10>(EAI_SYSTEM) + "; errno=0): ", + str(EAI_SYSTEM)); + errno = 110; + UNIT_ASSERT_VALUES_EQUAL(expected(EAI_SYSTEM) + "(" + IntToString<10>(EAI_SYSTEM) + "; errno=110): ", + str(EAI_SYSTEM)); +#endif +} + class TTempEnableSigPipe { public: TTempEnableSigPipe() { diff --git a/util/stream/buffered.cpp b/util/stream/buffered.cpp index a00e592e1c..570dbfb7bb 100644 --- a/util/stream/buffered.cpp +++ b/util/stream/buffered.cpp @@ -63,8 +63,8 @@ public: } inline size_t ReadTo(TString& st, char to) { - st.clear(); - + st.clear(); + TString s_tmp; size_t ret = 0; @@ -81,14 +81,14 @@ public: } const size_t a_len(MemInput_.Avail()); - size_t s_len = 0; - if (st.empty()) { - ret += MemInput_.ReadTo(st, to); - s_len = st.length(); + size_t s_len = 0; + if (st.empty()) { + ret += MemInput_.ReadTo(st, to); + s_len = st.length(); } else { - ret += MemInput_.ReadTo(s_tmp, to); - s_len = s_tmp.length(); - st.append(s_tmp); + ret += MemInput_.ReadTo(s_tmp, to); + s_len = s_tmp.length(); + st.append(s_tmp); } if (s_len != a_len) { diff --git a/util/string/ascii.h b/util/string/ascii.h index 10344384d3..aa2a4a3426 100644 --- a/util/string/ascii.h +++ b/util/string/ascii.h @@ -159,7 +159,7 @@ inline ::NPrivate::TDereferenced<T> AsciiToUpper(T c) noexcept { /** * ASCII case-insensitive string comparison (for proper UTF8 strings - * case-insensitive comparison consider using @c library/cpp/charset). + * case-insensitive comparison consider using @c library/cpp/charset). * * BUGS: Currently will NOT work properly with strings that contain * 0-terminator character inside. See IGNIETFERRO-1641 for details. @@ -172,7 +172,7 @@ static inline bool AsciiEqualsIgnoreCase(const char* s1, const char* s2) noexcep /** * ASCII case-insensitive string comparison (for proper UTF8 strings - * case-insensitive comparison consider using @c library/cpp/charset). + * case-insensitive comparison consider using @c library/cpp/charset). * * BUGS: Currently will NOT work properly with strings that contain * 0-terminator character inside. See IGNIETFERRO-1641 for details. @@ -185,7 +185,7 @@ static inline bool AsciiEqualsIgnoreCase(const TStringBuf s1, const TStringBuf s /** * ASCII case-insensitive string comparison (for proper UTF8 strings - * case-insensitive comparison consider using @c library/cpp/charset). + * case-insensitive comparison consider using @c library/cpp/charset). * * BUGS: Currently will NOT work properly with strings that contain * 0-terminator character inside. See IGNIETFERRO-1641 for details. @@ -200,7 +200,7 @@ static inline int AsciiCompareIgnoreCase(const char* s1, const char* s2) noexcep /** * ASCII case-insensitive string comparison (for proper UTF8 strings - * case-insensitive comparison consider using @c library/cpp/charset). + * case-insensitive comparison consider using @c library/cpp/charset). * * BUGS: Currently will NOT work properly with strings that contain * 0-terminator character inside. See IGNIETFERRO-1641 for details. @@ -228,7 +228,7 @@ static inline bool AsciiHasPrefix(const TStringBuf s1, const TStringBuf s2) noex /** * ASCII case-insensitive string comparison (for proper UTF8 strings - * case-insensitive comparison consider using @c library/cpp/charset). + * case-insensitive comparison consider using @c library/cpp/charset). * * @return true iff @c s2 are case-insensitively prefix of @c s1. */ @@ -238,7 +238,7 @@ static inline bool AsciiHasPrefixIgnoreCase(const TStringBuf s1, const TStringBu /** * ASCII case-insensitive string comparison (for proper UTF8 strings - * case-insensitive comparison consider using @c library/cpp/charset). + * case-insensitive comparison consider using @c library/cpp/charset). * * @return true iff @c s2 are case-insensitively suffix of @c s1. */ diff --git a/util/system/fasttime.cpp b/util/system/fasttime.cpp index 057a814f0a..512de42872 100644 --- a/util/system/fasttime.cpp +++ b/util/system/fasttime.cpp @@ -33,7 +33,7 @@ namespace { inline TSymbols() : Func(nullptr) { - // not DEFAULT, cause library/cpp/gettimeofday + // not DEFAULT, cause library/cpp/gettimeofday Func = reinterpret_cast<TFunc>(dlsym(RTLD_NEXT, "gettimeofday")); #if defined(_musl_) diff --git a/util/system/madvise.cpp b/util/system/madvise.cpp index 58c894e3ef..0e7aea280a 100644 --- a/util/system/madvise.cpp +++ b/util/system/madvise.cpp @@ -19,22 +19,22 @@ #ifndef MADV_DODUMP /* This flag is defined in sys/mman.h since Linux 3.4, but currently old libc header is in use \ for capability with Ubuntu 12.04, so we need to define it here manually */ #define MADV_DODUMP 17 /* Undo the effect of an earlier MADV_DONTDUMP */ -#endif - +#endif + namespace { - void Madvise(int flag, const void* cbegin, size_t size) { + void Madvise(int flag, const void* cbegin, size_t size) { static const size_t pageSize = NSystemInfo::GetPageSize(); void* begin = AlignDown(const_cast<void*>(cbegin), pageSize); size = AlignUp(size, pageSize); #if defined(_win_) - if (!VirtualFree((LPVOID)begin, size, flag)) { - TString err(LastSystemErrorText()); - ythrow yexception() << "VirtualFree(" << begin << ", " << size << ", " << flag << ")" - << " returned error: " << err; + if (!VirtualFree((LPVOID)begin, size, flag)) { + TString err(LastSystemErrorText()); + ythrow yexception() << "VirtualFree(" << begin << ", " << size << ", " << flag << ")" + << " returned error: " << err; } #else - if (-1 == madvise(begin, size, flag)) { + if (-1 == madvise(begin, size, flag)) { TString err(LastSystemErrorText()); ythrow yexception() << "madvise(" << begin << ", " << size << ", " << flag << ")" << " returned error: " << err; @@ -44,83 +44,83 @@ namespace { } void MadviseSequentialAccess(const void* begin, size_t size) { -#if !defined(_win_) - Madvise(MADV_SEQUENTIAL, begin, size); -#endif -} - -void MadviseSequentialAccess(TArrayRef<const char> data) { - MadviseSequentialAccess(data.data(), data.size()); -} - -void MadviseSequentialAccess(TArrayRef<const ui8> data) { - MadviseSequentialAccess(data.data(), data.size()); -} - +#if !defined(_win_) + Madvise(MADV_SEQUENTIAL, begin, size); +#endif +} + +void MadviseSequentialAccess(TArrayRef<const char> data) { + MadviseSequentialAccess(data.data(), data.size()); +} + +void MadviseSequentialAccess(TArrayRef<const ui8> data) { + MadviseSequentialAccess(data.data(), data.size()); +} + void MadviseRandomAccess(const void* begin, size_t size) { -#if !defined(_win_) - Madvise(MADV_RANDOM, begin, size); -#endif -} - -void MadviseRandomAccess(TArrayRef<const char> data) { - MadviseRandomAccess(data.data(), data.size()); -} - -void MadviseRandomAccess(TArrayRef<const ui8> data) { - MadviseRandomAccess(data.data(), data.size()); -} - +#if !defined(_win_) + Madvise(MADV_RANDOM, begin, size); +#endif +} + +void MadviseRandomAccess(TArrayRef<const char> data) { + MadviseRandomAccess(data.data(), data.size()); +} + +void MadviseRandomAccess(TArrayRef<const ui8> data) { + MadviseRandomAccess(data.data(), data.size()); +} + void MadviseEvict(const void* begin, size_t size) { -#if defined(_win_) - Madvise(MEM_DECOMMIT, begin, size); -#elif defined(_linux_) || defined(_cygwin_) - Madvise(MADV_DONTNEED, begin, size); -#else // freebsd, osx - Madvise(MADV_FREE, begin, size); -#endif -} - -void MadviseEvict(TArrayRef<const char> data) { - MadviseEvict(data.data(), data.size()); -} - -void MadviseEvict(TArrayRef<const ui8> data) { - MadviseEvict(data.data(), data.size()); -} - +#if defined(_win_) + Madvise(MEM_DECOMMIT, begin, size); +#elif defined(_linux_) || defined(_cygwin_) + Madvise(MADV_DONTNEED, begin, size); +#else // freebsd, osx + Madvise(MADV_FREE, begin, size); +#endif +} + +void MadviseEvict(TArrayRef<const char> data) { + MadviseEvict(data.data(), data.size()); +} + +void MadviseEvict(TArrayRef<const ui8> data) { + MadviseEvict(data.data(), data.size()); +} + void MadviseExcludeFromCoreDump(const void* begin, size_t size) { -#if defined(_darwin_) - // Don't try to call function with flag which doesn't work - // https://st.yandex-team.ru/PASSP-31755#6050bbafc68f501f2c22caab - Y_UNUSED(begin); - Y_UNUSED(size); -#elif !defined(_win_) - Madvise(MADV_DONTDUMP, begin, size); -#endif -} - -void MadviseExcludeFromCoreDump(TArrayRef<const char> data) { - MadviseExcludeFromCoreDump(data.data(), data.size()); -} - -void MadviseExcludeFromCoreDump(TArrayRef<const ui8> data) { - MadviseExcludeFromCoreDump(data.data(), data.size()); -} - -void MadviseIncludeIntoCoreDump(const void* begin, size_t size) { -#if defined(_darwin_) - Y_UNUSED(begin); - Y_UNUSED(size); -#elif !defined(_win_) - Madvise(MADV_DODUMP, begin, size); -#endif -} - -void MadviseIncludeIntoCoreDump(TArrayRef<const char> data) { - MadviseIncludeIntoCoreDump(data.data(), data.size()); -} - -void MadviseIncludeIntoCoreDump(TArrayRef<const ui8> data) { - MadviseIncludeIntoCoreDump(data.data(), data.size()); -} +#if defined(_darwin_) + // Don't try to call function with flag which doesn't work + // https://st.yandex-team.ru/PASSP-31755#6050bbafc68f501f2c22caab + Y_UNUSED(begin); + Y_UNUSED(size); +#elif !defined(_win_) + Madvise(MADV_DONTDUMP, begin, size); +#endif +} + +void MadviseExcludeFromCoreDump(TArrayRef<const char> data) { + MadviseExcludeFromCoreDump(data.data(), data.size()); +} + +void MadviseExcludeFromCoreDump(TArrayRef<const ui8> data) { + MadviseExcludeFromCoreDump(data.data(), data.size()); +} + +void MadviseIncludeIntoCoreDump(const void* begin, size_t size) { +#if defined(_darwin_) + Y_UNUSED(begin); + Y_UNUSED(size); +#elif !defined(_win_) + Madvise(MADV_DODUMP, begin, size); +#endif +} + +void MadviseIncludeIntoCoreDump(TArrayRef<const char> data) { + MadviseIncludeIntoCoreDump(data.data(), data.size()); +} + +void MadviseIncludeIntoCoreDump(TArrayRef<const ui8> data) { + MadviseIncludeIntoCoreDump(data.data(), data.size()); +} diff --git a/util/system/madvise.h b/util/system/madvise.h index 606733152e..d875cce245 100644 --- a/util/system/madvise.h +++ b/util/system/madvise.h @@ -2,29 +2,29 @@ #include "defaults.h" -#include <util/generic/array_ref.h> - +#include <util/generic/array_ref.h> + /// see linux madvise(MADV_SEQUENTIAL) void MadviseSequentialAccess(const void* begin, size_t size); -void MadviseSequentialAccess(TArrayRef<const char> data); -void MadviseSequentialAccess(TArrayRef<const ui8> data); +void MadviseSequentialAccess(TArrayRef<const char> data); +void MadviseSequentialAccess(TArrayRef<const ui8> data); /// see linux madvise(MADV_RANDOM) void MadviseRandomAccess(const void* begin, size_t size); -void MadviseRandomAccess(TArrayRef<const char> data); -void MadviseRandomAccess(TArrayRef<const ui8> data); +void MadviseRandomAccess(TArrayRef<const char> data); +void MadviseRandomAccess(TArrayRef<const ui8> data); /// see linux madvise(MADV_DONTNEED) void MadviseEvict(const void* begin, size_t size); -void MadviseEvict(TArrayRef<const char> data); -void MadviseEvict(TArrayRef<const ui8> data); +void MadviseEvict(TArrayRef<const char> data); +void MadviseEvict(TArrayRef<const ui8> data); /// see linux madvise(MADV_DONTDUMP) void MadviseExcludeFromCoreDump(const void* begin, size_t size); -void MadviseExcludeFromCoreDump(TArrayRef<const char> data); -void MadviseExcludeFromCoreDump(TArrayRef<const ui8> data); - -/// see linux madvise(MADV_DODUMP) -void MadviseIncludeIntoCoreDump(const void* begin, size_t size); -void MadviseIncludeIntoCoreDump(TArrayRef<const char> data); -void MadviseIncludeIntoCoreDump(TArrayRef<const ui8> data); +void MadviseExcludeFromCoreDump(TArrayRef<const char> data); +void MadviseExcludeFromCoreDump(TArrayRef<const ui8> data); + +/// see linux madvise(MADV_DODUMP) +void MadviseIncludeIntoCoreDump(const void* begin, size_t size); +void MadviseIncludeIntoCoreDump(TArrayRef<const char> data); +void MadviseIncludeIntoCoreDump(TArrayRef<const ui8> data); diff --git a/util/system/thread.cpp b/util/system/thread.cpp index 6236746c2d..d529776f49 100644 --- a/util/system/thread.cpp +++ b/util/system/thread.cpp @@ -251,23 +251,23 @@ namespace { class TThread::TImpl: public TThreadBase { public: - inline TImpl(const TParams& params, THolder<TCallableBase> callable = {}) + inline TImpl(const TParams& params, THolder<TCallableBase> callable = {}) : TThreadBase(params) - , Callable_(std::move(callable)) + , Callable_(std::move(callable)) { } inline TId Id() const noexcept { return ThreadIdHashFunction(SystemThreadId()); } - - static THolder<TImpl> Create(THolder<TCallableBase> callable) { - TParams params(TCallableBase::ThreadWorker, callable.Get()); - return MakeHolder<TImpl>(std::move(params), std::move(callable)); - } - -private: - THolder<TCallableBase> Callable_; + + static THolder<TImpl> Create(THolder<TCallableBase> callable) { + TParams params(TCallableBase::ThreadWorker, callable.Get()); + return MakeHolder<TImpl>(std::move(params), std::move(callable)); + } + +private: + THolder<TCallableBase> Callable_; }; TThread::TThread(const TParams& p) @@ -280,11 +280,11 @@ TThread::TThread(TThreadProc threadProc, void* param) { } -TThread::TThread(TPrivateCtor, THolder<TCallableBase> callable) - : Impl_(TImpl::Create(std::move(callable))) -{ -} - +TThread::TThread(TPrivateCtor, THolder<TCallableBase> callable) + : Impl_(TImpl::Create(std::move(callable))) +{ +} + TThread::~TThread() { Join(); } diff --git a/util/system/thread.h b/util/system/thread.h index a6e8abdb5b..588c96985f 100644 --- a/util/system/thread.h +++ b/util/system/thread.h @@ -13,10 +13,10 @@ bool SetHighestThreadPriority(); class TThread { - template <typename Callable> - struct TCallableParams; - struct TPrivateCtor {}; - + template <typename Callable> + struct TCallableParams; + struct TPrivateCtor {}; + public: using TThreadProc = void* (*)(void*); using TId = size_t; @@ -75,23 +75,23 @@ public: TThread(const TParams& params); TThread(TThreadProc threadProc, void* param); - template <typename Callable> - TThread(Callable&& callable) - : TThread(TPrivateCtor{}, + template <typename Callable> + TThread(Callable&& callable) + : TThread(TPrivateCtor{}, MakeHolder<TCallableParams<Callable>>(std::forward<Callable>(callable))) { - } - - TThread(TParams&& params) - : TThread((const TParams&)params) - { - } - - TThread(TParams& params) - : TThread((const TParams&)params) - { - } - + } + + TThread(TParams&& params) + : TThread((const TParams&)params) + { + } + + TThread(TParams& params) + : TThread((const TParams&)params) + { + } + ~TThread(); void Start(); @@ -126,33 +126,33 @@ public: static bool CanGetCurrentThreadName(); private: - struct TCallableBase { - virtual ~TCallableBase() = default; - virtual void run() = 0; - - static void* ThreadWorker(void* arg) { - static_cast<TCallableBase*>(arg)->run(); - return nullptr; - } - }; - - template <typename Callable> - struct TCallableParams: public TCallableBase { - TCallableParams(Callable&& callable) - : Callable_(std::forward<Callable>(callable)) - { - } - - Callable Callable_; - - void run() override { - Callable_(); - } - }; - - TThread(TPrivateCtor, THolder<TCallableBase> callable); - -private: + struct TCallableBase { + virtual ~TCallableBase() = default; + virtual void run() = 0; + + static void* ThreadWorker(void* arg) { + static_cast<TCallableBase*>(arg)->run(); + return nullptr; + } + }; + + template <typename Callable> + struct TCallableParams: public TCallableBase { + TCallableParams(Callable&& callable) + : Callable_(std::forward<Callable>(callable)) + { + } + + Callable Callable_; + + void run() override { + Callable_(); + } + }; + + TThread(TPrivateCtor, THolder<TCallableBase> callable); + +private: class TImpl; THolder<TImpl> Impl_; }; diff --git a/util/system/thread_ut.cpp b/util/system/thread_ut.cpp index d820898fd5..0a50a36e59 100644 --- a/util/system/thread_ut.cpp +++ b/util/system/thread_ut.cpp @@ -178,52 +178,52 @@ Y_UNIT_TEST_SUITE(TSysThreadTest) { UNIT_ASSERT(sl.StackBegin); UNIT_ASSERT(sl.StackLength > 0); } - - Y_UNIT_TEST(TestFunc) { - std::atomic_bool flag = {false}; - TThread thread([&flag]() { flag = true; }); - - thread.Start(); - UNIT_ASSERT_VALUES_EQUAL(thread.Join(), nullptr); - UNIT_ASSERT(flag); - } - - Y_UNIT_TEST(TestCopyFunc) { - std::atomic_bool flag = {false}; - auto func = [&flag]() { flag = true; }; - - TThread thread(func); - thread.Start(); - UNIT_ASSERT_VALUES_EQUAL(thread.Join(), nullptr); - - TThread thread2(func); - thread2.Start(); - UNIT_ASSERT_VALUES_EQUAL(thread2.Join(), nullptr); - - UNIT_ASSERT(flag); - } - - Y_UNIT_TEST(TestCallable) { - std::atomic_bool flag = {false}; - + + Y_UNIT_TEST(TestFunc) { + std::atomic_bool flag = {false}; + TThread thread([&flag]() { flag = true; }); + + thread.Start(); + UNIT_ASSERT_VALUES_EQUAL(thread.Join(), nullptr); + UNIT_ASSERT(flag); + } + + Y_UNIT_TEST(TestCopyFunc) { + std::atomic_bool flag = {false}; + auto func = [&flag]() { flag = true; }; + + TThread thread(func); + thread.Start(); + UNIT_ASSERT_VALUES_EQUAL(thread.Join(), nullptr); + + TThread thread2(func); + thread2.Start(); + UNIT_ASSERT_VALUES_EQUAL(thread2.Join(), nullptr); + + UNIT_ASSERT(flag); + } + + Y_UNIT_TEST(TestCallable) { + std::atomic_bool flag = {false}; + struct TCallable: TMoveOnly { - std::atomic_bool* Flag_; - - TCallable(std::atomic_bool* flag) - : Flag_(flag) - { - } - - void operator()() { - *Flag_ = true; - } - }; - - TCallable foo(&flag); - TThread thread(std::move(foo)); - - thread.Start(); - UNIT_ASSERT_VALUES_EQUAL(thread.Join(), nullptr); - UNIT_ASSERT(flag); - } + std::atomic_bool* Flag_; + + TCallable(std::atomic_bool* flag) + : Flag_(flag) + { + } + + void operator()() { + *Flag_ = true; + } + }; + + TCallable foo(&flag); + TThread thread(std::move(foo)); + + thread.Start(); + UNIT_ASSERT_VALUES_EQUAL(thread.Join(), nullptr); + UNIT_ASSERT(flag); + } }; diff --git a/util/system/yassert.cpp b/util/system/yassert.cpp index 0f586648b7..e84055effa 100644 --- a/util/system/yassert.cpp +++ b/util/system/yassert.cpp @@ -5,7 +5,7 @@ #include "spinlock.h" #include "src_root.h" -#include <util/datetime/base.h> +#include <util/datetime/base.h> #include <util/generic/singleton.h> #include <util/generic/strbuf.h> #include <util/generic/string.h> @@ -63,14 +63,14 @@ void ::NPrivate::Panic(const TStaticBuf& file, int line, const char* function, c namespace NPrivate { [[noreturn]] Y_NO_INLINE void InternalPanicImpl(int line, const char* function, const char* expr, int, int, int, const TStringBuf file, const char* errorMessage, size_t errorMessageSize) noexcept try { TStringBuf errorMsg{errorMessage, errorMessageSize}; - const TString now = TInstant::Now().ToStringLocal(); - + const TString now = TInstant::Now().ToStringLocal(); + TString r; TStringOutput o(r); if (expr) { - o << "VERIFY failed (" << now << "): " << errorMsg << Endl; + o << "VERIFY failed (" << now << "): " << errorMsg << Endl; } else { - o << "FAIL (" << now << "): " << errorMsg << Endl; + o << "FAIL (" << now << "): " << errorMsg << Endl; } o << " " << file << ":" << line << Endl; if (expr) { diff --git a/ydb/core/actorlib_impl/actor_bootstrapped_ut.cpp b/ydb/core/actorlib_impl/actor_bootstrapped_ut.cpp index 990330b321..e39ef90aec 100644 --- a/ydb/core/actorlib_impl/actor_bootstrapped_ut.cpp +++ b/ydb/core/actorlib_impl/actor_bootstrapped_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <library/cpp/testing/unittest/registar.h> #include <ydb/core/testlib/basics/runtime.h> #include <ydb/core/testlib/basics/appdata.h> diff --git a/ydb/core/actorlib_impl/actor_tracker.cpp b/ydb/core/actorlib_impl/actor_tracker.cpp index 99787dfce1..4adaca0b4c 100644 --- a/ydb/core/actorlib_impl/actor_tracker.cpp +++ b/ydb/core/actorlib_impl/actor_tracker.cpp @@ -1,6 +1,6 @@ #include "actor_tracker.h" -#include <library/cpp/actors/core/executor_thread.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/executor_thread.h> +#include <library/cpp/actors/core/hfunc.h> namespace NActors { diff --git a/ydb/core/actorlib_impl/actor_tracker.h b/ydb/core/actorlib_impl/actor_tracker.h index 66e953740d..6310a2b26b 100644 --- a/ydb/core/actorlib_impl/actor_tracker.h +++ b/ydb/core/actorlib_impl/actor_tracker.h @@ -1,9 +1,9 @@ #pragma once #include "defs.h" -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/events.h> #include <util/generic/set.h> namespace NActors { diff --git a/ydb/core/actorlib_impl/actor_tracker_ut.cpp b/ydb/core/actorlib_impl/actor_tracker_ut.cpp index d804e3b924..e625dc42db 100644 --- a/ydb/core/actorlib_impl/actor_tracker_ut.cpp +++ b/ydb/core/actorlib_impl/actor_tracker_ut.cpp @@ -1,7 +1,7 @@ #include <library/cpp/testing/unittest/registar.h> #include <ydb/core/testlib/basics/runtime.h> #include <ydb/core/testlib/basics/appdata.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include "actor_tracker.h" using namespace NActors; diff --git a/ydb/core/actorlib_impl/async_destroyer.h b/ydb/core/actorlib_impl/async_destroyer.h index 9d0d6f4c4c..ac8228cd8b 100644 --- a/ydb/core/actorlib_impl/async_destroyer.h +++ b/ydb/core/actorlib_impl/async_destroyer.h @@ -1,6 +1,6 @@ #pragma once #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <util/generic/ptr.h> namespace NKikimr { diff --git a/ydb/core/actorlib_impl/connect_socket_protocol.h b/ydb/core/actorlib_impl/connect_socket_protocol.h index df6e08276a..42c8ebfbff 100644 --- a/ydb/core/actorlib_impl/connect_socket_protocol.h +++ b/ydb/core/actorlib_impl/connect_socket_protocol.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/actors/interconnect/events_local.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect_stream.h> +#include <library/cpp/actors/interconnect/events_local.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect_stream.h> namespace NActors { diff --git a/ydb/core/actorlib_impl/defs.h b/ydb/core/actorlib_impl/defs.h index dffa5929b4..0a07c4bf19 100644 --- a/ydb/core/actorlib_impl/defs.h +++ b/ydb/core/actorlib_impl/defs.h @@ -1,3 +1,3 @@ #pragma once -#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/defs.h> diff --git a/ydb/core/actorlib_impl/destruct_actor.h b/ydb/core/actorlib_impl/destruct_actor.h index adc236911d..ae9d6dd4c0 100644 --- a/ydb/core/actorlib_impl/destruct_actor.h +++ b/ydb/core/actorlib_impl/destruct_actor.h @@ -1,9 +1,9 @@ #pragma once -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/events.h> namespace NActors { diff --git a/ydb/core/actorlib_impl/load_network.cpp b/ydb/core/actorlib_impl/load_network.cpp index ae6f1b248a..cfbe9369be 100644 --- a/ydb/core/actorlib_impl/load_network.cpp +++ b/ydb/core/actorlib_impl/load_network.cpp @@ -1,8 +1,8 @@ #include "load_network.h" -#include <library/cpp/actors/core/actorid.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/events.h> namespace { diff --git a/ydb/core/actorlib_impl/load_network.h b/ydb/core/actorlib_impl/load_network.h index 767ab5c98d..cbe1eae66e 100644 --- a/ydb/core/actorlib_impl/load_network.h +++ b/ydb/core/actorlib_impl/load_network.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <ydb/core/base/appdata.h> namespace IC_Load { diff --git a/ydb/core/actorlib_impl/long_timer.cpp b/ydb/core/actorlib_impl/long_timer.cpp index e3b139579f..6234a1626c 100644 --- a/ydb/core/actorlib_impl/long_timer.cpp +++ b/ydb/core/actorlib_impl/long_timer.cpp @@ -1,6 +1,6 @@ #include "long_timer.h" -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/events.h> #include <ydb/core/protos/services.pb.h> namespace NActors { diff --git a/ydb/core/actorlib_impl/long_timer.h b/ydb/core/actorlib_impl/long_timer.h index 9b04c30121..082b06618a 100644 --- a/ydb/core/actorlib_impl/long_timer.h +++ b/ydb/core/actorlib_impl/long_timer.h @@ -1,5 +1,5 @@ #pragma once -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NActors { diff --git a/ydb/core/actorlib_impl/mad_squirrel.cpp b/ydb/core/actorlib_impl/mad_squirrel.cpp index 3f9629d099..13c539d1c5 100644 --- a/ydb/core/actorlib_impl/mad_squirrel.cpp +++ b/ydb/core/actorlib_impl/mad_squirrel.cpp @@ -1,6 +1,6 @@ #include "mad_squirrel.h" -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/hfunc.h> namespace NActors { diff --git a/ydb/core/actorlib_impl/mad_squirrel.h b/ydb/core/actorlib_impl/mad_squirrel.h index cce45d4aaa..9232636917 100644 --- a/ydb/core/actorlib_impl/mad_squirrel.h +++ b/ydb/core/actorlib_impl/mad_squirrel.h @@ -1,5 +1,5 @@ #pragma once -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NActors { diff --git a/ydb/core/actorlib_impl/melancholic_gopher.cpp b/ydb/core/actorlib_impl/melancholic_gopher.cpp index 52a895aae4..acc62ff781 100644 --- a/ydb/core/actorlib_impl/melancholic_gopher.cpp +++ b/ydb/core/actorlib_impl/melancholic_gopher.cpp @@ -1,9 +1,9 @@ #include "mad_squirrel.h" -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <util/system/hp_timer.h> #include <util/system/spinlock.h> diff --git a/ydb/core/actorlib_impl/name_service_client_protocol.h b/ydb/core/actorlib_impl/name_service_client_protocol.h index c46ffe9b03..e68d7e3445 100644 --- a/ydb/core/actorlib_impl/name_service_client_protocol.h +++ b/ydb/core/actorlib_impl/name_service_client_protocol.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/actors/memory_log/memlog.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/interconnect/events_local.h> +#include <library/cpp/actors/memory_log/memlog.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/events_local.h> namespace NActors { diff --git a/ydb/core/actorlib_impl/node_identifier.cpp b/ydb/core/actorlib_impl/node_identifier.cpp index 410fbede7c..9a09e3acae 100644 --- a/ydb/core/actorlib_impl/node_identifier.cpp +++ b/ydb/core/actorlib_impl/node_identifier.cpp @@ -1,12 +1,12 @@ -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/protos/services.pb.h> -#include <library/cpp/json/json_reader.h> -#include <library/cpp/http/io/stream.h> -#include <library/cpp/openssl/init/init.h> -#include <library/cpp/openssl/io/stream.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/http/io/stream.h> +#include <library/cpp/openssl/init/init.h> +#include <library/cpp/openssl/io/stream.h> #include <util/network/sock.h> #include <util/system/hostname.h> diff --git a/ydb/core/actorlib_impl/node_identifier.h b/ydb/core/actorlib_impl/node_identifier.h index 7981886b93..6699d6ed56 100644 --- a/ydb/core/actorlib_impl/node_identifier.h +++ b/ydb/core/actorlib_impl/node_identifier.h @@ -1,5 +1,5 @@ #pragma once -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr { diff --git a/ydb/core/actorlib_impl/proto_ready_actor.h b/ydb/core/actorlib_impl/proto_ready_actor.h index f0b29ec65f..d725686d4a 100644 --- a/ydb/core/actorlib_impl/proto_ready_actor.h +++ b/ydb/core/actorlib_impl/proto_ready_actor.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include <util/system/type_name.h> template <typename TType, TType val> diff --git a/ydb/core/actorlib_impl/read_data_protocol.h b/ydb/core/actorlib_impl/read_data_protocol.h index 7edefab299..9bc6c20301 100644 --- a/ydb/core/actorlib_impl/read_data_protocol.h +++ b/ydb/core/actorlib_impl/read_data_protocol.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/actors/interconnect/events_local.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect_stream.h> +#include <library/cpp/actors/interconnect/events_local.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect_stream.h> namespace NActors { diff --git a/ydb/core/actorlib_impl/send_data_protocol.h b/ydb/core/actorlib_impl/send_data_protocol.h index 2c22936034..d067259d9e 100644 --- a/ydb/core/actorlib_impl/send_data_protocol.h +++ b/ydb/core/actorlib_impl/send_data_protocol.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/actors/interconnect/events_local.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect_stream.h> +#include <library/cpp/actors/interconnect/events_local.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect_stream.h> namespace NActors { diff --git a/ydb/core/actorlib_impl/test_interconnect_ut.cpp b/ydb/core/actorlib_impl/test_interconnect_ut.cpp index 0d9d3535ef..1a5a9a0751 100644 --- a/ydb/core/actorlib_impl/test_interconnect_ut.cpp +++ b/ydb/core/actorlib_impl/test_interconnect_ut.cpp @@ -1,15 +1,15 @@ -#include <library/cpp/actors/interconnect/interconnect_channel.h> -#include <library/cpp/actors/interconnect/interconnect_impl.h> -#include <library/cpp/actors/interconnect/events_local.h> +#include <library/cpp/actors/interconnect/interconnect_channel.h> +#include <library/cpp/actors/interconnect/interconnect_impl.h> +#include <library/cpp/actors/interconnect/events_local.h> #include <ydb/core/testlib/basics/runtime.h> #include <ydb/core/testlib/basics/appdata.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/protos/services_common.pb.h> -#include <library/cpp/actors/protos/unittests.pb.h> -#include <library/cpp/http/io/headers.h> -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_value.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/protos/unittests.pb.h> +#include <library/cpp/http/io/headers.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_value.h> #include <library/cpp/testing/unittest/registar.h> #include <util/system/sanitizers.h> #include <util/thread/factory.h> diff --git a/ydb/core/actorlib_impl/test_protocols_ut.cpp b/ydb/core/actorlib_impl/test_protocols_ut.cpp index 2e622406a0..b3bbfeba6c 100644 --- a/ydb/core/actorlib_impl/test_protocols_ut.cpp +++ b/ydb/core/actorlib_impl/test_protocols_ut.cpp @@ -1,12 +1,12 @@ #include <ydb/core/testlib/basics/runtime.h> #include <ydb/core/testlib/basics/appdata.h> -#include <library/cpp/http/io/stream.h> -#include <library/cpp/http/server/http_ex.h> -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_value.h> +#include <library/cpp/http/io/stream.h> +#include <library/cpp/http/server/http_ex.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_value.h> #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/tests_data.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <util/stream/null.h> #include <util/system/event.h> diff --git a/ydb/core/actorlib_impl/ut/ya.make b/ydb/core/actorlib_impl/ut/ya.make index f76d57807a..3114141f42 100644 --- a/ydb/core/actorlib_impl/ut/ya.make +++ b/ydb/core/actorlib_impl/ut/ya.make @@ -19,10 +19,10 @@ ELSE() ENDIF() PEERDIR( - library/cpp/actors/core - library/cpp/actors/interconnect + library/cpp/actors/core + library/cpp/actors/interconnect library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/testlib/actors ydb/core/testlib/basics ) diff --git a/ydb/core/actorlib_impl/ya.make b/ydb/core/actorlib_impl/ya.make index ba63f39617..a5ff3c19bf 100644 --- a/ydb/core/actorlib_impl/ya.make +++ b/ydb/core/actorlib_impl/ya.make @@ -37,19 +37,19 @@ SRCS( ) PEERDIR( - library/cpp/actors/core - library/cpp/actors/dnscachelib - library/cpp/actors/protos + library/cpp/actors/core + library/cpp/actors/dnscachelib + library/cpp/actors/protos library/cpp/containers/stack_vector - library/cpp/digest/crc32c - library/cpp/html/pcdata - library/cpp/lwtrace + library/cpp/digest/crc32c + library/cpp/html/pcdata + library/cpp/lwtrace library/cpp/lwtrace/mon - library/cpp/messagebus/monitoring + library/cpp/messagebus/monitoring library/cpp/monlib/dynamic_counters library/cpp/monlib/service/pages/tablesorter - library/cpp/packedtypes - library/cpp/sliding_window + library/cpp/packedtypes + library/cpp/sliding_window ydb/core/base ydb/core/mon ydb/core/node_whiteboard diff --git a/ydb/core/base/appdata.h b/ydb/core/base/appdata.h index c666f7468c..f3f6848b25 100644 --- a/ydb/core/base/appdata.h +++ b/ydb/core/base/appdata.h @@ -19,9 +19,9 @@ #include <ydb/core/protos/stream.pb.h> #include <ydb/library/pdisk_io/aio.h> -#include <library/cpp/actors/interconnect/poller_tcp.h> -#include <library/cpp/actors/core/executor_thread.h> -#include <library/cpp/actors/util/should_continue.h> +#include <library/cpp/actors/interconnect/poller_tcp.h> +#include <library/cpp/actors/core/executor_thread.h> +#include <library/cpp/actors/util/should_continue.h> #include <library/cpp/random_provider/random_provider.h> #include <library/cpp/time_provider/time_provider.h> #include <library/cpp/monlib/dynamic_counters/counters.h> diff --git a/ydb/core/base/blobstorage.h b/ydb/core/base/blobstorage.h index a2faee326e..9396ae6924 100644 --- a/ydb/core/base/blobstorage.h +++ b/ydb/core/base/blobstorage.h @@ -16,7 +16,7 @@ #include <ydb/library/wilson/wilson_event.h> -#include <library/cpp/lwtrace/shuttle.h> +#include <library/cpp/lwtrace/shuttle.h> #include <util/stream/str.h> #include <util/generic/xrange.h> diff --git a/ydb/core/base/blobstorage_grouptype.cpp b/ydb/core/base/blobstorage_grouptype.cpp index 66c79ba42c..f1841a24ec 100644 --- a/ydb/core/base/blobstorage_grouptype.cpp +++ b/ydb/core/base/blobstorage_grouptype.cpp @@ -1,6 +1,6 @@ #include "blobstorage_grouptype.h" -#include <library/cpp/digest/old_crc/crc.h> +#include <library/cpp/digest/old_crc/crc.h> #include <util/generic/yexception.h> #define MAX_TOTAL_PARTS 8 diff --git a/ydb/core/base/board_lookup.cpp b/ydb/core/base/board_lookup.cpp index 890b88f6b9..473f2facff 100644 --- a/ydb/core/base/board_lookup.cpp +++ b/ydb/core/base/board_lookup.cpp @@ -1,11 +1,11 @@ #include "statestorage_impl.h" #include "tabletid.h" #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/xrange.h> diff --git a/ydb/core/base/board_publish.cpp b/ydb/core/base/board_publish.cpp index cdd4bf6e48..d934ff5498 100644 --- a/ydb/core/base/board_publish.cpp +++ b/ydb/core/base/board_publish.cpp @@ -1,11 +1,11 @@ #include "statestorage_impl.h" #include "tabletid.h" #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/map.h> diff --git a/ydb/core/base/board_replica.cpp b/ydb/core/base/board_replica.cpp index c38fd20e35..05355b8c93 100644 --- a/ydb/core/base/board_replica.cpp +++ b/ydb/core/base/board_replica.cpp @@ -1,11 +1,11 @@ #include "statestorage_impl.h" #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> #include <util/generic/set.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/hfunc.h> #if defined BLOG_D || defined BLOG_I || defined BLOG_ERROR #error log macro definition clash diff --git a/ydb/core/base/defs.h b/ydb/core/base/defs.h index bb4eb55689..4575a6bb35 100644 --- a/ydb/core/base/defs.h +++ b/ydb/core/base/defs.h @@ -1,9 +1,9 @@ #pragma once // unique tag to fix pragma once gcc glueing: ./ydb/core/base/defs.h -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/event.h> -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/event.h> +#include <library/cpp/actors/core/actorid.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/debug/valgrind_check.h> #include <util/generic/array_ref.h> diff --git a/ydb/core/base/event_filter.h b/ydb/core/base/event_filter.h index 1df9899d5b..1abde7fdef 100644 --- a/ydb/core/base/event_filter.h +++ b/ydb/core/base/event_filter.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/interconnect/interconnect_common.h> +#include <library/cpp/actors/interconnect/interconnect_common.h> namespace NKikimr { diff --git a/ydb/core/base/events.h b/ydb/core/base/events.h index f5fedfe19b..9df576b0e6 100644 --- a/ydb/core/base/events.h +++ b/ydb/core/base/events.h @@ -1,8 +1,8 @@ #pragma once #include "defs.h" -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/event_pb.h> #include <ydb/library/yql/dq/actors/dq_events_ids.h> #include <ydb/core/yq/libs/events/event_ids.h> diff --git a/ydb/core/base/monitoring_provider.h b/ydb/core/base/monitoring_provider.h index b9d9ac2227..5c60d9a1ad 100644 --- a/ydb/core/base/monitoring_provider.h +++ b/ydb/core/base/monitoring_provider.h @@ -1,5 +1,5 @@ #pragma once -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #define MONITORING_PROVIDER(PROBE, EVENT, GROUPS, TYPES, NAMES) \ PROBE(MonitoringCounterLookup, GROUPS("Monitoring"), \ diff --git a/ydb/core/base/pool_stats_collector.cpp b/ydb/core/base/pool_stats_collector.cpp index 7dcbf28954..296a97b783 100644 --- a/ydb/core/base/pool_stats_collector.cpp +++ b/ydb/core/base/pool_stats_collector.cpp @@ -6,7 +6,7 @@ #include <ydb/library/yql/minikql/aligned_page_pool.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <library/cpp/actors/helpers/pool_stats_collector.h> namespace NKikimr { diff --git a/ydb/core/base/pool_stats_collector.h b/ydb/core/base/pool_stats_collector.h index cbf06f9f51..4b22e97975 100644 --- a/ydb/core/base/pool_stats_collector.h +++ b/ydb/core/base/pool_stats_collector.h @@ -1,6 +1,6 @@ #pragma once #include "defs.h" -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <library/cpp/monlib/dynamic_counters/counters.h> namespace NActors { diff --git a/ydb/core/base/quoter.h b/ydb/core/base/quoter.h index 41a19775bc..b2b2f78019 100644 --- a/ydb/core/base/quoter.h +++ b/ydb/core/base/quoter.h @@ -1,7 +1,7 @@ #pragma once #include "defs.h" #include "events.h" -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/event_local.h> #include <util/generic/deque.h> #include <util/generic/vector.h> #include <ydb/core/util/time_series_vec.h> diff --git a/ydb/core/base/services/defs.h b/ydb/core/base/services/defs.h index 9c81773dfa..6c41930061 100644 --- a/ydb/core/base/services/defs.h +++ b/ydb/core/base/services/defs.h @@ -1,9 +1,9 @@ #pragma once // unique tag to fix pragma once gcc glueing: ./ydb/core/base/services/defs.h -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/event.h> -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/event.h> +#include <library/cpp/actors/core/actorid.h> namespace NKikimr { // actorlib is organic part of kikimr so we emulate global import by this directive diff --git a/ydb/core/base/services/ya.make b/ydb/core/base/services/ya.make index 8d043ac349..9e550031a1 100644 --- a/ydb/core/base/services/ya.make +++ b/ydb/core/base/services/ya.make @@ -9,10 +9,10 @@ SRCS( ) PEERDIR( - library/cpp/actors/core - library/cpp/actors/protos - library/cpp/actors/interconnect - library/cpp/actors/helpers + library/cpp/actors/core + library/cpp/actors/protos + library/cpp/actors/interconnect + library/cpp/actors/helpers ) END() diff --git a/ydb/core/base/services_assert.cpp b/ydb/core/base/services_assert.cpp index 97fa3b8222..c334f9abef 100644 --- a/ydb/core/base/services_assert.cpp +++ b/ydb/core/base/services_assert.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <ydb/core/protos/services.pb.h> static_assert(static_cast<ui32>(NKikimrServices::EServiceKikimr_MIN) > static_cast<ui32>(NActorsServices::EServiceCommon_MAX), "KIKIMR SERVICES IDs SHOULD BE GREATER THAN COMMON ONES"); diff --git a/ydb/core/base/statestorage.h b/ydb/core/base/statestorage.h index 9b3e3b6b1b..cd9f3d1760 100644 --- a/ydb/core/base/statestorage.h +++ b/ydb/core/base/statestorage.h @@ -3,7 +3,7 @@ #include "events.h" #include <ydb/core/protos/statestorage.pb.h> #include <ydb/core/protos/config.pb.h> -#include <library/cpp/actors/interconnect/event_filter.h> +#include <library/cpp/actors/interconnect/event_filter.h> #include <util/stream/str.h> #include <util/generic/list.h> #include <util/generic/map.h> diff --git a/ydb/core/base/statestorage_guardian.cpp b/ydb/core/base/statestorage_guardian.cpp index f1df97896b..680ced170f 100644 --- a/ydb/core/base/statestorage_guardian.cpp +++ b/ydb/core/base/statestorage_guardian.cpp @@ -9,7 +9,7 @@ #include <library/cpp/actors/core/actor_bootstrapped.h> #include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> #include <util/generic/algorithm.h> #include <util/generic/xrange.h> diff --git a/ydb/core/base/statestorage_monitoring.cpp b/ydb/core/base/statestorage_monitoring.cpp index 5bcc3ec67f..105f5d12bf 100644 --- a/ydb/core/base/statestorage_monitoring.cpp +++ b/ydb/core/base/statestorage_monitoring.cpp @@ -1,11 +1,11 @@ #include "statestorage_impl.h" #include "tabletid.h" #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> #include <library/cpp/monlib/service/pages/templates.h> -#include <library/cpp/actors/core/mon.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> namespace NKikimr { diff --git a/ydb/core/base/statestorage_proxy.cpp b/ydb/core/base/statestorage_proxy.cpp index 13d396cb0f..bfb2f91ca9 100644 --- a/ydb/core/base/statestorage_proxy.cpp +++ b/ydb/core/base/statestorage_proxy.cpp @@ -6,9 +6,9 @@ #include <library/cpp/actors/core/actor_bootstrapped.h> #include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/helpers/flow_controlled_queue.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/helpers/flow_controlled_queue.h> #include <util/digest/city.h> #include <util/generic/xrange.h> diff --git a/ydb/core/base/statestorage_replica.cpp b/ydb/core/base/statestorage_replica.cpp index aca41acb16..768e266c86 100644 --- a/ydb/core/base/statestorage_replica.cpp +++ b/ydb/core/base/statestorage_replica.cpp @@ -4,9 +4,9 @@ #include "tablet.h" #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> #include <util/generic/map.h> #include <util/generic/hash_set.h> diff --git a/ydb/core/base/statestorage_replica_probe.cpp b/ydb/core/base/statestorage_replica_probe.cpp index 959c5a77ac..ff3107172c 100644 --- a/ydb/core/base/statestorage_replica_probe.cpp +++ b/ydb/core/base/statestorage_replica_probe.cpp @@ -3,10 +3,10 @@ #include "appdata.h" #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <util/generic/set.h> diff --git a/ydb/core/base/statestorage_warden.cpp b/ydb/core/base/statestorage_warden.cpp index 972a74e1fb..b01e861d5a 100644 --- a/ydb/core/base/statestorage_warden.cpp +++ b/ydb/core/base/statestorage_warden.cpp @@ -7,10 +7,10 @@ #include <ydb/core/cms/cms.h> #include <ydb/core/cms/console/console.h> #include <ydb/core/cms/console/configs_dispatcher.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> #include <util/generic/map.h> #include <util/generic/hash_set.h> diff --git a/ydb/core/base/tablet.h b/ydb/core/base/tablet.h index 602e39c600..f112d1e022 100644 --- a/ydb/core/base/tablet.h +++ b/ydb/core/base/tablet.h @@ -11,7 +11,7 @@ #include <ydb/core/protos/tablet_tx.pb.h> #include <ydb/core/tablet/tablet_metrics.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <util/generic/deque.h> #include <util/generic/vector.h> #include <util/datetime/base.h> diff --git a/ydb/core/base/tablet_killer.cpp b/ydb/core/base/tablet_killer.cpp index d46e2c5c89..eb6909916f 100644 --- a/ydb/core/base/tablet_killer.cpp +++ b/ydb/core/base/tablet_killer.cpp @@ -2,8 +2,8 @@ #include "tablet.h" #include "tabletid.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { diff --git a/ydb/core/base/tablet_pipe.h b/ydb/core/base/tablet_pipe.h index a0420b8672..a749d69978 100644 --- a/ydb/core/base/tablet_pipe.h +++ b/ydb/core/base/tablet_pipe.h @@ -5,7 +5,7 @@ #include <ydb/core/protos/base.pb.h> #include <ydb/core/protos/tablet_pipe.pb.h> -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/event_local.h> namespace NKikimr { diff --git a/ydb/core/base/tablet_pipecache.h b/ydb/core/base/tablet_pipecache.h index d3a519c9bd..cb5adae727 100644 --- a/ydb/core/base/tablet_pipecache.h +++ b/ydb/core/base/tablet_pipecache.h @@ -4,7 +4,7 @@ #include "counters.h" #include <ydb/core/base/tablet_pipe.h> -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/event_local.h> #include <util/stream/str.h> namespace NKikimr { diff --git a/ydb/core/base/tablet_resolver.h b/ydb/core/base/tablet_resolver.h index 24744cef47..0f907cead0 100644 --- a/ydb/core/base/tablet_resolver.h +++ b/ydb/core/base/tablet_resolver.h @@ -3,7 +3,7 @@ #include "events.h" #include <ydb/core/protos/base.pb.h> -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/event_local.h> #include <util/stream/str.h> #include <util/string/builder.h> diff --git a/ydb/core/base/tablet_status_checker.cpp b/ydb/core/base/tablet_status_checker.cpp index bfb51b8e85..e842e03281 100644 --- a/ydb/core/base/tablet_status_checker.cpp +++ b/ydb/core/base/tablet_status_checker.cpp @@ -1,7 +1,7 @@ #include "tablet.h" #include <ydb/core/base/blobstorage.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/hash_set.h> diff --git a/ydb/core/base/user_registry.h b/ydb/core/base/user_registry.h index 74484c3d06..d7d9113a60 100644 --- a/ydb/core/base/user_registry.h +++ b/ydb/core/base/user_registry.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/events.h> #include <ydb/core/tx/defs.h> namespace NKikimr { diff --git a/ydb/core/base/ut/ya.make b/ydb/core/base/ut/ya.make index 7d6b2f3546..7c73db006f 100644 --- a/ydb/core/base/ut/ya.make +++ b/ydb/core/base/ut/ya.make @@ -8,7 +8,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ) SRCS( diff --git a/ydb/core/base/ya.make b/ydb/core/base/ya.make index 83db5825c3..0fe4b2a8bf 100644 --- a/ydb/core/base/ya.make +++ b/ydb/core/base/ya.make @@ -89,13 +89,13 @@ SRCS( ) PEERDIR( - library/cpp/actors/core - library/cpp/actors/helpers - library/cpp/actors/interconnect - library/cpp/actors/protos - library/cpp/deprecated/enum_codegen - library/cpp/logger - library/cpp/lwtrace + library/cpp/actors/core + library/cpp/actors/helpers + library/cpp/actors/interconnect + library/cpp/actors/protos + library/cpp/deprecated/enum_codegen + library/cpp/logger + library/cpp/lwtrace library/cpp/lwtrace/mon library/cpp/random_provider library/cpp/time_provider diff --git a/ydb/core/blobstorage/backpressure/defs.h b/ydb/core/blobstorage/backpressure/defs.h index d510a3545e..bd902a8a22 100644 --- a/ydb/core/blobstorage/backpressure/defs.h +++ b/ydb/core/blobstorage/backpressure/defs.h @@ -17,5 +17,5 @@ #include <library/cpp/actors/core/actor_bootstrapped.h> #include <library/cpp/actors/core/mailbox.h> #include <library/cpp/actors/core/mon.h> -#include <library/cpp/containers/intrusive_rb_tree/rb_tree.h> +#include <library/cpp/containers/intrusive_rb_tree/rb_tree.h> #include <google/protobuf/message.h> diff --git a/ydb/core/blobstorage/backpressure/queue_backpressure_client_ut.cpp b/ydb/core/blobstorage/backpressure/queue_backpressure_client_ut.cpp index af14a13f2d..e5d7697620 100644 --- a/ydb/core/blobstorage/backpressure/queue_backpressure_client_ut.cpp +++ b/ydb/core/blobstorage/backpressure/queue_backpressure_client_ut.cpp @@ -1,11 +1,11 @@ #include "queue_backpressure_client.h" #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/monlib/dynamic_counters/counters.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/executor_pool_io.h> -#include <library/cpp/actors/core/scheduler_basic.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/executor_pool_io.h> +#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.h> #include <ydb/core/blobstorage/pdisk/blobstorage_pdisk.h> #include <ydb/core/blobstorage/vdisk/vdisk_actor.h> diff --git a/ydb/core/blobstorage/backpressure/unisched.cpp b/ydb/core/blobstorage/backpressure/unisched.cpp index 0a0190fa1c..cf148a2ab4 100644 --- a/ydb/core/blobstorage/backpressure/unisched.cpp +++ b/ydb/core/blobstorage/backpressure/unisched.cpp @@ -1,5 +1,5 @@ #include "unisched.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <ydb/core/base/events.h> #include <util/generic/set.h> diff --git a/ydb/core/blobstorage/backpressure/unisched.h b/ydb/core/blobstorage/backpressure/unisched.h index 9331b43e70..fe54108cda 100644 --- a/ydb/core/blobstorage/backpressure/unisched.h +++ b/ydb/core/blobstorage/backpressure/unisched.h @@ -4,7 +4,7 @@ #include "queue_backpressure_common.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/backpressure/ut/ya.make b/ydb/core/blobstorage/backpressure/ut/ya.make index ed318404ab..dda3710d0b 100644 --- a/ydb/core/blobstorage/backpressure/ut/ya.make +++ b/ydb/core/blobstorage/backpressure/ut/ya.make @@ -15,7 +15,7 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage ) diff --git a/ydb/core/blobstorage/backpressure/ya.make b/ydb/core/blobstorage/backpressure/ya.make index 9dcc817659..cbdf219b1e 100644 --- a/ydb/core/blobstorage/backpressure/ya.make +++ b/ydb/core/blobstorage/backpressure/ya.make @@ -4,8 +4,8 @@ OWNER(alexvru) PEERDIR( contrib/libs/protobuf - library/cpp/actors/core - library/cpp/containers/intrusive_rb_tree + library/cpp/actors/core + library/cpp/containers/intrusive_rb_tree ydb/core/base ydb/core/blobstorage/groupinfo ydb/core/blobstorage/lwtrace_probes diff --git a/ydb/core/blobstorage/base/html.cpp b/ydb/core/blobstorage/base/html.cpp index 6658530a94..cc5581f45b 100644 --- a/ydb/core/blobstorage/base/html.cpp +++ b/ydb/core/blobstorage/base/html.cpp @@ -1,5 +1,5 @@ #include "html.h" -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> #include <library/cpp/monlib/service/pages/templates.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/base/ut/ya.make b/ydb/core/blobstorage/base/ut/ya.make index 3e223c0bfd..e3341cbe37 100644 --- a/ydb/core/blobstorage/base/ut/ya.make +++ b/ydb/core/blobstorage/base/ut/ya.make @@ -15,7 +15,7 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/erasure ydb/core/protos ) diff --git a/ydb/core/blobstorage/base/utility.h b/ydb/core/blobstorage/base/utility.h index afb519dcb8..ab448d68cc 100644 --- a/ydb/core/blobstorage/base/utility.h +++ b/ydb/core/blobstorage/base/utility.h @@ -1,7 +1,7 @@ #pragma once #include "defs.h" -#include <library/cpp/actors/helpers/activeactors.h> +#include <library/cpp/actors/helpers/activeactors.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/blobstorage.h> diff --git a/ydb/core/blobstorage/base/ya.make b/ydb/core/blobstorage/base/ya.make index a5345d772a..ec86a0be2e 100644 --- a/ydb/core/blobstorage/base/ya.make +++ b/ydb/core/blobstorage/base/ya.make @@ -8,7 +8,7 @@ OWNER( ) PEERDIR( - library/cpp/lwtrace + library/cpp/lwtrace ydb/core/protos ydb/library/wilson ) diff --git a/ydb/core/blobstorage/defs.h b/ydb/core/blobstorage/defs.h index 7d7caf57ce..2f6133e69b 100644 --- a/ydb/core/blobstorage/defs.h +++ b/ydb/core/blobstorage/defs.h @@ -2,9 +2,9 @@ // unique tag to fix pragma once gcc glueing: ./ydb/core/blobstorage/vdisk/defs.h #include <ydb/core/base/defs.h> #include <ydb/core/base/logoblob.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/blobstorage/dsproxy/dsproxy.h b/ydb/core/blobstorage/dsproxy/dsproxy.h index 27592e971f..f8f4af99d4 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy.h +++ b/ydb/core/blobstorage/dsproxy/dsproxy.h @@ -15,7 +15,7 @@ #include <ydb/core/blobstorage/base/transparent.h> #include <ydb/core/blobstorage/base/wilson_events.h> #include <ydb/core/blobstorage/backpressure/queue_backpressure_client.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/group_stat.h> #include <library/cpp/containers/stack_vector/stack_vec.h> diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_get.cpp b/ydb/core/blobstorage/dsproxy/dsproxy_get.cpp index 9b08b41861..b08491eaf3 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy_get.cpp +++ b/ydb/core/blobstorage/dsproxy/dsproxy_get.cpp @@ -5,7 +5,7 @@ #include <ydb/core/blobstorage/lwtrace_probes/blobstorage_probes.h> #include <ydb/core/blobstorage/base/wilson_events.h> #include <library/cpp/containers/stack_vector/stack_vec.h> -#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/digest/crc32c/crc32c.h> #include <util/generic/set.h> #include <util/system/datetime.h> #include "dsproxy_get_impl.h" diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_monactor.cpp b/ydb/core/blobstorage/dsproxy/dsproxy_monactor.cpp index 96b492c415..398c4c18e5 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy_monactor.cpp +++ b/ydb/core/blobstorage/dsproxy/dsproxy_monactor.cpp @@ -6,9 +6,9 @@ #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/mon/crossref.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/mon.h> #include <library/cpp/actors/interconnect/interconnect.h> #include <library/cpp/monlib/service/pages/templates.h> diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_nodemonactor.cpp b/ydb/core/blobstorage/dsproxy/dsproxy_nodemonactor.cpp index 5bf4b09836..c7051105c5 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy_nodemonactor.cpp +++ b/ydb/core/blobstorage/dsproxy/dsproxy_nodemonactor.cpp @@ -3,9 +3,9 @@ #include <ydb/core/base/appdata.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/mon.h> #include <library/cpp/monlib/service/pages/templates.h> diff --git a/ydb/core/blobstorage/dsproxy/ut/dsproxy_fault_tolerance_ut_base.h b/ydb/core/blobstorage/dsproxy/ut/dsproxy_fault_tolerance_ut_base.h index c4b5c76f39..ca0715c0f2 100644 --- a/ydb/core/blobstorage/dsproxy/ut/dsproxy_fault_tolerance_ut_base.h +++ b/ydb/core/blobstorage/dsproxy/ut/dsproxy_fault_tolerance_ut_base.h @@ -3,7 +3,7 @@ #include "defs.h" #include <ydb/core/blobstorage/groupinfo/blobstorage_groupinfo_sets.h> #include <ydb/core/blobstorage/groupinfo/blobstorage_groupinfo_partlayout.h> -#include <library/cpp/actors/core/actor_coroutine.h> +#include <library/cpp/actors/core/actor_coroutine.h> #include <library/cpp/testing/unittest/registar.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/dsproxy/ut/dsproxy_fault_tolerance_ut_runtime.h b/ydb/core/blobstorage/dsproxy/ut/dsproxy_fault_tolerance_ut_runtime.h index bc33af4b86..26519ff767 100644 --- a/ydb/core/blobstorage/dsproxy/ut/dsproxy_fault_tolerance_ut_runtime.h +++ b/ydb/core/blobstorage/dsproxy/ut/dsproxy_fault_tolerance_ut_runtime.h @@ -3,13 +3,13 @@ #include "defs.h" #include <ydb/core/base/appdata.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/executor_pool_io.h> -#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/executor_pool_io.h> +#include <library/cpp/actors/core/scheduler_basic.h> #include <ydb/core/scheme/scheme_type_registry.h> #include <ydb/library/yql/minikql/mkql_function_registry.h> #include <ydb/library/yql/minikql/invoke_builtins/mkql_builtins.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <ydb/core/blobstorage/dsproxy/dsproxy_nodemon.h> #include <ydb/core/blobstorage/dsproxy/dsproxy.h> #include <ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.h> diff --git a/ydb/core/blobstorage/dsproxy/ut/ya.make b/ydb/core/blobstorage/dsproxy/ut/ya.make index 76825e572b..bbcf6e3a6b 100644 --- a/ydb/core/blobstorage/dsproxy/ut/ya.make +++ b/ydb/core/blobstorage/dsproxy/ut/ya.make @@ -20,9 +20,9 @@ ELSE() ENDIF() PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage/base ydb/core/blobstorage/dsproxy diff --git a/ydb/core/blobstorage/dsproxy/ut_fat/dsproxy_ut.cpp b/ydb/core/blobstorage/dsproxy/ut_fat/dsproxy_ut.cpp index 13b1bec356..38f6b1add6 100644 --- a/ydb/core/blobstorage/dsproxy/ut_fat/dsproxy_ut.cpp +++ b/ydb/core/blobstorage/dsproxy/ut_fat/dsproxy_ut.cpp @@ -21,21 +21,21 @@ #include <ydb/core/protos/blobstorage_vdisk_config.pb.h> #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/executor_pool_io.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/scheduler_basic.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/executor_pool_io.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <library/cpp/actors/interconnect/poller_tcp.h> #include <library/cpp/actors/interconnect/poller_actor.h> #include <library/cpp/actors/interconnect/mock/ic_mock.h> -#include <library/cpp/actors/protos/services_common.pb.h> -#include <library/cpp/actors/util/affinity.h> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/util/affinity.h> +#include <library/cpp/svnversion/svnversion.h> #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/tests_data.h> diff --git a/ydb/core/blobstorage/dsproxy/ut_fat/ya.make b/ydb/core/blobstorage/dsproxy/ut_fat/ya.make index 6544b16ff1..b32a06f08f 100644 --- a/ydb/core/blobstorage/dsproxy/ut_fat/ya.make +++ b/ydb/core/blobstorage/dsproxy/ut_fat/ya.make @@ -21,9 +21,9 @@ ENDIF() PEERDIR( library/cpp/actors/protos - library/cpp/actors/util + library/cpp/actors/util library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage/base ydb/core/blobstorage/dsproxy diff --git a/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.cpp b/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.cpp index 054d5be665..3e5bd02003 100644 --- a/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.cpp +++ b/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.cpp @@ -6,7 +6,7 @@ #include <ydb/core/base/services/blobstorage_service_id.h> #include <ydb/core/blobstorage/vdisk/ingress/blobstorage_ingress.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> #include <library/cpp/pop_count/popcount.h> diff --git a/ydb/core/blobstorage/groupinfo/ut/ya.make b/ydb/core/blobstorage/groupinfo/ut/ya.make index 78d020c48b..609d6d2f35 100644 --- a/ydb/core/blobstorage/groupinfo/ut/ya.make +++ b/ydb/core/blobstorage/groupinfo/ut/ya.make @@ -15,7 +15,7 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage/base ydb/core/blobstorage/groupinfo diff --git a/ydb/core/blobstorage/groupinfo/ya.make b/ydb/core/blobstorage/groupinfo/ya.make index 59db5e1e52..d300c9933d 100644 --- a/ydb/core/blobstorage/groupinfo/ya.make +++ b/ydb/core/blobstorage/groupinfo/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(g:kikimr) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/digest/crc32c library/cpp/pop_count ydb/core/base diff --git a/ydb/core/blobstorage/incrhuge/incrhuge_id_dict.h b/ydb/core/blobstorage/incrhuge/incrhuge_id_dict.h index 270e210699..18d5ea1101 100644 --- a/ydb/core/blobstorage/incrhuge/incrhuge_id_dict.h +++ b/ydb/core/blobstorage/incrhuge/incrhuge_id_dict.h @@ -2,7 +2,7 @@ #include "defs.h" -#include <library/cpp/containers/intrusive_rb_tree/rb_tree.h> +#include <library/cpp/containers/intrusive_rb_tree/rb_tree.h> #include <util/generic/intrlist.h> #include <util/generic/bitmap.h> diff --git a/ydb/core/blobstorage/incrhuge/incrhuge_keeper.cpp b/ydb/core/blobstorage/incrhuge/incrhuge_keeper.cpp index 05aafde94d..62cd570351 100644 --- a/ydb/core/blobstorage/incrhuge/incrhuge_keeper.cpp +++ b/ydb/core/blobstorage/incrhuge/incrhuge_keeper.cpp @@ -1,9 +1,9 @@ #include "incrhuge_keeper.h" #include "incrhuge.h" #include "incrhuge_keeper_recovery_scan.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <ydb/core/blobstorage/pdisk/blobstorage_pdisk.h> -#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/digest/crc32c/crc32c.h> #include <library/cpp/monlib/service/pages/templates.h> #include <util/generic/queue.h> #include <util/generic/bitmap.h> diff --git a/ydb/core/blobstorage/incrhuge/incrhuge_keeper.h b/ydb/core/blobstorage/incrhuge/incrhuge_keeper.h index 3f45a0c030..2aaf1b7ec3 100644 --- a/ydb/core/blobstorage/incrhuge/incrhuge_keeper.h +++ b/ydb/core/blobstorage/incrhuge/incrhuge_keeper.h @@ -10,7 +10,7 @@ #include "incrhuge_keeper_recovery.h" #include "incrhuge_keeper_write.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr { namespace NIncrHuge { diff --git a/ydb/core/blobstorage/incrhuge/incrhuge_keeper_defrag.cpp b/ydb/core/blobstorage/incrhuge/incrhuge_keeper_defrag.cpp index 0cb43beb2a..e55830b7e1 100644 --- a/ydb/core/blobstorage/incrhuge/incrhuge_keeper_defrag.cpp +++ b/ydb/core/blobstorage/incrhuge/incrhuge_keeper_defrag.cpp @@ -1,7 +1,7 @@ #include "incrhuge_keeper_defrag.h" #include "incrhuge_keeper.h" #include "incrhuge_keeper_recovery_scan.h" -#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/digest/crc32c/crc32c.h> namespace NKikimr { namespace NIncrHuge { diff --git a/ydb/core/blobstorage/incrhuge/incrhuge_keeper_recovery_read_log.h b/ydb/core/blobstorage/incrhuge/incrhuge_keeper_recovery_read_log.h index 551e8ad641..0a04971fb9 100644 --- a/ydb/core/blobstorage/incrhuge/incrhuge_keeper_recovery_read_log.h +++ b/ydb/core/blobstorage/incrhuge/incrhuge_keeper_recovery_read_log.h @@ -2,7 +2,7 @@ #include "defs.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include <ydb/core/blobstorage/pdisk/blobstorage_pdisk.h> diff --git a/ydb/core/blobstorage/incrhuge/incrhuge_keeper_recovery_scan.cpp b/ydb/core/blobstorage/incrhuge/incrhuge_keeper_recovery_scan.cpp index eb60105861..11353eb415 100644 --- a/ydb/core/blobstorage/incrhuge/incrhuge_keeper_recovery_scan.cpp +++ b/ydb/core/blobstorage/incrhuge/incrhuge_keeper_recovery_scan.cpp @@ -1,5 +1,5 @@ #include "incrhuge_keeper_recovery_scan.h" -#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/digest/crc32c/crc32c.h> namespace NKikimr { namespace NIncrHuge { diff --git a/ydb/core/blobstorage/incrhuge/incrhuge_keeper_write.cpp b/ydb/core/blobstorage/incrhuge/incrhuge_keeper_write.cpp index ca6cedf5d8..6186439c35 100644 --- a/ydb/core/blobstorage/incrhuge/incrhuge_keeper_write.cpp +++ b/ydb/core/blobstorage/incrhuge/incrhuge_keeper_write.cpp @@ -1,6 +1,6 @@ #include "incrhuge_keeper_write.h" #include "incrhuge_keeper.h" -#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/digest/crc32c/crc32c.h> namespace NKikimr { namespace NIncrHuge { diff --git a/ydb/core/blobstorage/incrhuge/ut/incrhuge_basic_ut.cpp b/ydb/core/blobstorage/incrhuge/ut/incrhuge_basic_ut.cpp index 59d3cb999c..3935e998ac 100644 --- a/ydb/core/blobstorage/incrhuge/ut/incrhuge_basic_ut.cpp +++ b/ydb/core/blobstorage/incrhuge/ut/incrhuge_basic_ut.cpp @@ -1,11 +1,11 @@ -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/executor_pool_io.h> -#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/executor_pool_io.h> +#include <library/cpp/actors/core/scheduler_basic.h> #include <ydb/core/blobstorage/incrhuge/incrhuge.h> #include <ydb/core/blobstorage/incrhuge/incrhuge_keeper.h> #include <ydb/core/blobstorage/pdisk/blobstorage_pdisk.h> #include <ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <library/cpp/testing/unittest/registar.h> #include <util/random/fast.h> #include <util/folder/tempdir.h> diff --git a/ydb/core/blobstorage/incrhuge/ut/test_actor_concurrent.h b/ydb/core/blobstorage/incrhuge/ut/test_actor_concurrent.h index d7f370706f..4b8c53e63d 100644 --- a/ydb/core/blobstorage/incrhuge/ut/test_actor_concurrent.h +++ b/ydb/core/blobstorage/incrhuge/ut/test_actor_concurrent.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/digest/md5/md5.h> +#include <library/cpp/digest/md5/md5.h> class TTestActorConcurrent : public TActorBootstrapped<TTestActorConcurrent> { public: diff --git a/ydb/core/blobstorage/incrhuge/ut/ya.make b/ydb/core/blobstorage/incrhuge/ut/ya.make index 971a739c01..9e5d18008a 100644 --- a/ydb/core/blobstorage/incrhuge/ut/ya.make +++ b/ydb/core/blobstorage/incrhuge/ut/ya.make @@ -17,7 +17,7 @@ ELSE() ENDIF() PEERDIR( - library/cpp/actors/protos + library/cpp/actors/protos ydb/core/blobstorage ydb/core/blobstorage/incrhuge ydb/core/blobstorage/pdisk diff --git a/ydb/core/blobstorage/lwtrace_probes/blobstorage_probes.h b/ydb/core/blobstorage/lwtrace_probes/blobstorage_probes.h index 7e20a7bd81..01bd3570b4 100644 --- a/ydb/core/blobstorage/lwtrace_probes/blobstorage_probes.h +++ b/ydb/core/blobstorage/lwtrace_probes/blobstorage_probes.h @@ -2,7 +2,7 @@ //#include <ydb/core/protos/base.pb.h> -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> // Helper class for printing pdisk id in the same was as it done for counters struct TPDiskIdField { diff --git a/ydb/core/blobstorage/lwtrace_probes/ya.make b/ydb/core/blobstorage/lwtrace_probes/ya.make index 412fe7a0d3..486807fba0 100644 --- a/ydb/core/blobstorage/lwtrace_probes/ya.make +++ b/ydb/core/blobstorage/lwtrace_probes/ya.make @@ -12,7 +12,7 @@ SRCS( PEERDIR( contrib/libs/grpc - library/cpp/lwtrace/protos + library/cpp/lwtrace/protos ydb/core/base ydb/core/protos ) diff --git a/ydb/core/blobstorage/nodewarden/defs.h b/ydb/core/blobstorage/nodewarden/defs.h index a3a658d27f..2c343f4fb6 100644 --- a/ydb/core/blobstorage/nodewarden/defs.h +++ b/ydb/core/blobstorage/nodewarden/defs.h @@ -2,11 +2,11 @@ #include <ydb/core/blobstorage/defs.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/mailbox_queue_revolving.h> -#include <library/cpp/actors/core/invoke.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/mailbox_queue_revolving.h> +#include <library/cpp/actors/core/invoke.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/protos/config.pb.h> @@ -37,8 +37,8 @@ #include <google/protobuf/text_format.h> -#include <library/cpp/digest/crc32c/crc32c.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <util/folder/dirut.h> #include <util/folder/tempdir.h> diff --git a/ydb/core/blobstorage/nodewarden/group_stat_aggregator.h b/ydb/core/blobstorage/nodewarden/group_stat_aggregator.h index 24c1f0a93e..2746cc48f9 100644 --- a/ydb/core/blobstorage/nodewarden/group_stat_aggregator.h +++ b/ydb/core/blobstorage/nodewarden/group_stat_aggregator.h @@ -5,8 +5,8 @@ #include <ydb/core/protos/blobstorage.pb.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/event_local.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/other/mon_blob_range_page.cpp b/ydb/core/blobstorage/other/mon_blob_range_page.cpp index f4797d62e2..8e925b6551 100644 --- a/ydb/core/blobstorage/other/mon_blob_range_page.cpp +++ b/ydb/core/blobstorage/other/mon_blob_range_page.cpp @@ -1,6 +1,6 @@ #include "mon_blob_range_page.h" #include <ydb/core/base/blobstorage.h> -#include <library/cpp/json/writer/json.h> +#include <library/cpp/json/writer/json.h> #include <library/cpp/json/writer/json_value.h> #include <library/cpp/monlib/service/pages/templates.h> #include <library/cpp/threading/future/future.h> diff --git a/ydb/core/blobstorage/other/ya.make b/ydb/core/blobstorage/other/ya.make index 650c118dad..447394d1a8 100644 --- a/ydb/core/blobstorage/other/ya.make +++ b/ydb/core/blobstorage/other/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/json/writer + library/cpp/json/writer library/cpp/monlib/service/pages library/cpp/threading/future ydb/core/base diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_actor.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_actor.cpp index d92b19c6cc..c8351dfa29 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_actor.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_actor.cpp @@ -25,9 +25,9 @@ #include <ydb/core/protos/services.pb.h> #include <ydb/library/schlab/mon/mon.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/mon.h> #include <library/cpp/monlib/service/pages/templates.h> #include <util/generic/algorithm.h> diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice_async.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice_async.cpp index 34c20999b7..6d8259d768 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice_async.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice_async.cpp @@ -18,8 +18,8 @@ #include <ydb/library/pdisk_io/aio.h> #include <ydb/library/pdisk_io/spdk_state.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/util/thread.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/util/thread.h> #include <library/cpp/containers/stack_vector/stack_vec.h> #include <util/generic/deque.h> diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_driveestimator.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_driveestimator.h index 8855da6c21..d66b0c0869 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_driveestimator.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_driveestimator.h @@ -11,7 +11,7 @@ #include <util/system/hp_timer.h> #include <util/system/atomic.h> #include <util/system/condvar.h> -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> namespace NKikimr { namespace NPDisk { diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_internal_interface.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_internal_interface.h index df2f088569..54eca08674 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_internal_interface.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_internal_interface.h @@ -6,7 +6,7 @@ #include <ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice.h> #include <ydb/library/pdisk_io/buffers.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_thread.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_thread.h index f31ec3017c..6cda2e1b91 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_thread.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_thread.h @@ -2,7 +2,7 @@ #include "defs.h" #include "blobstorage_pdisk.h" #include "blobstorage_pdisk_abstract.h" -#include <library/cpp/actors/util/thread.h> +#include <library/cpp/actors/util/thread.h> #include <util/system/thread.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.cpp index 152deec999..35fc26289c 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.cpp @@ -20,11 +20,11 @@ #include <ydb/core/util/queue_oneone_inplace.h> #include <ydb/library/pdisk_io/aio.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <library/cpp/actors/core/executor_pool_io.h> #include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/mon.h> #include <library/cpp/actors/core/scheduler_basic.h> #include <library/cpp/monlib/service/pages/templates.h> diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.h index 6bf5c0695d..a2a1c555ee 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.h @@ -21,19 +21,19 @@ #include <ydb/core/protos/blobstorage_vdisk_config.pb.h> #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/executor_pool_io.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/executor_pool_io.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> #include <library/cpp/actors/core/mon.h> -#include <library/cpp/actors/core/scheduler_basic.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <library/cpp/actors/protos/services_common.pb.h> -#include <library/cpp/actors/util/affinity.h> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/actors/util/affinity.h> +#include <library/cpp/svnversion/svnversion.h> #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/tests_data.h> diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_wcache.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_wcache.cpp index f613c70bee..1a98ec2be3 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_wcache.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_wcache.cpp @@ -1,5 +1,5 @@ #include "blobstorage_pdisk_util_wcache.h" -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/protos/services.pb.h> #include <util/stream/file.h> diff --git a/ydb/core/blobstorage/pdisk/defs.h b/ydb/core/blobstorage/pdisk/defs.h index 2e3ea7932a..5b0220652c 100644 --- a/ydb/core/blobstorage/pdisk/defs.h +++ b/ydb/core/blobstorage/pdisk/defs.h @@ -2,9 +2,9 @@ // unique tag to fix pragma once gcc glueing: ./ydb/core/blobstorage/pdisk/defs.h #include <ydb/core/base/defs.h> #include <ydb/core/util/yverify_stream.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/protos/services.pb.h> #include <util/system/sanitizers.h> diff --git a/ydb/core/blobstorage/pdisk/ut/ya.make b/ydb/core/blobstorage/pdisk/ut/ya.make index 9eab049637..44bc2a42c6 100644 --- a/ydb/core/blobstorage/pdisk/ut/ya.make +++ b/ydb/core/blobstorage/pdisk/ut/ya.make @@ -25,7 +25,7 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/blobstorage/lwtrace_probes ydb/core/testlib/actors ) diff --git a/ydb/core/blobstorage/pdisk/ya.make b/ydb/core/blobstorage/pdisk/ya.make index 464191b8c0..5042377715 100644 --- a/ydb/core/blobstorage/pdisk/ya.make +++ b/ydb/core/blobstorage/pdisk/ya.make @@ -8,9 +8,9 @@ OWNER( PEERDIR( contrib/libs/lz4 - library/cpp/actors/core - library/cpp/actors/protos - library/cpp/actors/util + library/cpp/actors/core + library/cpp/actors/protos + library/cpp/actors/util library/cpp/containers/stack_vector library/cpp/lwtrace library/cpp/monlib/dynamic_counters/percentile diff --git a/ydb/core/blobstorage/storagepoolmon/ut/ya.make b/ydb/core/blobstorage/storagepoolmon/ut/ya.make index 7f062b3da0..ef3b721cfa 100644 --- a/ydb/core/blobstorage/storagepoolmon/ut/ya.make +++ b/ydb/core/blobstorage/storagepoolmon/ut/ya.make @@ -21,7 +21,7 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/blobstorage/storagepoolmon ydb/core/testlib ydb/core/testlib/actors diff --git a/ydb/core/blobstorage/testload/defs.h b/ydb/core/blobstorage/testload/defs.h index d2e2630427..4ce32c33c6 100644 --- a/ydb/core/blobstorage/testload/defs.h +++ b/ydb/core/blobstorage/testload/defs.h @@ -2,8 +2,8 @@ // unique tag to fix pragma once gcc glueing: ./ydb/core/blobstorage/testload/defs.h #include <ydb/core/base/defs.h> #include <ydb/core/base/logoblob.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/blobstorage/ut_pdiskfit/lib/basic_test.cpp b/ydb/core/blobstorage/ut_pdiskfit/lib/basic_test.cpp index 94eae0767a..782095e2e6 100644 --- a/ydb/core/blobstorage/ut_pdiskfit/lib/basic_test.cpp +++ b/ydb/core/blobstorage/ut_pdiskfit/lib/basic_test.cpp @@ -4,7 +4,7 @@ #include <util/generic/set.h> #include <util/generic/bitmap.h> #include <util/system/unaligned_mem.h> -#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/digest/crc32c/crc32c.h> class TFakeVDisk : public TActor<TFakeVDisk> diff --git a/ydb/core/blobstorage/ut_pdiskfit/lib/basic_test.h b/ydb/core/blobstorage/ut_pdiskfit/lib/basic_test.h index 17a25ef9fb..d1e6ad343b 100644 --- a/ydb/core/blobstorage/ut_pdiskfit/lib/basic_test.h +++ b/ydb/core/blobstorage/ut_pdiskfit/lib/basic_test.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <ydb/core/protos/pdiskfit.pb.h> #include <ydb/core/blobstorage/pdisk/blobstorage_pdisk.h> #include <ydb/core/blobstorage/pdisk/blobstorage_pdisk.h> diff --git a/ydb/core/blobstorage/ut_pdiskfit/lib/fail_injection_test.h b/ydb/core/blobstorage/ut_pdiskfit/lib/fail_injection_test.h index 7e0bfa05e0..b4d1b43b78 100644 --- a/ydb/core/blobstorage/ut_pdiskfit/lib/fail_injection_test.h +++ b/ydb/core/blobstorage/ut_pdiskfit/lib/fail_injection_test.h @@ -6,13 +6,13 @@ #include <ydb/core/base/appdata.h> #include <ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.h> #include <ydb/library/pdisk_io/aio.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/executor_pool_io.h> -#include <library/cpp/actors/core/scheduler_basic.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/executor_pool_io.h> +#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/protos/services_common.pb.h> -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #include <library/cpp/monlib/dynamic_counters/counters.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/ydb/core/blobstorage/ut_pdiskfit/lib/ya.make b/ydb/core/blobstorage/ut_pdiskfit/lib/ya.make index 7f9b9ba495..431ba39947 100644 --- a/ydb/core/blobstorage/ut_pdiskfit/lib/ya.make +++ b/ydb/core/blobstorage/ut_pdiskfit/lib/ya.make @@ -11,7 +11,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/protos + library/cpp/actors/protos ydb/core/base ydb/core/blobstorage/pdisk ydb/library/pdisk_io diff --git a/ydb/core/blobstorage/ut_vdisk/lib/astest.h b/ydb/core/blobstorage/ut_vdisk/lib/astest.h index 2cf254eff2..5e51da79a4 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/astest.h +++ b/ydb/core/blobstorage/ut_vdisk/lib/astest.h @@ -3,12 +3,12 @@ #include "defs.h" #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/tests_data.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/executor_pool_io.h> -#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/executor_pool_io.h> +#include <library/cpp/actors/core/scheduler_basic.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <ydb/core/base/appdata.h> #include <ydb/core/scheme_types/scheme_type_registry.h> #include <ydb/core/scheme/scheme_type_registry.h> diff --git a/ydb/core/blobstorage/ut_vdisk/lib/defs.h b/ydb/core/blobstorage/ut_vdisk/lib/defs.h index 3ddc72cf28..a8393a82de 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/defs.h +++ b/ydb/core/blobstorage/ut_vdisk/lib/defs.h @@ -1,5 +1,5 @@ #pragma once -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <ydb/core/blobstorage/vdisk/common/vdisk_events.h> diff --git a/ydb/core/blobstorage/ut_vdisk/lib/http_client.cpp b/ydb/core/blobstorage/ut_vdisk/lib/http_client.cpp index abde48cedf..f11028e885 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/http_client.cpp +++ b/ydb/core/blobstorage/ut_vdisk/lib/http_client.cpp @@ -1,6 +1,6 @@ #include "http_client.h" -#include <library/cpp/openssl/io/stream.h> +#include <library/cpp/openssl/io/stream.h> #include <util/network/socket.h> #include <util/stream/output.h> #include <util/string/cast.h> diff --git a/ydb/core/blobstorage/ut_vdisk/lib/http_client.h b/ydb/core/blobstorage/ut_vdisk/lib/http_client.h index 3370f0eb00..568608c7a4 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/http_client.h +++ b/ydb/core/blobstorage/ut_vdisk/lib/http_client.h @@ -6,9 +6,9 @@ #include <util/generic/strbuf.h> #include <util/generic/yexception.h> -#include <library/cpp/http/io/stream.h> +#include <library/cpp/http/io/stream.h> -// Simple http client based on library/cpp/http/simple. +// Simple http client based on library/cpp/http/simple. class TNetworkAddress; class IOutputStream; diff --git a/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp b/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp index b2c020c3d2..96ea4a5c64 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp +++ b/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp @@ -8,10 +8,10 @@ #include <ydb/core/scheme/scheme_type_registry.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/executor_pool_io.h> -#include <library/cpp/actors/core/scheduler_basic.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/executor_pool_io.h> +#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <library/cpp/testing/unittest/tests_data.h> diff --git a/ydb/core/blobstorage/ut_vdisk/lib/vdisk_mock.cpp b/ydb/core/blobstorage/ut_vdisk/lib/vdisk_mock.cpp index 0d68629c64..2ffd91db98 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/vdisk_mock.cpp +++ b/ydb/core/blobstorage/ut_vdisk/lib/vdisk_mock.cpp @@ -1,6 +1,6 @@ #include "vdisk_mock.h" -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <util/generic/hash_set.h> #include <util/system/guard.h> diff --git a/ydb/core/blobstorage/ut_vdisk/lib/ya.make b/ydb/core/blobstorage/ut_vdisk/lib/ya.make index c704427fd6..771bcf3a9d 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/ya.make +++ b/ydb/core/blobstorage/ut_vdisk/lib/ya.make @@ -49,9 +49,9 @@ SRCS( ) PEERDIR( - library/cpp/actors/protos - library/cpp/http/io - library/cpp/openssl/io + library/cpp/actors/protos + library/cpp/http/io + library/cpp/openssl/io library/cpp/string_utils/url library/cpp/testing/unittest ydb/core/base diff --git a/ydb/core/blobstorage/ut_vdisk/mon_reregister_ut.cpp b/ydb/core/blobstorage/ut_vdisk/mon_reregister_ut.cpp index 36a2eca81f..5fead90bd1 100644 --- a/ydb/core/blobstorage/ut_vdisk/mon_reregister_ut.cpp +++ b/ydb/core/blobstorage/ut_vdisk/mon_reregister_ut.cpp @@ -1,12 +1,12 @@ #include "defs.h" #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/tests_data.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/executor_pool_io.h> -#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/executor_pool_io.h> +#include <library/cpp/actors/core/scheduler_basic.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <ydb/core/base/appdata.h> #include <ydb/core/scheme_types/scheme_type_registry.h> #include <ydb/core/scheme/scheme_type_registry.h> diff --git a/ydb/core/blobstorage/vdisk/anubis_osiris/blobstorage_anubisproxy.cpp b/ydb/core/blobstorage/vdisk/anubis_osiris/blobstorage_anubisproxy.cpp index cdb854a099..b755ffb36a 100644 --- a/ydb/core/blobstorage/vdisk/anubis_osiris/blobstorage_anubisproxy.cpp +++ b/ydb/core/blobstorage/vdisk/anubis_osiris/blobstorage_anubisproxy.cpp @@ -4,7 +4,7 @@ #include <ydb/core/blobstorage/base/utility.h> #include <library/cpp/monlib/service/pages/templates.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/protos/blobstorage.pb.h> using namespace NKikimrServices; diff --git a/ydb/core/blobstorage/vdisk/anubis_osiris/blobstorage_anubisrunner.cpp b/ydb/core/blobstorage/vdisk/anubis_osiris/blobstorage_anubisrunner.cpp index f1bbfa34c6..32fa8a7d95 100644 --- a/ydb/core/blobstorage/vdisk/anubis_osiris/blobstorage_anubisrunner.cpp +++ b/ydb/core/blobstorage/vdisk/anubis_osiris/blobstorage_anubisrunner.cpp @@ -5,7 +5,7 @@ #include <ydb/core/blobstorage/groupinfo/blobstorage_groupinfo_sets.h> #include <library/cpp/monlib/service/pages/templates.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> using namespace NKikimrServices; diff --git a/ydb/core/blobstorage/vdisk/anubis_osiris/defs.h b/ydb/core/blobstorage/vdisk/anubis_osiris/defs.h index 294f96e911..afbce5835d 100644 --- a/ydb/core/blobstorage/vdisk/anubis_osiris/defs.h +++ b/ydb/core/blobstorage/vdisk/anubis_osiris/defs.h @@ -2,9 +2,9 @@ // unique tag to fix pragma once gcc glueing: ./ydb/core/blobstorage/vdisk/anubis_osiris/defs.h #include <ydb/core/base/defs.h> #include <ydb/core/base/logoblob.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/helpers/activeactors.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/helpers/activeactors.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/blobstorage/vdisk/anubis_osiris/ut/ya.make b/ydb/core/blobstorage/vdisk/anubis_osiris/ut/ya.make index c9f15ece4a..437e18e72a 100644 --- a/ydb/core/blobstorage/vdisk/anubis_osiris/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/anubis_osiris/ut/ya.make @@ -10,7 +10,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ) diff --git a/ydb/core/blobstorage/vdisk/anubis_osiris/ya.make b/ydb/core/blobstorage/vdisk/anubis_osiris/ya.make index e59b3a060e..b1d99d2ea6 100644 --- a/ydb/core/blobstorage/vdisk/anubis_osiris/ya.make +++ b/ydb/core/blobstorage/vdisk/anubis_osiris/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(fomichev) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/monlib/service/pages ydb/core/base ydb/core/blobstorage/backpressure diff --git a/ydb/core/blobstorage/vdisk/common/blobstorage_event_filter.h b/ydb/core/blobstorage/vdisk/common/blobstorage_event_filter.h index 8f7bfd8994..a75e98b92d 100644 --- a/ydb/core/blobstorage/vdisk/common/blobstorage_event_filter.h +++ b/ydb/core/blobstorage/vdisk/common/blobstorage_event_filter.h @@ -2,7 +2,7 @@ #include "defs.h" -#include <library/cpp/actors/interconnect/event_filter.h> +#include <library/cpp/actors/interconnect/event_filter.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/vdisk/common/ut/ya.make b/ydb/core/blobstorage/vdisk/common/ut/ya.make index 52db6aa8c4..b9879f6f78 100644 --- a/ydb/core/blobstorage/vdisk/common/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/common/ut/ya.make @@ -10,7 +10,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage/groupinfo ydb/core/erasure diff --git a/ydb/core/blobstorage/vdisk/common/vdisk_log.cpp b/ydb/core/blobstorage/vdisk/common/vdisk_log.cpp index e7a3e8cc27..d55b441dcb 100644 --- a/ydb/core/blobstorage/vdisk/common/vdisk_log.cpp +++ b/ydb/core/blobstorage/vdisk/common/vdisk_log.cpp @@ -1,6 +1,6 @@ #include "vdisk_log.h" #include "vdisk_context.h" -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/protos/services_common.pb.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/vdisk/common/ya.make b/ydb/core/blobstorage/vdisk/common/ya.make index 4fb4364ee2..bb0d4de339 100644 --- a/ydb/core/blobstorage/vdisk/common/ya.make +++ b/ydb/core/blobstorage/vdisk/common/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(g:kikimr) PEERDIR( - library/cpp/actors/protos + library/cpp/actors/protos library/cpp/monlib/service/pages ydb/core/base ydb/core/blobstorage/vdisk/hulldb/base diff --git a/ydb/core/blobstorage/vdisk/handoff/handoff_delegate.cpp b/ydb/core/blobstorage/vdisk/handoff/handoff_delegate.cpp index f37aca976a..00d1df08c2 100644 --- a/ydb/core/blobstorage/vdisk/handoff/handoff_delegate.cpp +++ b/ydb/core/blobstorage/vdisk/handoff/handoff_delegate.cpp @@ -4,7 +4,7 @@ #include "handoff_mon.h" #include <ydb/core/blobstorage/base/utility.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> using namespace NKikimrServices; using namespace NKikimr::NHandoff; diff --git a/ydb/core/blobstorage/vdisk/handoff/handoff_mon.cpp b/ydb/core/blobstorage/vdisk/handoff/handoff_mon.cpp index 5aa0e92348..3176c5700a 100644 --- a/ydb/core/blobstorage/vdisk/handoff/handoff_mon.cpp +++ b/ydb/core/blobstorage/vdisk/handoff/handoff_mon.cpp @@ -1,7 +1,7 @@ #include "handoff_mon.h" #include <ydb/core/blobstorage/vdisk/common/vdisk_mon.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> using namespace NKikimrServices; using namespace NKikimr::NHandoff; diff --git a/ydb/core/blobstorage/vdisk/handoff/ya.make b/ydb/core/blobstorage/vdisk/handoff/ya.make index 61be4cc530..76e855c90e 100644 --- a/ydb/core/blobstorage/vdisk/handoff/ya.make +++ b/ydb/core/blobstorage/vdisk/handoff/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(fomichev) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/monlib/service/pages ydb/core/base ydb/core/blobstorage/backpressure diff --git a/ydb/core/blobstorage/vdisk/huge/ut/ya.make b/ydb/core/blobstorage/vdisk/huge/ut/ya.make index 2a638ac565..dd04e77b0f 100644 --- a/ydb/core/blobstorage/vdisk/huge/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/huge/ut/ya.make @@ -10,7 +10,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage ydb/core/blobstorage/groupinfo diff --git a/ydb/core/blobstorage/vdisk/hulldb/barriers/hullds_gcessence_defs.h b/ydb/core/blobstorage/vdisk/hulldb/barriers/hullds_gcessence_defs.h index 40132629ce..b2cbd3509a 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/barriers/hullds_gcessence_defs.h +++ b/ydb/core/blobstorage/vdisk/hulldb/barriers/hullds_gcessence_defs.h @@ -3,7 +3,7 @@ #include "defs.h" #include <ydb/core/blobstorage/vdisk/hulldb/base/hullbase_barrier.h> -#include <library/cpp/actors/util/named_tuple.h> +#include <library/cpp/actors/util/named_tuple.h> namespace NKikimr { namespace NGc { diff --git a/ydb/core/blobstorage/vdisk/hulldb/barriers/ut/ya.make b/ydb/core/blobstorage/vdisk/hulldb/barriers/ut/ya.make index 26c55d2346..f9dce32bdc 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/barriers/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/hulldb/barriers/ut/ya.make @@ -10,7 +10,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage/vdisk/common ) diff --git a/ydb/core/blobstorage/vdisk/hulldb/base/hullbase_barrier.h b/ydb/core/blobstorage/vdisk/hulldb/base/hullbase_barrier.h index 4afce21c05..dbb1d55c39 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/base/hullbase_barrier.h +++ b/ydb/core/blobstorage/vdisk/hulldb/base/hullbase_barrier.h @@ -6,7 +6,7 @@ #include <ydb/core/blobstorage/vdisk/common/vdisk_dbtype.h> #include <ydb/core/blobstorage/vdisk/ingress/blobstorage_ingress.h> #include <ydb/core/protos/blobstorage.pb.h> -#include <library/cpp/actors/util/named_tuple.h> +#include <library/cpp/actors/util/named_tuple.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/vdisk/hulldb/base/hullds_arena.h b/ydb/core/blobstorage/vdisk/hulldb/base/hullds_arena.h index 687e1a4ba0..7f5595d6c3 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/base/hullds_arena.h +++ b/ydb/core/blobstorage/vdisk/hulldb/base/hullds_arena.h @@ -2,7 +2,7 @@ #include "defs.h" -#include <library/cpp/actors/util/rope.h> +#include <library/cpp/actors/util/rope.h> #include <util/thread/lfstack.h> #include <util/system/filemap.h> diff --git a/ydb/core/blobstorage/vdisk/hulldb/base/ut/ya.make b/ydb/core/blobstorage/vdisk/hulldb/base/ut/ya.make index 5c7e85bf6c..e9663d0d90 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/base/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/hulldb/base/ut/ya.make @@ -10,7 +10,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage/vdisk/common ydb/core/blobstorage/vdisk/hulldb diff --git a/ydb/core/blobstorage/vdisk/hulldb/fresh/ut/ya.make b/ydb/core/blobstorage/vdisk/hulldb/fresh/ut/ya.make index 52b4282cb3..a6017ced19 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/fresh/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/hulldb/fresh/ut/ya.make @@ -10,7 +10,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage/vdisk/common ydb/core/blobstorage/vdisk/hulldb diff --git a/ydb/core/blobstorage/vdisk/hulldb/generic/ut/ya.make b/ydb/core/blobstorage/vdisk/hulldb/generic/ut/ya.make index ed64d664b2..9ee093471d 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/generic/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/hulldb/generic/ut/ya.make @@ -10,7 +10,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage/vdisk/common ydb/core/blobstorage/vdisk/hulldb diff --git a/ydb/core/blobstorage/vdisk/hulldb/ut/ya.make b/ydb/core/blobstorage/vdisk/hulldb/ut/ya.make index a4a6c7f7c1..96ae69007c 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/hulldb/ut/ya.make @@ -10,7 +10,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage ydb/core/erasure diff --git a/ydb/core/blobstorage/vdisk/hullop/ut/ya.make b/ydb/core/blobstorage/vdisk/hullop/ut/ya.make index c6a5556163..c4d63c82d1 100644 --- a/ydb/core/blobstorage/vdisk/hullop/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/hullop/ut/ya.make @@ -23,7 +23,7 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/blobstorage/pdisk ) diff --git a/ydb/core/blobstorage/vdisk/ingress/defs.h b/ydb/core/blobstorage/vdisk/ingress/defs.h index ed5b11c6f6..b5201aa2b8 100644 --- a/ydb/core/blobstorage/vdisk/ingress/defs.h +++ b/ydb/core/blobstorage/vdisk/ingress/defs.h @@ -2,8 +2,8 @@ // unique tag to fix pragma once gcc glueing: ./ydb/core/blobstorage/vdisk/ingress/defs.h #include <ydb/core/base/defs.h> #include <ydb/core/base/logoblob.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/blobstorage/vdisk/ingress/ut/ya.make b/ydb/core/blobstorage/vdisk/ingress/ut/ya.make index c9be2d9d4a..ed4d1538f5 100644 --- a/ydb/core/blobstorage/vdisk/ingress/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/ingress/ut/ya.make @@ -10,7 +10,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage/base ydb/core/blobstorage/groupinfo diff --git a/ydb/core/blobstorage/vdisk/query/query_stream.h b/ydb/core/blobstorage/vdisk/query/query_stream.h index 1f5236284d..960bc6ebee 100644 --- a/ydb/core/blobstorage/vdisk/query/query_stream.h +++ b/ydb/core/blobstorage/vdisk/query/query_stream.h @@ -4,7 +4,7 @@ #include <ydb/core/blobstorage/base/blobstorage_events.h> #include <ydb/core/blobstorage/vdisk/common/vdisk_events.h> #include <ydb/core/blobstorage/vdisk/hulldb/hull_ds_all_snap.h> -#include <library/cpp/streams/bzip2/bzip2.h> +#include <library/cpp/streams/bzip2/bzip2.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/vdisk/query/ya.make b/ydb/core/blobstorage/vdisk/query/ya.make index 4d638cf803..9381d1113b 100644 --- a/ydb/core/blobstorage/vdisk/query/ya.make +++ b/ydb/core/blobstorage/vdisk/query/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/streams/bzip2 + library/cpp/streams/bzip2 ydb/core/base ydb/core/blobstorage/base ydb/core/blobstorage/vdisk/hulldb/barriers diff --git a/ydb/core/blobstorage/vdisk/repl/blobstorage_replproxy.cpp b/ydb/core/blobstorage/vdisk/repl/blobstorage_replproxy.cpp index 1f82e552ba..d9e99b8db2 100644 --- a/ydb/core/blobstorage/vdisk/repl/blobstorage_replproxy.cpp +++ b/ydb/core/blobstorage/vdisk/repl/blobstorage_replproxy.cpp @@ -3,7 +3,7 @@ #include <ydb/core/blobstorage/vdisk/common/vdisk_events.h> #include <ydb/core/blobstorage/vdisk/common/vdisk_response.h> #include <ydb/core/blobstorage/backpressure/queue_backpressure_client.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> #include <util/generic/fwd.h> #include <util/generic/queue.h> #include <util/generic/deque.h> diff --git a/ydb/core/blobstorage/vdisk/repl/ut/ya.make b/ydb/core/blobstorage/vdisk/repl/ut/ya.make index 186f4213dc..0e3451bcd0 100644 --- a/ydb/core/blobstorage/vdisk/repl/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/repl/ut/ya.make @@ -10,7 +10,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage ydb/core/erasure diff --git a/ydb/core/blobstorage/vdisk/repl/ya.make b/ydb/core/blobstorage/vdisk/repl/ya.make index 8c23757890..4600e58b10 100644 --- a/ydb/core/blobstorage/vdisk/repl/ya.make +++ b/ydb/core/blobstorage/vdisk/repl/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(fomichev) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/monlib/service/pages ydb/core/base ydb/core/blobstorage/backpressure diff --git a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_monactors.cpp b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_monactors.cpp index 44b3c58c9c..bd129f21c7 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_monactors.cpp +++ b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_monactors.cpp @@ -3,9 +3,9 @@ #include "skeleton_mon_dbmainpage.h" #include "skeleton_mon_util.h" -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <library/cpp/monlib/service/pages/templates.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/vdisk/skeleton/ut/ya.make b/ydb/core/blobstorage/vdisk/skeleton/ut/ya.make index 67d78277da..690ac5346c 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/skeleton/ut/ya.make @@ -10,7 +10,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/blobstorage ydb/core/blobstorage/vdisk/common ydb/core/blobstorage/vdisk/skeleton diff --git a/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer.cpp b/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer.cpp index bf0179b4ed..51619ecf39 100644 --- a/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer.cpp +++ b/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer.cpp @@ -13,7 +13,7 @@ #include <ydb/core/blobstorage/vdisk/synclog/blobstorage_synclog_public_events.h> #include <library/cpp/monlib/service/pages/templates.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> using namespace NKikimrServices; using namespace NKikimr::NSyncer; diff --git a/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_scheduler.cpp b/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_scheduler.cpp index 92ae94e89f..31f02821e1 100644 --- a/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_scheduler.cpp +++ b/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_scheduler.cpp @@ -6,9 +6,9 @@ #include <ydb/core/blobstorage/vdisk/common/blobstorage_dblogcutter.h> #include <ydb/core/blobstorage/vdisk/common/blobstorage_status.h> -#include <library/cpp/actors/core/mon.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <library/cpp/monlib/service/pages/templates.h> #include <util/generic/queue.h> #include <util/generic/deque.h> diff --git a/ydb/core/blobstorage/vdisk/syncer/defs.h b/ydb/core/blobstorage/vdisk/syncer/defs.h index 49e51073af..9bf4a4062b 100644 --- a/ydb/core/blobstorage/vdisk/syncer/defs.h +++ b/ydb/core/blobstorage/vdisk/syncer/defs.h @@ -2,9 +2,9 @@ // unique tag to fix pragma once gcc glueing: ./ydb/core/blobstorage/vdisk/syncer/defs.h #include <ydb/core/base/defs.h> #include <ydb/core/base/logoblob.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/helpers/activeactors.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/helpers/activeactors.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/blobstorage/vdisk/syncer/guid_propagator.cpp b/ydb/core/blobstorage/vdisk/syncer/guid_propagator.cpp index 75be975307..d604ef4aca 100644 --- a/ydb/core/blobstorage/vdisk/syncer/guid_propagator.cpp +++ b/ydb/core/blobstorage/vdisk/syncer/guid_propagator.cpp @@ -2,7 +2,7 @@ #include "guid_proxywrite.h" #include <ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.h> #include <ydb/core/blobstorage/vdisk/common/vdisk_events.h> -#include <library/cpp/actors/helpers/activeactors.h> +#include <library/cpp/actors/helpers/activeactors.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/vdisk/syncer/guid_proxybase.h b/ydb/core/blobstorage/vdisk/syncer/guid_proxybase.h index ffdd4b26c7..cbe098a111 100644 --- a/ydb/core/blobstorage/vdisk/syncer/guid_proxybase.h +++ b/ydb/core/blobstorage/vdisk/syncer/guid_proxybase.h @@ -1,7 +1,7 @@ #pragma once #include "defs.h" #include <ydb/core/blobstorage/vdisk/common/vdisk_events.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/vdisk/syncer/guid_proxyobtain.cpp b/ydb/core/blobstorage/vdisk/syncer/guid_proxyobtain.cpp index 29f2e3bfbc..8b4dde7d2d 100644 --- a/ydb/core/blobstorage/vdisk/syncer/guid_proxyobtain.cpp +++ b/ydb/core/blobstorage/vdisk/syncer/guid_proxyobtain.cpp @@ -1,7 +1,7 @@ #include "guid_proxyobtain.h" #include "guid_proxybase.h" -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> using namespace NKikimrServices; diff --git a/ydb/core/blobstorage/vdisk/syncer/guid_proxywrite.cpp b/ydb/core/blobstorage/vdisk/syncer/guid_proxywrite.cpp index 8b2d29b061..3ffd678757 100644 --- a/ydb/core/blobstorage/vdisk/syncer/guid_proxywrite.cpp +++ b/ydb/core/blobstorage/vdisk/syncer/guid_proxywrite.cpp @@ -1,7 +1,7 @@ #include "guid_proxywrite.h" #include "guid_proxybase.h" -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> using namespace NKikimrServices; diff --git a/ydb/core/blobstorage/vdisk/syncer/guid_recovery.cpp b/ydb/core/blobstorage/vdisk/syncer/guid_recovery.cpp index d4dc97f9ab..29a316b100 100644 --- a/ydb/core/blobstorage/vdisk/syncer/guid_recovery.cpp +++ b/ydb/core/blobstorage/vdisk/syncer/guid_recovery.cpp @@ -4,7 +4,7 @@ #include "blobstorage_syncquorum.h" #include <ydb/core/blobstorage/vdisk/common/sublog.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> using namespace NKikimrServices; using namespace NKikimr::NSync; diff --git a/ydb/core/blobstorage/vdisk/syncer/syncer_job_actor.cpp b/ydb/core/blobstorage/vdisk/syncer/syncer_job_actor.cpp index c1a1629bf1..7e6e8e5d51 100644 --- a/ydb/core/blobstorage/vdisk/syncer/syncer_job_actor.cpp +++ b/ydb/core/blobstorage/vdisk/syncer/syncer_job_actor.cpp @@ -6,7 +6,7 @@ #include <ydb/core/blobstorage/vdisk/anubis_osiris/blobstorage_anubisrunner.h> #include <ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgreader.h> #include <ydb/core/base/interconnect_channels.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> using namespace NKikimrServices; using namespace NKikimr::NSyncer; diff --git a/ydb/core/blobstorage/vdisk/syncer/ut/ya.make b/ydb/core/blobstorage/vdisk/syncer/ut/ya.make index b5be2b2603..9841ee1f29 100644 --- a/ydb/core/blobstorage/vdisk/syncer/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/syncer/ut/ya.make @@ -10,7 +10,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/blobstorage ) diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogdata.h b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogdata.h index 15ee59bfe4..6659299ef2 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogdata.h +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogdata.h @@ -12,7 +12,7 @@ #include <ydb/core/protos/blobstorage_vdisk_internal.pb.h> #include <ydb/core/base/blobstorage.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/deque.h> #include <util/generic/queue.h> diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogdsk.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogdsk.cpp index 1a2fb95e1c..c80e3d6a62 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogdsk.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogdsk.cpp @@ -1,9 +1,9 @@ #include "blobstorage_synclogdsk.h" #include "blobstorage_synclog_private_events.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <library/cpp/monlib/service/pages/templates.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_syncloghttp.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_syncloghttp.cpp index cc10f0ceed..b08fb234f4 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_syncloghttp.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_syncloghttp.cpp @@ -4,7 +4,7 @@ #include <ydb/core/blobstorage/vdisk/common/vdisk_context.h> #include <ydb/core/blobstorage/vdisk/common/vdisk_mon.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <library/cpp/monlib/service/pages/templates.h> diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_syncloghttp.h b/ydb/core/blobstorage/vdisk/synclog/blobstorage_syncloghttp.h index cc8df3a897..980baaf9cb 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_syncloghttp.h +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_syncloghttp.h @@ -2,7 +2,7 @@ #include "defs.h" #include "blobstorage_synclogneighbors.h" -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgimpl.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgimpl.cpp index ec10a5c1e1..49838e538c 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgimpl.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgimpl.cpp @@ -1,7 +1,7 @@ #include "blobstorage_synclogmsgimpl.h" #include "codecs.h" -#include <library/cpp/codecs/pfor_codec.h> +#include <library/cpp/codecs/pfor_codec.h> #include <util/system/unaligned_mem.h> using namespace NCodecs; diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgimpl.h b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgimpl.h index 0b9251e516..dcc46e6445 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgimpl.h +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgimpl.h @@ -6,7 +6,7 @@ #include <util/generic/string.h> #include <util/generic/list.h> #include <util/thread/singleton.h> -#include <library/cpp/blockcodecs/codecs.h> +#include <library/cpp/blockcodecs/codecs.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgimpl_ut.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgimpl_ut.cpp index 344377c9a3..22d0d25e03 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgimpl_ut.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgimpl_ut.cpp @@ -96,9 +96,9 @@ Y_UNIT_TEST_SUITE(ReorderCodecTest) { } -#include <library/cpp/codecs/pfor_codec.h> -#include <library/cpp/codecs/huffman_codec.h> -#include <library/cpp/codecs/solar_codec.h> +#include <library/cpp/codecs/pfor_codec.h> +#include <library/cpp/codecs/huffman_codec.h> +#include <library/cpp/codecs/solar_codec.h> Y_UNIT_TEST_SUITE(CodecsTest) { diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgwriter.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgwriter.cpp index ab2b6dc161..00f7dbfb26 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgwriter.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogmsgwriter.cpp @@ -1,7 +1,7 @@ #include "blobstorage_synclogmsgwriter.h" #include "blobstorage_synclogmsgimpl.h" -#include <library/cpp/blockcodecs/codecs.h> +#include <library/cpp/blockcodecs/codecs.h> #include <util/thread/singleton.h> #include <util/generic/algorithm.h> diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogneighbors.h b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogneighbors.h index 72bb1c825d..e21d767b7d 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogneighbors.h +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogneighbors.h @@ -2,9 +2,9 @@ #include "defs.h" #include <ydb/core/blobstorage/vdisk/common/vdisk_syncneighbors.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/containers/intrusive_avl_tree/avltree.h> +#include <library/cpp/containers/intrusive_avl_tree/avltree.h> namespace NKikimr { diff --git a/ydb/core/blobstorage/vdisk/synclog/codecs.h b/ydb/core/blobstorage/vdisk/synclog/codecs.h index ed377c46b1..ae2fb06ede 100644 --- a/ydb/core/blobstorage/vdisk/synclog/codecs.h +++ b/ydb/core/blobstorage/vdisk/synclog/codecs.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/codecs/codecs.h> -#include <library/cpp/packedtypes/longs.h> +#include <library/cpp/codecs/codecs.h> +#include <library/cpp/packedtypes/longs.h> namespace NCodecs { diff --git a/ydb/core/blobstorage/vdisk/synclog/defs.h b/ydb/core/blobstorage/vdisk/synclog/defs.h index 392283b509..43d9aa4d6b 100644 --- a/ydb/core/blobstorage/vdisk/synclog/defs.h +++ b/ydb/core/blobstorage/vdisk/synclog/defs.h @@ -2,8 +2,8 @@ // unique tag to fix pragma once gcc glueing: ./ydb/core/blobstorage/vdisk/synclog/defs.h #include <ydb/core/base/defs.h> #include <ydb/core/base/logoblob.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/blobstorage/vdisk/synclog/ut/ya.make b/ydb/core/blobstorage/vdisk/synclog/ut/ya.make index 10e7e6886d..ebc8c7ec1d 100644 --- a/ydb/core/blobstorage/vdisk/synclog/ut/ya.make +++ b/ydb/core/blobstorage/vdisk/synclog/ut/ya.make @@ -10,7 +10,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion library/cpp/testing/unittest ydb/core/base ydb/core/blobstorage diff --git a/ydb/core/blobstorage/vdisk/synclog/ya.make b/ydb/core/blobstorage/vdisk/synclog/ya.make index 99fd493387..43322fd6a1 100644 --- a/ydb/core/blobstorage/vdisk/synclog/ya.make +++ b/ydb/core/blobstorage/vdisk/synclog/ya.make @@ -3,10 +3,10 @@ LIBRARY() OWNER(g:kikimr) PEERDIR( - library/cpp/actors/core - library/cpp/actors/interconnect - library/cpp/blockcodecs - library/cpp/codecs + library/cpp/actors/core + library/cpp/actors/interconnect + library/cpp/blockcodecs + library/cpp/codecs library/cpp/monlib/service/pages ydb/core/base ydb/core/blobstorage/base diff --git a/ydb/core/blockstore/core/blockstore.h b/ydb/core/blockstore/core/blockstore.h index bce840973f..c67788fa00 100644 --- a/ydb/core/blockstore/core/blockstore.h +++ b/ydb/core/blockstore/core/blockstore.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actorid.h> #include <ydb/core/base/blobstorage.h> #include <ydb/core/protos/blockstore_config.pb.h> diff --git a/ydb/core/blockstore/core/ya.make b/ydb/core/blockstore/core/ya.make index c192f4e56e..83b3c9d75d 100644 --- a/ydb/core/blockstore/core/ya.make +++ b/ydb/core/blockstore/core/ya.make @@ -3,7 +3,7 @@ LIBRARY() OWNER(g:kikimr) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/core/base ydb/core/protos ) diff --git a/ydb/core/client/flat_ut.cpp b/ydb/core/client/flat_ut.cpp index 362c052aa1..06b44e216a 100644 --- a/ydb/core/client/flat_ut.cpp +++ b/ydb/core/client/flat_ut.cpp @@ -9,8 +9,8 @@ #include <ydb/public/lib/deprecated/kicli/kicli.h> #include <ydb/core/engine/mkql_engine_flat.h> -#include <library/cpp/http/io/stream.h> -#include <library/cpp/http/server/http_ex.h> +#include <library/cpp/http/io/stream.h> +#include <library/cpp/http/server/http_ex.h> #include <library/cpp/testing/unittest/tests_data.h> #include <library/cpp/testing/unittest/registar.h> #include <google/protobuf/text_format.h> diff --git a/ydb/core/client/minikql_compile/db_key_resolver.h b/ydb/core/client/minikql_compile/db_key_resolver.h index e748525fa8..83518a3f56 100644 --- a/ydb/core/client/minikql_compile/db_key_resolver.h +++ b/ydb/core/client/minikql_compile/db_key_resolver.h @@ -1,9 +1,9 @@ #pragma once -#include <library/cpp/actors/core/actorid.h> -#include <library/cpp/actors/core/event.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/event.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/events.h> #include <ydb/core/scheme/tablet_scheme_defs.h> #include <ydb/core/scheme/scheme_tabledefs.h> diff --git a/ydb/core/client/minikql_compile/mkql_compile_service.cpp b/ydb/core/client/minikql_compile/mkql_compile_service.cpp index e01d61a22c..6532890ad8 100644 --- a/ydb/core/client/minikql_compile/mkql_compile_service.cpp +++ b/ydb/core/client/minikql_compile/mkql_compile_service.cpp @@ -1,9 +1,9 @@ #include "mkql_compile_service.h" -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/executor_thread.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/executor_thread.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <ydb/core/client/scheme_cache_lib/yql_db_scheme_resolver.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/tx/scheme_board/cache.h> diff --git a/ydb/core/client/minikql_compile/mkql_compile_service.h b/ydb/core/client/minikql_compile/mkql_compile_service.h index 4b0aca1491..6014226c33 100644 --- a/ydb/core/client/minikql_compile/mkql_compile_service.h +++ b/ydb/core/client/minikql_compile/mkql_compile_service.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/event_local.h> #include <ydb/core/client/minikql_compile/yql_expr_minikql.h> #include <ydb/core/client/scheme_cache_lib/yql_db_scheme_resolver.h> diff --git a/ydb/core/client/minikql_compile/ya.make b/ydb/core/client/minikql_compile/ya.make index a8bd3ca518..c039a7362d 100644 --- a/ydb/core/client/minikql_compile/ya.make +++ b/ydb/core/client/minikql_compile/ya.make @@ -15,7 +15,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/threading/future ydb/core/base ydb/core/engine diff --git a/ydb/core/client/minikql_compile/yql_expr_minikql.cpp b/ydb/core/client/minikql_compile/yql_expr_minikql.cpp index 76f38bf35c..60dc6f5a02 100644 --- a/ydb/core/client/minikql_compile/yql_expr_minikql.cpp +++ b/ydb/core/client/minikql_compile/yql_expr_minikql.cpp @@ -3,9 +3,9 @@ #include "compile_context.h" #include "db_key_resolver.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/executor_thread.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/executor_thread.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/domain.h> #include <ydb/core/kqp/provider/yql_kikimr_provider_impl.h> diff --git a/ydb/core/client/minikql_compile/yql_expr_minikql.h b/ydb/core/client/minikql_compile/yql_expr_minikql.h index ab6011c105..0f2573a1c8 100644 --- a/ydb/core/client/minikql_compile/yql_expr_minikql.h +++ b/ydb/core/client/minikql_compile/yql_expr_minikql.h @@ -4,8 +4,8 @@ #include "compile_context.h" #include "db_key_resolver.h" -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/events.h> #include <ydb/library/yql/ast/yql_expr.h> #include <library/cpp/threading/future/future.h> diff --git a/ydb/core/client/scheme_cache_lib/ya.make b/ydb/core/client/scheme_cache_lib/ya.make index 3140bad5a2..e009cb78c1 100644 --- a/ydb/core/client/scheme_cache_lib/ya.make +++ b/ydb/core/client/scheme_cache_lib/ya.make @@ -10,7 +10,7 @@ SRCS( PEERDIR( contrib/libs/protobuf library/cpp/actors/core - library/cpp/grpc/client + library/cpp/grpc/client library/cpp/threading/future ydb/core/base ydb/core/client/minikql_compile diff --git a/ydb/core/client/scheme_cache_lib/yql_db_scheme_resolver.cpp b/ydb/core/client/scheme_cache_lib/yql_db_scheme_resolver.cpp index eb74fa36e9..f1aeea2679 100644 --- a/ydb/core/client/scheme_cache_lib/yql_db_scheme_resolver.cpp +++ b/ydb/core/client/scheme_cache_lib/yql_db_scheme_resolver.cpp @@ -4,7 +4,7 @@ #include <ydb/core/tx/schemeshard/schemeshard.h> #include <ydb/core/client/minikql_compile/yql_expr_minikql.h> -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> namespace NKikimr { namespace NSchCache { diff --git a/ydb/core/client/server/grpc_base.h b/ydb/core/client/server/grpc_base.h index e104ef0c1b..141f32d3a4 100644 --- a/ydb/core/client/server/grpc_base.h +++ b/ydb/core/client/server/grpc_base.h @@ -3,4 +3,4 @@ #include <ydb/core/protos/grpc.grpc.pb.h> #include <ydb/core/base/counters.h> -#include <library/cpp/uri/uri.h> +#include <library/cpp/uri/uri.h> diff --git a/ydb/core/client/server/grpc_proxy_status.cpp b/ydb/core/client/server/grpc_proxy_status.cpp index 827335ad40..1361912b0c 100644 --- a/ydb/core/client/server/grpc_proxy_status.cpp +++ b/ydb/core/client/server/grpc_proxy_status.cpp @@ -1,9 +1,9 @@ #include "grpc_proxy_status.h" #include "msgbus_servicereq.h" -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <ydb/core/base/tablet_resolver.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/base/appdata.h> diff --git a/ydb/core/client/server/grpc_proxy_status.h b/ydb/core/client/server/grpc_proxy_status.h index 13ea930262..d77fb7a137 100644 --- a/ydb/core/client/server/grpc_proxy_status.h +++ b/ydb/core/client/server/grpc_proxy_status.h @@ -1,9 +1,9 @@ #pragma once //////////////////////////////////////////// -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/event.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/event.h> #include <ydb/core/base/blobstorage.h> #include <ydb/core/protos/grpc_status_proxy.pb.h> diff --git a/ydb/core/client/server/grpc_server.cpp b/ydb/core/client/server/grpc_server.cpp index aa122da36a..dff18aa1bb 100644 --- a/ydb/core/client/server/grpc_server.cpp +++ b/ydb/core/client/server/grpc_server.cpp @@ -7,7 +7,7 @@ #include <library/cpp/grpc/server/grpc_counters.h> #include <library/cpp/grpc/server/grpc_async_ctx_base.h> -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_writer.h> #include <util/string/join.h> diff --git a/ydb/core/client/server/grpc_server.h b/ydb/core/client/server/grpc_server.h index 2f2ae1da6b..9a013c2392 100644 --- a/ydb/core/client/server/grpc_server.h +++ b/ydb/core/client/server/grpc_server.h @@ -2,8 +2,8 @@ #include <ydb/core/protos/grpc.grpc.pb.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <library/cpp/grpc/server/grpc_server.h> #include <ydb/public/lib/deprecated/client/grpc_client.h> #include <ydb/public/lib/base/defs.h> diff --git a/ydb/core/client/server/msgbus_http_server.cpp b/ydb/core/client/server/msgbus_http_server.cpp index e535ebe335..d14c51780f 100644 --- a/ydb/core/client/server/msgbus_http_server.cpp +++ b/ydb/core/client/server/msgbus_http_server.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/messagebus/handler.h> -#include <library/cpp/protobuf/json/json2proto.h> -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/messagebus/handler.h> +#include <library/cpp/protobuf/json/json2proto.h> +#include <library/cpp/actors/core/actorsystem.h> #include <ydb/public/lib/base/msgbus.h> #include "msgbus_http_server.h" #include "http_ping.h" diff --git a/ydb/core/client/server/msgbus_http_server.h b/ydb/core/client/server/msgbus_http_server.h index 911978c422..5c8326abc1 100644 --- a/ydb/core/client/server/msgbus_http_server.h +++ b/ydb/core/client/server/msgbus_http_server.h @@ -3,7 +3,7 @@ #include <library/cpp/monlib/service/monservice.h> #include <library/cpp/monlib/service/pages/mon_page.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/helpers/mon_histogram_helper.h> +#include <library/cpp/actors/helpers/mon_histogram_helper.h> #include <ydb/public/lib/base/msgbus.h> #include <ydb/core/base/appdata.h> diff --git a/ydb/core/client/server/msgbus_server.h b/ydb/core/client/server/msgbus_server.h index 3d40fc9001..1e485847c2 100644 --- a/ydb/core/client/server/msgbus_server.h +++ b/ydb/core/client/server/msgbus_server.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <ydb/public/lib/base/defs.h> #include <ydb/public/lib/base/msgbus.h> #include "msgbus_http_server.h" diff --git a/ydb/core/client/server/msgbus_server_cms.cpp b/ydb/core/client/server/msgbus_server_cms.cpp index 53ada2a3fa..0b428b799a 100644 --- a/ydb/core/client/server/msgbus_server_cms.cpp +++ b/ydb/core/client/server/msgbus_server_cms.cpp @@ -1,8 +1,8 @@ #include "msgbus_server_request.h" #include "msgbus_securereq.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/cms/cms.h> diff --git a/ydb/core/client/server/msgbus_server_console.cpp b/ydb/core/client/server/msgbus_server_console.cpp index 66bc0b02eb..3759b0c74b 100644 --- a/ydb/core/client/server/msgbus_server_console.cpp +++ b/ydb/core/client/server/msgbus_server_console.cpp @@ -1,8 +1,8 @@ #include "msgbus_server_request.h" #include "msgbus_securereq.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/cms/console/console.h> diff --git a/ydb/core/client/server/msgbus_server_db.cpp b/ydb/core/client/server/msgbus_server_db.cpp index 08f3d71786..d9e69c5bdd 100644 --- a/ydb/core/client/server/msgbus_server_db.cpp +++ b/ydb/core/client/server/msgbus_server_db.cpp @@ -1,7 +1,7 @@ #include "msgbus_server.h" #include "msgbus_server_proxy.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/path.h> #include <ydb/core/base/tablet_pipe.h> @@ -17,9 +17,9 @@ #include <ydb/library/yql/minikql/mkql_node_serialization.h> #include <ydb/library/yql/minikql/mkql_function_registry.h> -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_value.h> -#include <library/cpp/protobuf/json/json2proto.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_value.h> +#include <library/cpp/protobuf/json/json2proto.h> namespace NKikimr { diff --git a/ydb/core/client/server/msgbus_server_ic_debug.cpp b/ydb/core/client/server/msgbus_server_ic_debug.cpp index 7757757fee..116338ffef 100644 --- a/ydb/core/client/server/msgbus_server_ic_debug.cpp +++ b/ydb/core/client/server/msgbus_server_ic_debug.cpp @@ -1,7 +1,7 @@ #include "msgbus_servicereq.h" -#include <library/cpp/actors/interconnect/load.h> -#include <library/cpp/actors/interconnect/slowpoke_actor.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/load.h> +#include <library/cpp/actors/interconnect/slowpoke_actor.h> +#include <library/cpp/actors/core/interconnect.h> namespace NKikimr { namespace NMsgBusProxy { diff --git a/ydb/core/client/server/msgbus_server_node_registration.cpp b/ydb/core/client/server/msgbus_server_node_registration.cpp index a3dda6092d..a850edded7 100644 --- a/ydb/core/client/server/msgbus_server_node_registration.cpp +++ b/ydb/core/client/server/msgbus_server_node_registration.cpp @@ -1,8 +1,8 @@ #include "msgbus_servicereq.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/mind/node_broker.h> diff --git a/ydb/core/client/server/msgbus_server_persqueue.cpp b/ydb/core/client/server/msgbus_server_persqueue.cpp index 78b83ef3a3..3bbcae229a 100644 --- a/ydb/core/client/server/msgbus_server_persqueue.cpp +++ b/ydb/core/client/server/msgbus_server_persqueue.cpp @@ -3,8 +3,8 @@ #include "msgbus_server_persqueue.h" #include "msgbus_server_pq_metacache.h" #include "msgbus_server_pq_metarequest.h" -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <ydb/core/persqueue/events/global.h> #include <ydb/core/base/appdata.h> #include <ydb/core/tx/tx_proxy/proxy.h> diff --git a/ydb/core/client/server/msgbus_server_persqueue.h b/ydb/core/client/server/msgbus_server_persqueue.h index 52c67832e4..cf0eda3caf 100644 --- a/ydb/core/client/server/msgbus_server_persqueue.h +++ b/ydb/core/client/server/msgbus_server_persqueue.h @@ -7,7 +7,7 @@ #include <ydb/core/persqueue/events/global.h> #include <ydb/core/tx/scheme_cache/scheme_cache.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> #include <util/generic/ptr.h> #include <util/system/compiler.h> diff --git a/ydb/core/client/server/msgbus_server_pq_metacache.h b/ydb/core/client/server/msgbus_server_pq_metacache.h index 6c12b76b04..4360404d3c 100644 --- a/ydb/core/client/server/msgbus_server_pq_metacache.h +++ b/ydb/core/client/server/msgbus_server_pq_metacache.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/event_local.h> #include <ydb/core/tx/schemeshard/schemeshard.h> #include <ydb/core/tx/scheme_cache/scheme_cache.h> diff --git a/ydb/core/client/server/msgbus_server_proxy.cpp b/ydb/core/client/server/msgbus_server_proxy.cpp index 7f3146d21a..e8a9c82f4a 100644 --- a/ydb/core/client/server/msgbus_server_proxy.cpp +++ b/ydb/core/client/server/msgbus_server_proxy.cpp @@ -3,7 +3,7 @@ #include "msgbus_server_proxy.h" #include "msgbus_securereq.h" -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/counters.h> #include <ydb/core/base/kikimr_issue.h> diff --git a/ydb/core/client/server/msgbus_server_proxy.h b/ydb/core/client/server/msgbus_server_proxy.h index cb9f9c19d3..d9d940b123 100644 --- a/ydb/core/client/server/msgbus_server_proxy.h +++ b/ydb/core/client/server/msgbus_server_proxy.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/base/counters.h> #include <ydb/library/aclib/aclib.h> #include "msgbus_server.h" diff --git a/ydb/core/client/server/msgbus_server_resolve_node.cpp b/ydb/core/client/server/msgbus_server_resolve_node.cpp index 762df383cb..f70e35d1c6 100644 --- a/ydb/core/client/server/msgbus_server_resolve_node.cpp +++ b/ydb/core/client/server/msgbus_server_resolve_node.cpp @@ -1,6 +1,6 @@ #include "msgbus_servicereq.h" -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> namespace NKikimr { namespace NMsgBusProxy { diff --git a/ydb/core/client/server/msgbus_server_tablet_state.cpp b/ydb/core/client/server/msgbus_server_tablet_state.cpp index c8582fc550..76b80c0a07 100644 --- a/ydb/core/client/server/msgbus_server_tablet_state.cpp +++ b/ydb/core/client/server/msgbus_server_tablet_state.cpp @@ -1,9 +1,9 @@ #include "msgbus_server.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <ydb/core/base/appdata.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/base/tablet_types.h> diff --git a/ydb/core/client/server/msgbus_server_tracer.h b/ydb/core/client/server/msgbus_server_tracer.h index 57a3812f5d..bfb0d35ad1 100644 --- a/ydb/core/client/server/msgbus_server_tracer.h +++ b/ydb/core/client/server/msgbus_server_tracer.h @@ -2,11 +2,11 @@ #include <util/stream/file.h> #include <util/thread/pool.h> #include <util/generic/buffer.h> -#include <library/cpp/messagebus/handler.h> -#include <library/cpp/messagebus/message.h> -#include <library/cpp/messagebus/defs.h> +#include <library/cpp/messagebus/handler.h> +#include <library/cpp/messagebus/message.h> +#include <library/cpp/messagebus/defs.h> #include <ydb/public/lib/base/msgbus.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include "msgbus_server.h" #include <util/system/atomic.h> diff --git a/ydb/core/client/server/msgbus_server_whoami.cpp b/ydb/core/client/server/msgbus_server_whoami.cpp index d001154818..35765e758d 100644 --- a/ydb/core/client/server/msgbus_server_whoami.cpp +++ b/ydb/core/client/server/msgbus_server_whoami.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/base/ticket_parser.h> #include "msgbus_server.h" diff --git a/ydb/core/client/server/msgbus_servicereq.h b/ydb/core/client/server/msgbus_servicereq.h index 704a231dd1..b01dd9db0c 100644 --- a/ydb/core/client/server/msgbus_servicereq.h +++ b/ydb/core/client/server/msgbus_servicereq.h @@ -1,8 +1,8 @@ #pragma once #include "msgbus_server.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/base/appdata.h> #include <ydb/public/lib/base/msgbus.h> #include <util/network/address.h> diff --git a/ydb/core/client/server/msgbus_tabletreq.h b/ydb/core/client/server/msgbus_tabletreq.h index f173ae9097..18de611e78 100644 --- a/ydb/core/client/server/msgbus_tabletreq.h +++ b/ydb/core/client/server/msgbus_tabletreq.h @@ -3,9 +3,9 @@ #include <ydb/public/lib/base/msgbus.h> #include <ydb/core/base/tablet.h> #include <ydb/core/base/tablet_pipe.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/protos/services.pb.h> #include <util/generic/hash_set.h> #include <util/generic/vector.h> diff --git a/ydb/core/client/server/ya.make b/ydb/core/client/server/ya.make index 8cbeec21b7..972759a4c7 100644 --- a/ydb/core/client/server/ya.make +++ b/ydb/core/client/server/ya.make @@ -65,13 +65,13 @@ SRCS( ) PEERDIR( - library/cpp/actors/helpers - library/cpp/json - library/cpp/messagebus - library/cpp/messagebus/protobuf + library/cpp/actors/helpers + library/cpp/json + library/cpp/messagebus + library/cpp/messagebus/protobuf library/cpp/monlib/messagebus - library/cpp/protobuf/json - library/cpp/protobuf/util + library/cpp/protobuf/json + library/cpp/protobuf/util library/cpp/threading/future ydb/core/actorlib_impl ydb/core/base diff --git a/ydb/core/client/ut/ya.make b/ydb/core/client/ut/ya.make index 5d839f47c8..c8ee3bd679 100644 --- a/ydb/core/client/ut/ya.make +++ b/ydb/core/client/ut/ya.make @@ -28,7 +28,7 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/regex/pcre + library/cpp/regex/pcre library/cpp/svnversion ydb/core/client/scheme_cache_lib ydb/core/tablet_flat/test/libs/rows diff --git a/ydb/core/cms/base_handler.h b/ydb/core/cms/base_handler.h index b5aa12761b..8d9d2c25b3 100644 --- a/ydb/core/cms/base_handler.h +++ b/ydb/core/cms/base_handler.h @@ -2,7 +2,7 @@ #include "defs.h" -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> namespace NKikimr { namespace NCms { diff --git a/ydb/core/cms/cluster_info.h b/ydb/core/cms/cluster_info.h index af5fe24af8..3fa538c8c8 100644 --- a/ydb/core/cms/cluster_info.h +++ b/ydb/core/cms/cluster_info.h @@ -5,7 +5,7 @@ #include "downtime.h" #include "services.h" -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <ydb/core/base/blobstorage.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/blobstorage/base/blobstorage_vdiskid.h> diff --git a/ydb/core/cms/cluster_info_ut.cpp b/ydb/core/cms/cluster_info_ut.cpp index 8b9d3b3d65..7fa615c257 100644 --- a/ydb/core/cms/cluster_info_ut.cpp +++ b/ydb/core/cms/cluster_info_ut.cpp @@ -1,7 +1,7 @@ #include "cluster_info.h" #include "ut_helpers.h" -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/ydb/core/cms/cms.cpp b/ydb/core/cms/cms.cpp index 0a205024e3..ceb72e09ae 100644 --- a/ydb/core/cms/cms.cpp +++ b/ydb/core/cms/cms.cpp @@ -9,7 +9,7 @@ #include <ydb/core/base/ticket_parser.h> #include <ydb/core/tablet_flat/tablet_flat_executed.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <util/generic/serialized_enum.h> #include <util/string/join.h> diff --git a/ydb/core/cms/cms.h b/ydb/core/cms/cms.h index 25cb8ef024..6d06130da5 100644 --- a/ydb/core/cms/cms.h +++ b/ydb/core/cms/cms.h @@ -4,8 +4,8 @@ #include "cluster_info.h" #include "cms_state.h" -#include <library/cpp/actors/interconnect/events_local.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/interconnect/events_local.h> +#include <library/cpp/actors/core/actor.h> #include <ydb/core/protos/cms.pb.h> /** diff --git a/ydb/core/cms/cms_impl.h b/ydb/core/cms/cms_impl.h index 4813888490..9bdea60752 100644 --- a/ydb/core/cms/cms_impl.h +++ b/ydb/core/cms/cms_impl.h @@ -7,8 +7,8 @@ #include "services.h" #include "walle.h" -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/cms/console/console.h> #include <ydb/core/tablet_flat/tablet_flat_executed.h> diff --git a/ydb/core/cms/cms_tx_load_state.cpp b/ydb/core/cms/cms_tx_load_state.cpp index eb144dc0de..51d280bce5 100644 --- a/ydb/core/cms/cms_tx_load_state.cpp +++ b/ydb/core/cms/cms_tx_load_state.cpp @@ -3,7 +3,7 @@ #include <google/protobuf/text_format.h> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/svnversion/svnversion.h> #include <util/system/hostname.h> diff --git a/ydb/core/cms/cms_ut.cpp b/ydb/core/cms/cms_ut.cpp index 9842fb7156..e62b9244dc 100644 --- a/ydb/core/cms/cms_ut.cpp +++ b/ydb/core/cms/cms_ut.cpp @@ -8,7 +8,7 @@ #include <ydb/core/base/ticket_parser.h> #include <ydb/core/testlib/tablet_helpers.h> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/svnversion/svnversion.h> #include <library/cpp/testing/unittest/registar.h> #include <util/system/hostname.h> diff --git a/ydb/core/cms/cms_ut_common.cpp b/ydb/core/cms/cms_ut_common.cpp index b458fe672c..bc684869e4 100644 --- a/ydb/core/cms/cms_ut_common.cpp +++ b/ydb/core/cms/cms_ut_common.cpp @@ -11,8 +11,8 @@ #include <ydb/core/testlib/tablet_helpers.h> #include <google/protobuf/text_format.h> -#include <library/cpp/malloc/api/malloc.h> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/svnversion/svnversion.h> #include <library/cpp/testing/unittest/registar.h> #include <util/string/subst.h> diff --git a/ydb/core/cms/console/config_helpers.cpp b/ydb/core/cms/console/config_helpers.cpp index 6d5a81beaf..a0b0261bea 100644 --- a/ydb/core/cms/console/config_helpers.cpp +++ b/ydb/core/cms/console/config_helpers.cpp @@ -7,7 +7,7 @@ #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/mind/tenant_pool.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <util/string/join.h> #include <util/system/hostname.h> diff --git a/ydb/core/cms/console/configs_dispatcher.cpp b/ydb/core/cms/console/configs_dispatcher.cpp index 8e50754239..023bffb8d9 100644 --- a/ydb/core/cms/console/configs_dispatcher.cpp +++ b/ydb/core/cms/console/configs_dispatcher.cpp @@ -7,8 +7,8 @@ #include <ydb/core/mind/tenant_pool.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <util/generic/bitmap.h> #include <util/generic/ptr.h> diff --git a/ydb/core/cms/console/console_configs_manager.h b/ydb/core/cms/console/console_configs_manager.h index 2dca13be26..304a3afbee 100644 --- a/ydb/core/cms/console/console_configs_manager.h +++ b/ydb/core/cms/console/console_configs_manager.h @@ -11,8 +11,8 @@ #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/tablet_flat/tablet_flat_executed.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/interconnect/interconnect.h> namespace NKikimr { namespace NConsole { diff --git a/ydb/core/cms/console/console_configs_provider.cpp b/ydb/core/cms/console/console_configs_provider.cpp index 4ba6f46033..0727887d68 100644 --- a/ydb/core/cms/console/console_configs_provider.cpp +++ b/ydb/core/cms/console/console_configs_provider.cpp @@ -5,7 +5,7 @@ #include <ydb/core/base/appdata.h> #include <ydb/core/cms/console/validators/registry.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> namespace NKikimr { namespace NConsole { diff --git a/ydb/core/cms/console/console_configs_provider.h b/ydb/core/cms/console/console_configs_provider.h index ddb74d52d4..1e9c7d3da6 100644 --- a/ydb/core/cms/console/console_configs_provider.h +++ b/ydb/core/cms/console/console_configs_provider.h @@ -9,7 +9,7 @@ #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/tablet_flat/tablet_flat_executed.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NConsole { diff --git a/ydb/core/cms/console/console_impl.h b/ydb/core/cms/console/console_impl.h index 0894337c3e..8b873942bc 100644 --- a/ydb/core/cms/console/console_impl.h +++ b/ydb/core/cms/console/console_impl.h @@ -15,7 +15,7 @@ #include <ydb/library/yql/public/issue/protos/issue_severity.pb.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/set.h> diff --git a/ydb/core/cms/console/console_tenants_manager.h b/ydb/core/cms/console/console_tenants_manager.h index a21615dd62..5f6a6eb517 100644 --- a/ydb/core/cms/console/console_tenants_manager.h +++ b/ydb/core/cms/console/console_tenants_manager.h @@ -21,7 +21,7 @@ #include <ydb/library/yql/public/issue/protos/issue_severity.pb.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/set.h> diff --git a/ydb/core/cms/console/immediate_controls_configurator.cpp b/ydb/core/cms/console/immediate_controls_configurator.cpp index af3ad24217..c8359dd03a 100644 --- a/ydb/core/cms/console/immediate_controls_configurator.cpp +++ b/ydb/core/cms/console/immediate_controls_configurator.cpp @@ -5,7 +5,7 @@ #include <ydb/core/base/appdata.h> #include <ydb/core/protos/config.pb.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> namespace NKikimr { namespace NConsole { diff --git a/ydb/core/cms/console/log_settings_configurator.cpp b/ydb/core/cms/console/log_settings_configurator.cpp index 11d41e245e..ef97929cd8 100644 --- a/ydb/core/cms/console/log_settings_configurator.cpp +++ b/ydb/core/cms/console/log_settings_configurator.cpp @@ -2,7 +2,7 @@ #include "console.h" #include "log_settings_configurator.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <util/system/file.h> #include <util/system/fs.h> #include <util/stream/file.h> diff --git a/ydb/core/cms/console/net_classifier_updater.cpp b/ydb/core/cms/console/net_classifier_updater.cpp index 121a65efc3..2d7dfc2276 100644 --- a/ydb/core/cms/console/net_classifier_updater.cpp +++ b/ydb/core/cms/console/net_classifier_updater.cpp @@ -3,9 +3,9 @@ #include <ydb/core/base/appdata.h> #include <ydb/core/base/tablet_pipe.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/http/http_proxy.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/http/http_proxy.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <library/cpp/json/json_reader.h> #include <util/stream/zlib.h> diff --git a/ydb/core/cms/console/net_classifier_updater_ut.cpp b/ydb/core/cms/console/net_classifier_updater_ut.cpp index da41ee51f2..8bd58aa05d 100644 --- a/ydb/core/cms/console/net_classifier_updater_ut.cpp +++ b/ydb/core/cms/console/net_classifier_updater_ut.cpp @@ -4,9 +4,9 @@ #include <ydb/core/cms/console/net_classifier_updater.h> #include <ydb/core/testlib/test_client.h> -#include <library/cpp/actors/http/http_proxy.cpp> +#include <library/cpp/actors/http/http_proxy.cpp> -#include <library/cpp/protobuf/util/is_equal.h> +#include <library/cpp/protobuf/util/is_equal.h> #include <library/cpp/testing/unittest/tests_data.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/ydb/core/cms/console/shared_cache_configurator.cpp b/ydb/core/cms/console/shared_cache_configurator.cpp index 6011814849..79bfcfdaa5 100644 --- a/ydb/core/cms/console/shared_cache_configurator.cpp +++ b/ydb/core/cms/console/shared_cache_configurator.cpp @@ -4,7 +4,7 @@ #include <ydb/core/tablet_flat/shared_sausagecache.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> namespace NKikimr { namespace NConsole { diff --git a/ydb/core/cms/console/ut/ya.make b/ydb/core/cms/console/ut/ya.make index 9f42e18427..950ef50a50 100644 --- a/ydb/core/cms/console/ut/ya.make +++ b/ydb/core/cms/console/ut/ya.make @@ -18,9 +18,9 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/protobuf/util - library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/protobuf/util + library/cpp/regex/pcre + library/cpp/svnversion ydb/core/testlib ) diff --git a/ydb/core/cms/console/validators/validator_nameservice.cpp b/ydb/core/cms/console/validators/validator_nameservice.cpp index 0867be3813..7942db86e9 100644 --- a/ydb/core/cms/console/validators/validator_nameservice.cpp +++ b/ydb/core/cms/console/validators/validator_nameservice.cpp @@ -3,7 +3,7 @@ #include <ydb/core/base/localdb.h> #include <ydb/core/protos/console_config.pb.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <util/string/builder.h> diff --git a/ydb/core/cms/console/ya.make b/ydb/core/cms/console/ya.make index e33d3fc19a..c9a1972963 100644 --- a/ydb/core/cms/console/ya.make +++ b/ydb/core/cms/console/ya.make @@ -69,8 +69,8 @@ SRCS( ) PEERDIR( - library/cpp/actors/core - library/cpp/actors/http + library/cpp/actors/core + library/cpp/actors/http ydb/core/actorlib_impl ydb/core/base ydb/core/blobstorage diff --git a/ydb/core/cms/http.cpp b/ydb/core/cms/http.cpp index 648d864b6e..08604d70b6 100644 --- a/ydb/core/cms/http.cpp +++ b/ydb/core/cms/http.cpp @@ -13,11 +13,11 @@ #include <ydb/core/base/appdata.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/mon.h> -#include <library/cpp/mime/types/mime.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/mon.h> +#include <library/cpp/mime/types/mime.h> +#include <library/cpp/resource/resource.h> namespace NKikimr { namespace NCms { diff --git a/ydb/core/cms/http.h b/ydb/core/cms/http.h index 1401d2b89b..ab57e22249 100644 --- a/ydb/core/cms/http.h +++ b/ydb/core/cms/http.h @@ -2,7 +2,7 @@ #include "defs.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr { namespace NCms { diff --git a/ydb/core/cms/json_proxy.h b/ydb/core/cms/json_proxy.h index 185d0ce01b..6035aa03ed 100644 --- a/ydb/core/cms/json_proxy.h +++ b/ydb/core/cms/json_proxy.h @@ -4,19 +4,19 @@ #include <ydb/core/base/defs.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/cms/cms.h> #include <ydb/core/cms/console/console.h> #include <ydb/core/tx/datashard/datashard.h> -#include <library/cpp/protobuf/json/json2proto.h> -#include <library/cpp/protobuf/json/proto2json.h> +#include <library/cpp/protobuf/json/json2proto.h> +#include <library/cpp/protobuf/json/proto2json.h> #include <iostream> diff --git a/ydb/core/cms/json_proxy_proto.h b/ydb/core/cms/json_proxy_proto.h index b1b87f30cd..cb93575369 100644 --- a/ydb/core/cms/json_proxy_proto.h +++ b/ydb/core/cms/json_proxy_proto.h @@ -6,12 +6,12 @@ #include <ydb/core/mon/mon.h> #include <google/protobuf/util/json_util.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/mon.h> -#include <library/cpp/json/json_value.h> -#include <library/cpp/json/json_reader.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/mon.h> +#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_reader.h> #include <library/cpp/json/json_writer.h> #include <util/generic/serialized_enum.h> diff --git a/ydb/core/cms/sentinel.cpp b/ydb/core/cms/sentinel.cpp index 638b78fe09..146cc20bbb 100644 --- a/ydb/core/cms/sentinel.cpp +++ b/ydb/core/cms/sentinel.cpp @@ -9,9 +9,9 @@ #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> #include <util/generic/algorithm.h> #include <util/generic/hash_set.h> diff --git a/ydb/core/cms/ut/ya.make b/ydb/core/cms/ut/ya.make index 91fb1cd823..b3879b0d63 100644 --- a/ydb/core/cms/ut/ya.make +++ b/ydb/core/cms/ut/ya.make @@ -15,7 +15,7 @@ TIMEOUT(600) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/testlib ) diff --git a/ydb/core/cms/ut_sentinel/ya.make b/ydb/core/cms/ut_sentinel/ya.make index 773d06889a..4cb2835ff7 100644 --- a/ydb/core/cms/ut_sentinel/ya.make +++ b/ydb/core/cms/ut_sentinel/ya.make @@ -11,7 +11,7 @@ TIMEOUT(600) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/testlib ) diff --git a/ydb/core/cms/walle_api_handler.cpp b/ydb/core/cms/walle_api_handler.cpp index 7b62f3275a..fb24fe56b1 100644 --- a/ydb/core/cms/walle_api_handler.cpp +++ b/ydb/core/cms/walle_api_handler.cpp @@ -1,16 +1,16 @@ #include "walle.h" -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/mon/mon.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/cms/cms.h> -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_writer.h> namespace NKikimr { namespace NCms { diff --git a/ydb/core/cms/walle_check_task_adapter.cpp b/ydb/core/cms/walle_check_task_adapter.cpp index e5570c9af9..8ea2c68948 100644 --- a/ydb/core/cms/walle_check_task_adapter.cpp +++ b/ydb/core/cms/walle_check_task_adapter.cpp @@ -1,7 +1,7 @@ #include "walle.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NCms { diff --git a/ydb/core/cms/walle_create_task_adapter.cpp b/ydb/core/cms/walle_create_task_adapter.cpp index 56989e2db0..f44e4502d9 100644 --- a/ydb/core/cms/walle_create_task_adapter.cpp +++ b/ydb/core/cms/walle_create_task_adapter.cpp @@ -2,8 +2,8 @@ #include "info_collector.h" #include "cms_impl.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NCms { diff --git a/ydb/core/cms/walle_list_tasks_adapter.cpp b/ydb/core/cms/walle_list_tasks_adapter.cpp index d256294cc1..3101185e5b 100644 --- a/ydb/core/cms/walle_list_tasks_adapter.cpp +++ b/ydb/core/cms/walle_list_tasks_adapter.cpp @@ -1,7 +1,7 @@ #include "walle.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NCms { diff --git a/ydb/core/cms/walle_remove_task_adapter.cpp b/ydb/core/cms/walle_remove_task_adapter.cpp index 899d484825..2abe821a54 100644 --- a/ydb/core/cms/walle_remove_task_adapter.cpp +++ b/ydb/core/cms/walle_remove_task_adapter.cpp @@ -1,7 +1,7 @@ #include "walle.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NCms { diff --git a/ydb/core/cms/ya.make b/ydb/core/cms/ya.make index b341c4a0d0..cc759fc947 100644 --- a/ydb/core/cms/ya.make +++ b/ydb/core/cms/ya.make @@ -88,7 +88,7 @@ RESOURCE( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/core/actorlib_impl ydb/core/base ydb/core/blobstorage diff --git a/ydb/core/control/immediate_control_board_actor.h b/ydb/core/control/immediate_control_board_actor.h index 0b2cff4cf6..36342498cc 100644 --- a/ydb/core/control/immediate_control_board_actor.h +++ b/ydb/core/control/immediate_control_board_actor.h @@ -3,8 +3,8 @@ #include "immediate_control_board_impl.h" #include <library/cpp/monlib/dynamic_counters/counters.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> namespace NKikimr { diff --git a/ydb/core/control/immediate_control_board_actor_ut.cpp b/ydb/core/control/immediate_control_board_actor_ut.cpp index 2753077d93..1b89f7cacd 100644 --- a/ydb/core/control/immediate_control_board_actor_ut.cpp +++ b/ydb/core/control/immediate_control_board_actor_ut.cpp @@ -2,18 +2,18 @@ #include "immediate_control_board_actor.h" #include "immediate_control_board_wrapper.h" -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <ydb/core/mon/mon.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/counters.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/base/tablet.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/executor_pool_io.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/mon.h> -#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/executor_pool_io.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/scheduler_basic.h> #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/tests_data.h> diff --git a/ydb/core/control/ut/ya.make b/ydb/core/control/ut/ya.make index 18a4c9dc3b..f4664552d7 100644 --- a/ydb/core/control/ut/ya.make +++ b/ydb/core/control/ut/ya.make @@ -12,8 +12,8 @@ TIMEOUT(600) SIZE(MEDIUM) PEERDIR( - library/cpp/actors/core - library/cpp/actors/interconnect + library/cpp/actors/core + library/cpp/actors/interconnect library/cpp/testing/unittest util ydb/core/base diff --git a/ydb/core/control/ya.make b/ydb/core/control/ya.make index bb1de545ae..d0dd30557d 100644 --- a/ydb/core/control/ya.make +++ b/ydb/core/control/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/monlib/dynamic_counters util ydb/core/base diff --git a/ydb/core/driver_lib/base_utils/base_utils.h b/ydb/core/driver_lib/base_utils/base_utils.h index 4809f2824d..4b77b33323 100644 --- a/ydb/core/driver_lib/base_utils/base_utils.h +++ b/ydb/core/driver_lib/base_utils/base_utils.h @@ -5,14 +5,14 @@ #include <ydb/core/protos/config.pb.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <util/stream/file.h> #include <util/stream/format.h> #include <util/system/hostname.h> #include <library/cpp/getopt/last_getopt.h> #include <library/cpp/string_utils/parse_size/parse_size.h> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/svnversion/svnversion.h> namespace NKikimr { diff --git a/ydb/core/driver_lib/base_utils/ya.make b/ydb/core/driver_lib/base_utils/ya.make index 3c72ab274a..8116995132 100644 --- a/ydb/core/driver_lib/base_utils/ya.make +++ b/ydb/core/driver_lib/base_utils/ya.make @@ -13,7 +13,7 @@ SRCS( ) PEERDIR( - library/cpp/deprecated/enum_codegen + library/cpp/deprecated/enum_codegen library/cpp/grpc/client ydb/core/blobstorage/pdisk ydb/core/client/server diff --git a/ydb/core/driver_lib/cli_base/cli_cmds_db.cpp b/ydb/core/driver_lib/cli_base/cli_cmds_db.cpp index 450d4135c6..44210bf67a 100644 --- a/ydb/core/driver_lib/cli_base/cli_cmds_db.cpp +++ b/ydb/core/driver_lib/cli_base/cli_cmds_db.cpp @@ -8,7 +8,7 @@ #include <ydb/public/sdk/cpp/client/resources/ydb_resources.h> -#include <library/cpp/grpc/client/grpc_client_low.h> +#include <library/cpp/grpc/client/grpc_client_low.h> #include <ydb/public/api/grpc/ydb_table_v1.grpc.pb.h> #include <ydb/public/sdk/cpp/client/ydb_table/table.h> diff --git a/ydb/core/driver_lib/cli_base/cli_grpc.h b/ydb/core/driver_lib/cli_base/cli_grpc.h index 61d09c9f70..9148f53889 100644 --- a/ydb/core/driver_lib/cli_base/cli_grpc.h +++ b/ydb/core/driver_lib/cli_base/cli_grpc.h @@ -4,7 +4,7 @@ #include <ydb/public/sdk/cpp/client/resources/ydb_resources.h> #include <ydb/public/lib/deprecated/client/grpc_client.h> -#include <library/cpp/grpc/client/grpc_client_low.h> +#include <library/cpp/grpc/client/grpc_client_low.h> #include <ydb/public/api/protos/ydb_operation.pb.h> #include <ydb/public/api/grpc/ydb_operation_v1.grpc.pb.h> #include <util/string/split.h> diff --git a/ydb/core/driver_lib/cli_config_base/config_base.h b/ydb/core/driver_lib/cli_config_base/config_base.h index 6db66dc7d1..153384a2c8 100644 --- a/ydb/core/driver_lib/cli_config_base/config_base.h +++ b/ydb/core/driver_lib/cli_config_base/config_base.h @@ -9,7 +9,7 @@ #include <util/datetime/base.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <util/generic/ptr.h> #include <util/generic/strbuf.h> diff --git a/ydb/core/driver_lib/cli_config_base/ya.make b/ydb/core/driver_lib/cli_config_base/ya.make index feb09c8e7b..ca219c904e 100644 --- a/ydb/core/driver_lib/cli_config_base/ya.make +++ b/ydb/core/driver_lib/cli_config_base/ya.make @@ -8,7 +8,7 @@ SRCS( ) PEERDIR( - library/cpp/deprecated/enum_codegen + library/cpp/deprecated/enum_codegen ydb/core/util ydb/public/lib/deprecated/client ydb/library/yql/minikql diff --git a/ydb/core/driver_lib/cli_utils/cli.h b/ydb/core/driver_lib/cli_utils/cli.h index 099664792e..d1fedeb32b 100644 --- a/ydb/core/driver_lib/cli_utils/cli.h +++ b/ydb/core/driver_lib/cli_utils/cli.h @@ -5,17 +5,17 @@ #include <ydb/core/driver_lib/cli_base/cli.h> #include <ydb/core/driver_lib/run/factories.h> -#include <library/cpp/actors/interconnect/poller_tcp.h> +#include <library/cpp/actors/interconnect/poller_tcp.h> #include <ydb/public/lib/deprecated/client/msgbus_client.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <util/stream/file.h> #include <util/stream/format.h> #include <util/system/hostname.h> #include <library/cpp/getopt/last_getopt.h> #include <library/cpp/string_utils/parse_size/parse_size.h> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/svnversion/svnversion.h> #include <google/protobuf/text_format.h> diff --git a/ydb/core/driver_lib/cli_utils/cli_actorsystem_perftest.cpp b/ydb/core/driver_lib/cli_utils/cli_actorsystem_perftest.cpp index a26faf4262..273254213c 100644 --- a/ydb/core/driver_lib/cli_utils/cli_actorsystem_perftest.cpp +++ b/ydb/core/driver_lib/cli_utils/cli_actorsystem_perftest.cpp @@ -1,8 +1,8 @@ #include "cli.h" #include <ydb/core/actorlib_impl/mad_squirrel.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/scheduler_basic.h> -#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/core/executor_pool_basic.h> namespace NKikimr { namespace NDriverClient { diff --git a/ydb/core/driver_lib/cli_utils/cli_cmds_tenant.cpp b/ydb/core/driver_lib/cli_utils/cli_cmds_tenant.cpp index db44a3a516..bbb67cdd2d 100644 --- a/ydb/core/driver_lib/cli_utils/cli_cmds_tenant.cpp +++ b/ydb/core/driver_lib/cli_utils/cli_cmds_tenant.cpp @@ -2,7 +2,7 @@ #include "cli_cmds.h" -#include <library/cpp/grpc/client/grpc_client_low.h> +#include <library/cpp/grpc/client/grpc_client_low.h> #include <ydb/public/sdk/cpp/client/resources/ydb_resources.h> #include <ydb/public/api/grpc/ydb_operation_v1.grpc.pb.h> diff --git a/ydb/core/driver_lib/cli_utils/cli_persqueue_cluster_discovery.cpp b/ydb/core/driver_lib/cli_utils/cli_persqueue_cluster_discovery.cpp index 79800a67da..c505751012 100644 --- a/ydb/core/driver_lib/cli_utils/cli_persqueue_cluster_discovery.cpp +++ b/ydb/core/driver_lib/cli_utils/cli_persqueue_cluster_discovery.cpp @@ -7,7 +7,7 @@ #include <ydb/public/api/grpc/ydb_operation_v1.grpc.pb.h> #include <ydb/public/api/grpc/draft/ydb_persqueue_v1.grpc.pb.h> -#include <library/cpp/protobuf/json/proto2json.h> +#include <library/cpp/protobuf/json/proto2json.h> namespace NKikimr::NDriverClient { diff --git a/ydb/core/driver_lib/cli_utils/ya.make b/ydb/core/driver_lib/cli_utils/ya.make index cb1f9670be..208d542f39 100644 --- a/ydb/core/driver_lib/cli_utils/ya.make +++ b/ydb/core/driver_lib/cli_utils/ya.make @@ -38,8 +38,8 @@ SRCS( PEERDIR( library/cpp/deprecated/enum_codegen - library/cpp/grpc/client - library/cpp/protobuf/json + library/cpp/grpc/client + library/cpp/protobuf/json library/cpp/yson ydb/core/actorlib_impl ydb/core/base diff --git a/ydb/core/driver_lib/run/config_parser.cpp b/ydb/core/driver_lib/run/config_parser.cpp index bb68656291..08a2e52b14 100644 --- a/ydb/core/driver_lib/run/config_parser.cpp +++ b/ydb/core/driver_lib/run/config_parser.cpp @@ -1,7 +1,7 @@ #include "config_parser.h" #include "dummy.h" -#include <library/cpp/actors/core/log_settings.h> +#include <library/cpp/actors/core/log_settings.h> #include <ydb/public/lib/base/msgbus.h> #include <ydb/public/lib/deprecated/client/msgbus_client.h> diff --git a/ydb/core/driver_lib/run/config_parser.h b/ydb/core/driver_lib/run/config_parser.h index 5825ec6c49..e0160da36b 100644 --- a/ydb/core/driver_lib/run/config_parser.h +++ b/ydb/core/driver_lib/run/config_parser.h @@ -6,8 +6,8 @@ #include <library/cpp/getopt/last_getopt.h> -#include <library/cpp/messagebus/session_config.h> -#include <library/cpp/messagebus/queue_config.h> +#include <library/cpp/messagebus/session_config.h> +#include <library/cpp/messagebus/queue_config.h> namespace NKikimr { diff --git a/ydb/core/driver_lib/run/driver.h b/ydb/core/driver_lib/run/driver.h index 7ad96718d1..a643a4ef6b 100644 --- a/ydb/core/driver_lib/run/driver.h +++ b/ydb/core/driver_lib/run/driver.h @@ -2,13 +2,13 @@ #include <ydb/core/driver_lib/cli_config_base/config_base.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <util/stream/file.h> #include <util/stream/format.h> #include <library/cpp/getopt/last_getopt.h> #include <library/cpp/string_utils/parse_size/parse_size.h> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/svnversion/svnversion.h> namespace NKikimr { diff --git a/ydb/core/driver_lib/run/main.cpp b/ydb/core/driver_lib/run/main.cpp index f0a9315685..ed7e745deb 100644 --- a/ydb/core/driver_lib/run/main.cpp +++ b/ydb/core/driver_lib/run/main.cpp @@ -15,7 +15,7 @@ #include <ydb/core/driver_lib/run/run.h> // allocator info -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/malloc/api/malloc.h> #ifndef _win_ #include <sys/mman.h> diff --git a/ydb/core/driver_lib/run/run.cpp b/ydb/core/driver_lib/run/run.cpp index a4f74aa4e0..c705df2b26 100644 --- a/ydb/core/driver_lib/run/run.cpp +++ b/ydb/core/driver_lib/run/run.cpp @@ -3,30 +3,30 @@ #include "service_initializer.h" #include "kikimr_services_initializers.h" -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> -#include <library/cpp/actors/core/mon_stats.h> -#include <library/cpp/actors/core/process_stats.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/log_settings.h> - -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/executor_pool_io.h> -#include <library/cpp/actors/core/scheduler_basic.h> - -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/interconnect/poller_tcp.h> -#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> -#include <library/cpp/actors/interconnect/interconnect_tcp_server.h> -#include <library/cpp/actors/interconnect/interconnect_mon.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon_stats.h> +#include <library/cpp/actors/core/process_stats.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log_settings.h> + +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/executor_pool_io.h> +#include <library/cpp/actors/core/scheduler_basic.h> + +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/poller_tcp.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_server.h> +#include <library/cpp/actors/interconnect/interconnect_mon.h> #include <ydb/core/actorlib_impl/mad_squirrel.h> #include <ydb/core/control/immediate_control_board_actor.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <ydb/core/keyvalue/keyvalue.h> #include <ydb/core/formats/clickhouse_block.h> #include <ydb/core/grpc_services/grpc_request_proxy.h> @@ -35,7 +35,7 @@ #include <ydb/core/mon/crossref.h> #include <ydb/core/mon_alloc/profiler.h> -#include <library/cpp/actors/util/affinity.h> +#include <library/cpp/actors/util/affinity.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/counters.h> @@ -103,11 +103,11 @@ #include <ydb/core/yq/libs/init/init.h> -#include <library/cpp/logger/global/global.h> +#include <library/cpp/logger/global/global.h> #include <library/cpp/monlib/messagebus/mon_messagebus.h> -#include <library/cpp/sighandler/async_signals_handler.h> -#include <library/cpp/svnversion/svnversion.h> -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/sighandler/async_signals_handler.h> +#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/malloc/api/malloc.h> #include <ydb/core/util/sig.h> @@ -115,7 +115,7 @@ #include <ydb/core/tablet/node_tablet_monitor.h> #include <library/cpp/actors/core/memory_track.h> -#include <library/cpp/actors/prof/tag.h> +#include <library/cpp/actors/prof/tag.h> #include <ydb/library/yql/minikql/invoke_builtins/mkql_builtins.h> #include <util/folder/dirut.h> diff --git a/ydb/core/driver_lib/run/run.h b/ydb/core/driver_lib/run/run.h index dfd93a24e7..bc3512a6fb 100644 --- a/ydb/core/driver_lib/run/run.h +++ b/ydb/core/driver_lib/run/run.h @@ -3,10 +3,10 @@ #include "factories.h" #include "service_initializer.h" -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/log_settings.h> -#include <library/cpp/actors/interconnect/poller_tcp.h> -#include <library/cpp/actors/util/should_continue.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/log_settings.h> +#include <library/cpp/actors/interconnect/poller_tcp.h> +#include <library/cpp/actors/util/should_continue.h> #include <library/cpp/grpc/server/grpc_server.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/statestorage.h> diff --git a/ydb/core/driver_lib/run/service_initializer.h b/ydb/core/driver_lib/run/service_initializer.h index 870fd3da68..6463ed39dc 100644 --- a/ydb/core/driver_lib/run/service_initializer.h +++ b/ydb/core/driver_lib/run/service_initializer.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <ydb/core/base/appdata.h> #include <util/generic/list.h> diff --git a/ydb/core/driver_lib/run/version.cpp b/ydb/core/driver_lib/run/version.cpp index b8f2ef8caf..da85e1d155 100644 --- a/ydb/core/driver_lib/run/version.cpp +++ b/ydb/core/driver_lib/run/version.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/svnversion/svnversion.h> #include "version.h" TMaybe<NActors::TInterconnectProxyCommon::TVersionInfo> VERSION = NActors::TInterconnectProxyCommon::TVersionInfo{ diff --git a/ydb/core/driver_lib/run/version.h b/ydb/core/driver_lib/run/version.h index 27230577aa..29bcef5428 100644 --- a/ydb/core/driver_lib/run/version.h +++ b/ydb/core/driver_lib/run/version.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/interconnect/interconnect_common.h> +#include <library/cpp/actors/interconnect/interconnect_common.h> extern TMaybe<NActors::TInterconnectProxyCommon::TVersionInfo> VERSION; diff --git a/ydb/core/driver_lib/run/ya.make b/ydb/core/driver_lib/run/ya.make index f410ef42f2..d40cd70a56 100644 --- a/ydb/core/driver_lib/run/ya.make +++ b/ydb/core/driver_lib/run/ya.make @@ -43,25 +43,25 @@ SRCS( PEERDIR( contrib/libs/protobuf - library/cpp/actors/core + library/cpp/actors/core library/cpp/actors/dnsresolver - library/cpp/actors/interconnect - library/cpp/actors/memory_log - library/cpp/actors/prof - library/cpp/actors/protos - library/cpp/actors/util + library/cpp/actors/interconnect + library/cpp/actors/memory_log + library/cpp/actors/prof + library/cpp/actors/protos + library/cpp/actors/util library/cpp/getopt/small - library/cpp/grpc/client + library/cpp/grpc/client library/cpp/grpc/server library/cpp/grpc/server/actors - library/cpp/logger - library/cpp/malloc/api - library/cpp/messagebus + library/cpp/logger + library/cpp/malloc/api + library/cpp/messagebus library/cpp/monlib/dynamic_counters library/cpp/monlib/messagebus - library/cpp/sighandler + library/cpp/sighandler library/cpp/string_utils/parse_size - library/cpp/svnversion + library/cpp/svnversion ydb/core/actorlib_impl ydb/core/base ydb/core/blobstorage diff --git a/ydb/core/engine/mkql_engine_flat.cpp b/ydb/core/engine/mkql_engine_flat.cpp index c7fe388eef..20335d8321 100644 --- a/ydb/core/engine/mkql_engine_flat.cpp +++ b/ydb/core/engine/mkql_engine_flat.cpp @@ -3,7 +3,7 @@ #include "mkql_engine_flat_impl.h" #include "mkql_proto.h" -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <ydb/library/yql/minikql/computation/mkql_computation_node.h> #include <ydb/library/yql/minikql/computation/mkql_computation_node_pack.h> #include <ydb/library/yql/minikql/mkql_node_cast.h> diff --git a/ydb/core/engine/mkql_keys.h b/ydb/core/engine/mkql_keys.h index 635ad3ce14..00d60d429a 100644 --- a/ydb/core/engine/mkql_keys.h +++ b/ydb/core/engine/mkql_keys.h @@ -7,7 +7,7 @@ #include <ydb/core/scheme_types/scheme_types.h> #include <util/stream/output.h> // for IOutputStream -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> namespace NKikimr { diff --git a/ydb/core/engine/ya.make b/ydb/core/engine/ya.make index df644f17dc..0ff9d8a85c 100644 --- a/ydb/core/engine/ya.make +++ b/ydb/core/engine/ya.make @@ -18,7 +18,7 @@ SRCS( PEERDIR( library/cpp/containers/stack_vector - library/cpp/deprecated/enum_codegen + library/cpp/deprecated/enum_codegen library/cpp/random_provider library/cpp/time_provider ydb/core/base diff --git a/ydb/core/erasure/erasure.cpp b/ydb/core/erasure/erasure.cpp index a41b027932..4321dbc2b3 100644 --- a/ydb/core/erasure/erasure.cpp +++ b/ydb/core/erasure/erasure.cpp @@ -3,7 +3,7 @@ #include <util/generic/yexception.h> #include <util/system/unaligned_mem.h> #include <library/cpp/containers/stack_vector/stack_vec.h> -#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/digest/crc32c/crc32c.h> #define MAX_TOTAL_PARTS 8 #define MAX_LINES_IN_BLOCK 8 diff --git a/ydb/core/erasure/erasure_perf_test.cpp b/ydb/core/erasure/erasure_perf_test.cpp index 2aaee89334..716ab29cf8 100644 --- a/ydb/core/erasure/erasure_perf_test.cpp +++ b/ydb/core/erasure/erasure_perf_test.cpp @@ -10,7 +10,7 @@ #include <util/system/hp_timer.h> #include <iostream> #include <numeric> -#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/digest/crc32c/crc32c.h> #define SHORT_TEST //#define LONG_TEST diff --git a/ydb/core/erasure/erasure_rope.h b/ydb/core/erasure/erasure_rope.h index a4835ce834..24c645e819 100644 --- a/ydb/core/erasure/erasure_rope.h +++ b/ydb/core/erasure/erasure_rope.h @@ -11,8 +11,8 @@ #include <util/generic/list.h> #include <library/cpp/containers/stack_vector/stack_vec.h> -#include <library/cpp/actors/util/rope.h> -#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/actors/util/rope.h> +#include <library/cpp/digest/crc32c/crc32c.h> namespace NKikimr { namespace NErasureRope { diff --git a/ydb/core/erasure/ut/ya.make b/ydb/core/erasure/ut/ya.make index 549ac7f896..da56a6ecaf 100644 --- a/ydb/core/erasure/ut/ya.make +++ b/ydb/core/erasure/ut/ya.make @@ -15,7 +15,7 @@ ENDIF() OWNER(ddoarn cthulhu fomichev g:kikimr) PEERDIR( - library/cpp/digest/crc32c + library/cpp/digest/crc32c ) SRCS( diff --git a/ydb/core/erasure/ut_rope/ya.make b/ydb/core/erasure/ut_rope/ya.make index bcba5b5729..ac5aa4c0dc 100644 --- a/ydb/core/erasure/ut_rope/ya.make +++ b/ydb/core/erasure/ut_rope/ya.make @@ -21,7 +21,7 @@ OWNER( ) PEERDIR( - library/cpp/digest/crc32c + library/cpp/digest/crc32c ydb/core/erasure ) diff --git a/ydb/core/erasure/ya.make b/ydb/core/erasure/ya.make index 63483c1b96..188565b03e 100644 --- a/ydb/core/erasure/ya.make +++ b/ydb/core/erasure/ya.make @@ -17,10 +17,10 @@ SRCS( ) PEERDIR( - library/cpp/actors/util + library/cpp/actors/util library/cpp/containers/stack_vector library/cpp/digest/crc32c - library/cpp/digest/old_crc + library/cpp/digest/old_crc ydb/core/debug ) diff --git a/ydb/core/grpc_services/grpc_mon.cpp b/ydb/core/grpc_services/grpc_mon.cpp index cd15157b05..ea52c0c0a7 100644 --- a/ydb/core/grpc_services/grpc_mon.cpp +++ b/ydb/core/grpc_services/grpc_mon.cpp @@ -4,8 +4,8 @@ #include <library/cpp/cache/cache.h> #include <library/cpp/monlib/service/pages/templates.h> -#include <library/cpp/actors/core/mon.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NGRpcService { diff --git a/ydb/core/grpc_services/grpc_request_proxy.h b/ydb/core/grpc_services/grpc_request_proxy.h index 97315f6e9f..4f2023d2a2 100644 --- a/ydb/core/grpc_services/grpc_request_proxy.h +++ b/ydb/core/grpc_services/grpc_request_proxy.h @@ -4,7 +4,7 @@ #include "rpc_calls.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include <util/generic/ptr.h> #include <util/generic/vector.h> diff --git a/ydb/core/grpc_services/rpc_cancel_operation.cpp b/ydb/core/grpc_services/rpc_cancel_operation.cpp index 579f927c80..bffcfa8580 100644 --- a/ydb/core/grpc_services/rpc_cancel_operation.cpp +++ b/ydb/core/grpc_services/rpc_cancel_operation.cpp @@ -8,7 +8,7 @@ #include <ydb/core/tx/schemeshard/schemeshard_import.h> #include <ydb/public/lib/operation_id/operation_id.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NGRpcService { diff --git a/ydb/core/grpc_services/rpc_deferrable.h b/ydb/core/grpc_services/rpc_deferrable.h index 644e7b84c4..f6ee48d68e 100644 --- a/ydb/core/grpc_services/rpc_deferrable.h +++ b/ydb/core/grpc_services/rpc_deferrable.h @@ -14,7 +14,7 @@ #include <ydb/core/actorlib_impl/long_timer.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> namespace NKikimr { namespace NGRpcService { diff --git a/ydb/core/grpc_services/rpc_discovery.cpp b/ydb/core/grpc_services/rpc_discovery.cpp index 75550f92ac..d0bb74b3b7 100644 --- a/ydb/core/grpc_services/rpc_discovery.cpp +++ b/ydb/core/grpc_services/rpc_discovery.cpp @@ -12,9 +12,9 @@ #include <ydb/library/yql/public/issue/yql_issue_message.h> #include <ydb/library/yql/public/issue/yql_issue.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/random/shuffle.h> diff --git a/ydb/core/grpc_services/rpc_export.cpp b/ydb/core/grpc_services/rpc_export.cpp index f0fa7be3df..cbf45313b1 100644 --- a/ydb/core/grpc_services/rpc_export.cpp +++ b/ydb/core/grpc_services/rpc_export.cpp @@ -5,7 +5,7 @@ #include <ydb/core/tx/schemeshard/schemeshard_export.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/ptr.h> #include <util/string/builder.h> diff --git a/ydb/core/grpc_services/rpc_forget_operation.cpp b/ydb/core/grpc_services/rpc_forget_operation.cpp index 8b250125ca..ae51d16e89 100644 --- a/ydb/core/grpc_services/rpc_forget_operation.cpp +++ b/ydb/core/grpc_services/rpc_forget_operation.cpp @@ -8,7 +8,7 @@ #include <ydb/core/tx/schemeshard/schemeshard_import.h> #include <ydb/public/lib/operation_id/operation_id.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NGRpcService { diff --git a/ydb/core/grpc_services/rpc_get_operation.cpp b/ydb/core/grpc_services/rpc_get_operation.cpp index 6f7a140686..6a941a5530 100644 --- a/ydb/core/grpc_services/rpc_get_operation.cpp +++ b/ydb/core/grpc_services/rpc_get_operation.cpp @@ -16,7 +16,7 @@ #include <ydb/core/tx/tx_proxy/proxy.h> #include <ydb/public/lib/operation_id/operation_id.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/string/cast.h> diff --git a/ydb/core/grpc_services/rpc_get_shard_locations.cpp b/ydb/core/grpc_services/rpc_get_shard_locations.cpp index f7088c8eb6..c851474e13 100644 --- a/ydb/core/grpc_services/rpc_get_shard_locations.cpp +++ b/ydb/core/grpc_services/rpc_get_shard_locations.cpp @@ -5,10 +5,10 @@ #include <ydb/library/aclib/aclib.h> #include <ydb/core/base/tablet_pipe.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <util/string/vector.h> #include <util/generic/hash.h> diff --git a/ydb/core/grpc_services/rpc_kh_describe.cpp b/ydb/core/grpc_services/rpc_kh_describe.cpp index e2c48213ce..73ee090170 100644 --- a/ydb/core/grpc_services/rpc_kh_describe.cpp +++ b/ydb/core/grpc_services/rpc_kh_describe.cpp @@ -9,10 +9,10 @@ #include <ydb/core/tablet_flat/tablet_flat_executed.h> #include <ydb/core/base/tablet_pipecache.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <util/string/vector.h> #include <util/generic/hash.h> diff --git a/ydb/core/grpc_services/rpc_kh_snapshots.cpp b/ydb/core/grpc_services/rpc_kh_snapshots.cpp index c390c81fae..ad395635a8 100644 --- a/ydb/core/grpc_services/rpc_kh_snapshots.cpp +++ b/ydb/core/grpc_services/rpc_kh_snapshots.cpp @@ -7,7 +7,7 @@ #include <ydb/core/actorlib_impl/long_timer.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/string/vector.h> #include <util/generic/hash.h> diff --git a/ydb/core/grpc_services/rpc_list_operations.cpp b/ydb/core/grpc_services/rpc_list_operations.cpp index a905efd8d6..46194db1e1 100644 --- a/ydb/core/grpc_services/rpc_list_operations.cpp +++ b/ydb/core/grpc_services/rpc_list_operations.cpp @@ -10,7 +10,7 @@ #include <ydb/core/tx/schemeshard/schemeshard_import.h> #include <ydb/public/lib/operation_id/operation_id.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NGRpcService { diff --git a/ydb/core/grpc_services/rpc_request_base.h b/ydb/core/grpc_services/rpc_request_base.h index b5cb84fc0b..043bdee836 100644 --- a/ydb/core/grpc_services/rpc_request_base.h +++ b/ydb/core/grpc_services/rpc_request_base.h @@ -9,7 +9,7 @@ #include <ydb/public/api/protos/ydb_status_codes.pb.h> #include <ydb/public/api/protos/ydb_issue_message.pb.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <util/generic/ptr.h> diff --git a/ydb/core/grpc_services/rpc_stream_execute_scan_query.cpp b/ydb/core/grpc_services/rpc_stream_execute_scan_query.cpp index 5f95f263c6..dca8f91682 100644 --- a/ydb/core/grpc_services/rpc_stream_execute_scan_query.cpp +++ b/ydb/core/grpc_services/rpc_stream_execute_scan_query.cpp @@ -13,7 +13,7 @@ #include <ydb/core/protos/ydb_table_impl.pb.h> #include <ydb/core/ydb_convert/ydb_convert.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> namespace NKikimr { namespace NGRpcService { diff --git a/ydb/core/grpc_services/rpc_whoami.cpp b/ydb/core/grpc_services/rpc_whoami.cpp index b8b2dadfcf..9f6722284e 100644 --- a/ydb/core/grpc_services/rpc_whoami.cpp +++ b/ydb/core/grpc_services/rpc_whoami.cpp @@ -1,7 +1,7 @@ #include "grpc_request_proxy.h" #include "rpc_calls.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <ydb/core/security/ticket_parser.h> diff --git a/ydb/core/grpc_services/ut/ya.make b/ydb/core/grpc_services/ut/ya.make index b1888784b2..b6662efff9 100644 --- a/ydb/core/grpc_services/ut/ya.make +++ b/ydb/core/grpc_services/ut/ya.make @@ -19,7 +19,7 @@ SRCS( PEERDIR( library/cpp/getopt library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/svnversion ydb/core/client/scheme_cache_lib ydb/core/testlib ) diff --git a/ydb/core/grpc_streaming/grpc_streaming.h b/ydb/core/grpc_streaming/grpc_streaming.h index ecac6fcf17..87fc3e73c5 100644 --- a/ydb/core/grpc_streaming/grpc_streaming.h +++ b/ydb/core/grpc_streaming/grpc_streaming.h @@ -6,8 +6,8 @@ #include <library/cpp/grpc/server/grpc_counters.h> #include <library/cpp/grpc/server/grpc_request_base.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/log.h> #include <contrib/libs/grpc/include/grpcpp/support/async_stream.h> #include <contrib/libs/grpc/include/grpcpp/support/async_unary_call.h> diff --git a/ydb/core/grpc_streaming/ut/ya.make b/ydb/core/grpc_streaming/ut/ya.make index c387ec6b3c..d20568c1ea 100644 --- a/ydb/core/grpc_streaming/ut/ya.make +++ b/ydb/core/grpc_streaming/ut/ya.make @@ -13,7 +13,7 @@ SRCS( ) PEERDIR( - library/cpp/grpc/client + library/cpp/grpc/client ydb/core/grpc_streaming/ut/grpc ydb/core/testlib ) diff --git a/ydb/core/grpc_streaming/ya.make b/ydb/core/grpc_streaming/ya.make index 19498f0cf0..c7ea7ee00f 100644 --- a/ydb/core/grpc_streaming/ya.make +++ b/ydb/core/grpc_streaming/ya.make @@ -7,7 +7,7 @@ OWNER( PEERDIR( contrib/libs/grpc - library/cpp/actors/core + library/cpp/actors/core library/cpp/grpc/server ydb/core/base ) diff --git a/ydb/core/kesus/proxy/proxy.cpp b/ydb/core/kesus/proxy/proxy.cpp index 9633816e60..e8d2b87682 100644 --- a/ydb/core/kesus/proxy/proxy.cpp +++ b/ydb/core/kesus/proxy/proxy.cpp @@ -6,9 +6,9 @@ #include <ydb/core/tx/schemeshard/schemeshard.h> #include <ydb/core/tx/scheme_cache/scheme_cache.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> namespace NKikimr { namespace NKesus { diff --git a/ydb/core/kesus/proxy/proxy_actor.cpp b/ydb/core/kesus/proxy/proxy_actor.cpp index e93d90355f..8422347f29 100644 --- a/ydb/core/kesus/proxy/proxy_actor.cpp +++ b/ydb/core/kesus/proxy/proxy_actor.cpp @@ -5,9 +5,9 @@ #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/kesus/tablet/events.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> #include <util/generic/hash_set.h> diff --git a/ydb/core/kesus/tablet/probes.h b/ydb/core/kesus/tablet/probes.h index 077375fb36..ba6e3c230f 100644 --- a/ydb/core/kesus/tablet/probes.h +++ b/ydb/core/kesus/tablet/probes.h @@ -1,6 +1,6 @@ #pragma once #include <library/cpp/actors/core/actorid.h> -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #include <util/string/builder.h> diff --git a/ydb/core/kesus/tablet/quoter_resource_tree_ut.cpp b/ydb/core/kesus/tablet/quoter_resource_tree_ut.cpp index b280b4b29b..67d1f2935e 100644 --- a/ydb/core/kesus/tablet/quoter_resource_tree_ut.cpp +++ b/ydb/core/kesus/tablet/quoter_resource_tree_ut.cpp @@ -1,6 +1,6 @@ #include "quoter_resource_tree.h" -#include <library/cpp/testing/gmock_in_unittest/gmock.h> +#include <library/cpp/testing/gmock_in_unittest/gmock.h> #include <library/cpp/testing/unittest/registar.h> namespace NKikimr { diff --git a/ydb/core/kesus/tablet/tablet_impl.cpp b/ydb/core/kesus/tablet/tablet_impl.cpp index 245c4b91b8..141e7df4b2 100644 --- a/ydb/core/kesus/tablet/tablet_impl.cpp +++ b/ydb/core/kesus/tablet/tablet_impl.cpp @@ -4,7 +4,7 @@ #include <ydb/core/engine/minikql/flat_local_tx_factory.h> #include <ydb/core/tablet/tablet_counters_protobuf.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NKesus { diff --git a/ydb/core/kesus/tablet/tablet_impl.h b/ydb/core/kesus/tablet/tablet_impl.h index 1607e352d0..7430547c03 100644 --- a/ydb/core/kesus/tablet/tablet_impl.h +++ b/ydb/core/kesus/tablet/tablet_impl.h @@ -14,8 +14,8 @@ #include <ydb/core/tablet_flat/flat_executor_counters.h> #include <ydb/core/tablet_flat/tablet_flat_executed.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/scheduler_cookie.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/scheduler_cookie.h> #include <util/generic/hash.h> diff --git a/ydb/core/kesus/tablet/tablet_ut.cpp b/ydb/core/kesus/tablet/tablet_ut.cpp index 1cf1a80ca8..26787d023f 100644 --- a/ydb/core/kesus/tablet/tablet_ut.cpp +++ b/ydb/core/kesus/tablet/tablet_ut.cpp @@ -5,7 +5,7 @@ #include <ydb/core/metering/metering.h> -#include <library/cpp/actors/interconnect/interconnect_impl.h> +#include <library/cpp/actors/interconnect/interconnect_impl.h> #include <util/random/random.h> diff --git a/ydb/core/kesus/tablet/tx_quoter_resource_add.cpp b/ydb/core/kesus/tablet/tx_quoter_resource_add.cpp index fa5755eb6e..36e67ce530 100644 --- a/ydb/core/kesus/tablet/tx_quoter_resource_add.cpp +++ b/ydb/core/kesus/tablet/tx_quoter_resource_add.cpp @@ -1,6 +1,6 @@ #include "tablet_impl.h" -#include <library/cpp/protobuf/util/is_equal.h> +#include <library/cpp/protobuf/util/is_equal.h> namespace NKikimr { namespace NKesus { diff --git a/ydb/core/kesus/tablet/ut/ya.make b/ydb/core/kesus/tablet/ut/ya.make index d9a9218c2b..1defe156fd 100644 --- a/ydb/core/kesus/tablet/ut/ya.make +++ b/ydb/core/kesus/tablet/ut/ya.make @@ -14,7 +14,7 @@ TIMEOUT(600) SIZE(MEDIUM) PEERDIR( - library/cpp/testing/gmock_in_unittest + library/cpp/testing/gmock_in_unittest ydb/core/testlib ) diff --git a/ydb/core/kesus/tablet/ut_helpers.cpp b/ydb/core/kesus/tablet/ut_helpers.cpp index f559800a76..1dab8e13d6 100644 --- a/ydb/core/kesus/tablet/ut_helpers.cpp +++ b/ydb/core/kesus/tablet/ut_helpers.cpp @@ -2,7 +2,7 @@ #include <ydb/core/metering/metering.h> -#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/event_pb.h> #include <algorithm> diff --git a/ydb/core/kesus/tablet/ya.make b/ydb/core/kesus/tablet/ya.make index 02c34c7fce..0fae464312 100644 --- a/ydb/core/kesus/tablet/ya.make +++ b/ydb/core/kesus/tablet/ya.make @@ -41,7 +41,7 @@ SRCS( ) PEERDIR( - library/cpp/protobuf/util + library/cpp/protobuf/util ydb/core/actorlib_impl ydb/core/base ydb/core/engine/minikql diff --git a/ydb/core/keyvalue/keyvalue.h b/ydb/core/keyvalue/keyvalue.h index fa3bc71917..2afb72da69 100644 --- a/ydb/core/keyvalue/keyvalue.h +++ b/ydb/core/keyvalue/keyvalue.h @@ -1,7 +1,7 @@ #pragma once #include "defs.h" -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actorid.h> #include <ydb/core/base/blobstorage.h> #include <ydb/core/protos/msgbus.pb.h> #include <ydb/core/protos/msgbus_kv.pb.h> diff --git a/ydb/core/keyvalue/keyvalue_collector.cpp b/ydb/core/keyvalue/keyvalue_collector.cpp index 8b7696bcb2..0049c1a328 100644 --- a/ydb/core/keyvalue/keyvalue_collector.cpp +++ b/ydb/core/keyvalue/keyvalue_collector.cpp @@ -1,7 +1,7 @@ #include "keyvalue_flat_impl.h" #include <ydb/core/blobstorage/dsproxy/blobstorage_backoff.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> namespace NKikimr { namespace NKeyValue { diff --git a/ydb/core/keyvalue/keyvalue_flat_impl.h b/ydb/core/keyvalue/keyvalue_flat_impl.h index 292f2feff9..97f9d9ebdb 100644 --- a/ydb/core/keyvalue/keyvalue_flat_impl.h +++ b/ydb/core/keyvalue/keyvalue_flat_impl.h @@ -14,8 +14,8 @@ #include <ydb/core/tablet/tablet_counters_protobuf.h> #include <ydb/core/blobstorage/base/blobstorage_events.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> #include <library/cpp/json/json_writer.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/blobstorage.h> diff --git a/ydb/core/keyvalue/keyvalue_simple_db_flat.h b/ydb/core/keyvalue/keyvalue_simple_db_flat.h index 82661a9f15..c3b64f0a00 100644 --- a/ydb/core/keyvalue/keyvalue_simple_db_flat.h +++ b/ydb/core/keyvalue/keyvalue_simple_db_flat.h @@ -1,7 +1,7 @@ #pragma once #include "defs.h" #include "keyvalue_simple_db.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr { diff --git a/ydb/core/keyvalue/keyvalue_storage_request.cpp b/ydb/core/keyvalue/keyvalue_storage_request.cpp index e9032d2ed3..567cc88bda 100644 --- a/ydb/core/keyvalue/keyvalue_storage_request.cpp +++ b/ydb/core/keyvalue/keyvalue_storage_request.cpp @@ -1,6 +1,6 @@ #include "keyvalue_flat_impl.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <ydb/public/lib/base/msgbus.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/base/hive.h> diff --git a/ydb/core/keyvalue/ut/ya.make b/ydb/core/keyvalue/ut/ya.make index 7124f2ccf8..d4d7687cc5 100644 --- a/ydb/core/keyvalue/ut/ya.make +++ b/ydb/core/keyvalue/ut/ya.make @@ -21,7 +21,7 @@ ENDIF() PEERDIR( library/cpp/getopt library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/svnversion ydb/core/testlib ) diff --git a/ydb/core/keyvalue/ya.make b/ydb/core/keyvalue/ya.make index 17bb1853c0..8270099411 100644 --- a/ydb/core/keyvalue/ya.make +++ b/ydb/core/keyvalue/ya.make @@ -47,7 +47,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/actors/protos ydb/core/base ydb/core/blobstorage/base diff --git a/ydb/core/kqp/common/kqp_gateway.h b/ydb/core/kqp/common/kqp_gateway.h index 1e06beca39..1c0aa19176 100644 --- a/ydb/core/kqp/common/kqp_gateway.h +++ b/ydb/core/kqp/common/kqp_gateway.h @@ -7,7 +7,7 @@ #include <ydb/library/yql/dq/common/dq_value.h> #include <ydb/core/kqp/provider/yql_kikimr_gateway.h> -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actorid.h> namespace NKikimr { namespace NKqp { diff --git a/ydb/core/kqp/counters/kqp_counters.cpp b/ydb/core/kqp/counters/kqp_counters.cpp index 26a28a0249..8d9097ab34 100644 --- a/ydb/core/kqp/counters/kqp_counters.cpp +++ b/ydb/core/kqp/counters/kqp_counters.cpp @@ -6,7 +6,7 @@ #include <ydb/core/sys_view/service/db_counters.h> #include <ydb/core/sys_view/service/sysview_service.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <util/generic/size_literals.h> diff --git a/ydb/core/kqp/executer/kqp_result_channel.h b/ydb/core/kqp/executer/kqp_result_channel.h index 299b0f686b..d3df35210e 100644 --- a/ydb/core/kqp/executer/kqp_result_channel.h +++ b/ydb/core/kqp/executer/kqp_result_channel.h @@ -2,7 +2,7 @@ #include "kqp_tasks_graph.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NYql { diff --git a/ydb/core/kqp/executer/kqp_scan_executer.cpp b/ydb/core/kqp/executer/kqp_scan_executer.cpp index 07c29f64e2..632ac419bb 100644 --- a/ydb/core/kqp/executer/kqp_scan_executer.cpp +++ b/ydb/core/kqp/executer/kqp_scan_executer.cpp @@ -21,10 +21,10 @@ #include <ydb/library/yql/dq/tasks/dq_connection_builder.h> #include <ydb/library/yql/public/issue/yql_issue_message.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> namespace NKikimr { namespace NKqp { diff --git a/ydb/core/kqp/executer/kqp_tasks_graph.cpp b/ydb/core/kqp/executer/kqp_tasks_graph.cpp index 1ccfa26047..046d5b9191 100644 --- a/ydb/core/kqp/executer/kqp_tasks_graph.cpp +++ b/ydb/core/kqp/executer/kqp_tasks_graph.cpp @@ -7,7 +7,7 @@ #include <ydb/library/yql/core/yql_expr_optimize.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> namespace NKikimr { namespace NKqp { diff --git a/ydb/core/kqp/executer/ut/kqp_executer_ut.cpp b/ydb/core/kqp/executer/ut/kqp_executer_ut.cpp index 3148a2ec59..5a0c3361a4 100644 --- a/ydb/core/kqp/executer/ut/kqp_executer_ut.cpp +++ b/ydb/core/kqp/executer/ut/kqp_executer_ut.cpp @@ -8,7 +8,7 @@ #include <ydb/library/yql/dq/common/dq_value.h> #include <ydb/library/yql/core/services/mounts/yql_mounts.h> -#include <library/cpp/protobuf/util/pb_io.h> +#include <library/cpp/protobuf/util/pb_io.h> namespace NKikimr { namespace NKqp { diff --git a/ydb/core/kqp/executer/ya.make b/ydb/core/kqp/executer/ya.make index 3db082d5d0..bbf52957ad 100644 --- a/ydb/core/kqp/executer/ya.make +++ b/ydb/core/kqp/executer/ya.make @@ -23,7 +23,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/core/actorlib_impl ydb/core/base ydb/core/client/minikql_compile diff --git a/ydb/core/kqp/kqp_compile_actor.cpp b/ydb/core/kqp/kqp_compile_actor.cpp index 27cf296a03..66ff05e834 100644 --- a/ydb/core/kqp/kqp_compile_actor.cpp +++ b/ydb/core/kqp/kqp_compile_actor.cpp @@ -9,8 +9,8 @@ #include <ydb/library/yql/utils/actor_log/log.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <library/cpp/json/json_writer.h> #include <library/cpp/string_utils/base64/base64.h> #include <library/cpp/digest/md5/md5.h> diff --git a/ydb/core/kqp/kqp_compile_service.cpp b/ydb/core/kqp/kqp_compile_service.cpp index da886224a2..872b954174 100644 --- a/ydb/core/kqp/kqp_compile_service.cpp +++ b/ydb/core/kqp/kqp_compile_service.cpp @@ -8,8 +8,8 @@ #include <ydb/core/kqp/counters/kqp_counters.h> #include <ydb/library/aclib/aclib.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <library/cpp/cache/cache.h> #include <util/string/escape.h> diff --git a/ydb/core/kqp/kqp_ic_gateway.cpp b/ydb/core/kqp/kqp_ic_gateway.cpp index 47489a9bd5..52dc4ed953 100644 --- a/ydb/core/kqp/kqp_ic_gateway.cpp +++ b/ydb/core/kqp/kqp_ic_gateway.cpp @@ -28,8 +28,8 @@ #include <ydb/library/yql/providers/common/proto/gateways_config.pb.h> #include <ydb/library/yql/public/issue/yql_issue_message.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/string/split.h> #include <util/string/vector.h> diff --git a/ydb/core/kqp/kqp_impl.h b/ydb/core/kqp/kqp_impl.h index 7d6f172899..3dab221bf5 100644 --- a/ydb/core/kqp/kqp_impl.h +++ b/ydb/core/kqp/kqp_impl.h @@ -8,8 +8,8 @@ #include <ydb/library/yql/utils/log/log.h> #include <ydb/library/yql/utils/log/tls_backend.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/protobuf/util/pb_io.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/protobuf/util/pb_io.h> namespace NKikimr { namespace NKqp { diff --git a/ydb/core/kqp/kqp_worker_actor.cpp b/ydb/core/kqp/kqp_worker_actor.cpp index cccb8a51e8..4db095e7c6 100644 --- a/ydb/core/kqp/kqp_worker_actor.cpp +++ b/ydb/core/kqp/kqp_worker_actor.cpp @@ -17,10 +17,10 @@ #include <ydb/library/yql/utils/actor_log/log.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> #include <library/cpp/json/json_reader.h> #include <util/string/escape.h> diff --git a/ydb/core/kqp/proxy/kqp_proxy_service.cpp b/ydb/core/kqp/proxy/kqp_proxy_service.cpp index decd2cb301..741ab9f37e 100644 --- a/ydb/core/kqp/proxy/kqp_proxy_service.cpp +++ b/ydb/core/kqp/proxy/kqp_proxy_service.cpp @@ -21,12 +21,12 @@ #include <ydb/library/yql/utils/actor_log/log.h> #include <ydb/library/yql/core/services/mounts/yql_mounts.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> #include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> #include <library/cpp/monlib/service/pages/templates.h> diff --git a/ydb/core/kqp/rm/ya.make b/ydb/core/kqp/rm/ya.make index 0d8a759639..e847e5fab8 100644 --- a/ydb/core/kqp/rm/ya.make +++ b/ydb/core/kqp/rm/ya.make @@ -9,7 +9,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/core/actorlib_impl ydb/core/base ydb/core/cms/console diff --git a/ydb/core/kqp/ut/kqp_query_ut.cpp b/ydb/core/kqp/ut/kqp_query_ut.cpp index 5ef6d18f38..d995d3db24 100644 --- a/ydb/core/kqp/ut/kqp_query_ut.cpp +++ b/ydb/core/kqp/ut/kqp_query_ut.cpp @@ -9,7 +9,7 @@ #include <ydb/library/yql/ast/yql_expr.h> #include <ydb/library/yql/core/yql_expr_optimize.h> -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> namespace NKikimr { namespace NKqp { diff --git a/ydb/core/kqp/ut/kqp_table_predicate_ut.cpp b/ydb/core/kqp/ut/kqp_table_predicate_ut.cpp index 5ab5108968..295cb9027f 100644 --- a/ydb/core/kqp/ut/kqp_table_predicate_ut.cpp +++ b/ydb/core/kqp/ut/kqp_table_predicate_ut.cpp @@ -7,7 +7,7 @@ #include <ydb/library/yql/ast/yql_expr.h> #include <ydb/library/yql/core/yql_expr_optimize.h> -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> namespace NKikimr { namespace NKqp { diff --git a/ydb/core/mind/address_classification/net_classifier.cpp b/ydb/core/mind/address_classification/net_classifier.cpp index 11c7e6750c..86f4932b8b 100644 --- a/ydb/core/mind/address_classification/net_classifier.cpp +++ b/ydb/core/mind/address_classification/net_classifier.cpp @@ -9,7 +9,7 @@ #include <ydb/core/cms/console/net_classifier_updater.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <util/generic/hash.h> #include <util/stream/file.h> diff --git a/ydb/core/mind/address_classification/net_classifier.h b/ydb/core/mind/address_classification/net_classifier.h index 6a298cd4c4..65ad5638c0 100644 --- a/ydb/core/mind/address_classification/net_classifier.h +++ b/ydb/core/mind/address_classification/net_classifier.h @@ -3,10 +3,10 @@ #include <ydb/core/base/events.h> #include <ydb/core/util/address_classifier.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actorid.h> -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/event_local.h> #include <library/cpp/monlib/dynamic_counters/counters.h> diff --git a/ydb/core/mind/address_classification/net_classifier_ut.cpp b/ydb/core/mind/address_classification/net_classifier_ut.cpp index 088d25b9c7..8410154419 100644 --- a/ydb/core/mind/address_classification/net_classifier_ut.cpp +++ b/ydb/core/mind/address_classification/net_classifier_ut.cpp @@ -6,7 +6,7 @@ #include <ydb/core/testlib/test_client.h> -#include <library/cpp/actors/http/http_proxy.cpp> +#include <library/cpp/actors/http/http_proxy.cpp> #include <library/cpp/testing/unittest/tests_data.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/ydb/core/mind/address_classification/ut/ya.make b/ydb/core/mind/address_classification/ut/ya.make index 62157a5aff..70e3233730 100644 --- a/ydb/core/mind/address_classification/ut/ya.make +++ b/ydb/core/mind/address_classification/ut/ya.make @@ -20,7 +20,7 @@ ELSE() ENDIF() PEERDIR( - library/cpp/actors/http + library/cpp/actors/http ydb/core/mind/address_classification ydb/core/testlib ) diff --git a/ydb/core/mind/address_classification/ya.make b/ydb/core/mind/address_classification/ya.make index 73301851da..246ce28c7d 100644 --- a/ydb/core/mind/address_classification/ya.make +++ b/ydb/core/mind/address_classification/ya.make @@ -13,7 +13,7 @@ SRCS( GENERATE_ENUM_SERIALIZATION(net_classifier.h) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/monlib/dynamic_counters ydb/core/base ydb/core/cms/console diff --git a/ydb/core/mind/bscontroller/defs.h b/ydb/core/mind/bscontroller/defs.h index 162907fe8e..7603b6c29b 100644 --- a/ydb/core/mind/bscontroller/defs.h +++ b/ydb/core/mind/bscontroller/defs.h @@ -31,15 +31,15 @@ #include <ydb/core/tablet/tablet_responsiveness_pinger.h> #include <ydb/core/util/format.h> #include <ydb/core/util/stlog.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/actor_coroutine.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actorid.h> -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_coroutine.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <library/cpp/monlib/service/pages/templates.h> #include <type_traits> #include <util/generic/algorithm.h> diff --git a/ydb/core/mind/bscontroller/grouper_ut.cpp b/ydb/core/mind/bscontroller/grouper_ut.cpp index a119ff665a..952da37b55 100644 --- a/ydb/core/mind/bscontroller/grouper_ut.cpp +++ b/ydb/core/mind/bscontroller/grouper_ut.cpp @@ -1,7 +1,7 @@ #include "defs.h" -#include <library/cpp/actors/util/affinity.h> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/actors/util/affinity.h> +#include <library/cpp/svnversion/svnversion.h> #include <library/cpp/testing/unittest/registar.h> #include "grouper.h" diff --git a/ydb/core/mind/bscontroller/ut/ya.make b/ydb/core/mind/bscontroller/ut/ya.make index 46321b2378..c08e3262e1 100644 --- a/ydb/core/mind/bscontroller/ut/ya.make +++ b/ydb/core/mind/bscontroller/ut/ya.make @@ -20,7 +20,7 @@ ELSE() ENDIF() PEERDIR( - library/cpp/actors/util + library/cpp/actors/util ydb/core/yql_testlib ) diff --git a/ydb/core/mind/bscontroller/ya.make b/ydb/core/mind/bscontroller/ya.make index 275a4dc238..e9621b5228 100644 --- a/ydb/core/mind/bscontroller/ya.make +++ b/ydb/core/mind/bscontroller/ya.make @@ -61,7 +61,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/core/base ydb/core/base/services ydb/core/blobstorage diff --git a/ydb/core/mind/configured_tablet_bootstrapper.cpp b/ydb/core/mind/configured_tablet_bootstrapper.cpp index 008acd2b40..fa9934b881 100644 --- a/ydb/core/mind/configured_tablet_bootstrapper.cpp +++ b/ydb/core/mind/configured_tablet_bootstrapper.cpp @@ -2,7 +2,7 @@ #include <ydb/core/tablet/bootstrapper.h> #include <ydb/core/cms/console/configs_dispatcher.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> // for 'create' funcs #include <ydb/core/mind/bscontroller/bsc.h> @@ -23,7 +23,7 @@ #include <ydb/core/sys_view/processor/processor.h> #include <ydb/core/test_tablet/test_tablet.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { diff --git a/ydb/core/mind/dynamic_nameserver.h b/ydb/core/mind/dynamic_nameserver.h index 38b9b7e842..c3bae0260d 100644 --- a/ydb/core/mind/dynamic_nameserver.h +++ b/ydb/core/mind/dynamic_nameserver.h @@ -2,8 +2,8 @@ #include "defs.h" -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <ydb/core/base/domain.h> #include <ydb/core/protos/node_broker.pb.h> diff --git a/ydb/core/mind/dynamic_nameserver_impl.h b/ydb/core/mind/dynamic_nameserver_impl.h index ae0e188951..44f25fe901 100644 --- a/ydb/core/mind/dynamic_nameserver_impl.h +++ b/ydb/core/mind/dynamic_nameserver_impl.h @@ -3,14 +3,14 @@ #include "dynamic_nameserver.h" #include "node_broker.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/interconnect/events_local.h> -#include <library/cpp/actors/interconnect/interconnect_impl.h> -#include <library/cpp/actors/interconnect/interconnect_address.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/interconnect/events_local.h> +#include <library/cpp/actors/interconnect/interconnect_impl.h> +#include <library/cpp/actors/interconnect/interconnect_address.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/bitmap.h> diff --git a/ydb/core/mind/hive/balancer.cpp b/ydb/core/mind/hive/balancer.cpp index 8521e30499..0477d6d285 100644 --- a/ydb/core/mind/hive/balancer.cpp +++ b/ydb/core/mind/hive/balancer.cpp @@ -1,5 +1,5 @@ #include <random> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include "hive_impl.h" #include "hive_log.h" #include "node_info.h" diff --git a/ydb/core/mind/hive/drain.cpp b/ydb/core/mind/hive/drain.cpp index 2e263a7f0e..eb3316e10f 100644 --- a/ydb/core/mind/hive/drain.cpp +++ b/ydb/core/mind/hive/drain.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include "hive_impl.h" #include "hive_log.h" #include "node_info.h" diff --git a/ydb/core/mind/hive/fill.cpp b/ydb/core/mind/hive/fill.cpp index f90fa56f42..76162580d4 100644 --- a/ydb/core/mind/hive/fill.cpp +++ b/ydb/core/mind/hive/fill.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include "hive_impl.h" #include "hive_log.h" #include "node_info.h" diff --git a/ydb/core/mind/hive/hive.h b/ydb/core/mind/hive/hive.h index cce565aecd..e1bd531e01 100644 --- a/ydb/core/mind/hive/hive.h +++ b/ydb/core/mind/hive/hive.h @@ -25,8 +25,8 @@ #include <ydb/core/tablet_flat/flat_executor_counters.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/tablet/tablet_metrics.h> diff --git a/ydb/core/mind/hive/hive_events.h b/ydb/core/mind/hive/hive_events.h index 9e26edc7a8..66f38c9fa6 100644 --- a/ydb/core/mind/hive/hive_events.h +++ b/ydb/core/mind/hive/hive_events.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/event_local.h> #include "hive.h" #include "tablet_info.h" #include "node_info.h" diff --git a/ydb/core/mind/hive/hive_impl.cpp b/ydb/core/mind/hive/hive_impl.cpp index 58ca2ac3e4..be5be1dd09 100644 --- a/ydb/core/mind/hive/hive_impl.cpp +++ b/ydb/core/mind/hive/hive_impl.cpp @@ -5,7 +5,7 @@ #include <ydb/core/protos/counters_hive.pb.h> #include <ydb/core/util/tuples.h> #include <ydb/core/util/yverify_stream.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <util/generic/array_ref.h> template <> diff --git a/ydb/core/mind/hive/hive_impl.h b/ydb/core/mind/hive/hive_impl.h index 70c4530fee..417a0e8466 100644 --- a/ydb/core/mind/hive/hive_impl.h +++ b/ydb/core/mind/hive/hive_impl.h @@ -1,6 +1,6 @@ #pragma once #include <bitset> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> #include <ydb/core/base/hive.h> #include <ydb/core/base/statestorage.h> #include <ydb/core/base/blobstorage.h> @@ -28,8 +28,8 @@ #include <ydb/core/cms/console/console.h> #include <ydb/core/cms/console/configs_dispatcher.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/queue.h> #include <util/random/random.h> diff --git a/ydb/core/mind/hive/hive_ut.cpp b/ydb/core/mind/hive/hive_ut.cpp index 0383d49a12..ac975ec861 100644 --- a/ydb/core/mind/hive/hive_ut.cpp +++ b/ydb/core/mind/hive/hive_ut.cpp @@ -19,10 +19,10 @@ #include <ydb/core/tx/schemeshard/schemeshard.h> #include <ydb/core/tx/mediator/mediator.h> -#include <library/cpp/actors/interconnect/interconnect_impl.h> +#include <library/cpp/actors/interconnect/interconnect_impl.h> -#include <library/cpp/malloc/api/malloc.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/actors/core/interconnect.h> #include <util/random/entropy.h> #include <util/stream/null.h> #include <util/string/printf.h> diff --git a/ydb/core/mind/hive/monitoring.cpp b/ydb/core/mind/hive/monitoring.cpp index 7e9a83b354..6d80aff493 100644 --- a/ydb/core/mind/hive/monitoring.cpp +++ b/ydb/core/mind/hive/monitoring.cpp @@ -1,5 +1,5 @@ #include <library/cpp/monlib/service/pages/templates.h> -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_writer.h> #include <library/cpp/protobuf/json/proto2json.h> #include <util/string/vector.h> #include <ydb/core/tablet_flat/flat_executor_counters.h> diff --git a/ydb/core/mind/hive/tx__init_scheme.cpp b/ydb/core/mind/hive/tx__init_scheme.cpp index b65451f94a..a9a1e8da14 100644 --- a/ydb/core/mind/hive/tx__init_scheme.cpp +++ b/ydb/core/mind/hive/tx__init_scheme.cpp @@ -1,6 +1,6 @@ #include "hive_impl.h" #include "hive_log.h" -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> namespace NKikimr { namespace NHive { diff --git a/ydb/core/mind/hive/ut/ya.make b/ydb/core/mind/hive/ut/ya.make index e5f2423eaf..63dcb95cfd 100644 --- a/ydb/core/mind/hive/ut/ya.make +++ b/ydb/core/mind/hive/ut/ya.make @@ -14,7 +14,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/base ydb/core/mind ydb/core/mind/hive diff --git a/ydb/core/mind/hive/ya.make b/ydb/core/mind/hive/ya.make index 171f26f1b5..4b8d4c7a8f 100644 --- a/ydb/core/mind/hive/ya.make +++ b/ydb/core/mind/hive/ya.make @@ -79,8 +79,8 @@ SRCS( ) PEERDIR( - library/cpp/actors/core - library/cpp/actors/interconnect + library/cpp/actors/core + library/cpp/actors/interconnect library/cpp/json library/cpp/monlib/dynamic_counters ydb/core/base diff --git a/ydb/core/mind/labels_maintainer.cpp b/ydb/core/mind/labels_maintainer.cpp index 19138c7d23..8d1f80512d 100644 --- a/ydb/core/mind/labels_maintainer.cpp +++ b/ydb/core/mind/labels_maintainer.cpp @@ -5,9 +5,9 @@ #include <ydb/core/cms/console/configs_dispatcher.h> #include <ydb/core/cms/console/console.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> namespace NKikimr { diff --git a/ydb/core/mind/lease_holder.cpp b/ydb/core/mind/lease_holder.cpp index 5d47d04c71..70f62f6561 100644 --- a/ydb/core/mind/lease_holder.cpp +++ b/ydb/core/mind/lease_holder.cpp @@ -1,10 +1,10 @@ #include "lease_holder.h" #include "node_broker.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/tablet_pipe.h> diff --git a/ydb/core/mind/lease_holder.h b/ydb/core/mind/lease_holder.h index bb1bc5ff93..10991e3915 100644 --- a/ydb/core/mind/lease_holder.h +++ b/ydb/core/mind/lease_holder.h @@ -2,7 +2,7 @@ #include "defs.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> /** * Lease Holder actor is used to keep dynamic node alive by extending its diff --git a/ydb/core/mind/local.cpp b/ydb/core/mind/local.cpp index 09fc15f76d..87d22f02f0 100644 --- a/ydb/core/mind/local.cpp +++ b/ydb/core/mind/local.cpp @@ -10,9 +10,9 @@ #include <ydb/core/tx/scheme_board/scheme_board.h> #include <ydb/core/util/tuples.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> #include <util/system/info.h> diff --git a/ydb/core/mind/node_broker.h b/ydb/core/mind/node_broker.h index c86edfe0e7..23f3160b7e 100644 --- a/ydb/core/mind/node_broker.h +++ b/ydb/core/mind/node_broker.h @@ -2,8 +2,8 @@ #include "defs.h" -#include <library/cpp/actors/interconnect/events_local.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/interconnect/events_local.h> +#include <library/cpp/actors/core/actor.h> #include <ydb/core/base/blobstorage.h> #include <ydb/core/base/domain.h> #include <ydb/core/protos/node_broker.pb.h> diff --git a/ydb/core/mind/node_broker_impl.h b/ydb/core/mind/node_broker_impl.h index e3b68b0587..171a086b5d 100644 --- a/ydb/core/mind/node_broker_impl.h +++ b/ydb/core/mind/node_broker_impl.h @@ -8,8 +8,8 @@ #include <ydb/core/engine/minikql/flat_local_tx_factory.h> #include <ydb/core/tablet_flat/tablet_flat_executed.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> #include <util/generic/bitmap.h> diff --git a/ydb/core/mind/node_broker_ut.cpp b/ydb/core/mind/node_broker_ut.cpp index 0d9498ddcd..e25afa0f4d 100644 --- a/ydb/core/mind/node_broker_ut.cpp +++ b/ydb/core/mind/node_broker_ut.cpp @@ -6,8 +6,8 @@ #include <ydb/core/testlib/basics/helpers.h> #include <ydb/core/testlib/tablet_helpers.h> -#include <library/cpp/actors/interconnect/events_local.h> -#include <library/cpp/actors/interconnect/interconnect_impl.h> +#include <library/cpp/actors/interconnect/events_local.h> +#include <library/cpp/actors/interconnect/interconnect_impl.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/base/tablet_resolver.h> #include <ydb/core/base/statestorage_impl.h> @@ -15,8 +15,8 @@ #include <ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.h> #include <google/protobuf/text_format.h> -#include <library/cpp/malloc/api/malloc.h> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/svnversion/svnversion.h> #include <library/cpp/testing/unittest/registar.h> #include <util/string/printf.h> diff --git a/ydb/core/mind/tenant_node_enumeration.cpp b/ydb/core/mind/tenant_node_enumeration.cpp index 15ecddceb2..397efff756 100644 --- a/ydb/core/mind/tenant_node_enumeration.cpp +++ b/ydb/core/mind/tenant_node_enumeration.cpp @@ -3,8 +3,8 @@ #include <ydb/core/base/appdata.h> #include <ydb/core/base/statestorage.h> #include <ydb/core/base/path.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/algorithm.h> namespace NKikimr { diff --git a/ydb/core/mind/tenant_node_enumeration.h b/ydb/core/mind/tenant_node_enumeration.h index f7ee7e937e..d5d881acd1 100644 --- a/ydb/core/mind/tenant_node_enumeration.h +++ b/ydb/core/mind/tenant_node_enumeration.h @@ -1,6 +1,6 @@ #pragma once #include "defs.h" -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/event_local.h> #include <util/generic/vector.h> diff --git a/ydb/core/mind/tenant_pool.cpp b/ydb/core/mind/tenant_pool.cpp index 80236570b9..f9713bd2c9 100644 --- a/ydb/core/mind/tenant_pool.cpp +++ b/ydb/core/mind/tenant_pool.cpp @@ -12,10 +12,10 @@ #include <ydb/core/cms/console/console.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/mon.h> #include <library/cpp/monlib/service/pages/templates.h> #include <util/generic/queue.h> diff --git a/ydb/core/mind/tenant_slot_broker__load_state.cpp b/ydb/core/mind/tenant_slot_broker__load_state.cpp index 345b131ea3..5d78c2084f 100644 --- a/ydb/core/mind/tenant_slot_broker__load_state.cpp +++ b/ydb/core/mind/tenant_slot_broker__load_state.cpp @@ -1,7 +1,7 @@ #include "tenant_slot_broker_impl.h" #include <ydb/core/base/appdata.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> namespace NKikimr { namespace NTenantSlotBroker { diff --git a/ydb/core/mind/tenant_slot_broker__update_pool_status.cpp b/ydb/core/mind/tenant_slot_broker__update_pool_status.cpp index 1e43062762..2dc696eb50 100644 --- a/ydb/core/mind/tenant_slot_broker__update_pool_status.cpp +++ b/ydb/core/mind/tenant_slot_broker__update_pool_status.cpp @@ -1,6 +1,6 @@ #include "tenant_slot_broker_impl.h" -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> namespace NKikimr { namespace NTenantSlotBroker { diff --git a/ydb/core/mind/tenant_slot_broker_impl.h b/ydb/core/mind/tenant_slot_broker_impl.h index b5e3b107ab..5dbd6bb90f 100644 --- a/ydb/core/mind/tenant_slot_broker_impl.h +++ b/ydb/core/mind/tenant_slot_broker_impl.h @@ -11,8 +11,8 @@ #include <ydb/core/protos/tenant_slot_broker.pb.h> #include <ydb/core/tablet_flat/tablet_flat_executed.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> #include <util/datetime/base.h> #include <util/generic/map.h> diff --git a/ydb/core/mind/ut/ya.make b/ydb/core/mind/ut/ya.make index 26e6412fc7..ffc60a50ad 100644 --- a/ydb/core/mind/ut/ya.make +++ b/ydb/core/mind/ut/ya.make @@ -30,7 +30,7 @@ ENDIF() PEERDIR( library/cpp/getopt library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/svnversion ydb/core/testlib ) diff --git a/ydb/core/mind/ut_fat/ya.make b/ydb/core/mind/ut_fat/ya.make index 77d6d68dd0..0a6915efec 100644 --- a/ydb/core/mind/ut_fat/ya.make +++ b/ydb/core/mind/ut_fat/ya.make @@ -14,8 +14,8 @@ TIMEOUT(600) PEERDIR( library/cpp/getopt - library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/regex/pcre + library/cpp/svnversion ydb/core/base ydb/core/blobstorage/base ydb/core/blobstorage/crypto diff --git a/ydb/core/mind/ya.make b/ydb/core/mind/ya.make index b9248c9d91..11d4c9df9e 100644 --- a/ydb/core/mind/ya.make +++ b/ydb/core/mind/ya.make @@ -52,7 +52,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/core/actorlib_impl ydb/core/base ydb/core/blobstorage diff --git a/ydb/core/mon/mon.cpp b/ydb/core/mon/mon.cpp index d4722266f3..879324b032 100644 --- a/ydb/core/mon/mon.cpp +++ b/ydb/core/mon/mon.cpp @@ -1,11 +1,11 @@ #include "mon.h" -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/mon.h> -#include <library/cpp/actors/core/probes.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/probes.h> #include <library/cpp/lwtrace/mon/mon_lwtrace.h> -#include <library/cpp/mime/types/mime.h> +#include <library/cpp/mime/types/mime.h> #include <library/cpp/monlib/service/pages/version_mon_page.h> #include <library/cpp/monlib/service/pages/mon_page.h> #include <library/cpp/monlib/dynamic_counters/counters.h> diff --git a/ydb/core/mon/mon.h b/ydb/core/mon/mon.h index 1cb5dbecd0..23e8570839 100644 --- a/ydb/core/mon/mon.h +++ b/ydb/core/mon/mon.h @@ -5,7 +5,7 @@ #include <library/cpp/monlib/service/pages/tablesorter/css_mon_page.h> #include <library/cpp/monlib/service/pages/tablesorter/js_mon_page.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> namespace NActors { diff --git a/ydb/core/mon/ya.make b/ydb/core/mon/ya.make index c717b0f5b9..759ea6333a 100644 --- a/ydb/core/mon/ya.make +++ b/ydb/core/mon/ya.make @@ -14,7 +14,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/lwtrace/mon library/cpp/string_utils/url ydb/core/base diff --git a/ydb/core/mon_alloc/monitor.cpp b/ydb/core/mon_alloc/monitor.cpp index 8afc7852c9..6a3071fc8c 100644 --- a/ydb/core/mon_alloc/monitor.cpp +++ b/ydb/core/mon_alloc/monitor.cpp @@ -5,12 +5,12 @@ #include <ydb/core/base/appdata.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/prof/tag.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/prof/tag.h> #include <library/cpp/html/pcdata/pcdata.h> #include <library/cpp/lfalloc/dbg_info/dbg_info.h> -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/malloc/api/malloc.h> #include <library/cpp/monlib/dynamic_counters/counters.h> #include <library/cpp/monlib/service/pages/templates.h> #include <library/cpp/ytalloc/api/ytalloc.h> diff --git a/ydb/core/mon_alloc/monitor.h b/ydb/core/mon_alloc/monitor.h index f6a8404b65..74eda80003 100644 --- a/ydb/core/mon_alloc/monitor.h +++ b/ydb/core/mon_alloc/monitor.h @@ -2,8 +2,8 @@ #include <ydb/core/control/immediate_control_board_impl.h> -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/actor.h> #include <library/cpp/monlib/dynamic_counters/counters.h> diff --git a/ydb/core/mon_alloc/profiler.cpp b/ydb/core/mon_alloc/profiler.cpp index bfff45c180..de54572f6e 100644 --- a/ydb/core/mon_alloc/profiler.cpp +++ b/ydb/core/mon_alloc/profiler.cpp @@ -1,12 +1,12 @@ #include "profiler.h" #include "tcmalloc.h" -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/mon.h> #include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/prof/tag.h> -#include <library/cpp/html/pcdata/pcdata.h> +#include <library/cpp/actors/prof/tag.h> +#include <library/cpp/html/pcdata/pcdata.h> #include <library/cpp/malloc/api/malloc.h> #include <library/cpp/monlib/service/pages/templates.h> @@ -17,7 +17,7 @@ #if defined(_linux_) && !defined(WITH_VALGRIND) #define EXEC_PROFILER_ENABLED -#include <library/cpp/execprofile/profile.h> +#include <library/cpp/execprofile/profile.h> #endif #include <util/datetime/base.h> diff --git a/ydb/core/mon_alloc/profiler.h b/ydb/core/mon_alloc/profiler.h index 4fba8941da..f60bd4c502 100644 --- a/ydb/core/mon_alloc/profiler.h +++ b/ydb/core/mon_alloc/profiler.h @@ -2,10 +2,10 @@ #include <ydb/core/protos/profiler.pb.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/events.h> #include <library/cpp/monlib/dynamic_counters/counters.h> diff --git a/ydb/core/mon_alloc/stats.cpp b/ydb/core/mon_alloc/stats.cpp index 050822241c..0e79e0616c 100644 --- a/ydb/core/mon_alloc/stats.cpp +++ b/ydb/core/mon_alloc/stats.cpp @@ -3,11 +3,11 @@ #include <ydb/core/base/counters.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <library/cpp/actors/core/process_stats.h> #include <library/cpp/lfalloc/dbg_info/dbg_info.h> -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/malloc/api/malloc.h> #include <library/cpp/monlib/dynamic_counters/counters.h> #include <library/cpp/ytalloc/api/ytalloc.h> diff --git a/ydb/core/mon_alloc/stats.h b/ydb/core/mon_alloc/stats.h index a5528e5afd..f16b12090a 100644 --- a/ydb/core/mon_alloc/stats.h +++ b/ydb/core/mon_alloc/stats.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/actor.h> #include <library/cpp/monlib/dynamic_counters/counters.h> diff --git a/ydb/core/mon_alloc/ya.make b/ydb/core/mon_alloc/ya.make index 972ea082f3..153e39cb9e 100644 --- a/ydb/core/mon_alloc/ya.make +++ b/ydb/core/mon_alloc/ya.make @@ -15,12 +15,12 @@ SRCS( ) PEERDIR( - library/cpp/actors/core - library/cpp/actors/prof - library/cpp/html/pcdata + library/cpp/actors/core + library/cpp/actors/prof + library/cpp/html/pcdata library/cpp/lfalloc/alloc_profiler library/cpp/lfalloc/dbg_info - library/cpp/malloc/api + library/cpp/malloc/api library/cpp/monlib/service/pages library/cpp/ytalloc/api ydb/core/base diff --git a/ydb/core/node_whiteboard/defs.h b/ydb/core/node_whiteboard/defs.h index 99e490cf97..31d8cdeeda 100644 --- a/ydb/core/node_whiteboard/defs.h +++ b/ydb/core/node_whiteboard/defs.h @@ -1,9 +1,9 @@ #pragma once // unique tag to fix pragma once gcc glueing: ./ydb/core/node_whiteboard/defs.h -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/event.h> -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/event.h> +#include <library/cpp/actors/core/actorid.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/debug/valgrind_check.h> #include <util/generic/array_ref.h> diff --git a/ydb/core/node_whiteboard/node_whiteboard.h b/ydb/core/node_whiteboard/node_whiteboard.h index cdf7601807..1a68575fe6 100644 --- a/ydb/core/node_whiteboard/node_whiteboard.h +++ b/ydb/core/node_whiteboard/node_whiteboard.h @@ -7,7 +7,7 @@ #include <ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.h> #include <ydb/core/blobstorage/groupinfo/blobstorage_groupinfo_iter.h> #include <ydb/core/protos/node_whiteboard.pb.h> -#include <library/cpp/actors/interconnect/events_local.h> +#include <library/cpp/actors/interconnect/events_local.h> #include <library/cpp/actors/core/interconnect.h> #include <ydb/core/base/tracing.h> diff --git a/ydb/core/node_whiteboard/ya.make b/ydb/core/node_whiteboard/ya.make index 2d9f4debd2..60524713a4 100644 --- a/ydb/core/node_whiteboard/ya.make +++ b/ydb/core/node_whiteboard/ya.make @@ -7,12 +7,12 @@ SRCS( ) PEERDIR( - library/cpp/actors/core - library/cpp/actors/helpers - library/cpp/actors/interconnect - library/cpp/actors/protos - library/cpp/deprecated/enum_codegen - library/cpp/logger + library/cpp/actors/core + library/cpp/actors/helpers + library/cpp/actors/interconnect + library/cpp/actors/protos + library/cpp/deprecated/enum_codegen + library/cpp/logger library/cpp/lwtrace/mon library/cpp/random_provider library/cpp/time_provider diff --git a/ydb/core/persqueue/cluster_tracker.cpp b/ydb/core/persqueue/cluster_tracker.cpp index 59fdea5c2b..6cb38043ac 100644 --- a/ydb/core/persqueue/cluster_tracker.cpp +++ b/ydb/core/persqueue/cluster_tracker.cpp @@ -4,7 +4,7 @@ #include <ydb/core/base/appdata.h> #include <ydb/core/kqp/kqp.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <util/generic/hash.h> #include <util/generic/scope.h> diff --git a/ydb/core/persqueue/cluster_tracker.h b/ydb/core/persqueue/cluster_tracker.h index 2ae06cf915..1370b4dbe2 100644 --- a/ydb/core/persqueue/cluster_tracker.h +++ b/ydb/core/persqueue/cluster_tracker.h @@ -2,10 +2,10 @@ #include <ydb/core/base/events.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actorid.h> -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/event_local.h> #include <library/cpp/monlib/dynamic_counters/counters.h> diff --git a/ydb/core/persqueue/events/global.h b/ydb/core/persqueue/events/global.h index e1957e7a16..80c7cb98d3 100644 --- a/ydb/core/persqueue/events/global.h +++ b/ydb/core/persqueue/events/global.h @@ -2,8 +2,8 @@ #include <ydb/core/keyvalue/defs.h> #include <ydb/core/tablet/tablet_counters.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actorid.h> #include <ydb/core/base/blobstorage.h> #include <ydb/core/protos/msgbus.pb.h> #include <ydb/public/api/protos/draft/persqueue_common.pb.h> diff --git a/ydb/core/persqueue/events/internal.h b/ydb/core/persqueue/events/internal.h index bc892988b4..7275920bd5 100644 --- a/ydb/core/persqueue/events/internal.h +++ b/ydb/core/persqueue/events/internal.h @@ -5,8 +5,8 @@ #include <ydb/core/protos/pqconfig.pb.h> #include <ydb/core/tablet/tablet_counters.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actorid.h> #include <util/generic/maybe.h> diff --git a/ydb/core/persqueue/partition.h b/ydb/core/persqueue/partition.h index 2eec26f251..1e92880ede 100644 --- a/ydb/core/persqueue/partition.h +++ b/ydb/core/persqueue/partition.h @@ -4,10 +4,10 @@ #include <ydb/core/base/quoter.h> #include <ydb/core/keyvalue/keyvalue_events.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/sliding_window/sliding_window.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/sliding_window/sliding_window.h> #include <ydb/core/protos/pqconfig.pb.h> #include <ydb/core/persqueue/events/internal.h> #include <ydb/library/persqueue/counter_time_keeper/counter_time_keeper.h> diff --git a/ydb/core/persqueue/pq_impl.h b/ydb/core/persqueue/pq_impl.h index bc3bfb10ba..09a9e03702 100644 --- a/ydb/core/persqueue/pq_impl.h +++ b/ydb/core/persqueue/pq_impl.h @@ -6,7 +6,7 @@ #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/persqueue/events/internal.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> namespace NKikimr { namespace NPQ { diff --git a/ydb/core/persqueue/pq_l2_service.h b/ydb/core/persqueue/pq_l2_service.h index a9c5eefd16..b4b52130d6 100644 --- a/ydb/core/persqueue/pq_l2_service.h +++ b/ydb/core/persqueue/pq_l2_service.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/actor.h> #include <atomic> diff --git a/ydb/core/persqueue/read_balancer.h b/ydb/core/persqueue/read_balancer.h index 6a07edcb78..5b33b9b20b 100644 --- a/ydb/core/persqueue/read_balancer.h +++ b/ydb/core/persqueue/read_balancer.h @@ -5,7 +5,7 @@ #include <ydb/core/tablet_flat/tablet_flat_executed.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/base/appdata.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/persqueue/events/global.h> #include <ydb/core/tablet_flat/flat_dbase_scheme.h> #include <ydb/core/tablet_flat/flat_cxx_database.h> diff --git a/ydb/core/persqueue/type_coders.h b/ydb/core/persqueue/type_coders.h index 26c2566d32..14f15991e1 100644 --- a/ydb/core/persqueue/type_coders.h +++ b/ydb/core/persqueue/type_coders.h @@ -2,9 +2,9 @@ #include "type_codecs_defs.h" -#include <library/cpp/containers/bitseq/bitvector.h> -#include <library/cpp/packedtypes/longs.h> -#include <library/cpp/packedtypes/zigzag.h> +#include <library/cpp/containers/bitseq/bitvector.h> +#include <library/cpp/packedtypes/longs.h> +#include <library/cpp/packedtypes/zigzag.h> #include <util/generic/typetraits.h> diff --git a/ydb/core/persqueue/type_decoders.h b/ydb/core/persqueue/type_decoders.h index 30a8846923..a4aa305a7d 100644 --- a/ydb/core/persqueue/type_decoders.h +++ b/ydb/core/persqueue/type_decoders.h @@ -2,9 +2,9 @@ #include "type_codecs_defs.h" -#include <library/cpp/containers/bitseq/bititerator.h> -#include <library/cpp/packedtypes/longs.h> -#include <library/cpp/packedtypes/zigzag.h> +#include <library/cpp/containers/bitseq/bititerator.h> +#include <library/cpp/packedtypes/longs.h> +#include <library/cpp/packedtypes/zigzag.h> #include <util/generic/deque.h> #include <util/generic/map.h> diff --git a/ydb/core/persqueue/user_info.h b/ydb/core/persqueue/user_info.h index 258e947c46..cea758385d 100644 --- a/ydb/core/persqueue/user_info.h +++ b/ydb/core/persqueue/user_info.h @@ -11,7 +11,7 @@ #include <ydb/core/tablet/tablet_counters_protobuf.h> #include <ydb/library/persqueue/topic_parser/topic_parser.h> -#include <library/cpp/sliding_window/sliding_window.h> +#include <library/cpp/sliding_window/sliding_window.h> #include <util/generic/set.h> diff --git a/ydb/core/persqueue/ut/ya.make b/ydb/core/persqueue/ut/ya.make index 7cbb0b9496..8034be4039 100644 --- a/ydb/core/persqueue/ut/ya.make +++ b/ydb/core/persqueue/ut/ya.make @@ -22,7 +22,7 @@ ENDIF() PEERDIR( library/cpp/getopt library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/svnversion ydb/core/testlib ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils ) diff --git a/ydb/core/persqueue/ut_slow/ya.make b/ydb/core/persqueue/ut_slow/ya.make index 9e018d205b..dd5d3cd8be 100644 --- a/ydb/core/persqueue/ut_slow/ya.make +++ b/ydb/core/persqueue/ut_slow/ya.make @@ -19,7 +19,7 @@ TIMEOUT(3600) PEERDIR( library/cpp/getopt library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/svnversion ydb/core/testlib ) diff --git a/ydb/core/protos/blobstorage.proto b/ydb/core/protos/blobstorage.proto index a08ccbf865..0d88c6ba94 100644 --- a/ydb/core/protos/blobstorage.proto +++ b/ydb/core/protos/blobstorage.proto @@ -1,5 +1,5 @@ -import "library/cpp/actors/protos/actors.proto"; -import "library/cpp/actors/protos/interconnect.proto"; +import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/interconnect.proto"; import "ydb/core/protos/base.proto"; import "ydb/core/protos/blobstorage_vdisk_config.proto"; import "ydb/core/protos/blobstorage_pdisk_config.proto"; diff --git a/ydb/core/protos/blobstorage_config.proto b/ydb/core/protos/blobstorage_config.proto index 10d0a29e6c..80d95f9e85 100644 --- a/ydb/core/protos/blobstorage_config.proto +++ b/ydb/core/protos/blobstorage_config.proto @@ -3,7 +3,7 @@ syntax = "proto3"; import "ydb/core/protos/blobstorage_disk.proto"; import "ydb/core/protos/blobstorage_disk_color.proto"; import "ydb/core/protos/blobstorage_pdisk_config.proto"; -import "library/cpp/actors/protos/interconnect.proto"; +import "library/cpp/actors/protos/interconnect.proto"; package NKikimrBlobStorage; diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index d64169d4fc..88ac9defe9 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -1,5 +1,5 @@ import "google/protobuf/descriptor.proto"; -import "library/cpp/actors/protos/interconnect.proto"; +import "library/cpp/actors/protos/interconnect.proto"; import "ydb/core/protos/blobstorage.proto"; import "ydb/core/protos/blobstorage_config.proto"; import "ydb/core/protos/blobstorage_vdisk_config.proto"; diff --git a/ydb/core/protos/console_config.proto b/ydb/core/protos/console_config.proto index d5a32d05c6..b2eda1fb99 100644 --- a/ydb/core/protos/console_config.proto +++ b/ydb/core/protos/console_config.proto @@ -1,4 +1,4 @@ -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "ydb/core/protos/config.proto"; import "ydb/core/protos/console_base.proto"; import "ydb/public/api/protos/ydb_status_codes.proto"; diff --git a/ydb/core/protos/flat_tx_scheme.proto b/ydb/core/protos/flat_tx_scheme.proto index dc06523e5c..7c6386b55d 100644 --- a/ydb/core/protos/flat_tx_scheme.proto +++ b/ydb/core/protos/flat_tx_scheme.proto @@ -1,4 +1,4 @@ -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "ydb/core/protos/base.proto"; import "ydb/core/protos/subdomains.proto"; import "ydb/core/protos/bind_channel_storage_pool.proto"; diff --git a/ydb/core/protos/hive.proto b/ydb/core/protos/hive.proto index 0059db81de..4f1d612795 100644 --- a/ydb/core/protos/hive.proto +++ b/ydb/core/protos/hive.proto @@ -1,4 +1,4 @@ -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "ydb/core/protos/base.proto"; import "ydb/core/protos/tablet.proto"; import "ydb/core/protos/subdomains.proto"; diff --git a/ydb/core/protos/kesus.proto b/ydb/core/protos/kesus.proto index 7c03a3ccd9..a30a2f16a1 100644 --- a/ydb/core/protos/kesus.proto +++ b/ydb/core/protos/kesus.proto @@ -5,7 +5,7 @@ package NKikimrKesus; option java_package = "ru.yandex.kikimr.proto"; option cc_enable_arenas = true; -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "ydb/public/api/protos/ydb_coordination.proto"; import "ydb/public/api/protos/ydb_status_codes.proto"; import "ydb/public/api/protos/ydb_issue_message.proto"; diff --git a/ydb/core/protos/kqp.proto b/ydb/core/protos/kqp.proto index 9b46b720e1..1a51c3810e 100644 --- a/ydb/core/protos/kqp.proto +++ b/ydb/core/protos/kqp.proto @@ -2,7 +2,7 @@ package NKikimrKqp; option java_package = "ru.yandex.kikimr.proto"; option cc_enable_arenas = true; -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "ydb/core/protos/kqp_physical.proto"; import "ydb/core/protos/kqp_stats.proto"; import "ydb/core/protos/query_stats.proto"; diff --git a/ydb/core/protos/local.proto b/ydb/core/protos/local.proto index a385a3cf3e..9ea616176c 100644 --- a/ydb/core/protos/local.proto +++ b/ydb/core/protos/local.proto @@ -1,4 +1,4 @@ -import "library/cpp/actors/protos/interconnect.proto"; +import "library/cpp/actors/protos/interconnect.proto"; import "ydb/core/protos/base.proto"; import "ydb/core/protos/tablet.proto"; import "ydb/core/protos/subdomains.proto"; diff --git a/ydb/core/protos/msgbus.proto b/ydb/core/protos/msgbus.proto index df7cda5980..feb373cee8 100644 --- a/ydb/core/protos/msgbus.proto +++ b/ydb/core/protos/msgbus.proto @@ -1,5 +1,5 @@ import "ydb/core/protos/console.proto"; -import "library/cpp/actors/protos/interconnect.proto"; +import "library/cpp/actors/protos/interconnect.proto"; import "ydb/core/protos/console_base.proto"; import "ydb/core/protos/console_config.proto"; import "ydb/core/protos/console_tenant.proto"; diff --git a/ydb/core/protos/msgbus_pq.proto b/ydb/core/protos/msgbus_pq.proto index 849b292383..64afc9828e 100644 --- a/ydb/core/protos/msgbus_pq.proto +++ b/ydb/core/protos/msgbus_pq.proto @@ -1,6 +1,6 @@ import "ydb/core/protos/pqconfig.proto"; import "ydb/public/api/protos/draft/persqueue_error_codes.proto"; -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; package NKikimrClient; option java_package = "ru.yandex.kikimr.proto"; diff --git a/ydb/core/protos/node_broker.proto b/ydb/core/protos/node_broker.proto index ee0908902c..ed1e9e3c0f 100644 --- a/ydb/core/protos/node_broker.proto +++ b/ydb/core/protos/node_broker.proto @@ -1,4 +1,4 @@ -import "library/cpp/actors/protos/interconnect.proto"; +import "library/cpp/actors/protos/interconnect.proto"; package NKikimrNodeBroker; option java_package = "ru.yandex.kikimr.proto"; diff --git a/ydb/core/protos/node_whiteboard.proto b/ydb/core/protos/node_whiteboard.proto index b96713ca29..b5eb3d0381 100644 --- a/ydb/core/protos/node_whiteboard.proto +++ b/ydb/core/protos/node_whiteboard.proto @@ -1,4 +1,4 @@ -import "library/cpp/actors/protos/interconnect.proto"; +import "library/cpp/actors/protos/interconnect.proto"; import "ydb/core/protos/tablet.proto"; import "ydb/core/protos/subdomains.proto"; import "ydb/core/protos/blobstorage_disk.proto"; diff --git a/ydb/core/protos/pqconfig.proto b/ydb/core/protos/pqconfig.proto index 7c85927449..e3660a1e47 100644 --- a/ydb/core/protos/pqconfig.proto +++ b/ydb/core/protos/pqconfig.proto @@ -7,7 +7,7 @@ import "ydb/core/protos/node_limits.proto"; import "ydb/core/protos/netclassifier.proto"; import "ydb/core/protos/services.proto"; -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; package NKikimrPQ; diff --git a/ydb/core/protos/statestorage.proto b/ydb/core/protos/statestorage.proto index 4165af89ba..eb3c2727bb 100644 --- a/ydb/core/protos/statestorage.proto +++ b/ydb/core/protos/statestorage.proto @@ -1,4 +1,4 @@ -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "ydb/core/protos/base.proto"; package NKikimrStateStorage; diff --git a/ydb/core/protos/tablet_pipe.proto b/ydb/core/protos/tablet_pipe.proto index e1fd3769f8..91cd46aca0 100644 --- a/ydb/core/protos/tablet_pipe.proto +++ b/ydb/core/protos/tablet_pipe.proto @@ -1,4 +1,4 @@ -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "ydb/core/protos/base.proto"; package NKikimrTabletPipe; diff --git a/ydb/core/protos/tablet_tracing_signals.proto b/ydb/core/protos/tablet_tracing_signals.proto index 51c1c7dd4b..62fe349bd7 100644 --- a/ydb/core/protos/tablet_tracing_signals.proto +++ b/ydb/core/protos/tablet_tracing_signals.proto @@ -1,4 +1,4 @@ -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "ydb/core/protos/tablet.proto"; import "ydb/core/protos/base.proto"; import "ydb/core/protos/tracing.proto"; diff --git a/ydb/core/protos/tenant_slot_broker.proto b/ydb/core/protos/tenant_slot_broker.proto index bccc7f7dc7..462d635d5a 100644 --- a/ydb/core/protos/tenant_slot_broker.proto +++ b/ydb/core/protos/tenant_slot_broker.proto @@ -1,4 +1,4 @@ -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; package NKikimrTenantSlotBroker; option java_package = "ru.yandex.kikimr.proto"; diff --git a/ydb/core/protos/tx.proto b/ydb/core/protos/tx.proto index 1f18e7eca6..e4eaebc48e 100644 --- a/ydb/core/protos/tx.proto +++ b/ydb/core/protos/tx.proto @@ -1,4 +1,4 @@ -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "ydb/core/protos/base.proto"; package NKikimrTx; diff --git a/ydb/core/protos/tx_datashard.proto b/ydb/core/protos/tx_datashard.proto index 89863b2540..db1054f054 100644 --- a/ydb/core/protos/tx_datashard.proto +++ b/ydb/core/protos/tx_datashard.proto @@ -1,7 +1,7 @@ option cc_enable_arenas = true; -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "ydb/core/protos/base.proto"; import "ydb/core/protos/kqp.proto"; import "ydb/core/protos/ssa.proto"; diff --git a/ydb/core/protos/tx_scheme.proto b/ydb/core/protos/tx_scheme.proto index 037db6c497..b9ebf5ee9d 100644 --- a/ydb/core/protos/tx_scheme.proto +++ b/ydb/core/protos/tx_scheme.proto @@ -1,4 +1,4 @@ -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "ydb/core/protos/base.proto"; import "ydb/core/protos/bind_channel_storage_pool.proto"; diff --git a/ydb/core/protos/ya.make b/ydb/core/protos/ya.make index 70bb65514c..8405b47792 100644 --- a/ydb/core/protos/ya.make +++ b/ydb/core/protos/ya.make @@ -134,7 +134,7 @@ SRCS( GENERATE_ENUM_SERIALIZATION(blobstorage_pdisk_config.pb.h) PEERDIR( - library/cpp/actors/protos + library/cpp/actors/protos ydb/core/yq/libs/config/protos ydb/library/login/protos ydb/library/mkql_proto/protos diff --git a/ydb/core/quoter/kesus_quoter_proxy.cpp b/ydb/core/quoter/kesus_quoter_proxy.cpp index 4d2d20691e..0b8489fe6a 100644 --- a/ydb/core/quoter/kesus_quoter_proxy.cpp +++ b/ydb/core/quoter/kesus_quoter_proxy.cpp @@ -9,9 +9,9 @@ #include <ydb/library/yql/public/issue/yql_issue_message.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <util/generic/map.h> #include <util/generic/hash.h> diff --git a/ydb/core/quoter/kesus_quoter_proxy.h b/ydb/core/quoter/kesus_quoter_proxy.h index ed79edfc9f..fa409aed05 100644 --- a/ydb/core/quoter/kesus_quoter_proxy.h +++ b/ydb/core/quoter/kesus_quoter_proxy.h @@ -3,9 +3,9 @@ #include <ydb/core/protos/kesus.pb.h> #include <ydb/core/tx/scheme_cache/scheme_cache.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actorid.h> -#include <library/cpp/containers/ring_buffer/ring_buffer.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/containers/ring_buffer/ring_buffer.h> #include <util/datetime/base.h> #include <util/generic/ptr.h> diff --git a/ydb/core/quoter/probes.h b/ydb/core/quoter/probes.h index c5ef9aca12..4d3a88097d 100644 --- a/ydb/core/quoter/probes.h +++ b/ydb/core/quoter/probes.h @@ -1,7 +1,7 @@ #pragma once #include <ydb/core/base/quoter.h> -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #include <util/string/builder.h> diff --git a/ydb/core/quoter/quoter_service_bandwidth_test/main.cpp b/ydb/core/quoter/quoter_service_bandwidth_test/main.cpp index a04106743e..d256b2c46c 100644 --- a/ydb/core/quoter/quoter_service_bandwidth_test/main.cpp +++ b/ydb/core/quoter/quoter_service_bandwidth_test/main.cpp @@ -1,7 +1,7 @@ #include "options.h" #include "server.h" -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> using namespace NKikimr; diff --git a/ydb/core/quoter/quoter_service_bandwidth_test/options.h b/ydb/core/quoter/quoter_service_bandwidth_test/options.h index 6dd98ebaea..eb11e39da1 100644 --- a/ydb/core/quoter/quoter_service_bandwidth_test/options.h +++ b/ydb/core/quoter/quoter_service_bandwidth_test/options.h @@ -1,6 +1,6 @@ #pragma once #include <library/cpp/getopt/opt.h> -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> #include <util/datetime/base.h> diff --git a/ydb/core/quoter/quoter_service_bandwidth_test/quota_requester.h b/ydb/core/quoter/quoter_service_bandwidth_test/quota_requester.h index 6f21fa652a..34b2d998a9 100644 --- a/ydb/core/quoter/quoter_service_bandwidth_test/quota_requester.h +++ b/ydb/core/quoter/quoter_service_bandwidth_test/quota_requester.h @@ -4,7 +4,7 @@ #include <ydb/core/base/quoter.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <random> diff --git a/ydb/core/quoter/quoter_service_bandwidth_test/ya.make b/ydb/core/quoter/quoter_service_bandwidth_test/ya.make index ddb00e5873..3989ea0e9b 100644 --- a/ydb/core/quoter/quoter_service_bandwidth_test/ya.make +++ b/ydb/core/quoter/quoter_service_bandwidth_test/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/colorizer + library/cpp/colorizer library/cpp/getopt ydb/core/base ydb/core/kesus/tablet diff --git a/ydb/core/quoter/quoter_service_impl.h b/ydb/core/quoter/quoter_service_impl.h index d27ea134e1..df8c97cf13 100644 --- a/ydb/core/quoter/quoter_service_impl.h +++ b/ydb/core/quoter/quoter_service_impl.h @@ -7,10 +7,10 @@ #include <ydb/core/base/path.h> #include <ydb/core/tx/scheme_cache/scheme_cache.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/lwtrace/shuttle.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/lwtrace/shuttle.h> #include <util/generic/set.h> #include <util/generic/deque.h> diff --git a/ydb/core/quoter/ut_helpers.h b/ydb/core/quoter/ut_helpers.h index ea76fdc0ae..328e9cb7ce 100644 --- a/ydb/core/quoter/ut_helpers.h +++ b/ydb/core/quoter/ut_helpers.h @@ -13,7 +13,7 @@ #include <ydb/core/protos/flat_tx_scheme.pb.h> #include <ydb/core/protos/kesus.pb.h> -#include <library/cpp/testing/gmock_in_unittest/gmock.h> +#include <library/cpp/testing/gmock_in_unittest/gmock.h> #include <library/cpp/testing/unittest/registar.h> #include <util/generic/hash_set.h> diff --git a/ydb/core/quoter/ya.make b/ydb/core/quoter/ya.make index 937aae960d..48986bda63 100644 --- a/ydb/core/quoter/ya.make +++ b/ydb/core/quoter/ya.make @@ -16,8 +16,8 @@ SRCS( ) PEERDIR( - library/cpp/actors/core - library/cpp/containers/ring_buffer + library/cpp/actors/core + library/cpp/containers/ring_buffer ydb/core/base ydb/core/kesus/tablet ydb/core/tx/scheme_cache diff --git a/ydb/core/scheme/scheme_tabledefs.h b/ydb/core/scheme/scheme_tabledefs.h index 190233fdee..731036125e 100644 --- a/ydb/core/scheme/scheme_tabledefs.h +++ b/ydb/core/scheme/scheme_tabledefs.h @@ -8,7 +8,7 @@ #include <ydb/core/scheme_types/scheme_types.h> #include <ydb/library/aclib/aclib.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <util/generic/maybe.h> #include <util/generic/map.h> diff --git a/ydb/core/scheme/scheme_types_defs.h b/ydb/core/scheme/scheme_types_defs.h index 32a3a2b872..ad05075215 100644 --- a/ydb/core/scheme/scheme_types_defs.h +++ b/ydb/core/scheme/scheme_types_defs.h @@ -2,7 +2,7 @@ #include "scheme_type_id.h" -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actorid.h> #include <ydb/core/scheme_types/scheme_types_defs.h> #include <util/stream/output.h> diff --git a/ydb/core/scheme/ya.make b/ydb/core/scheme/ya.make index 128ef015bf..e7e829f6f2 100644 --- a/ydb/core/scheme/ya.make +++ b/ydb/core/scheme/ya.make @@ -14,10 +14,10 @@ SRCS( ) PEERDIR( - library/cpp/actors/core - library/cpp/charset - library/cpp/containers/bitseq - library/cpp/deprecated/enum_codegen + library/cpp/actors/core + library/cpp/charset + library/cpp/containers/bitseq + library/cpp/deprecated/enum_codegen library/cpp/yson ydb/core/base ydb/core/scheme_types diff --git a/ydb/core/security/ticket_parser.cpp b/ydb/core/security/ticket_parser.cpp index c7d024d03d..2d62abd65a 100644 --- a/ydb/core/security/ticket_parser.cpp +++ b/ydb/core/security/ticket_parser.cpp @@ -1,9 +1,9 @@ -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/digest/md5/md5.h> -#include <library/cpp/openssl/init/init.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/digest/md5/md5.h> +#include <library/cpp/openssl/init/init.h> #include <library/cpp/string_utils/base64/base64.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/counters.h> diff --git a/ydb/core/security/ya.make b/ydb/core/security/ya.make index 514b0c3474..b430fdc62e 100644 --- a/ydb/core/security/ya.make +++ b/ydb/core/security/ya.make @@ -15,9 +15,9 @@ SRCS( PEERDIR( library/cpp/actors/core - library/cpp/actors/http + library/cpp/actors/http library/cpp/monlib/service/pages - library/cpp/openssl/io + library/cpp/openssl/io ydb/core/base ydb/core/protos ydb/library/aclib diff --git a/ydb/core/sys_view/common/events.h b/ydb/core/sys_view/common/events.h index 6e19aadc2b..c05b3c9e2a 100644 --- a/ydb/core/sys_view/common/events.h +++ b/ydb/core/sys_view/common/events.h @@ -5,7 +5,7 @@ #include <ydb/core/base/events.h> #include <ydb/core/base/pathid.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/events.h> #include <ydb/core/protos/sys_view.pb.h> namespace NKikimr { diff --git a/ydb/core/sys_view/common/scan_actor_base_impl.h b/ydb/core/sys_view/common/scan_actor_base_impl.h index 298a8efbc0..5840cf9cfa 100644 --- a/ydb/core/sys_view/common/scan_actor_base_impl.h +++ b/ydb/core/sys_view/common/scan_actor_base_impl.h @@ -11,9 +11,9 @@ #include <ydb/library/yql/dq/actors/compute/dq_compute_actor.h> #include <ydb/library/yql/public/issue/yql_issue_message.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/base/tablet_pipecache.h> #include <ydb/core/tx/schemeshard/schemeshard.h> diff --git a/ydb/core/sys_view/common/ya.make b/ydb/core/sys_view/common/ya.make index b4ec91b3d8..59940bd41c 100644 --- a/ydb/core/sys_view/common/ya.make +++ b/ydb/core/sys_view/common/ya.make @@ -17,7 +17,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/core/base ydb/core/protos ydb/core/tablet_flat diff --git a/ydb/core/sys_view/nodes/nodes.cpp b/ydb/core/sys_view/nodes/nodes.cpp index a2322de9f9..7a1eb149bd 100644 --- a/ydb/core/sys_view/nodes/nodes.cpp +++ b/ydb/core/sys_view/nodes/nodes.cpp @@ -7,9 +7,9 @@ #include <ydb/library/yql/dq/actors/compute/dq_compute_actor.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NSysView { diff --git a/ydb/core/sys_view/nodes/ya.make b/ydb/core/sys_view/nodes/ya.make index 3dc17dd412..407c73fd33 100644 --- a/ydb/core/sys_view/nodes/ya.make +++ b/ydb/core/sys_view/nodes/ya.make @@ -11,7 +11,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/core/base ydb/core/kqp/runtime ydb/core/sys_view/common diff --git a/ydb/core/sys_view/partition_stats/partition_stats.cpp b/ydb/core/sys_view/partition_stats/partition_stats.cpp index d6ea9ff73b..3145301766 100644 --- a/ydb/core/sys_view/partition_stats/partition_stats.cpp +++ b/ydb/core/sys_view/partition_stats/partition_stats.cpp @@ -7,7 +7,7 @@ #include <ydb/library/yql/dq/actors/compute/dq_compute_actor.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NSysView { diff --git a/ydb/core/sys_view/partition_stats/ya.make b/ydb/core/sys_view/partition_stats/ya.make index d24bf5c89d..737182ae18 100644 --- a/ydb/core/sys_view/partition_stats/ya.make +++ b/ydb/core/sys_view/partition_stats/ya.make @@ -11,7 +11,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/core/base ydb/core/kqp/runtime ydb/core/sys_view/common diff --git a/ydb/core/sys_view/query_stats/query_stats.cpp b/ydb/core/sys_view/query_stats/query_stats.cpp index 918c9b781e..57bd9a49f1 100644 --- a/ydb/core/sys_view/query_stats/query_stats.cpp +++ b/ydb/core/sys_view/query_stats/query_stats.cpp @@ -11,10 +11,10 @@ #include <ydb/library/yql/dq/actors/compute/dq_compute_actor.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> namespace NKikimr { namespace NSysView { diff --git a/ydb/core/sys_view/query_stats/ya.make b/ydb/core/sys_view/query_stats/ya.make index 8a572dbeae..23e564676e 100644 --- a/ydb/core/sys_view/query_stats/ya.make +++ b/ydb/core/sys_view/query_stats/ya.make @@ -13,7 +13,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/core/base ydb/core/kqp/runtime ydb/core/sys_view/common diff --git a/ydb/core/sys_view/service/sysview_service.cpp b/ydb/core/sys_view/service/sysview_service.cpp index 1f56906599..5c01fd8e95 100644 --- a/ydb/core/sys_view/service/sysview_service.cpp +++ b/ydb/core/sys_view/service/sysview_service.cpp @@ -10,9 +10,9 @@ #include <ydb/core/tx/scheme_cache/scheme_cache.h> #include <ydb/core/mind/tenant_pool.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> using namespace NActors; diff --git a/ydb/core/sys_view/service/ya.make b/ydb/core/sys_view/service/ya.make index 133557dbe1..58b863cfbf 100644 --- a/ydb/core/sys_view/service/ya.make +++ b/ydb/core/sys_view/service/ya.make @@ -18,7 +18,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/core/base ydb/core/protos ydb/library/aclib/protos diff --git a/ydb/core/sys_view/storage/ya.make b/ydb/core/sys_view/storage/ya.make index 324b36b798..539abfe1a0 100644 --- a/ydb/core/sys_view/storage/ya.make +++ b/ydb/core/sys_view/storage/ya.make @@ -19,7 +19,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/core/base ydb/core/kqp/runtime ydb/core/sys_view/common diff --git a/ydb/core/tablet/bootstrapper.cpp b/ydb/core/tablet/bootstrapper.cpp index d2e5dd8b7f..50019bea69 100644 --- a/ydb/core/tablet/bootstrapper.cpp +++ b/ydb/core/tablet/bootstrapper.cpp @@ -4,8 +4,8 @@ #include <ydb/core/base/statestorage.h> #include <ydb/core/base/appdata.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/protos/bootstrapper.pb.h> diff --git a/ydb/core/tablet/node_tablet_monitor.cpp b/ydb/core/tablet/node_tablet_monitor.cpp index 8bb34e7ea0..433f921044 100644 --- a/ydb/core/tablet/node_tablet_monitor.cpp +++ b/ydb/core/tablet/node_tablet_monitor.cpp @@ -1,12 +1,12 @@ #include "node_tablet_monitor.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/appdata.h> #include <library/cpp/monlib/service/pages/templates.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> #include <util/generic/algorithm.h> #include <ydb/core/base/tablet_types.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> diff --git a/ydb/core/tablet/node_tablet_monitor.h b/ydb/core/tablet/node_tablet_monitor.h index 0fe8891200..fa4bc82888 100644 --- a/ydb/core/tablet/node_tablet_monitor.h +++ b/ydb/core/tablet/node_tablet_monitor.h @@ -1,10 +1,10 @@ #pragma once #include "defs.h" -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/event.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/event.h> +#include <library/cpp/actors/core/interconnect.h> #include <ydb/core/base/events.h> #include <ydb/core/protos/node_whiteboard.pb.h> #include <util/generic/ptr.h> diff --git a/ydb/core/tablet/node_whiteboard.cpp b/ydb/core/tablet/node_whiteboard.cpp index 783758e99d..6c2d056814 100644 --- a/ydb/core/tablet/node_whiteboard.cpp +++ b/ydb/core/tablet/node_whiteboard.cpp @@ -1,11 +1,11 @@ #include <cmath> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/svnversion/svnversion.h> #include <util/system/info.h> #include <ydb/core/base/appdata.h> #include <ydb/core/mon_alloc/stats.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <library/cpp/actors/core/process_stats.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include "tablet_counters.h" diff --git a/ydb/core/tablet/resource_broker.h b/ydb/core/tablet/resource_broker.h index 095702cc19..4122980d24 100644 --- a/ydb/core/tablet/resource_broker.h +++ b/ydb/core/tablet/resource_broker.h @@ -4,9 +4,9 @@ #include <ydb/core/protos/resource_broker.pb.h> -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/event.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/event.h> #include <library/cpp/monlib/dynamic_counters/counters.h> #include <array> diff --git a/ydb/core/tablet/resource_broker_impl.h b/ydb/core/tablet/resource_broker_impl.h index 2c781692f6..358215f08f 100644 --- a/ydb/core/tablet/resource_broker_impl.h +++ b/ydb/core/tablet/resource_broker_impl.h @@ -5,7 +5,7 @@ #include <ydb/core/mon/mon.h> #include <ydb/core/base/appdata.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/ptr.h> #include <util/generic/set.h> diff --git a/ydb/core/tablet/tablet_counters.h b/ydb/core/tablet/tablet_counters.h index a8cc27e9ed..97a3a39132 100644 --- a/ydb/core/tablet/tablet_counters.h +++ b/ydb/core/tablet/tablet_counters.h @@ -2,7 +2,7 @@ #include "defs.h" #include <util/generic/singleton.h> #include <util/generic/vector.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <library/cpp/monlib/service/pages/templates.h> #include <google/protobuf/descriptor.pb.h> #include <ydb/core/protos/counters.pb.h> diff --git a/ydb/core/tablet/tablet_counters_aggregator.cpp b/ydb/core/tablet/tablet_counters_aggregator.cpp index 1885b26e09..1805fcde62 100644 --- a/ydb/core/tablet/tablet_counters_aggregator.cpp +++ b/ydb/core/tablet/tablet_counters_aggregator.cpp @@ -1,10 +1,10 @@ #include "tablet_counters_aggregator.h" #include "tablet_counters_app.h" -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/core/mon.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <ydb/core/base/tablet_resolver.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/base/appdata.h> diff --git a/ydb/core/tablet/tablet_counters_aggregator.h b/ydb/core/tablet/tablet_counters_aggregator.h index db350d41cb..f8f4d485e5 100644 --- a/ydb/core/tablet/tablet_counters_aggregator.h +++ b/ydb/core/tablet/tablet_counters_aggregator.h @@ -4,9 +4,9 @@ #include "defs.h" #include "tablet_counters.h" -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/event.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/event.h> #include <ydb/core/base/blobstorage.h> #include <ydb/core/protos/tablet_counters_aggregator.pb.h> diff --git a/ydb/core/tablet/tablet_counters_aggregator_ut.cpp b/ydb/core/tablet/tablet_counters_aggregator_ut.cpp index 707ffb977e..944281f998 100644 --- a/ydb/core/tablet/tablet_counters_aggregator_ut.cpp +++ b/ydb/core/tablet/tablet_counters_aggregator_ut.cpp @@ -1,5 +1,5 @@ #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> #include <ydb/core/testlib/basics/runtime.h> #include <ydb/core/testlib/basics/appdata.h> #include "tablet_counters_aggregator.h" diff --git a/ydb/core/tablet/tablet_impl.h b/ydb/core/tablet/tablet_impl.h index b47b1f1097..d2e486a29b 100644 --- a/ydb/core/tablet/tablet_impl.h +++ b/ydb/core/tablet/tablet_impl.h @@ -7,7 +7,7 @@ #include <ydb/core/base/blobstorage.h> #include <ydb/core/tablet/tablet_metrics.h> -#include <library/cpp/actors/core/scheduler_cookie.h> +#include <library/cpp/actors/core/scheduler_cookie.h> #include <util/generic/deque.h> #include <ydb/core/base/tracing.h> diff --git a/ydb/core/tablet/tablet_list_renderer.cpp b/ydb/core/tablet/tablet_list_renderer.cpp index ad36f12a29..9adff5278f 100644 --- a/ydb/core/tablet/tablet_list_renderer.cpp +++ b/ydb/core/tablet/tablet_list_renderer.cpp @@ -1,7 +1,7 @@ #include "tablet_list_renderer.h" #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/tablet/tablet_sys.h> #include <library/cpp/monlib/service/pages/templates.h> #include <util/generic/algorithm.h> diff --git a/ydb/core/tablet/tablet_monitoring_proxy.cpp b/ydb/core/tablet/tablet_monitoring_proxy.cpp index a61a43b7e5..6b86c8d47f 100644 --- a/ydb/core/tablet/tablet_monitoring_proxy.cpp +++ b/ydb/core/tablet/tablet_monitoring_proxy.cpp @@ -1,8 +1,8 @@ #include "tablet_monitoring_proxy.h" -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/tablet_resolver.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/base/statestorage.h> diff --git a/ydb/core/tablet/tablet_monitoring_proxy.h b/ydb/core/tablet/tablet_monitoring_proxy.h index 07fd7888db..268eca6284 100644 --- a/ydb/core/tablet/tablet_monitoring_proxy.h +++ b/ydb/core/tablet/tablet_monitoring_proxy.h @@ -3,9 +3,9 @@ //////////////////////////////////////////// #include "defs.h" -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/event.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/event.h> #include <ydb/core/base/blobstorage.h> #include <ydb/core/base/tablet_pipe.h> diff --git a/ydb/core/tablet/tablet_pipe_client.cpp b/ydb/core/tablet/tablet_pipe_client.cpp index 2fa35af9a0..e82fb29452 100644 --- a/ydb/core/tablet/tablet_pipe_client.cpp +++ b/ydb/core/tablet/tablet_pipe_client.cpp @@ -1,14 +1,14 @@ #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/base/tabletid.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/base/tablet_resolver.h> #include <ydb/core/base/hive.h> #include <ydb/core/base/appdata.h> -#include <library/cpp/actors/util/queue_oneone_inplace.h> +#include <library/cpp/actors/util/queue_oneone_inplace.h> #if defined BLOG_D || defined BLOG_I || defined BLOG_ERROR #error log macro definition clash diff --git a/ydb/core/tablet/tablet_pipe_client_cache.cpp b/ydb/core/tablet/tablet_pipe_client_cache.cpp index 47b81e4568..9a63217a97 100644 --- a/ydb/core/tablet/tablet_pipe_client_cache.cpp +++ b/ydb/core/tablet/tablet_pipe_client_cache.cpp @@ -1,5 +1,5 @@ #include "tablet_pipe_client_cache.h" -#include <library/cpp/actors/core/executor_thread.h> +#include <library/cpp/actors/core/executor_thread.h> #include <ydb/core/util/cache.h> #include <util/generic/map.h> #include <util/system/mutex.h> diff --git a/ydb/core/tablet/tablet_pipe_server.cpp b/ydb/core/tablet/tablet_pipe_server.cpp index b7c669e72c..8a18cf0d74 100644 --- a/ydb/core/tablet/tablet_pipe_server.cpp +++ b/ydb/core/tablet/tablet_pipe_server.cpp @@ -1,8 +1,8 @@ #include <ydb/core/base/tablet_pipe.h> -#include <library/cpp/actors/core/executor_thread.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/executor_thread.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/log.h> #include <util/generic/hash_set.h> namespace NKikimr { diff --git a/ydb/core/tablet/tablet_pipe_ut.cpp b/ydb/core/tablet/tablet_pipe_ut.cpp index 2a528070fb..0429cddf74 100644 --- a/ydb/core/tablet/tablet_pipe_ut.cpp +++ b/ydb/core/tablet/tablet_pipe_ut.cpp @@ -1,13 +1,13 @@ #include <ydb/core/testlib/tablet_helpers.h> #include <ydb/core/base/tablet_pipe.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/protos/services_common.pb.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/protos/services_common.pb.h> #include <ydb/core/base/tablet_resolver.h> #include <ydb/core/tx/tx.h> #include <library/cpp/testing/unittest/registar.h> #include <ydb/core/tablet_flat/tablet_flat_executed.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { struct TEvProducerTablet { diff --git a/ydb/core/tablet/tablet_pipecache.cpp b/ydb/core/tablet/tablet_pipecache.cpp index 292571f661..79f4af3699 100644 --- a/ydb/core/tablet/tablet_pipecache.cpp +++ b/ydb/core/tablet/tablet_pipecache.cpp @@ -3,7 +3,7 @@ #include <util/generic/set.h> #include <util/generic/hash.h> #include <util/generic/hash_set.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { diff --git a/ydb/core/tablet/tablet_req_blockbs.cpp b/ydb/core/tablet/tablet_req_blockbs.cpp index 7e2e94ec95..94f7f1295a 100644 --- a/ydb/core/tablet/tablet_req_blockbs.cpp +++ b/ydb/core/tablet/tablet_req_blockbs.cpp @@ -1,6 +1,6 @@ #include "tablet_impl.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/set.h> namespace NKikimr { diff --git a/ydb/core/tablet/tablet_req_delete.cpp b/ydb/core/tablet/tablet_req_delete.cpp index 754c79bb32..c5c693bada 100644 --- a/ydb/core/tablet/tablet_req_delete.cpp +++ b/ydb/core/tablet/tablet_req_delete.cpp @@ -1,6 +1,6 @@ #include "tablet_impl.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <util/generic/hash_set.h> diff --git a/ydb/core/tablet/tablet_req_findlatest.cpp b/ydb/core/tablet/tablet_req_findlatest.cpp index ca3d09aa43..577fdcb9f2 100644 --- a/ydb/core/tablet/tablet_req_findlatest.cpp +++ b/ydb/core/tablet/tablet_req_findlatest.cpp @@ -1,6 +1,6 @@ #include "tablet_impl.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #if defined BLOG_D || defined BLOG_I || defined BLOG_ERROR #error log macro definition clash diff --git a/ydb/core/tablet/tablet_req_rebuildhistory.cpp b/ydb/core/tablet/tablet_req_rebuildhistory.cpp index c0b4c0c2bc..c0310a2f99 100644 --- a/ydb/core/tablet/tablet_req_rebuildhistory.cpp +++ b/ydb/core/tablet/tablet_req_rebuildhistory.cpp @@ -1,12 +1,12 @@ #include "tablet_impl.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/tablet/tablet_metrics.h> #include <util/generic/map.h> #include <util/generic/set.h> #include <util/string/builder.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/protos/services.pb.h> #include <google/protobuf/text_format.h> diff --git a/ydb/core/tablet/tablet_req_reset.cpp b/ydb/core/tablet/tablet_req_reset.cpp index b73c68c120..6681c3d14d 100644 --- a/ydb/core/tablet/tablet_req_reset.cpp +++ b/ydb/core/tablet/tablet_req_reset.cpp @@ -1,8 +1,8 @@ #include "tablet_impl.h" #include "tablet_sys.h" #include <ydb/core/base/logoblob.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { diff --git a/ydb/core/tablet/tablet_req_writelog.cpp b/ydb/core/tablet/tablet_req_writelog.cpp index 7c4d02c405..e16ba358fc 100644 --- a/ydb/core/tablet/tablet_req_writelog.cpp +++ b/ydb/core/tablet/tablet_req_writelog.cpp @@ -1,7 +1,7 @@ #include "tablet_impl.h" #include <ydb/core/base/blobstorage.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/tablet/tablet_metrics.h> #include <util/random/random.h> diff --git a/ydb/core/tablet/tablet_resolver.cpp b/ydb/core/tablet/tablet_resolver.cpp index c0a39a2216..2413ba5136 100644 --- a/ydb/core/tablet/tablet_resolver.cpp +++ b/ydb/core/tablet/tablet_resolver.cpp @@ -5,11 +5,11 @@ #include <ydb/core/base/tabletid.h> #include <ydb/core/base/tablet.h> #include <ydb/core/base/appdata.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <ydb/core/util/cache.h> #include <ydb/core/util/queue_oneone_inplace.h> #include <util/generic/map.h> diff --git a/ydb/core/tablet/tablet_responsiveness_pinger.h b/ydb/core/tablet/tablet_responsiveness_pinger.h index 93954ea0b4..60122f88b7 100644 --- a/ydb/core/tablet/tablet_responsiveness_pinger.h +++ b/ydb/core/tablet/tablet_responsiveness_pinger.h @@ -1,7 +1,7 @@ #pragma once #include "defs.h" #include "tablet_counters.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> namespace NKikimr { diff --git a/ydb/core/tablet/tablet_sys.h b/ydb/core/tablet/tablet_sys.h index 661d75a4e0..9f75b95606 100644 --- a/ydb/core/tablet/tablet_sys.h +++ b/ydb/core/tablet/tablet_sys.h @@ -2,10 +2,10 @@ #include "defs.h" #include "tablet_impl.h" #include "tablet_setup.h" -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/base/tablet_pipe.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/intrlist.h> #include <util/generic/set.h> diff --git a/ydb/core/tablet/ut/ya.make b/ydb/core/tablet/ut/ya.make index 52440600e1..b4fcf08a0b 100644 --- a/ydb/core/tablet/ut/ya.make +++ b/ydb/core/tablet/ut/ya.make @@ -16,7 +16,7 @@ SPLIT_FACTOR(50) PEERDIR( library/cpp/getopt library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/svnversion ydb/core/testlib ) diff --git a/ydb/core/tablet/ya.make b/ydb/core/tablet/ya.make index 25e611b408..390c4612c7 100644 --- a/ydb/core/tablet/ya.make +++ b/ydb/core/tablet/ya.make @@ -54,12 +54,12 @@ SRCS( ) PEERDIR( - library/cpp/actors/core - library/cpp/actors/helpers + library/cpp/actors/core + library/cpp/actors/helpers library/cpp/actors/protos - library/cpp/actors/util - library/cpp/blockcodecs - library/cpp/deprecated/enum_codegen + library/cpp/actors/util + library/cpp/blockcodecs + library/cpp/deprecated/enum_codegen library/cpp/yson ydb/core/base ydb/core/mon diff --git a/ydb/core/tablet_flat/flat_bio_events.h b/ydb/core/tablet_flat/flat_bio_events.h index dae56ecca0..26e269f85a 100644 --- a/ydb/core/tablet_flat/flat_bio_events.h +++ b/ydb/core/tablet_flat/flat_bio_events.h @@ -5,7 +5,7 @@ #include "flat_sausage_fetch.h" #include <ydb/core/protos/base.pb.h> #include <ydb/core/base/events.h> -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/event_local.h> namespace NKikimr { namespace NTabletFlatExecutor { diff --git a/ydb/core/tablet_flat/flat_boot_gclog.h b/ydb/core/tablet_flat/flat_boot_gclog.h index ced4c72265..3e383786b8 100644 --- a/ydb/core/tablet_flat/flat_boot_gclog.h +++ b/ydb/core/tablet_flat/flat_boot_gclog.h @@ -6,7 +6,7 @@ #include "flat_bio_events.h" #include <ydb/core/util/pb.h> -#include <library/cpp/blockcodecs/codecs.h> +#include <library/cpp/blockcodecs/codecs.h> #include <util/generic/xrange.h> namespace NKikimr { diff --git a/ydb/core/tablet_flat/flat_boot_loans.h b/ydb/core/tablet_flat/flat_boot_loans.h index d4a98224ac..12d087a07c 100644 --- a/ydb/core/tablet_flat/flat_boot_loans.h +++ b/ydb/core/tablet_flat/flat_boot_loans.h @@ -6,7 +6,7 @@ #include "flat_executor_borrowlogic.h" #include <ydb/core/util/pb.h> -#include <library/cpp/blockcodecs/codecs.h> +#include <library/cpp/blockcodecs/codecs.h> #include <util/generic/xrange.h> namespace NKikimr { diff --git a/ydb/core/tablet_flat/flat_exec_broker.h b/ydb/core/tablet_flat/flat_exec_broker.h index 7e2647419f..a1f7be36ab 100644 --- a/ydb/core/tablet_flat/flat_exec_broker.h +++ b/ydb/core/tablet_flat/flat_exec_broker.h @@ -3,7 +3,7 @@ #include "util_basics.h" #include "flat_broker.h" #include <ydb/core/tablet/resource_broker.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr { namespace NTabletFlatExecutor { diff --git a/ydb/core/tablet_flat/flat_exec_memory.h b/ydb/core/tablet_flat/flat_exec_memory.h index 9f827bd75e..1016df8e68 100644 --- a/ydb/core/tablet_flat/flat_exec_memory.h +++ b/ydb/core/tablet_flat/flat_exec_memory.h @@ -4,7 +4,7 @@ #include "flat_exec_broker.h" #include "util_fmt_line.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr { namespace NTabletFlatExecutor { diff --git a/ydb/core/tablet_flat/flat_executor_db_mon.cpp b/ydb/core/tablet_flat/flat_executor_db_mon.cpp index d5353747be..379e5586a4 100644 --- a/ydb/core/tablet_flat/flat_executor_db_mon.cpp +++ b/ydb/core/tablet_flat/flat_executor_db_mon.cpp @@ -5,7 +5,7 @@ #include <util/stream/hex.h> #include <util/string/escape.h> -#include <library/cpp/html/pcdata/pcdata.h> +#include <library/cpp/html/pcdata/pcdata.h> namespace NKikimr { namespace NTabletFlatExecutor { diff --git a/ydb/core/tablet_flat/flat_ops_compact.h b/ydb/core/tablet_flat/flat_ops_compact.h index 2ac81c4113..9f506d7a4d 100644 --- a/ydb/core/tablet_flat/flat_ops_compact.h +++ b/ydb/core/tablet_flat/flat_ops_compact.h @@ -15,7 +15,7 @@ #include <ydb/core/base/blobstorage.h> #include <ydb/core/base/appdata.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include <bitset> diff --git a/ydb/core/tablet_flat/flat_page_data.h b/ydb/core/tablet_flat/flat_page_data.h index aab03c724d..a48db13f08 100644 --- a/ydb/core/tablet_flat/flat_page_data.h +++ b/ydb/core/tablet_flat/flat_page_data.h @@ -8,7 +8,7 @@ #include <ydb/core/base/shared_data.h> -#include <library/cpp/blockcodecs/codecs.h> +#include <library/cpp/blockcodecs/codecs.h> #include <util/generic/buffer.h> namespace NKikimr { diff --git a/ydb/core/tablet_flat/flat_sausage_meta.cpp b/ydb/core/tablet_flat/flat_sausage_meta.cpp index 6f708945a0..c382a128cc 100644 --- a/ydb/core/tablet_flat/flat_sausage_meta.cpp +++ b/ydb/core/tablet_flat/flat_sausage_meta.cpp @@ -1,6 +1,6 @@ #include "flat_sausage_align.h" #include "flat_sausage_meta.h" -#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/digest/crc32c/crc32c.h> namespace NKikimr { namespace NPageCollection { diff --git a/ydb/core/tablet_flat/flat_sausage_slicer.h b/ydb/core/tablet_flat/flat_sausage_slicer.h index 0dd6230902..195a97810c 100644 --- a/ydb/core/tablet_flat/flat_sausage_slicer.h +++ b/ydb/core/tablet_flat/flat_sausage_slicer.h @@ -3,7 +3,7 @@ #include "util_fmt_abort.h" #include "flat_sausage_grind.h" #include <util/thread/singleton.h> -#include <library/cpp/blockcodecs/codecs.h> +#include <library/cpp/blockcodecs/codecs.h> namespace NKikimr { namespace NPageCollection { diff --git a/ydb/core/tablet_flat/flat_scan_actor.h b/ydb/core/tablet_flat/flat_scan_actor.h index 5cbf2797a0..174b3d00e1 100644 --- a/ydb/core/tablet_flat/flat_scan_actor.h +++ b/ydb/core/tablet_flat/flat_scan_actor.h @@ -14,9 +14,9 @@ #include <ydb/core/base/appdata.h> #include <ydb/core/base/counters.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/cast.h> namespace NKikimr { diff --git a/ydb/core/tablet_flat/flat_scan_events.h b/ydb/core/tablet_flat/flat_scan_events.h index 730f94b075..fbed542d44 100644 --- a/ydb/core/tablet_flat/flat_scan_events.h +++ b/ydb/core/tablet_flat/flat_scan_events.h @@ -7,7 +7,7 @@ #include "flat_fwd_sieve.h" #include "flat_table_subset.h" #include "flat_executor_misc.h" -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/event_local.h> namespace NKikimr { namespace NTabletFlatExecutor { diff --git a/ydb/core/tablet_flat/shared_sausagecache.cpp b/ydb/core/tablet_flat/shared_sausagecache.cpp index c60c30202b..4fdde04a19 100644 --- a/ydb/core/tablet_flat/shared_sausagecache.cpp +++ b/ydb/core/tablet_flat/shared_sausagecache.cpp @@ -6,7 +6,7 @@ #include <ydb/core/util/cache_cache.h> #include <ydb/core/util/page_map.h> #include <ydb/core/base/blobstorage.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <library/cpp/containers/stack_vector/stack_vec.h> #include <util/generic/set.h> diff --git a/ydb/core/tablet_flat/test/libs/exec/dummy.h b/ydb/core/tablet_flat/test/libs/exec/dummy.h index 5c6e2f5b4f..adc9b87c6a 100644 --- a/ydb/core/tablet_flat/test/libs/exec/dummy.h +++ b/ydb/core/tablet_flat/test/libs/exec/dummy.h @@ -3,7 +3,7 @@ #include "events.h" #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/tablet_flat/tablet_flat_executed.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include <util/system/type_name.h> namespace NKikimr { diff --git a/ydb/core/tablet_flat/test/libs/exec/events.h b/ydb/core/tablet_flat/test/libs/exec/events.h index b6aeb3e82f..53f461fe7e 100644 --- a/ydb/core/tablet_flat/test/libs/exec/events.h +++ b/ydb/core/tablet_flat/test/libs/exec/events.h @@ -1,8 +1,8 @@ #pragma once #include "tablet_flat_executor.h" -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/actorsystem.h> namespace NKikimr { namespace NFake { diff --git a/ydb/core/tablet_flat/test/libs/exec/leader.h b/ydb/core/tablet_flat/test/libs/exec/leader.h index f964c4b33c..ce22889e99 100644 --- a/ydb/core/tablet_flat/test/libs/exec/leader.h +++ b/ydb/core/tablet_flat/test/libs/exec/leader.h @@ -6,7 +6,7 @@ #include <ydb/core/tablet_flat/util_fmt_abort.h> #include <ydb/core/tablet_flat/util_fmt_desc.h> #include <ydb/core/tablet_flat/util_fmt_basic.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr { namespace NFake { diff --git a/ydb/core/tablet_flat/test/libs/exec/logger.h b/ydb/core/tablet_flat/test/libs/exec/logger.h index 471f00b844..4dd8b2f7c1 100644 --- a/ydb/core/tablet_flat/test/libs/exec/logger.h +++ b/ydb/core/tablet_flat/test/libs/exec/logger.h @@ -4,8 +4,8 @@ #include <ydb/core/tablet_flat/util_basics.h> #include <ydb/core/tablet_flat/util_fmt_line.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/log_iface.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/log_iface.h> namespace NKikimr { namespace NFake { diff --git a/ydb/core/tablet_flat/test/libs/exec/nanny.h b/ydb/core/tablet_flat/test/libs/exec/nanny.h index 9b00928c8e..7e4f13eef9 100644 --- a/ydb/core/tablet_flat/test/libs/exec/nanny.h +++ b/ydb/core/tablet_flat/test/libs/exec/nanny.h @@ -7,7 +7,7 @@ #include <ydb/core/tablet_flat/tablet_flat_executed.h> #include <ydb/core/tablet_flat/ut/flat_test_db.h> #include <ydb/core/tablet_flat/ut/flat_test_db_helpers.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr { namespace NFake { diff --git a/ydb/core/tablet_flat/test/libs/exec/owner.h b/ydb/core/tablet_flat/test/libs/exec/owner.h index f3e3d7363c..25ede6a973 100644 --- a/ydb/core/tablet_flat/test/libs/exec/owner.h +++ b/ydb/core/tablet_flat/test/libs/exec/owner.h @@ -3,7 +3,7 @@ #include "world.h" #include "events.h" #include <util/system/type_name.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/blobstorage.h> #include <ydb/core/base/tablet.h> diff --git a/ydb/core/tablet_flat/test/libs/exec/warden.h b/ydb/core/tablet_flat/test/libs/exec/warden.h index cc2afbde88..12d1981078 100644 --- a/ydb/core/tablet_flat/test/libs/exec/warden.h +++ b/ydb/core/tablet_flat/test/libs/exec/warden.h @@ -2,7 +2,7 @@ #include "world.h" #include "storage.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include <ydb/core/base/blobstorage.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/tablet_flat/util_fmt_logger.h> diff --git a/ydb/core/tablet_flat/test/libs/exec/world.h b/ydb/core/tablet_flat/test/libs/exec/world.h index 576ff162f2..1f44f41a64 100644 --- a/ydb/core/tablet_flat/test/libs/exec/world.h +++ b/ydb/core/tablet_flat/test/libs/exec/world.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actorid.h> #include <util/system/types.h> #include <array> diff --git a/ydb/core/tablet_flat/test/tool/surg/main.cpp b/ydb/core/tablet_flat/test/tool/surg/main.cpp index c196de6a7e..97cf2b57f3 100644 --- a/ydb/core/tablet_flat/test/tool/surg/main.cpp +++ b/ydb/core/tablet_flat/test/tool/surg/main.cpp @@ -8,7 +8,7 @@ #include <ydb/core/util/pb.h> #include <library/cpp/getopt/last_getopt.h> -#include <library/cpp/blockcodecs/codecs.h> +#include <library/cpp/blockcodecs/codecs.h> #include <util/generic/yexception.h> #include <util/stream/file.h> #include <array> diff --git a/ydb/core/tablet_flat/ut/ut_pages.cpp b/ydb/core/tablet_flat/ut/ut_pages.cpp index b9e417861a..e5288cfccb 100644 --- a/ydb/core/tablet_flat/ut/ut_pages.cpp +++ b/ydb/core/tablet_flat/ut/ut_pages.cpp @@ -6,7 +6,7 @@ #include <ydb/core/tablet_flat/test/libs/table/test_wreck.h> #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> #include <util/generic/xrange.h> #include <util/stream/file.h> #include <util/stream/str.h> diff --git a/ydb/core/tablet_flat/ut/ut_redo.cpp b/ydb/core/tablet_flat/ut/ut_redo.cpp index 73271b4403..5efcaca7ec 100644 --- a/ydb/core/tablet_flat/ut/ut_redo.cpp +++ b/ydb/core/tablet_flat/ut/ut_redo.cpp @@ -2,7 +2,7 @@ #include <ydb/core/tablet_flat/test/libs/rows/cook.h> #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> #include <util/stream/file.h> namespace NKikimr { diff --git a/ydb/core/tablet_flat/util_fmt_logger.h b/ydb/core/tablet_flat/util_fmt_logger.h index 784e1795fd..e39ddda6a2 100644 --- a/ydb/core/tablet_flat/util_fmt_logger.h +++ b/ydb/core/tablet_flat/util_fmt_logger.h @@ -4,8 +4,8 @@ #include <ydb/core/base/appdata.h> #include <library/cpp/time_provider/time_provider.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/log_iface.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/log_iface.h> namespace NKikimr { namespace NUtil { diff --git a/ydb/core/tablet_flat/ya.make b/ydb/core/tablet_flat/ya.make index 6b1226bf01..f470c23aac 100644 --- a/ydb/core/tablet_flat/ya.make +++ b/ydb/core/tablet_flat/ya.make @@ -95,8 +95,8 @@ PEERDIR( contrib/libs/protobuf library/cpp/containers/intrusive_rb_tree library/cpp/containers/stack_vector - library/cpp/digest/crc32c - library/cpp/html/pcdata + library/cpp/digest/crc32c + library/cpp/html/pcdata library/cpp/lwtrace library/cpp/lwtrace/mon ydb/core/base diff --git a/ydb/core/testlib/actor_helpers.h b/ydb/core/testlib/actor_helpers.h index b9df571aca..fa949385f1 100644 --- a/ydb/core/testlib/actor_helpers.h +++ b/ydb/core/testlib/actor_helpers.h @@ -1,8 +1,8 @@ #pragma once #include "defs.h" -#include <library/cpp/actors/core/mailbox.h> -#include <library/cpp/actors/core/executor_thread.h> +#include <library/cpp/actors/core/mailbox.h> +#include <library/cpp/actors/core/executor_thread.h> namespace NKikimr { diff --git a/ydb/core/testlib/actors/test_runtime.cpp b/ydb/core/testlib/actors/test_runtime.cpp index 63f0436bff..d066fd5531 100644 --- a/ydb/core/testlib/actors/test_runtime.cpp +++ b/ydb/core/testlib/actors/test_runtime.cpp @@ -7,8 +7,8 @@ #include <ydb/core/mon_alloc/profiler.h> #include <ydb/core/tablet/tablet_impl.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/executor_pool_io.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/executor_pool_io.h> /**** ACHTUNG: Do not make here any new dependecies on kikimr ****/ diff --git a/ydb/core/testlib/actors/test_runtime.h b/ydb/core/testlib/actors/test_runtime.h index deb156876b..30d1078123 100644 --- a/ydb/core/testlib/actors/test_runtime.h +++ b/ydb/core/testlib/actors/test_runtime.h @@ -3,7 +3,7 @@ #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/testlib/test_runtime.h> +#include <library/cpp/actors/testlib/test_runtime.h> #include <library/cpp/testing/unittest/tests_data.h> namespace NKikimr { diff --git a/ydb/core/testlib/actors/test_runtime_ut.cpp b/ydb/core/testlib/actors/test_runtime_ut.cpp index fce7f19293..58768537d1 100644 --- a/ydb/core/testlib/actors/test_runtime_ut.cpp +++ b/ydb/core/testlib/actors/test_runtime_ut.cpp @@ -1,7 +1,7 @@ #include <ydb/core/testlib/actors/test_runtime.h> #include <ydb/core/base/appdata.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/events.h> #include <library/cpp/testing/unittest/registar.h> #include <util/thread/factory.h> diff --git a/ydb/core/testlib/actors/ut/ya.make b/ydb/core/testlib/actors/ut/ya.make index 85a31fe740..1b9d9504bc 100644 --- a/ydb/core/testlib/actors/ut/ya.make +++ b/ydb/core/testlib/actors/ut/ya.make @@ -12,8 +12,8 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/svnversion - library/cpp/regex/pcre + library/cpp/svnversion + library/cpp/regex/pcre ) SRCS( diff --git a/ydb/core/testlib/actors/ya.make b/ydb/core/testlib/actors/ya.make index 984cf7e177..27be2cf036 100644 --- a/ydb/core/testlib/actors/ya.make +++ b/ydb/core/testlib/actors/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/testlib + library/cpp/actors/testlib library/cpp/testing/unittest ydb/core/base ydb/core/mon diff --git a/ydb/core/testlib/basics/runtime.cpp b/ydb/core/testlib/basics/runtime.cpp index cd62ce82bf..e500332cf2 100644 --- a/ydb/core/testlib/basics/runtime.cpp +++ b/ydb/core/testlib/basics/runtime.cpp @@ -3,8 +3,8 @@ #include <ydb/core/base/appdata.h> #include <ydb/core/mind/dynamic_nameserver.h> #include <library/cpp/actors/dnsresolver/dnsresolver.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect_tcp_server.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_server.h> #include <util/generic/xrange.h> namespace NActors { diff --git a/ydb/core/testlib/basics/runtime.h b/ydb/core/testlib/basics/runtime.h index 982dd7500b..0a7068c6d9 100644 --- a/ydb/core/testlib/basics/runtime.h +++ b/ydb/core/testlib/basics/runtime.h @@ -1,7 +1,7 @@ #pragma once #include <ydb/core/testlib/actors/test_runtime.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> namespace NActors { diff --git a/ydb/core/testlib/basics/ya.make b/ydb/core/testlib/basics/ya.make index 61f74922f4..2f9a644fcd 100644 --- a/ydb/core/testlib/basics/ya.make +++ b/ydb/core/testlib/basics/ya.make @@ -11,7 +11,7 @@ SRCS( PEERDIR( library/cpp/actors/dnsresolver - library/cpp/regex/pcre + library/cpp/regex/pcre library/cpp/testing/unittest ydb/core/base ydb/core/blobstorage diff --git a/ydb/core/testlib/fake_scheme_shard.h b/ydb/core/testlib/fake_scheme_shard.h index 8c388d49dd..a33173fddb 100644 --- a/ydb/core/testlib/fake_scheme_shard.h +++ b/ydb/core/testlib/fake_scheme_shard.h @@ -7,8 +7,8 @@ #include <ydb/core/tx/schemeshard/schemeshard.h> #include <ydb/library/aclib/aclib.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/events.h> #include <library/cpp/testing/unittest/registar.h> #include <util/generic/ptr.h> diff --git a/ydb/core/testlib/mock_pq_metacache.h b/ydb/core/testlib/mock_pq_metacache.h index 1280f87779..d3a01c0d85 100644 --- a/ydb/core/testlib/mock_pq_metacache.h +++ b/ydb/core/testlib/mock_pq_metacache.h @@ -1,8 +1,8 @@ #pragma once #include <ydb/core/client/server/msgbus_server_pq_metacache.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/testing/gmock_in_unittest/gmock.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/testing/gmock_in_unittest/gmock.h> #include <library/cpp/testing/unittest/registar.h> #include <util/generic/ptr.h> diff --git a/ydb/core/testlib/tablet_flat_dummy.cpp b/ydb/core/testlib/tablet_flat_dummy.cpp index 1a9dca04a5..669c3adc48 100644 --- a/ydb/core/testlib/tablet_flat_dummy.cpp +++ b/ydb/core/testlib/tablet_flat_dummy.cpp @@ -4,7 +4,7 @@ #include <ydb/core/tablet_flat/flat_cxx_database.h> #include <ydb/core/engine/minikql/flat_local_tx_factory.h> #include <ydb/core/base/appdata.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { diff --git a/ydb/core/testlib/tablet_helpers.cpp b/ydb/core/testlib/tablet_helpers.cpp index a853040b93..5e52c7b2a1 100644 --- a/ydb/core/testlib/tablet_helpers.cpp +++ b/ydb/core/testlib/tablet_helpers.cpp @@ -31,12 +31,12 @@ #include <util/folder/dirut.h> #include <util/random/mersenne.h> -#include <library/cpp/regex/pcre/regexp.h> +#include <library/cpp/regex/pcre/regexp.h> #include <util/string/printf.h> #include <util/string/subst.h> #include <util/system/env.h> #include <util/system/sanitizers.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <library/cpp/testing/unittest/registar.h> #include <ydb/core/kesus/tablet/tablet.h> diff --git a/ydb/core/testlib/tenant_runtime.cpp b/ydb/core/testlib/tenant_runtime.cpp index 974cc166d0..67fcec9674 100644 --- a/ydb/core/testlib/tenant_runtime.cpp +++ b/ydb/core/testlib/tenant_runtime.cpp @@ -24,8 +24,8 @@ #include <ydb/core/tx/tx_proxy/proxy.h> #include <ydb/core/sys_view/processor/processor.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <library/cpp/testing/unittest/registar.h> #include <util/folder/dirut.h> diff --git a/ydb/core/testlib/test_client.cpp b/ydb/core/testlib/test_client.cpp index d4907c26f1..79a68426f9 100644 --- a/ydb/core/testlib/test_client.cpp +++ b/ydb/core/testlib/test_client.cpp @@ -89,7 +89,7 @@ #include <ydb/core/client/server/msgbus_server_tracer.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <library/cpp/grpc/server/actors/logger.h> diff --git a/ydb/core/testlib/test_pq_client.h b/ydb/core/testlib/test_pq_client.h index f059923250..cde2d91268 100644 --- a/ydb/core/testlib/test_pq_client.h +++ b/ydb/core/testlib/test_pq_client.h @@ -11,7 +11,7 @@ #include <ydb/library/aclib/aclib.h> #include <ydb/library/persqueue/topic_parser/topic_parser.h> -#include <library/cpp/tvmauth/unittest.h> +#include <library/cpp/tvmauth/unittest.h> #include <library/cpp/testing/unittest/registar.h> #include <util/string/printf.h> @@ -33,7 +33,7 @@ inline Tests::TServerSettings PQSettings(ui16 port, ui32 nodesCount = 2, bool ro authConfig.SetUseStaff(false); authConfig.MutableTVMConfig()->SetEnabled(true); authConfig.MutableTVMConfig()->SetServiceTVMId(10); - authConfig.MutableTVMConfig()->SetPublicKeys(NTvmAuth::NUnittest::TVMKNIFE_PUBLIC_KEYS); + authConfig.MutableTVMConfig()->SetPublicKeys(NTvmAuth::NUnittest::TVMKNIFE_PUBLIC_KEYS); authConfig.MutableTVMConfig()->SetUpdatePublicKeys(false); pqConfig.SetRoundRobinPartitionMapping(roundrobin); const TString query = R"___( diff --git a/ydb/core/testlib/ya.make b/ydb/core/testlib/ya.make index 137fa829f3..96bbbe6b6b 100644 --- a/ydb/core/testlib/ya.make +++ b/ydb/core/testlib/ya.make @@ -32,13 +32,13 @@ SRCS( ) PEERDIR( - library/cpp/actors/core - library/cpp/actors/interconnect - library/cpp/grpc/client + library/cpp/actors/core + library/cpp/actors/interconnect + library/cpp/grpc/client library/cpp/grpc/server library/cpp/grpc/server/actors - library/cpp/regex/pcre - library/cpp/testing/gmock_in_unittest + library/cpp/regex/pcre + library/cpp/testing/gmock_in_unittest library/cpp/testing/unittest ydb/core/base ydb/core/blobstorage/base diff --git a/ydb/core/tracing/tablet_info.cpp b/ydb/core/tracing/tablet_info.cpp index 6eb99ffc60..cdec7300fd 100644 --- a/ydb/core/tracing/tablet_info.cpp +++ b/ydb/core/tracing/tablet_info.cpp @@ -1,14 +1,14 @@ #include "tablet_info.h" -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/appdata.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/base/tracing.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include "http.h" namespace NKikimr { diff --git a/ydb/core/tracing/tablet_info.h b/ydb/core/tracing/tablet_info.h index c3ebf10225..d44abefb63 100644 --- a/ydb/core/tracing/tablet_info.h +++ b/ydb/core/tracing/tablet_info.h @@ -1,8 +1,8 @@ #pragma once #include <ydb/core/base/defs.h> -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/event.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/event.h> namespace NKikimr { namespace NTabletInfo { diff --git a/ydb/core/tx/coordinator/coordinator_impl.cpp b/ydb/core/tx/coordinator/coordinator_impl.cpp index b4eeb184e2..0db3cbe6a1 100644 --- a/ydb/core/tx/coordinator/coordinator_impl.cpp +++ b/ydb/core/tx/coordinator/coordinator_impl.cpp @@ -2,7 +2,7 @@ #include <ydb/core/engine/minikql/flat_local_tx_factory.h> #include <ydb/core/tablet/tablet_counters_protobuf.h> #include <ydb/core/tablet/tablet_counters_aggregator.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/counters.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/tx/coordinator/coordinator_impl.h b/ydb/core/tx/coordinator/coordinator_impl.h index 39018aff1e..e4c48ace5b 100644 --- a/ydb/core/tx/coordinator/coordinator_impl.h +++ b/ydb/core/tx/coordinator/coordinator_impl.h @@ -5,7 +5,7 @@ #include <ydb/core/protos/counters_coordinator.pb.h> -#include <library/cpp/actors/helpers/mon_histogram_helper.h> +#include <library/cpp/actors/helpers/mon_histogram_helper.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/base/tx_processing.h> #include <ydb/core/tablet/tablet_exception.h> @@ -15,8 +15,8 @@ #include <ydb/core/tx/tx.h> #include <ydb/core/util/queue_oneone_inplace.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/hash_set.h> #include <util/stream/file.h> diff --git a/ydb/core/tx/coordinator/mediator_queue.cpp b/ydb/core/tx/coordinator/mediator_queue.cpp index 9b3955fa1b..610ba7ce42 100644 --- a/ydb/core/tx/coordinator/mediator_queue.cpp +++ b/ydb/core/tx/coordinator/mediator_queue.cpp @@ -3,8 +3,8 @@ #include <ydb/core/tx/tx_processing.h> #include <ydb/core/base/tablet_pipe.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NFlatTxCoordinator { diff --git a/ydb/core/tx/coordinator/ya.make b/ydb/core/tx/coordinator/ya.make index 080671e1fe..aef2660765 100644 --- a/ydb/core/tx/coordinator/ya.make +++ b/ydb/core/tx/coordinator/ya.make @@ -27,7 +27,7 @@ SRCS( PEERDIR( library/cpp/actors/core library/cpp/actors/helpers - library/cpp/actors/interconnect + library/cpp/actors/interconnect ydb/core/actorlib_impl ydb/core/base ydb/core/engine/minikql diff --git a/ydb/core/tx/datashard/datashard__cleanup_borrowed.cpp b/ydb/core/tx/datashard/datashard__cleanup_borrowed.cpp index c53faa1c60..fdd7b4234a 100644 --- a/ydb/core/tx/datashard/datashard__cleanup_borrowed.cpp +++ b/ydb/core/tx/datashard/datashard__cleanup_borrowed.cpp @@ -4,10 +4,10 @@ #include <ydb/core/tablet_flat/flat_stat_table.h> #include <ydb/core/util/pb.h> -#include <library/cpp/mime/types/mime.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/mime/types/mime.h> +#include <library/cpp/resource/resource.h> -#include <library/cpp/html/pcdata/pcdata.h> +#include <library/cpp/html/pcdata/pcdata.h> namespace NKikimr { namespace NDataShard { diff --git a/ydb/core/tx/datashard/datashard__engine_host.cpp b/ydb/core/tx/datashard/datashard__engine_host.cpp index 876c337093..6cb4c5e9d0 100644 --- a/ydb/core/tx/datashard/datashard__engine_host.cpp +++ b/ydb/core/tx/datashard/datashard__engine_host.cpp @@ -13,7 +13,7 @@ #include <ydb/library/yql/minikql/mkql_string_util.h> #include <ydb/library/yql/minikql/mkql_node_cast.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <util/generic/cast.h> diff --git a/ydb/core/tx/datashard/datashard__mon_reset_schema_version.cpp b/ydb/core/tx/datashard/datashard__mon_reset_schema_version.cpp index a0ed0f927e..b5f80246e2 100644 --- a/ydb/core/tx/datashard/datashard__mon_reset_schema_version.cpp +++ b/ydb/core/tx/datashard/datashard__mon_reset_schema_version.cpp @@ -4,10 +4,10 @@ #include <ydb/core/tablet_flat/flat_stat_table.h> #include <ydb/core/util/pb.h> -#include <library/cpp/mime/types/mime.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/mime/types/mime.h> +#include <library/cpp/resource/resource.h> -#include <library/cpp/html/pcdata/pcdata.h> +#include <library/cpp/html/pcdata/pcdata.h> namespace NKikimr { namespace NDataShard { diff --git a/ydb/core/tx/datashard/datashard__monitoring.cpp b/ydb/core/tx/datashard/datashard__monitoring.cpp index 644f9a7419..f8f5dae5f4 100644 --- a/ydb/core/tx/datashard/datashard__monitoring.cpp +++ b/ydb/core/tx/datashard/datashard__monitoring.cpp @@ -4,10 +4,10 @@ #include <ydb/core/tablet_flat/flat_stat_table.h> #include <ydb/core/util/pb.h> -#include <library/cpp/mime/types/mime.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/mime/types/mime.h> +#include <library/cpp/resource/resource.h> -#include <library/cpp/html/pcdata/pcdata.h> +#include <library/cpp/html/pcdata/pcdata.h> namespace NKikimr { namespace NDataShard { diff --git a/ydb/core/tx/datashard/datashard_impl.h b/ydb/core/tx/datashard/datashard_impl.h index 11313474f8..7286daaadd 100644 --- a/ydb/core/tx/datashard/datashard_impl.h +++ b/ydb/core/tx/datashard/datashard_impl.h @@ -43,7 +43,7 @@ #include <ydb/public/api/protos/ydb_status_codes.pb.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <util/string/join.h> diff --git a/ydb/core/tx/datashard/export_s3_base_uploader.h b/ydb/core/tx/datashard/export_s3_base_uploader.h index 8c72a8c393..8fdd690a05 100644 --- a/ydb/core/tx/datashard/export_s3_base_uploader.h +++ b/ydb/core/tx/datashard/export_s3_base_uploader.h @@ -10,8 +10,8 @@ #include <ydb/core/protos/flat_scheme_op.pb.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/wrappers/s3_wrapper.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/maybe.h> #include <util/generic/ptr.h> diff --git a/ydb/core/tx/datashard/export_scan.cpp b/ydb/core/tx/datashard/export_scan.cpp index 2cda75fdd0..da80c77b6b 100644 --- a/ydb/core/tx/datashard/export_scan.cpp +++ b/ydb/core/tx/datashard/export_scan.cpp @@ -5,7 +5,7 @@ #include <ydb/core/base/counters.h> #include <ydb/core/tablet_flat/flat_row_state.h> #include <ydb/core/tablet_flat/flat_scan_spent.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/bitmap.h> #include <util/string/builder.h> diff --git a/ydb/core/tx/datashard/read_table_scan.cpp b/ydb/core/tx/datashard/read_table_scan.cpp index 63e94fde96..19d36ac805 100644 --- a/ydb/core/tx/datashard/read_table_scan.cpp +++ b/ydb/core/tx/datashard/read_table_scan.cpp @@ -9,7 +9,7 @@ #include <ydb/library/binary_json/read.h> #include <ydb/library/dynumber/dynumber.h> -//#include <library/cpp/actors/interconnect/interconnect.h> +//#include <library/cpp/actors/interconnect/interconnect.h> //#include <util/generic/cast.h> diff --git a/ydb/core/tx/datashard/ya.make b/ydb/core/tx/datashard/ya.make index 9c98e8e79b..cfd1f263f8 100644 --- a/ydb/core/tx/datashard/ya.make +++ b/ydb/core/tx/datashard/ya.make @@ -204,9 +204,9 @@ RESOURCE( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/containers/flat_hash - library/cpp/html/pcdata + library/cpp/html/pcdata library/cpp/string_utils/quote ydb/core/actorlib_impl ydb/core/base diff --git a/ydb/core/tx/mediator/execute_queue.cpp b/ydb/core/tx/mediator/execute_queue.cpp index 07740e9f82..788d9ee9ec 100644 --- a/ydb/core/tx/mediator/execute_queue.cpp +++ b/ydb/core/tx/mediator/execute_queue.cpp @@ -2,7 +2,7 @@ #include <ydb/core/base/appdata.h> #include <ydb/core/base/tx_processing.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/tx/time_cast/time_cast.h> #include <util/generic/hash.h> diff --git a/ydb/core/tx/mediator/tablet_queue.cpp b/ydb/core/tx/mediator/tablet_queue.cpp index b28179517c..c4de22811f 100644 --- a/ydb/core/tx/mediator/tablet_queue.cpp +++ b/ydb/core/tx/mediator/tablet_queue.cpp @@ -1,8 +1,8 @@ #include "mediator_impl.h" -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/core/base/counters.h> #include <ydb/core/base/statestorage.h> #include <ydb/core/base/appdata.h> diff --git a/ydb/core/tx/scheme_board/cache.cpp b/ydb/core/tx/scheme_board/cache.cpp index 8e778a4a1d..d00a4a416e 100644 --- a/ydb/core/tx/scheme_board/cache.cpp +++ b/ydb/core/tx/scheme_board/cache.cpp @@ -18,9 +18,9 @@ #include <ydb/core/tx/schemeshard/schemeshard_types.h> #include <ydb/core/util/yverify_stream.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> #include <library/cpp/json/writer/json.h> #include <util/generic/algorithm.h> diff --git a/ydb/core/tx/scheme_board/helpers.cpp b/ydb/core/tx/scheme_board/helpers.cpp index 3b53323ad3..337d651749 100644 --- a/ydb/core/tx/scheme_board/helpers.cpp +++ b/ydb/core/tx/scheme_board/helpers.cpp @@ -4,8 +4,8 @@ #include <google/protobuf/io/zero_copy_stream_impl_lite.h> #include <google/protobuf/wire_format_lite.h> -#include <library/cpp/actors/core/executor_thread.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/executor_thread.h> +#include <library/cpp/actors/core/interconnect.h> #include <util/stream/format.h> diff --git a/ydb/core/tx/scheme_board/helpers.h b/ydb/core/tx/scheme_board/helpers.h index 3b07df3e06..9f67672145 100644 --- a/ydb/core/tx/scheme_board/helpers.h +++ b/ydb/core/tx/scheme_board/helpers.h @@ -5,7 +5,7 @@ #include <ydb/core/protos/flat_tx_scheme.pb.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <util/generic/vector.h> #include <util/generic/set.h> diff --git a/ydb/core/tx/scheme_board/load_test.cpp b/ydb/core/tx/scheme_board/load_test.cpp index d993f1e5ed..2044e58ad1 100644 --- a/ydb/core/tx/scheme_board/load_test.cpp +++ b/ydb/core/tx/scheme_board/load_test.cpp @@ -10,8 +10,8 @@ #include <ydb/core/protos/flat_tx_scheme.pb.h> #include <ydb/core/tx/schemeshard/schemeshard.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/ptr.h> #include <util/generic/ylimits.h> diff --git a/ydb/core/tx/scheme_board/populator.cpp b/ydb/core/tx/scheme_board/populator.cpp index f860bb88cb..9faebb2883 100644 --- a/ydb/core/tx/scheme_board/populator.cpp +++ b/ydb/core/tx/scheme_board/populator.cpp @@ -11,10 +11,10 @@ #include <ydb/core/tx/schemeshard/schemeshard.h> #include <ydb/core/util/yverify_stream.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/log.h> #include <util/digest/city.h> diff --git a/ydb/core/tx/scheme_board/populator_ut.cpp b/ydb/core/tx/scheme_board/populator_ut.cpp index c0eb1cb62f..6e7f9f8a05 100644 --- a/ydb/core/tx/scheme_board/populator_ut.cpp +++ b/ydb/core/tx/scheme_board/populator_ut.cpp @@ -6,7 +6,7 @@ #include <ydb/core/protos/services.pb.h> #include <ydb/core/tx/schemeshard/ut_helpers/helpers.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <library/cpp/testing/unittest/registar.h> #include <util/generic/map.h> diff --git a/ydb/core/tx/scheme_board/replica.cpp b/ydb/core/tx/scheme_board/replica.cpp index 638656e91d..5f35923cfc 100644 --- a/ydb/core/tx/scheme_board/replica.cpp +++ b/ydb/core/tx/scheme_board/replica.cpp @@ -10,9 +10,9 @@ #include <ydb/core/protos/services.pb.h> #include <ydb/core/util/yverify_stream.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/log.h> #include <library/cpp/actors/core/memory_track.h> #include <util/generic/hash.h> diff --git a/ydb/core/tx/scheme_board/replica_ut.cpp b/ydb/core/tx/scheme_board/replica_ut.cpp index 10113c7bcc..2caf81bf2a 100644 --- a/ydb/core/tx/scheme_board/replica_ut.cpp +++ b/ydb/core/tx/scheme_board/replica_ut.cpp @@ -6,7 +6,7 @@ #include <ydb/core/protos/services.pb.h> #include <ydb/core/testlib/basics/appdata.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <library/cpp/testing/unittest/registar.h> namespace NKikimr { diff --git a/ydb/core/tx/scheme_board/subscriber.cpp b/ydb/core/tx/scheme_board/subscriber.cpp index 97173d81ad..324e519c40 100644 --- a/ydb/core/tx/scheme_board/subscriber.cpp +++ b/ydb/core/tx/scheme_board/subscriber.cpp @@ -9,10 +9,10 @@ #include <ydb/core/protos/services.pb.h> #include <ydb/core/util/yverify_stream.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/log.h> #include <util/generic/map.h> #include <util/generic/maybe.h> diff --git a/ydb/core/tx/scheme_board/subscriber_ut.cpp b/ydb/core/tx/scheme_board/subscriber_ut.cpp index 7e1d580305..15b20709ef 100644 --- a/ydb/core/tx/scheme_board/subscriber_ut.cpp +++ b/ydb/core/tx/scheme_board/subscriber_ut.cpp @@ -8,7 +8,7 @@ #include <ydb/core/testlib/basics/appdata.h> #include <ydb/core/testlib/basics/helpers.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <library/cpp/testing/unittest/registar.h> #include <util/generic/vector.h> diff --git a/ydb/core/tx/scheme_board/ut_helpers.h b/ydb/core/tx/scheme_board/ut_helpers.h index 1f2e4d5e9b..219ae523d9 100644 --- a/ydb/core/tx/scheme_board/ut_helpers.h +++ b/ydb/core/tx/scheme_board/ut_helpers.h @@ -14,7 +14,7 @@ #include <ydb/core/tx/schemeshard/schemeshard.h> #include <ydb/core/tx/tx_allocator/txallocator.h> -#include <library/cpp/actors/interconnect/interconnect_impl.h> +#include <library/cpp/actors/interconnect/interconnect_impl.h> #include <library/cpp/testing/unittest/registar.h> #include <util/generic/algorithm.h> diff --git a/ydb/core/tx/scheme_board/ut_subscriber/ya.make b/ydb/core/tx/scheme_board/ut_subscriber/ya.make index cf3dd5d1d0..01daf63733 100644 --- a/ydb/core/tx/scheme_board/ut_subscriber/ya.make +++ b/ydb/core/tx/scheme_board/ut_subscriber/ya.make @@ -12,7 +12,7 @@ SIZE(MEDIUM) TIMEOUT(600) PEERDIR( - library/cpp/actors/interconnect + library/cpp/actors/interconnect library/cpp/testing/unittest ydb/core/testlib/basics ) diff --git a/ydb/core/tx/scheme_board/ya.make b/ydb/core/tx/scheme_board/ya.make index 3caed17371..292bdad0ad 100644 --- a/ydb/core/tx/scheme_board/ya.make +++ b/ydb/core/tx/scheme_board/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/core/base ydb/core/mon ydb/core/protos diff --git a/ydb/core/tx/schemeshard/schemeshard.h b/ydb/core/tx/schemeshard/schemeshard.h index d33173508c..835499218b 100644 --- a/ydb/core/tx/schemeshard/schemeshard.h +++ b/ydb/core/tx/schemeshard/schemeshard.h @@ -10,7 +10,7 @@ #include <ydb/core/protos/flat_tx_scheme.pb.h> #include <ydb/core/scheme/scheme_tablecell.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include "schemeshard_identificators.h" diff --git a/ydb/core/tx/schemeshard/schemeshard__monitoring.cpp b/ydb/core/tx/schemeshard/schemeshard__monitoring.cpp index 76e7318249..48e481d5f4 100644 --- a/ydb/core/tx/schemeshard/schemeshard__monitoring.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__monitoring.cpp @@ -5,7 +5,7 @@ #include <ydb/core/tx/datashard/range_ops.h> #include <ydb/core/tx/tx_proxy/proxy.h> -#include <library/cpp/html/pcdata/pcdata.h> +#include <library/cpp/html/pcdata/pcdata.h> #include <util/string/cast.h> static ui64 TryParseTabletId(TStringBuf tabletIdParam) { diff --git a/ydb/core/tx/schemeshard/schemeshard_domain_links.h b/ydb/core/tx/schemeshard/schemeshard_domain_links.h index d9cb6133c4..9a817cb151 100644 --- a/ydb/core/tx/schemeshard/schemeshard_domain_links.h +++ b/ydb/core/tx/schemeshard/schemeshard_domain_links.h @@ -7,7 +7,7 @@ #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/flat_tx_scheme.pb.h> -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actorid.h> namespace NKikimr { namespace NSchemeShard { diff --git a/ydb/core/tx/schemeshard/schemeshard_tx_infly.h b/ydb/core/tx/schemeshard/schemeshard_tx_infly.h index 41a8045155..9841d78d9c 100644 --- a/ydb/core/tx/schemeshard/schemeshard_tx_infly.h +++ b/ydb/core/tx/schemeshard/schemeshard_tx_infly.h @@ -7,7 +7,7 @@ #include <ydb/core/tx/datashard/datashard.h> -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actorid.h> #include <util/generic/hash.h> #include <util/generic/hash_set.h> diff --git a/ydb/core/tx/schemeshard/schemeshard_utils.h b/ydb/core/tx/schemeshard/schemeshard_utils.h index de7d17f316..8e3ef8798a 100644 --- a/ydb/core/tx/schemeshard/schemeshard_utils.h +++ b/ydb/core/tx/schemeshard/schemeshard_utils.h @@ -12,7 +12,7 @@ #include <ydb/library/yql/minikql/mkql_type_ops.h> -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actorid.h> #include <util/generic/hash.h> #include <util/generic/hash_set.h> diff --git a/ydb/core/tx/schemeshard/ut_base/ya.make b/ydb/core/tx/schemeshard/ut_base/ya.make index 430ee1310e..09cb961e70 100644 --- a/ydb/core/tx/schemeshard/ut_base/ya.make +++ b/ydb/core/tx/schemeshard/ut_base/ya.make @@ -17,8 +17,8 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/regex/pcre + library/cpp/svnversion ydb/core/kqp/ut/common ydb/core/testlib ydb/core/tx diff --git a/ydb/core/tx/schemeshard/ut_bsvolume/ya.make b/ydb/core/tx/schemeshard/ut_bsvolume/ya.make index 005d942ac4..cca173e1ba 100644 --- a/ydb/core/tx/schemeshard/ut_bsvolume/ya.make +++ b/ydb/core/tx/schemeshard/ut_bsvolume/ya.make @@ -15,8 +15,8 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/regex/pcre + library/cpp/svnversion ydb/core/testlib ydb/core/tx ydb/core/tx/schemeshard/ut_helpers diff --git a/ydb/core/tx/schemeshard/ut_extsubdomain/ya.make b/ydb/core/tx/schemeshard/ut_extsubdomain/ya.make index 09a86b1e7e..b0ced7ec75 100644 --- a/ydb/core/tx/schemeshard/ut_extsubdomain/ya.make +++ b/ydb/core/tx/schemeshard/ut_extsubdomain/ya.make @@ -15,8 +15,8 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/regex/pcre + library/cpp/svnversion ydb/core/testlib ydb/core/tx ydb/core/tx/schemeshard/ut_helpers diff --git a/ydb/core/tx/schemeshard/ut_index_build/ya.make b/ydb/core/tx/schemeshard/ut_index_build/ya.make index 12a292282c..a1279bbddd 100644 --- a/ydb/core/tx/schemeshard/ut_index_build/ya.make +++ b/ydb/core/tx/schemeshard/ut_index_build/ya.make @@ -13,8 +13,8 @@ SIZE(MEDIUM) PEERDIR( library/cpp/getopt - library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/regex/pcre + library/cpp/svnversion ydb/core/metering ydb/core/testlib ydb/core/tx diff --git a/ydb/core/tx/schemeshard/ut_index_build_reboots/ya.make b/ydb/core/tx/schemeshard/ut_index_build_reboots/ya.make index 33907508db..1d2c976289 100644 --- a/ydb/core/tx/schemeshard/ut_index_build_reboots/ya.make +++ b/ydb/core/tx/schemeshard/ut_index_build_reboots/ya.make @@ -19,8 +19,8 @@ SIZE(LARGE) PEERDIR( library/cpp/getopt - library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/regex/pcre + library/cpp/svnversion ydb/core/kqp/ut/common ydb/core/testlib ydb/core/tx diff --git a/ydb/core/tx/schemeshard/ut_pq/ya.make b/ydb/core/tx/schemeshard/ut_pq/ya.make index fe304ef882..2dcf7a558f 100644 --- a/ydb/core/tx/schemeshard/ut_pq/ya.make +++ b/ydb/core/tx/schemeshard/ut_pq/ya.make @@ -20,8 +20,8 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/regex/pcre + library/cpp/svnversion ydb/core/testlib ydb/core/tx ydb/core/tx/schemeshard/ut_helpers diff --git a/ydb/core/tx/schemeshard/ut_rtmr/ya.make b/ydb/core/tx/schemeshard/ut_rtmr/ya.make index 43ff241e87..3e0e1679ae 100644 --- a/ydb/core/tx/schemeshard/ut_rtmr/ya.make +++ b/ydb/core/tx/schemeshard/ut_rtmr/ya.make @@ -18,8 +18,8 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/regex/pcre + library/cpp/svnversion ydb/core/testlib ydb/core/tx ydb/core/tx/schemeshard/ut_helpers diff --git a/ydb/core/tx/schemeshard/ut_subdomain/ya.make b/ydb/core/tx/schemeshard/ut_subdomain/ya.make index aaa80b7090..da752a1bdb 100644 --- a/ydb/core/tx/schemeshard/ut_subdomain/ya.make +++ b/ydb/core/tx/schemeshard/ut_subdomain/ya.make @@ -20,8 +20,8 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/regex/pcre + library/cpp/svnversion ydb/core/testlib ydb/core/tx ydb/core/tx/schemeshard/ut_helpers diff --git a/ydb/core/tx/schemeshard/ut_upgradesubdomain_reboots/ya.make b/ydb/core/tx/schemeshard/ut_upgradesubdomain_reboots/ya.make index fd956b3981..71d3b3d59d 100644 --- a/ydb/core/tx/schemeshard/ut_upgradesubdomain_reboots/ya.make +++ b/ydb/core/tx/schemeshard/ut_upgradesubdomain_reboots/ya.make @@ -18,8 +18,8 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/regex/pcre + library/cpp/svnversion ydb/core/testlib ydb/core/tx ydb/core/tx/schemeshard/ut_helpers diff --git a/ydb/core/tx/schemeshard/ut_user_attributes/ya.make b/ydb/core/tx/schemeshard/ut_user_attributes/ya.make index 6162927aa9..a17f42357d 100644 --- a/ydb/core/tx/schemeshard/ut_user_attributes/ya.make +++ b/ydb/core/tx/schemeshard/ut_user_attributes/ya.make @@ -14,7 +14,7 @@ SIZE(MEDIUM) PEERDIR( library/cpp/http/io library/cpp/http/server - library/cpp/svnversion + library/cpp/svnversion library/cpp/testing/unittest ydb/core/base ydb/core/blockstore/core diff --git a/ydb/core/tx/schemeshard/ya.make b/ydb/core/tx/schemeshard/ya.make index ceb87ce388..568275041d 100644 --- a/ydb/core/tx/schemeshard/ya.make +++ b/ydb/core/tx/schemeshard/ya.make @@ -213,8 +213,8 @@ GENERATE_ENUM_SERIALIZATION(schemeshard_types.h) PEERDIR( contrib/libs/protobuf - library/cpp/deprecated/enum_codegen - library/cpp/html/pcdata + library/cpp/deprecated/enum_codegen + library/cpp/html/pcdata ydb/core/actorlib_impl ydb/core/base ydb/core/blockstore/core diff --git a/ydb/core/tx/time_cast/time_cast.cpp b/ydb/core/tx/time_cast/time_cast.cpp index 08042194fc..48a6464ebc 100644 --- a/ydb/core/tx/time_cast/time_cast.cpp +++ b/ydb/core/tx/time_cast/time_cast.cpp @@ -1,7 +1,7 @@ #include "time_cast.h" -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> #include <ydb/core/base/tx_processing.h> #include <ydb/core/protos/subdomains.pb.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/tx/tx.h b/ydb/core/tx/tx.h index bacde44237..d941c3bdd8 100644 --- a/ydb/core/tx/tx.h +++ b/ydb/core/tx/tx.h @@ -7,7 +7,7 @@ #include <ydb/core/base/blobstorage.h> #include <ydb/core/base/appdata.h> -#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/event_pb.h> namespace NKikimr { struct TEvTxProxy { diff --git a/ydb/core/tx/tx_allocator/ya.make b/ydb/core/tx/tx_allocator/ya.make index 1a9c8ce85a..30a59800a5 100644 --- a/ydb/core/tx/tx_allocator/ya.make +++ b/ydb/core/tx/tx_allocator/ya.make @@ -14,7 +14,7 @@ SRCS( PEERDIR( library/cpp/actors/helpers - library/cpp/actors/interconnect + library/cpp/actors/interconnect ydb/core/actorlib_impl ydb/core/base ydb/core/engine/minikql diff --git a/ydb/core/tx/tx_allocator_client/actor_client.cpp b/ydb/core/tx/tx_allocator_client/actor_client.cpp index 20909a8401..4c8d388ed4 100644 --- a/ydb/core/tx/tx_allocator_client/actor_client.cpp +++ b/ydb/core/tx/tx_allocator_client/actor_client.cpp @@ -3,8 +3,8 @@ #include <ydb/core/base/tablet_pipe.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/deque.h> diff --git a/ydb/core/tx/tx_proxy/datareq.cpp b/ydb/core/tx/tx_proxy/datareq.cpp index af48b42d60..9838db1693 100644 --- a/ydb/core/tx/tx_proxy/datareq.cpp +++ b/ydb/core/tx/tx_proxy/datareq.cpp @@ -24,8 +24,8 @@ #include <ydb/library/yql/public/issue/yql_issue_message.h> #include <ydb/library/yql/public/issue/yql_issue_manager.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/hash_set.h> #include <util/generic/queue.h> diff --git a/ydb/core/tx/tx_proxy/describe.cpp b/ydb/core/tx/tx_proxy/describe.cpp index deb38ca2b7..ddbd50a411 100644 --- a/ydb/core/tx/tx_proxy/describe.cpp +++ b/ydb/core/tx/tx_proxy/describe.cpp @@ -9,7 +9,7 @@ #include <ydb/library/aclib/aclib.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NTxProxy { diff --git a/ydb/core/tx/tx_proxy/encrypted_storage_ut.cpp b/ydb/core/tx/tx_proxy/encrypted_storage_ut.cpp index aee1540004..93160adc63 100644 --- a/ydb/core/tx/tx_proxy/encrypted_storage_ut.cpp +++ b/ydb/core/tx/tx_proxy/encrypted_storage_ut.cpp @@ -1,6 +1,6 @@ #include "proxy_ut_helpers.h" -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <ydb/core/base/path.h> #include <ydb/core/tx/schemeshard/schemeshard_impl.h> diff --git a/ydb/core/tx/tx_proxy/mon.h b/ydb/core/tx/tx_proxy/mon.h index d747ab4f99..228e0a546b 100644 --- a/ydb/core/tx/tx_proxy/mon.h +++ b/ydb/core/tx/tx_proxy/mon.h @@ -3,7 +3,7 @@ #include <ydb/core/mon/mon.h> #include <ydb/library/yql/minikql/aligned_page_pool.h> -#include <library/cpp/actors/helpers/mon_histogram_helper.h> +#include <library/cpp/actors/helpers/mon_histogram_helper.h> namespace NKikimr { namespace NTxProxy { diff --git a/ydb/core/tx/tx_proxy/schemereq.cpp b/ydb/core/tx/tx_proxy/schemereq.cpp index 923fe381ae..a9a3dd6433 100644 --- a/ydb/core/tx/tx_proxy/schemereq.cpp +++ b/ydb/core/tx/tx_proxy/schemereq.cpp @@ -10,7 +10,7 @@ #include <ydb/library/aclib/aclib.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/string/cast.h> namespace NKikimr { diff --git a/ydb/core/tx/tx_proxy/snapshotreq.cpp b/ydb/core/tx/tx_proxy/snapshotreq.cpp index 4b2d7fe275..13992c77bf 100644 --- a/ydb/core/tx/tx_proxy/snapshotreq.cpp +++ b/ydb/core/tx/tx_proxy/snapshotreq.cpp @@ -8,8 +8,8 @@ #include <ydb/core/base/path.h> #include <ydb/core/base/tablet_pipecache.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NTxProxy { diff --git a/ydb/core/tx/tx_proxy/storage_tenant_ut.cpp b/ydb/core/tx/tx_proxy/storage_tenant_ut.cpp index c3b8e9921a..dfe4fa438a 100644 --- a/ydb/core/tx/tx_proxy/storage_tenant_ut.cpp +++ b/ydb/core/tx/tx_proxy/storage_tenant_ut.cpp @@ -2,7 +2,7 @@ #include <ydb/core/testlib/tablet_helpers.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <ydb/core/base/path.h> #include <ydb/core/tx/schemeshard/schemeshard_impl.h> diff --git a/ydb/core/tx/tx_proxy/ut_base_tenant/ya.make b/ydb/core/tx/tx_proxy/ut_base_tenant/ya.make index a07ffd818a..c86901b0cd 100644 --- a/ydb/core/tx/tx_proxy/ut_base_tenant/ya.make +++ b/ydb/core/tx/tx_proxy/ut_base_tenant/ya.make @@ -18,7 +18,7 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion library/cpp/testing/unittest ydb/core/testlib ydb/core/tx diff --git a/ydb/core/tx/tx_proxy/ut_encrypted_storage/ya.make b/ydb/core/tx/tx_proxy/ut_encrypted_storage/ya.make index bc5ef23bd3..2512d1fa2c 100644 --- a/ydb/core/tx/tx_proxy/ut_encrypted_storage/ya.make +++ b/ydb/core/tx/tx_proxy/ut_encrypted_storage/ya.make @@ -26,7 +26,7 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion library/cpp/testing/unittest ydb/core/testlib ydb/core/tx diff --git a/ydb/core/tx/tx_proxy/ut_ext_tenant/ya.make b/ydb/core/tx/tx_proxy/ut_ext_tenant/ya.make index 71efeaaeca..564feb2658 100644 --- a/ydb/core/tx/tx_proxy/ut_ext_tenant/ya.make +++ b/ydb/core/tx/tx_proxy/ut_ext_tenant/ya.make @@ -18,7 +18,7 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion library/cpp/testing/unittest ydb/core/testlib ydb/core/tx diff --git a/ydb/core/tx/tx_proxy/ut_storage_tenant/ya.make b/ydb/core/tx/tx_proxy/ut_storage_tenant/ya.make index 3192b7f7d2..3a4db1fad7 100644 --- a/ydb/core/tx/tx_proxy/ut_storage_tenant/ya.make +++ b/ydb/core/tx/tx_proxy/ut_storage_tenant/ya.make @@ -18,7 +18,7 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion library/cpp/testing/unittest ydb/core/blobstorage ydb/core/testlib diff --git a/ydb/core/tx/tx_proxy/ya.make b/ydb/core/tx/tx_proxy/ya.make index d412dc8988..fc10f33ca9 100644 --- a/ydb/core/tx/tx_proxy/ya.make +++ b/ydb/core/tx/tx_proxy/ya.make @@ -20,9 +20,9 @@ SRCS( GENERATE_ENUM_SERIALIZATION(read_table_impl.h) PEERDIR( - library/cpp/actors/core - library/cpp/actors/helpers - library/cpp/actors/interconnect + library/cpp/actors/core + library/cpp/actors/helpers + library/cpp/actors/interconnect util/draft ydb/core/actorlib_impl ydb/core/base diff --git a/ydb/core/util/failure_injection.cpp b/ydb/core/util/failure_injection.cpp index 9eeaaa968b..9bda8b13cf 100644 --- a/ydb/core/util/failure_injection.cpp +++ b/ydb/core/util/failure_injection.cpp @@ -3,10 +3,10 @@ #include <util/system/mutex.h> #include <util/generic/queue.h> #include <library/cpp/monlib/service/pages/templates.h> -#include <library/cpp/lwtrace/all.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/lwtrace/all.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/log.h> using namespace NActors; diff --git a/ydb/core/util/failure_injection.h b/ydb/core/util/failure_injection.h index 65d3397d53..e82a5de3fa 100644 --- a/ydb/core/util/failure_injection.h +++ b/ydb/core/util/failure_injection.h @@ -1,7 +1,7 @@ #pragma once #include "defs.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr { diff --git a/ydb/core/util/queue_oneone_inplace.h b/ydb/core/util/queue_oneone_inplace.h index 499215b821..b173c81449 100644 --- a/ydb/core/util/queue_oneone_inplace.h +++ b/ydb/core/util/queue_oneone_inplace.h @@ -1,3 +1,3 @@ #pragma once -#include <library/cpp/actors/util/queue_oneone_inplace.h> +#include <library/cpp/actors/util/queue_oneone_inplace.h> diff --git a/ydb/core/util/ut/ya.make b/ydb/core/util/ut/ya.make index 315713cad8..2b10732e8c 100644 --- a/ydb/core/util/ut/ya.make +++ b/ydb/core/util/ut/ya.make @@ -15,7 +15,7 @@ ENDIF() PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion library/cpp/threading/future ) diff --git a/ydb/core/util/ya.make b/ydb/core/util/ya.make index 4f325d8fcb..09a70a08aa 100644 --- a/ydb/core/util/ya.make +++ b/ydb/core/util/ya.make @@ -63,11 +63,11 @@ SRCS( PEERDIR( library/cpp/actors/interconnect/mock - library/cpp/actors/util + library/cpp/actors/util library/cpp/containers/stack_vector library/cpp/html/escape library/cpp/ipmath - library/cpp/lwtrace + library/cpp/lwtrace library/cpp/monlib/dynamic_counters library/cpp/random_provider ydb/core/base diff --git a/ydb/core/viewer/browse.h b/ydb/core/viewer/browse.h index c5716f46a7..94d8f0a788 100644 --- a/ydb/core/viewer/browse.h +++ b/ydb/core/viewer/browse.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/domain.h> #include <ydb/core/base/tablet.h> #include <ydb/core/base/tablet_pipe.h> diff --git a/ydb/core/viewer/browse_db.h b/ydb/core/viewer/browse_db.h index fe7b5d3140..1b514f935f 100644 --- a/ydb/core/viewer/browse_db.h +++ b/ydb/core/viewer/browse_db.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/tablet.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/viewer/browse_events.h b/ydb/core/viewer/browse_events.h index 96ced77393..4d54b56596 100644 --- a/ydb/core/viewer/browse_events.h +++ b/ydb/core/viewer/browse_events.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/event_local.h> #include <ydb/core/viewer/protos/viewer.pb.h> #include <util/generic/string.h> diff --git a/ydb/core/viewer/browse_pq.h b/ydb/core/viewer/browse_pq.h index 3e3b32a21e..5019c4651a 100644 --- a/ydb/core/viewer/browse_pq.h +++ b/ydb/core/viewer/browse_pq.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/tablet.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/persqueue/events/global.h> diff --git a/ydb/core/viewer/counters_hosts.h b/ydb/core/viewer/counters_hosts.h index 6a7bdcfb3d..6acde46f75 100644 --- a/ydb/core/viewer/counters_hosts.h +++ b/ydb/core/viewer/counters_hosts.h @@ -3,7 +3,7 @@ #include <library/cpp/actors/core/interconnect.h> #include <library/cpp/actors/core/mon.h> #include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_writer.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include "viewer.h" diff --git a/ydb/core/viewer/json_browse.h b/ydb/core/viewer/json_browse.h index cba672826e..e7daebc934 100644 --- a/ydb/core/viewer/json_browse.h +++ b/ydb/core/viewer/json_browse.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/tablet.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/viewer/json_bscontrollerinfo.h b/ydb/core/viewer/json_bscontrollerinfo.h index 5df47ed553..d6a8e9f1ba 100644 --- a/ydb/core/viewer/json_bscontrollerinfo.h +++ b/ydb/core/viewer/json_bscontrollerinfo.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/blobstorage/base/blobstorage_events.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/viewer/json_bsgroupinfo.h b/ydb/core/viewer/json_bsgroupinfo.h index 7a95f443b7..e0838b2941 100644 --- a/ydb/core/viewer/json_bsgroupinfo.h +++ b/ydb/core/viewer/json_bsgroupinfo.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include "wb_merge.h" diff --git a/ydb/core/viewer/json_cluster.h b/ydb/core/viewer/json_cluster.h index 36b5362a45..07b5a2579f 100644 --- a/ydb/core/viewer/json_cluster.h +++ b/ydb/core/viewer/json_cluster.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/tx/schemeshard/schemeshard.h> #include <ydb/core/tx/tx_proxy/proxy.h> diff --git a/ydb/core/viewer/json_compute.h b/ydb/core/viewer/json_compute.h index 980b8bfc1e..8445357464 100644 --- a/ydb/core/viewer/json_compute.h +++ b/ydb/core/viewer/json_compute.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/interconnect.h> #include <ydb/core/base/tablet.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/base/subdomain.h> diff --git a/ydb/core/viewer/json_config.h b/ydb/core/viewer/json_config.h index 7e501d5afb..81513d1f8b 100644 --- a/ydb/core/viewer/json_config.h +++ b/ydb/core/viewer/json_config.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/hive.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/viewer/json_content.h b/ydb/core/viewer/json_content.h index 79b230f128..725e4cc50f 100644 --- a/ydb/core/viewer/json_content.h +++ b/ydb/core/viewer/json_content.h @@ -1,8 +1,8 @@ #pragma once #include <unordered_map> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include "viewer.h" #include "browse.h" diff --git a/ydb/core/viewer/json_counters.h b/ydb/core/viewer/json_counters.h index cac1e0885c..fd032a710f 100644 --- a/ydb/core/viewer/json_counters.h +++ b/ydb/core/viewer/json_counters.h @@ -1,8 +1,8 @@ #pragma once #include <unordered_map> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include "viewer.h" #include "json_tabletinfo.h" diff --git a/ydb/core/viewer/json_describe.h b/ydb/core/viewer/json_describe.h index 05ef441f8f..8ab4df8dbf 100644 --- a/ydb/core/viewer/json_describe.h +++ b/ydb/core/viewer/json_describe.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/tx/schemeshard/schemeshard.h> diff --git a/ydb/core/viewer/json_hiveinfo.h b/ydb/core/viewer/json_hiveinfo.h index f4d04ddfaf..3cafb14541 100644 --- a/ydb/core/viewer/json_hiveinfo.h +++ b/ydb/core/viewer/json_hiveinfo.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/hive.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/viewer/json_hivestats.h b/ydb/core/viewer/json_hivestats.h index 7f24693d63..87f2b85912 100644 --- a/ydb/core/viewer/json_hivestats.h +++ b/ydb/core/viewer/json_hivestats.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/hive.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/viewer/json_labeledcounters.h b/ydb/core/viewer/json_labeledcounters.h index 6fce18b32b..848f441b63 100644 --- a/ydb/core/viewer/json_labeledcounters.h +++ b/ydb/core/viewer/json_labeledcounters.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/tablet/tablet_counters_aggregator.h> diff --git a/ydb/core/viewer/json_metainfo.h b/ydb/core/viewer/json_metainfo.h index 54064d7403..a0027056a0 100644 --- a/ydb/core/viewer/json_metainfo.h +++ b/ydb/core/viewer/json_metainfo.h @@ -1,8 +1,8 @@ #pragma once #include <unordered_map> #include <unordered_set> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/appdata.h> #include <ydb/core/base/domain.h> #include <ydb/core/base/hive.h> diff --git a/ydb/core/viewer/json_netinfo.h b/ydb/core/viewer/json_netinfo.h index 3d7c3835a0..4bfa6a3348 100644 --- a/ydb/core/viewer/json_netinfo.h +++ b/ydb/core/viewer/json_netinfo.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/interconnect.h> #include <ydb/core/base/tablet.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/base/subdomain.h> diff --git a/ydb/core/viewer/json_nodeinfo.h b/ydb/core/viewer/json_nodeinfo.h index 60245326fa..77dc7d298a 100644 --- a/ydb/core/viewer/json_nodeinfo.h +++ b/ydb/core/viewer/json_nodeinfo.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include "wb_merge.h" diff --git a/ydb/core/viewer/json_nodelist.h b/ydb/core/viewer/json_nodelist.h index 504ed152d8..a9febb7749 100644 --- a/ydb/core/viewer/json_nodelist.h +++ b/ydb/core/viewer/json_nodelist.h @@ -1,9 +1,9 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/json/json_writer.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/json/json_writer.h> #include <ydb/core/protos/services.pb.h> #include "viewer.h" diff --git a/ydb/core/viewer/json_pdiskinfo.h b/ydb/core/viewer/json_pdiskinfo.h index 881c108e51..2e1fa81704 100644 --- a/ydb/core/viewer/json_pdiskinfo.h +++ b/ydb/core/viewer/json_pdiskinfo.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include "json_wb_req.h" diff --git a/ydb/core/viewer/json_pqconsumerinfo.h b/ydb/core/viewer/json_pqconsumerinfo.h index b98dfc2632..3201c98297 100644 --- a/ydb/core/viewer/json_pqconsumerinfo.h +++ b/ydb/core/viewer/json_pqconsumerinfo.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/persqueue/events/global.h> diff --git a/ydb/core/viewer/json_query.h b/ydb/core/viewer/json_query.h index 600d8088e1..ac083d92ea 100644 --- a/ydb/core/viewer/json_query.h +++ b/ydb/core/viewer/json_query.h @@ -1,11 +1,11 @@ #pragma once #include "viewer.h" #include <unordered_map> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> -#include <library/cpp/json/json_value.h> -#include <library/cpp/json/json_reader.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> +#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_reader.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/kqp/kqp.h> #include <ydb/core/kqp/executer/kqp_executer.h> diff --git a/ydb/core/viewer/json_storage.h b/ydb/core/viewer/json_storage.h index 76e5d2f5e8..9246d6e838 100644 --- a/ydb/core/viewer/json_storage.h +++ b/ydb/core/viewer/json_storage.h @@ -1,8 +1,8 @@ #pragma once #include <unordered_map> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/viewer/json/json.h> #include <ydb/core/protos/node_whiteboard.pb.h> diff --git a/ydb/core/viewer/json_sysinfo.h b/ydb/core/viewer/json_sysinfo.h index 05a477c2df..caf005fecd 100644 --- a/ydb/core/viewer/json_sysinfo.h +++ b/ydb/core/viewer/json_sysinfo.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include "json_wb_req.h" diff --git a/ydb/core/viewer/json_tabletcounters.h b/ydb/core/viewer/json_tabletcounters.h index 7f39910441..a32fed3100 100644 --- a/ydb/core/viewer/json_tabletcounters.h +++ b/ydb/core/viewer/json_tabletcounters.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/tablet.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/viewer/json_tabletinfo.h b/ydb/core/viewer/json_tabletinfo.h index 32546865a1..9fc7ffadce 100644 --- a/ydb/core/viewer/json_tabletinfo.h +++ b/ydb/core/viewer/json_tabletinfo.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/tx/schemeshard/schemeshard.h> #include <ydb/core/tx/tx_proxy/proxy.h> diff --git a/ydb/core/viewer/json_tenantinfo.h b/ydb/core/viewer/json_tenantinfo.h index 749422ba39..5fcb71c14a 100644 --- a/ydb/core/viewer/json_tenantinfo.h +++ b/ydb/core/viewer/json_tenantinfo.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/tablet.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/base/subdomain.h> diff --git a/ydb/core/viewer/json_tenants.h b/ydb/core/viewer/json_tenants.h index 762d5e3b43..973622c8d6 100644 --- a/ydb/core/viewer/json_tenants.h +++ b/ydb/core/viewer/json_tenants.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/tablet.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> diff --git a/ydb/core/viewer/json_topicinfo.h b/ydb/core/viewer/json_topicinfo.h index cbf42ee727..468962297a 100644 --- a/ydb/core/viewer/json_topicinfo.h +++ b/ydb/core/viewer/json_topicinfo.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/tablet/tablet_counters_aggregator.h> diff --git a/ydb/core/viewer/json_vdiskinfo.h b/ydb/core/viewer/json_vdiskinfo.h index db681f044b..3830f45acd 100644 --- a/ydb/core/viewer/json_vdiskinfo.h +++ b/ydb/core/viewer/json_vdiskinfo.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/util/tuples.h> diff --git a/ydb/core/viewer/json_wb_req.h b/ydb/core/viewer/json_wb_req.h index f04c85688f..6742e58368 100644 --- a/ydb/core/viewer/json_wb_req.h +++ b/ydb/core/viewer/json_wb_req.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/viewer/json/json.h> diff --git a/ydb/core/viewer/json_whoami.h b/ydb/core/viewer/json_whoami.h index b490a6930f..0cdc0c0ea7 100644 --- a/ydb/core/viewer/json_whoami.h +++ b/ydb/core/viewer/json_whoami.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/tablet_pipe.h> #include <ydb/core/protos/services.pb.h> #include <ydb/core/tx/schemeshard/schemeshard.h> diff --git a/ydb/core/viewer/viewer.cpp b/ydb/core/viewer/viewer.cpp index f1124115bf..2e863846d8 100644 --- a/ydb/core/viewer/viewer.cpp +++ b/ydb/core/viewer/viewer.cpp @@ -1,16 +1,16 @@ -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <ydb/core/mon/mon.h> -#include <library/cpp/actors/core/mon.h> +#include <library/cpp/actors/core/mon.h> #include <ydb/core/base/appdata.h> #include <library/cpp/monlib/service/pages/templates.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> #include <util/generic/algorithm.h> #include <ydb/core/base/path.h> #include <ydb/core/base/tablet_types.h> #include <ydb/core/node_whiteboard/node_whiteboard.h> #include <ydb/core/base/statestorage.h> -#include <library/cpp/mime/types/mime.h> +#include <library/cpp/mime/types/mime.h> #include <util/system/fstat.h> #include <util/stream/file.h> #include "viewer.h" diff --git a/ydb/core/viewer/viewer.h b/ydb/core/viewer/viewer.h index ab34762e3e..90567e1dd1 100644 --- a/ydb/core/viewer/viewer.h +++ b/ydb/core/viewer/viewer.h @@ -3,9 +3,9 @@ #include <ydb/core/viewer/json/json.h> #include <ydb/core/tablet/defs.h> -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/event.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/event.h> #include <ydb/core/driver_lib/run/config.h> #include <ydb/core/viewer/protos/viewer.pb.h> #include <util/system/hostname.h> diff --git a/ydb/core/viewer/ya.make b/ydb/core/viewer/ya.make index 214e3b6726..188bf5b831 100644 --- a/ydb/core/viewer/ya.make +++ b/ydb/core/viewer/ya.make @@ -180,9 +180,9 @@ RESOURCE( ) PEERDIR( - library/cpp/actors/core - library/cpp/archive - library/cpp/mime/types + library/cpp/actors/core + library/cpp/archive + library/cpp/mime/types ydb/core/base ydb/core/blobstorage/base ydb/core/client/server diff --git a/ydb/core/ymq/actor/action.h b/ydb/core/ymq/actor/action.h index 1801c98d68..fec117a2f1 100644 --- a/ydb/core/ymq/actor/action.h +++ b/ydb/core/ymq/actor/action.h @@ -22,8 +22,8 @@ #include <ydb/core/ymq/base/query_id.h> #include <ydb/core/ymq/base/security.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/folder/path.h> #include <util/generic/guid.h> diff --git a/ydb/core/ymq/actor/actor.h b/ydb/core/ymq/actor/actor.h index d6a825d2f8..dfe1c4a599 100644 --- a/ydb/core/ymq/actor/actor.h +++ b/ydb/core/ymq/actor/actor.h @@ -2,7 +2,7 @@ #include "defs.h" #include <ydb/core/protos/msgbus.pb.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr::NSQS { diff --git a/ydb/core/ymq/actor/attributes_md5.cpp b/ydb/core/ymq/actor/attributes_md5.cpp index 411c3b0861..58cdadd5b4 100644 --- a/ydb/core/ymq/actor/attributes_md5.cpp +++ b/ydb/core/ymq/actor/attributes_md5.cpp @@ -1,6 +1,6 @@ #include "attributes_md5.h" -#include <library/cpp/digest/md5/md5.h> +#include <library/cpp/digest/md5/md5.h> #include <util/network/init.h> diff --git a/ydb/core/ymq/actor/defs.h b/ydb/core/ymq/actor/defs.h index 2ca6059903..0b4e33e7bc 100644 --- a/ydb/core/ymq/actor/defs.h +++ b/ydb/core/ymq/actor/defs.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> namespace NKikimr::NSQS { diff --git a/ydb/core/ymq/actor/events.h b/ydb/core/ymq/actor/events.h index 9fff62c7cf..13772629f5 100644 --- a/ydb/core/ymq/actor/events.h +++ b/ydb/core/ymq/actor/events.h @@ -16,8 +16,8 @@ #include <ydb/core/ymq/base/queue_path.h> #include <ydb/core/ymq/proto/records.pb.h> -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/event_local.h> #include <library/cpp/monlib/dynamic_counters/counters.h> #include <util/generic/hash.h> diff --git a/ydb/core/ymq/actor/executor.h b/ydb/core/ymq/actor/executor.h index 5dd51c6da2..04e7fe29ae 100644 --- a/ydb/core/ymq/actor/executor.h +++ b/ydb/core/ymq/actor/executor.h @@ -8,9 +8,9 @@ #include <ydb/core/ymq/actor/params.h> #include <ydb/core/ymq/base/counters.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/hfunc.h> #include <library/cpp/monlib/dynamic_counters/counters.h> #include <util/generic/hash.h> diff --git a/ydb/core/ymq/actor/fifo_cleanup.cpp b/ydb/core/ymq/actor/fifo_cleanup.cpp index 218deb0fcc..994eb1ae8f 100644 --- a/ydb/core/ymq/actor/fifo_cleanup.cpp +++ b/ydb/core/ymq/actor/fifo_cleanup.cpp @@ -7,7 +7,7 @@ #include <ydb/core/base/appdata.h> #include <ydb/core/ymq/base/debug_info.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/random/random.h> diff --git a/ydb/core/ymq/actor/fifo_cleanup.h b/ydb/core/ymq/actor/fifo_cleanup.h index edf6040eec..79136f8b38 100644 --- a/ydb/core/ymq/actor/fifo_cleanup.h +++ b/ydb/core/ymq/actor/fifo_cleanup.h @@ -3,7 +3,7 @@ #include <ydb/core/ymq/actor/events.h> #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr::NSQS { diff --git a/ydb/core/ymq/actor/garbage_collector.cpp b/ydb/core/ymq/actor/garbage_collector.cpp index e82284c020..201f314355 100644 --- a/ydb/core/ymq/actor/garbage_collector.cpp +++ b/ydb/core/ymq/actor/garbage_collector.cpp @@ -11,8 +11,8 @@ #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <library/cpp/monlib/service/pages/templates.h> diff --git a/ydb/core/ymq/actor/infly.h b/ydb/core/ymq/actor/infly.h index 1dea6baa6c..51e814b528 100644 --- a/ydb/core/ymq/actor/infly.h +++ b/ydb/core/ymq/actor/infly.h @@ -1,6 +1,6 @@ #pragma once #include "defs.h" -#include <library/cpp/containers/intrusive_rb_tree/rb_tree.h> +#include <library/cpp/containers/intrusive_rb_tree/rb_tree.h> #include <util/datetime/base.h> #include <util/generic/ptr.h> diff --git a/ydb/core/ymq/actor/log.h b/ydb/core/ymq/actor/log.h index 6acb8cebaf..8e28b1c33b 100644 --- a/ydb/core/ymq/actor/log.h +++ b/ydb/core/ymq/actor/log.h @@ -1,6 +1,6 @@ #pragma once #include "defs.h" -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <util/stream/output.h> diff --git a/ydb/core/ymq/actor/metering.cpp b/ydb/core/ymq/actor/metering.cpp index 94ccef7eb0..09907d5f01 100644 --- a/ydb/core/ymq/actor/metering.cpp +++ b/ydb/core/ymq/actor/metering.cpp @@ -10,8 +10,8 @@ #include <ydb/core/ymq/base/counters.h> #include <ydb/core/ymq/base/processed_request_attributes.h> -#include <library/cpp/logger/global/global.h> -#include <library/cpp/logger/record.h> +#include <library/cpp/logger/global/global.h> +#include <library/cpp/logger/record.h> #include <util/generic/guid.h> #include <util/generic/serialized_enum.h> diff --git a/ydb/core/ymq/actor/metering.h b/ydb/core/ymq/actor/metering.h index c9d5a58991..041641426c 100644 --- a/ydb/core/ymq/actor/metering.h +++ b/ydb/core/ymq/actor/metering.h @@ -7,7 +7,7 @@ #include <ydb/core/protos/config.pb.h> -#include <library/cpp/scheme/scheme.h> +#include <library/cpp/scheme/scheme.h> #include <util/datetime/base.h> #include <util/generic/hash.h> diff --git a/ydb/core/ymq/actor/migration.h b/ydb/core/ymq/actor/migration.h index 501ec050f3..d1bcc0ab64 100644 --- a/ydb/core/ymq/actor/migration.h +++ b/ydb/core/ymq/actor/migration.h @@ -4,7 +4,7 @@ #include <ydb/core/protos/services.pb.h> #include <ydb/public/lib/scheme_types/scheme_type_id.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr::NSQS { diff --git a/ydb/core/ymq/actor/ping.h b/ydb/core/ymq/actor/ping.h index 830f7e10b8..0a7431eed2 100644 --- a/ydb/core/ymq/actor/ping.h +++ b/ydb/core/ymq/actor/ping.h @@ -3,7 +3,7 @@ #include "actor.h" #include "log.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> namespace NKikimr::NSQS { diff --git a/ydb/core/ymq/actor/proxy_actor.cpp b/ydb/core/ymq/actor/proxy_actor.cpp index 98d85210a5..619e7e689c 100644 --- a/ydb/core/ymq/actor/proxy_actor.cpp +++ b/ydb/core/ymq/actor/proxy_actor.cpp @@ -5,7 +5,7 @@ #include <ydb/core/protos/sqs.pb.h> #include <ydb/core/ymq/base/counters.h> #include <ydb/core/ymq/base/security.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/string/builder.h> #include <util/system/defaults.h> diff --git a/ydb/core/ymq/actor/proxy_actor.h b/ydb/core/ymq/actor/proxy_actor.h index b553716bf0..812d6fac64 100644 --- a/ydb/core/ymq/actor/proxy_actor.h +++ b/ydb/core/ymq/actor/proxy_actor.h @@ -9,7 +9,7 @@ #include <ydb/core/ymq/base/counters.h> #include <ydb/core/ymq/base/debug_info.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <library/cpp/monlib/dynamic_counters/counters.h> namespace NKikimr::NSQS { diff --git a/ydb/core/ymq/actor/proxy_service.h b/ydb/core/ymq/actor/proxy_service.h index a3c991105f..2475dc9ed8 100644 --- a/ydb/core/ymq/actor/proxy_service.h +++ b/ydb/core/ymq/actor/proxy_service.h @@ -9,11 +9,11 @@ #include <ydb/core/protos/config.pb.h> #include <ydb/core/ymq/actor/actor.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/hash.h> #include <util/generic/hash_set.h> diff --git a/ydb/core/ymq/actor/purge.h b/ydb/core/ymq/actor/purge.h index 2a16a5aa24..f9d0201371 100644 --- a/ydb/core/ymq/actor/purge.h +++ b/ydb/core/ymq/actor/purge.h @@ -2,9 +2,9 @@ #include "defs.h" #include "events.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/map.h> diff --git a/ydb/core/ymq/actor/queue_leader.cpp b/ydb/core/ymq/actor/queue_leader.cpp index 2c6e81d827..40f6dee5e0 100644 --- a/ydb/core/ymq/actor/queue_leader.cpp +++ b/ydb/core/ymq/actor/queue_leader.cpp @@ -18,7 +18,7 @@ #include <ydb/core/ymq/queues/fifo/queries.h> #include <ydb/core/ymq/queues/std/queries.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/random/random.h> #include <util/random/shuffle.h> diff --git a/ydb/core/ymq/actor/queue_leader.h b/ydb/core/ymq/actor/queue_leader.h index 3504e4ddb1..adb58fad6c 100644 --- a/ydb/core/ymq/actor/queue_leader.h +++ b/ydb/core/ymq/actor/queue_leader.h @@ -10,8 +10,8 @@ #include <ydb/core/ymq/actor/message_delay_stats.h> #include <ydb/core/ymq/base/counters.h> -#include <library/cpp/actors/core/actorid.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <library/cpp/monlib/dynamic_counters/counters.h> #include <util/generic/guid.h> diff --git a/ydb/core/ymq/actor/queues_list_reader.h b/ydb/core/ymq/actor/queues_list_reader.h index 6562ad4036..1259eb2ec0 100644 --- a/ydb/core/ymq/actor/queues_list_reader.h +++ b/ydb/core/ymq/actor/queues_list_reader.h @@ -4,7 +4,7 @@ #include "log.h" #include "serviceid.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include <util/generic/hash.h> #include <util/generic/ptr.h> diff --git a/ydb/core/ymq/actor/receive_message.cpp b/ydb/core/ymq/actor/receive_message.cpp index 2b5bf0e517..eb74add760 100644 --- a/ydb/core/ymq/actor/receive_message.cpp +++ b/ydb/core/ymq/actor/receive_message.cpp @@ -11,7 +11,7 @@ #include <ydb/core/ymq/proto/records.pb.h> #include <ydb/public/lib/value/value.h> -#include <library/cpp/digest/md5/md5.h> +#include <library/cpp/digest/md5/md5.h> #include <library/cpp/monlib/metrics/histogram_collector.h> using NKikimr::NClient::TValue; diff --git a/ydb/core/ymq/actor/retention.cpp b/ydb/core/ymq/actor/retention.cpp index 9e610e8ed2..e3b6bf7a48 100644 --- a/ydb/core/ymq/actor/retention.cpp +++ b/ydb/core/ymq/actor/retention.cpp @@ -7,7 +7,7 @@ #include <ydb/core/base/appdata.h> #include <ydb/core/ymq/base/debug_info.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/random/random.h> namespace NKikimr::NSQS { diff --git a/ydb/core/ymq/actor/retention.h b/ydb/core/ymq/actor/retention.h index 724baddff3..9d55925570 100644 --- a/ydb/core/ymq/actor/retention.h +++ b/ydb/core/ymq/actor/retention.h @@ -3,7 +3,7 @@ #include <ydb/core/ymq/actor/events.h> #include <ydb/core/protos/services.pb.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NKikimr::NSQS { diff --git a/ydb/core/ymq/actor/schema.h b/ydb/core/ymq/actor/schema.h index c88face921..1697e45384 100644 --- a/ydb/core/ymq/actor/schema.h +++ b/ydb/core/ymq/actor/schema.h @@ -9,10 +9,10 @@ #include <ydb/core/kesus/tablet/events.h> #include <ydb/core/tx/schemeshard/schemeshard.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/generic/hash.h> diff --git a/ydb/core/ymq/actor/send_message.cpp b/ydb/core/ymq/actor/send_message.cpp index e596b8f2e3..28fa81652c 100644 --- a/ydb/core/ymq/actor/send_message.cpp +++ b/ydb/core/ymq/actor/send_message.cpp @@ -13,7 +13,7 @@ #include <ydb/public/lib/value/value.h> -#include <library/cpp/digest/md5/md5.h> +#include <library/cpp/digest/md5/md5.h> #include <util/random/random.h> using NKikimr::NClient::TValue; diff --git a/ydb/core/ymq/actor/service.cpp b/ydb/core/ymq/actor/service.cpp index 34c9a4ae46..1a57ba6007 100644 --- a/ydb/core/ymq/actor/service.cpp +++ b/ydb/core/ymq/actor/service.cpp @@ -26,8 +26,8 @@ #include <ydb/core/base/counters.h> #include <library/cpp/lwtrace/mon/mon_lwtrace.h> -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/hfunc.h> #include <library/cpp/logger/global/global.h> #include <util/generic/algorithm.h> diff --git a/ydb/core/ymq/actor/service.h b/ydb/core/ymq/actor/service.h index caf091c24b..b89d92276e 100644 --- a/ydb/core/ymq/actor/service.h +++ b/ydb/core/ymq/actor/service.h @@ -11,7 +11,7 @@ #include <ydb/core/tx/schemeshard/schemeshard.h> #include <ydb/public/sdk/cpp/client/ydb_table/table.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <util/generic/hash.h> #include <util/generic/ptr.h> #include <library/cpp/logger/log.h> diff --git a/ydb/core/ymq/actor/serviceid.h b/ydb/core/ymq/actor/serviceid.h index 7219d918ba..ab9c33994a 100644 --- a/ydb/core/ymq/actor/serviceid.h +++ b/ydb/core/ymq/actor/serviceid.h @@ -1,9 +1,9 @@ #pragma once #include "defs.h" -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> -#include <library/cpp/logger/file.h> +#include <library/cpp/logger/file.h> #include <util/generic/strbuf.h> diff --git a/ydb/core/ymq/actor/set_queue_attributes.cpp b/ydb/core/ymq/actor/set_queue_attributes.cpp index df33ad99e6..ff9ed526c2 100644 --- a/ydb/core/ymq/actor/set_queue_attributes.cpp +++ b/ydb/core/ymq/actor/set_queue_attributes.cpp @@ -10,7 +10,7 @@ #include <ydb/core/ymq/base/queue_attributes.h> #include <ydb/public/lib/value/value.h> -#include <library/cpp/scheme/scheme.h> +#include <library/cpp/scheme/scheme.h> #include <util/generic/maybe.h> #include <util/generic/utility.h> diff --git a/ydb/core/ymq/actor/user_settings_reader.h b/ydb/core/ymq/actor/user_settings_reader.h index c85d6922e4..b42456ec02 100644 --- a/ydb/core/ymq/actor/user_settings_reader.h +++ b/ydb/core/ymq/actor/user_settings_reader.h @@ -4,7 +4,7 @@ #include "log.h" #include "serviceid.h" -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <util/generic/hash.h> #include <util/generic/ptr.h> diff --git a/ydb/core/ymq/actor/ya.make b/ydb/core/ymq/actor/ya.make index 070653bb57..d9f45579b1 100644 --- a/ydb/core/ymq/actor/ya.make +++ b/ydb/core/ymq/actor/ya.make @@ -56,15 +56,15 @@ SRCS( PEERDIR( contrib/libs/openssl contrib/libs/protobuf - library/cpp/actors/core - library/cpp/containers/intrusive_rb_tree - library/cpp/digest/md5 - library/cpp/grpc/client - library/cpp/logger + library/cpp/actors/core + library/cpp/containers/intrusive_rb_tree + library/cpp/digest/md5 + library/cpp/grpc/client + library/cpp/logger library/cpp/lwtrace/mon library/cpp/monlib/dynamic_counters library/cpp/monlib/service/pages - library/cpp/scheme + library/cpp/scheme ydb/core/base ydb/core/client/minikql_compile ydb/core/engine diff --git a/ydb/core/ymq/base/dlq_helpers.cpp b/ydb/core/ymq/base/dlq_helpers.cpp index a2ba9fac42..76f6c3849e 100644 --- a/ydb/core/ymq/base/dlq_helpers.cpp +++ b/ydb/core/ymq/base/dlq_helpers.cpp @@ -2,7 +2,7 @@ #include <ydb/core/ymq/base/constants.h> #include <ydb/core/ymq/base/limits.h> -#include <library/cpp/scheme/scheme.h> +#include <library/cpp/scheme/scheme.h> #include <util/string/split.h> #include <util/string/join.h> diff --git a/ydb/core/ymq/base/probes.h b/ydb/core/ymq/base/probes.h index 0fa0a46ffc..0143a96acb 100644 --- a/ydb/core/ymq/base/probes.h +++ b/ydb/core/ymq/base/probes.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #define SQS_PROVIDER(PROBE, EVENT, GROUPS, TYPES, NAMES) \ PROBE(CreateLeader, GROUPS("SqsLeadersLifeTime"), \ diff --git a/ydb/core/ymq/base/ya.make b/ydb/core/ymq/base/ya.make index 14cd4e72a1..c3988fbf5b 100644 --- a/ydb/core/ymq/base/ya.make +++ b/ydb/core/ymq/base/ya.make @@ -27,9 +27,9 @@ PEERDIR( contrib/libs/openssl library/cpp/cgiparam library/cpp/ipmath - library/cpp/lwtrace + library/cpp/lwtrace library/cpp/monlib/dynamic_counters - library/cpp/scheme + library/cpp/scheme library/cpp/string_utils/base64 ydb/core/base ydb/core/protos diff --git a/ydb/core/ymq/http/http.cpp b/ydb/core/ymq/http/http.cpp index 5d0963bfb2..87c083921d 100644 --- a/ydb/core/ymq/http/http.cpp +++ b/ydb/core/ymq/http/http.cpp @@ -13,10 +13,10 @@ #include <ydb/core/ymq/base/limits.h> #include <ydb/core/ymq/base/secure_protobuf_printer.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/http/server/response.h> -#include <library/cpp/http/misc/parsed_request.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/http/server/response.h> +#include <library/cpp/http/misc/parsed_request.h> #include <util/generic/guid.h> #include <util/generic/hash.h> diff --git a/ydb/core/ymq/http/http.h b/ydb/core/ymq/http/http.h index 01a2b0edc4..bca6ce12ed 100644 --- a/ydb/core/ymq/http/http.h +++ b/ydb/core/ymq/http/http.h @@ -9,8 +9,8 @@ #include <ydb/library/http_proxy/authorization/signature.h> #include <ydb/core/ymq/base/counters.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/http/server/http.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/http/server/http.h> #include <util/generic/buffer.h> #include <util/generic/maybe.h> diff --git a/ydb/core/ymq/http/xml.cpp b/ydb/core/ymq/http/xml.cpp index 0cb6f85274..b844a66b73 100644 --- a/ydb/core/ymq/http/xml.cpp +++ b/ydb/core/ymq/http/xml.cpp @@ -1,7 +1,7 @@ #include "xml.h" #include "xml_builder.h" -#include <library/cpp/protobuf/json/proto2json.h> +#include <library/cpp/protobuf/json/proto2json.h> #include <library/cpp/string_utils/base64/base64.h> #include <util/string/builder.h> diff --git a/ydb/core/ymq/http/ya.make b/ydb/core/ymq/http/ya.make index a8c5f62386..cd82854985 100644 --- a/ydb/core/ymq/http/ya.make +++ b/ydb/core/ymq/http/ya.make @@ -15,11 +15,11 @@ SRCS( PEERDIR( contrib/libs/libxml - library/cpp/actors/core + library/cpp/actors/core library/cpp/cgiparam - library/cpp/http/misc - library/cpp/http/server - library/cpp/protobuf/json + library/cpp/http/misc + library/cpp/http/server + library/cpp/protobuf/json library/cpp/string_utils/base64 library/cpp/string_utils/quote library/cpp/string_utils/url diff --git a/ydb/core/yql_testlib/ya.make b/ydb/core/yql_testlib/ya.make index a68cca63d3..b94d9326b6 100644 --- a/ydb/core/yql_testlib/ya.make +++ b/ydb/core/yql_testlib/ya.make @@ -8,8 +8,8 @@ SRCS( ) PEERDIR( - library/cpp/grpc/client - library/cpp/regex/pcre + library/cpp/grpc/client + library/cpp/regex/pcre library/cpp/testing/unittest ydb/core/base ydb/core/client diff --git a/ydb/library/aclib/aclib.cpp b/ydb/library/aclib/aclib.cpp index 946497ea30..050360c064 100644 --- a/ydb/library/aclib/aclib.cpp +++ b/ydb/library/aclib/aclib.cpp @@ -3,7 +3,7 @@ #include <util/string/vector.h> #include <algorithm> #include <util/string/split.h> -#include <library/cpp/protobuf/util/is_equal.h> +#include <library/cpp/protobuf/util/is_equal.h> namespace NACLib { diff --git a/ydb/library/aclib/ya.make b/ydb/library/aclib/ya.make index a0c1da4c76..e07e433efe 100644 --- a/ydb/library/aclib/ya.make +++ b/ydb/library/aclib/ya.make @@ -2,7 +2,7 @@ LIBRARY() PEERDIR( contrib/libs/protobuf - library/cpp/protobuf/util + library/cpp/protobuf/util ydb/library/aclib/protos ) diff --git a/ydb/library/binary_json/ut/test_base.h b/ydb/library/binary_json/ut/test_base.h index 838fb33251..a0829e2029 100644 --- a/ydb/library/binary_json/ut/test_base.h +++ b/ydb/library/binary_json/ut/test_base.h @@ -14,7 +14,7 @@ #include <ydb/library/binary_json/read.h> -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> #include <library/cpp/testing/unittest/registar.h> #include <util/generic/yexception.h> diff --git a/ydb/library/binary_json/write.cpp b/ydb/library/binary_json/write.cpp index 0aee36f5d3..882995bc6b 100644 --- a/ydb/library/binary_json/write.cpp +++ b/ydb/library/binary_json/write.cpp @@ -1,6 +1,6 @@ #include "write.h" -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> #include <util/generic/vector.h> #include <util/generic/stack.h> diff --git a/ydb/library/binary_json/ya.make b/ydb/library/binary_json/ya.make index c2fe77f4bf..466b4692af 100644 --- a/ydb/library/binary_json/ya.make +++ b/ydb/library/binary_json/ya.make @@ -12,7 +12,7 @@ YQL_ABI_VERSION( ) PEERDIR( - library/cpp/json + library/cpp/json ydb/library/yql/minikql/dom ) diff --git a/ydb/library/http_proxy/authorization/signature.cpp b/ydb/library/http_proxy/authorization/signature.cpp index 60368c0614..d42d0e4fd7 100644 --- a/ydb/library/http_proxy/authorization/signature.cpp +++ b/ydb/library/http_proxy/authorization/signature.cpp @@ -1,8 +1,8 @@ #include "auth_helpers.h" #include "signature.h" -#include <library/cpp/http/io/stream.h> -#include <library/cpp/http/misc/parsed_request.h> +#include <library/cpp/http/io/stream.h> +#include <library/cpp/http/misc/parsed_request.h> #include <contrib/libs/openssl/include/openssl/evp.h> #include <contrib/libs/openssl/include/openssl/hmac.h> diff --git a/ydb/library/schlab/mon/mon.cpp b/ydb/library/schlab/mon/mon.cpp index fc06b412ae..1c5e5c5149 100644 --- a/ydb/library/schlab/mon/mon.cpp +++ b/ydb/library/schlab/mon/mon.cpp @@ -4,8 +4,8 @@ #include <library/cpp/monlib/service/pages/mon_page.h> #include <library/cpp/monlib/service/pages/resource_mon_page.h> #include <library/cpp/monlib/service/pages/templates.h> -#include <library/cpp/resource/resource.h> -#include <library/cpp/html/pcdata/pcdata.h> +#include <library/cpp/resource/resource.h> +#include <library/cpp/html/pcdata/pcdata.h> #include <util/stream/str.h> namespace NKikimr { diff --git a/ydb/library/schlab/mon/test/test.cpp b/ydb/library/schlab/mon/test/test.cpp index 64bf719d9a..f5fb3253c8 100644 --- a/ydb/library/schlab/mon/test/test.cpp +++ b/ydb/library/schlab/mon/test/test.cpp @@ -2,7 +2,7 @@ #include <library/cpp/getopt/last_getopt.h> #include <library/cpp/monlib/service/monservice.h> #include <library/cpp/monlib/service/pages/resource_mon_page.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> namespace { diff --git a/ydb/library/schlab/mon/ya.make b/ydb/library/schlab/mon/ya.make index ca05b8cdc3..9493e26917 100644 --- a/ydb/library/schlab/mon/ya.make +++ b/ydb/library/schlab/mon/ya.make @@ -26,7 +26,7 @@ SRCS( PEERDIR( library/cpp/html/pcdata library/cpp/monlib/dynamic_counters - library/cpp/resource + library/cpp/resource ydb/library/schlab/schemu ) diff --git a/ydb/library/schlab/probes/probes.h b/ydb/library/schlab/probes/probes.h index 6d08a84b29..fb54fd1336 100644 --- a/ydb/library/schlab/probes/probes.h +++ b/ydb/library/schlab/probes/probes.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #define SCHLAB_PROVIDER(PROBE, EVENT, GROUPS, TYPES, NAMES) \ PROBE(AddJob, GROUPS("SchLab"), \ diff --git a/ydb/library/schlab/probes/ya.make b/ydb/library/schlab/probes/ya.make index c3b87eb5df..c63e2f34fe 100644 --- a/ydb/library/schlab/probes/ya.make +++ b/ydb/library/schlab/probes/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/lwtrace + library/cpp/lwtrace ) SRCS( diff --git a/ydb/library/schlab/schine/scheduler.cpp b/ydb/library/schlab/schine/scheduler.cpp index dfd012a41c..2331cb89af 100644 --- a/ydb/library/schlab/schine/scheduler.cpp +++ b/ydb/library/schlab/schine/scheduler.cpp @@ -1,6 +1,6 @@ #include "scheduler.h" -#include <library/cpp/lwtrace/all.h> +#include <library/cpp/lwtrace/all.h> #include <library/cpp/lwtrace/mon/mon_lwtrace.h> #include <ydb/library/schlab/probes/probes.h> diff --git a/ydb/library/schlab/schoot/schoot_gen_cfg.cpp b/ydb/library/schlab/schoot/schoot_gen_cfg.cpp index 92f721c73a..6e6bb25ce9 100644 --- a/ydb/library/schlab/schoot/schoot_gen_cfg.cpp +++ b/ydb/library/schlab/schoot/schoot_gen_cfg.cpp @@ -1,6 +1,6 @@ #include "schoot_gen_cfg.h" #include <ydb/library/schlab/protos/schlab.pb.h> -#include <library/cpp/protobuf/json/json2proto.h> +#include <library/cpp/protobuf/json/json2proto.h> #include <util/stream/str.h> #include <google/protobuf/text_format.h> diff --git a/ydb/library/schlab/schoot/ya.make b/ydb/library/schlab/schoot/ya.make index 89519078de..aa38c369dc 100644 --- a/ydb/library/schlab/schoot/ya.make +++ b/ydb/library/schlab/schoot/ya.make @@ -7,7 +7,7 @@ OWNER( PEERDIR( library/cpp/containers/stack_vector - library/cpp/protobuf/json + library/cpp/protobuf/json ydb/library/schlab/protos ) diff --git a/ydb/library/wilson/wilson_event.h b/ydb/library/wilson/wilson_event.h index e092a2cd97..793bcc3e58 100644 --- a/ydb/library/wilson/wilson_event.h +++ b/ydb/library/wilson/wilson_event.h @@ -1,2 +1,2 @@ #pragma once -#include <library/cpp/actors/wilson/wilson_event.h> +#include <library/cpp/actors/wilson/wilson_event.h> diff --git a/ydb/library/wilson/wilson_trace.h b/ydb/library/wilson/wilson_trace.h index 8c27c41fbd..4077f77136 100644 --- a/ydb/library/wilson/wilson_trace.h +++ b/ydb/library/wilson/wilson_trace.h @@ -1,2 +1,2 @@ #pragma once -#include <library/cpp/actors/wilson/wilson_trace.h> +#include <library/cpp/actors/wilson/wilson_trace.h> diff --git a/ydb/library/wilson/ya.make b/ydb/library/wilson/ya.make index e4daf898c7..0b5ab83c2d 100644 --- a/ydb/library/wilson/ya.make +++ b/ydb/library/wilson/ya.make @@ -1,6 +1,6 @@ LIBRARY() PEERDIR( - library/cpp/actors/wilson + library/cpp/actors/wilson ) OWNER(alexvru) diff --git a/ydb/library/yql/ast/ya.make b/ydb/library/yql/ast/ya.make index 2d55860c89..a40a296972 100644 --- a/ydb/library/yql/ast/ya.make +++ b/ydb/library/yql/ast/ya.make @@ -31,11 +31,11 @@ SRCS( ) PEERDIR( - library/cpp/colorizer + library/cpp/colorizer library/cpp/containers/sorted_vector library/cpp/containers/stack_vector - library/cpp/deprecated/enum_codegen - library/cpp/enumbitset + library/cpp/deprecated/enum_codegen + library/cpp/enumbitset library/cpp/string_utils/levenshtein_diff library/cpp/yson ydb/library/yql/public/udf diff --git a/ydb/library/yql/ast/yql_ast.h b/ydb/library/yql/ast/yql_ast.h index 887b53dbc5..069710a90b 100644 --- a/ydb/library/yql/ast/yql_ast.h +++ b/ydb/library/yql/ast/yql_ast.h @@ -2,7 +2,7 @@ #include "yql_errors.h" -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <util/generic/ptr.h> #include <util/generic/strbuf.h> #include <util/generic/string.h> diff --git a/ydb/library/yql/ast/yql_expr.h b/ydb/library/yql/ast/yql_expr.h index d6eb544f9a..fc9e8a038a 100644 --- a/ydb/library/yql/ast/yql_expr.h +++ b/ydb/library/yql/ast/yql_expr.h @@ -13,9 +13,9 @@ #include <ydb/library/yql/public/udf/udf_data_type.h> #include <library/cpp/string_utils/levenshtein_diff/levenshtein_diff.h> -#include <library/cpp/enumbitset/enumbitset.h> +#include <library/cpp/enumbitset/enumbitset.h> #include <library/cpp/containers/stack_vector/stack_vec.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <util/string/builder.h> #include <util/generic/array_ref.h> diff --git a/ydb/library/yql/ast/yql_expr_types.h b/ydb/library/yql/ast/yql_expr_types.h index 391fa1ca97..abb9001793 100644 --- a/ydb/library/yql/ast/yql_expr_types.h +++ b/ydb/library/yql/ast/yql_expr_types.h @@ -1,5 +1,5 @@ #pragma once -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <util/stream/output.h> namespace NYql { diff --git a/ydb/library/yql/ast/yql_type_string.cpp b/ydb/library/yql/ast/yql_type_string.cpp index af9af93259..0e749ba87c 100644 --- a/ydb/library/yql/ast/yql_type_string.cpp +++ b/ydb/library/yql/ast/yql_type_string.cpp @@ -7,7 +7,7 @@ #include <util/string/cast.h> #include <util/generic/map.h> #include <util/generic/utility.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #define EXPECT_AND_SKIP_TOKEN_IMPL(token, message, result) \ diff --git a/ydb/library/yql/core/facade/ya.make b/ydb/library/yql/core/facade/ya.make index c3b5188980..efecd741e9 100644 --- a/ydb/library/yql/core/facade/ya.make +++ b/ydb/library/yql/core/facade/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/deprecated/split + library/cpp/deprecated/split library/cpp/random_provider library/cpp/string_utils/base64 library/cpp/threading/future diff --git a/ydb/library/yql/core/file_storage/file_storage.cpp b/ydb/library/yql/core/file_storage/file_storage.cpp index 631adbc688..08b6a41aed 100644 --- a/ydb/library/yql/core/file_storage/file_storage.cpp +++ b/ydb/library/yql/core/file_storage/file_storage.cpp @@ -15,7 +15,7 @@ #include <ydb/library/yql/utils/yql_panic.h> #include <library/cpp/cache/cache.h> -#include <library/cpp/digest/md5/md5.h> +#include <library/cpp/digest/md5/md5.h> #include <library/cpp/threading/future/async.h> #include <util/generic/guid.h> diff --git a/ydb/library/yql/core/file_storage/http_download/pattern_group.h b/ydb/library/yql/core/file_storage/http_download/pattern_group.h index 53d0d64a7f..613fbf8c3f 100644 --- a/ydb/library/yql/core/file_storage/http_download/pattern_group.h +++ b/ydb/library/yql/core/file_storage/http_download/pattern_group.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/regex/pcre/regexp.h> +#include <library/cpp/regex/pcre/regexp.h> #include <util/generic/map.h> #include <util/generic/vector.h> diff --git a/ydb/library/yql/core/file_storage/storage.cpp b/ydb/library/yql/core/file_storage/storage.cpp index 247bff5242..87b8c7b683 100644 --- a/ydb/library/yql/core/file_storage/storage.cpp +++ b/ydb/library/yql/core/file_storage/storage.cpp @@ -4,7 +4,7 @@ #include <ydb/library/yql/utils/rand_guid.h> #include <ydb/library/yql/utils/proc_alive.h> -#include <library/cpp/digest/md5/md5.h> +#include <library/cpp/digest/md5/md5.h> #include <util/folder/dirut.h> #include <util/generic/algorithm.h> diff --git a/ydb/library/yql/core/file_storage/url_mapper.h b/ydb/library/yql/core/file_storage/url_mapper.h index f6438ecca3..d151933483 100644 --- a/ydb/library/yql/core/file_storage/url_mapper.h +++ b/ydb/library/yql/core/file_storage/url_mapper.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/regex/pcre/regexp.h> +#include <library/cpp/regex/pcre/regexp.h> #include <util/generic/vector.h> namespace NYql { diff --git a/ydb/library/yql/core/file_storage/url_meta.cpp b/ydb/library/yql/core/file_storage/url_meta.cpp index 2dd973ea06..21ed1f7e5f 100644 --- a/ydb/library/yql/core/file_storage/url_meta.cpp +++ b/ydb/library/yql/core/file_storage/url_meta.cpp @@ -1,5 +1,5 @@ #include "url_meta.h" -#include <library/cpp/http/io/headers.h> +#include <library/cpp/http/io/headers.h> #include <util/stream/file.h> #include <util/system/file.h> diff --git a/ydb/library/yql/core/file_storage/ut/test_http_server.cpp b/ydb/library/yql/core/file_storage/ut/test_http_server.cpp index c296fc4bef..53fb076bb0 100644 --- a/ydb/library/yql/core/file_storage/ut/test_http_server.cpp +++ b/ydb/library/yql/core/file_storage/ut/test_http_server.cpp @@ -1,7 +1,7 @@ #include "test_http_server.h" -#include <library/cpp/http/misc/httpcodes.h> -#include <library/cpp/http/server/http_ex.h> +#include <library/cpp/http/misc/httpcodes.h> +#include <library/cpp/http/server/http_ex.h> #include <library/cpp/testing/unittest/registar.h> #include <util/system/atomic_ops.h> diff --git a/ydb/library/yql/core/file_storage/ut/test_http_server.h b/ydb/library/yql/core/file_storage/ut/test_http_server.h index 170b45ca62..4f0917da21 100644 --- a/ydb/library/yql/core/file_storage/ut/test_http_server.h +++ b/ydb/library/yql/core/file_storage/ut/test_http_server.h @@ -4,7 +4,7 @@ #include <util/generic/ptr.h> #include <util/generic/string.h> -#include <library/cpp/http/misc/httpcodes.h> +#include <library/cpp/http/misc/httpcodes.h> #include <library/cpp/threading/future/future.h> #include <functional> diff --git a/ydb/library/yql/core/file_storage/ut/ya.make b/ydb/library/yql/core/file_storage/ut/ya.make index c19f58203b..f3107767e8 100644 --- a/ydb/library/yql/core/file_storage/ut/ya.make +++ b/ydb/library/yql/core/file_storage/ut/ya.make @@ -18,7 +18,7 @@ SRCS( ) PEERDIR( - library/cpp/http/server + library/cpp/http/server library/cpp/threading/future ydb/library/yql/core/file_storage/http_download ) diff --git a/ydb/library/yql/core/file_storage/ya.make b/ydb/library/yql/core/file_storage/ya.make index f25592bfb7..5b1f9025fa 100644 --- a/ydb/library/yql/core/file_storage/ya.make +++ b/ydb/library/yql/core/file_storage/ya.make @@ -19,10 +19,10 @@ SRCS( PEERDIR( library/cpp/cache - library/cpp/digest/md5 - library/cpp/logger/global + library/cpp/digest/md5 + library/cpp/logger/global library/cpp/threading/future - library/cpp/regex/pcre + library/cpp/regex/pcre library/cpp/uri ydb/library/yql/core/file_storage/proto ydb/library/yql/utils diff --git a/ydb/library/yql/core/issue/ya.make b/ydb/library/yql/core/issue/ya.make index 1e9bc1ce81..025c56bc8d 100644 --- a/ydb/library/yql/core/issue/ya.make +++ b/ydb/library/yql/core/issue/ya.make @@ -7,7 +7,7 @@ SRCS( ) PEERDIR( - library/cpp/resource + library/cpp/resource contrib/libs/protobuf ydb/library/yql/public/issue ydb/library/yql/core/issue/protos diff --git a/ydb/library/yql/core/services/mounts/yql_mounts.cpp b/ydb/library/yql/core/services/mounts/yql_mounts.cpp index 7d0e221799..072326a51f 100644 --- a/ydb/library/yql/core/services/mounts/yql_mounts.cpp +++ b/ydb/library/yql/core/services/mounts/yql_mounts.cpp @@ -2,7 +2,7 @@ #include <ydb/library/yql/core/yql_library_compiler.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> #include <util/folder/path.h> #include <util/stream/file.h> diff --git a/ydb/library/yql/core/yql_expr_type_annotation.h b/ydb/library/yql/core/yql_expr_type_annotation.h index a865aa27cd..09acbddf5c 100644 --- a/ydb/library/yql/core/yql_expr_type_annotation.h +++ b/ydb/library/yql/core/yql_expr_type_annotation.h @@ -7,7 +7,7 @@ #include <ydb/library/yql/core/expr_nodes/yql_expr_nodes.h> #include <ydb/library/yql/minikql/mkql_type_ops.h> -#include <library/cpp/enumbitset/enumbitset.h> +#include <library/cpp/enumbitset/enumbitset.h> #include <functional> diff --git a/ydb/library/yql/core/yql_type_annotation.h b/ydb/library/yql/core/yql_type_annotation.h index 1a1f1fb476..2149153cd6 100644 --- a/ydb/library/yql/core/yql_type_annotation.h +++ b/ydb/library/yql/core/yql_type_annotation.h @@ -12,7 +12,7 @@ #include <library/cpp/yson/node/node.h> #include <library/cpp/time_provider/time_provider.h> #include <library/cpp/random_provider/random_provider.h> -#include <library/cpp/enumbitset/enumbitset.h> +#include <library/cpp/enumbitset/enumbitset.h> #include <util/generic/hash.h> #include <util/generic/hash_set.h> diff --git a/ydb/library/yql/core/yql_user_data.h b/ydb/library/yql/core/yql_user_data.h index fadc8f79cf..8f2601bcf2 100644 --- a/ydb/library/yql/core/yql_user_data.h +++ b/ydb/library/yql/core/yql_user_data.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/enumbitset/enumbitset.h> +#include <library/cpp/enumbitset/enumbitset.h> #include <ydb/library/yql/core/file_storage/file_storage.h> diff --git a/ydb/library/yql/dq/actors/compute/dq_compute_actor.h b/ydb/library/yql/dq/actors/compute/dq_compute_actor.h index 84eeda2edb..1927cbe8c4 100644 --- a/ydb/library/yql/dq/actors/compute/dq_compute_actor.h +++ b/ydb/library/yql/dq/actors/compute/dq_compute_actor.h @@ -9,9 +9,9 @@ #include <ydb/library/yql/dq/runtime/dq_tasks_runner.h> #include <ydb/library/yql/dq/runtime/dq_transport.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/log.h> namespace NYql { namespace NDq { diff --git a/ydb/library/yql/dq/actors/compute/dq_compute_actor_channels.h b/ydb/library/yql/dq/actors/compute/dq_compute_actor_channels.h index 648b1d8b56..2a579ec528 100644 --- a/ydb/library/yql/dq/actors/compute/dq_compute_actor_channels.h +++ b/ydb/library/yql/dq/actors/compute/dq_compute_actor_channels.h @@ -4,8 +4,8 @@ #include <ydb/core/kqp/kqp.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/interconnect/interconnect.h> namespace NYql::NDq { diff --git a/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h b/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h index deaadefb42..94eb2fce5e 100644 --- a/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h +++ b/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h @@ -18,7 +18,7 @@ #include <ydb/library/yql/minikql/comp_nodes/mkql_saveload.h> #include <ydb/library/yql/public/issue/yql_issue_message.h> -#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/interconnect.h> #include <util/generic/size_literals.h> #include <util/string/join.h> diff --git a/ydb/library/yql/dq/actors/protos/dq_events.proto b/ydb/library/yql/dq/actors/protos/dq_events.proto index 0e38ab3bbc..c50229490a 100644 --- a/ydb/library/yql/dq/actors/protos/dq_events.proto +++ b/ydb/library/yql/dq/actors/protos/dq_events.proto @@ -1,7 +1,7 @@ package NYql.NDqProto; option cc_enable_arenas = true; -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "ydb/library/yql/dq/actors/protos/dq_stats.proto"; import "ydb/library/yql/dq/proto/dq_state_load_plan.proto"; import "ydb/library/yql/dq/proto/dq_tasks.proto"; diff --git a/ydb/library/yql/dq/common/dq_common.h b/ydb/library/yql/dq/common/dq_common.h index 71cc7be6cb..8e82bba381 100644 --- a/ydb/library/yql/dq/common/dq_common.h +++ b/ydb/library/yql/dq/common/dq_common.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/events.h> #include <util/generic/variant.h> diff --git a/ydb/library/yql/dq/common/ya.make b/ydb/library/yql/dq/common/ya.make index a47ae59c37..5a8e8c3ead 100644 --- a/ydb/library/yql/dq/common/ya.make +++ b/ydb/library/yql/dq/common/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core ydb/library/mkql_proto/protos ) diff --git a/ydb/library/yql/dq/proto/dq_tasks.proto b/ydb/library/yql/dq/proto/dq_tasks.proto index e29e64ef2c..be37f5547b 100644 --- a/ydb/library/yql/dq/proto/dq_tasks.proto +++ b/ydb/library/yql/dq/proto/dq_tasks.proto @@ -4,7 +4,7 @@ option cc_enable_arenas = true; package NYql.NDqProto; import "google/protobuf/any.proto"; -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; import "ydb/library/yql/dq/proto/dq_transport.proto"; enum ERuntimeVersion { diff --git a/ydb/library/yql/dq/proto/ya.make b/ydb/library/yql/dq/proto/ya.make index d5327f2634..da18a9fa20 100644 --- a/ydb/library/yql/dq/proto/ya.make +++ b/ydb/library/yql/dq/proto/ya.make @@ -5,7 +5,7 @@ OWNER( ) PEERDIR( - library/cpp/actors/protos + library/cpp/actors/protos ) SRCS( diff --git a/ydb/library/yql/dq/tasks/dq_tasks_graph.h b/ydb/library/yql/dq/tasks/dq_tasks_graph.h index e5c772310b..56e23b1eb9 100644 --- a/ydb/library/yql/dq/tasks/dq_tasks_graph.h +++ b/ydb/library/yql/dq/tasks/dq_tasks_graph.h @@ -3,7 +3,7 @@ #include <ydb/library/yql/dq/expr_nodes/dq_expr_nodes.h> #include <ydb/library/yql/dq/proto/dq_tasks.pb.h> -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actorid.h> #include <variant> diff --git a/ydb/library/yql/minikql/aligned_page_pool.cpp b/ydb/library/yql/minikql/aligned_page_pool.cpp index e015c255c8..695ca42ad8 100644 --- a/ydb/library/yql/minikql/aligned_page_pool.cpp +++ b/ydb/library/yql/minikql/aligned_page_pool.cpp @@ -1,5 +1,5 @@ #include "aligned_page_pool.h" -#include <library/cpp/actors/util/intrinsics.h> +#include <library/cpp/actors/util/intrinsics.h> #include <util/generic/yexception.h> #include <util/string/cast.h> diff --git a/ydb/library/yql/minikql/benchmark/pack_num/pack_num_bench.cpp b/ydb/library/yql/minikql/benchmark/pack_num/pack_num_bench.cpp index d49aa682d0..c60e0e6257 100644 --- a/ydb/library/yql/minikql/benchmark/pack_num/pack_num_bench.cpp +++ b/ydb/library/yql/minikql/benchmark/pack_num/pack_num_bench.cpp @@ -1,7 +1,7 @@ #include <ydb/library/yql/minikql/pack_num.h> #include <library/cpp/testing/benchmark/bench.h> -#include <library/cpp/packedtypes/longs.h> +#include <library/cpp/packedtypes/longs.h> #include <dict/dictutil/pack.h> diff --git a/ydb/library/yql/minikql/benchmark/pack_num/ya.make b/ydb/library/yql/minikql/benchmark/pack_num/ya.make index c0c74da450..24a2f28964 100644 --- a/ydb/library/yql/minikql/benchmark/pack_num/ya.make +++ b/ydb/library/yql/minikql/benchmark/pack_num/ya.make @@ -8,7 +8,7 @@ OWNER( PEERDIR( ydb/library/yql/minikql - library/cpp/packedtypes + library/cpp/packedtypes dict/dictutil ) diff --git a/ydb/library/yql/minikql/codegen/codegen_ut.cpp b/ydb/library/yql/minikql/codegen/codegen_ut.cpp index 332e3fdcdc..a2d7293e1e 100644 --- a/ydb/library/yql/minikql/codegen/codegen_ut.cpp +++ b/ydb/library/yql/minikql/codegen/codegen_ut.cpp @@ -7,7 +7,7 @@ #include <llvm/IR/Module.h> #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> using namespace NYql::NCodegen; using namespace llvm; diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_apply.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_apply.cpp index a613c9dcd9..5bc7197883 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_apply.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_apply.cpp @@ -3,7 +3,7 @@ #include <ydb/library/yql/minikql/computation/mkql_computation_node_codegen.h> #include <ydb/library/yql/minikql/computation/mkql_computation_node_holders.h> #include <ydb/library/yql/minikql/mkql_node_cast.h> -#include <library/cpp/containers/stack_array/stack_array.h> +#include <library/cpp/containers/stack_array/stack_array.h> namespace NKikimr { namespace NMiniKQL { diff --git a/ydb/library/yql/minikql/computation/mkql_computation_node_pack.cpp b/ydb/library/yql/minikql/computation/mkql_computation_node_pack.cpp index 625a269eaf..9ab16b1637 100644 --- a/ydb/library/yql/minikql/computation/mkql_computation_node_pack.cpp +++ b/ydb/library/yql/minikql/computation/mkql_computation_node_pack.cpp @@ -7,8 +7,8 @@ #include <ydb/library/yql/minikql/defs.h> #include <ydb/library/yql/minikql/pack_num.h> #include <ydb/library/yql/minikql/mkql_string_util.h> -#include <library/cpp/packedtypes/zigzag.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/packedtypes/zigzag.h> +#include <library/cpp/resource/resource.h> #include <ydb/library/yql/utils/fp_bits.h> #ifndef MKQL_DISABLE_CODEGEN diff --git a/ydb/library/yql/minikql/computation/mkql_computation_node_pack.h b/ydb/library/yql/minikql/computation/mkql_computation_node_pack.h index c69f4467a3..29fa693812 100644 --- a/ydb/library/yql/minikql/computation/mkql_computation_node_pack.h +++ b/ydb/library/yql/minikql/computation/mkql_computation_node_pack.h @@ -6,7 +6,7 @@ #include <ydb/library/yql/public/udf/udf_value.h> -#include <library/cpp/enumbitset/enumbitset.h> +#include <library/cpp/enumbitset/enumbitset.h> #include <util/stream/output.h> #include <util/generic/buffer.h> diff --git a/ydb/library/yql/minikql/computation/mkql_pack_bc.cpp b/ydb/library/yql/minikql/computation/mkql_pack_bc.cpp index 68441746c3..1b520c92b6 100644 --- a/ydb/library/yql/minikql/computation/mkql_pack_bc.cpp +++ b/ydb/library/yql/minikql/computation/mkql_pack_bc.cpp @@ -2,7 +2,7 @@ #include <ydb/library/yql/public/udf/udf_value.h> #include <ydb/library/yql/minikql/pack_num.h> -#include <library/cpp/packedtypes/zigzag.h> +#include <library/cpp/packedtypes/zigzag.h> #include <ydb/library/yql/minikql/defs.h> #include "mkql_optional_usage_mask.h" diff --git a/ydb/library/yql/minikql/computation/ya.make b/ydb/library/yql/minikql/computation/ya.make index ae419b3b23..da63637088 100644 --- a/ydb/library/yql/minikql/computation/ya.make +++ b/ydb/library/yql/minikql/computation/ya.make @@ -57,8 +57,8 @@ LLVM_BC( PEERDIR( contrib/libs/apache/arrow - library/cpp/enumbitset - library/cpp/packedtypes + library/cpp/enumbitset + library/cpp/packedtypes library/cpp/random_provider library/cpp/time_provider ydb/library/yql/minikql diff --git a/ydb/library/yql/minikql/dom/json.cpp b/ydb/library/yql/minikql/dom/json.cpp index 853df56cab..90269ffeb4 100644 --- a/ydb/library/yql/minikql/dom/json.cpp +++ b/ydb/library/yql/minikql/dom/json.cpp @@ -3,8 +3,8 @@ #include <library/cpp/containers/stack_vector/stack_vec.h> -#include <library/cpp/json/json_reader.h> -#include <library/cpp/json/json_writer.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_writer.h> #include <util/stream/input.h> #include <util/stream/str.h> diff --git a/ydb/library/yql/minikql/dom/ya.make b/ydb/library/yql/minikql/dom/ya.make index d18bbe29e6..5b9c424e73 100644 --- a/ydb/library/yql/minikql/dom/ya.make +++ b/ydb/library/yql/minikql/dom/ya.make @@ -10,8 +10,8 @@ YQL_ABI_VERSION(2 21 0) PEERDIR( library/cpp/containers/stack_vector - library/cpp/json - library/cpp/yson_pull + library/cpp/json + library/cpp/yson_pull ydb/library/yql/public/udf ydb/library/yql/utils ) diff --git a/ydb/library/yql/minikql/dom/yson.cpp b/ydb/library/yql/minikql/dom/yson.cpp index f3ab30f22c..a9b0730644 100644 --- a/ydb/library/yql/minikql/dom/yson.cpp +++ b/ydb/library/yql/minikql/dom/yson.cpp @@ -3,9 +3,9 @@ #include <library/cpp/containers/stack_vector/stack_vec.h> -#include <library/cpp/yson_pull/exceptions.h> -#include <library/cpp/yson_pull/reader.h> -#include <library/cpp/yson_pull/writer.h> +#include <library/cpp/yson_pull/exceptions.h> +#include <library/cpp/yson_pull/reader.h> +#include <library/cpp/yson_pull/writer.h> #include <util/string/builder.h> diff --git a/ydb/library/yql/minikql/jsonpath/ast_nodes.h b/ydb/library/yql/minikql/jsonpath/ast_nodes.h index f9129ef1dd..7f6adb0904 100644 --- a/ydb/library/yql/minikql/jsonpath/ast_nodes.h +++ b/ydb/library/yql/minikql/jsonpath/ast_nodes.h @@ -2,7 +2,7 @@ #include <ydb/library/yql/public/issue/yql_issue.h> -#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_value.h> #include <library/cpp/regex/hyperscan/hyperscan.h> namespace NYql::NJsonPath { diff --git a/ydb/library/yql/minikql/jsonpath/benchmark/main.cpp b/ydb/library/yql/minikql/jsonpath/benchmark/main.cpp index 742a9e18b4..6215e63b8a 100644 --- a/ydb/library/yql/minikql/jsonpath/benchmark/main.cpp +++ b/ydb/library/yql/minikql/jsonpath/benchmark/main.cpp @@ -9,7 +9,7 @@ #include <ydb/library/yql/minikql/mkql_alloc.h> #include <ydb/library/yql/minikql/mkql_node.h> -#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_value.h> #include <library/cpp/testing/benchmark/bench.h> #include <util/random/fast.h> diff --git a/ydb/library/yql/minikql/jsonpath/benchmark/ya.make b/ydb/library/yql/minikql/jsonpath/benchmark/ya.make index 461937db13..9b1e816ff4 100644 --- a/ydb/library/yql/minikql/jsonpath/benchmark/ya.make +++ b/ydb/library/yql/minikql/jsonpath/benchmark/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/json + library/cpp/json ydb/library/yql/minikql ydb/library/yql/minikql/computation ydb/library/yql/minikql/dom diff --git a/ydb/library/yql/minikql/jsonpath/executor.h b/ydb/library/yql/minikql/jsonpath/executor.h index 782ab1818d..fbb24a66cf 100644 --- a/ydb/library/yql/minikql/jsonpath/executor.h +++ b/ydb/library/yql/minikql/jsonpath/executor.h @@ -9,7 +9,7 @@ #include <ydb/library/yql/public/udf/udf_value_builder.h> #include <ydb/library/yql/public/udf/udf_allocator.h> -#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_value.h> #include <library/cpp/containers/stack_vector/stack_vec.h> #include <util/generic/ptr.h> diff --git a/ydb/library/yql/minikql/jsonpath/ut/common_ut.cpp b/ydb/library/yql/minikql/jsonpath/ut/common_ut.cpp index 6999564f71..ec5efe2eda 100644 --- a/ydb/library/yql/minikql/jsonpath/ut/common_ut.cpp +++ b/ydb/library/yql/minikql/jsonpath/ut/common_ut.cpp @@ -90,7 +90,7 @@ public: {"1", "\"string\"", {"\"string\""}}, {"1", "\" space another space \"", {"\" space another space \""}}, {"1", "\"привет\"", {"\"привет\""}}, - // NOTE: escaping is added by library/cpp/json + // NOTE: escaping is added by library/cpp/json {"1", "\"\r\n\t\"", {"\"\\r\\n\\t\""}}, }; diff --git a/ydb/library/yql/minikql/jsonpath/ut/test_base.h b/ydb/library/yql/minikql/jsonpath/ut/test_base.h index 7c4bd803f6..d6703e880d 100644 --- a/ydb/library/yql/minikql/jsonpath/ut/test_base.h +++ b/ydb/library/yql/minikql/jsonpath/ut/test_base.h @@ -12,7 +12,7 @@ #include <ydb/library/yql/minikql/mkql_alloc.h> #include <ydb/library/yql/minikql/mkql_node.h> -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> #include <library/cpp/testing/unittest/registar.h> #include <util/generic/yexception.h> diff --git a/ydb/library/yql/minikql/jsonpath/ut/ya.make b/ydb/library/yql/minikql/jsonpath/ut/ya.make index ef51d59ae3..5a4081ad03 100644 --- a/ydb/library/yql/minikql/jsonpath/ut/ya.make +++ b/ydb/library/yql/minikql/jsonpath/ut/ya.make @@ -11,7 +11,7 @@ SRCS( ) PEERDIR( - library/cpp/json + library/cpp/json ydb/library/binary_json ydb/library/yql/minikql ydb/library/yql/minikql/computation diff --git a/ydb/library/yql/minikql/mkql_node.h b/ydb/library/yql/minikql/mkql_node.h index ee74455ea6..b88d89b4f9 100644 --- a/ydb/library/yql/minikql/mkql_node.h +++ b/ydb/library/yql/minikql/mkql_node.h @@ -8,7 +8,7 @@ #include <util/generic/hash.h> #include <util/generic/hash_set.h> #include <util/generic/maybe.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> #include <stack> diff --git a/ydb/library/yql/minikql/mkql_node_serialization.cpp b/ydb/library/yql/minikql/mkql_node_serialization.cpp index e314f38cd6..b0de222cad 100644 --- a/ydb/library/yql/minikql/mkql_node_serialization.cpp +++ b/ydb/library/yql/minikql/mkql_node_serialization.cpp @@ -6,7 +6,7 @@ #include <ydb/library/yql/minikql/pack_num.h> #include <library/cpp/containers/stack_vector/stack_vec.h> -#include <library/cpp/packedtypes/zigzag.h> +#include <library/cpp/packedtypes/zigzag.h> #include <util/generic/algorithm.h> #include <util/system/unaligned_mem.h> diff --git a/ydb/library/yql/minikql/mkql_type_ops.cpp b/ydb/library/yql/minikql/mkql_type_ops.cpp index d559bb108c..233ffba892 100644 --- a/ydb/library/yql/minikql/mkql_type_ops.cpp +++ b/ydb/library/yql/minikql/mkql_type_ops.cpp @@ -20,8 +20,8 @@ #include <library/cpp/yson/varint.h> #include <library/cpp/yson/detail.h> -#include <library/cpp/json/json_reader.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/json/json_reader.h> +#include <library/cpp/resource/resource.h> #include <contrib/libs/cctz/include/cctz/civil_time.h> #include <contrib/libs/cctz/include/cctz/time_zone.h> diff --git a/ydb/library/yql/minikql/ya.make b/ydb/library/yql/minikql/ya.make index c4b608128d..8ea2060e34 100644 --- a/ydb/library/yql/minikql/ya.make +++ b/ydb/library/yql/minikql/ya.make @@ -55,12 +55,12 @@ SRCS( PEERDIR( contrib/libs/apache/arrow contrib/libs/cctz/tzdata - library/cpp/actors/util - library/cpp/deprecated/enum_codegen - library/cpp/enumbitset + library/cpp/actors/util + library/cpp/deprecated/enum_codegen + library/cpp/enumbitset library/cpp/monlib/dynamic_counters - library/cpp/packedtypes - library/cpp/resource + library/cpp/packedtypes + library/cpp/resource library/cpp/yson ydb/library/binary_json ydb/library/dynumber diff --git a/ydb/library/yql/providers/common/metrics/ya.make b/ydb/library/yql/providers/common/metrics/ya.make index 19f8832060..a8022db99f 100644 --- a/ydb/library/yql/providers/common/metrics/ya.make +++ b/ydb/library/yql/providers/common/metrics/ya.make @@ -10,7 +10,7 @@ SRCS( ) PEERDIR( - library/cpp/logger/global + library/cpp/logger/global library/cpp/monlib/dynamic_counters ydb/library/yql/providers/common/metrics/protos ) diff --git a/ydb/library/yql/providers/config/yql_config_provider.cpp b/ydb/library/yql/providers/config/yql_config_provider.cpp index 6952e96cf0..364ad62e95 100644 --- a/ydb/library/yql/providers/config/yql_config_provider.cpp +++ b/ydb/library/yql/providers/config/yql_config_provider.cpp @@ -14,7 +14,7 @@ #include <ydb/library/yql/utils/fetch/fetch.h> #include <ydb/library/yql/utils/retry.h> -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> #include <util/string/cast.h> diff --git a/ydb/library/yql/providers/dq/actors/actor_helpers.h b/ydb/library/yql/providers/dq/actors/actor_helpers.h index b92603ab0f..741118359c 100644 --- a/ydb/library/yql/providers/dq/actors/actor_helpers.h +++ b/ydb/library/yql/providers/dq/actors/actor_helpers.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/events.h> #include <library/cpp/actors/core/interconnect.h> #include <library/cpp/actors/core/hfunc.h> #include <ydb/library/yql/utils/actors/rich_actor.h> diff --git a/ydb/library/yql/providers/dq/actors/events.h b/ydb/library/yql/providers/dq/actors/events.h index 594921560a..dca6aa8dcd 100644 --- a/ydb/library/yql/providers/dq/actors/events.h +++ b/ydb/library/yql/providers/dq/actors/events.h @@ -8,8 +8,8 @@ #include <ydb/library/yql/minikql/computation/mkql_computation_node_holders.h> #include <ydb/library/yql/minikql/mkql_node.h> -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/events.h> namespace NYql::NDqs { using TDqExecuterEvents = NDq::TBaseDqExecuterEvents<NActors::TEvents::EEventSpace::ES_USERSPACE>; diff --git a/ydb/library/yql/providers/dq/actors/executer_actor.cpp b/ydb/library/yql/providers/dq/actors/executer_actor.cpp index 91f1caee74..50f6d4ce22 100644 --- a/ydb/library/yql/providers/dq/actors/executer_actor.cpp +++ b/ydb/library/yql/providers/dq/actors/executer_actor.cpp @@ -13,7 +13,7 @@ #include <ydb/library/yql/utils/log/log.h> #include <ydb/library/yql/public/issue/yql_issue_message.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <library/cpp/protobuf/util/pb_io.h> #include <ydb/library/yql/utils/failure_injector/failure_injector.h> diff --git a/ydb/library/yql/providers/dq/actors/executer_actor.h b/ydb/library/yql/providers/dq/actors/executer_actor.h index fae7d1cdbf..5e4afeb715 100644 --- a/ydb/library/yql/providers/dq/actors/executer_actor.h +++ b/ydb/library/yql/providers/dq/actors/executer_actor.h @@ -2,7 +2,7 @@ #include <ydb/library/yql/providers/dq/common/yql_dq_settings.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include <library/cpp/monlib/dynamic_counters/counters.h> namespace NYql { diff --git a/ydb/library/yql/providers/dq/actors/resource_allocator.cpp b/ydb/library/yql/providers/dq/actors/resource_allocator.cpp index 6acfb1277e..e795ec4218 100644 --- a/ydb/library/yql/providers/dq/actors/resource_allocator.cpp +++ b/ydb/library/yql/providers/dq/actors/resource_allocator.cpp @@ -5,7 +5,7 @@ #include <ydb/library/yql/utils/yql_panic.h> #include <ydb/library/yql/utils/log/log.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/hfunc.h> #include <ydb/library/yql/providers/dq/worker_manager/interface/events.h> #include <ydb/library/yql/providers/dq/counters/counters.h> diff --git a/ydb/library/yql/providers/dq/actors/resource_allocator.h b/ydb/library/yql/providers/dq/actors/resource_allocator.h index ab5db2df0e..d14f24c57d 100644 --- a/ydb/library/yql/providers/dq/actors/resource_allocator.h +++ b/ydb/library/yql/providers/dq/actors/resource_allocator.h @@ -3,7 +3,7 @@ #include <ydb/library/yql/dq/proto/dq_tasks.pb.h> #include <ydb/library/yql/providers/dq/common/yql_dq_settings.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include <library/cpp/monlib/dynamic_counters/counters.h> namespace NYql { diff --git a/ydb/library/yql/providers/dq/actors/result_aggregator.cpp b/ydb/library/yql/providers/dq/actors/result_aggregator.cpp index 59ae95c3af..084730cc69 100644 --- a/ydb/library/yql/providers/dq/actors/result_aggregator.cpp +++ b/ydb/library/yql/providers/dq/actors/result_aggregator.cpp @@ -21,11 +21,11 @@ #include <ydb/public/lib/yson_value/ydb_yson_value.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/scheduler_basic.h> #include <library/cpp/threading/future/future.h> #include <library/cpp/yson/writer.h> diff --git a/ydb/library/yql/providers/dq/actors/result_aggregator.h b/ydb/library/yql/providers/dq/actors/result_aggregator.h index 450bc2de88..566af06d5c 100644 --- a/ydb/library/yql/providers/dq/actors/result_aggregator.h +++ b/ydb/library/yql/providers/dq/actors/result_aggregator.h @@ -5,7 +5,7 @@ #include <ydb/public/api/protos/ydb_value.pb.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> namespace NYql::NDqs::NExecutionHelpers { THolder<NActors::IActor> MakeResultAggregator( diff --git a/ydb/library/yql/providers/dq/actors/worker_actor.cpp b/ydb/library/yql/providers/dq/actors/worker_actor.cpp index f4503a60b2..926be939fe 100644 --- a/ydb/library/yql/providers/dq/actors/worker_actor.cpp +++ b/ydb/library/yql/providers/dq/actors/worker_actor.cpp @@ -9,8 +9,8 @@ #include <ydb/library/yql/minikql/mkql_string_util.h> -#include <library/cpp/actors/core/event_pb.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/stream/file.h> #include <util/string/split.h> diff --git a/ydb/library/yql/providers/dq/actors/worker_actor.h b/ydb/library/yql/providers/dq/actors/worker_actor.h index 4d39687f5b..fbb55547fa 100644 --- a/ydb/library/yql/providers/dq/actors/worker_actor.h +++ b/ydb/library/yql/providers/dq/actors/worker_actor.h @@ -11,7 +11,7 @@ #include <ydb/library/yql/dq/runtime/dq_transport.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actor.h> #include <ydb/library/yql/providers/dq/counters/counters.h> diff --git a/ydb/library/yql/providers/dq/api/protos/dqs.proto b/ydb/library/yql/providers/dq/api/protos/dqs.proto index 09aecfcf92..9997d80a07 100644 --- a/ydb/library/yql/providers/dq/api/protos/dqs.proto +++ b/ydb/library/yql/providers/dq/api/protos/dqs.proto @@ -9,7 +9,7 @@ import "ydb/library/yql/dq/proto/dq_tasks.proto"; import "ydb/library/yql/providers/dq/api/protos/service.proto"; import "ydb/public/api/protos/ydb_issue_message.proto"; import "ydb/public/api/protos/ydb_value.proto"; -import "library/cpp/actors/protos/actors.proto"; +import "library/cpp/actors/protos/actors.proto"; message TAllocateWorkersRequest { uint32 Count = 1; diff --git a/ydb/library/yql/providers/dq/planner/dqs_task_graph.h b/ydb/library/yql/providers/dq/planner/dqs_task_graph.h index 0b62dfce4a..9b911c9e87 100644 --- a/ydb/library/yql/providers/dq/planner/dqs_task_graph.h +++ b/ydb/library/yql/providers/dq/planner/dqs_task_graph.h @@ -3,7 +3,7 @@ #include <ydb/library/yql/dq/tasks/dq_connection_builder.h> #include <ydb/library/yql/dq/tasks/dq_tasks_graph.h> -#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actorid.h> namespace NYql::NDqs { struct TStageInfoMeta { diff --git a/ydb/library/yql/providers/dq/planner/execution_planner.cpp b/ydb/library/yql/providers/dq/planner/execution_planner.cpp index ec404c0a6d..dbab8ec89d 100644 --- a/ydb/library/yql/providers/dq/planner/execution_planner.cpp +++ b/ydb/library/yql/providers/dq/planner/execution_planner.cpp @@ -24,7 +24,7 @@ #include <ydb/library/yql/minikql/aligned_page_pool.h> #include <ydb/library/yql/minikql/mkql_node_serialization.h> -#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/event_pb.h> #include <stack> diff --git a/ydb/library/yql/providers/dq/provider/yql_dq_control.cpp b/ydb/library/yql/providers/dq/provider/yql_dq_control.cpp index 1a0053350a..a0dbce7cf9 100644 --- a/ydb/library/yql/providers/dq/provider/yql_dq_control.cpp +++ b/ydb/library/yql/providers/dq/provider/yql_dq_control.cpp @@ -7,7 +7,7 @@ #include <ydb/public/lib/yson_value/ydb_yson_value.h> -#include <library/cpp/grpc/client/grpc_client_low.h> +#include <library/cpp/grpc/client/grpc_client_low.h> #include <library/cpp/svnversion/svnversion.h> diff --git a/ydb/library/yql/providers/dq/provider/yql_dq_gateway.cpp b/ydb/library/yql/providers/dq/provider/yql_dq_gateway.cpp index 2341b28ad4..57561ec032 100644 --- a/ydb/library/yql/providers/dq/provider/yql_dq_gateway.cpp +++ b/ydb/library/yql/providers/dq/provider/yql_dq_gateway.cpp @@ -9,7 +9,7 @@ #include <ydb/public/lib/yson_value/ydb_yson_value.h> -#include <library/cpp/grpc/client/grpc_client_low.h> +#include <library/cpp/grpc/client/grpc_client_low.h> #include <library/cpp/yson/node/node_io.h> #include <library/cpp/threading/task_scheduler/task_scheduler.h> diff --git a/ydb/library/yql/providers/dq/service/grpc_service.cpp b/ydb/library/yql/providers/dq/service/grpc_service.cpp index 65a9e500d9..edc8abec1c 100644 --- a/ydb/library/yql/providers/dq/service/grpc_service.cpp +++ b/ydb/library/yql/providers/dq/service/grpc_service.cpp @@ -24,10 +24,10 @@ #include <library/cpp/grpc/server/grpc_counters.h> #include <ydb/public/api/protos/ydb_status_codes.pb.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/helpers/future_callback.h> -#include <library/cpp/build_info/build_info.h> -#include <library/cpp/svnversion/svnversion.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/helpers/future_callback.h> +#include <library/cpp/build_info/build_info.h> +#include <library/cpp/svnversion/svnversion.h> #include <util/string/split.h> #include <util/system/env.h> diff --git a/ydb/library/yql/providers/dq/service/grpc_service.h b/ydb/library/yql/providers/dq/service/grpc_service.h index fa2a835c8c..75f1a36c4f 100644 --- a/ydb/library/yql/providers/dq/service/grpc_service.h +++ b/ydb/library/yql/providers/dq/service/grpc_service.h @@ -10,9 +10,9 @@ #include <library/cpp/grpc/server/grpc_request.h> #include <library/cpp/grpc/server/grpc_server.h> -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/core/event_local.h> -#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/events.h> #include <library/cpp/monlib/dynamic_counters/counters.h> #include <library/cpp/threading/future/future.h> diff --git a/ydb/library/yql/providers/dq/service/interconnect_helpers.cpp b/ydb/library/yql/providers/dq/service/interconnect_helpers.cpp index bef368a961..b487bb4198 100644 --- a/ydb/library/yql/providers/dq/service/interconnect_helpers.cpp +++ b/ydb/library/yql/providers/dq/service/interconnect_helpers.cpp @@ -11,15 +11,15 @@ #include <ydb/library/yql/minikql/invoke_builtins/mkql_builtins.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/scheduler_basic.h> #include <library/cpp/actors/core/scheduler_actor.h> #include <library/cpp/actors/dnsresolver/dnsresolver.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect_common.h> -#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> -#include <library/cpp/actors/interconnect/interconnect_tcp_server.h> -#include <library/cpp/actors/interconnect/poller_actor.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect_common.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_server.h> +#include <library/cpp/actors/interconnect/poller_actor.h> #include <library/cpp/yson/node/node_io.h> #include <util/stream/file.h> diff --git a/ydb/library/yql/providers/dq/service/interconnect_helpers.h b/ydb/library/yql/providers/dq/service/interconnect_helpers.h index 9009c8c179..7827fda1b9 100644 --- a/ydb/library/yql/providers/dq/service/interconnect_helpers.h +++ b/ydb/library/yql/providers/dq/service/interconnect_helpers.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> -#include <library/cpp/actors/interconnect/poller_tcp.h> +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/interconnect/poller_tcp.h> #include <library/cpp/actors/interconnect/interconnect.h> #include <library/cpp/yson/node/node.h> diff --git a/ydb/library/yql/providers/dq/service/service_node.h b/ydb/library/yql/providers/dq/service/service_node.h index 32f904901d..68c4e7f2fc 100644 --- a/ydb/library/yql/providers/dq/service/service_node.h +++ b/ydb/library/yql/providers/dq/service/service_node.h @@ -8,13 +8,13 @@ #include <ydb/library/yql/minikql/mkql_function_registry.h> -#include <library/cpp/actors/core/executor_pool_basic.h> -#include <library/cpp/actors/core/scheduler_basic.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/actors/interconnect/interconnect_common.h> -#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> -#include <library/cpp/actors/interconnect/interconnect_tcp_server.h> -#include <library/cpp/actors/interconnect/poller_actor.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect_common.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_server.h> +#include <library/cpp/actors/interconnect/poller_actor.h> namespace NYql { class TServiceNode { diff --git a/ydb/library/yql/providers/dq/service/ya.make b/ydb/library/yql/providers/dq/service/ya.make index 7af208b9cd..3cdc2b103c 100644 --- a/ydb/library/yql/providers/dq/service/ya.make +++ b/ydb/library/yql/providers/dq/service/ya.make @@ -10,13 +10,13 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/actors/dnsresolver - library/cpp/actors/interconnect - library/cpp/build_info + library/cpp/actors/interconnect + library/cpp/build_info library/cpp/grpc/server library/cpp/grpc/server/actors - library/cpp/svnversion + library/cpp/svnversion library/cpp/threading/future ydb/library/yql/sql ydb/public/api/protos diff --git a/ydb/library/yql/providers/dq/worker_manager/interface/events.h b/ydb/library/yql/providers/dq/worker_manager/interface/events.h index a2d0c9f540..ce58dc0ed9 100644 --- a/ydb/library/yql/providers/dq/worker_manager/interface/events.h +++ b/ydb/library/yql/providers/dq/worker_manager/interface/events.h @@ -6,8 +6,8 @@ #include <ydb/library/yql/utils/log/log.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include <util/generic/guid.h> diff --git a/ydb/library/yql/providers/dq/worker_manager/local_worker_manager.cpp b/ydb/library/yql/providers/dq/worker_manager/local_worker_manager.cpp index 5ecf0a4a85..6f4b7bb7dd 100644 --- a/ydb/library/yql/providers/dq/worker_manager/local_worker_manager.cpp +++ b/ydb/library/yql/providers/dq/worker_manager/local_worker_manager.cpp @@ -11,9 +11,9 @@ #include <ydb/library/yql/utils/failure_injector/failure_injector.h> #include <ydb/library/yql/utils/log/log.h> -#include <library/cpp/actors/core/hfunc.h> -#include <library/cpp/actors/core/events.h> -#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/interconnect/interconnect.h> #include "worker_manager_common.h" diff --git a/ydb/library/yql/public/issue/ya.make b/ydb/library/yql/public/issue/ya.make index 04a84bee88..f93b0dadbf 100644 --- a/ydb/library/yql/public/issue/ya.make +++ b/ydb/library/yql/public/issue/ya.make @@ -16,7 +16,7 @@ SRCS( PEERDIR( contrib/libs/protobuf library/cpp/colorizer - library/cpp/resource + library/cpp/resource ydb/public/api/protos ydb/library/yql/public/issue/protos ydb/library/yql/utils diff --git a/ydb/library/yql/public/issue/yql_issue.cpp b/ydb/library/yql/public/issue/yql_issue.cpp index 3b89156874..52b94bc3eb 100644 --- a/ydb/library/yql/public/issue/yql_issue.cpp +++ b/ydb/library/yql/public/issue/yql_issue.cpp @@ -3,7 +3,7 @@ #include <ydb/library/yql/utils/utf8.h> -#include <library/cpp/colorizer/output.h> +#include <library/cpp/colorizer/output.h> #include <util/string/ascii.h> #include <util/string/split.h> diff --git a/ydb/library/yql/public/issue/yql_issue_id.h b/ydb/library/yql/public/issue/yql_issue_id.h index 9f4300f06b..bac39ca3a0 100644 --- a/ydb/library/yql/public/issue/yql_issue_id.h +++ b/ydb/library/yql/public/issue/yql_issue_id.h @@ -2,7 +2,7 @@ #include <ydb/library/yql/public/issue/protos/issue_severity.pb.h> -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> #include <google/protobuf/descriptor.h> #include <google/protobuf/repeated_field.h> #include <google/protobuf/text_format.h> diff --git a/ydb/library/yql/public/udf/udf_helpers.cpp b/ydb/library/yql/public/udf/udf_helpers.cpp index 260ff3e544..590caff18c 100644 --- a/ydb/library/yql/public/udf/udf_helpers.cpp +++ b/ydb/library/yql/public/udf/udf_helpers.cpp @@ -1,6 +1,6 @@ #include "udf_helpers.h" -#include <library/cpp/resource/resource.h> +#include <library/cpp/resource/resource.h> #include <util/generic/hash.h> #include <util/generic/singleton.h> diff --git a/ydb/library/yql/public/udf/udf_validate.h b/ydb/library/yql/public/udf/udf_validate.h index 6e9957ec25..2b49284715 100644 --- a/ydb/library/yql/public/udf/udf_validate.h +++ b/ydb/library/yql/public/udf/udf_validate.h @@ -1,7 +1,7 @@ #pragma once #include <util/generic/string.h> #include <util/generic/strbuf.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> namespace NYql { namespace NUdf { diff --git a/ydb/library/yql/public/udf/ya.make b/ydb/library/yql/public/udf/ya.make index 57a34d00b4..5ced4337d8 100644 --- a/ydb/library/yql/public/udf/ya.make +++ b/ydb/library/yql/public/udf/ya.make @@ -41,8 +41,8 @@ SRCS( ) PEERDIR( - library/cpp/deprecated/enum_codegen - library/cpp/resource + library/cpp/deprecated/enum_codegen + library/cpp/resource ydb/library/yql/public/decimal ydb/library/yql/public/types ) diff --git a/ydb/library/yql/sql/v0/aggregation.cpp b/ydb/library/yql/sql/v0/aggregation.cpp index 6440604881..c62430cf75 100644 --- a/ydb/library/yql/sql/v0/aggregation.cpp +++ b/ydb/library/yql/sql/v0/aggregation.cpp @@ -3,7 +3,7 @@ #include <ydb/library/yql/ast/yql_type_string.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <util/string/builder.h> #include <util/string/cast.h> diff --git a/ydb/library/yql/sql/v0/builtin.cpp b/ydb/library/yql/sql/v0/builtin.cpp index a0945f9d05..2406018ed9 100644 --- a/ydb/library/yql/sql/v0/builtin.cpp +++ b/ydb/library/yql/sql/v0/builtin.cpp @@ -10,7 +10,7 @@ #include <ydb/library/yql/minikql/mkql_type_ops.h> #include <ydb/library/yql/public/issue/yql_issue_id.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <util/string/builder.h> #include <util/string/cast.h> #include <util/string/util.h> diff --git a/ydb/library/yql/sql/v0/join.cpp b/ydb/library/yql/sql/v0/join.cpp index 78f5affb49..0bb1923d63 100644 --- a/ydb/library/yql/sql/v0/join.cpp +++ b/ydb/library/yql/sql/v0/join.cpp @@ -3,7 +3,7 @@ #include <ydb/library/yql/utils/yql_panic.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <util/generic/hash_set.h> #include <util/string/cast.h> #include <util/string/split.h> diff --git a/ydb/library/yql/sql/v0/list_builtin.h b/ydb/library/yql/sql/v0/list_builtin.h index 9fc4f22ce6..474826965f 100644 --- a/ydb/library/yql/sql/v0/list_builtin.h +++ b/ydb/library/yql/sql/v0/list_builtin.h @@ -5,7 +5,7 @@ #include <ydb/library/yql/ast/yql_type_string.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <util/string/builder.h> #include <util/string/cast.h> #include <util/string/util.h> diff --git a/ydb/library/yql/sql/v0/node.cpp b/ydb/library/yql/sql/v0/node.cpp index 57f0c6a561..108be5b806 100644 --- a/ydb/library/yql/sql/v0/node.cpp +++ b/ydb/library/yql/sql/v0/node.cpp @@ -7,7 +7,7 @@ #include <ydb/library/yql/utils/yql_panic.h> #include <library/cpp/containers/stack_vector/stack_vec.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <util/generic/hash_set.h> #include <util/stream/str.h> #include <util/string/cast.h> diff --git a/ydb/library/yql/sql/v0/node.h b/ydb/library/yql/sql/v0/node.h index 4c7cfc273b..74da15e8eb 100644 --- a/ydb/library/yql/sql/v0/node.h +++ b/ydb/library/yql/sql/v0/node.h @@ -13,7 +13,7 @@ #include <util/generic/maybe.h> #include <util/string/builder.h> -#include <library/cpp/enumbitset/enumbitset.h> +#include <library/cpp/enumbitset/enumbitset.h> namespace NSQLTranslationV0 { constexpr const size_t SQL_MAX_INLINE_SCRIPT_LEN = 24; diff --git a/ydb/library/yql/sql/v0/query.cpp b/ydb/library/yql/sql/v0/query.cpp index 7752b28b01..322f6d4c9e 100644 --- a/ydb/library/yql/sql/v0/query.cpp +++ b/ydb/library/yql/sql/v0/query.cpp @@ -6,7 +6,7 @@ #include <ydb/library/yql/providers/common/provider/yql_provider_names.h> #include <ydb/library/yql/core/yql_expr_type_annotation.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <util/digest/fnv.h> diff --git a/ydb/library/yql/sql/v0/select.cpp b/ydb/library/yql/sql/v0/select.cpp index ef47023be1..aa4ebc551e 100644 --- a/ydb/library/yql/sql/v0/select.cpp +++ b/ydb/library/yql/sql/v0/select.cpp @@ -5,7 +5,7 @@ #include <ydb/library/yql/utils/yql_panic.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> using namespace NYql; diff --git a/ydb/library/yql/sql/v0/sql.cpp b/ydb/library/yql/sql/v0/sql.cpp index b028fc0439..e147143887 100644 --- a/ydb/library/yql/sql/v0/sql.cpp +++ b/ydb/library/yql/sql/v0/sql.cpp @@ -13,7 +13,7 @@ #include <ydb/library/yql/core/yql_expr_type_annotation.h> #include <ydb/library/yql/sql/settings/translation_settings.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <google/protobuf/repeated_field.h> diff --git a/ydb/library/yql/sql/v0/ya.make b/ydb/library/yql/sql/v0/ya.make index c7410eadfd..1922c88c73 100644 --- a/ydb/library/yql/sql/v0/ya.make +++ b/ydb/library/yql/sql/v0/ya.make @@ -6,8 +6,8 @@ OWNER( ) PEERDIR( - library/cpp/charset - library/cpp/enumbitset + library/cpp/charset + library/cpp/enumbitset ydb/library/yql/minikql ydb/library/yql/public/udf ydb/library/yql/sql/settings diff --git a/ydb/library/yql/sql/v1/aggregation.cpp b/ydb/library/yql/sql/v1/aggregation.cpp index 850e0e5056..0ab58df472 100644 --- a/ydb/library/yql/sql/v1/aggregation.cpp +++ b/ydb/library/yql/sql/v1/aggregation.cpp @@ -3,7 +3,7 @@ #include <ydb/library/yql/ast/yql_type_string.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <util/string/builder.h> #include <util/string/cast.h> diff --git a/ydb/library/yql/sql/v1/builtin.cpp b/ydb/library/yql/sql/v1/builtin.cpp index 43ef1243f1..7450a8c4d1 100644 --- a/ydb/library/yql/sql/v1/builtin.cpp +++ b/ydb/library/yql/sql/v1/builtin.cpp @@ -11,7 +11,7 @@ #include <ydb/library/yql/minikql/mkql_type_ops.h> #include <ydb/library/yql/public/issue/yql_issue_id.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <library/cpp/yson/node/node_io.h> #include <util/string/builder.h> #include <util/string/cast.h> diff --git a/ydb/library/yql/sql/v1/join.cpp b/ydb/library/yql/sql/v1/join.cpp index 29f5b3ec4b..15ff725398 100644 --- a/ydb/library/yql/sql/v1/join.cpp +++ b/ydb/library/yql/sql/v1/join.cpp @@ -3,7 +3,7 @@ #include <ydb/library/yql/utils/yql_panic.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <util/generic/hash_set.h> #include <util/string/cast.h> #include <util/string/split.h> diff --git a/ydb/library/yql/sql/v1/list_builtin.h b/ydb/library/yql/sql/v1/list_builtin.h index a8077b464a..18b3d03cc5 100644 --- a/ydb/library/yql/sql/v1/list_builtin.h +++ b/ydb/library/yql/sql/v1/list_builtin.h @@ -5,7 +5,7 @@ #include <ydb/library/yql/ast/yql_type_string.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <util/string/builder.h> #include <util/string/cast.h> #include <util/string/util.h> diff --git a/ydb/library/yql/sql/v1/node.cpp b/ydb/library/yql/sql/v1/node.cpp index 870bbd9cc7..da687e0959 100644 --- a/ydb/library/yql/sql/v1/node.cpp +++ b/ydb/library/yql/sql/v1/node.cpp @@ -8,7 +8,7 @@ #include <ydb/library/yql/utils/yql_panic.h> #include <library/cpp/containers/stack_vector/stack_vec.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <util/generic/hash_set.h> #include <util/stream/str.h> #include <util/string/cast.h> diff --git a/ydb/library/yql/sql/v1/node.h b/ydb/library/yql/sql/v1/node.h index de82b45a23..6ced5e326c 100644 --- a/ydb/library/yql/sql/v1/node.h +++ b/ydb/library/yql/sql/v1/node.h @@ -14,7 +14,7 @@ #include <util/generic/maybe.h> #include <util/string/builder.h> -#include <library/cpp/enumbitset/enumbitset.h> +#include <library/cpp/enumbitset/enumbitset.h> #include <array> #include <functional> diff --git a/ydb/library/yql/sql/v1/query.cpp b/ydb/library/yql/sql/v1/query.cpp index 725356b9f5..af7196a2e1 100644 --- a/ydb/library/yql/sql/v1/query.cpp +++ b/ydb/library/yql/sql/v1/query.cpp @@ -6,7 +6,7 @@ #include <ydb/library/yql/providers/common/provider/yql_provider_names.h> #include <ydb/library/yql/core/yql_expr_type_annotation.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <util/digest/fnv.h> diff --git a/ydb/library/yql/sql/v1/select.cpp b/ydb/library/yql/sql/v1/select.cpp index 2841f05a5b..ee96ca834f 100644 --- a/ydb/library/yql/sql/v1/select.cpp +++ b/ydb/library/yql/sql/v1/select.cpp @@ -6,7 +6,7 @@ #include <ydb/library/yql/providers/common/provider/yql_provider_names.h> #include <ydb/library/yql/utils/yql_panic.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> using namespace NYql; diff --git a/ydb/library/yql/sql/v1/sql.cpp b/ydb/library/yql/sql/v1/sql.cpp index ab5a864788..d6580f4b2a 100644 --- a/ydb/library/yql/sql/v1/sql.cpp +++ b/ydb/library/yql/sql/v1/sql.cpp @@ -19,7 +19,7 @@ #include <ydb/library/yql/sql/settings/translation_settings.h> #include <ydb/library/yql/core/yql_atom_enums.h> -#include <library/cpp/charset/ci_string.h> +#include <library/cpp/charset/ci_string.h> #include <google/protobuf/repeated_field.h> diff --git a/ydb/library/yql/sql/v1/ya.make b/ydb/library/yql/sql/v1/ya.make index 432fdefbf7..cc3a86fff7 100644 --- a/ydb/library/yql/sql/v1/ya.make +++ b/ydb/library/yql/sql/v1/ya.make @@ -6,8 +6,8 @@ OWNER( ) PEERDIR( - library/cpp/charset - library/cpp/enumbitset + library/cpp/charset + library/cpp/enumbitset library/cpp/yson/node ydb/library/yql/core/sql_types ydb/library/yql/minikql diff --git a/ydb/library/yql/sql/ya.make b/ydb/library/yql/sql/ya.make index e10a314ebc..1dadfbfe59 100644 --- a/ydb/library/yql/sql/ya.make +++ b/ydb/library/yql/sql/ya.make @@ -6,7 +6,7 @@ OWNER( ) PEERDIR( - library/cpp/deprecated/split + library/cpp/deprecated/split ydb/library/yql/sql/pg ydb/library/yql/sql/settings ydb/library/yql/sql/v0 diff --git a/ydb/library/yql/udfs/common/datetime/datetime_udf.cpp b/ydb/library/yql/udfs/common/datetime/datetime_udf.cpp index 01567c0b1b..92f7f3b273 100644 --- a/ydb/library/yql/udfs/common/datetime/datetime_udf.cpp +++ b/ydb/library/yql/udfs/common/datetime/datetime_udf.cpp @@ -4,7 +4,7 @@ #include <util/draft/datetime.h> #include <util/string/cast.h> -#include <library/cpp/timezone_conversion/convert.h> +#include <library/cpp/timezone_conversion/convert.h> #include <unordered_map> diff --git a/ydb/library/yql/udfs/common/datetime/ya.make b/ydb/library/yql/udfs/common/datetime/ya.make index 400415d407..d48d217806 100644 --- a/ydb/library/yql/udfs/common/datetime/ya.make +++ b/ydb/library/yql/udfs/common/datetime/ya.make @@ -13,7 +13,7 @@ SRCS( ) PEERDIR( - library/cpp/timezone_conversion + library/cpp/timezone_conversion util/draft ) diff --git a/ydb/library/yql/udfs/common/digest/digest_udf.cpp b/ydb/library/yql/udfs/common/digest/digest_udf.cpp index 7487a078dd..58ac49ca50 100644 --- a/ydb/library/yql/udfs/common/digest/digest_udf.cpp +++ b/ydb/library/yql/udfs/common/digest/digest_udf.cpp @@ -6,12 +6,12 @@ #include <util/digest/numeric.h> #include <util/digest/fnv.h> -#include <library/cpp/digest/argonish/argon2.h> -#include <library/cpp/digest/argonish/blake2b.h> -#include <library/cpp/digest/crc32c/crc32c.h> -#include <library/cpp/digest/md5/md5.h> -#include <library/cpp/digest/old_crc/crc.h> -#include <library/cpp/digest/sfh/sfh.h> +#include <library/cpp/digest/argonish/argon2.h> +#include <library/cpp/digest/argonish/blake2b.h> +#include <library/cpp/digest/crc32c/crc32c.h> +#include <library/cpp/digest/md5/md5.h> +#include <library/cpp/digest/old_crc/crc.h> +#include <library/cpp/digest/sfh/sfh.h> #include <contrib/libs/highwayhash/highwayhash/c_bindings.h> #include <contrib/libs/highwayhash/highwayhash/sip_hash.h> diff --git a/ydb/library/yql/udfs/common/digest/ya.make b/ydb/library/yql/udfs/common/digest/ya.make index 53ee51c8d1..cf020b7737 100644 --- a/ydb/library/yql/udfs/common/digest/ya.make +++ b/ydb/library/yql/udfs/common/digest/ya.make @@ -17,11 +17,11 @@ PEERDIR( contrib/libs/highwayhash contrib/libs/openssl contrib/libs/xxhash - library/cpp/digest/argonish - library/cpp/digest/crc32c - library/cpp/digest/md5 - library/cpp/digest/old_crc - library/cpp/digest/sfh + library/cpp/digest/argonish + library/cpp/digest/crc32c + library/cpp/digest/md5 + library/cpp/digest/old_crc + library/cpp/digest/sfh ) ADDINCL(contrib/libs/highwayhash) diff --git a/ydb/library/yql/udfs/common/histogram/histogram_udf.cpp b/ydb/library/yql/udfs/common/histogram/histogram_udf.cpp index 3cbf685cc1..848e235fcd 100644 --- a/ydb/library/yql/udfs/common/histogram/histogram_udf.cpp +++ b/ydb/library/yql/udfs/common/histogram/histogram_udf.cpp @@ -1,7 +1,7 @@ #include <ydb/library/yql/public/udf/udf_helpers.h> -#include <library/cpp/histogram/adaptive/adaptive_histogram.h> -#include <library/cpp/histogram/adaptive/block_histogram.h> +#include <library/cpp/histogram/adaptive/adaptive_histogram.h> +#include <library/cpp/histogram/adaptive/block_histogram.h> #include <util/string/printf.h> #include <util/stream/format.h> diff --git a/ydb/library/yql/udfs/common/histogram/ya.make b/ydb/library/yql/udfs/common/histogram/ya.make index 5cd127c96f..8e879ae190 100644 --- a/ydb/library/yql/udfs/common/histogram/ya.make +++ b/ydb/library/yql/udfs/common/histogram/ya.make @@ -13,7 +13,7 @@ SRCS( ) PEERDIR( - library/cpp/histogram/adaptive + library/cpp/histogram/adaptive ) END() diff --git a/ydb/library/yql/udfs/common/hyperloglog/hyperloglog_udf.cpp b/ydb/library/yql/udfs/common/hyperloglog/hyperloglog_udf.cpp index b4b52639dc..bdb2794382 100644 --- a/ydb/library/yql/udfs/common/hyperloglog/hyperloglog_udf.cpp +++ b/ydb/library/yql/udfs/common/hyperloglog/hyperloglog_udf.cpp @@ -1,6 +1,6 @@ #include <ydb/library/yql/public/udf/udf_helpers.h> -#include <library/cpp/hyperloglog/hyperloglog.h> +#include <library/cpp/hyperloglog/hyperloglog.h> #include <util/generic/hash_set.h> diff --git a/ydb/library/yql/udfs/common/hyperloglog/ya.make b/ydb/library/yql/udfs/common/hyperloglog/ya.make index 0bfcaefb6d..4544744b3b 100644 --- a/ydb/library/yql/udfs/common/hyperloglog/ya.make +++ b/ydb/library/yql/udfs/common/hyperloglog/ya.make @@ -13,7 +13,7 @@ SRCS( ) PEERDIR( - library/cpp/hyperloglog + library/cpp/hyperloglog ) END() diff --git a/ydb/library/yql/udfs/common/hyperscan/hyperscan_udf.cpp b/ydb/library/yql/udfs/common/hyperscan/hyperscan_udf.cpp index bc9251897f..9a8c4eb700 100644 --- a/ydb/library/yql/udfs/common/hyperscan/hyperscan_udf.cpp +++ b/ydb/library/yql/udfs/common/hyperscan/hyperscan_udf.cpp @@ -4,8 +4,8 @@ #include <ydb/library/yql/public/udf/udf_value_builder.h> #include <ydb/library/yql/public/udf/udf_terminator.h> -#include <library/cpp/regex/hyperscan/hyperscan.h> -#include <library/cpp/regex/pcre/regexp.h> +#include <library/cpp/regex/hyperscan/hyperscan.h> +#include <library/cpp/regex/pcre/regexp.h> #include <util/charset/utf8.h> #include <util/string/split.h> diff --git a/ydb/library/yql/udfs/common/hyperscan/ya.make b/ydb/library/yql/udfs/common/hyperscan/ya.make index f8bb10662d..1b6ebe5093 100644 --- a/ydb/library/yql/udfs/common/hyperscan/ya.make +++ b/ydb/library/yql/udfs/common/hyperscan/ya.make @@ -15,8 +15,8 @@ IF (OS_LINUX AND CLANG) ) PEERDIR( - library/cpp/regex/hyperscan - library/cpp/regex/pcre + library/cpp/regex/hyperscan + library/cpp/regex/pcre ) END() diff --git a/ydb/library/yql/udfs/common/json/json_udf.cpp b/ydb/library/yql/udfs/common/json/json_udf.cpp index e994e589bd..03a0b7f8a3 100644 --- a/ydb/library/yql/udfs/common/json/json_udf.cpp +++ b/ydb/library/yql/udfs/common/json/json_udf.cpp @@ -1,6 +1,6 @@ #include <ydb/library/yql/public/udf/udf_helpers.h> -#include <library/cpp/json/easy_parse/json_easy_parser.h> +#include <library/cpp/json/easy_parse/json_easy_parser.h> using namespace NKikimr; using namespace NUdf; diff --git a/ydb/library/yql/udfs/common/json/ya.make b/ydb/library/yql/udfs/common/json/ya.make index e95c3f42e0..f967925cf7 100644 --- a/ydb/library/yql/udfs/common/json/ya.make +++ b/ydb/library/yql/udfs/common/json/ya.make @@ -13,7 +13,7 @@ SRCS( ) PEERDIR( - library/cpp/json/easy_parse + library/cpp/json/easy_parse ) END() diff --git a/ydb/library/yql/udfs/common/json2/parse.h b/ydb/library/yql/udfs/common/json2/parse.h index 6139e724e2..a8b1446553 100644 --- a/ydb/library/yql/udfs/common/json2/parse.h +++ b/ydb/library/yql/udfs/common/json2/parse.h @@ -6,7 +6,7 @@ #include <ydb/library/yql/public/udf/udf_helpers.h> #include <ydb/library/yql/minikql/dom/json.h> -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> namespace NJson2Udf { using namespace NKikimr; diff --git a/ydb/library/yql/udfs/common/pire/pire_udf.cpp b/ydb/library/yql/udfs/common/pire/pire_udf.cpp index 9592959683..456229b8b5 100644 --- a/ydb/library/yql/udfs/common/pire/pire_udf.cpp +++ b/ydb/library/yql/udfs/common/pire/pire_udf.cpp @@ -4,8 +4,8 @@ #include <ydb/library/yql/public/udf/udf_value_builder.h> #include <ydb/library/yql/public/udf/udf_terminator.h> -#include <library/cpp/regex/pire/regexp.h> -#include <library/cpp/regex/pire/pcre2pire.h> +#include <library/cpp/regex/pire/regexp.h> +#include <library/cpp/regex/pire/pcre2pire.h> #include <util/string/builder.h> diff --git a/ydb/library/yql/udfs/common/pire/ya.make b/ydb/library/yql/udfs/common/pire/ya.make index ba65dd6d10..49475649e3 100644 --- a/ydb/library/yql/udfs/common/pire/ya.make +++ b/ydb/library/yql/udfs/common/pire/ya.make @@ -13,7 +13,7 @@ SRCS( ) PEERDIR( - library/cpp/regex/pire + library/cpp/regex/pire ) END() diff --git a/ydb/library/yql/udfs/common/re2/ya.make b/ydb/library/yql/udfs/common/re2/ya.make index 64d14c652b..53862d3dfb 100644 --- a/ydb/library/yql/udfs/common/re2/ya.make +++ b/ydb/library/yql/udfs/common/re2/ya.make @@ -14,7 +14,7 @@ SRCS( PEERDIR( contrib/libs/re2 - library/cpp/deprecated/enum_codegen + library/cpp/deprecated/enum_codegen ) END() diff --git a/ydb/library/yql/udfs/common/string/string_udf.cpp b/ydb/library/yql/udfs/common/string/string_udf.cpp index c468215090..28118d3e9c 100644 --- a/ydb/library/yql/udfs/common/string/string_udf.cpp +++ b/ydb/library/yql/udfs/common/string/string_udf.cpp @@ -2,9 +2,9 @@ #include <ydb/library/yql/public/udf/udf_helpers.h> #include <ydb/library/yql/public/udf/udf_value_builder.h> -#include <library/cpp/charset/codepage.h> +#include <library/cpp/charset/codepage.h> #include <library/cpp/deprecated/split/split_iterator.h> -#include <library/cpp/html/pcdata/pcdata.h> +#include <library/cpp/html/pcdata/pcdata.h> #include <library/cpp/string_utils/base64/base64.h> #include <library/cpp/string_utils/levenshtein_diff/levenshtein_diff.h> #include <library/cpp/string_utils/quote/quote.h> diff --git a/ydb/library/yql/udfs/common/string/ya.make b/ydb/library/yql/udfs/common/string/ya.make index ca6da4e586..c2be55b0ef 100644 --- a/ydb/library/yql/udfs/common/string/ya.make +++ b/ydb/library/yql/udfs/common/string/ya.make @@ -13,9 +13,9 @@ SRCS( ) PEERDIR( - library/cpp/charset - library/cpp/deprecated/split - library/cpp/html/pcdata + library/cpp/charset + library/cpp/deprecated/split + library/cpp/html/pcdata library/cpp/string_utils/base64 library/cpp/string_utils/levenshtein_diff library/cpp/string_utils/quote diff --git a/ydb/library/yql/udfs/common/url_base/lib/url_parse.h b/ydb/library/yql/udfs/common/url_base/lib/url_parse.h index a2f4b0291c..2db4b8758e 100644 --- a/ydb/library/yql/udfs/common/url_base/lib/url_parse.h +++ b/ydb/library/yql/udfs/common/url_base/lib/url_parse.h @@ -1,7 +1,7 @@ #pragma once #include <ydb/library/yql/public/udf/udf_helpers.h> -#include <library/cpp/uri/uri.h> +#include <library/cpp/uri/uri.h> #define FIELD_MAP(XX) \ XX(Scheme) \ diff --git a/ydb/library/yql/udfs/common/yson2/ya.make b/ydb/library/yql/udfs/common/yson2/ya.make index 8b293d2fe7..1498e746da 100644 --- a/ydb/library/yql/udfs/common/yson2/ya.make +++ b/ydb/library/yql/udfs/common/yson2/ya.make @@ -14,7 +14,7 @@ SRCS( PEERDIR( library/cpp/containers/stack_vector - library/cpp/yson_pull + library/cpp/yson_pull ydb/library/yql/minikql/dom ) diff --git a/ydb/library/yql/udfs/common/yson2/yson2_udf.cpp b/ydb/library/yql/udfs/common/yson2/yson2_udf.cpp index 1278ec565c..81f3ebf2f0 100644 --- a/ydb/library/yql/udfs/common/yson2/yson2_udf.cpp +++ b/ydb/library/yql/udfs/common/yson2/yson2_udf.cpp @@ -8,7 +8,7 @@ #include <ydb/library/yql/public/udf/udf_helpers.h> #include <ydb/library/yql/public/udf/udf_type_printer.h> -#include <library/cpp/yson_pull/exceptions.h> +#include <library/cpp/yson_pull/exceptions.h> #include <util/string/split.h> diff --git a/ydb/library/yql/udfs/logs/dsv/dsv_udf.cpp b/ydb/library/yql/udfs/logs/dsv/dsv_udf.cpp index b74bf80b18..b5418bc4ba 100644 --- a/ydb/library/yql/udfs/logs/dsv/dsv_udf.cpp +++ b/ydb/library/yql/udfs/logs/dsv/dsv_udf.cpp @@ -3,7 +3,7 @@ #include <ydb/library/yql/public/udf/udf_type_inspection.h> #include <util/generic/yexception.h> -#include <library/cpp/deprecated/split/split_iterator.h> +#include <library/cpp/deprecated/split/split_iterator.h> #include <util/string/vector.h> using namespace NKikimr; diff --git a/ydb/library/yql/udfs/logs/dsv/ya.make b/ydb/library/yql/udfs/logs/dsv/ya.make index d2938eb4b9..6d8de1dc90 100644 --- a/ydb/library/yql/udfs/logs/dsv/ya.make +++ b/ydb/library/yql/udfs/logs/dsv/ya.make @@ -9,7 +9,7 @@ YQL_ABI_VERSION( OWNER(g:yql) PEERDIR( - library/cpp/deprecated/split + library/cpp/deprecated/split ) SRCS( diff --git a/ydb/library/yql/utils/actor_log/log.cpp b/ydb/library/yql/utils/actor_log/log.cpp index 3b3002208c..9585f157df 100644 --- a/ydb/library/yql/utils/actor_log/log.cpp +++ b/ydb/library/yql/utils/actor_log/log.cpp @@ -1,6 +1,6 @@ #include "log.h" -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> namespace NYql { namespace NDq { diff --git a/ydb/library/yql/utils/backtrace/backtrace.cpp b/ydb/library/yql/utils/backtrace/backtrace.cpp index f9487f6671..d042641467 100644 --- a/ydb/library/yql/utils/backtrace/backtrace.cpp +++ b/ydb/library/yql/utils/backtrace/backtrace.cpp @@ -4,7 +4,7 @@ #include <llvm/DebugInfo/Symbolize/DIPrinter.h> #include <llvm/Support/raw_ostream.h> -#include <library/cpp/malloc/api/malloc.h> +#include <library/cpp/malloc/api/malloc.h> #include <util/generic/hash.h> #include <util/generic/xrange.h> diff --git a/ydb/library/yql/utils/bind_in_range.h b/ydb/library/yql/utils/bind_in_range.h index 28c6069f81..dfe0ec8b4f 100644 --- a/ydb/library/yql/utils/bind_in_range.h +++ b/ydb/library/yql/utils/bind_in_range.h @@ -1,7 +1,7 @@ #pragma once #include <ydb/library/yql/utils/range_walker.h> -#include <library/cpp/messagebus/network.h> +#include <library/cpp/messagebus/network.h> namespace NYql { TVector<NBus::TBindResult> BindInRange(TRangeWalker<int>& portWalker); diff --git a/ydb/library/yql/utils/fetch/fetch.cpp b/ydb/library/yql/utils/fetch/fetch.cpp index 100c88c385..0142925f53 100644 --- a/ydb/library/yql/utils/fetch/fetch.cpp +++ b/ydb/library/yql/utils/fetch/fetch.cpp @@ -2,8 +2,8 @@ #include <ydb/library/yql/utils/log/log.h> -#include <library/cpp/openssl/io/stream.h> -#include <library/cpp/http/misc/httpcodes.h> +#include <library/cpp/openssl/io/stream.h> +#include <library/cpp/http/misc/httpcodes.h> #include <library/cpp/charset/ci_string.h> #include <util/network/socket.h> diff --git a/ydb/library/yql/utils/fetch/fetch.h b/ydb/library/yql/utils/fetch/fetch.h index d9e1c3c1a5..3316ea2bed 100644 --- a/ydb/library/yql/utils/fetch/fetch.h +++ b/ydb/library/yql/utils/fetch/fetch.h @@ -1,8 +1,8 @@ #pragma once -#include <library/cpp/uri/http_url.h> -#include <library/cpp/http/io/headers.h> -#include <library/cpp/http/io/stream.h> +#include <library/cpp/uri/http_url.h> +#include <library/cpp/http/io/headers.h> +#include <library/cpp/http/io/stream.h> #include <util/datetime/base.h> #include <util/generic/string.h> diff --git a/ydb/library/yql/utils/fetch/ya.make b/ydb/library/yql/utils/fetch/ya.make index f36bfe247c..a435cfd85c 100644 --- a/ydb/library/yql/utils/fetch/ya.make +++ b/ydb/library/yql/utils/fetch/ya.make @@ -7,11 +7,11 @@ SRCS( ) PEERDIR( - library/cpp/charset - library/cpp/http/io - library/cpp/http/misc + library/cpp/charset + library/cpp/http/io + library/cpp/http/misc library/cpp/openssl/io - library/cpp/uri + library/cpp/uri ydb/library/yql/utils/log ) diff --git a/ydb/library/yql/utils/log/log.cpp b/ydb/library/yql/utils/log/log.cpp index b62bfeb907..c2c050ccad 100644 --- a/ydb/library/yql/utils/log/log.cpp +++ b/ydb/library/yql/utils/log/log.cpp @@ -1,7 +1,7 @@ #include "log.h" -#include <library/cpp/logger/stream.h> -#include <library/cpp/logger/system.h> +#include <library/cpp/logger/stream.h> +#include <library/cpp/logger/system.h> #include <util/datetime/systime.h> #include <util/generic/strbuf.h> diff --git a/ydb/library/yql/utils/log/log.h b/ydb/library/yql/utils/log/log.h index 8095fdd495..3caf24508d 100644 --- a/ydb/library/yql/utils/log/log.h +++ b/ydb/library/yql/utils/log/log.h @@ -5,7 +5,7 @@ #include "context.h" #include "profile.h" -#include <library/cpp/logger/global/common.h> +#include <library/cpp/logger/global/common.h> #include <util/system/atomic.h> #include <util/stream/output.h> diff --git a/ydb/library/yql/utils/log/log_level.h b/ydb/library/yql/utils/log/log_level.h index ccb12e4690..5c451abbaa 100644 --- a/ydb/library/yql/utils/log/log_level.h +++ b/ydb/library/yql/utils/log/log_level.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/logger/priority.h> +#include <library/cpp/logger/priority.h> #include <util/generic/strbuf.h> #include <util/generic/yexception.h> diff --git a/ydb/library/yql/utils/log/log_ut.cpp b/ydb/library/yql/utils/log/log_ut.cpp index bf8b71476c..eea4a83fa8 100644 --- a/ydb/library/yql/utils/log/log_ut.cpp +++ b/ydb/library/yql/utils/log/log_ut.cpp @@ -4,7 +4,7 @@ #include <ydb/library/yql/utils/log/ut/log_parser.h> #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/logger/stream.h> +#include <library/cpp/logger/stream.h> #include <util/datetime/base.h> #include <util/generic/yexception.h> diff --git a/ydb/library/yql/utils/log/tls_backend.h b/ydb/library/yql/utils/log/tls_backend.h index 69a0955432..318eeb36e2 100644 --- a/ydb/library/yql/utils/log/tls_backend.h +++ b/ydb/library/yql/utils/log/tls_backend.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/logger/backend.h> +#include <library/cpp/logger/backend.h> #include <util/generic/ptr.h> diff --git a/ydb/library/yql/utils/log/tls_backend_ut.cpp b/ydb/library/yql/utils/log/tls_backend_ut.cpp index 6f4147fed6..89bf067323 100644 --- a/ydb/library/yql/utils/log/tls_backend_ut.cpp +++ b/ydb/library/yql/utils/log/tls_backend_ut.cpp @@ -3,8 +3,8 @@ #include <ydb/library/yql/utils/log/ut/log_parser.h> #include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/logger/stream.h> -#include <library/cpp/logger/null.h> +#include <library/cpp/logger/stream.h> +#include <library/cpp/logger/null.h> #include <util/system/thread.h> #include <util/string/split.h> diff --git a/ydb/library/yql/utils/log/ya.make b/ydb/library/yql/utils/log/ya.make index e83464fe9f..2a6b69106b 100644 --- a/ydb/library/yql/utils/log/ya.make +++ b/ydb/library/yql/utils/log/ya.make @@ -13,8 +13,8 @@ SRCS( ) PEERDIR( - library/cpp/logger - library/cpp/logger/global + library/cpp/logger + library/cpp/logger/global ) END() diff --git a/ydb/library/yql/utils/md5_stream.h b/ydb/library/yql/utils/md5_stream.h index ca8b1c4bb9..d45c21366f 100644 --- a/ydb/library/yql/utils/md5_stream.h +++ b/ydb/library/yql/utils/md5_stream.h @@ -1,7 +1,7 @@ #pragma once #include <util/stream/output.h> -#include <library/cpp/digest/md5/md5.h> +#include <library/cpp/digest/md5/md5.h> namespace NYql { class TMd5OutputStream : public IOutputStream { diff --git a/ydb/library/yql/utils/ya.make b/ydb/library/yql/utils/ya.make index afba70be53..0b7b9b4dff 100644 --- a/ydb/library/yql/utils/ya.make +++ b/ydb/library/yql/utils/ya.make @@ -38,7 +38,7 @@ SRCS( ) PEERDIR( - library/cpp/digest/md5 + library/cpp/digest/md5 library/cpp/threading/future library/cpp/messagebus ) diff --git a/ydb/public/lib/base/defs.h b/ydb/public/lib/base/defs.h index 97e933c93a..59499b2f4b 100644 --- a/ydb/public/lib/base/defs.h +++ b/ydb/public/lib/base/defs.h @@ -1,10 +1,10 @@ #pragma once /// @note It must not depend on anything except util, library and propobufs -#include <library/cpp/actors/core/actorid.h> -#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/actor.h> -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> namespace NKikimr { diff --git a/ydb/public/lib/base/msgbus.h b/ydb/public/lib/base/msgbus.h index f11bd9771f..8f0d8c12cf 100644 --- a/ydb/public/lib/base/msgbus.h +++ b/ydb/public/lib/base/msgbus.h @@ -4,10 +4,10 @@ #include <ydb/core/protos/msgbus.pb.h> #include <ydb/core/protos/msgbus_kv.pb.h> #include <ydb/core/protos/msgbus_pq.pb.h> -#include <library/cpp/messagebus/ybus.h> -#include <library/cpp/messagebus/protobuf/ybusbuf.h> -#include <library/cpp/messagebus/session_config.h> -#include <library/cpp/messagebus/queue_config.h> +#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/protobuf/ybusbuf.h> +#include <library/cpp/messagebus/session_config.h> +#include <library/cpp/messagebus/queue_config.h> namespace NKikimr { namespace NMsgBusProxy { diff --git a/ydb/public/lib/base/msgbus_status.h b/ydb/public/lib/base/msgbus_status.h index 15876b170d..a8664dcd74 100644 --- a/ydb/public/lib/base/msgbus_status.h +++ b/ydb/public/lib/base/msgbus_status.h @@ -1,7 +1,7 @@ #pragma once #include "defs.h" -#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> +#include <library/cpp/deprecated/enum_codegen/enum_codegen.h> namespace NKikimr { namespace NMsgBusProxy { diff --git a/ydb/public/lib/base/ya.make b/ydb/public/lib/base/ya.make index ace9d9f06e..38fc6b8c91 100644 --- a/ydb/public/lib/base/ya.make +++ b/ydb/public/lib/base/ya.make @@ -13,9 +13,9 @@ SRCS( ) PEERDIR( - library/cpp/deprecated/enum_codegen - library/cpp/messagebus - library/cpp/messagebus/protobuf + library/cpp/deprecated/enum_codegen + library/cpp/messagebus + library/cpp/messagebus/protobuf ydb/core/protos ) diff --git a/ydb/public/lib/deprecated/client/grpc_client.h b/ydb/public/lib/deprecated/client/grpc_client.h index b0483a2646..e299253239 100644 --- a/ydb/public/lib/deprecated/client/grpc_client.h +++ b/ydb/public/lib/deprecated/client/grpc_client.h @@ -3,7 +3,7 @@ #include <ydb/core/protos/grpc.pb.h> #include <util/datetime/base.h> -#include <library/cpp/grpc/client/grpc_common.h> +#include <library/cpp/grpc/client/grpc_common.h> namespace NKikimr { namespace NGRpcProxy { diff --git a/ydb/public/lib/deprecated/client/msgbus_client.h b/ydb/public/lib/deprecated/client/msgbus_client.h index 7d721946d8..4bd95d909e 100644 --- a/ydb/public/lib/deprecated/client/msgbus_client.h +++ b/ydb/public/lib/deprecated/client/msgbus_client.h @@ -7,7 +7,7 @@ #include <functional> #include <util/system/info.h> -#include <library/cpp/messagebus/ybus.h> +#include <library/cpp/messagebus/ybus.h> namespace NKikimr { namespace NMsgBusProxy { diff --git a/ydb/public/lib/deprecated/client/msgbus_client_config.h b/ydb/public/lib/deprecated/client/msgbus_client_config.h index 816efff967..e7835939b9 100644 --- a/ydb/public/lib/deprecated/client/msgbus_client_config.h +++ b/ydb/public/lib/deprecated/client/msgbus_client_config.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/messagebus/queue_config.h> -#include <library/cpp/messagebus/session_config.h> +#include <library/cpp/messagebus/queue_config.h> +#include <library/cpp/messagebus/session_config.h> #include <library/cpp/getopt/last_getopt.h> namespace NKikimr { diff --git a/ydb/public/lib/deprecated/client/ya.make b/ydb/public/lib/deprecated/client/ya.make index 0792f44996..b0fa123480 100644 --- a/ydb/public/lib/deprecated/client/ya.make +++ b/ydb/public/lib/deprecated/client/ya.make @@ -12,8 +12,8 @@ SRCS( ) PEERDIR( - library/cpp/grpc/client - library/cpp/messagebus + library/cpp/grpc/client + library/cpp/messagebus ydb/public/lib/base ) diff --git a/ydb/public/lib/deprecated/kicli/kicli.h b/ydb/public/lib/deprecated/kicli/kicli.h index 9dc472d231..4dace4c320 100644 --- a/ydb/public/lib/deprecated/kicli/kicli.h +++ b/ydb/public/lib/deprecated/kicli/kicli.h @@ -9,9 +9,9 @@ #include <ydb/public/lib/scheme_types/scheme_type_id.h> #include <ydb/public/lib/value/value.h> -#include <library/cpp/actors/core/interconnect.h> -#include <library/cpp/messagebus/message_status.h> -#include <library/cpp/messagebus/message.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/messagebus/message_status.h> +#include <library/cpp/messagebus/message.h> #include <library/cpp/threading/future/future.h> #include <util/generic/queue.h> diff --git a/ydb/public/lib/experimental/ydb_clickhouse_internal.cpp b/ydb/public/lib/experimental/ydb_clickhouse_internal.cpp index 2984f680b7..022560786e 100644 --- a/ydb/public/lib/experimental/ydb_clickhouse_internal.cpp +++ b/ydb/public/lib/experimental/ydb_clickhouse_internal.cpp @@ -5,7 +5,7 @@ #undef INCLUDE_YDB_INTERNAL_H #include <ydb/public/api/grpc/draft/ydb_clickhouse_internal_v1.grpc.pb.h> -#include <library/cpp/grpc/client/grpc_client_low.h> +#include <library/cpp/grpc/client/grpc_client_low.h> #include <ydb/public/sdk/cpp/client/ydb_common_client/impl/client.h> // TODO: Bad dependency??? diff --git a/ydb/public/lib/experimental/ydb_experimental.cpp b/ydb/public/lib/experimental/ydb_experimental.cpp index 8765c0c750..1bfe41aa67 100644 --- a/ydb/public/lib/experimental/ydb_experimental.cpp +++ b/ydb/public/lib/experimental/ydb_experimental.cpp @@ -5,7 +5,7 @@ #undef INCLUDE_YDB_INTERNAL_H #include <ydb/public/api/grpc/draft/ydb_experimental_v1.grpc.pb.h> -#include <library/cpp/grpc/client/grpc_client_low.h> +#include <library/cpp/grpc/client/grpc_client_low.h> #include <ydb/public/sdk/cpp/client/ydb_proto/accessor.h> #include <ydb/public/sdk/cpp/client/ydb_common_client/impl/client.h> diff --git a/ydb/public/lib/idx_test/idx_test.h b/ydb/public/lib/idx_test/idx_test.h index 9444cf1463..fd26298f39 100644 --- a/ydb/public/lib/idx_test/idx_test.h +++ b/ydb/public/lib/idx_test/idx_test.h @@ -5,7 +5,7 @@ #include <memory> -#include <library/cpp/json/json_value.h> +#include <library/cpp/json/json_value.h> namespace NIdxTest { diff --git a/ydb/public/lib/json_value/ydb_json_value.h b/ydb/public/lib/json_value/ydb_json_value.h index 24fa92d02e..9f33b5a05f 100644 --- a/ydb/public/lib/json_value/ydb_json_value.h +++ b/ydb/public/lib/json_value/ydb_json_value.h @@ -4,7 +4,7 @@ #include <ydb/public/sdk/cpp/client/ydb_value/value.h> #include <ydb/public/sdk/cpp/client/ydb_types/fatal_error_handlers/handlers.h> -#include <library/cpp/json/writer/json.h> +#include <library/cpp/json/writer/json.h> namespace NYdb { diff --git a/ydb/public/lib/json_value/ydb_json_value_ut.cpp b/ydb/public/lib/json_value/ydb_json_value_ut.cpp index d8c1356338..5b9220555a 100644 --- a/ydb/public/lib/json_value/ydb_json_value_ut.cpp +++ b/ydb/public/lib/json_value/ydb_json_value_ut.cpp @@ -4,7 +4,7 @@ #include <library/cpp/testing/unittest/registar.h> #include <ydb/public/sdk/cpp/client/ydb_types/exceptions/exceptions.h> #include <ydb/public/sdk/cpp/client/ydb_proto/accessor.h> -#include <library/cpp/json/json_reader.h> +#include <library/cpp/json/json_reader.h> namespace NYdb { diff --git a/ydb/public/lib/operation_id/operation_id.cpp b/ydb/public/lib/operation_id/operation_id.cpp index 725da690f4..3ce7fddb94 100644 --- a/ydb/public/lib/operation_id/operation_id.cpp +++ b/ydb/public/lib/operation_id/operation_id.cpp @@ -3,7 +3,7 @@ #include <google/protobuf/message.h> #include <library/cpp/cgiparam/cgiparam.h> -#include <library/cpp/uri/uri.h> +#include <library/cpp/uri/uri.h> #include <util/generic/yexception.h> #include <util/string/cast.h> diff --git a/ydb/public/lib/operation_id/ya.make b/ydb/public/lib/operation_id/ya.make index d8a249f59a..d300dd5f90 100644 --- a/ydb/public/lib/operation_id/ya.make +++ b/ydb/public/lib/operation_id/ya.make @@ -12,7 +12,7 @@ SRCS( PEERDIR( contrib/libs/protobuf library/cpp/cgiparam - library/cpp/uri + library/cpp/uri ydb/public/lib/operation_id/protos ) diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp index 2f94b2fc03..ea7218d194 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_table.cpp @@ -6,7 +6,7 @@ #include <ydb/public/lib/ydb_cli/common/query_stats.h> #include <ydb/public/sdk/cpp/client/ydb_proto/accessor.h> -#include <library/cpp/json/json_prettifier.h> +#include <library/cpp/json/json_prettifier.h> #include <google/protobuf/util/json_util.h> #include <util/string/split.h> diff --git a/ydb/public/lib/ydb_cli/common/command.h b/ydb/public/lib/ydb_cli/common/command.h index 441206cdf7..7d936d429c 100644 --- a/ydb/public/lib/ydb_cli/common/command.h +++ b/ydb/public/lib/ydb_cli/common/command.h @@ -5,7 +5,7 @@ #include <ydb/public/sdk/cpp/client/ydb_types/credentials/credentials.h> #include <library/cpp/getopt/last_getopt.h> -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> #include <util/generic/strbuf.h> #include <util/generic/vector.h> #include <util/charset/utf8.h> diff --git a/ydb/public/lib/ydb_cli/common/parseable_struct.h b/ydb/public/lib/ydb_cli/common/parseable_struct.h index 6eeb08ffba..46705f97f9 100644 --- a/ydb/public/lib/ydb_cli/common/parseable_struct.h +++ b/ydb/public/lib/ydb_cli/common/parseable_struct.h @@ -2,7 +2,7 @@ #include "command.h" -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> #include <util/generic/algorithm.h> #include <util/generic/hash.h> diff --git a/ydb/public/lib/ydb_cli/common/print_utils.h b/ydb/public/lib/ydb_cli/common/print_utils.h index 8b7e8755c1..0c99265770 100644 --- a/ydb/public/lib/ydb_cli/common/print_utils.h +++ b/ydb/public/lib/ydb_cli/common/print_utils.h @@ -1,7 +1,7 @@ #pragma once #include <ydb/public/sdk/cpp/client/ydb_scheme/scheme.h> -#include <library/cpp/colorizer/colors.h> +#include <library/cpp/colorizer/colors.h> namespace NYdb { namespace NConsoleClient { diff --git a/ydb/public/sdk/cpp/client/extensions/solomon_stats/pull_client.h b/ydb/public/sdk/cpp/client/extensions/solomon_stats/pull_client.h index 8d410c2fa2..f17cf291c2 100644 --- a/ydb/public/sdk/cpp/client/extensions/solomon_stats/pull_client.h +++ b/ydb/public/sdk/cpp/client/extensions/solomon_stats/pull_client.h @@ -2,7 +2,7 @@ #include <ydb/public/sdk/cpp/client/ydb_extension/extension.h> -#include <library/cpp/http/server/response.h> +#include <library/cpp/http/server/response.h> #include <library/cpp/monlib/metrics/metric_consumer.h> #include <library/cpp/monlib/encode/json/json.h> #include <library/cpp/monlib/metrics/metric_registry.h> diff --git a/ydb/public/sdk/cpp/client/impl/ydb_stats/stats.h b/ydb/public/sdk/cpp/client/impl/ydb_stats/stats.h index cae4099682..918b62d83f 100644 --- a/ydb/public/sdk/cpp/client/impl/ydb_stats/stats.h +++ b/ydb/public/sdk/cpp/client/impl/ydb_stats/stats.h @@ -3,7 +3,7 @@ #include <ydb/public/sdk/cpp/client/ydb_types/status_codes.h> #include <ydb/public/sdk/cpp/client/impl/ydb_internal/common/type_switcher.h> -#include <library/cpp/grpc/client/grpc_client_low.h> +#include <library/cpp/grpc/client/grpc_client_low.h> #include <library/cpp/monlib/metrics/metric_registry.h> #include <library/cpp/monlib/metrics/histogram_collector.h> diff --git a/ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/sdk_test_setup.h b/ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/sdk_test_setup.h index 677eb8c03d..9e1403fb38 100644 --- a/ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/sdk_test_setup.h +++ b/ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/sdk_test_setup.h @@ -1,7 +1,7 @@ #pragma once #include "test_server.h" #include <ydb/library/persqueue/topic_parser_public/topic_parser.h> -#include <library/cpp/logger/log.h> +#include <library/cpp/logger/log.h> #include <util/system/tempfile.h> #define TEST_CASE_NAME (this->Name_) diff --git a/ydb/services/cms/cms_ut.cpp b/ydb/services/cms/cms_ut.cpp index 7d5234715e..4c7d075101 100644 --- a/ydb/services/cms/cms_ut.cpp +++ b/ydb/services/cms/cms_ut.cpp @@ -11,7 +11,7 @@ #include <ydb/public/api/grpc/ydb_cms_v1.grpc.pb.h> #include <ydb/public/api/grpc/ydb_operation_v1.grpc.pb.h> -#include <library/cpp/grpc/client/grpc_client_low.h> +#include <library/cpp/grpc/client/grpc_client_low.h> #include <google/protobuf/any.h> diff --git a/ydb/services/cms/grpc_service.h b/ydb/services/cms/grpc_service.h index 80f3bbe928..62d272a4fa 100644 --- a/ydb/services/cms/grpc_service.h +++ b/ydb/services/cms/grpc_service.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <library/cpp/grpc/server/grpc_server.h> #include <ydb/public/api/grpc/ydb_cms_v1.grpc.pb.h> diff --git a/ydb/services/cms/ut/ya.make b/ydb/services/cms/ut/ya.make index 646ff009e9..92cd82f307 100644 --- a/ydb/services/cms/ut/ya.make +++ b/ydb/services/cms/ut/ya.make @@ -16,7 +16,7 @@ PEERDIR( library/cpp/getopt library/cpp/grpc/client library/cpp/regex/pcre - library/cpp/svnversion + library/cpp/svnversion ydb/core/testlib ydb/services/cms ) diff --git a/ydb/services/discovery/grpc_service.h b/ydb/services/discovery/grpc_service.h index c6cb25f0fd..cd4cc7e569 100644 --- a/ydb/services/discovery/grpc_service.h +++ b/ydb/services/discovery/grpc_service.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <ydb/public/api/grpc/ydb_discovery_v1.grpc.pb.h> diff --git a/ydb/services/kesus/grpc_service.cpp b/ydb/services/kesus/grpc_service.cpp index c5826b6627..1fb87762d1 100644 --- a/ydb/services/kesus/grpc_service.cpp +++ b/ydb/services/kesus/grpc_service.cpp @@ -15,8 +15,8 @@ #include <library/cpp/grpc/server/grpc_async_ctx_base.h> #include <ydb/public/sdk/cpp/client/resources/ydb_resources.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> namespace NKikimr { namespace NKesus { diff --git a/ydb/services/kesus/grpc_service.h b/ydb/services/kesus/grpc_service.h index b5f597b7d9..249240d8dd 100644 --- a/ydb/services/kesus/grpc_service.h +++ b/ydb/services/kesus/grpc_service.h @@ -4,7 +4,7 @@ #include <library/cpp/grpc/server/grpc_server.h> -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <util/generic/hash_set.h> diff --git a/ydb/services/persqueue_cluster_discovery/cluster_discovery_service.cpp b/ydb/services/persqueue_cluster_discovery/cluster_discovery_service.cpp index aabd11d4ca..4c48277c42 100644 --- a/ydb/services/persqueue_cluster_discovery/cluster_discovery_service.cpp +++ b/ydb/services/persqueue_cluster_discovery/cluster_discovery_service.cpp @@ -10,7 +10,7 @@ #include <ydb/core/persqueue/cluster_tracker.h> #include <ydb/core/util/address_classifier.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> #include <algorithm> diff --git a/ydb/services/persqueue_cluster_discovery/cluster_discovery_service.h b/ydb/services/persqueue_cluster_discovery/cluster_discovery_service.h index fec5708c15..f97ab2e145 100644 --- a/ydb/services/persqueue_cluster_discovery/cluster_discovery_service.h +++ b/ydb/services/persqueue_cluster_discovery/cluster_discovery_service.h @@ -2,10 +2,10 @@ #include <ydb/core/base/events.h> -#include <library/cpp/actors/core/actor.h> -#include <library/cpp/actors/core/actorid.h> -#include <library/cpp/actors/core/defs.h> -#include <library/cpp/actors/core/event_local.h> +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/actorid.h> +#include <library/cpp/actors/core/defs.h> +#include <library/cpp/actors/core/event_local.h> #include <library/cpp/monlib/dynamic_counters/counters.h> diff --git a/ydb/services/persqueue_cluster_discovery/cluster_discovery_service_ut.cpp b/ydb/services/persqueue_cluster_discovery/cluster_discovery_service_ut.cpp index 34721e262d..141a28e4a0 100644 --- a/ydb/services/persqueue_cluster_discovery/cluster_discovery_service_ut.cpp +++ b/ydb/services/persqueue_cluster_discovery/cluster_discovery_service_ut.cpp @@ -9,7 +9,7 @@ #include <ydb/public/api/grpc/draft/ydb_persqueue_v1.grpc.pb.h> -#include <library/cpp/actors/http/http_proxy.h> +#include <library/cpp/actors/http/http_proxy.h> #include <library/cpp/testing/unittest/tests_data.h> #include <library/cpp/testing/unittest/registar.h> diff --git a/ydb/services/persqueue_cluster_discovery/cluster_discovery_worker.cpp b/ydb/services/persqueue_cluster_discovery/cluster_discovery_worker.cpp index 0c061b9bea..03ae09b8a6 100644 --- a/ydb/services/persqueue_cluster_discovery/cluster_discovery_worker.cpp +++ b/ydb/services/persqueue_cluster_discovery/cluster_discovery_worker.cpp @@ -2,8 +2,8 @@ #include <ydb/services/persqueue_cluster_discovery/cluster_ordering/weighed_ordering.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> -#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/hfunc.h> #include <util/digest/numeric.h> #include <util/generic/hash.h> diff --git a/ydb/services/persqueue_cluster_discovery/cluster_discovery_worker.h b/ydb/services/persqueue_cluster_discovery/cluster_discovery_worker.h index c92bb64940..18eaa15fa7 100644 --- a/ydb/services/persqueue_cluster_discovery/cluster_discovery_worker.h +++ b/ydb/services/persqueue_cluster_discovery/cluster_discovery_worker.h @@ -6,7 +6,7 @@ #include <ydb/core/persqueue/cluster_tracker.h> #include <ydb/core/util/address_classifier.h> -#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> namespace NKikimr::NPQ::NClusterDiscovery::NWorker { diff --git a/ydb/services/persqueue_cluster_discovery/grpc_service.h b/ydb/services/persqueue_cluster_discovery/grpc_service.h index 7bc17ba2f5..721f72fde2 100644 --- a/ydb/services/persqueue_cluster_discovery/grpc_service.h +++ b/ydb/services/persqueue_cluster_discovery/grpc_service.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <ydb/public/api/grpc/draft/ydb_persqueue_v1.grpc.pb.h> #include <library/cpp/grpc/server/grpc_server.h> diff --git a/ydb/services/persqueue_v1/grpc_pq_read.h b/ydb/services/persqueue_v1/grpc_pq_read.h index 558063ed13..d0e6685246 100644 --- a/ydb/services/persqueue_v1/grpc_pq_read.h +++ b/ydb/services/persqueue_v1/grpc_pq_read.h @@ -7,7 +7,7 @@ #include <ydb/core/persqueue/cluster_tracker.h> #include <ydb/core/mind/address_classification/net_classifier.h> -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <util/generic/hash.h> #include <util/system/mutex.h> diff --git a/ydb/services/persqueue_v1/grpc_pq_read_actor.cpp b/ydb/services/persqueue_v1/grpc_pq_read_actor.cpp index 654edfcfcd..fb69827c22 100644 --- a/ydb/services/persqueue_v1/grpc_pq_read_actor.cpp +++ b/ydb/services/persqueue_v1/grpc_pq_read_actor.cpp @@ -12,9 +12,9 @@ #include <ydb/library/persqueue/topic_parser/topic_parser.h> -#include <library/cpp/actors/core/log.h> -#include <library/cpp/actors/interconnect/interconnect.h> -#include <library/cpp/protobuf/util/repeated_field_utils.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/protobuf/util/repeated_field_utils.h> #include <library/cpp/containers/disjoint_interval_tree/disjoint_interval_tree.h> #include <util/string/strip.h> diff --git a/ydb/services/persqueue_v1/grpc_pq_write.h b/ydb/services/persqueue_v1/grpc_pq_write.h index 73148388b2..6eb65143d8 100644 --- a/ydb/services/persqueue_v1/grpc_pq_write.h +++ b/ydb/services/persqueue_v1/grpc_pq_write.h @@ -7,7 +7,7 @@ #include <ydb/core/persqueue/cluster_tracker.h> #include <ydb/core/mind/address_classification/net_classifier.h> -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <util/generic/hash.h> #include <util/generic/maybe.h> diff --git a/ydb/services/persqueue_v1/grpc_pq_write_actor.cpp b/ydb/services/persqueue_v1/grpc_pq_write_actor.cpp index 3038cc82a6..54b18cfe23 100644 --- a/ydb/services/persqueue_v1/grpc_pq_write_actor.cpp +++ b/ydb/services/persqueue_v1/grpc_pq_write_actor.cpp @@ -9,7 +9,7 @@ #include <ydb/public/lib/deprecated/kicli/kicli.h> #include <ydb/library/persqueue/topic_parser/topic_parser.h> #include <ydb/services/lib/sharding/sharding.h> -#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/log.h> #include <library/cpp/digest/md5/md5.h> #include <util/string/hex.h> #include <util/string/vector.h> diff --git a/ydb/services/persqueue_v1/persqueue.h b/ydb/services/persqueue_v1/persqueue.h index eefe1ee4c2..d4a49deeaf 100644 --- a/ydb/services/persqueue_v1/persqueue.h +++ b/ydb/services/persqueue_v1/persqueue.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <ydb/public/api/grpc/draft/ydb_persqueue_v1.grpc.pb.h> diff --git a/ydb/services/persqueue_v1/ut/api_test_setup.h b/ydb/services/persqueue_v1/ut/api_test_setup.h index 8d5d82b33d..4ccb27c4af 100644 --- a/ydb/services/persqueue_v1/ut/api_test_setup.h +++ b/ydb/services/persqueue_v1/ut/api_test_setup.h @@ -6,7 +6,7 @@ #include <ydb/core/testlib/test_pq_client.h> #include <google/protobuf/message.h> -#include <library/cpp/logger/log.h> +#include <library/cpp/logger/log.h> #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/tests_data.h> #include <util/string/builder.h> diff --git a/ydb/services/persqueue_v1/ut/rate_limiter_test_setup.cpp b/ydb/services/persqueue_v1/ut/rate_limiter_test_setup.cpp index 779d60e778..9f81f3c203 100644 --- a/ydb/services/persqueue_v1/ut/rate_limiter_test_setup.cpp +++ b/ydb/services/persqueue_v1/ut/rate_limiter_test_setup.cpp @@ -1,6 +1,6 @@ #include "rate_limiter_test_setup.h" #include <ydb/library/persqueue/topic_parser/topic_parser.h> -#include <library/cpp/logger/priority.h> +#include <library/cpp/logger/priority.h> using namespace NPersQueue; using namespace Ydb::PersQueue; diff --git a/ydb/services/persqueue_v1/ut/ya.make b/ydb/services/persqueue_v1/ut/ya.make index 70c088383d..246961e862 100644 --- a/ydb/services/persqueue_v1/ut/ya.make +++ b/ydb/services/persqueue_v1/ut/ya.make @@ -34,7 +34,7 @@ SRCS( PEERDIR( library/cpp/getopt - library/cpp/svnversion + library/cpp/svnversion ydb/core/testlib ydb/library/aclib ydb/library/persqueue/topic_parser diff --git a/ydb/services/persqueue_v1/ya.make b/ydb/services/persqueue_v1/ya.make index ade0406fcc..efa5935826 100644 --- a/ydb/services/persqueue_v1/ya.make +++ b/ydb/services/persqueue_v1/ya.make @@ -24,7 +24,7 @@ SRCS( ) PEERDIR( - library/cpp/actors/core + library/cpp/actors/core library/cpp/containers/disjoint_interval_tree library/cpp/grpc/server ydb/core/base diff --git a/ydb/services/ydb/ydb_clickhouse_internal.h b/ydb/services/ydb/ydb_clickhouse_internal.h index a0ff8863d1..add5739aa4 100644 --- a/ydb/services/ydb/ydb_clickhouse_internal.h +++ b/ydb/services/ydb/ydb_clickhouse_internal.h @@ -5,7 +5,7 @@ #include <ydb/core/grpc_services/grpc_helper.h> #include <library/cpp/grpc/server/grpc_server.h> -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> namespace NKikimr { namespace NGRpcService { diff --git a/ydb/services/ydb/ydb_dummy.h b/ydb/services/ydb/ydb_dummy.h index 7e3e74c506..f03622d135 100644 --- a/ydb/services/ydb/ydb_dummy.h +++ b/ydb/services/ydb/ydb_dummy.h @@ -1,7 +1,7 @@ #pragma once #include <library/cpp/grpc/server/grpc_server.h> -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <library/cpp/monlib/counters/counters.h> #include <ydb/public/api/grpc/draft/dummy.grpc.pb.h> diff --git a/ydb/services/ydb/ydb_experimental.h b/ydb/services/ydb/ydb_experimental.h index c312a18cac..f374568656 100644 --- a/ydb/services/ydb/ydb_experimental.h +++ b/ydb/services/ydb/ydb_experimental.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <library/cpp/grpc/server/grpc_server.h> diff --git a/ydb/services/ydb/ydb_export.h b/ydb/services/ydb/ydb_export.h index 6049462ca2..b2355141c0 100644 --- a/ydb/services/ydb/ydb_export.h +++ b/ydb/services/ydb/ydb_export.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <library/cpp/grpc/server/grpc_server.h> #include <ydb/public/api/grpc/ydb_export_v1.grpc.pb.h> diff --git a/ydb/services/ydb/ydb_operation.h b/ydb/services/ydb/ydb_operation.h index 9f7e8646b1..7bb3592873 100644 --- a/ydb/services/ydb/ydb_operation.h +++ b/ydb/services/ydb/ydb_operation.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <ydb/public/api/grpc/ydb_operation_v1.grpc.pb.h> #include <library/cpp/grpc/server/grpc_server.h> diff --git a/ydb/services/ydb/ydb_s3_internal.h b/ydb/services/ydb/ydb_s3_internal.h index e947a9b131..672d261029 100644 --- a/ydb/services/ydb/ydb_s3_internal.h +++ b/ydb/services/ydb/ydb_s3_internal.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <library/cpp/grpc/server/grpc_server.h> #include <ydb/public/api/grpc/draft/ydb_s3_internal_v1.grpc.pb.h> diff --git a/ydb/services/ydb/ydb_scheme.h b/ydb/services/ydb/ydb_scheme.h index a510e5f592..ec8b94a900 100644 --- a/ydb/services/ydb/ydb_scheme.h +++ b/ydb/services/ydb/ydb_scheme.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <library/cpp/grpc/server/grpc_server.h> #include <ydb/public/api/grpc/ydb_scheme_v1.grpc.pb.h> diff --git a/ydb/services/ydb/ydb_scripting.h b/ydb/services/ydb/ydb_scripting.h index 9566cadeee..eec3234675 100644 --- a/ydb/services/ydb/ydb_scripting.h +++ b/ydb/services/ydb/ydb_scripting.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <library/cpp/grpc/server/grpc_server.h> #include <ydb/public/api/grpc/ydb_scripting_v1.grpc.pb.h> diff --git a/ydb/services/ydb/ydb_table.h b/ydb/services/ydb/ydb_table.h index 77756bf023..5cdd61654d 100644 --- a/ydb/services/ydb/ydb_table.h +++ b/ydb/services/ydb/ydb_table.h @@ -1,6 +1,6 @@ #pragma once -#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/actorsystem.h> #include <library/cpp/grpc/server/grpc_server.h> #include <ydb/public/api/grpc/ydb_table_v1.grpc.pb.h> diff --git a/ydb/services/ydb/ydb_ut.cpp b/ydb/services/ydb/ydb_ut.cpp index 2d37063079..3f1b4589de 100644 --- a/ydb/services/ydb/ydb_ut.cpp +++ b/ydb/services/ydb/ydb_ut.cpp @@ -15,7 +15,7 @@ #include <ydb/public/api/grpc/draft/dummy.grpc.pb.h> #include <ydb/public/api/protos/ydb_table.pb.h> -#include <library/cpp/grpc/client/grpc_client_low.h> +#include <library/cpp/grpc/client/grpc_client_low.h> #include <google/protobuf/any.h> diff --git a/ydb/tests/library/common/msgbus_types.py b/ydb/tests/library/common/msgbus_types.py index 475837f0cd..163f639fb6 100644 --- a/ydb/tests/library/common/msgbus_types.py +++ b/ydb/tests/library/common/msgbus_types.py @@ -35,7 +35,7 @@ class MessageBusStatus(enum.IntEnum): @enum.unique class EMessageStatus(enum.IntEnum): """ - See /arcadia/library/cpp/messagebus/message_status.h + See /arcadia/library/cpp/messagebus/message_status.h """ MESSAGE_OK = 0 MESSAGE_CONNECT_FAILED = 1 |