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

Feat - Allowing raw_input and timestamp flags #73

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

1griffy
Copy link
Contributor

@1griffy 1griffy commented Apr 23, 2023

As of now the cli only accepts file input
However for usablility sake, users should also be allowed to pass simple command line input

A useful feature could be if users can timestamp as input i.e. allow decrypt only after new year 2024

This PR aims to add that

@1griffy 1griffy changed the title Allow Raw input to be accepted Feat - Allowing raw_input and timestamp flags Apr 23, 2023
Copy link
Contributor

@CluEleSsUK CluEleSsUK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for your first contribution!
I definitely agree with the change in spirit and the PR looks pretty close, but could you address the following:

  • add a few unit tests around the flag combos to make sure they work
  • add a few e2e tests for the CLI in tlock_test.go
  • run golangci-lint run --fix over everything (you may have already done this!)

@AnomalRoil
Copy link
Member

The current CLI supports stdin input:

echo "hello 24th" | tle -e -D 1m -a

works on my machine and gives me:

-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHRsb2NrIDE1NDcwMTQgZGJkNTA2ZDZl
Zjc2ZTVmMzg2ZjQxYzY1MWRjYjgwOGM1YmNiZDc1NDcxY2M0ZWFmYTNmNGRmN2Fk
NGU0YzQ5MwpvaHh6Q2c2M204UHNWNUhLUWN5dmNaeHd6R2x1TW4vVkIxblo2Yzhq
YXhNSXUvdS9seUpmc0hBNzdPaUZIN3YyCkdMT3N2VTZMcTdUNEdoV3MzSFRqTC9U
dWM0Y3BWRkhzWVhKUDlqcXcreDRET1hadmp4WXBHMDdFdjdlNVdnaEMKQlI3ZUtz
N0NUc01XbHFtUUx6QzFvWkxjenl1N3NCY0crZUc5enpTTVZDOAotLS0gQ0ZoRFY3
a093dEhCL3poZTJ4RXlteFI2bEdLdkZNYzBLZkZXUHFjM2hjZwqqcqLQ4Xg/xIrz
xSPBM6rWk4g0g2nRbWVXtGMIPU0PAXu7uEPU7+wxAM5O
-----END AGE ENCRYPTED FILE-----

which correctly decrypts too:

echo """-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHRsb2NrIDE1NDcwMTQgZGJkNTA2ZDZl
Zjc2ZTVmMzg2ZjQxYzY1MWRjYjgwOGM1YmNiZDc1NDcxY2M0ZWFmYTNmNGRmN2Fk
NGU0YzQ5MwpvaHh6Q2c2M204UHNWNUhLUWN5dmNaeHd6R2x1TW4vVkIxblo2Yzhq
YXhNSXUvdS9seUpmc0hBNzdPaUZIN3YyCkdMT3N2VTZMcTdUNEdoV3MzSFRqTC9U
dWM0Y3BWRkhzWVhKUDlqcXcreDRET1hadmp4WXBHMDdFdjdlNVdnaEMKQlI3ZUtz
N0NUc01XbHFtUUx6QzFvWkxjenl1N3NCY0crZUc5enpTTVZDOAotLS0gQ0ZoRFY3
a093dEhCL3poZTJ4RXlteFI2bEdLdkZNYzBLZkZXUHFjM2hjZwqqcqLQ4Xg/xIrz
xSPBM6rWk4g0g2nRbWVXtGMIPU0PAXu7uEPU7+wxAM5O
-----END AGE ENCRYPTED FILE-----""" | tle -d

cmd/tle/commands/commands.go Outdated Show resolved Hide resolved
@1griffy 1griffy requested review from AnomalRoil and CluEleSsUK May 1, 2023 05:29
tlock_test.go Outdated Show resolved Hide resolved
@1griffy 1griffy requested a review from CluEleSsUK May 1, 2023 10:05
Copy link
Member

@AnomalRoil AnomalRoil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost ready!

cmd/tle/commands/commands.go Outdated Show resolved Hide resolved
cmd/tle/commands/encrypt.go Outdated Show resolved Hide resolved
1griffy and others added 2 commits May 9, 2023 23:55
@1griffy 1griffy requested a review from AnomalRoil May 9, 2023 18:26
@1griffy
Copy link
Contributor Author

1griffy commented Jun 14, 2024

Following up on this one - if you need this I can resolve the conflicts

@CluEleSsUK
Copy link
Contributor

sorry this slipped through the net - if you could resolve the conflicts we'll get it merged asap!

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.

3 participants