Uploaded image for project: 'mod-pubsub'
  1. mod-pubsub
  2. MODPUBSUB-85

Pub/sub client: Subscribers.post permission required when no subscribers

    XMLWordPrintable

    Details

    • Template:
    • Sprint:
      EPAM BatchLoader Sprint 43
    • Story Points:
      0.5
    • Development Team:
      Folijet

      Description

      The pubsub.subscribers.post permission is required when I use org.folio.util.pubsub.PubSubClientUtils#registerModule method to register my module even though no subscribers present in the MessagingDescriptor.json at all.

      Steps to repro:

      1. Create a messaging descriptor with either no subscriptions property or empty:
        {
          "publications": [
            {
              "eventType": "DI_FEESFINES_ACCOUNT_WITH_LOAN_CLOSED",
              "description": "An account with a loan associated is closed",
              "eventTTL": 30,
              "signed": false
            }
          ]
        }
        
      2. Attempt to register a module using the descriptor by calling org.folio.util.pubsub.PubSubClientUtils#registerModule method.

      Expected:

      The module is deployed and registered as publisher.

      Actual

      The registration process failed with following exception:

      org.folio.util.pubsub.exceptions.ModuleRegistrationException: 
      Module's subscribers were not registered in PubSub. HTTP status: 403
      

      Dev notes:

      There is a check descriptorHolder.getSubscriberDescriptor() != null in the method to decide whether to execute API call to pub/sub or not. It seems that getSubscriberDescriptor() always returns non-null value. The check have to be modified to descriptorHolder.getSubscriberDescriptor().size() > 0.

      Similar issue should happen with publications property.

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Kateryna Senchenko Kateryna Senchenko
                Reporter:
                bohdan-suprun Bohdan Suprun
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases