sym.sdk.integrations.onelogin

Helpers for interacting with the OneLogin API within the Sym SDK.

Functions

get_user_info(user)

Get information about a OneLogin user.

is_user_in_role(user, *, role_id)

Checks if the provided User is a member of the OneLogin role specified.

list_roles([name_filter])

Returns a list of all roles in the OneLogin account configured in the current Environment.

users_in_role(role_id)

Returns the members of the specified OneLogin role.

sym.sdk.integrations.onelogin.get_user_info(user: sym.sdk.user.User) dict

Get information about a OneLogin user.

Refer to OneLogin’s get-user API documentation for details on the response format: https://developers.onelogin.com/api-docs/2/users/get-user

Parameters

user – The Sym User to request OneLogin info for

Returns

A dictionary of user information

sym.sdk.integrations.onelogin.is_user_in_role(user: sym.sdk.user.User, *, role_id: int) bool

Checks if the provided User is a member of the OneLogin role specified.

The OneLogin role’s ID must be given, and the function will check that the role exists and is accessible.

Parameters
  • user – The User to check role membership for.

  • role_id – The ID of the OneLogin role.

Returns

True if the user is a member of the specified OneLogin role, False otherwise.

Raises
sym.sdk.integrations.onelogin.list_roles(name_filter: Optional[str] = None) List[dict]

Returns a list of all roles in the OneLogin account configured in the current Environment. Roles are represented as dictionaries, whose structure is defined by the OneLogin API.

Details here: https://developers.onelogin.com/api-docs/2/roles/list-roles

Note that if more than 650 roles exist in the OneLogin account, this call will fail. This is a limitation of the OneLogin API.

Parameters

name_filter – If provided, only roles whose name contains the given string will be returned.

Returns

A list of dictionaries representing OneLogin roles.

sym.sdk.integrations.onelogin.users_in_role(role_id: int) List[sym.sdk.user.User]

Returns the members of the specified OneLogin role.

The OneLogin role’s ID must be given, and the function will check that the role exists and is accessible.

Parameters

role_id – The ID of the OneLogin role.

Returns

A list of Users who are members of the given role.

Raises