Skip to content

Ensure Booking Partner and Seller are securely partitioned #441

@nickevansuk

Description

@nickevansuk

There are currently no tests to ensure that correct security is implemented for the Orders feed.

Additional tests

booking-partner-authentication feature should be split into:

  • booking-partner-openid-authentication-for-multiple-sellers - the authorization-code-flow related tests (required if multiple-sellers feature is enabled)
  • booking-partner-openid-authentication - the client-credentials-flow tests (required if openid-authentication-for-multiple-sellers feature is enabled)
  • booking-partner-authentication - this is a set of authentication-agnostic tests to check the booking partner partitioning is implemented correctly (always required)
    • booking-partner-partitioning-for-orders test
      • Orders from two different bookings partners must not be visible to each other, and UUID must be unique within each booking partner
      • Using primary booking partner auth, make a booking using a UUID, cancel it, and check for it in the Orders feed. Using secondary booking auth, assert that an Order with the same UUID is not present in the orders feed. Then using secondary booking partner auth, make a different booking using the same UUID, cancel it, and check for it in the Orders feed. Both booking should succeed.
    • booking-partner-partitioning-for-order-proposals test
      • Order Proposals from two different bookings partners must not be visible to each other, and UUID must be unique within each booking partner
      • (if minimal-proposal is implemented) Using primary booking partner auth, make a P call using a UUID, approve it, and check for it in the Order Proposals feed. Using secondary booking auth, assert that an Order Proposal with the same UUID is not present in the Order Proposals feed. Then using secondary booking partner auth, make a different P call using the same UUID, approve it, and check for it in the Orders feed.

multiple-sellers feature should also include:

  • seller-access-restricted-by-auth test
    • Credentials for Seller (a) must not provide access make bookings for Seller (b)
    • Using primary seller auth, make a call to C1, C2, and P/B for the secondary seller, expecting all calls to fail with InvalidAuthorizationDetailsError (this is supported on the coverage/additional-auth-tests branch)

Additional test suite features to support these

To implement the above, recommend additional features in the broker microservice:

  1. Allow Orders feed listening to take into account the booking-partner creds to use (primary or secondary, already configured) - this likely means harvesting double the number of Orders feeds (harvesting running for each set of creds, getOrdersFeedHeader looks like it could easily be parameterised to support primary and secondary).
  2. Keep track of the UUIDs seen in each Orders/Order Proposal feed for each booking-partner creds. Add a new endpoint that allows test suite to assert that a particular UUID has not been seen yet.

Out of scope for this issue

Additionally to assure stability of tests that use the Orders feed, the following tests should be added to the order-deletion feature:

  • order-lifecycle test

    • Order should only be added to Orders feed after it updated following B
    • Make a booking using C1, C2, and B, then assert that the Order has not yet appeared in the Orders feed (does this need a timeout of some sort? is there a better way of doing this?)
  • order-proposal-lifecycle test

    • Order should only be added to Orders feed after it updated following P
    • Create an Order Proposal using C1, C2, and P, then assert that the Order does not appear in the Orders feed (does this need a timeout of some sort? is there a better way of doing this?)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions