@defra/lis-hubs-infra-core 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/lis-hubs-infra-core",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Shared hub mechanics for livestock platform.",
5
5
  "main": "src/index.js",
6
6
  "repository": {
@@ -49,6 +49,9 @@ export function createProxyPlugin({ hubId, environment }) {
49
49
  uri,
50
50
  headers: {
51
51
  'x-forwarded-prefix': path,
52
+ ...(request.headers.authorization && {
53
+ authorization: request.headers.authorization
54
+ }),
52
55
  ...(request.headers.cookie && {
53
56
  cookie: request.headers.cookie
54
57
  })
@@ -40,12 +40,16 @@ describe('createProxyPlugin()', () => {
40
40
  expect(
41
41
  route.handler.proxy.mapUri({
42
42
  params: { path: 'summary-data' },
43
- headers: { cookie: 'session=abc' }
43
+ headers: {
44
+ authorization: 'Bearer hub-service-token',
45
+ cookie: 'session=abc'
46
+ }
44
47
  })
45
48
  ).toEqual({
46
49
  uri: `${expectedBaseUri}/summary-data`,
47
50
  headers: {
48
51
  'x-forwarded-prefix': '/cattle',
52
+ authorization: 'Bearer hub-service-token',
49
53
  cookie: 'session=abc'
50
54
  }
51
55
  })