oktalib.entities package¶
Submodules¶
oktalib.entities.core module¶
Main code for core.
-
class
oktalib.entities.core.Entity(okta_instance, data)[source]¶ Bases:
objectThe core object of okta.
-
created_at¶ The date and time of the group’s creation.
Returns: The datetime object of when the group was created Return type: datetime
-
id¶ The id of the entity.
Returns: The internal id of the entity Return type: basestring
-
last_updated_at¶ The date and time of the entity’s last update.
Returns: The datetime object of when the entity was last updated Return type: datetime
-
url¶ The url of the entity.
Returns: None in the core entity. All objects inheriting from this would either expose this from their data or construct and overwrite this.
-
oktalib.entities.entities module¶
Main code for entities.
-
class
oktalib.entities.entities.Application(okta_instance, data)[source]¶ Bases:
oktalib.entities.core.EntityModels the apps in okta.
-
accessibility¶ The accessibility of the application.
Returns: The accessibility of the application Return type: dictionary
-
activate()[source]¶ Activates the application.
Returns: True on success, False otherwise Return type: bool
-
add_group_by_id(group_id)[source]¶ Adds a group to the application.
Parameters: group_id – The id of the group to add Returns: True on success, False otherwise
-
add_group_by_name(group_name)[source]¶ Adds a group to the application.
Parameters: group_name – The name of the group to add Returns: True on success, False otherwise
-
assign_group_to_saml_user_roles(group_id, role, saml_roles)[source]¶ Assigns an okta group to an okta application with saml user roles.
Parameters: - group_id – The id of the group to be associated
- role – The aws role that okta uses to assume SAML roles in other accounts
- saml_roles – the SAML Roles to be assumed
Returns: The status of the assignment( True or False )
Return type: Bool
-
credentials¶ The credentials of the application.
Returns: The credentials of the application Return type: dictionary
-
deactivate()[source]¶ Deactivates the application.
Returns: True on success, False otherwise Return type: bool
-
features¶ The features of the application.
Returns: The features of the application Return type: dictionary
-
get_associated_saml_roles()[source]¶ Returns the Saml IAM Roles associated with the application.
Returns: List of saml iam roles Return type: list
-
get_group_assignment_by_group_name(name)[source]¶ Retrieves a group assignment by a group name.
Parameters: name – The name of the group assignment to retrieve. Returns: The matching group assignment if found else None. Return type: group_assignment (GroupAssignment)
-
get_user_assignment_by_email(email)[source]¶ Retrieves a user assignment by a user email.
Parameters: email – The email of the user assignment to retrieve. Returns: The matching user assignment if found else None. Return type: user_assignment (UserAssignment)
-
group_assignments¶ The group assignments to the application.
Returns: A generator of group assignments for application Return type: generator
-
groups¶ The groups of the application.
Returns: A generator of Group objects for the groups of the application Return type: generator
-
label¶ The label of the application.
Returns: The label of the application Return type: basestring
-
name¶ The name of the application.
Returns: The name of the application Return type: basestring
-
notification_settings¶ The notification settings of the application.
Returns: The notification settings of the application Return type: dictionary
-
remove_group_by_id(group_id)[source]¶ Removes a group from the application.
Parameters: group_id – The id of the group to remove Returns: True on success, False otherwise
-
remove_group_by_name(group_name)[source]¶ Removes a group from the application.
Parameters: group_name – The name of the group to remove Returns: True on success, False otherwise
-
settings¶ The settings of the application.
Returns: The settings of the application Return type: dictionary
-
sign_on_mode¶ The sign on mode of the application.
Returns: The sign on mode of the application Return type: basestring
-
sign_on_settings¶ The sign on settings of the application.
Returns: The sign on settings of the application Return type: dictionary
-
status¶ The status of the application.
Returns: The status of the application Return type: basestring
-
url¶ The url of the application.
Returns: The url of the application Return type: string
-
user_assignments¶ The user assignments to the application.
Returns: A generator of user assignments for application Return type: generator
-
users¶ The users of the application.
Returns: A generator of User objects for the users of the application Return type: generator
-
visibility¶ The visibility of the application.
Returns: The visibility of the application Return type: dictionary
-
-
class
oktalib.entities.entities.Group(okta_instance, data)[source]¶ Bases:
oktalib.entities.core.EntityModels the group object of okta.
-
add_to_application_with_label(application_label)[source]¶ Adds the group to an application.
Parameters: application_label – The label of the application to add the group to Returns: True on success, False otherwise
-
add_user_by_id(id_)[source]¶ Adds a user to the group.
Parameters: id – The id of the user to add Returns: True on success, False otherwise
-
add_user_by_login(login)[source]¶ Adds a user to the group.
Parameters: login – The login of the user to add Returns: True on success, False otherwise
-
applications¶ The applications of the group.
Returns: A generator of Application objects for the applications of the group Return type: generator
-
delete()[source]¶ Deletes the group from okta.
Returns: True on success, False otherwise Return type: bool
-
description¶ The description of the group.
Returns: The description of the group Return type: string
-
last_membership_updated_at¶ The date and time of the group’s last membership update.
Returns: The datetime object of when the group’s memberships were last updated Return type: datetime
-
name¶ The name of the group.
Returns: The name of the group Return type: string
-
object_classes¶ The classes of the group.
Returns: The tuple of the classes of the group Return type: tuple
-
profile¶ The profile of the group.
Returns: The profile of the group Return type: dict
-
remove_from_application_with_label(application_label)[source]¶ Removes the group from an application.
Parameters: application_label – The label of the application to remove the group from Returns: True on success, False otherwise
-
remove_user_by_id(id_)[source]¶ Remove a user from the group.
Parameters: id – The id of the user to remove Returns: True on success, False otherwise
-
remove_user_by_login(login)[source]¶ Removes a user from the group.
Parameters: login – The login of the user to remove Returns: True on success, False otherwise
-
type¶ The type of the group.
Returns: The name of the type of the group Return type: string
-
url¶ The url of the group.
Returns: The url of the group Return type: string
-
users¶ The users of the group.
Returns: A generator of User objects for the users of the group Return type: generator
-
-
class
oktalib.entities.entities.GroupAssignment(okta_instance, data)[source]¶ Bases:
oktalib.entities.entities.GroupModels the group assignment object of okta for apps.
-
priority¶ The priority of the group assignment.
Returns: The priority of the group. Return type: int
-
profile_role¶ Profile role.
-
profile_saml_roles¶ Profile saml roles.
-
-
class
oktalib.entities.entities.User(okta_instance, data)[source]¶ Bases:
oktalib.entities.core.EntityModels the user object of okta.
-
activated_at¶ The date and time of the users’s activation.
Returns: The datetime object of when the user was activated Return type: datetime
-
city¶ The city of the user.
Returns: The city of the user Return type: string
-
contry_code¶ The contry code of the user.
Returns: The country code of the user Return type: string
-
credentials¶ The credentials of the user.
Returns: The credentials of the user Return type: dictionary
-
delete()[source]¶ Deletes the user from okta.
Returns: True on success, False otherwise Return type: bool
-
department¶ The department of the user.
Returns: The department of the user Return type: string
-
display_name¶ The display name of the user.
Returns: The display name of the user Return type: string
-
email¶ The email of the user.
Returns: The email of the user Return type: string
-
employee_number¶ The employee number of the user.
Returns: The employee number of the user Return type: string
-
first_name¶ The first name of the user.
Returns: The first name of the user Return type: string
-
groups¶ Lists the groups the user is a member of.
Returns: A generator of Group objects for which the user is member of Return type: generator
-
last_login_at¶ The date and time of the users’s last login.
Returns: The datetime object of when the user last logged in Return type: datetime
-
last_name¶ The last name of the user.
Returns: The last name of the user Return type: string
-
locale¶ The locale of the user.
Returns: The locale of the user Return type: string
-
login¶ The login of the user.
Returns: The login of the user Return type: string
-
manager¶ The manager of the user.
Returns: The manager of the user Return type: string
-
mobile_phone¶ The mobile phone of the user.
Returns: The mobile phone of the user Return type: string
-
organization¶ The organization of the user.
Returns: The organization of the user Return type: string
-
password_changed_at¶ The date and time of the users’s last password change.
Returns: The datetime object of when the user last changed password Return type: datetime
-
primary_phone¶ The primary phone of the user.
Returns: The primary phone of the user Return type: string
-
second_email¶ The second email of the user.
Returns: The second email of the user Return type: string
-
set_password(password)[source]¶ Set a password for the user.
Returns: True on success, False otherwise
-
set_temporary_password()[source]¶ Sets a temporary password for the user.
Returns: Password on success, None otherwise Return type: string
-
status¶ The status of the user.
Returns: The status of the user Return type: string
-
status_changed_at¶ The date and time of the users’s status change.
Returns: The datetime object of when the user had last changed status Return type: datetime
-
street_address¶ The street address of the user.
Returns: The street address of the user Return type: string
-
title¶ The title of the user.
Returns: The title of the user Return type: string
-
update_password(old_password, new_password)[source]¶ Changes the user’s password.
Returns: True on success, False otherwise
-
update_profile(new_profile)[source]¶ Update a user’s profile in okta.
Parameters: new_profile – A object with attributes to change (example: {‘profile’: {‘firstName’: ‘Test’}}) Returns: True or False depending on success Return type: Bool
-
update_security_question(password, question, answer)[source]¶ Changes the user’s security question and answer.
Returns: True on success, False otherwise
-
url¶ The url of the user.
Returns: The url of the user Return type: string
-
zip_code¶ The zip code of the user.
Returns: The zip code of the user Return type: string
-
-
class
oktalib.entities.entities.UserAssignment(okta_instance, data)[source]¶ Bases:
oktalib.entities.entities.UserModels the user assignment object of okta for apps.
-
email¶ The email of the user.
Returns: The email of the user. Return type: email (str)
-
group¶ The group that the user assignment refers to.
Returns: The group that the user assignment refers to. Return type: group (Group)
-
profile_role¶ Profile role.
-
profile_saml_roles¶ Profile saml roles.
-