community.general icon indicating copy to clipboard operation
community.general copied to clipboard

Add keycloak_user_info and keycloak_user module

Open drpdishant opened this issue 1 year ago • 9 comments

SUMMARY

Add user management modules for keycloak Fixes #5089

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME
  • keycloak
ADDITIONAL INFORMATION

Status:

  • [x] keycloak_user_info (For getting user info from a keycloak realm)
  • [x] keycloak_user (For user related CRUD operations)

Examples:

- name: Get all users in a realm
  community.general.keycloak_user_info:
    realm: MyCustomRealm
    auth_keycloak_url: http://localhost:8080
  delegate_to: localhost

drpdishant avatar Aug 08 '22 06:08 drpdishant

cc @eikef @ndclt click here for bot help

ansibullbot avatar Aug 08 '22 06:08 ansibullbot

Docs Build 📝

This PR is closed and any previously published docsite has been unpublished.

github-actions[bot] avatar Aug 08 '22 06:08 github-actions[bot]

The test ansible-test sanity --test pylint [explain] failed with 6 errors:

plugins/module_utils/identity/keycloak/keycloak.py:1827:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1831:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1846:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1850:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1867:11: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1892:0: missing-final-newline: Final newline missing

The test ansible-test sanity --test pylint [explain] failed with 6 errors:

plugins/module_utils/identity/keycloak/keycloak.py:1827:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1831:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1846:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1850:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1867:11: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1892:0: missing-final-newline: Final newline missing

The test ansible-test sanity --test pep8 [explain] failed with 7 errors:

plugins/module_utils/identity/keycloak/keycloak.py:1820:5: E301: expected 1 blank line, found 0
plugins/module_utils/identity/keycloak/keycloak.py:1827:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1831:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1846:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1850:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1867:12: W291: trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1892:89: W292: no newline at end of file

The test ansible-test sanity --test pep8 [explain] failed with 7 errors:

plugins/module_utils/identity/keycloak/keycloak.py:1820:5: E301: expected 1 blank line, found 0
plugins/module_utils/identity/keycloak/keycloak.py:1827:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1831:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1846:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1850:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1867:12: W291: trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1892:89: W292: no newline at end of file

The test ansible-test sanity --test pylint [explain] failed with 6 errors:

plugins/module_utils/identity/keycloak/keycloak.py:1827:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1831:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1846:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1850:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1867:11: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1892:0: missing-final-newline: Final newline missing

The test botmeta failed with 2 errors:

.github/BOTMETA.yml:0:0: Author drpdishant not mentioned as active or inactive maintainer for plugins/modules/identity/keycloak/keycloak_user.py (mentioned are: eikef, ndclt)
.github/BOTMETA.yml:0:0: Author MahekKatariya not mentioned as active or inactive maintainer for plugins/modules/identity/keycloak/keycloak_user.py (mentioned are: eikef, ndclt)

The test ansible-test sanity --test pep8 [explain] failed with 7 errors:

plugins/module_utils/identity/keycloak/keycloak.py:1820:5: E301: expected 1 blank line, found 0
plugins/module_utils/identity/keycloak/keycloak.py:1827:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1831:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1846:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1850:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1867:12: W291: trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1892:89: W292: no newline at end of file

The test ansible-test sanity --test pep8 [explain] failed with 7 errors:

plugins/module_utils/identity/keycloak/keycloak.py:1820:5: E301: expected 1 blank line, found 0
plugins/module_utils/identity/keycloak/keycloak.py:1827:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1831:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1846:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1850:1: W293: blank line contains whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1867:12: W291: trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1892:89: W292: no newline at end of file

The test ansible-test sanity --test pylint [explain] failed with 6 errors:

plugins/module_utils/identity/keycloak/keycloak.py:1827:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1831:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1846:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1850:0: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1867:11: trailing-whitespace: Trailing whitespace
plugins/module_utils/identity/keycloak/keycloak.py:1892:0: missing-final-newline: Final newline missing

click here for bot help

ansibullbot avatar Aug 12 '22 14:08 ansibullbot

The test licenses failed with 8 errors:

tests/integration/inventory:0:0: found no copyright notice
tests/integration/inventory:0:0: must have at least one license
tests/integration/targets/keycloak_user/README.md:0:0: found no copyright notice
tests/integration/targets/keycloak_user/README.md:0:0: must have at least one license
tests/integration/targets/keycloak_user/tasks/nocreds.yaml:0:0: found no copyright notice
tests/integration/targets/keycloak_user/tasks/nocreds.yaml:0:0: must have at least one license
tests/integration/targets/keycloak_user/tasks/creds.yaml:0:0: found no copyright notice
tests/integration/targets/keycloak_user/tasks/creds.yaml:0:0: must have at least one license

The test botmeta failed with 2 errors:

.github/BOTMETA.yml:0:0: Author drpdishant not mentioned as active or inactive maintainer for plugins/modules/identity/keycloak/keycloak_user.py (mentioned are: eikef, ndclt)
.github/BOTMETA.yml:0:0: Author MahekKatariya not mentioned as active or inactive maintainer for plugins/modules/identity/keycloak/keycloak_user.py (mentioned are: eikef, ndclt)

click here for bot help

ansibullbot avatar Aug 13 '22 09:08 ansibullbot

The test licenses failed with 8 errors:

tests/integration/inventory:0:0: found no copyright notice
tests/integration/inventory:0:0: must have at least one license
tests/integration/targets/keycloak_user/README.md:0:0: found no copyright notice
tests/integration/targets/keycloak_user/README.md:0:0: must have at least one license
tests/integration/targets/keycloak_user/tasks/nocreds.yaml:0:0: found no copyright notice
tests/integration/targets/keycloak_user/tasks/nocreds.yaml:0:0: must have at least one license
tests/integration/targets/keycloak_user/tasks/creds.yaml:0:0: found no copyright notice
tests/integration/targets/keycloak_user/tasks/creds.yaml:0:0: must have at least one license

The test botmeta failed with 2 errors:

.github/BOTMETA.yml:0:0: Author drpdishant not mentioned as active or inactive maintainer for plugins/modules/identity/keycloak/keycloak_user.py (mentioned are: eikef, ndclt)
.github/BOTMETA.yml:0:0: Author MahekKatariya not mentioned as active or inactive maintainer for plugins/modules/identity/keycloak/keycloak_user.py (mentioned are: eikef, ndclt)

click here for bot help

@felixfontein please guide me regarding this. I have added tests for keycloak_user module, but I guess licence block should not be required in there.

drpdishant avatar Aug 16 '22 08:08 drpdishant

@felixfontein please guide me regarding this. I have added tests for keycloak_user module, but I guess licence block should not be required in there.

The license block is required in every file.

~~Also please don't forget to update .github/BOTMETA.yml. (See also CONTRIBUTING.md.)~~ (just noticed that this is already done)

felixfontein avatar Aug 18 '22 04:08 felixfontein

@drpdishant this PR contains the following merge commits:

  • https://github.com/ansible-collections/community.general/commit/457221e5d8620cac7927356371342f3880ac0c7e

Please rebase your branch to remove these commits.

click here for bot help

ansibullbot avatar Aug 22 '22 09:08 ansibullbot

@drpdishant

You are missing a file: tests/integration/targets/keycloak_user/aliases

See other integration test directories and also the docs: https://docs.ansible.com/ansible/latest/dev_guide/testing/sanity/integration-aliases.html

russoz avatar Sep 08 '22 09:09 russoz

Codecov Report

Merging #5092 (59d43be) into main (8e9ec61) will decrease coverage by 0.02%. The diff coverage is 54.59%.

:exclamation: Current head 59d43be differs from pull request most recent head faba59f. Consider uploading reports for the commit faba59f to get more accurate results

@@            Coverage Diff             @@
##             main    #5092      +/-   ##
==========================================
- Coverage   45.51%   45.48%   -0.03%     
==========================================
  Files         976      977       +1     
  Lines       96045    96024      -21     
  Branches    18279    18294      +15     
==========================================
- Hits        43714    43677      -37     
- Misses      50331    50332       +1     
- Partials     2000     2015      +15     
Flag Coverage Δ
integration 71.18% <78.00%> (+0.01%) :arrow_up:
sanity 21.26% <33.67%> (-0.11%) :arrow_down:
stub 0.00% <0.00%> (ø)
units 68.24% <42.74%> (-0.03%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
plugins/become/doas.py 82.14% <ø> (ø)
plugins/become/dzdo.py 89.47% <ø> (ø)
plugins/become/ksu.py 78.26% <ø> (ø)
plugins/become/machinectl.py 57.57% <ø> (ø)
plugins/become/pbrun.py 88.23% <ø> (ø)
plugins/become/pfexec.py 85.71% <ø> (ø)
plugins/become/pmrun.py 60.00% <ø> (ø)
plugins/become/sesu.py 56.25% <ø> (ø)
plugins/cache/pickle.py 66.66% <ø> (ø)
plugins/cache/redis.py 44.91% <ø> (ø)
... and 306 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Sep 15 '22 08:09 codecov[bot]

Please note that in #5461 the collection repository was restructured to remove the directory tree in plugins/modules/, and the corresponding tree in tests/unit/plugins/modules/. Your PR adds new files into this hierarchy. Please rebase with the current main branch and move your files directly into plugins/modules/. You also can remove the changes to meta/runtime.yml, these are not needed anymore (the corresponding section was removed from CONTRIBUTING.md), and make sure to adjust the new entries in .github/BOTMETA.yml as well.

felixfontein avatar Nov 03 '22 06:11 felixfontein