From f699509eee4cece53d2bd1259cf43089f15773ef Mon Sep 17 00:00:00 2001 From: Aleksey Kashapov Date: Wed, 25 Jun 2025 11:49:54 +0300 Subject: [PATCH] Upgrades to dmt v2 #minor --- apps/wapi/test/wapi_ct_helper.erl | 60 ++++++++++++++++++++----------- config/sys.config | 5 +-- rebar.config | 8 ++--- rebar.lock | 28 +++++++-------- 4 files changed, 60 insertions(+), 41 deletions(-) diff --git a/apps/wapi/test/wapi_ct_helper.erl b/apps/wapi/test/wapi_ct_helper.erl index ee6bc3a..59f5de2 100644 --- a/apps/wapi/test/wapi_ct_helper.erl +++ b/apps/wapi/test/wapi_ct_helper.erl @@ -4,7 +4,7 @@ -include_lib("wapi_dummy_data.hrl"). -include_lib("wapi_token_keeper_data.hrl"). -include_lib("wapi_bouncer_data.hrl"). --include_lib("damsel/include/dmsl_domain_conf_thrift.hrl"). +-include_lib("damsel/include/dmsl_domain_conf_v2_thrift.hrl"). -include_lib("damsel/include/dmsl_domain_thrift.hrl"). -export([init_suite/2]). @@ -79,27 +79,45 @@ init_suite(Module, Config, WapiEnv) -> start_app(scoper), ServiceURLs = mock_services_( [ - { - 'Repository', - {dmsl_domain_conf_thrift, 'Repository'}, - fun('Checkout', _) -> - {ok, #'domain_conf_Snapshot'{ - version = 1, - domain = #{ - ?PAYMENT_SYSTEM_REF(<<"VISA">>) => - ?PAYMENT_SYSTEM_OBJ( - <<"VISA">>, - bankcard_validator_legacy:get_payment_system_ruleset(<<"VISA">>) - ), - ?PAYMENT_SYSTEM_REF(<<"MASTERCARD">>) => - ?PAYMENT_SYSTEM_OBJ( - <<"MASTERCARD">>, - bankcard_validator_legacy:get_payment_system_ruleset(<<"MASTERCARD">>) - ) + {'RepositoryClient', {dmsl_domain_conf_v2_thrift, 'RepositoryClient'}, fun( + 'CheckoutObject', {{version, ?INTEGER}, ?PAYMENT_SYSTEM_REF(<<"VISA">>)} + ) -> + {ok, #domain_conf_v2_VersionedObject{ + info = #domain_conf_v2_VersionedObjectInfo{ + version = ?INTEGER, + changed_at = genlib_rfc3339:format(genlib_time:unow(), second), + changed_by = #domain_conf_v2_Author{ + id = ?STRING, + name = ?STRING, + email = ?STRING } - }} - end - } + }, + object = ?PAYMENT_SYSTEM_OBJ( + <<"VISA">>, + bankcard_validator_legacy:get_payment_system_ruleset(<<"VISA">>) + ) + }} + end}, + {'RepositoryClient', {dmsl_domain_conf_v2_thrift, 'RepositoryClient'}, fun( + 'CheckoutObject', {{version, ?INTEGER}, ?PAYMENT_SYSTEM_REF(<<"MASTERCARD">>)} + ) -> + {ok, #domain_conf_v2_VersionedObject{ + info = #domain_conf_v2_VersionedObjectInfo{ + version = ?INTEGER, + changed_at = genlib_rfc3339:format(genlib_time:unow(), second), + changed_by = #domain_conf_v2_Author{ + id = ?STRING, + name = ?STRING, + email = ?STRING + } + }, + object = ?PAYMENT_SYSTEM_OBJ( + <<"MASTERCARD">>, + bankcard_validator_legacy:get_payment_system_ruleset(<<"MASTERCARD">>) + ) + }} + end}, + {'Repository', {dmsl_domain_conf_v2_thrift, 'Repository'}, fun('GetLatestVersion', _) -> {ok, ?INTEGER} end} ], SupPid ), diff --git a/config/sys.config b/config/sys.config index 0e4bbd8..a613707 100644 --- a/config/sys.config +++ b/config/sys.config @@ -115,8 +115,9 @@ }} ]}, {service_urls, #{ - 'Repository' => <<"http://dominant:8022/v1/domain/repository">>, - 'RepositoryClient' => <<"http://dominant:8022/v1/domain/repository_client">> + 'AuthorManagement' => <<"http://dmt:8022/v1/domain/author">>, + 'Repository' => <<"http://dmt:8022/v1/domain/repository">>, + 'RepositoryClient' => <<"http://dmt:8022/v1/domain/repository_client">> }} ]}, diff --git a/rebar.config b/rebar.config index e13d1f6..cdc61de 100644 --- a/rebar.config +++ b/rebar.config @@ -34,16 +34,16 @@ %% Protocols {cds_proto, {git, "https://github.com/valitydev/cds-proto.git", {branch, "master"}}}, {binbase_proto, {git, "https://github.com/valitydev/binbase-proto.git", {branch, "master"}}}, - {damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "master"}}}, - {fistful_proto, {git, "https://github.com/valitydev/fistful-proto.git", {branch, "master"}}}, + {damsel, {git, "https://github.com/valitydev/damsel.git", {tag, "v2.2.0"}}}, + {fistful_proto, {git, "https://github.com/valitydev/fistful-proto.git", {tag, "v2.0.0"}}}, %% - {bankcard_validator, {git, "https://github.com/valitydev/bankcard-validator.git", {branch, "master"}}}, + {bankcard_validator, {git, "https://github.com/valitydev/bankcard-validator.git", {tag, "v1.1.0"}}}, {bouncer_proto, {git, "https://github.com/valitydev/bouncer-proto.git", {branch, "master"}}}, {bouncer_client, {git, "https://github.com/valitydev/bouncer-client-erlang.git", {tag, "v1.1.0"}}}, {cowboy_cors, {git, "https://github.com/valitydev/cowboy_cors.git", {branch, "master"}}}, {cowboy_access_log, {git, "https://github.com/valitydev/cowboy_access_log.git", {branch, "master"}}}, {cowboy_draining_server, {git, "https://github.com/valitydev/cowboy_draining_server.git", {branch, "master"}}}, - {dmt_client, {git, "https://github.com/valitydev/dmt_client.git", {branch, "master"}}}, + {dmt_client, {git, "https://github.com/valitydev/dmt_client.git", {tag, "v2.0.0"}}}, {erl_health, {git, "https://github.com/valitydev/erlang-health.git", {branch, "master"}}}, {genlib, {git, "https://github.com/valitydev/genlib.git", {tag, "v1.1.0"}}}, {lechiffre, {git, "https://github.com/valitydev/lechiffre.git", {tag, "v0.1.0"}}}, diff --git a/rebar.lock b/rebar.lock index f62e905..3e72321 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,9 +1,9 @@ {"1.2.0", -[{<<"accept">>,{pkg,<<"accept">>,<<"0.3.6">>},2}, +[{<<"accept">>,{pkg,<<"accept">>,<<"0.3.7">>},2}, {<<"acceptor_pool">>,{pkg,<<"acceptor_pool">>,<<"1.0.0">>},2}, {<<"bankcard_validator">>, {git,"https://github.com/valitydev/bankcard-validator.git", - {ref,"d9c82e9fa7b017278b3f72d9e27ff0249a5e40d7"}}, + {ref,"28073759961858a76a8ebaa294f32ed3123d6dd6"}}, 0}, {<<"bender_client">>, {git,"https://github.com/valitydev/bender-client-erlang.git", @@ -23,7 +23,7 @@ 0}, {<<"bouncer_proto">>, {git,"https://github.com/valitydev/bouncer-proto.git", - {ref,"07dcc7b9b4599923b20bcf5f84642c3a1d6570e2"}}, + {ref,"31866c36c049dc568d4bc795a641690db3cb20ab"}}, 0}, {<<"cache">>,{pkg,<<"cache">>,<<"2.3.3">>},1}, {<<"cds_proto">>, @@ -53,11 +53,11 @@ {<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},2}, {<<"damsel">>, {git,"https://github.com/valitydev/damsel.git", - {ref,"24932cdc557a75bfb3a4aeb1738638366003aba4"}}, + {ref,"ba7414811590859d058817b8f22d2e9c22f627f8"}}, 0}, {<<"dmt_client">>, {git,"https://github.com/valitydev/dmt_client.git", - {ref,"d8a4f490d49c038d96f1cbc2a279164c6f4039f9"}}, + {ref,"fcfb028a041149caeebec8d9cef469c8cdbbc63e"}}, 0}, {<<"dmt_core">>, {git,"https://github.com/valitydev/dmt-core.git", @@ -70,7 +70,7 @@ 0}, {<<"fistful_proto">>, {git,"https://github.com/valitydev/fistful-proto.git", - {ref,"54f1d580854d38429f56ce8cc14bac307eeb4ec7"}}, + {ref,"8b04c7faca7393b9a6a5509205be383d68039907"}}, 0}, {<<"genlib">>, {git,"https://github.com/valitydev/genlib.git", @@ -116,7 +116,7 @@ {<<"parse_trans">>,{pkg,<<"parse_trans">>,<<"3.4.1">>},0}, {<<"prometheus">>,{pkg,<<"prometheus">>,<<"4.11.0">>},0}, {<<"prometheus_cowboy">>,{pkg,<<"prometheus_cowboy">>,<<"0.1.9">>},0}, - {<<"prometheus_httpd">>,{pkg,<<"prometheus_httpd">>,<<"2.1.14">>},1}, + {<<"prometheus_httpd">>,{pkg,<<"prometheus_httpd">>,<<"2.1.15">>},1}, {<<"quantile_estimator">>,{pkg,<<"quantile_estimator">>,<<"0.2.1">>},1}, {<<"ranch">>,{pkg,<<"ranch">>,<<"1.8.0">>},1}, {<<"scoper">>, @@ -141,7 +141,7 @@ {ref,"3a60e5dc5bbd709495024f26e100b041c3547fd9"}}, 1}, {<<"tls_certificate_check">>, - {pkg,<<"tls_certificate_check">>,<<"1.27.0">>}, + {pkg,<<"tls_certificate_check">>,<<"1.28.0">>}, 1}, {<<"token_keeper_client">>, {git,"https://github.com/valitydev/token-keeper-client.git", @@ -162,7 +162,7 @@ 0}]}. [ {pkg_hash,[ - {<<"accept">>, <<"AD44AC7D704BF70EF8FB2E313EF5B978F9D1330BDDAC64509E93AFDA13281215">>}, + {<<"accept">>, <<"CD6E34A2D7E28CA38B2D3CB233734CA0C221EFBC1F171F91FEC5F162CC2D18DA">>}, {<<"acceptor_pool">>, <<"43C20D2ACAE35F0C2BCD64F9D2BDE267E459F0F3FD23DAB26485BF518C281B21">>}, {<<"cache">>, <<"B23A5FE7095445A88412A6E614C933377E0137B44FFED77C9B3FEF1A731A20B2">>}, {<<"certifi">>, <<"DBAB8E5E155A0763EEA978C913CA280A6B544BFA115633FA20249C3D396D9493">>}, @@ -185,14 +185,14 @@ {<<"parse_trans">>, <<"6E6AA8167CB44CC8F39441D05193BE6E6F4E7C2946CB2759F015F8C56B76E5FF">>}, {<<"prometheus">>, <<"B95F8DE8530F541BD95951E18E355A840003672E5EDA4788C5FA6183406BA29A">>}, {<<"prometheus_cowboy">>, <<"D9D5B300516A61ED5AE31391F8EEEEB202230081D32A1813F2D78772B6F274E1">>}, - {<<"prometheus_httpd">>, <<"529A63CA2A451FC5D28C77020787A75AF661DADF721E7EC14B5842412FB67A32">>}, + {<<"prometheus_httpd">>, <<"8F767D819A5D36275EAB9264AFF40D87279151646776069BF69FBDBBD562BD75">>}, {<<"quantile_estimator">>, <<"EF50A361F11B5F26B5F16D0696E46A9E4661756492C981F7B2229EF42FF1CD15">>}, {<<"ranch">>, <<"8C7A100A139FD57F17327B6413E4167AC559FBC04CA7448E9BE9057311597A1D">>}, {<<"ssl_verify_fun">>, <<"CF344F5692C82D2CD7554F5EC8FD961548D4FD09E7D22F5B62482E5AEAEBD4B0">>}, - {<<"tls_certificate_check">>, <<"2C1C7FC922A329B9EB45DDF39113C998BBDEB28A534219CD884431E2AEE1811E">>}, + {<<"tls_certificate_check">>, <<"C39BF21F67C2D124AE905454FAD00F27E625917E8AB1009146E916E1DF6AB275">>}, {<<"unicode_util_compat">>, <<"BC84380C9AB48177092F43AC89E4DFA2C6D62B40B8BD132B1059ECC7232F9A78">>}]}, {pkg_hash_ext,[ - {<<"accept">>, <<"A5167FA1AE90315C3F1DD189446312F8A55D00EFA357E9C569BDA47736B874C3">>}, + {<<"accept">>, <<"CA69388943F5DAD2E7232A5478F16086E3C872F48E32B88B378E1885A59F5649">>}, {<<"acceptor_pool">>, <<"0CBCD83FDC8B9AD2EEE2067EF8B91A14858A5883CB7CD800E6FCD5803E158788">>}, {<<"cache">>, <<"44516CE6FA03594D3A2AF025DD3A87BFE711000EB730219E1DDEFC816E0AA2F4">>}, {<<"certifi">>, <<"524C97B4991B3849DD5C17A631223896272C6B0AF446778BA4675A1DFF53BB7E">>}, @@ -215,10 +215,10 @@ {<<"parse_trans">>, <<"620A406CE75DADA827B82E453C19CF06776BE266F5A67CFF34E1EF2CBB60E49A">>}, {<<"prometheus">>, <<"719862351AABF4DF7079B05DC085D2BBCBE3AC0AC3009E956671B1D5AB88247D">>}, {<<"prometheus_cowboy">>, <<"5F71C039DEB9E9FF9DD6366BC74C907A463872B85286E619EFF0BDA15111695A">>}, - {<<"prometheus_httpd">>, <<"8B39F8CB6467B80D648FB982FDEB796BAB006BB43B1C95279289F311DB562D4E">>}, + {<<"prometheus_httpd">>, <<"67736D000745184D5013C58A63E947821AB90CB9320BC2E6AE5D3061C6FFE039">>}, {<<"quantile_estimator">>, <<"282A8A323CA2A845C9E6F787D166348F776C1D4A41EDE63046D72D422E3DA946">>}, {<<"ranch">>, <<"49FBCFD3682FAB1F5D109351B61257676DA1A2FDBE295904176D5E521A2DDFE5">>}, {<<"ssl_verify_fun">>, <<"BDB0D2471F453C88FF3908E7686F86F9BE327D065CC1EC16FA4540197EA04680">>}, - {<<"tls_certificate_check">>, <<"51A5AD3DBD72D4694848965F3B5076E8B55D70EB8D5057FCDDD536029AB8A23C">>}, + {<<"tls_certificate_check">>, <<"3AB058C3F9457FFFCA916729587415F0DDC822048A0E5B5E2694918556D92DF1">>}, {<<"unicode_util_compat">>, <<"25EEE6D67DF61960CF6A794239566599B09E17E668D3700247BC498638152521">>}]} ].