-
Notifications
You must be signed in to change notification settings - Fork 2
Hdpi 5335 enable access to globalsearch without parties #1842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 106 commits
e5e5d82
90cf6e1
c7109b9
78e1234
c8ffc49
a2ae320
1df1fa6
c69133d
3e1939f
773aa20
01d2cf4
9823795
76610f7
d905605
30fcc91
2479362
c00584d
7eacfa9
db7ef83
196268a
1971be3
25250ca
67a3066
df0a43c
4f231af
c3be642
a958716
aaf0226
10c4367
1575542
ba03bb6
eb1f171
664ea45
503ea8e
0936ad1
4c0b41d
3efafd2
7c45241
8c4a32a
4899673
546031e
58ce009
f074b27
17fa2fe
d943827
6608255
ed7adb0
f27b9fa
e8c35b5
56dd3f7
48e914a
ee5f22c
96a99cb
878ead9
f64b2af
74aa952
ce7a25d
9c40a32
d181dea
0b4bac0
b57ae2b
f09c17d
2fd8d59
69557c0
d61d679
684169a
640630c
5bc345f
e75b417
251b9d4
461be8f
cccb807
b1d1f5f
2fc1779
bb21159
131046f
db6cc09
29d8bed
7a7f502
c91e0b3
30fc5d8
e3f2689
f7e74a4
1d98450
ab3a795
91629e7
95b1f74
8bd2f08
69108b6
5366bb5
e05ac25
3492145
0979654
291508a
2219262
033c8e7
261ee6a
ae34499
dbe80b3
47e1d25
a9de490
af808a9
d5b98ee
cc97154
b4cb47d
b582d0a
4e1606e
acc998a
e017d5e
03735cf
056ef76
4374959
900bbcf
d21e87f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,6 @@ withPipeline(type, product, component) { | |
| setPreviewEnvVars() | ||
| if (githubApi.getLabelsbyPattern(env.BRANCH_NAME, "pr-values:ccd").size() > 0) { | ||
| env.CCD_ENABLED = "true" | ||
| env.CASE_TYPE_SUFFIX="${CHANGE_ID}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was the reason for removing this?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Global search wasn't working when we had the case number on the end of the case type. |
||
| enableHighLevelDataSetup() | ||
| } else { | ||
| env.CCD_ENABLED = "false" | ||
|
|
@@ -127,6 +126,12 @@ withPipeline(type, product, component) { | |
| generateDefinitions(builder) | ||
| } | ||
|
|
||
| before('smoketest:preview') { | ||
| if (githubApi.getLabelsbyPattern(env.BRANCH_NAME, "pr-values:ccd").size() > 0) { | ||
| sh "./bin/trigger-global-search-index.sh" | ||
| } | ||
| } | ||
|
|
||
| before('smoketest:aat') { | ||
| env.CASE_TYPE_SUFFIX="staging" | ||
| env.CCD_ENABLED = "true" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #!/usr/bin/env bash | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Originally reviewed under: #1714 |
||
| set -ex | ||
|
|
||
| S2S_TOKEN=$(curl -s -X POST "${IDAM_S2S_AUTH_URL}/testing-support/lease" \ | ||
| -H 'Content-Type: application/json' \ | ||
| -d '{"microservice": "pcs_api"}') | ||
|
|
||
| IDAM_TOKEN=$(curl -s -X POST "${IDAM_API_URL}/o/token" \ | ||
| -H 'Content-Type: application/x-www-form-urlencoded' \ | ||
| --data-urlencode 'grant_type=password' \ | ||
| --data-urlencode "username=${IDAM_SYSTEM_USERNAME}" \ | ||
| --data-urlencode "password=${IDAM_SYSTEM_USER_PASSWORD}" \ | ||
| --data-urlencode 'client_id=pcs-api' \ | ||
| --data-urlencode "client_secret=${PCS_API_IDAM_SECRET}" \ | ||
| --data-urlencode 'scope=openid profile roles' \ | ||
| | python3 -c "import sys,json; print(json.load(sys.stdin)['access_token'])") | ||
|
|
||
| STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST "${DEFINITION_STORE_URL_BASE}/elastic-support/global-search/index" \ | ||
| -H "Authorization: Bearer ${IDAM_TOKEN}" \ | ||
| -H "ServiceAuthorization: Bearer ${S2S_TOKEN}") | ||
|
|
||
| if [ "$STATUS" != "201" ]; then | ||
| echo "ERROR: Global search index returned status ${STATUS}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Global search index created successfully" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,6 @@ global: | |
|
|
||
| java: | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines 199-->202 contain the only changes that haven't been reviewed. The rest reviewed under #1714 |
||
| environment: | ||
| CASE_TYPE_SUFFIX: ${CHANGE_ID} | ||
| PCS_DB_NAME: "{{ .Values.global.databaseNamePrefix }}pcs" | ||
| PCS_DB_HOST: '{{ tpl .Values.global.postgresHostname $}}' | ||
| PCS_DB_USER_NAME: "{{ .Values.global.postgresUsername}}" | ||
|
|
@@ -43,7 +42,6 @@ postgresql: | |
| - name: "pr-${CHANGE_ID}-data-store" | ||
| - name: "pr-${CHANGE_ID}-definition-store" | ||
| - name: "pr-${CHANGE_ID}-pcs" | ||
|
|
||
| ccd: | ||
| enabled: true | ||
| ccd: | ||
|
|
@@ -81,6 +79,7 @@ ccd: | |
| DEFINITION_STORE_DB_OPTIONS: "" | ||
| ELASTIC_SEARCH_INDEX_SHARDS: 1 | ||
| ELASTIC_SEARCH_INDEX_SHARDS_REPLICAS: 0 | ||
| DEFINITION_STORE_S2S_AUTHORISED_SERVICES: "ccd_data,ccd_gw,ccd_admin,jui_webapp,pui_webapp,aac_manage_case_assignment,xui_webapp,am_org_role_mapping_service,pcs_api" | ||
| ingressHost: ccd-definition-store-${SERVICE_FQDN} | ||
| keyVaults: | ||
| ccd: | ||
|
|
@@ -167,7 +166,7 @@ ccd: | |
| - name: cluster.initial_master_nodes | ||
| value: "" | ||
| - name: action.auto_create_index | ||
| value: .security*,.watches,.triggered_watches,.watcher-history-*,.logstash_dead_letter,.ml*,global_search | ||
| value: .security*,.watches,.triggered_watches,.watcher-history-*,.logstash_dead_letter,.ml* | ||
| persistence: | ||
| enabled: false | ||
| ingress: | ||
|
|
@@ -197,8 +196,10 @@ xui-webapp: | |
| SERVICES_CCD_DATA_STORE_API: http://${SERVICE_NAME}-ccd-data-store-api | ||
| SERVICES_TERMS_AND_CONDITIONS: http://xui-terms-and-conditions-aat.service.core-compute-aat.internal | ||
| SERVICES_HEARINGS_COMPONENT_API: http://jurisdiction-hearings-api-aat.service.core-compute-aat.internal | ||
| JURISDICTIONS: PCS,CIVIL | ||
| STAFF_SUPPORTED_JURISDICTIONS: PCS | ||
| JURISDICTIONS: PCS | ||
| GLOBAL_SEARCH_SERVICES: PCS,CIVIL,SSCS | ||
| WA_SUPPORTED_JURISDICTIONS: PCS,CIVIL,SSCS | ||
| STAFF_SUPPORTED_JURISDICTIONS: PCS,CIVIL,SSCS | ||
| FEATURE_REDIS_ENABLED: false | ||
| REDISCLOUD_URL: http://dummyrediscloudurl | ||
| FEATURE_APP_INSIGHTS_ENABLED: false | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,6 +72,7 @@ private void createAccessProfiles(CFTLib lib) { | |
|
|
||
| roleNames.add("caseworker"); | ||
| roleNames.add("caseworker-ras-validation"); | ||
| roleNames.add("GS_profile"); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Approved here: #1743 |
||
|
|
||
| lib.createRoles(roleNames.toArray(new String[0])); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| package uk.gov.hmcts.reform.pcs.ccd.accesscontrol; | ||
|
|
||
| import static java.util.Arrays.stream; | ||
| import static uk.gov.hmcts.ccd.sdk.api.Permission.CRU; | ||
| import static uk.gov.hmcts.ccd.sdk.api.Permission.R; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonValue; | ||
| import java.util.Set; | ||
| import lombok.Getter; | ||
| import uk.gov.hmcts.ccd.sdk.api.HasRole; | ||
| import uk.gov.hmcts.ccd.sdk.api.Permission; | ||
|
|
||
| @Getter | ||
| public enum AccessProfile implements HasRole { | ||
|
|
||
| CREATOR("[CREATOR]", CRU), | ||
| RAS_VALIDATOR("caseworker-ras-validation", Set.of(R)), | ||
| CITIZEN("citizen", CRU), | ||
| DEFENDANT("[DEFENDANT]", CRU), | ||
| CLAIMANT_SOLICITOR("[CLAIMANTSOLICITOR]", CRU), | ||
| DEFENDANT_SOLICITOR("[DEFENDANTSOLICITOR]", CRU), | ||
| PCS_CASE_WORKER("caseworker-pcs", Set.of(R)), | ||
| PCS_SOLICITOR("caseworker-pcs-solicitor", CRU), | ||
|
|
||
| GS_PROFILE("GS_profile", Set.of(R)); | ||
|
|
||
| @JsonValue | ||
| private final String role; | ||
| private final Set<Permission> caseTypePermissions; | ||
|
|
||
| AccessProfile(String role, Set<Permission> permissions) { | ||
| this.role = role; | ||
| this.caseTypePermissions = permissions; | ||
| } | ||
|
|
||
| public static String[] toRoles(AccessProfile... profiles) { | ||
| return stream(profiles) | ||
| .map(AccessProfile::getRole) | ||
| .toArray(String[]::new); | ||
| } | ||
|
|
||
| public String getCaseTypePermissions() { | ||
| return Permission.toString(caseTypePermissions); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes. Previously reviewed: #1714