hughhhh commented on code in PR #45890:
URL: https://github.com/apache/superset/pull/45890#discussion_r4448024228


##########
superset-frontend/src/features/databases/DatabaseModal/index.tsx:
##########
@@ -552,11 +559,23 @@ export function dbReducer(
       return {
         ...trimmedState,
       };
-    case ActionType.EditorChange:
-      return {
+    case ActionType.EditorChange: {
+      const edited = {
         ...trimmedState,
         [action.payload.name]: action.payload.json,
       };
+      if (
+        action.payload.name === 'masked_encrypted_extra' &&
+        edited.parameters?.embedded_credentials

Review Comment:
   > [!NOTE]
   > 🤖 **Claude Opus 5.5 responding on behalf of Hugh (hughhhh)**
   
   Yes, it should clear both. Fixed in d1272877ed, and the same change is on 
#45870 in f02cc08e08. The reducer now drops `parameters.oauth2_client_info` as 
well as `parameters.embedded_credentials` on a Secure Extra edit, and the 
reducer test covers both. One tradeoff: any edit in that editor discards values 
typed but not yet saved in those two sections, even if the edit touches an 
unrelated key. The sections then show what's in Secure Extra, so the change is 
visible.



##########
superset-frontend/src/components/ImportModal/index.tsx:
##########
@@ -351,20 +351,39 @@ export const ImportModal: 
FunctionComponent<ImportModelsModalProps> = ({
                   {field.label}
                   <span className="required">*</span>
                 </div>
-                <Input.Password
-                  name={`encrypted-extra-${fileName}-${field.path}`}
-                  value={encryptedExtraSecrets[fileName]?.[field.path] || ''}
-                  onChange={event =>
-                    setEncryptedExtraSecrets({
-                      ...encryptedExtraSecrets,
-                      [fileName]: {
-                        ...encryptedExtraSecrets[fileName],
-                        [field.path]: event.target.value,
-                      },
-                    })
-                  }
-                  data-test="encrypted_extra_secret"
-                />
+                {/* A PEM key is unusable without its newlines. */}
+                {/private_?key(_body)?$/.test(field.path) ? (

Review Comment:
   > [!NOTE]
   > 🤖 **Claude Opus 5.5 responding on behalf of Hugh (hughhhh)**
   
   Yes, and I need to correct my earlier reply, which said the `ImportModal` 
change also covered database import prompts. It didn't. Fixed in d1272877ed, 
and the same change is on #45870 in f02cc08e08. `encryptedExtraNeededField` now 
uses `renderAsTextArea` for the same paths through a shared `isPrivateKeyField` 
helper. I haven't added a render test for this field, because the 
`DatabaseModal` render tests can't run in my local setup. The SSH tunnel 
private key input in this modal is also single-line. That predates this PR, so 
I left it as a follow-up.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to