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

Feature: Certificate passphrase check #238

Open
wants to merge 52 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d4e2a3f
Added skeleton of new object
danopt Aug 21, 2023
d274cd5
Revert commits
danopt Aug 28, 2023
a470fde
Revert commits
danopt Aug 28, 2023
c06d900
Corrected parameter
danopt Aug 28, 2023
0a2b827
Added parameter passphrase_check to module
danopt Aug 28, 2023
6dc347e
Catched wrong passphrases with an exception
danopt Aug 28, 2023
bb117f1
Added task in molecule tests for passphrase_check
danopt Aug 28, 2023
0bc0a59
Added condition to load certificate info only if passphrase_check is …
danopt Aug 28, 2023
7d3c4cb
Added condition to map certificate only if loaded
danopt Aug 28, 2023
6cd2807
Added passphrase_check parameter to molecule task
danopt Aug 28, 2023
d88212f
Added a condition to fail module if passphrase_check is false
danopt Aug 28, 2023
f39d88f
Set no_log for new parameter
danopt Aug 28, 2023
932b330
Privatized passphrase_check variable
danopt Aug 28, 2023
048704e
Privatized pkcs12_data variable
danopt Aug 28, 2023
da01eac
Added passphrase_check key value to result dict seeded for Ansible mo…
danopt Aug 28, 2023
0e81e58
Corrected key value for passphrase_check in results dict
danopt Aug 28, 2023
6267d87
Added task to molecule scenario to check correct passphrase in passph…
danopt Aug 28, 2023
ea70b6d
Set passphrase_check result if mode is disabled
danopt Aug 28, 2023
5b543cb
Only map certificate if passphrase_check mode is disabled
danopt Aug 28, 2023
630fb4a
Optimized code by 2 lines
danopt Aug 28, 2023
b3535e1
Added unit tests
danopt Aug 29, 2023
47b1f4d
Revert last commit
danopt Aug 30, 2023
0c50189
Redesigned checks in unit tests
danopt Aug 30, 2023
9b7ebbf
Typo
danopt Aug 30, 2023
8ce9d6a
Debug
danopt Aug 30, 2023
a78a42b
Debug
danopt Aug 30, 2023
64eb7c9
Debug
danopt Aug 30, 2023
a4e27b8
Debug
danopt Aug 30, 2023
521be99
Debug
danopt Aug 30, 2023
ceacd1d
Fixed argument check
danopt Aug 31, 2023
e25fe8f
Removed print statement
danopt Aug 31, 2023
70d8dce
Removed redundant exceptions in cert_info module
danopt Aug 31, 2023
fbe5871
Test functionallity of unit test again
danopt Aug 31, 2023
e6b11f3
Removed debug test
danopt Aug 31, 2023
a8a8258
Merge branch 'main' into feature/crt_passphrase_check
danopt Aug 31, 2023
e85a6b8
Added documentation for new parameter
danopt Aug 31, 2023
562801b
Merge branch 'feature/crt_passphrase_check' of github.com:NETWAYS/ans…
danopt Aug 31, 2023
3d61904
Updated plugins overview
danopt Aug 31, 2023
002f6d2
Fixed typo
danopt Aug 31, 2023
8773c07
Fixed typo
danopt Aug 31, 2023
1ed7144
Fixed typo
danopt Aug 31, 2023
75a64bb
Fixed typo
danopt Aug 31, 2023
6ef199c
Fixed typo
danopt Aug 31, 2023
1005029
Typo - Update README.md
danopt Sep 11, 2023
e2fab52
Added comment to unit tests
danopt Sep 11, 2023
c01a203
Merge branch 'main' into feature/crt_passphrase_check
danopt Sep 25, 2023
7f7ce15
Added merge_group to GitHub Action
danopt Sep 28, 2023
ebc2249
Merge branch 'feature/crt_passphrase_check' of github.com:NETWAYS/ans…
danopt Sep 28, 2023
0a22093
Merge branch 'main' into feature/crt_passphrase_check
danopt Oct 10, 2023
d70cb58
Specified branch in merge_group
danopt Oct 10, 2023
69ac901
Removed merge_group from test_plugins.yml
danopt Oct 10, 2023
3b538d2
Merge branch 'main' into feature/crt_passphrase_check
danopt Dec 4, 2023
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
Prev Previous commit
Next Next commit
Test functionallity of unit test again
danopt committed Aug 31, 2023
commit fbe587196e424b79bd4088b74ea0915d19021ca4
6 changes: 3 additions & 3 deletions tests/unit/plugins/modules/test_cert_info.py
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ def exit_json(*args, **kwargs):
checks_passed = True

# only if passphrase_check mode is disabled
if args[0].params['passphrase_check'] is False:
if args[0].params['passphrase_check'] is not True:
# check every item in certificate if it matches with the result
# and if that fails, don't catch the Exception, so the test will fail
for item in certificate:
@@ -82,10 +82,10 @@ def exit_json(*args, **kwargs):
# if passphrase_check mode is enabled
else:
# fail checks, if passphrase is wrong and passphrase_check kwarg is not False
if args[0].params['passphrase'] == 'PleaseChangeMe-Wrong' and kwargs['passphrase_check'] is not False:
if args[0].params['passphrase'] == 'PleaseChangeMe-Wrong' and kwargs['passphrase_check'] is True:
checks_passed = False
# fail checks, if passphrase is correct and passphrase_check kwarg is not True
if args[0].params['passphrase'] == 'PleaseChangeMe' and kwargs['passphrase_check'] is not True:
if args[0].params['passphrase'] == 'PleaseChangeMe' and kwargs['passphrase_check'] is not False:
checks_passed = False

if checks_passed: