From 8ab22dbc0dc365a46f434a309530600cf489736a Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Fri, 19 Aug 2022 11:47:21 -0400 Subject: [PATCH 01/11] [CLDN-1541] Added the ability to filter on multiple user ID's and IP's at the same time in the Application Links custom viz --- .../src/ApplicationLinks.tsx | 33 +++++++++++++++---- .../src/plugin/transformProps.ts | 4 +-- .../src/types.ts | 2 +- superset/proxy/api.py | 28 +++++++++++++--- 4 files changed, 54 insertions(+), 13 deletions(-) diff --git a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx index d68f7999ef8ae..9e4a15ac9e8df 100644 --- a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx +++ b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx @@ -20,6 +20,19 @@ export default function ApplicationLinks(props: ApplicationsProps) { } } + const link_formatter = () => { + let tempString = ''; + if (appVal.length > 1) { + tempString = appVal[0]; + for (let i = 1; i < appVal.length; i += 1) { + tempString += `%22%2C%20%22${appVal[i]}`; + } + } else if (appVal.length === 1) { + tempString = appVal[0]; + } + return tempString; + }; + useEffect(() => { fetch( // eslint-disable-next-line no-restricted-globals @@ -36,11 +49,15 @@ export default function ApplicationLinks(props: ApplicationsProps) { if (appType === 'USER_ID') { setAlfredURL( - `${response.payload?.url}/?expression=MATCH%20(email%3AEMAIL_ADDRESS)%20WHERE%20email.value%20IN%20%5B%22${appVal}%22%5D%20RETURN%20email.value%2C%20email.maliciousness%2C%20email.uri`, + `${ + response.payload?.url + }/?expression=MATCH%20(email%3AEMAIL_ADDRESS)%20WHERE%20email.value%20IN%20%5B%22${link_formatter()}%22%5D%20RETURN%20email.value%2C%20email.maliciousness%2C%20email.uri`, ); } else if (appType === 'IP') { setAlfredURL( - `${response.payload?.url}/?expression=MATCH%20(ip%3AIP_ADDRESS)%20WHERE%20ip.value%20IN%20%5B%22${appVal}%22%5D%20RETURN%20ip.value%2C%20ip.maliciousness%2C%20ip.creation_date%2C%20ip.created_by%2C%20ip.uri%2C%20ip.report_uri`, + `${ + response.payload?.url + }/?expression=MATCH%20(ip%3AIP_ADDRESS)%20WHERE%20ip.value%20IN%20%5B%22${link_formatter()}%22%5D%20RETURN%20ip.value%2C%20ip.maliciousness%2C%20ip.creation_date%2C%20ip.created_by%2C%20ip.uri%2C%20ip.report_uri`, ); } else { setAlfredURL(`${response.payload?.url}`); @@ -59,7 +76,7 @@ export default function ApplicationLinks(props: ApplicationsProps) { return (
- {appVal === '' && appType === '' ? ( + {appVal.length === 0 && appType === '' ? (
{alfredCount > 0 ? (

- Alfred has seen this {infoType} {alfredCount} time(s). Search - the{' '} + Alfred has seen {appVal.length > 1 ? 'these' : 'this'}{' '} + {infoType} + {appVal.length > 1 ? "'s" : ''} {alfredCount} time + {alfredCount > 1 ? 's' : ''}. Search the{' '} Alfred {' '} @@ -98,7 +117,9 @@ export default function ApplicationLinks(props: ApplicationsProps) {

) : (

- Alfred has not seen this {infoType}. Search the{' '} + Alfred has not seen {appVal.length > 1 ? 'these' : 'this'}{' '} + {infoType} + {appVal.length > 1 ? "'s" : ''}. Search the{' '} Alfred {' '} diff --git a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/plugin/transformProps.ts b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/plugin/transformProps.ts index a7945ec2c2729..3c5a002bca65c 100644 --- a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/plugin/transformProps.ts +++ b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/plugin/transformProps.ts @@ -60,11 +60,11 @@ export default function transformProps(chartProps: ChartProps) { const filter = formData.extraFormData.filters[0]; if (filter.col === 'ip_string') { appType = 'IP'; - appVal = filter.val[0]; + appVal = filter.val; break; } else if (filter.col === 'user_id') { appType = 'USER_ID'; - appVal = filter.val[0]; + appVal = filter.val; break; } } diff --git a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/types.ts b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/types.ts index 95b8bd3704bae..62373de9d55e6 100644 --- a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/types.ts +++ b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/types.ts @@ -3,6 +3,6 @@ import { QueryFormData, TimeseriesDataRecord } from '@superset-ui/core'; export type ApplicationsProps = QueryFormData & { data: TimeseriesDataRecord[]; application: string; - appVal: string; + appVal: string[]; appType: string; }; diff --git a/superset/proxy/api.py b/superset/proxy/api.py index a1d1314a124c4..2dfbfcd0808ad 100644 --- a/superset/proxy/api.py +++ b/superset/proxy/api.py @@ -158,14 +158,24 @@ def get_userid(self, user_id: str, **_kwargs: Any) -> Response: current logged in user, and will then send a request to Alfred to see if the passed in user_id is in any reports/incidents - :param user_id: String value representing the user id passed in from the front-end + :param user_id: String value representing the user id(s) passed in from the front-end :param _kwargs: Array representing any other arguments passed to the function :returns: Response generated from passing values to the make_alfred_connection function """ + user_emails = user_id.split(",") + user_email_string = '' + + if len(user_emails) > 1: + user_email_string = user_emails[0] + for index in range(1, len(user_emails)): + user_email_string += "%22%2C%20%22" + user_emails[index] + elif len(user_emails) == 1: + user_email_string = user_emails[0] + url = ( self.ALFRED_URL + "/rest/search/cypher?expression=MATCH%20(email%3AEMAIL_ADDRESS)%20WHERE%20email.value%20IN%20%5B%22" - + user_id + + user_email_string + "%22%5D%20RETURN%20email.value%2C%20email.maliciousness%2C%20email.uri" ) @@ -182,14 +192,24 @@ def get_ipstring(self, ip_string: str, **_kwargs: Any) -> Response: current logged in user, and will then send a request to Alfred to see if the passed in ip_string is in any reports/incidents - :param ip_string: String value representing the ip passed in from the front-end + :param ip_string: String value representing the ip(s) passed in from the front-end :param _kwargs: Array representing any other arguments passed to the function :returns: Response generated from passing values to the make_alfred_connection function """ + user_ips = ip_string.split(",") + user_ip_string = '' + + if len(user_ips) > 1: + user_ip_string = user_ips[0] + for index in range(1, len(user_ips)): + user_ip_string += "%22%2C%20%22" + user_ips[index] + elif len(user_ips) == 1: + user_ip_string = user_ips[0] + url = ( self.ALFRED_URL + "/rest/search/cypher?expression=MATCH%20(ip%3AIP_ADDRESS)%20WHERE%20ip.value%20IN%20%5B%22" - + ip_string + + user_ip_string + "%22%5D%20RETURN%20ip.value%2C%20ip.maliciousness%2C%20ip.creation_date%2C%20ip.created_by%2C%20ip.uri%2C%20ip.report_uri" ) From c89292d3e0e47663801982304bb9f36eea33f974 Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Mon, 22 Aug 2022 09:21:53 -0400 Subject: [PATCH 02/11] Temp update to image for deploying to PB-stg --- cccs-build/superset/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cccs-build/superset/Dockerfile b/cccs-build/superset/Dockerfile index cfe6ecc6f343d..f47f29e41bea7 100644 --- a/cccs-build/superset/Dockerfile +++ b/cccs-build/superset/Dockerfile @@ -1,7 +1,7 @@ # Vault CA container import ARG VAULT_CA_CONTAINER=uchimera.azurecr.io/cccs/hogwarts/vault-ca:master_2921_22315d60 FROM $VAULT_CA_CONTAINER AS vault_ca -FROM uchimera.azurecr.io/cccs/superset-base:cccs-2.0_20220817191129_b4593 +FROM uchimera.azurecr.io/cccs/superset-base:feature_CLDN-1541_20220822130611_b4622 USER root From 5d42174be40b88d9fafd3e7dbc5acf7ef2295a5f Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Mon, 22 Aug 2022 09:53:16 -0400 Subject: [PATCH 03/11] Reverting change to image --- cccs-build/superset/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cccs-build/superset/Dockerfile b/cccs-build/superset/Dockerfile index f47f29e41bea7..cfe6ecc6f343d 100644 --- a/cccs-build/superset/Dockerfile +++ b/cccs-build/superset/Dockerfile @@ -1,7 +1,7 @@ # Vault CA container import ARG VAULT_CA_CONTAINER=uchimera.azurecr.io/cccs/hogwarts/vault-ca:master_2921_22315d60 FROM $VAULT_CA_CONTAINER AS vault_ca -FROM uchimera.azurecr.io/cccs/superset-base:feature_CLDN-1541_20220822130611_b4622 +FROM uchimera.azurecr.io/cccs/superset-base:cccs-2.0_20220817191129_b4593 USER root From 94eef6d6b29a6c2700fa0f013fd977ea673fbfb0 Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Mon, 22 Aug 2022 13:29:12 -0400 Subject: [PATCH 04/11] [CLDN-1541] Added a tooltip to the Alfred icon --- .../plugin-chart-application-links/src/ApplicationLinks.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx index 9e4a15ac9e8df..c6b7322fe5285 100644 --- a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx +++ b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx @@ -83,6 +83,7 @@ export default function ApplicationLinks(props: ApplicationsProps) { width="30" alt="Alfred" unselectable="on" + title="Alfred" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAjCAYAAAA5dzKxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAhdEVYdENyZWF0aW9uIFRpbWUAMjAyMToxMDoyMCAxMDo1NjoxODj1iuIAAAdVSURBVFhH7Vh7TJRXFv/Ni5nhVRRQTHShBevSkq6P1FK3dtWiQHazW7O+TRDsuq6Jf7T9Q7ubzSZtdvuHpmnTFbWgriuJumtX3EajbVFKpUCk1NRHqFbkFVTk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YXpfAh70bHgcDg0ulGLTso97cqVKyIPR/e4CgCXUFpUkpZLK7eJqL83fJDBsFgsKCgoEJ1cVPbs2SN9/B4ymFEoUB5qa2uThGcPUknV+vr6RP4gULr5Pzj04Sa6+X9td+7cEXmoCDky7D1GWVkZBukzgOZi+fLl8kWp+sYLFeW0tDS5RXD71q1bKC8vl/5Q9Yd8N/t/wLhy5vsJ4H+26s1scE22tgAAAABJRU5ErkJggg==" />

@@ -101,6 +102,7 @@ export default function ApplicationLinks(props: ApplicationsProps) { height="17" width="30" alt="Alfred" + title="Alfred" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAjCAYAAAA5dzKxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAhdEVYdENyZWF0aW9uIFRpbWUAMjAyMToxMDoyMCAxMDo1NjoxODj1iuIAAAdVSURBVFhH7Vh7TJRXFv/Ni5nhVRRQTHShBevSkq6P1FK3dtWiQHazW7O+TRDsuq6Jf7T9Q7ubzSZtdvuHpmnTFbWgriuJumtX3EajbVFKpUCk1NRHqFbkFVTkrcMM8/z2nMPcKaXozOCYdJv+kuG737n3nnt+59xz7v3QaQT8QKD3P38Q+JHM9xUPnUx2djZ0Op38FixYILKHlqZcACINr9crz7q6Ok2v12sGg0F+RqNRu3DhgvT5fD55RhIPNTI7duwAGR34eTwe7Nq1S/pobXlGFMOcIo8bN25osbGxGm0vLSUlRZs8ebK0ExMTtd7eXv+oyCLikeEIMPbv3w+bzSYR2LJlCzZv3iztnp4eHD58WMaosRGDUIownE6nlp6eLpEwm81aZ2en1tzcLDnDspkzZz6UnHkgMl4yyDPCKJX45eXlnBBi+NKlS0XGWLx4sci4r6qqSmRqDsPjJX0j3sNFRCOjvJ2TkxMwuqKiQmSMo0ePBkiuXLlSZCPJPCjGTcbp8Whnmju0qusdEiGFixcvBrZTVlbWt4wdGhrS0tLSpC86Olprb2/395A+l0c7VXNFO3PuGs0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vtRmZmJlpaWmTxmto6PDP3aVzv7MVrR6phG/LB6xikskuejopGksWA7UULMSXxEZz68CPk5+WK8bNmzUJ9fX0gMiMRLPEVgpZmxXW0LlVyeXs0NTXJe25urhDhfPpJ0gQYNa61bhpFX5qswOuBxagTIjwmL3cJ5s6dK3O5+tXW1goRpVtBEQnm96BkRntJQcmLi4ulzQvx3mdwfrhpu7jJKO7jkapYuDwUKTbWb9jGjRsDRu7cuVOe98K9bFEI6wagoLZCY2MjKisrRZaRkYG8vDxp86ltpfKa+9RjMFjj+GYJOmGgN1vx6+wZw+Xa7+Rly5Zh0qRJ0j527Bhu3rwp50+wKIyFcZNhlJSUSM7w+/r166W8DifwsDGFv3gKv3kyBVMmxGEqVbK1VIaXPfeE9A2f7D7Ex8dj1apVIuOPuQMHDoju0VstJJCScWFgYEBLTk6WG3BMTIzW0dEhcjJCniPB3ym0tfxv30CNvXTpUuCmPX36dM3lcok8XIRNRl3pS0tLOTxiwJo1a0Sm+kZiJImxPrwUoUWLFoku1nn8+HGRjaXvfgibjFp8zpw5gcXPnj0rsnAXZ6g5R44cCTiHLqIiGyvK90NYZNTC1dXVgYXpfAh70bHgcDg0ulGLTso97cqVKyIPR/e4CgCXUFpUkpZLK7eJqL83fJDBsFgsKCgoEJ1cVPbs2SN9/B4ymFEoUB5qa2uThGcPUknV+vr6RP4gULr5Pzj04Sa6+X9td+7cEXmoCDky7D1GWVkZBukzgOZi+fLl8kWp+sYLFeW0tDS5RXD71q1bKC8vl/5Q9Yd8N/t/wLhy5vsJ4H+26s1scE22tgAAAABJRU5ErkJggg==" /> From 5c363224df7ce1387d38bdc22b8cb12a3bf01b8f Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Mon, 22 Aug 2022 13:55:46 -0400 Subject: [PATCH 05/11] Temp update to base image --- cccs-build/superset/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cccs-build/superset/Dockerfile b/cccs-build/superset/Dockerfile index cfe6ecc6f343d..89310c718df2a 100644 --- a/cccs-build/superset/Dockerfile +++ b/cccs-build/superset/Dockerfile @@ -1,7 +1,7 @@ # Vault CA container import ARG VAULT_CA_CONTAINER=uchimera.azurecr.io/cccs/hogwarts/vault-ca:master_2921_22315d60 FROM $VAULT_CA_CONTAINER AS vault_ca -FROM uchimera.azurecr.io/cccs/superset-base:cccs-2.0_20220817191129_b4593 +FROM uchimera.azurecr.io/cccs/superset-base:feature_CLDN-1541_20220822173221_b4624 USER root From 005d2d9998411a95282c968e7642621a3d7beb38 Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:14:28 -0400 Subject: [PATCH 06/11] Reverting temporary change to image tag --- cccs-build/superset/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cccs-build/superset/Dockerfile b/cccs-build/superset/Dockerfile index 89310c718df2a..cfe6ecc6f343d 100644 --- a/cccs-build/superset/Dockerfile +++ b/cccs-build/superset/Dockerfile @@ -1,7 +1,7 @@ # Vault CA container import ARG VAULT_CA_CONTAINER=uchimera.azurecr.io/cccs/hogwarts/vault-ca:master_2921_22315d60 FROM $VAULT_CA_CONTAINER AS vault_ca -FROM uchimera.azurecr.io/cccs/superset-base:feature_CLDN-1541_20220822173221_b4624 +FROM uchimera.azurecr.io/cccs/superset-base:cccs-2.0_20220817191129_b4593 USER root From fe12203cab3ae349b0c8cab743edb9a3b4041ef8 Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Mon, 22 Aug 2022 15:25:40 -0400 Subject: [PATCH 07/11] Update superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx Co-authored-by: cccs-rc <62034438+cccs-rc@users.noreply.github.com> --- .../plugin-chart-application-links/src/ApplicationLinks.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx index c6b7322fe5285..d6015417b0da0 100644 --- a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx +++ b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx @@ -110,7 +110,7 @@ export default function ApplicationLinks(props: ApplicationsProps) {

Alfred has seen {appVal.length > 1 ? 'these' : 'this'}{' '} {infoType} - {appVal.length > 1 ? "'s" : ''} {alfredCount} time + {appVal.length > 1 ? "s" : ''} {alfredCount} time {alfredCount > 1 ? 's' : ''}. Search the{' '} Alfred From b10e661d250617be57e8165059e1c57cb24386e9 Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Mon, 22 Aug 2022 15:25:52 -0400 Subject: [PATCH 08/11] Update superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx Co-authored-by: cccs-rc <62034438+cccs-rc@users.noreply.github.com> --- .../plugin-chart-application-links/src/ApplicationLinks.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx index d6015417b0da0..ba62e7f34f7b0 100644 --- a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx +++ b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx @@ -121,7 +121,7 @@ export default function ApplicationLinks(props: ApplicationsProps) {

Alfred has not seen {appVal.length > 1 ? 'these' : 'this'}{' '} {infoType} - {appVal.length > 1 ? "'s" : ''}. Search the{' '} + {appVal.length > 1 ? "s" : ''}. Search the{' '} Alfred {' '} From 742edc6ec7f8e73df4f19c50416a8f2106f7ff76 Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Tue, 23 Aug 2022 08:18:37 -0400 Subject: [PATCH 09/11] [CLDN-1541] Changed the logic around creating the proper links/URL --- .../src/ApplicationLinks.tsx | 4 +--- superset/proxy/api.py | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx index ba62e7f34f7b0..9c22627aeeb08 100644 --- a/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx +++ b/superset-frontend/src/cccs-viz/plugins/plugin-chart-application-links/src/ApplicationLinks.tsx @@ -22,13 +22,11 @@ export default function ApplicationLinks(props: ApplicationsProps) { const link_formatter = () => { let tempString = ''; - if (appVal.length > 1) { + if (appVal.length > 0) { tempString = appVal[0]; for (let i = 1; i < appVal.length; i += 1) { tempString += `%22%2C%20%22${appVal[i]}`; } - } else if (appVal.length === 1) { - tempString = appVal[0]; } return tempString; }; diff --git a/superset/proxy/api.py b/superset/proxy/api.py index 2dfbfcd0808ad..c64b29f4a95e0 100644 --- a/superset/proxy/api.py +++ b/superset/proxy/api.py @@ -165,12 +165,10 @@ def get_userid(self, user_id: str, **_kwargs: Any) -> Response: user_emails = user_id.split(",") user_email_string = '' - if len(user_emails) > 1: + if len(user_emails) > 0: user_email_string = user_emails[0] for index in range(1, len(user_emails)): user_email_string += "%22%2C%20%22" + user_emails[index] - elif len(user_emails) == 1: - user_email_string = user_emails[0] url = ( self.ALFRED_URL @@ -199,12 +197,10 @@ def get_ipstring(self, ip_string: str, **_kwargs: Any) -> Response: user_ips = ip_string.split(",") user_ip_string = '' - if len(user_ips) > 1: + if len(user_ips) > 0: user_ip_string = user_ips[0] for index in range(1, len(user_ips)): user_ip_string += "%22%2C%20%22" + user_ips[index] - elif len(user_ips) == 1: - user_ip_string = user_ips[0] url = ( self.ALFRED_URL From 70166486a4fb9e96212ac098e40d611480c9c755 Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Tue, 23 Aug 2022 10:01:28 -0400 Subject: [PATCH 10/11] Temp update to img --- cccs-build/superset/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cccs-build/superset/Dockerfile b/cccs-build/superset/Dockerfile index cfe6ecc6f343d..543aa8039d6bb 100644 --- a/cccs-build/superset/Dockerfile +++ b/cccs-build/superset/Dockerfile @@ -1,7 +1,7 @@ # Vault CA container import ARG VAULT_CA_CONTAINER=uchimera.azurecr.io/cccs/hogwarts/vault-ca:master_2921_22315d60 FROM $VAULT_CA_CONTAINER AS vault_ca -FROM uchimera.azurecr.io/cccs/superset-base:cccs-2.0_20220817191129_b4593 +FROM uchimera.azurecr.io/cccs/superset-base:feature_CLDN-1541_20220823134845_b4653 USER root From b37bc8c9ebf985464c105f9695eca95cd028911e Mon Sep 17 00:00:00 2001 From: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com> Date: Tue, 23 Aug 2022 10:28:04 -0400 Subject: [PATCH 11/11] Undo temp img change --- cccs-build/superset/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cccs-build/superset/Dockerfile b/cccs-build/superset/Dockerfile index 543aa8039d6bb..cfe6ecc6f343d 100644 --- a/cccs-build/superset/Dockerfile +++ b/cccs-build/superset/Dockerfile @@ -1,7 +1,7 @@ # Vault CA container import ARG VAULT_CA_CONTAINER=uchimera.azurecr.io/cccs/hogwarts/vault-ca:master_2921_22315d60 FROM $VAULT_CA_CONTAINER AS vault_ca -FROM uchimera.azurecr.io/cccs/superset-base:feature_CLDN-1541_20220823134845_b4653 +FROM uchimera.azurecr.io/cccs/superset-base:cccs-2.0_20220817191129_b4593 USER root