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

Added timeout option to authentication module #48

Merged
merged 2 commits into from
Jan 11, 2023
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
5 changes: 5 additions & 0 deletions docs/cyberark_authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ options:
cyberark_session:
description:
- Dictionary set by a CyberArk authentication containing the different values to perform actions on a logged-on CyberArk session.
timeout:
type: int
default: 10
description:
- Allows you set a timeout for when your authenticating to Cyberark
```
## Example Playbooks

Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace: "cyberark"
name: "pas"
version: "1.0.15"
version: "1.0.16"
readme: README.md
authors:
- CyberArk Business Development (@cyberark-bizdev)
Expand Down
8 changes: 8 additions & 0 deletions plugins/modules/cyberark_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
different values to perform actions on a logged-on CyberArk
session.
type: dict
timeout:
description:
- Allows you set a timeout for when your authenticating to Cyberark
type: int
"""

EXAMPLES = """
Expand Down Expand Up @@ -171,6 +175,8 @@ def processAuthentication(module):

concurrentSession = module.params["concurrentSession"]

timeout = module.params["timeout"]

# if in check mode it will not perform password changes
if module.check_mode and new_password is not None:
new_password = None
Expand Down Expand Up @@ -240,6 +246,7 @@ def processAuthentication(module):
headers=headers,
data=payload,
validate_certs=validate_certs,
timeout=timeout,
)

except (HTTPError, HTTPException) as http_exception:
Expand Down Expand Up @@ -336,6 +343,7 @@ def main():
"default": "present",
},
"cyberark_session": {"type": "dict"},
"timeout": {"default": 10, "type": "int"},
}

# cyberark and radius -> mutually_exclusive is cyberark and ldap
Expand Down