Skip to content

Commit

Permalink
feat(sessionToken): CHK-2936 update wallet/ecommerce api for io policy (
Browse files Browse the repository at this point in the history
#2131)

* feat(auth-fow-wallet): add common pagopa IO auth

* feat(ecomm-auth-io): new auth for eCommerce

* fix: token in ecommerce for io api

* fix wallet disalignment

* update openapi

* set v2 for ecommerce api

* add email to start session policy. set variable to fragment code

* feat(wallet-common & pay-wallet-common): add expiration storage queue (#2133)

* feat(wallet-common): add expiration storage queue

* fix: pre-commit

* feat: Migrated uat apim (#2135)

migrated uat apim

* feat: Switched to old apim v2 uat (#2136)

switched to old apim v2

* pre commit

* pre-commit

* restore wallet token into shared jwt token

* fix typo

* remove wallet token from shared session token claim

* add v2 api to check shared jwt session token

* add fragment policy to check jwt token

* remove interpolation for wallet token

* named value to handle pm policies

* fix named value

* fix named value and policy

* rename policy file

* update v2 policies

* fix new wallet pèolicy

* update policies and prepare resources for pay-wallet-app domain

* move check session for PM to get Payment methods

* remove pm webview openapi and pm webview policy from ecommerce-io v2

* fix post transactions

* set header client io

* fix policies

* add base policy

* remove wallet id from post wallet response

* fix post wallet policy

* read user id from right variable name

* fix payment method check session

* fix client id and session reading

* chore(wallet): use itn backend (#2162)

---------

Co-authored-by: Simone Infante <[email protected]>
Co-authored-by: Simone infante <[email protected]>
Co-authored-by: Gianluca Ciuffa <[email protected]>
Co-authored-by: Pietro Tota <[email protected]>
Co-authored-by: Marco Mari <[email protected]>
Co-authored-by: Giovanni Berti <[email protected]>
Co-authored-by: Gianluca Ciuffa <[email protected]>
  • Loading branch information
8 people authored Jun 18, 2024
1 parent e720f19 commit c6e7b3a
Show file tree
Hide file tree
Showing 30 changed files with 1,820 additions and 1,273 deletions.
47 changes: 46 additions & 1 deletion src/domains/ecommerce-app/04_apim_ecommerce_io.tf
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ resource "azurerm_api_management_api_operation_policy" "io_transaction_authoriza
operation_id = "requestTransactionAuthorizationForIO"

xml_content = templatefile("./api/ecommerce-io/v2/_auth_request.xml.tpl", {
wallet-basepath = local.wallet_hostname
authurl-basepath = var.env_short == "d" ? local.apim_hostname : "{{wisp2-gov-it}}"
wallet-basepath = local.wallet_hostname
})
}

Expand All @@ -377,4 +378,48 @@ resource "azurerm_api_management_api_operation_policy" "io_calculate_fee_v2" {
)
}

resource "azurerm_api_management_api_operation_policy" "delete_transactions_v2" {
api_name = "${local.project}-ecommerce-io-api-v2"
resource_group_name = local.pagopa_apim_rg
api_management_name = local.pagopa_apim_name
operation_id = "requestTransactionUserCancellationForIO"

xml_content = templatefile("./api/ecommerce-io/v2/_delete_transaction.xml.tpl", {
wallet-basepath = local.wallet_hostname
})
}

resource "azurerm_api_management_api_operation_policy" "get_transactions_v2" {
api_name = "${local.project}-ecommerce-io-api-v2"
resource_group_name = local.pagopa_apim_rg
api_management_name = local.pagopa_apim_name
operation_id = "getTransactionInfoForIO"

xml_content = templatefile("./api/ecommerce-io/v2/get_transaction.xml.tpl", {
wallet-basepath = local.wallet_hostname
})
}

resource "azurerm_api_management_api_operation_policy" "create_transactions_v2" {
api_name = "${local.project}-ecommerce-io-api-v2"
resource_group_name = local.pagopa_apim_rg
api_management_name = local.pagopa_apim_name
operation_id = "newTransactionForIO"

xml_content = templatefile("./api/ecommerce-io/v2/post_transactions.xml.tpl", {
ecommerce_ingress_hostname = local.ecommerce_hostname
})
}

resource "azurerm_api_management_api_operation_policy" "io_wallets_by_user_v2" {
api_name = "${local.project}-ecommerce-io-api-v2"
resource_group_name = local.pagopa_apim_rg
api_management_name = local.pagopa_apim_name
operation_id = "getWalletsByIdIOUser"

xml_content = templatefile("./api/ecommerce-io/v2/_get_wallets_by_user_with_pm.xml.tpl", {
ecommerce-hostname = local.ecommerce_hostname
})
}


4 changes: 4 additions & 0 deletions src/domains/ecommerce-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
| [azurerm_api_management_api_operation_policy.auth_request_gateway_policy](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.confirm_payment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.create_session](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.create_transactions_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.delete_transaction](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.delete_transactions_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.get_card_data](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.get_card_data_information](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.get_carts_redirect](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
Expand All @@ -66,6 +68,7 @@
| [azurerm_api_management_api_operation_policy.get_payment_request_info_api_policy](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.get_state](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.get_transaction_info](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.get_transactions_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.helpdesk_pgs_vpos](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.helpdesk_pgs_xpay](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.io_calculate_fee](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
Expand All @@ -80,6 +83,7 @@
| [azurerm_api_management_api_operation_policy.io_transaction_authorization_request_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.io_transaction_outcome](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.io_wallets_by_user](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.io_wallets_by_user_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.npg_notifications_policy](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.post_orders_build](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.refund_payment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
Expand Down
Loading

0 comments on commit c6e7b3a

Please sign in to comment.