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

Pass in a custom json as pipe to CLI commands #526

Closed
2 tasks
n-dusan opened this issue Sep 13, 2024 · 2 comments
Closed
2 tasks

Pass in a custom json as pipe to CLI commands #526

n-dusan opened this issue Sep 13, 2024 · 2 comments
Assignees
Labels

Comments

@n-dusan
Copy link
Contributor

n-dusan commented Sep 13, 2024

Example:

  • taf targets add-repo --path . badriver-nsn/law-rdf < custom.json --target-path ../../badriver-nsn/law-rdf

    • instead of taf targets add-repo --path . badriver-nsn/law-rdf --serve latest --type rdf --serve-prefix _rdf --role rdf --target-path ../../badriver-nsn/law-rdf
  • Update all other commands to use the pipe code (wherever we pass in a path to a file, such as keys-description.json)

More information in click docs and stackoverflow.

@n-dusan n-dusan added good first issue Good for newcomers security labels Sep 13, 2024
@renatav renatav self-assigned this Oct 9, 2024
@renatav renatav removed the good first issue Good for newcomers label Oct 10, 2024
@renatav
Copy link
Collaborator

renatav commented Oct 10, 2024

I've been looking into this and this is actually going to be really hard. The problem is that we have our yubikey prompts which don't work in combination with < and |. This is what happens:

Do you want to reuse already set up Yubikey? [y/N]: Aborted!

Standard Input Stream State: When a CLI function reads from stdin that has been redirected from a file (using <), it consumes all the input from that file. After the end of this input, stdin is considered exhausted and effectively closed from the perspective of awaiting further interactive input. This means no additional data can be read through standard input mechanisms like prompts directly within the same execution context or process flow.

I can refactor some of these commands to expect a config file, but it looks like supporting < would take a lot of work. I removed the good first issue label since this is far from trivial sadly.

@renatav renatav mentioned this issue Oct 16, 2024
6 tasks
@renatav
Copy link
Collaborator

renatav commented Oct 16, 2024

Partially addressed by merging #550, not worth fully implementing due to restrictions mentioned in the previous commit

@renatav renatav closed this as completed Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants