Skip to content

Commit c2927fb

Browse files
Merge branch 'release/0.12.0'
2 parents 990cea0 + 1e211e5 commit c2927fb

File tree

11 files changed

+88
-18
lines changed

11 files changed

+88
-18
lines changed

Dockerfile-local

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM golang:1.16-stretch as build
2+
3+
RUN apt-get update && apt-get upgrade -y
4+
5+
WORKDIR /service
6+
CMD tail -f /dev/null
7+
8+
FROM build as test

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ API for managing access control permissions for Digital Publishing API resources
44

55
### Getting started
66

7-
* Load inital roles into your local mongodb using the `import-roles` utility in the import-roles folder. Follow the steps in the [README](./import-roles/README.md).
7+
* Load inital roles into your local mongodb using the `import-script` utility in the import-script folder. Follow the steps in the [README](./import-script/README.md).
88
* Run `make debug`
99

1010
### Dependencies

features/steps/permissions_component.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ import (
1717

1818
"github.com/ONSdigital/dp-authorisation/v2/authorisation"
1919
"github.com/ONSdigital/dp-authorisation/v2/authorisationtest"
20+
2021
"github.com/ONSdigital/dp-authorisation/v2/permissions"
2122

2223
"github.com/cucumber/godog"
2324
"github.com/gofrs/uuid"
2425
"go.mongodb.org/mongo-driver/bson"
2526
)
2627

28+
var (
29+
publicSigningkey = map[string]string{
30+
"NeKb65194Jo=": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u+qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyehkd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdgcKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbcmwIDAQAB",
31+
}
32+
)
33+
2734
// PermissionsComponent holds the initialized http server, mongo client and configs required for running component tests.
2835
type PermissionsComponent struct {
2936
ErrorFeature componenttest.ErrorFeature
@@ -231,7 +238,8 @@ func (f *PermissionsComponent) DoGetMongoDB(_ context.Context, _ *config.Config)
231238

232239
// DoGetAuthorisationMiddleware returns an authorisationMock.Middleware object
233240
func (f *PermissionsComponent) DoGetAuthorisationMiddleware(ctx context.Context, cfg *authorisation.Config) (authorisation.Middleware, error) {
234-
middleware, err := authorisation.NewMiddlewareFromConfig(ctx, cfg)
241+
middleware, err := authorisation.NewMiddlewareFromConfig(ctx, cfg, publicSigningkey)
242+
235243
if err != nil {
236244
return nil, err
237245
}

go.mod

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ go 1.17
55
replace github.com/spf13/viper => github.com/spf13/viper v1.9.0
66

77
require (
8-
github.com/ONSdigital/dp-authorisation/v2 v2.15.0
8+
github.com/ONSdigital/dp-authorisation/v2 v2.17.0
99
github.com/ONSdigital/dp-component-test v0.6.3
10-
github.com/ONSdigital/dp-healthcheck v1.2.1
10+
github.com/ONSdigital/dp-healthcheck v1.2.3
1111
github.com/ONSdigital/dp-mongodb/v3 v3.0.0-beta.8
1212
github.com/ONSdigital/dp-net v1.2.0
13-
github.com/ONSdigital/log.go/v2 v2.0.9
13+
github.com/ONSdigital/log.go/v2 v2.1.0
1414
github.com/cucumber/godog v0.12.2
1515
github.com/gofrs/uuid v4.1.0+incompatible
1616
github.com/gorilla/mux v1.8.0
@@ -22,8 +22,9 @@ require (
2222

2323
require (
2424
github.com/ONSdigital/dp-api-clients-go v1.43.0 // indirect
25-
github.com/ONSdigital/dp-api-clients-go/v2 v2.4.7 // indirect
25+
github.com/ONSdigital/dp-api-clients-go/v2 v2.92.2 // indirect
2626
github.com/ONSdigital/dp-mongodb-in-memory v1.1.0 // indirect
27+
github.com/ONSdigital/dp-net/v2 v2.1.0 // indirect
2728
github.com/ONSdigital/dp-rchttp v1.0.0 // indirect
2829
github.com/ONSdigital/go-ns v0.0.0-20210916104633-ac1c1c52327e // indirect
2930
github.com/cucumber/gherkin-go/v19 v19.0.3 // indirect
@@ -33,7 +34,7 @@ require (
3334
github.com/go-stack/stack v1.8.1 // indirect
3435
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
3536
github.com/golang/snappy v0.0.4 // indirect
36-
github.com/gopherjs/gopherjs v0.0.0-20210803090616-8f023c250c89 // indirect
37+
github.com/gopherjs/gopherjs v0.0.0-20220104163920-15ed2e8cf2bd // indirect
3738
github.com/hashicorp/go-immutable-radix v1.3.0 // indirect
3839
github.com/hashicorp/go-memdb v1.3.0 // indirect
3940
github.com/hashicorp/golang-lru v0.5.4 // indirect
@@ -46,7 +47,7 @@ require (
4647
github.com/mattn/go-isatty v0.0.14 // indirect
4748
github.com/maxcnunes/httpfake v1.2.4 // indirect
4849
github.com/pmezard/go-difflib v1.0.0 // indirect
49-
github.com/smartystreets/assertions v1.2.0 // indirect
50+
github.com/smartystreets/assertions v1.2.1 // indirect
5051
github.com/spf13/afero v1.6.0 // indirect
5152
github.com/spf13/pflag v1.0.5 // indirect
5253
github.com/square/mongo-lock v0.0.0-20201208161834-4db518ed7fb2 // indirect
@@ -56,9 +57,9 @@ require (
5657
github.com/xdg-go/stringprep v1.0.2 // indirect
5758
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
5859
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 // indirect
59-
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
60+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
6061
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
61-
golang.org/x/sys v0.0.0-20211210111614-af8b64212486 // indirect
62+
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a // indirect
6263
golang.org/x/text v0.3.7 // indirect
6364
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
6465
)

go.sum

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ github.com/ONSdigital/dp-api-clients-go v1.43.0 h1:0982P/YxnYXvba1RhEcFmwF3xywC4
5252
github.com/ONSdigital/dp-api-clients-go v1.43.0/go.mod h1:V5MfINik+o3OAF985UXUoMjXIfrZe3JKYa5AhZn5jts=
5353
github.com/ONSdigital/dp-api-clients-go/v2 v2.4.7 h1:7ESKNn2eAiPwehgCY6NmDkytNRNNdiRU5IvGykzEzPs=
5454
github.com/ONSdigital/dp-api-clients-go/v2 v2.4.7/go.mod h1:oB+Pw1BJlLHUh+a6BJY52VFTRGBEM5RSPlg2Xkq7D9k=
55+
github.com/ONSdigital/dp-api-clients-go/v2 v2.92.2 h1:KlxSi4kRz9nO5j5OjCgnjQsyoRAky5WOmMKQPbNPHA8=
56+
github.com/ONSdigital/dp-api-clients-go/v2 v2.92.2/go.mod h1:P3GYyqqXnbp4RjWhz0oYpUFjHPT6Ca4fEoh4huNkxHU=
5557
github.com/ONSdigital/dp-authorisation/v2 v2.15.0 h1:5Gkb0ITKqRYz/o9/sev3xh1PfTeOTHcIaEv8Xnr3XZA=
5658
github.com/ONSdigital/dp-authorisation/v2 v2.15.0/go.mod h1:Tk4Twtmn5eky8j2FIV/WM2PJYjo8KbW3wdxRQ/VEIUA=
59+
github.com/ONSdigital/dp-authorisation/v2 v2.17.0 h1:OMMULCmz+5iovN2C+v2z3pP9eb6dslYurT+fhUPtrUY=
60+
github.com/ONSdigital/dp-authorisation/v2 v2.17.0/go.mod h1:kxjSafH1971tcl0oGxiYRir1vTWkIagB+wNfGP75bgM=
5761
github.com/ONSdigital/dp-component-test v0.6.3 h1:WxaKaMZGdTUAb9DNp1K+PH+Xfc8ATIXpJ3lhcUW3myk=
5862
github.com/ONSdigital/dp-component-test v0.6.3/go.mod h1:CfpOujIEqZS5qON7sWn0LRyiP0V+5l12+2XWHB7S/oo=
5963
github.com/ONSdigital/dp-frontend-models v1.1.0/go.mod h1:TT96P7Mi69N3Tc/jFNdbjiwG4GAaMjP26HLotFQ6BPw=
@@ -62,6 +66,8 @@ github.com/ONSdigital/dp-healthcheck v1.0.5/go.mod h1:2wbVAUHMl9+4tWhUlxYUuA1dnf
6266
github.com/ONSdigital/dp-healthcheck v1.1.0/go.mod h1:vZwyjMJiCHjp/sJ2R1ZEqzZT0rJ0+uHVGwxqdP4J5vg=
6367
github.com/ONSdigital/dp-healthcheck v1.2.1 h1:HL0zHV5FI2Ym31gdMVNW9VLWiEJ0nrwXkVKX1MMPNr4=
6468
github.com/ONSdigital/dp-healthcheck v1.2.1/go.mod h1:XUhXoDIWPCdletDtpDOoXhmDFcc9b/kbedx96jN75aI=
69+
github.com/ONSdigital/dp-healthcheck v1.2.3 h1:8/qTe0TjXouQWW0jgrtDGMFl+fUWigfyntL+q96GUSY=
70+
github.com/ONSdigital/dp-healthcheck v1.2.3/go.mod h1:XUhXoDIWPCdletDtpDOoXhmDFcc9b/kbedx96jN75aI=
6571
github.com/ONSdigital/dp-mocking v0.0.0-20190905163309-fee2702ad1b9 h1:+WXVfTDyWXY1DQRDFSmt1b/ORKk5c7jGiPu7NoeaM/0=
6672
github.com/ONSdigital/dp-mocking v0.0.0-20190905163309-fee2702ad1b9/go.mod h1:BcIRgitUju//qgNePRBmNjATarTtynAgc0yV29VpLEk=
6773
github.com/ONSdigital/dp-mongodb-in-memory v1.1.0 h1:EjUU1zpIU1LElhiTMAG7qxy7Rq9+VTUtt3/lyA+K7jI=
@@ -75,6 +81,8 @@ github.com/ONSdigital/dp-net v1.0.7/go.mod h1:1QFzx32FwPKD2lgZI6MtcsUXritsBdJihl
7581
github.com/ONSdigital/dp-net v1.0.12/go.mod h1:2lvIKOlD4T3BjWQwjHhBUO2UNWDk82u/+mHRn0R3C9A=
7682
github.com/ONSdigital/dp-net v1.2.0 h1:gP9pBt/J8gktYeKsb7hq6uOC2xx1tfvTorUBNXp6pX0=
7783
github.com/ONSdigital/dp-net v1.2.0/go.mod h1:NinlaqcsPbIR+X7j5PXCl3UI5G2zCL041SDF6WIiiO4=
84+
github.com/ONSdigital/dp-net/v2 v2.1.0 h1:ZYuT7IPRctx0vkJp9ylmubP7zeYVCJ9KwISe92RtIJU=
85+
github.com/ONSdigital/dp-net/v2 v2.1.0/go.mod h1:Pv/35rM5tCLYdVdIZ5KoGu2EUXv/87fWTptlVTlS5MY=
7886
github.com/ONSdigital/dp-rchttp v0.0.0-20190919143000-bb5699e6fd59/go.mod h1:KkW68U3FPuivW4ogi9L8CPKNj9ZxGko4qcUY7KoAAkQ=
7987
github.com/ONSdigital/dp-rchttp v0.0.0-20200114090501-463a529590e8/go.mod h1:821jZtK0oBsV8hjIkNr8vhAWuv0FxJBPJuAHa2B70Gk=
8088
github.com/ONSdigital/dp-rchttp v1.0.0 h1:K/1/gDtfMZCX1Mbmq80nZxzDirzneqA1c89ea26FqP4=
@@ -93,6 +101,8 @@ github.com/ONSdigital/log.go/v2 v2.0.0/go.mod h1:PR7vXrv9dZKUc7SI/0toxBbStk84snm
93101
github.com/ONSdigital/log.go/v2 v2.0.5/go.mod h1:PR7vXrv9dZKUc7SI/0toxBbStk84snmybBnWpe+xY2o=
94102
github.com/ONSdigital/log.go/v2 v2.0.9 h1:dMtuN89vCP21iRuOBAGInn7ZzxIEGajC3o5pjoicnsY=
95103
github.com/ONSdigital/log.go/v2 v2.0.9/go.mod h1:VyTDkL82FtiAkaNFaT+bURBhLbP7NsIx4rkVbdpiuEg=
104+
github.com/ONSdigital/log.go/v2 v2.1.0 h1:nEPqMYyKQlbY8VPgMbnYpNpomUOgLrwEtMZZbuXC/5c=
105+
github.com/ONSdigital/log.go/v2 v2.1.0/go.mod h1:9w+SkChyhtIK7XCha+cq6bq2DpTaK16Q4LofgoEGMSk=
96106
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
97107
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
98108
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
@@ -271,6 +281,8 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR
271281
github.com/gopherjs/gopherjs v0.0.0-20210202160940-bed99a852dfe/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
272282
github.com/gopherjs/gopherjs v0.0.0-20210803090616-8f023c250c89 h1:cuZTXJQ2J5mpT2gioa6NRVnuNsbisCGG5tRBG0tZpI4=
273283
github.com/gopherjs/gopherjs v0.0.0-20210803090616-8f023c250c89/go.mod h1:0RnbP5ioI0nqRf3R9iK3iQaUJgsn0htlZEHCMn8FSfw=
284+
github.com/gopherjs/gopherjs v0.0.0-20220104163920-15ed2e8cf2bd h1:D/H64OK+VY7O0guGbCQaFKwAZlU5t764R++kgIdAGog=
285+
github.com/gopherjs/gopherjs v0.0.0-20220104163920-15ed2e8cf2bd/go.mod h1:cz9oNYuRUWGdHmLF2IodMLkAhcPtXeULvcBNagUrxTI=
274286
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
275287
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
276288
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
@@ -417,6 +429,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd
417429
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
418430
github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs=
419431
github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
432+
github.com/smartystreets/assertions v1.2.1 h1:bKNHfEv7tSIjZ8JbKaFjzFINljxG4lzZvmHUnElzOIg=
433+
github.com/smartystreets/assertions v1.2.1/go.mod h1:wDmR7qL282YbGsPy6H/yAsesrxfxaaSlJazyFLYVFx8=
420434
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
421435
github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg=
422436
github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM=
@@ -576,6 +590,8 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx
576590
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
577591
golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY=
578592
golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
593+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk=
594+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
579595
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
580596
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
581597
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -672,6 +688,8 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc
672688
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
673689
golang.org/x/sys v0.0.0-20211210111614-af8b64212486 h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk=
674690
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
691+
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a h1:ppl5mZgokTT8uPkmYOyEUmPTr3ypaKkg5eFOGrAmxxE=
692+
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
675693
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
676694
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
677695
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

import-script/policies.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,13 @@
3232
]
3333
}
3434
]
35+
},
36+
{
37+
"id": "dp-interactives-importer",
38+
"entities": [
39+
"users/dp-interactives-importer"
40+
],
41+
"role": "dp-interactives-importer",
42+
"conditions": []
3543
}
3644
]

import-script/roles.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
[
2+
{
3+
"name": "dp-interactives-importer",
4+
"permissions": [
5+
"interactives:update"
6+
]
7+
},
28
{
39
"name": "collection-previewer",
410
"permissions": [
511
"legacy:read",
6-
"datasets:read"
12+
"datasets:read",
13+
"interactives:read",
14+
"static-files:read"
715
]
816
},
917
{
@@ -15,7 +23,14 @@
1523
"datasets:read",
1624
"datasets:update",
1725
"datasets:delete",
18-
"groups:read"
26+
"interactives:create",
27+
"interactives:read",
28+
"interactives:update",
29+
"interactives:delete",
30+
"groups:read",
31+
"static-files:create",
32+
"static-files:read",
33+
"static-files:update"
1934
]
2035
},
2136
{
@@ -36,6 +51,10 @@
3651
"datasets:read",
3752
"datasets:update",
3853
"datasets:delete",
54+
"interactives:create",
55+
"interactives:read",
56+
"interactives:update",
57+
"interactives:delete",
3958
"groups:read",
4059
"policies:create",
4160
"policies:read",
@@ -50,7 +69,10 @@
5069
"groups:edit",
5170
"groups:delete",
5271
"users:logoutall",
53-
"roles:read"
72+
"roles:read",
73+
"static-files:create",
74+
"static-files:read",
75+
"static-files:update"
5476
]
5577
}
5678
]

models/responses.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package models
22

3-
// ErrorsResponse represents a slice of errors in a JSON response body.
3+
// ErrorResponse represents a slice of errors in a JSON response body.
44
type ErrorResponse struct {
55
Errors []error `json:"errors"`
66
Status int `json:"-"`
@@ -22,7 +22,7 @@ type SuccessResponse struct {
2222
Headers map[string]string `json:"-"`
2323
}
2424

25-
// NewErrorResponse creates a new SuccessResponse.
25+
// NewSuccessResponse creates a new SuccessResponse.
2626
func NewSuccessResponse(jsonBody []byte, statusCode int, headers map[string]string) *SuccessResponse {
2727
return &SuccessResponse{
2828
Body: jsonBody,

service/initialise.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (e *Init) DoGetMongoDB(ctx context.Context, cfg *config.Config) (Permission
8686

8787
// DoGetAuthorisationMiddleware creates authorisation middleware for the given config
8888
func (e *Init) DoGetAuthorisationMiddleware(ctx context.Context, authorisationConfig *authorisation.Config) (authorisation.Middleware, error) {
89-
return authorisation.NewFeatureFlaggedMiddleware(ctx, authorisationConfig)
89+
return authorisation.NewFeatureFlaggedMiddleware(ctx, authorisationConfig, nil)
9090
}
9191

9292
// GetAuthorisationMiddleware creates a new instance of authorisation.Middlware

service/service.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ func registerCheckers(ctx context.Context,
162162
log.Error(ctx, "error adding check for permissions cache", err)
163163
}
164164

165+
if err := hc.AddCheck("jwt keys state health check", authorisationMiddleware.IdentityHealthCheck); err != nil {
166+
hasErrors = true
167+
log.Error(ctx, "error getting jwt keys from identity service", err)
168+
}
169+
165170
if hasErrors {
166171
return errors.New("Error(s) registering checkers for health check")
167172
}

0 commit comments

Comments
 (0)