Skip to content

Fix authorization header bug in PartitionServiceClient

All Submissions:


  • [YES] I have added an explanation of what changes in this merge do and why we should include it?
  • [NA] I have updated the documentation accordingly.
  • [YES] I have added tests to cover my changes.
  • [YES] All new and existing tests passed.
  • [YES] My code follows the code style of this project.
  • [YES] I ran lint checks locally prior to submission.

What is the issue or story related to the change?


Existing behaviour: Each invocation of the method org.opengroup.osdu.azure.partition.PartitionServiceClient:getServiceClient overwrites the existing Authorization header in DpsHeaders, the token is overriden by result from the method org.opengroup.osdu.azure.util.AzureServicePrincipleTokenService:getAuthorizationToken. This is an erroneous behavior that overwrites the token of the client accessing the service.

New behaviour: Each invocation of the method org.opengroup.osdu.azure.partition.PartitionServiceClient:getServiceClient creates a new instance of DpsHeaders and puts there the Authorization header by result from the method org.opengroup.osdu.azure.util.AzureServicePrincipleTokenService:getAuthorizationToken. The new instance of DpsHeaders is used for org.opengroup.osdu.core.common.partition.PartitionService but the old instance remains unchanged having the correct token.

Test coverage:


Screenshot_2021-03-02_at_16.40.03

Does this introduce a breaking change?


  • [NO]

Pending items


Entitlements service requires this change to fix authorization logic.

Reviewer request


  • Please provide an ETA when you plan to review this MR. Write a comment to decline or provide an ETA.
  • Block the MR if you feel there is less testing or no details in the MR
  • Please cover the following aspects in the MR -- Coding design: <Reviewer1> -- Backward Compatibility: <Reviewer2> -- Feature Logic: <Logic design> -- <Any other context mention here> OR -- <Component 1>: <Reviewer1> -- <CosmosDB>: <Reviewer2> -- <ServiceBus> <Reviewer3> -- <Mention any other component and owner>

Merge request reports

Loading