Skip to content

Commit 18fac09

Browse files
author
Bingjie Liu
committed
Refactor to not use wildcard at end of path for url authorization config and remove bsi and cymulate access
1 parent f9eb048 commit 18fac09

File tree

7 files changed

+60
-46
lines changed

7 files changed

+60
-46
lines changed

src/main/resources/application-dev.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ authorisation:
2828
consumers:
2929
mapps.client.org:
3030
- "/v1/persons"
31-
- "/v1/persons/.*"
31+
- "/v1/persons/\\.*+[^/]*$"
3232
- "/v1/persons/.*/images"
3333
- "/v1/images/.*"
3434
- "/v1/persons/.*/addresses"
@@ -43,18 +43,18 @@ authorisation:
4343
- "/v1/persons/.*/licences/conditions"
4444
- "/v1/persons/.*/case-notes"
4545
- "/v1/persons/.*/protected-characteristics"
46+
- "/v1/persons/.*/risks/mappadetail"
47+
- "/v1/persons/.*/risks/categories"
4648
ctrlo:
47-
- "/v1/epf/person-details/.*/.*"
49+
- "/v1/epf/person-details/.*/\\.*+[^/]*$"
4850
kubernetes-health-check-client:
4951
- "/health/liveness"
5052
- "/health/readiness"
5153
heartbeat:
52-
- "/v1/persons/.*"
53-
cymulate:
54-
- "/v1/epf/person-details/.*/.*"
54+
- "/v1/persons/\\.*+[^/]*$"
5555
pnd:
5656
- "/v1/persons"
57-
- "/v1/persons/.*"
57+
- "/v1/persons/\\.*+[^/]*$"
5858
- "/v1/persons/.*/addresses"
5959
- "/v1/persons/.*/alerts"
6060
- "/v1/persons/.*/sentences"

src/main/resources/application-local-docker.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ authorisation:
2626
consumers:
2727
automated-test-client:
2828
- "/v1/persons"
29-
- "/v1/persons/.*"
29+
- "/v1/persons/\\.*+[^/]*$"
3030
- "/v1/persons/.*/images"
31-
- "/v1/images/.*"
31+
- "/v1/images/\\.*+[^/]*$"
3232
- "/v1/persons/.*/addresses"
3333
- "/v1/persons/.*/offences"
3434
- "/v1/persons/.*/alerts"
@@ -40,7 +40,10 @@ authorisation:
4040
- "/v1/persons/.*/reported-adjudications"
4141
- "/v1/persons/.*/case-notes"
4242
- "/v1/persons/.*/person-responsible-officer"
43-
- "/v1/epf/person-details/.*/.*"
43+
- "/v1/persons/.*/protected-characteristics"
44+
- "/v1/persons/.*/risks/mappadetail"
45+
- "/v1/persons/.*/risks/categories"
46+
- "/v1/epf/person-details/.*/\\.*+[^/]*$"
4447
- "/health"
4548
- "/health/ping"
4649
- "/health/readiness"

src/main/resources/application-local.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ authorisation:
3333
consumers:
3434
automated-test-client:
3535
- "/v1/persons"
36-
- "/v1/persons/.*"
36+
- "/v1/persons/\\.*+[^/]*$"
3737
- "/v1/persons/.*/images"
38-
- "/v1/images/.*"
38+
- "/v1/images/\\.*+[^/]*$"
3939
- "/v1/persons/.*/addresses"
4040
- "/v1/persons/.*/offences"
4141
- "/v1/persons/.*/alerts"
@@ -45,9 +45,14 @@ authorisation:
4545
- "/v1/persons/.*/needs"
4646
- "/v1/persons/.*/risks"
4747
- "/v1/persons/.*/reported-adjudications"
48+
- "/v1/persons/.*/adjudications"
49+
- "/v1/persons/.*/licences/conditions"
50+
- "/v1/persons/.*/protected-characteristics"
51+
- "/v1/persons/.*/risks/mappadetail"
52+
- "/v1/persons/.*/risks/categories"
4853
- "/v1/persons/.*/case-notes"
4954
- "/v1/persons/.*/person-responsible-officer"
50-
- "/v1/epf/person-details/.*/.*"
55+
- "/v1/epf/person-details/.*/\\.*+[^/]*$"
5156
- "/health"
5257
- "/health/ping"
5358
- "/health/readiness"

src/main/resources/application-preprod.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ services:
2727
authorisation:
2828
consumers:
2929
ctrlo:
30-
- "/v1/epf/person-details/.*/.*"
31-
bsi:
32-
- "/v1/epf/person-details/.*/.*"
30+
- "/v1/epf/person-details/.*/\\.*+[^/]*$"
3331
kubernetes-health-check-client:
3432
- "/health/liveness"
3533
- "/health/readiness"

src/main/resources/application-prod.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ services:
2727
authorisation:
2828
consumers:
2929
ctrlo:
30-
- "/v1/epf/person-details/.*/.*"
30+
- "/v1/epf/person-details/.*/\\.*+[^/]*$"
3131
kubernetes-health-check-client:
3232
- "/health/liveness"
3333
- "/health/readiness"

src/main/resources/application-test.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ authorisation:
4141
consumers:
4242
automated-test-client:
4343
- "/v1/persons"
44-
- "/v1/persons/.*"
44+
- "/v1/persons/\\.*+[^/]*$"
4545
- "/v1/persons/.*/images"
46-
- "/v1/images/.*"
46+
- "/v1/images/\\.*+[^/]*$"
4747
- "/v1/persons/.*/addresses"
4848
- "/v1/persons/.*/offences"
4949
- "/v1/persons/.*/alerts"
@@ -53,11 +53,14 @@ authorisation:
5353
- "/v1/persons/.*/needs"
5454
- "/v1/persons/.*/risks"
5555
- "/v1/persons/.*/reported-adjudications"
56-
- "/v1/epf/person-details/.*/.*"
56+
- "/v1/epf/person-details/.*/\\.*+[^/]*$"
5757
- "/v1/persons/.*/adjudications"
5858
- "/v1/persons/.*/licences/conditions"
5959
- "/v1/persons/.*/case-notes"
6060
- "/v1/persons/.*/person-responsible-officer"
61+
- "/v1/persons/.*/protected-characteristics"
62+
- "/v1/persons/.*/risks/mappadetail"
63+
- "/v1/persons/.*/risks/categories"
6164
- "/health"
6265
- "/health/ping"
6366
- "/health/readiness"

src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/smoke/AuthoriseConfigTest.kt

+32-27
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,38 @@ class AuthoriseConfigTest : DescribeSpec(
1919
response.body().shouldEqualJson(
2020
"""
2121
{
22-
"automated-test-client": [
23-
"/v1/persons",
24-
"/v1/persons/.*",
25-
"/v1/persons/.*/images",
26-
"/v1/images/.*",
27-
"/v1/persons/.*/addresses",
28-
"/v1/persons/.*/offences",
29-
"/v1/persons/.*/alerts",
30-
"/v1/persons/.*/sentences",
31-
"/v1/persons/.*/sentences/latest-key-dates-and-adjustments",
32-
"/v1/persons/.*/risks/scores",
33-
"/v1/persons/.*/needs",
34-
"/v1/persons/.*/risks",
35-
"/v1/persons/.*/reported-adjudications",
36-
"/v1/persons/.*/case-notes",
37-
"/v1/persons/.*/person-responsible-officer",
38-
"/v1/epf/person-details/.*/.*",
39-
"/health",
40-
"/health/ping",
41-
"/health/readiness",
42-
"/health/liveness",
43-
"/info"
44-
],
45-
"config-test": [
46-
"/v1/config/authorisation"
47-
]
48-
}
22+
"automated-test-client": [
23+
"/v1/persons",
24+
"/v1/persons/\\.*+[^/]*${'$'}",
25+
"/v1/persons/.*/images",
26+
"/v1/images/\\.*+[^/]*${'$'}",
27+
"/v1/persons/.*/addresses",
28+
"/v1/persons/.*/offences",
29+
"/v1/persons/.*/alerts",
30+
"/v1/persons/.*/sentences",
31+
"/v1/persons/.*/sentences/latest-key-dates-and-adjustments",
32+
"/v1/persons/.*/risks/scores",
33+
"/v1/persons/.*/needs",
34+
"/v1/persons/.*/risks",
35+
"/v1/persons/.*/reported-adjudications",
36+
"/v1/persons/.*/adjudications",
37+
"/v1/persons/.*/licences/conditions",
38+
"/v1/persons/.*/protected-characteristics",
39+
"/v1/persons/.*/risks/mappadetail",
40+
"/v1/persons/.*/risks/categories",
41+
"/v1/persons/.*/case-notes",
42+
"/v1/persons/.*/person-responsible-officer",
43+
"/v1/epf/person-details/.*/\\.*+[^/]*${'$'}",
44+
"/health",
45+
"/health/ping",
46+
"/health/readiness",
47+
"/health/liveness",
48+
"/info"
49+
],
50+
"config-test": [
51+
"/v1/config/authorisation"
52+
]
53+
}
4954
""".removeWhitespaceAndNewlines(),
5055
)
5156
}

0 commit comments

Comments
 (0)