forked from TrueCloudLab/frostfs-testlib
Interfaces for IAM in S3 client
This commit is contained in:
parent
863e74f161
commit
65ec50391e
4 changed files with 1039 additions and 17 deletions
|
@ -50,7 +50,7 @@ class BucketContainerResolver(ABC):
|
|||
|
||||
class S3ClientWrapper(HumanReadableABC):
|
||||
@abstractmethod
|
||||
def __init__(self, access_key_id: str, secret_access_key: str, s3gate_endpoint: str, profile: str) -> None:
|
||||
def __init__(self, access_key_id: str, secret_access_key: str, s3gate_endpoint: str, profile: str, region: str) -> None:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
|
@ -395,3 +395,154 @@ class S3ClientWrapper(HumanReadableABC):
|
|||
"""cp directory TODO: Add proper description"""
|
||||
|
||||
# END OF OBJECT METHODS #
|
||||
|
||||
|
||||
# IAM METHODS #
|
||||
|
||||
@abstractmethod
|
||||
def iam_add_user_to_group(self, user_name: str, group_name: str) -> dict:
|
||||
'''Adds the specified user to the specified group'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_attach_group_policy(self, group: str, policy_arn: str) -> dict:
|
||||
'''Attaches the specified managed policy to the specified IAM group'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_attach_user_policy(self, user_name: str, policy_arn: str) -> dict:
|
||||
'''Attaches the specified managed policy to the specified user'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_create_access_key(self, user_name: str) -> dict:
|
||||
'''Creates a new AWS secret access key and access key ID for the specified user'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_create_group(self, group_name: str) -> dict:
|
||||
'''Creates a new group'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_create_policy(self, policy_name: str, policy_document: dict) -> dict:
|
||||
'''Creates a new managed policy for your AWS account'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_create_user(self, user_name: str) -> dict:
|
||||
'''Creates a new IAM user for your AWS account'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_delete_access_key(self, access_key_id: str, user_name: str) -> dict:
|
||||
'''Deletes the access key pair associated with the specified IAM user'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_delete_group(self, group_name: str) -> dict:
|
||||
'''Deletes the specified IAM group'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_delete_group_policy(self, group_name: str, policy_name: str) -> dict:
|
||||
'''Deletes the specified inline policy that is embedded in the specified IAM group'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_delete_policy(self, policy_arn: str) -> dict:
|
||||
'''Deletes the specified managed policy'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_delete_user(self, user_name: str) -> dict:
|
||||
'''Deletes the specified IAM user'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_delete_user_policy(self, user_name: str, policy_name: str) -> dict:
|
||||
'''Deletes the specified inline policy that is embedded in the specified IAM user'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_detach_group_policy(self, group_name: str, policy_arn: str) -> dict:
|
||||
'''Removes the specified managed policy from the specified IAM group'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_detach_user_policy(self, user_name: str, policy_arn: str) -> dict:
|
||||
'''Removes the specified managed policy from the specified user'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_get_group(self, group_name: str) -> dict:
|
||||
'''Returns a list of IAM users that are in the specified IAM group'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_get_group_policy(self, group_name: str, policy_name: str) -> dict:
|
||||
'''Retrieves the specified inline policy document that is embedded in the specified IAM group'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_get_policy(self, policy_arn: str) -> dict:
|
||||
'''Retrieves information about the specified managed policy'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_get_policy_version(self, policy_arn: str, version_id: str) -> dict:
|
||||
'''Retrieves information about the specified version of the specified managed policy'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_get_user(self, user_name: str) -> dict:
|
||||
'''Retrieves information about the specified IAM user'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_get_user_policy(self, user_name: str, policy_name: str) -> dict:
|
||||
'''Retrieves the specified inline policy document that is embedded in the specified IAM user'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_list_access_keys(self, user_name: str) -> dict:
|
||||
'''Returns information about the access key IDs associated with the specified IAM user'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_list_attached_group_policies(self, group_name: str) -> dict:
|
||||
'''Lists all managed policies that are attached to the specified IAM group'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_list_attached_user_policies(self, user_name: str) -> dict:
|
||||
'''Lists all managed policies that are attached to the specified IAM user'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_list_entities_for_policy(self, policy_arn: str) -> dict:
|
||||
'''Lists all IAM users, groups, and roles that the specified managed policy is attached to'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_list_group_policies(self, group_name: str) -> dict:
|
||||
'''Lists the names of the inline policies that are embedded in the specified IAM group'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_list_groups(self) -> dict:
|
||||
'''Lists the IAM groups'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_list_groups_for_user(self, user_name: str) -> dict:
|
||||
'''Lists the IAM groups that the specified IAM user belongs to'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_list_policies(self) -> dict:
|
||||
'''Lists all the managed policies that are available in your AWS account'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_list_policy_versions(self, policy_arn: str) -> dict:
|
||||
'''Lists information about the versions of the specified managed policy'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_list_user_policies(self, user_name: str) -> dict:
|
||||
'''Lists the names of the inline policies embedded in the specified IAM user'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_list_users(self) -> dict:
|
||||
'''Lists the IAM users'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_put_group_policy(self, group_name: str, policy_name: str, policy_document: dict) -> dict:
|
||||
'''Adds or updates an inline policy document that is embedded in the specified IAM group'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_put_user_policy(self, user_name: str, policy_name: str, policy_document: dict) -> dict:
|
||||
'''Adds or updates an inline policy document that is embedded in the specified IAM user'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_remove_user_from_group(self, group_name: str, user_name: str) -> dict:
|
||||
'''Removes the specified user from the specified group'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_update_group(self, group_name: str, new_name: Optional[str] = None, new_path: Optional[str] = None) -> dict:
|
||||
'''Updates the name and/or the path of the specified IAM group'''
|
||||
|
||||
@abstractmethod
|
||||
def iam_update_user(self, user_name: str, new_name: Optional[str] = None, new_path: Optional[str] = None) -> dict:
|
||||
'''Updates the name and/or the path of the specified IAM user'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue