openziti / ziti-tunnel-sdk-c

Apache License 2.0
43 stars 17 forks source link

enroll: allow pipe redirects for input(jwt) output(identity) #168

Closed ekoby closed 3 years ago

ekoby commented 3 years ago

I believe this would be a more flexible approach than #160

the following patterns should be supported:

$ echo $ENROLL_JWT | ziti-edge-tunnel enroll -j - -i identity.json

$ ziti-edge-tunnel enroll -j <(echo $ENROLL_JWT) -i identity.json 
NicFragale commented 3 years ago

@qrkourier FYI

Voting YES for this to be done. Doing this aligns ZET with ZT in its ability to read from STDIN, but also (hopefully?) enables a FIFO PIPE to be used as well.

qrkourier commented 3 years ago

@ekoby I would love to have the option to pipe to stdin to enroll instead of reading from a JWT file. You're right, it would be more flexible. Looking at your second example with process substitution list as descriptor filename I don't believe any enhancements are necessary for that to work, and that's basically what @flouks and @NicFragale are looking for in both/all Linux tunnelers specifically for working within Docker container. The proposal is to allow a token value var to be preferred if present, and your second example is one way that could work.

ziti-edge-tunnel enroll -j <(echo $ENROLL_JWT) -i identity.json
NicFragale commented 3 years ago

Hi Team - What is the status of this functionality?

qrkourier commented 3 years ago

@NicFragale Not forgotten!

fullmetal-fred commented 3 years ago

Agreed on this approach vs #160. Let me know if I can assist here at all. Due to the way we're implementing, this feature would make our lives much much simpler!

qrkourier commented 3 years ago

I've implemented the stdin and env var methods of passing the token to ziti-edge-tunnel in a container in #185 .