Skip to content
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

fix:read spaces in secretPath #206

Conversation

shafiqihtsham
Copy link

@shafiqihtsham shafiqihtsham commented Jun 14, 2024

Description

When creating a secret, secretPaths should be able to handle spaces and not throw an error.
Screenshot_20240614_105733

Issues Fixed

Tasks

  • 1. Support spaces within secret paths.
  • 2. Added tests testing this functionality.

Final checklist

  • Domain specific tests
  • Full tests
  • Updated inline-comment documentation
  • Lint fixed
  • Squash and rebased
  • Sanity check the final build

@shafiqihtsham shafiqihtsham marked this pull request as draft June 14, 2024 10:55
@CMCDragonkai
Copy link
Member

Why was this closed @shafiqihtsham

@shafiqihtsham
Copy link
Author

shafiqihtsham commented Jun 17, 2024

I closed this PR because I was confused on the exact requirements the issue was asking for specifically what characters we should allow on the paths. Also I wasn't too sure if someone else was going to work on this as I didn't formally ask to be assigned to it.

I can reopen and work on it again as well as implement the needed fast check test, but I need help understanding what you meant by "least common characters" as to my understanding Unix only forbids / in paths where for Windows its
< > : " / \ | ? * . @CMCDragonkai

@CMCDragonkai
Copy link
Member

LCD - lowest common denominator I think I was referencing that. "least" is not the right word here.

How about the "common set of characters" between all 3 operating systems allowed in a file path/name.

@CMCDragonkai
Copy link
Member

But one has to fast check this, and also deal with "ingress" - which is relevant to #32.

@tegefaulkes
Copy link
Contributor

I'm going to re-open this. I don't want it to get lost in the issue tracker.

@tegefaulkes tegefaulkes reopened this Jun 17, 2024
@tegefaulkes
Copy link
Contributor

Two things to address still

  1. Make sure the regex matches the unix defined path format.
  2. Add a fast check test for the parser along with a fast check test for end to end creating and getting secrets with a generated secret name.

@tegefaulkes
Copy link
Contributor

Looking into it, it seems that unix file names are very permissive. They allow everything except null and /. I did some testing and found that isometric-git is a bit indiscriminate between / and \ so we can't allow either of these as part of the file name.

So I'm changing the allowable file path to be ([^\0\\]+) and I'm adding a fast-check test for testing it. The test is end to end create and read a secret with a generated secret path. It's slow so I'm limiting the runs to 5.

@tegefaulkes
Copy link
Contributor

Oh, this PR is forked off of Polykey-cli I'm going to make a new branch to address this.

@tegefaulkes
Copy link
Contributor

Superseded by #217

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

Successfully merging this pull request may close these issues.

Support spaces in secret paths
3 participants