Granitosaurus / xonsh-autoxsh

Automatically execute scripts for directories in Xonsh Shell.
GNU General Public License v3.0
15 stars 7 forks source link

Add checking md5 of .autoxsh file #9

Open anki-code opened 3 years ago

anki-code commented 3 years ago

Hi! Great xontrib!

To increase security:

  1. Save md5 hash and approval date of .autoxsh file with the path
  2. Check md5 hash before running
  3. If there is mismatch of hash then show prompt: with the time of change, the way to see the diff.

Example:

cd /project
# The autoxsh file in this directory was approved 2 months ago but was changed 5 days ago. 
# What's next? [Approve / Decline / Show diff / Skip autoxshing]

Thanks!