Skip to content

Architecture of the Pub/Sub Integration

This document describes the architecture of the Modigie Integration for Cloud Pub/Sub API and the infrastructure involved.

Modigie Pub/Sub Repository

Your application connects to a Modigie Pub/Sub Repository that is exclusive to your application. A repository represents an instance of the Modigie Integration for Cloud Pub/Sub API and is owned by your Modigie Org Account. The repository is associated with an active subscription, which is charged for completed jobs. The repository is used to configure the service's behavior and the infrastructure required for your application.

The repository also functions as a container for access control. All data that your application sends to the service is encapsulated in this repository and isolated from other applications' repositories.

Important

Modigie encrypts all data at rest and in transit.

High-level architecture diagram showing the connection between a client application and an exclusive Modigie Pub/Sub repository

Connection between your application and your Pub/Sub repository at Modigie

Infrastructure overview

The Modigie Integration for Cloud Pub/Sub API uses shared and tenant-specific infrastructure.

Shared infrastructure

The shared infrastructure, used by all repositories, includes:

  • The Modigie Integration for Cloud Pub/Sub service: This service is hosted on Google Cloud Platform (GCP) within Modigie's production environment. It uses shared Infrastructure as Code (IaC) provisioned through CI/CD pipelines following GitOps practices. The production environment is strictly isolated, and access is controlled using the principle of least privilege. Service updates are deployed gradually without maintenance windows.

Tenant-specific Modigie API resources

When you connect your application to Modigie, the following dedicated resources are provisioned for you:

  • Modigie repository: A repository manages the connection's behavior and features. It also isolates your instance's data from other instances.
  • Modigie job pipeline: While your Pub/Sub repository has the status active or inactive, Modigie also provisions a dedicated job pipeline that reserves real-time capacities for your application based on the subscription.
  • Repository subscription: The active subscription determines the available features of your repository and how you are charged for completed jobs.
  • Quota accounts: Quota accounts regulate the processing rate and volume of jobs, with specific limits defined by your subscription. The system accommodates temporary spikes in load, but exceeding the quota may delay the dispatch and processing of jobs until utilization has recovered. Jobs that remain enqueued for an extended time will expire.

Tenant-specific GCP resources

Your Pub/Sub repository and its corresponding job pipeline have their own dedicated Google Cloud resources to support the expected functioning. These resources are hosted within the Google Cloud project provisioned exclusively for your Modigie Org Account.

Important

Unless mentioned otherwise, access to such tenant GCP resources is restricted to Modigie systems and operations based on least privilege practice.

Once your repository is available, we will share the names of all Pub/Sub topics and pull subscriptions, and the email address of your application's service account, the Application Account.

In the examples below, we use the following variables:

  • REPO_SHORT_HASH: The first 15 characters of the SHA256 hex-digest hash of your Pub/Sub repository's unique ID.
  • TENANT_PROJECT_ID: The GCP project ID that we have provisioned for your Modigie Org Account. This project hosts all tenant-specific GCP resources that we create for you across all Modigie products and services.

Google Cloud Pub/Sub Topics

Your application publishes job requests into one of the available Cloud Pub/Sub topics. For each job type, there is a dedicated topic that also performs schema validation on the messages your application publishes. The naming conventions are as follows:

  • Enrich Mobile & Verify Employment: inpubsub-job-request-enrichmobile-<REPO_SHORT_HASH>
  • Verify Mobile: inpubsub-job-request-verifymobile-<REPO_SHORT_HASH>
  • Verify Employment: inpubsub-job-request-verifyemployment-<REPO_SHORT_HASH>

Request Topic Authorization & Keyless Access: To publish requests, client applications authenticate either via the Application Account or directly using customer-owned service accounts. If you configure requestPublishers in your repository's ownerConfig, Modigie tenant-infra automatically grants roles/pubsub.publisher on the request topic directly to your service accounts, allowing keyless publishing via Application Default Credentials (ADC).

Customer-Owned Response Topics: By default, Modigie provisions tenant-specific response topics. However, per job type, you can designate an existing topic in your own Google Cloud project via responseTopic. When configured, Modigie tenant-infra does not create a tenant response topic or subscriptions for that job type, and any existing Modigie-provided response topics and subscriptions are destroyed. See Customer-Owned Google Cloud Resources.

Google Cloud Pub/Sub Subscriptions

Your application receives job response messages through a job-type-specific Cloud Pub/Sub subscription or via direct delivery to a customer-owned topic:

If your application is configured to actively pull job response messages from Modigie-managed subscriptions, a Cloud Pub/Sub pull subscription is created for each available job type:

  • Enrich Mobile & Verify Employment: inpubsub-job-response-enrichmobile-pull-all-externalendpoint-<REPO_SHORT_HASH>
  • Verify Mobile: inpubsub-job-response-verifymobile-pull-all-externalendpoint-<REPO_SHORT_HASH>
  • Verify Employment: inpubsub-job-response-verifyemployment-pull-all-externalendpoint-<REPO_SHORT_HASH>

If your application is configured with push subscriptions, Modigie delivers messages to your designated webhook URL. If your application uses customer-owned response topics (mode: topic), tenant subscriptions are not created.

Custom Google Service Account (Application Account)

The Application Account is a user-managed Google Service Account designed for secure communication between your application and Modigie.

The pattern of the service account's email address is as follows:

inpubsub-app-<REPO_SHORT_HASH>@<TENANT_PROJECT_ID>.iam.gserviceaccount.com

The Application Account has the following responsibilities:

  1. Publishing Job Responses: Modigie backend services use this Application Account to sign and publish job responses to both Modigie-provisioned response topics and customer-owned response topics across GCP projects (via roles/pubsub.publisher granted on your topic).
  2. Push Message Signing: If you use Modigie-managed push mode, pushed messages to your webhook are signed with a JWT from this service account.
  3. Publishing Requests & Pulling Responses (Default Mode): If you do not configure customer service accounts, your application uses this service account to publish job requests and pull job responses.

Exclusivity Boundary when using Customer Service Accounts

If you provide your own service account(s) under requestPublishers to publish job requests keylessly:

  • Modigie grants roles/pubsub.publisher on the request topic to your service account(s).
  • Publishing job requests becomes the exclusive responsibility of your service account(s).
  • The Application Account will still be provisioned and used to publish job responses, but it cannot be used to publish job requests.

If you use the Application Account in default mode and provide Modigie with a list of Google Cloud users to manage its keys, we grant the following Cloud IAM roles to this service account:

For more information, see Authentication and Customer-Owned Google Cloud Resources.