1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
Commit graph

10 commits

Author SHA1 Message Date
Pierre Dumuid
ca5a2b291a
Bugfix keycloak client do not report changes when there is none (#3610)
* KeycloakClientDiffBugs - Introduce test that passes.

* KeycloakClientDiffBugs - Add test to show that checking of redirect_uri's fails.

* KeycloakClientDiffBugs - (Fix1) Update so that checking of `redirectUris` no longer shows a change.

* KeycloakClientDiffBugs - Add test to show that checking of attributes's fails (sorting issue)

* KeycloakClientDiffBugs - (Fix2) Update so that checking of `attributes` no longer shows a change.

* KeycloakClientDiffBugs - Add test to show that checking of protocol_mappers's fail

* KeycloakClientDiffBugs - (Fix3) Update so that checking of `protocol_mappers` no longer shows a change when there is none.

* Introduce code fragment.

* Update the changelog to be based on the PR instead of the issue.

* Fix the readme

* Fix yaml indentation.

* Fix pep8

* Update changelogs/fragments/3610-fix-keycloak-client-diff-bugs-when-sorting.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/3610-fix-keycloak-client-diff-bugs-when-sorting.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/identity/keycloak/keycloak_client.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Remove need for .copy() after making normalise_cr not mutate the dict.

Co-authored-by: Pierre Dumuid <pierre@knowyourdata.com.au>
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-10-30 08:18:31 +02:00
Pierre Dumuid
996dc617ed
Keycloak module cleanup and consistency (#3280)
* Consistent Modules - Rename updated_?? to desired_?? in all the keycloak modules.

* Consistent Modules - Rename the comments, and add whitespace so that all the modules are a lot more consistent between each other.

* Consistent Modules - Remove final elif where a final else doesn't exist.

This is to address the inconsistency between the other modules.

Whilst I can see it being more descriptive, there should be a final "else:" to cater if the values is neither 'absent' or 'present'.

* Consistent Modules - Use dict() instead of {} like most of the other keycloak modules.

* Consistent Modules - Update keycloak authentication so that the if ordering is consistent for no-item.

* Consistent Modules - Move the 'Filter and map' process to always occur before getting an existing item.

* Consistent Modules - Be consistent with how to initialse before_?? and set it to dict() if it is None.

* Consistent Modules - Add module.exit_?? in the locations as per the other modules.

* Consistent Modules - Represent result['diff'] using dict(before=.., after=...) as per all the other modules.

* Consistent Modules - Add / Move location of when result['end_state'] is getting defined.

* Consistent modules - Add result['changed'] = False where we do nothing and exit because item exists.

* Consistent Modules - Set the value result['changed'] to True earlier so it shows up when in checking mode only.

* Consistent Modules - test for equality with a dict to assert there was no realm in the first place as per the other modules.

* Consistent Modules - Address the spelling.

* Consistent Modules - keycloak_group - Remove result['group'] as result['end_state'] is the consistent value used in the other modules.

* Consistent Modules - Order the lines in the section, Do nothing and exit consistently.

* Consistent Modules - Add result['end_state'] and still add deprecated `flow` return value.

* Consistent Modules - Add missing return documentation for `msg`.

* Consistent Modules - Tweak whitespace in the RETURN variable.

* Consistent Modules - Add result['group'] in addition to deprecated result['group'] response.

* Consistent Modules - Add return property, 'contains' to address test errors.

* Consistent Modules - Rename updated_?? to desired_?? in new modules since initial PR.

* Consistent Modules - Rename the comments, and add whitespace so that all the (recently added) modules are a lot more consistent between each other.

* Consistent Modules - Make indentation consistent within the response document.

* Consistent Modules - Use B(DEPRECATED) in a seperate line in the description.

* Consistent Modules - Add a lot of full stops to sentences.

* Consistent Modules - Use C(...) and I(...) formatting methods.

* Consistent Modules - Use "on success" everywhere for end_state response documentation.

* Consistent Modules - Update the documents for RETURN.proposed, RETURN.existing, RETURN.end_state to be the same.

* Consistent Modules - Add fragment.

* Remove period after short_description.

* Update changelog fragment.

* Consistent Modules - PRFeedback - Remove `module.exit_json(**result)` within the `Delete` section of the if statement.

There's a exit_json(..) immediately after.

* Consistent Modules - PRFeedback - Use `if not x_repr` instead of `if x_repr == dict()`.

* keycloak_authentication - Add a sample of the output.

* Replace `dict()` with `{}` for all the keycloak modules.

* Add the requested deprecated notices

* Update changelogs/fragments/3280-keycloak-module-cleanup-and-consistency.yml

Co-authored-by: Pierre Dumuid <pierre@knowyourdata.com.au>
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-10-22 07:57:18 +02:00
Gaetan2907
1b80a9c587
Add option to the keycloak_client module (#2949)
* Add authentication_flow_binding_overrides option to the keycloak_client module

* Add changelog fragment

* Update changelogs/fragments/2949-add_authentication-flow-binding_keycloak-client.yml

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update plugins/modules/identity/keycloak/keycloak_client.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update plugins/modules/identity/keycloak/keycloak_client.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Add unit test authentication_flow_binding_overrides feature on keycloak_client module

Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-07-09 08:33:35 +02:00
Gaetan2907
6ab9b05da3
Allow keycloak modules to take token as parameter for the auth. (#2250)
* Allow keycloak_group.py to take token as parameter for the authentification

* Fix some pep8 issues

* Add changelog fragment

* Refactor get_token to pass module.params + Documentation

* Update plugins/module_utils/identity/keycloak/keycloak.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/module_utils/identity/keycloak/keycloak.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Fix unit test and add new one for token as param

* Fix identation

* Check base_url format also if token is given

* Update plugins/doc_fragments/keycloak.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/identity/keycloak/keycloak_client.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/identity/keycloak/keycloak_clienttemplate.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Allow keycloak_group.py to take token as parameter for the authentification

* Refactor get_token to pass module.params + Documentation

* Update plugins/module_utils/identity/keycloak/keycloak.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/identity/keycloak/keycloak_group.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Check if base_url is None before to check format

* Fix unit test: rename base_url parameter to auth_keycloak_url

* Update plugins/module_utils/identity/keycloak/keycloak.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/2250-allow-keycloak-modules-to-take-token-as-param.yml

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update plugins/module_utils/identity/keycloak/keycloak.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update plugins/modules/identity/keycloak/keycloak_client.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update plugins/modules/identity/keycloak/keycloak_client.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update plugins/modules/identity/keycloak/keycloak_clienttemplate.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update changelogs/fragments/2250-allow-keycloak-modules-to-take-token-as-param.yml

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update plugins/module_utils/identity/keycloak/keycloak.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update plugins/modules/identity/keycloak/keycloak_clienttemplate.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update plugins/modules/identity/keycloak/keycloak_group.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update plugins/modules/identity/keycloak/keycloak_group.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Switch to modern syntax for the documentation (e.g. community.general.keycloak_client)

* Add check either creds or token as argument of all keyloak_* modules

* Update plugins/modules/identity/keycloak/keycloak_client.py

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-04-20 13:20:46 +02:00
Alexei Znamensky
f33323ca89
Tidy up validate-modules:parameter-list-no-elements (batch 1) (#1795)
* fixed validation-modules for plugins/modules/storage/netapp/na_ontap_gather_facts.py

* fixed validation-modules for plugins/modules/source_control/gitlab/gitlab_runner.py

* fixed validation-modules for plugins/modules/packaging/os/redhat_subscription.py

* fixed validation-modules for plugins/modules/notification/twilio.py

* fixed validation-modules for plugins/modules/notification/slack.py

* fixed validation-modules for plugins/modules/notification/sendgrid.py

* fixed validation-modules for plugins/modules/notification/rocketchat.py

* fixed validation-modules for plugins/modules/notification/office_365_connector_card.py

* fixed validation-modules for plugins/modules/notification/nexmo.py

* fixed validation-modules for plugins/modules/notification/mail.py

* fixed validation-modules for plugins/modules/net_tools/omapi_host.py

* fixed validation-modules for plugins/modules/net_tools/nsupdate.py

* fixed validation-modules for plugins/modules/net_tools/dnsimple.py

* fixed validation-modules for plugins/modules/monitoring/pagerduty.py

* fixed validation-modules for plugins/modules/monitoring/librato_annotation.py

* fixed validation-modules for plugins/modules/identity/onepassword_info.py

* fixed validation-modules for plugins/modules/identity/keycloak/keycloak_client.py

* fixed validation-modules for plugins/modules/files/xml.py

* fixed validation-modules for plugins/modules/cloud/softlayer/sl_vm.py

* fixed validation-modules for plugins/modules/cloud/smartos/vmadm.py

* fixed validation-modules for plugins/modules/cloud/pubnub/pubnub_blocks.py

* fixed validation-modules for plugins/modules/cloud/packet/packet_device.py

* fixed validation-modules for plugins/modules/cloud/lxd/lxd_container.py

* fixed validation-modules for plugins/module_utils/oracle/oci_utils.py

* fixed validation-modules for plugins/doc_fragments/oracle_creatable_resource.py

* Tidy up validate-modules:parameter-list-no-elements for some modules

* fixed validation-modules for plugins/modules/monitoring/statusio_maintenance.py

* Fixed pending issues from CI validation

* Fixed xml module elements for add_children & set_children

* added changelog fragment

* typo

* fix wording in changelog frag
2021-02-16 07:11:37 +01:00
Felix Fontein
29bd5a9486
Fix a bunch of potential security issues (secret leaking) (#1736)
* Fix a bunch of potential security issues (secret leaking).

* oneandone_server was already ok.

* Add more parameters for pagerduty_alert.

* Add more no_log=True.
2021-02-08 16:33:18 +01:00
Alexei Znamensky
ae0d3cb090
Tidy up validate-modules:no-default-for-required-parameter and other cases (#1423)
* Fixed validate-modules:mutually_exclusive-unknown for plugins/modules/packaging/os/redhat_subscription.py

* fixed validation-modules for plugins/modules/cloud/lxd/lxd_container.py

* fixed validation-modules for plugins/modules/web_infrastructure/sophos_utm/utm_network_interface_address.py

* fixed validation-modules for plugins/modules/cloud/opennebula/one_host.py

* fixed validation-modules for plugins/modules/cloud/opennebula/one_image_info.py

* fixed validation-modules for plugins/modules/cloud/opennebula/one_image.py

* fixed validation-modules for plugins/modules/cloud/opennebula/one_service.py

* fixed validation-modules for plugins/modules/cloud/opennebula/one_vm.py

* fixed validation-modules for plugins/modules/net_tools/cloudflare_dns.py

* fixed validation-modules for plugins/modules/net_tools/ip_netns.py

* fixed validation-modules for plugins/modules/net_tools/ipinfoio_facts.py

* fixed validation-modules for plugins/modules/net_tools/netcup_dns.py

* fixed validation-modules for plugins/modules/remote_management/wakeonlan.py

* added types to plugins/modules/remote_management/stacki/stacki_host.py but still cannot remove ignore line

* added a couple of FIXME comments

* fixed validation-modules for plugins/modules/remote_management/manageiq/manageiq_provider.py

* fixed validation-modules for plugins/modules/notification/rocketchat.py

* fixed validation-modules for plugins/modules/monitoring/bigpanda.py

* fixed validation-modules for plugins/modules/identity/keycloak/keycloak_client.py

* fixed validation-modules for plugins/modules/identity/keycloak/keycloak_clienttemplate.py

* fixed validation-modules for plugins/modules/cloud/univention/udm_user.py

* fixed validation-modules for plugins/modules/cloud/univention/udm_group.py

* fixed validation-modules for plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py

* fixed validation-modules for plugins/modules/cloud/smartos/imgadm.py

* fixed validation-modules for plugins/modules/cloud/profitbricks/profitbricks_nic.py

* fixed validation-modules for plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py

* Tidy up validate-modules ignores no-default-for-required-parameter + couple of other cases

* Added changelog frag

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_alert_policy.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_firewall_policy.py

* fixed validation-modules for plugins/modules/cloud/lxd/lxd_profile.py

* Typos and small fixes

* fixed validation-modules for plugins/modules/net_tools/ldap/ldap_passwd.py

* Typos and small fixes, part 2

* Fixes from PR comments

* Update plugins/modules/cloud/profitbricks/profitbricks_nic.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Rolled back the mutually-exclusive-unknown in redhat_subscription

* Update changelogs/fragments/1423-valmod_multiple_cases.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-12-01 21:28:40 +01:00
Alexei Znamensky
47c456f740
Tidy up validate-modules:doc-elements-mismatch (#1399)
* fixed validation-modules for plugins/modules/cloud/xenserver/xenserver_guest.py

* fixed validation-modules for plugins/modules/identity/ipa/ipa_hbacrule.py

* fixed validation-modules for plugins/modules/identity/keycloak/keycloak_client.py

* fixed validation-modules for plugins/modules/identity/keycloak/keycloak_clienttemplate.py

* fixed validation-modules for plugins/modules/net_tools/nios/nios_fixed_address.py

* fixed validation-modules for plugins/modules/net_tools/nios/nios_host_record.py

* fixed validation-modules for plugins/modules/net_tools/nios/nios_member.py

* fixed validation-modules for plugins/modules/net_tools/nios/nios_network.py

* fixed validation-modules for plugins/modules/net_tools/nios/nios_nsgroup.py

* fixed validation-modules for plugins/modules/remote_management/redfish/redfish_config.py

* fixed validation-modules for plugins/modules/source_control/github/github_webhook.py

* fixed validation-modules for plugins/modules/web_infrastructure/sophos_utm/utm_proxy_exception.py

* Tidy up validate-modules ignores doc-elements-mismatch

* Added changelog frag for utm_proxy_exception

* Update changelogs/fragments/1399-fixed-wrong-elements-type.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Fixed couple of missing docs

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-27 08:01:02 +01:00
Andrew Klychkov
5d226f86b6
Remove ANSIBLE_METADATA (#339)
* Remove ANSIBLE_METADATA

* remove from other modules

* remove from plugins and scripts
2020-05-14 14:03:42 +01:00
Ansible Core Team
aebc1b03fd Initial commit 2020-03-09 09:11:07 +00:00