aws_session_recorder.lib.schema package

Submodules

aws_session_recorder.lib.schema.base module

class aws_session_recorder.lib.schema.base.TimeStamp(*args, **kwargs)[source]

Bases: sqlalchemy.sql.type_api.TypeDecorator

LOCAL_TIMEZONE = datetime.timezone(datetime.timedelta(0), 'UTC')
impl

alias of sqlalchemy.sql.sqltypes.DateTime

process_bind_param(value: datetime.datetime, dialect)[source]

Receive a bound parameter value to be converted.

Subclasses override this method to return the value that should be passed along to the underlying TypeEngine object, and from there to the DBAPI execute() method.

The operation could be anything desired to perform custom behavior, such as transforming or serializing data. This could also be used as a hook for validating logic.

This operation should be designed with the reverse operation in mind, which would be the process_result_value method of this class.

Parameters
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.

  • dialect – the Dialect in use.

process_result_value(value, dialect)[source]

Receive a result-row column value to be converted.

Subclasses should implement this method to operate on data fetched from the database.

Subclasses override this method to return the value that should be passed back to the application, given a value that is already processed by the underlying TypeEngine object, originally from the DBAPI cursor method fetchone() or similar.

The operation could be anything desired to perform custom behavior, such as transforming or serializing data. This could also be used as a hook for validating logic.

Parameters
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.

  • dialect – the Dialect in use.

This operation should be designed to be reversible by the “process_bind_param” method of this class.

aws_session_recorder.lib.schema.functions module

aws_session_recorder.lib.schema.functions.GetGroup(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method) → Iterator[aws_session_recorder.lib.schema.group.Group][source]
aws_session_recorder.lib.schema.functions.GetGroupPolicy(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)aws_session_recorder.lib.schema.group.GroupPolicy[source]
aws_session_recorder.lib.schema.functions.GetInstanceProfile(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.GetPolicy(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)aws_session_recorder.lib.schema.policy.Policy[source]
aws_session_recorder.lib.schema.functions.GetPolicyVersion(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.GetRole(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.GetRolePolicy(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.GetUser(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.GetUserPolicy(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.ListAccessKeys(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method) → Iterator[aws_session_recorder.lib.schema.user.AccessKey][source]
aws_session_recorder.lib.schema.functions.ListAttachedGroupPolicies(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.ListAttachedRolePolicies(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.ListAttachedUserPolicies(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.ListGroupPolicies(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.ListGroups(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.ListPolicies(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method) → Iterator[aws_session_recorder.lib.schema.policy.Policy][source]
aws_session_recorder.lib.schema.functions.ListPolicyVersions(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.ListRolePolicies(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.ListRoles(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.ListUserPolicies(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]
aws_session_recorder.lib.schema.functions.ListUsers(req_params: dict, resp: aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method)[source]

aws_session_recorder.lib.schema.group module

class aws_session_recorder.lib.schema.group.Group(resp)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Arn: dict
CreateDate: Optional[datetime.datetime]
GroupId: str
GroupName: str
Path: str
attached_policies: List[aws_session_recorder.lib.schema.policy.Policy]
id: int
inline_policies: List[aws_session_recorder.lib.schema.group.GroupPolicy]
users: List[Any]
class aws_session_recorder.lib.schema.group.GroupPolicy(resp)[source]

Bases: aws_session_recorder.lib.schema.identity.InlinePolicy

GroupName
PolicyDocument
PolicyName
group: List[aws_session_recorder.lib.schema.group.Group]
id: int
policy_name
type: str

aws_session_recorder.lib.schema.identity module

class aws_session_recorder.lib.schema.identity.Identity(resp)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Arn: str
CreateDate: datetime.datetime
Path: str
Tags: List[aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method]
id: int
type: str
class aws_session_recorder.lib.schema.identity.InlinePolicy(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

PolicyDocument
PolicyName
id: int
type: str

aws_session_recorder.lib.schema.policy module

class aws_session_recorder.lib.schema.policy.GroupPolicyAttachments(resp)[source]

Bases: sqlalchemy.ext.declarative.api.Base

GroupName
PolicyArn
PolicyName
group
policy
class aws_session_recorder.lib.schema.policy.Policy(resp)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Arn
AttachmentCount
CreateDate: datetime.datetime
DefaultVersionId
Description
IsAttachable
Path
PermissionsBoundaryUsageCount
PolicyId
PolicyName
UpdateDate: datetime.datetime
attached_to_groups
attached_to_roles
attached_to_users
id
versions: List[aws_session_recorder.lib.schema.policy.PolicyVersion]
class aws_session_recorder.lib.schema.policy.PolicyVersion(resp)[source]

Bases: sqlalchemy.ext.declarative.api.Base

CreateDate: datetime.datetime
Document: dict
IsDefaultVersion: bool
PolicyVersion: str
VersionId: str
policy
policy_id: int
class aws_session_recorder.lib.schema.policy.RolePolicyAttachments(resp)[source]

Bases: sqlalchemy.ext.declarative.api.Base

PolicyArn
PolicyName
RoleName
policy
role
class aws_session_recorder.lib.schema.policy.UserPolicyAttachments(resp)[source]

Bases: sqlalchemy.ext.declarative.api.Base

PolicyArn
PolicyName
UserName
policy
user

aws_session_recorder.lib.schema.role module

class aws_session_recorder.lib.schema.role.InstanceProfile(resp)[source]

Bases: aws_session_recorder.lib.schema.identity.Identity

Arn: str
AssumeRolePolicyDocument: dict
CreateDate: datetime.datetime
InstanceProfileId: str
InstanceProfileName: str
Path: str
Roles: List[dict]
Tags: List[t.TagTypeDef]
arn
id: int
type: str
class aws_session_recorder.lib.schema.role.Role(resp)[source]

Bases: aws_session_recorder.lib.schema.identity.Identity

Arn: str
AssumeRolePolicyDocument: dict
CreateDate: datetime.datetime
Description: str
MaxSessionDuration: int
Path: str
RoleId: str
RoleLastUsed: dict
RoleName: str
Tags: List[t.TagTypeDef]
arn
attached_policies: List[Policy]
id: int
inline_policies: List[RolePolicy]
type: str
class aws_session_recorder.lib.schema.role.RolePolicy(resp)[source]

Bases: aws_session_recorder.lib.schema.identity.InlinePolicy

PolicyDocument
PolicyName
RoleName
id: int
policy_name
role: List[aws_session_recorder.lib.schema.role.Role]
type: str

aws_session_recorder.lib.schema.user module

class aws_session_recorder.lib.schema.user.AccessKey(key)[source]

Bases: sqlalchemy.ext.declarative.api.Base

AccessKeyId: str
CreateDate: datetime.datetime
Status: dict
UserName: str
id: int
user: aws_session_recorder.lib.schema.user.User
class aws_session_recorder.lib.schema.user.User(resp)[source]

Bases: aws_session_recorder.lib.schema.identity.Identity

Arn: str
CreateDate: datetime.datetime
Path: str
Tags: List[aws_session_recorder.lib.helpers.AlwaysDoNothing.__getattr__.<locals>.method]
UserId: str
UserName: str
access_keys
arn
attached_policies: List[aws_session_recorder.lib.schema.policy.Policy]
groups: List[aws_session_recorder.lib.schema.group.Group]
id: int
inline_policies: List[aws_session_recorder.lib.schema.user.UserPolicy]
type: str
class aws_session_recorder.lib.schema.user.UserPolicy(resp)[source]

Bases: aws_session_recorder.lib.schema.identity.InlinePolicy

PolicyDocument
PolicyName
UserName
id: int
policy_name
type: str
user: List[aws_session_recorder.lib.schema.user.User]

Module contents