Skip to content

(GONRG-9014)Register multi partitioning, unhardcode namespace\PG Schema

Rustam Lotsmanenko (EPAM) requested to merge gc-multipartition into master

Description:

Register service keeps all subscriptions in the common namespace. We need to restructure it to keep them in separate tenants.

Currently, sub that was created in one partition, is available in others:

Create in "osdu":

 \
curl --location 'https://community.gcp.gnrg-osdu.projects.epam.com/api/register/v1/subscription' {color}\
--header 'data-partition-id: osdu' {color}\
--header 'Content-Type: application/json' {color}\
--header 'Authorization: Bearer ' {color}\
–data '{\
  "name": "test-subscription",\
  "description": "test description",\
  "topic": "records-changed",\
  "pushEndpoint": "https://community.gcp.gnrg-osdu.projects.epam.com/api/register/v1/test-gc/challenge/test_subscription",\
  "secret": {\
    "secretType": "HMAC",\
    "value": "7a786376626e"\
  }\
{color:#000000}}'\
 \

List in "second":

curl --location 'https://community.gcp.gnrg-osdu.projects.epam.com/api/register/v1/subscriptions' {color}\
--header 'Data-Partition-Id: second' {color}\
--header 'Authorization: Bearer \
**Response:**\
 

    {         "id": "",         "name": "test-subscription",         "description": "test description",         "topic": "records-changed",         "pushEndpoint": "https://community.gcp.gnrg-osdu.projects.epam.com/api/register/v1/test-gc/challenge/test_subscription",         "createdBy": "rustam_lotsmanenko@epam.com",         "notificationId": "de-6d705b60-021f-4490-9df0-512a324b567a"     }

List in "system":

curl --location 'https://community.gcp.gnrg-osdu.projects.epam.com/api/register/v1/subscriptions' {color}\
--header 'Data-Partition-Id: system' {color}\
--header 'Authorization: Bearer

\[     {         "id": "",         "name": "test-subscription",         "description": "test description",         "topic": "records-changed",         "pushEndpoint": "https://community.gcp.gnrg-osdu.projects.epam.com/api/register/v1/test-gc/challenge/test_subscription",         "createdBy": "rustam_lotsmanenko@epam.com",         "notificationId": "de-6d705b60-021f-4490-9df0-512a324b567a"     } \]

How to test:

Does functionality was tested and how?

Changes include:

  • Refactor (a non-breaking change that improves code maintainability).
  • Bugfix (a non-breaking change that solves an issue).
  • New feature (a non-breaking change that adds functionality).
  • Breaking change (a change that is not backward-compatible and/or changes current functionality).

Changes in:

  • GC
  • Azure
  • AWS
  • IBM

Dev Checklist:

  • Added Unit Tests, wherever applicable.
  • Updated the Readme, if applicable.
  • Existing Tests pass
  • Verified functionality locally
  • Self Reviewed my code for formatting and complex business logic.
Edited by Riabokon Stanislav(EPAM)[GCP]

Merge request reports

Loading