Skip to content

[#IOPLT-1469] Duplicate IO-COM endpoints#1293

Merged
gquadrati merged 18 commits intomasterfrom
IOPLT-1469
Jan 29, 2026
Merged

[#IOPLT-1469] Duplicate IO-COM endpoints#1293
gquadrati merged 18 commits intomasterfrom
IOPLT-1469

Conversation

@gquadrati
Copy link
Contributor

@gquadrati gquadrati commented Jan 19, 2026

List of Changes

  • Add new api_communication.yaml with all IO-COM endpoints, using api/communication/v1 as base path
  • Mount new endpoints and refactor old ones
  • Add new Opex Dashboard, using IO-COM action group
  • Generate and use new IO-COM types in code (they are equivalent to old ones, this will simplify the cleanup)
  • Integrate new Lollipop endpoints using new extractLollipopLocalsFromLollipopHeaders utility, that do not need redis

NOTE:

  • A new communicationController was needed to introduce new extractLollipopLocalsFromLollipopHeaders utility. It will replace old messageController as soon as we remove old endpoints
  • SEND activation has been moved to api_communication spec
  • Some unused functions have been removed (notify, deleteInstallation)
  • ALLOW_NOTIFY_IP_SOURCE_RANGE was removed, as it was anymore used
  • A complete refactory is not part of this PR (i.e. rename of pnService, pnRoutes, etc..)

Motivation and Context

Duplicate IO-COM endpoint using new x-user middleware

How Has This Been Tested?

Unit tests

Screenshots (if appropriate):

Types of changes

  • Chore (nothing changes by a user perspective)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a changeset, which I've added.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@changeset-bot
Copy link

changeset-bot bot commented Jan 19, 2026

🦋 Changeset detected

Latest commit: 1f954ad

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@pagopa/io-backend Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jan 19, 2026

Jira Pull Request Link

This Pull Request refers to the following Jira issue IOPLT-1469

@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

Terraform Plan 📖

Terraform Plan
�[0m�[1mInitializing the backend...�[0m
�[0m�[32m
Successfully configured the backend "azurerm"! Terraform will automatically
use this backend unless the backend configuration changes.�[0m

�[0m�[1mInitializing provider plugins...�[0m
- Finding hashicorp/azurerm versions matching ">= 3.86.0, <= 3.116.0"...
- Installing hashicorp/azurerm v3.116.0...
- Installed hashicorp/azurerm v3.116.0 (signed by HashiCorp)

Terraform has created a lock file �[1m.terraform.lock.hcl�[0m to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.�[0m

�[0m�[1m�[32mTerraform has been successfully initialized!�[0m�[32m�[0m
�[0m�[32m
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.�[0m
data.azurerm_resource_group.this: Reading...
data.azurerm_resource_group.this: Read complete after 0s [id=/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/dashboards]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # azurerm_portal_dashboard.this will be updated in-place
  ~ resource "azurerm_portal_dashboard" "this" {
      ~ dashboard_properties = jsonencode(
          ~ {
              ~ metadata = {
                  ~ model = {
                      ~ filters      = {
                          ~ value = {
                              ~ MsPortalFx_TimeRange = {
                                  ~ displayCache    = {
                                        name  = "Local Time"
                                      ~ value = "Past 4 hours" -> "Past 48 hours"
                                    }
                                  ~ filteredPartIds = [
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1e0",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1e2",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1e4",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1e6",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1e8",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1ea",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1ec",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1ee",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1f0",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1f2",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1f4",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1f6",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1f8",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1fa",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1fc",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c1fe",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c200",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c202",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c204",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c206",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c208",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c20a",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c20c",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c20e",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c210",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c212",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c214",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c216",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c218",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c21a",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c21c",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c21e",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c220",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c222",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c224",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c226",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c228",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c22a",
                                      - "StartboardPart-LogsDashboardPart-8811c540-2ff7-43c3-b567-e3ef68b4c22c",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432ed",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432ef",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432f1",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432f3",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432f5",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432f7",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432f9",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432fb",
                                      + "StartboardPart-LogsDashboardPart-9badbd78-7607-4131-8fa1-8b85191432fd",
                                    ]
                                  ~ model           = {
                                      ~ relative    = "4h" -> "48h"
                                        # (2 unchanged attributes hidden)
                                    }
                                }
                            }
                        }
                        # (2 unchanged attributes hidden)
                    }
                }
                # (1 unchanged attribute hidden)
            }
        )
        id                   = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/dashboards/providers/Microsoft.Portal/dashboards/io-p-opex_iobackend_api_backend"
        name                 = "io-p-opex_iobackend_api_backend"
      ~ tags                 = {
            "CostCenter"   = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"    = "Terraform"
            "Environment"  = "Prod"
            "Owner"        = "io"
            "Source"       = "https://github.com/pagopa/io-backend"
          - "hidden-title" = "io-p-opex_iobackend_api_backend" -> null
        }
        # (2 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR duplicates IO-COM endpoints using a new Communication API (/api/communication/v1) with modern stateless authentication. The changes introduce a new controller without Redis dependencies, add SEND activation endpoints, and set up Opex dashboard monitoring.

Changes:

  • New Communication API routes (/api/communication/v1) alongside legacy routes (/api/v1)
  • New CommunicationController using stateless authentication vs legacy MessagesController
  • Removed notify and deleteInstallation methods from NotificationService/Controller
  • Added Opex dashboard configuration for the new API endpoints
  • Removed ALLOW_NOTIFY_IP_SOURCE_RANGE configuration (no longer needed)

Reviewed changes

Copilot reviewed 32 out of 34 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/routes/communicationRoutes.ts New file with both legacy and modern Communication API route registration
src/controllers/communicationController.ts New stateless controller using UserIdentity without Redis
src/routes/pnRoutes.ts Refactored SEND activation routes (legacy + new)
src/controllers/notificationController.ts Removed notify method and related dependencies
src/services/notificationService.ts Removed notify and deleteInstallation methods
openapi/generated/api_communication.yaml New OpenAPI spec for Communication API
src/config.ts Removed ALLOW_NOTIFY_IP_SOURCE_RANGE, changed notification defaults
.opex/api_communication/** New Opex dashboard configuration files
Test files Updated tests to remove notify/deleteInstallation coverage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gquadrati gquadrati marked this pull request as ready for review January 20, 2026 15:16
@gquadrati gquadrati requested a review from a team as a code owner January 20, 2026 15:16
@gquadrati gquadrati changed the title [#IOPLT-1469] [#IOPLT-1469] Duplicate IO-COM endpoints Jan 21, 2026
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR should mark api_backend.yaml spec into a state of deprecation. Can we label api_backend.yaml as deprecated as done here for example?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 37 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gquadrati gquadrati merged commit 30746a4 into master Jan 29, 2026
8 checks passed
@gquadrati gquadrati deleted the IOPLT-1469 branch January 29, 2026 09:26
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants