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

Implement secrets ls command #245

Closed
tegefaulkes opened this issue Jul 11, 2024 · 8 comments
Closed

Implement secrets ls command #245

tegefaulkes opened this issue Jul 11, 2024 · 8 comments
Assignees
Labels
development Standard development

Comments

@tegefaulkes
Copy link
Contributor

Specification

The secrets ls command will list the contents of a directory.

There are 3 main features to support here.

  1. List directory normally
  2. List in list format -l
  3. Include hidden files with -a
  4. Paths can support wildcards and globing.
  5. Multiple paths can be specified.
  6. stdin is ignored
Polykey/tmp/asd on  staging [?] 
❯ ls
asdasd  best  dir1  dir2  one  test  two

Polykey/tmp/asd on  staging [?] 
❯ ls -l
total 32
-rw-r--r-- 1 brian operators  8 Jul 11 11:18 asdasd
-rw-r--r-- 1 brian operators 15 Jul 11 11:18 best
drwxr-xr-x 2 brian operators  2 Jul 11 11:19 dir1
drwxr-xr-x 2 brian operators  2 Jul 11 11:19 dir2
-rw-r--r-- 1 brian operators  0 Jul 11 11:18 one
-rw-r--r-- 1 brian operators  5 Jul 11 11:18 test
-rw-r--r-- 1 brian operators  0 Jul 11 11:18 two

Polykey/tmp/asd on  staging [?] 
❯ ls -a
.  ..  asdasd  best  dir1  dir2  .hidden  one  test  two

Polykey/tmp/asd on  staging [?] 
❯ ls *est
best  test

Polykey/tmp/asd on  staging [?] 
❯ ls **/*     
asdasd  best  dir1/a  dir2/b  dir2/c  one  test  two

dir1:
a

dir2:
b  c

Polykey/tmp/asd on  staging [?] 
❯ ls -l **/*
-rw-r--r-- 1 brian operators  8 Jul 11 11:18 asdasd
-rw-r--r-- 1 brian operators 15 Jul 11 11:18 best
-rw-r--r-- 1 brian operators  0 Jul 11 11:42 dir1/a
-rw-r--r-- 1 brian operators  0 Jul 11 11:43 dir2/b
-rw-r--r-- 1 brian operators  0 Jul 11 11:43 dir2/c
-rw-r--r-- 1 brian operators  0 Jul 11 11:18 one
-rw-r--r-- 1 brian operators  5 Jul 11 11:18 test
-rw-r--r-- 1 brian operators  0 Jul 11 11:18 two

dir1:
total 1
-rw-r--r-- 1 brian operators 0 Jul 11 11:42 a

dir2:
total 1
-rw-r--r-- 1 brian operators 0 Jul 11 11:43 b
-rw-r--r-- 1 brian operators 0 Jul 11 11:43 c

❯ ls **/*
asdasd  best  dir1/a  dir2/b  dir2/c  one  test  two

dir1:
a

dir2:
b  c

Additional context

Related #32

Tasks

  1. Implement secrets ls command
  2. Support the default format.
  3. Support the list -l format
  4. Files and directory's that start with . should be hidden unless -a is used.
  5. Support wild cards and globing.
  6. Support specifying multiple paths.
  7. Seamlessly support using normal and secret paths.
@tegefaulkes tegefaulkes added the development Standard development label Jul 11, 2024
Copy link

linear bot commented Jul 11, 2024

@CMCDragonkai
Copy link
Member

Although the EFS (based on VFS) fully supports file permissions, it sort of meaningless in the context of Polykey. Furthermore the user is always root.

So in a way I'm not sure if we should fully replicate the the whole unix permission and user output that ls normally does as it assumes am multi-user unix system.

That being said, maintaining similar textual format makes it easier to pipe into other commands. One might just default to rwxrwxrwx... etc.

@aryanjassal
Copy link
Member

aryanjassal commented Sep 10, 2024

The command now lists contents based on the directory name instead of listing all the files by default. The remaining tasks will be tracked by #278 (comment) (ENG-406).

Copy link
Member

What do you mean based on directory name? It should also list all files right?

@aryanjassal
Copy link
Member

If you pass in a directory name, then it will list all contents of that directory, instead of listing all the files that exist in the vault, which was the behaviour of the old polykey secrets list

@CMCDragonkai
Copy link
Member

Are you also removing the old list command too? I don't want those vestigial commands left around.

@aryanjassal
Copy link
Member

aryanjassal commented Sep 11, 2024 via email

@CMCDragonkai
Copy link
Member

Great!

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

No branches or pull requests

3 participants