17526: Remove redundant user/pass from webdav wget tab and add curl command
authorStephen Smith <stephen@curii.com>
Thu, 29 Jul 2021 15:07:14 +0000 (11:07 -0400)
committerStephen Smith <stephen@curii.com>
Thu, 29 Jul 2021 15:07:14 +0000 (11:07 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx

index 7255e756ce2919fbd8c17b5db96507234e25e0de..49283813eade8b7c09b0a5aaf6b43b29bebf556a 100644 (file)
@@ -148,6 +148,7 @@ export const WebDavS3InfoDialog = compose(
         }
 
         const wgetCommand = `wget --http-user=${props.data.username} --http-passwd=${props.data.token} --mirror --no-parent --no-host --cut-dirs=0 ${winDav.toString()}`;
+        const curlCommand = `curl -O -u ${props.data.username}:${props.data.token} ${winDav.toString()}<FILENAME>`;
 
         return <Dialog
             open={props.open}
@@ -270,14 +271,12 @@ export const WebDavS3InfoDialog = compose(
                     </DetailsAttribute>
 
                     <DetailsAttribute
-                        label='Username'
-                        value={props.data.username}
-                        copyValue={props.data.username} />
-
-                    <DetailsAttribute
-                        label='Password'
-                        value={props.data.token}
-                        copyValue={props.data.token} />
+                        label='Curl command'
+                        copyValue={curlCommand}
+                        classValue={props.classes.detailsAttrValWithCode}>
+                        <DefaultCodeSnippet
+                            lines={[curlCommand]} />
+                    </DetailsAttribute>
 
                 </TabPanel>