Skip to content

Commit

Permalink
Merge pull request #12 from william-cass-wright/readme
Browse files Browse the repository at this point in the history
readme updates and config handler
  • Loading branch information
will-wright-eng committed Jun 24, 2022
2 parents 0fa3396 + 6a7b6a3 commit 72d9ed5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
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()

0 comments on commit 72d9ed5

Please sign in to comment.