From 2483f600d6f00193a7e8493bcefd6654d14eaa6a Mon Sep 17 00:00:00 2001 From: Aleksey Kashapov Date: Tue, 29 Oct 2024 13:57:38 +0300 Subject: [PATCH] EMP-74: Introduces `destination_field` scope (#47) * Introduces `destination_field` scope * Locks compatible rebar version --- .github/workflows/erlang-pr.yml | 2 +- proto/limiter_config.thrift | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/erlang-pr.yml b/.github/workflows/erlang-pr.yml index ba70b5c..5108e7f 100644 --- a/.github/workflows/erlang-pr.yml +++ b/.github/workflows/erlang-pr.yml @@ -10,7 +10,7 @@ jobs: uses: valitydev/erlang-workflows/.github/workflows/erlang-simple-build.yml@v1 with: otp-version: 24 - rebar-version: 3 + rebar-version: 3.23 use-thrift: true thrift-version: 0.14.2.3 run-eunit: false diff --git a/proto/limiter_config.thrift b/proto/limiter_config.thrift index 4ba796f..9aa20b5 100644 --- a/proto/limiter_config.thrift +++ b/proto/limiter_config.thrift @@ -149,10 +149,24 @@ union LimitScopeType { */ 9: LimitScopeEmptyDetails sender 10: LimitScopeEmptyDetails receiver + + /** + * Scope for operations with destination's generic resource fields. + * See damsel's "base.Content" https://github.com/valitydev/damsel/blob/ad715bd647bc5cfa822e2b09b1329dab6a2bf295/proto/base.thrift#L20-L25 + * and it's example with generic payment tool https://github.com/valitydev/damsel/blob/ad715bd647bc5cfa822e2b09b1329dab6a2bf295/proto/domain.thrift#L1816-L1836 + */ + 11: LimitScopeDestinationFieldDetails destination_field } struct LimitScopeEmptyDetails {} +/** + * TODO Support universal context-based field selector + */ +struct LimitScopeDestinationFieldDetails { + 1: required list field_path +} + union LimitContextType { 1: LimitContextTypePaymentProcessing payment_processing 2: LimitContextTypeWithdrawalProcessing withdrawal_processing