GC-17: Removed redundant tests, cleaned-up tests for commands module and fixed wrong directory used for outputting server artifacts in server command:
- Removed CLI tests that check if command errors-out in case the hierarchy has already been initialised (for init command) or has not been initialised (for server command). These are part of commands module tests already. - Removed unnecessary changing of directory within the commands tests. - Fixed issue where server artifacts paths are not calculated correctly when writing them out (parent directory was not part of path).
GC-17: Deduplicate exits in command wrapper functions:
- Move all calls to exit to the main function. - Update signature of all wrapper functions to return status code. - Update a couple of CLI tests to not fail due to systemexit being thrown (instead of mocking away too much).
GC-17: Refactored calls to help and usage printing functions:
- Introduced distinct help/usage functions in commands module. - Wrap the help/usage in similar way to existing commands. - Added unit tests for new commands and their invocation from CLI.
GC-17: Refactored server command to handle output and return exit code:
- Updated server command to return just a status code. - Updated existing code and tests that call out to the server command to use correct function signature. - Moved output from cli module to commands module. - Updated existing tests for the server command to test for output being produced in correct streams.
GC-17: Refactored init command to handle output and return exit code:
- Introduced a holder class for command exit codes. - Moved output for the cli module to commands module. - Implemented new tests for verifying the command output. - Updated existing tests for verifying return value of command output. - Updated existing code and tests to use the new signature for init command.
GC-15: Prevent server command from overwriting artifacts and clean-up incorrect CLI tests:
- Added functional test for scenario where a server certificate has already been issued. - Updated server certificate issuance command not to overwrite the artifacts. - Fixed a couple of both server and init tests related to CLI parsing to not create artifacts unless necessary, and if necessary to create artifacts in temporary (test) directory. Otherwise intermittent failures will happen.
GC-15: Added user documentation for the server command:
- Updated quickstart section to include samples for issuing server certificates. - Updated the initialisation section to mention creation of directory used for storing server private keys and certificates. - Added new section covering command for issuing server certificates.
GC-15: Implemented functionality for including extra DNS names in server certificates:
- Added functional test covering the new scenario. - Updated invocations of relevant commands in existing code to pass-in the list of extra DNS names where appropriate. - Updated server command and high-level function for issuing server certificates to accept list of additional DNS subject alternative names to include in certificate. - Fixed existing unit tests. - Added additional unit tests that cover the new function.
GC-15: Implemented functionality for issuing a server certificate:
- Added functional test covering the user scenario. - Updated CLI implementation to show user message about issued server artifacts. - Implemented functionality in the server command. - Fixed a small typo in docstring for issue_certificate function. - Implemented high-level crypto function for issuing server certificates. - Implemented additional storage functions for reading an entire CA hierarchy, individual private keys, and individual certificates. - Implemented the necessary unit tests covering newly implemented code.
GC-15: Implemented scenario for server certificate issuance where user has not initialised the CA hierarchy:
- Added functional test that tests if correct error is shown to user in case he/she has not initialised the CA hierarchy. - Introduced new function to check if storage is initialised. - Added initial simplified server command implementation.
GC-14: Cleaned-up testing and development configuration and documentation:
- Enforce 100% coverage in tests (fail the tests otherwise). - Updated development documentation to list: - How to run tests with coverage. - How to generate coverage in html format. - How to build documentation. - What tests are included when running test via tox. - Default to running just the unit tests when not passing in any arguments to pytest. - Removed use of pytest-flake8. - Do not run coverage tests by default outside of tox. - Ensure documentation is built inside of tox environment, and that it does not pollute the source directory. - Have all Python interpreters specified in same section in tox configuration file.
GC-3: Added usage instructions to documentation for init command:
- Added beginnings of a quickstart section. - Added more detailed description on how initialisation behaves, what it generates and how, and what options can be provided.
GC-3: Implement option for specifying CA hierarchy depth during initialisation:
- Minor fix for option checks to make the more reliable (for short flags). - Added functional test for initialising a CA hierarchy with custom depth. - Added option for specifying the CA hierarchy depth (defaults to 1). - Updated the init command to accept and process the CA hierarchy depth option correctly. - Updated function used for issuing certificates to accept list of extensions to be added to certificate. - Updated function used for generating the CA hierarchy to add the CA basic constraint extension.
GC-3: Added ability to provide custom CA base name to init command:
- Added functional test to cover the new scenario (providing CA base name). - Updated init command to accept the CA base name to be used when constructing the CA subject DN. - Updated the existing tests to pass-in the CA base name explicitly. - Updated the CLI code to allow for user to pass-in the CA base name via option (both short and long form available).
GC-3: Updated init command to avoid errors and overwrites on already initialised directories:
- Added functional test covering the scenario where user has already initialised the directory and is re-running the tool. - Updated the init command to return status based on whether the directory is already initialised or not. - Implemented unit tests.
GC-3: Add example for init command to CLI help and fix formatting:
- Updated CLI help to include example on initialising the CA hierarchy. - Use formatter class that preserves description formatting (otherwise everything ends-up in a single paragrpah).
GC-3: Refactored main functionality of the init command into separate function:
- Introduced a new module (commands) where the majority of command implementation should reside. - The cli module should now be a thin wrapper around commands, in charge of processing input system arguments. - Refactored the tests accordingly.
- Added functional test for initialising hierarchy on a fresh directory. - Implemented the init command. - Added two new modules for working with storage and crypto. - Added cryptography (for certificate issuance and crypto) and python-dateutil (for better handling of certificate validities) as installation dependencies. - Added freezegun as test dependency (helps with testing validity dates). - Implemented necessary unit tests.
- Updated functional test for checking on the help subcommand as well. - Implemented the 'help' subcommand. - Updated required function signature for the subcommand_parser decorator (functions should return ArgumentParser instance). - Fixed a typo in inline documentation. - Updated the test for subcommand_parser decorator to be a more robust when checking if function registration works.
- Added terse description to the CLI. - Implemented small mechanism for invoking callback functions attached to parser. - Fixed some linting issues in setup script.
- Register entry point in the package setup script. - Implemented a very basic main function as entry point that constructs an empty argument parser. - Implemented functional test for testing if the CLI tool gets invoked correctly after installation. - Added unit tests for implemented functionality.
- Updated package manifest file to include the flake8 configuration file in generated source distribution. - Set the maximum line length limit to 160 characters.
GC-2: Added coverage configuration and updated manifest file:
- Include only the actual module files in the coverage reporting. - Addd comments to gitignore file. - Updated gitignore file to exclude test artefacts. - Updated manifest file to include documentation files, as well as test configuration file. - Added pytest configuration file that ensures coverage plugin is enabled and that report is stored in html format in the coverage directory.
- Updated gitignore to exlude some of the build and Python artefacts. - Added manifest file, including a number of files that are not normally being distributed. - Created setup.cfg that overrides default command for running tests. - Added initial setup.py.
GC-2: Adding initial documentation skeleton with some basic information about the project:
- Added basic documentation describing the project. - Updated gitignore file to ensure documentation build artifacts stay out of the repository. - README file placed at top directory for convenient access.