-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add password prompt fallback and stdin handling for envcrypt #79
Conversation
- envcrypt: Added a fallback to prompt for passwords when stdin is a terminal. - Updated input file rules for encrypted `.env` handling - Replacing `/`-based paths with `@` prefix for file reading. - Updated documentation to reflect encrypted environment file usage and compatibility.
Reviewer's Guide by SourceryThis pull request introduces a fallback password prompt for the Sequence diagram for password handling in envcryptsequenceDiagram
actor User
participant Envcrypt
participant FileSystem
participant Terminal
alt Password provided via command line
User->>Envcrypt: Run with -P/--password
Envcrypt->>Envcrypt: Use provided password
else Password from environment
User->>Envcrypt: Run with -E/--environ
Envcrypt->>Envcrypt: Read from environment variable
else Password from file
User->>Envcrypt: Run with -F/--file @filepath
Envcrypt->>FileSystem: Read password from file
FileSystem-->>Envcrypt: Return password
else No password provided and stdin is terminal
User->>Envcrypt: Run without password
Envcrypt->>Terminal: Prompt for password
Terminal-->>User: Display password prompt
User->>Terminal: Enter password
Terminal-->>Envcrypt: Return password
end
Envcrypt->>Envcrypt: Process encryption/decryption
State diagram for envcrypt password resolutionstateDiagram-v2
[*] --> CheckPasswordSource
CheckPasswordSource --> DirectPassword: -P/--password
CheckPasswordSource --> EnvVarPassword: -E/--environ
CheckPasswordSource --> FilePassword: -F/--file
CheckPasswordSource --> CheckStdin: No password source
CheckStdin --> PromptPassword: stdin is terminal
CheckStdin --> Error: stdin is not terminal
DirectPassword --> ProcessOperation
EnvVarPassword --> ProcessOperation
FilePassword --> ProcessOperation
PromptPassword --> ProcessOperation
ProcessOperation --> [*]
Error --> [*]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @deeprave - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🟡 Security: 1 issue found
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
.env
handling/
-based paths with@
prefix for file reading.Summary by Sourcery
Add support for encrypted environment files and a password prompt fallback for the
envcrypt
utility.New Features:
.env.enc
extension. Theenvcrypt
utility encrypts and decrypts environment files.envcrypt
to prompt for the password when stdin is a terminal.Tests:
.env
handling.