Skip to content

API fails to parse UserGroup objects that don't have parent_group set #9097

@Mase3206

Description

@Mase3206

Describe the bug
The authentik_client API published on PyPI fails to parse UserGroup objects that don't have parent_group set. Not all groups will have a parent group, and parsing Group objects works just fine.

To Reproduce
Steps to reproduce the behavior:

  1. Import and configure authentik_client in Python 3.12.2
  2. Initialize the baseAPI object.
  3. Initialize the coreAPI object from baseAPI.
  4. Call coreAPI.core_users_list()

Expected behavior
I would expect it to parse the groups without issue, as calling core_groups_list(), which outputs Group objects that may or may not contain parent_group

Screenshots
If applicable, add screenshots to help explain your problem.
image

Logs
Output of docker-compose logs or kubectl logs respectively

Version and Deployment (please complete the following information):

  • authentik version: 2024.2.2
  • Deployment: docker-compose
  • Python version: 3.12.2
  • authentik_client version: 2024.2.2-1710845398

Additional context
A few of my groups do not have a parent group, as they shouldn't or don't need to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions