コード例 #1
0
    def assign_group_to_app_instance(self, app_id, group_id):
        """Assign a group to an app by id

        :param app_id: the target app id
        :type id: str
        :param group_id: the group id
        :type id: str
        :return: None
        """
        ApiClient.put_path(self, '/{0}/groups/{1}'.format(app_id, group_id))
コード例 #2
0
    def add_group_target_for_user_admin_role(self, uid, rid, gid):
        """Adds a group target for a USER_ADMIN role assignment.

        :param uid: User id: str
        :param rid: Role id: str
        :param gid: Group id: str
        :return: None
        """
        ApiClient.put_path(
            self, '/{uid}/roles/{rid}/targets/groups/{gid}'.format(uid=uid,
                                                                   rid=rid,
                                                                   gid=gid))
コード例 #3
0
    def add_group_target_to_user_admin(self, uid, rid, gid):
        """Add a group target for an USER_ADMIN role assignment

        :param uid: the user id
        :type uid: str
        :param rid: the USER_ADMIN role id
        :type rid: str
        :param gid: the group id to be added
        :type gid: str
        :rtype: None
        """
        url = '/{0}/roles/{1}/targets/groups/{2}'.format(uid, rid, gid)
        ApiClient.put_path(self, url)
コード例 #4
0
    def add_app_target_to_app_admin(self, uid, rid, appname):
        """Add an app target for an APP_ADMIN role assignment

        :param uid: the user id
        :type uid: str
        :param rid: the APP_ADMIN role id
        :type rid: str
        :param appname: the name of the app to be added
        :type appname: str
        :rtype: None
        """
        url = '/{0}/roles/{1}/targets/catalog/apps/{2}'.format(uid, rid, appname)
        ApiClient.put_path(self, url)
コード例 #5
0
    def extend_session(self, id):
        """Extend a session's lifespan

        :param id: the target session id
        :rtype: Session
        """
        response = ApiClient.put_path(self, '/{0}'.format(id), None)
        return Utils.deserialize(response.text, Session)
コード例 #6
0
    def extend_session(self, id):
        """Extend a session's lifespan

        :param id: the target session id
        :rtype: Session
        """
        response = ApiClient.put_path(self, '/{0}'.format(id), None)
        return Utils.deserialize(response.text, Session)
コード例 #7
0
    def add_user_to_group_by_id(self, gid, uid):
        """Add a user to a group

        :param gid: the target group id
        :type gid: str
        :param uid: the target user id
        :type uid: str
        :return: None
        """
        response = ApiClient.put_path(self, '/{0}/users/{1}'.format(gid, uid))
コード例 #8
0
    def add_user_to_group_by_id(self, gid, uid):
        """Add a user to a group

        :param gid: the target group id
        :type gid: str
        :param uid: the target user id
        :type uid: str
        :return: None
        """
        response = ApiClient.put_path(self, '/{0}/users/{1}'.format(gid, uid))
コード例 #9
0
    def update_app_instance_by_id(self, id, app_instance):
        """Update an app, defined by an id

        :param id: the target app id
        :type id: str
        :param app_instance: the data to update the target app
        :type app_instance: AppInstance
        :rtype: AppInstance
        """
        response = ApiClient.put_path(self, '/{0}'.format(id), app_instance)
        return Utils.deserialize(response.text, AppInstance)
コード例 #10
0
    def add_app_target_to_app_admin_role(self, uid, rid, app_name):
        """Adds a app target to an APP_ADMIN role assignment.

        :param uid: User id: str
        :param rid: Role id: str
        :param app_name: App name: str
        :return: None
        """
        return ApiClient.put_path(
            self, '/{uid}/roles/{rid}/targets/catalog/apps/{app_name}'.format(
                uid=uid, rid=rid, app_name=app_name))
コード例 #11
0
    def update_app_instance_by_id(self, id, app_instance):
        """Update an app, defined by an id

        :param id: the target app id
        :type id: str
        :param app_instance: the data to update the target app
        :type app_instance: AppInstance
        :rtype: AppInstance
        """
        response = ApiClient.put_path(self, '/{0}'.format(id), app_instance)
        return Utils.deserialize(response.text, AppInstance)
コード例 #12
0
ファイル: UsersClient.py プロジェクト: okta/oktasdk-python
    def update_user_by_id(self, uid, user):
        """Update a user, defined by an id

        :param uid: the target user id
        :type uid: str
        :param user: the data to update the target user
        :type user: User
        :rtype: User
        """
        response = ApiClient.put_path(self, '/{0}'.format(uid), user)
        return Utils.deserialize(response.text, User)
コード例 #13
0
    def update_user_by_id(self, uid, user):
        """Update a user, defined by an id

        :param uid: the target user id
        :type uid: str
        :param user: the data to update the target user
        :type user: User
        :rtype: User
        """
        response = ApiClient.put_path(self, '/{0}'.format(uid), user)
        return Utils.deserialize(response.text, User)
コード例 #14
0
    def update_group_by_id(self, gid, group):
        """Update a group, defined by an id

        :param gid: the target group id
        :type gid: str
        :param group: the data to update the target group
        :type group: UserGroup
        :rtype: UserGroup
        """
        response = ApiClient.put_path(self, '/{0}'.format(gid), group)
        return Utils.deserialize(response.text, UserGroup)
コード例 #15
0
    def update_group_by_id(self, gid, group):
        """Update a group, defined by an id

        :param gid: the target group id
        :type gid: str
        :param group: the data to update the target group
        :type group: UserGroup
        :rtype: UserGroup
        """
        response = ApiClient.put_path(self, '/{0}'.format(gid), group)
        return Utils.deserialize(response.text, UserGroup)
コード例 #16
0
    def assign_group_to_app_instance(self, id, group_id):
        """Assigns a group to an application

        :param id: the target app id
        :type id: str
        :param group_id: the target group id
        :type id: str
        :rtype: AppGroup
        """
        response = ApiClient.put_path(self,
                                      '/{0}/groups/{1}'.format(id, group_id))
        return Utils.deserialize(response.text, AppGroup)
コード例 #17
0
ファイル: FactorsClient.py プロジェクト: djparida/flask_okta
    def update_factor(self, user_id, user_factor_id, factor_enroll_request):
        """Update an enrolled factor

        :param user_id: target user id
        :type user_id: str
        :param user_factor_id: target factor id
        :type user_factor_id: str
        :param factor_enroll_request: data to update the factor
        :type factor_enroll_request: FactorEnrollRequest
        :rtype: Factor
        """
        response = ApiClient.put_path(self, '/{0}/factors/{1}'.format(user_id, user_factor_id), factor_enroll_request)
        return Utils.deserialize(response.text, Factor)
コード例 #18
0
    def update_user_by_id(self, uid, user, partial=True):
        """Update a user, defined by an id

        :param uid: the target user id
        :type uid: str
        :param user: the data to update the target user
        :type user: User
        :param partial: whether to do a partial (true) or full (false) update
        :type partial: bool
        :rtype: User
        """
        if partial:
            response = ApiClient.post_path(self, '/{0}'.format(uid), user)
        else:
            response = ApiClient.put_path(self, '/{0}'.format(uid), user)
        return Utils.deserialize(response.text, self.user_class)