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

readme updates and config handler #12

Merged
merged 1 commit into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@
[![Tests](https://github.com/william-cass-wright/secrets-mgmt-cli/workflows/Test/badge.svg)](https://github.com/william-cass-wright/secrets-mgmt-cli/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/william-cass-wright/secrets-mgmt-cli/blob/master/LICENSE)

## Summary

- A simple CLI for managing secrets in AWS Secrets Manager
- [PyPI project](https://pypi.org/project/secrets-mgmt-cli/)
- Based on cookiecutter template [simonw/click-app](https://github.com/simonw/click-app)
- [PyPI project][2]
- Based on the following projects:
- cookiecutter template [simonw/click-app][3]
- AWS code sample [secretsmanager_basics.py][1]

[1]: https://docs.aws.amazon.com/code-samples/latest/catalog/python-secretsmanager-secretsmanager_basics.py.html
[2]: https://pypi.org/project/secrets-mgmt-cli/
[3]: https://github.com/simonw/click-app

## Installation
Install this tool using `pip`:
Expand Down Expand Up @@ -40,8 +48,3 @@ To run the tests:
```bash
pytest
```

## References
- heavily based on [secretsmanager_basics.py][1]

[1]: https://docs.aws.amazon.com/code-samples/latest/catalog/python-secretsmanager-secretsmanager_basics.py.html
8 changes: 8 additions & 0 deletions secrets_mgmt_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,13 @@ def formatted_print(self, key, val, n=20):
val = str(val)
print(key, (n - int(len(key))) * ".", val)

def get_configs(self):
if os.path.isfile(self.config_file_path):
return self.config.defaults()
else:
return None

def check_config_exists(self):
return os.path.isfile(self.config_file_path)

config_handler = ConfigHandler()