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

add user endpoint for managing user groups permissions #409

Merged
merged 21 commits into from
Sep 11, 2024

Conversation

jeffkala
Copy link
Contributor

The User model / endpoint was added awhile ago in NB core, this allows for some base level support for some of those models. Specifically User, Groups, Permissions. Did NOT implement password parameter for user to avoid potential security implications, also did NOT add the Token model to avoid potential security implementation with that.

@jeffkala
Copy link
Contributor Author

Still working to figure out why when I add groups to permissions that its not idompotent, always shows changed.

plugins/module_utils/users.py Outdated Show resolved Hide resolved
plugins/modules/admin_group.py Outdated Show resolved Hide resolved
plugins/modules/admin_group.py Outdated Show resolved Hide resolved
plugins/modules/admin_group.py Outdated Show resolved Hide resolved
plugins/modules/admin_group.py Outdated Show resolved Hide resolved
plugins/modules/object_permission.py Outdated Show resolved Hide resolved
plugins/modules/user.py Outdated Show resolved Hide resolved
plugins/modules/user.py Outdated Show resolved Hide resolved
plugins/modules/user.py Outdated Show resolved Hide resolved
tests/integration/targets/latest/tasks/main.yml Outdated Show resolved Hide resolved
tests/integration/targets/latest/tasks/main.yml Outdated Show resolved Hide resolved
plugins/module_utils/users.py Outdated Show resolved Hide resolved
tests/integration/targets/latest/tasks/admin_group.yml Outdated Show resolved Hide resolved
jeffkala and others added 3 commits August 30, 2024 12:42
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
@joewesch
Copy link
Contributor

The tests are not fully running, maybe because of the merge conflicts?

@jeffkala
Copy link
Contributor Author

okay, think I cleaned up everything pending and fixed merge conflict

jeffkala and others added 2 commits August 30, 2024 13:02
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
tasks.py Outdated Show resolved Hide resolved
plugins/module_utils/users.py Outdated Show resolved Hide resolved
object_types:
- "dcim.device"
state: present
register: test_three
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the users and groups fields to ensure they work as well.
This will probably require:

  • Adding items to the nautobot_populate.py file to create the user and group that you will use
  • set_fact at the top of this file to look up the user and group
    • this will require you to add the endpoints to the lookup plugin

tests/integration/targets/latest/tasks/admin_user.yml Outdated Show resolved Hide resolved
jeffkala and others added 2 commits September 9, 2024 15:33
Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com>
Copy link
Contributor

@joewesch joewesch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed up a change to convert groups on admin_permission to just str elements instead of raw. Technically, both - name: foo and - foo work, but since there are no other keys for a group it doesn't make much sense to have it be raw.

@joewesch
Copy link
Contributor

Full tests successful: https://github.com/nautobot/nautobot-ansible/actions/runs/10812691163

@joewesch joewesch merged commit 4a8ee71 into develop Sep 11, 2024
27 checks passed
@joewesch joewesch deleted the jkala-add-user-module branch December 20, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants