Skip to content

Hide passwords in repo path, fixing #58#66

Merged
emuell merged 3 commits intoemuell:masterfrom
nettnikl:fix-58
Jul 17, 2023
Merged

Hide passwords in repo path, fixing #58#66
emuell merged 3 commits intoemuell:masterfrom
nettnikl:fix-58

Conversation

@nettnikl
Copy link
Contributor

No description provided.

@emuell
Copy link
Owner

emuell commented Jul 13, 2023

Thanks for the contribution!

As the regex only applies to REST paths, I would move the regex replacement code into an if (appState.repoLocation.prefix == "rest") branch, also to document what it's trying to match.

The regex also won't match rest paths of the form https://user:pass@host:8000 (note the missing trailing /), but I'm not actually sure if restic allows them. But it won't match sftp path then either?

@nettnikl
Copy link
Contributor Author

nettnikl commented Jul 13, 2023

You're right, i didn't think about ports, will have to check. But you're right i'm missing quite a few test cases. Thin i was focusing on here wasmainly that we can have the protocol optional in the URL (diallowing the URL() from js).
Let's collect all cases interesting to blur out here, and then adjust.

@nettnikl
Copy link
Contributor Author

I actually tried to design it to work with any URL, rest but also sftp, ftps or any future URL like path. Ports and the whole path after the domain are now more leniently handled. Care to have a look?

@emuell emuell merged commit b912990 into emuell:master Jul 17, 2023
@emuell
Copy link
Owner

emuell commented Jul 17, 2023

Looks good to me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants