User

class jmpr.User(iam_client: <module 'boto3' from '/home/docs/checkouts/readthedocs.org/user_builds/jmpr/envs/latest/lib/python3.7/site-packages/boto3/__init__.py'>, username: str, arn: str, identity_account_id: str = None, create_date: <module 'datetime' from '/home/docs/.pyenv/versions/3.7.3/lib/python3.7/datetime.py'> = None, path: str = '/', desired_path: str = None, create_console_password: bool = True, is_prototype=False, config_policies: list = None, cloud: str = 'AWS', enforce_mfa: bool = True, self_service: bool = True)

Bases: object

Methods Summary

blank_principal_assumerole_policy()

[summary]

commit_principal()

[summary]

construct_role_list(target_roles, path)

[summary]

construct_user_prototype(username, …[, …])

[summary]

format_path(asset_path, additional_path)

[summary]

from_iam_dict(iam_dict, iam_client[, …])

from_yaml(userdict, identity_account_id, …)

[summary]

get_aws_user(username, iam_client)

[summary]

get_iam_client(identity_account_creds)

[summary]

inline_policy_from_roles(roles)

[summary]

print_switchroles()

[summary]

randomPassword()

Generate a random password

Methods Documentation

static blank_principal_assumerole_policy()

[summary]

Returns

[type] – [description]

commit_principal()

[summary]

Returns

[type] – [description]

static construct_role_list(target_roles: list, path: str)

[summary]

Parameters
  • {list} -- [description] (target_roles) –

  • {str} -- [description] (path) –

Returns

[type] – [description]

static construct_user_prototype(username: str, identity_account_id: str, desired_path: str, enforce_mfa: bool = True, self_service: bool = True)

[summary]

Parameters
  • {str} -- [description] (desired_path) –

  • {str} -- [description]

  • {str} -- [description]

Keyword Arguments
  • {bool} -- [description] (default (self_service) – {True})

  • {bool} -- [description] (default – {True})

Returns

[type] – [description]

static format_path(asset_path: str, additional_path: str)

[summary]

Parameters
  • {str} -- [description] (additional_path) –

  • {str} -- [description]

Returns

[type] – [description]

classmethod from_iam_dict(iam_dict: dict, iam_client: <module 'boto3' from '/home/docs/checkouts/readthedocs.org/user_builds/jmpr/envs/latest/lib/python3.7/site-packages/boto3/__init__.py'>, desired_path: str = None, is_prototype: bool = False, enforce_mfa: bool = True, self_service: bool = True)
classmethod from_yaml(userdict: dict, identity_account_id: str, identity_iam_client: <module 'boto3' from '/home/docs/checkouts/readthedocs.org/user_builds/jmpr/envs/latest/lib/python3.7/site-packages/boto3/__init__.py'>, asset_path: str = 'jmpr')

[summary]

Parameters
  • {dict} -- [description] (identity_account_creds) –

  • {str} -- [description] (identity_account_id) –

  • {dict} -- [description]

Keyword Arguments

{str} -- [description] (default (asset_path) – {“jmpr”})

Returns

[type] – [description]

classmethod get_aws_user(username: str, iam_client: <module 'boto3' from '/home/docs/checkouts/readthedocs.org/user_builds/jmpr/envs/latest/lib/python3.7/site-packages/boto3/__init__.py'>)

[summary]

Parameters

{str} -- [description] (username) –

Returns

[type] – [description]

classmethod get_iam_client(identity_account_creds: dict)

[summary]

Parameters

{dict} -- [description] (identity_account_creds) –

classmethod inline_policy_from_roles(roles)

[summary]

Parameters

{[type]} -- [description] (roles) –

Returns

[type] – [description]

print_switchroles()

[summary]

static randomPassword()

Generate a random password

Returns

[type] – [description]