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

get_client_role method documentation #594

Closed
rokf opened this issue Sep 19, 2024 · 1 comment · Fixed by #627
Closed

get_client_role method documentation #594

rokf opened this issue Sep 19, 2024 · 1 comment · Fixed by #627
Assignees

Comments

@rokf
Copy link

rokf commented Sep 19, 2024

Hello,

I've noticed that the inline documentation for the get_client_role method is incorrect. See:

def get_client_role(self, client_id, role_name):

def get_client_role(self, client_id, role_name):
        """Get client role id by name.

        This is required for further actions with this role.

        RoleRepresentation
        https://www.keycloak.org/docs-api/24.0.2/rest-api/index.html#_rolerepresentation

        :param client_id: id of client (not client-id)
        :type client_id: str
        :param role_name: role's name (not id!)
        :type role_name: str
        :return: role_id
        :rtype: str
        """
        params_path = {
            "realm-name": self.connection.realm_name,
            "id": client_id,
            "role-name": role_name,
        }
        data_raw = self.connection.raw_get(
            urls_patterns.URL_ADMIN_CLIENT_ROLE.format(**params_path)
        )
        return raise_error_from_response(data_raw, KeycloakGetError)

I might as well open a PR for this issue if nobody picks it up before I find some time for it.

Cheers 😉

@ryshoooo ryshoooo self-assigned this Dec 14, 2024
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 a pull request may close this issue.

3 participants
@rokf @ryshoooo and others