{"action":"created","comment":{"url":"https://api.github.com/repos/chef/inspec-aws/pulls/comments/144095280","pull_request_review_id":68704447,"id":144095280,"diff_hunk":"@@ -15,29 +15,31 @@ class AwsIamUser < Inspec.resource(1)\n   def initialize(\n     opts,\n     aws_user_provider = AwsIam::UserProvider.new,\n+    aws_user_details_provider_ini = AwsIam::UserDetailsProviderInitializer.new,\n     access_key_factory = AwsIamAccessKeyFactory.new\n   )\n-    @user = opts[:user]\n-    @user = aws_user_provider.user(opts[:name]) if @user.nil?\n+    user = opts[:user]\n+    user = aws_user_provider.user(opts[:name]) if user.nil?","path":"libraries/aws_iam_user.rb","position":10,"original_position":10,"commit_id":"3c4f63f9fa4533b2469e6109d68886e87c2bd16d","original_commit_id":"3c4f63f9fa4533b2469e6109d68886e87c2bd16d","user":{"login":"aduric","id":444683,"avatar_url":"https://avatars0.githubusercontent.com/u/444683?v=4","gravatar_id":"","url":"https://api.github.com/users/aduric","html_url":"https://github.com/aduric","followers_url":"https://api.github.com/users/aduric/followers","following_url":"https://api.github.com/users/aduric/following{/other_user}","gists_url":"https://api.github.com/users/aduric/gists{/gist_id}","starred_url":"https://api.github.com/users/aduric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduric/subscriptions","organizations_url":"https://api.github.com/users/aduric/orgs","repos_url":"https://api.github.com/users/aduric/repos","events_url":"https://api.github.com/users/aduric/events{/privacy}","received_events_url":"https://api.github.com/users/aduric/received_events","type":"User","site_admin":false},"body":"Agreed. We can take care of that in an upcoming PR.","created_at":"2017-10-11T18:22:31Z","updated_at":"2017-10-11T18:22:31Z","html_url":"https://github.com/chef/inspec-aws/pull/89#discussion_r144095280","pull_request_url":"https://api.github.com/repos/chef/inspec-aws/pulls/89","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/chef/inspec-aws/pulls/comments/144095280"},"html":{"href":"https://github.com/chef/inspec-aws/pull/89#discussion_r144095280"},"pull_request":{"href":"https://api.github.com/repos/chef/inspec-aws/pulls/89"}},"in_reply_to_id":144094237},"pull_request":{"url":"https://api.github.com/repos/chef/inspec-aws/pulls/89","id":142357424,"html_url":"https://github.com/chef/inspec-aws/pull/89","diff_url":"https://github.com/chef/inspec-aws/pull/89.diff","patch_url":"https://github.com/chef/inspec-aws/pull/89.patch","issue_url":"https://api.github.com/repos/chef/inspec-aws/issues/89","number":89,"state":"open","locked":false,"title":"Issue #46 Lazily load attributes in aws_iam_users","user":{"login":"Stiffni","id":9171326,"avatar_url":"https://avatars1.githubusercontent.com/u/9171326?v=4","gravatar_id":"","url":"https://api.github.com/users/Stiffni","html_url":"https://github.com/Stiffni","followers_url":"https://api.github.com/users/Stiffni/followers","following_url":"https://api.github.com/users/Stiffni/following{/other_user}","gists_url":"https://api.github.com/users/Stiffni/gists{/gist_id}","starred_url":"https://api.github.com/users/Stiffni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stiffni/subscriptions","organizations_url":"https://api.github.com/users/Stiffni/orgs","repos_url":"https://api.github.com/users/Stiffni/repos","events_url":"https://api.github.com/users/Stiffni/events{/privacy}","received_events_url":"https://api.github.com/users/Stiffni/received_events","type":"User","site_admin":false},"body":"This Pull Request addresses Issue #46: _Currently, aws_iam_users loads all of each user's attributes up-front. Refactor so that the loading happens lazily, as needed._\r\n\r\nWe've included updates to unit tests as needed, and introduced a new `UserDetailsProvider` class (with unit tests) to facilitate the lazy loading changes.\r\n\r\nIntegration test output still looks the same:\r\n``` \r\n  EC2 Instance\r\n     â  stefftest3.Example should exist\r\n     â  stefftest3.Example image_id should eq \"ami-0d729a60\"\r\n     â  stefftest3.Example instance_type should eq \"t2.micro\"\r\n  EC2 Instance\r\n     â  i-0406ea0909da1afb8 should exist\r\n     â  i-0406ea0909da1afb8 image_id should eq \"ami-0d729a60\"\r\n     â  i-0406ea0909da1afb8 instance_type should eq \"t2.micro\"\r\n  EC2 Instance\r\n     â  i-06b4bc106e0d03dfd should not exist\r\n  IAM Access-Key\r\n     â  not-an-id should not exist\r\n  IAM User\r\n     â  stefftest3.mfa_not_enabled_user should not have mfa enabled\r\n     â  stefftest3.mfa_not_enabled_user should not have console password\r\n  IAM User\r\n     â  stefftest3.console_password_enabled_user should have console password\r\n  IAM Access-Key\r\n     â  AKIAI5KC5OIRBGIMA2CQ should be active\r\n  IAM Users\r\n     â  with has_console_password? == true has_mfa_enabled? == false should exis                                                                               t\r\n```","created_at":"2017-09-21T14:22:22Z","updated_at":"2017-10-11T18:22:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0cb4ec652ccb3f37052f550ec1f7d2a6fddd7f85","assignee":null,"assignees":[],"requested_reviewers":[{"login":"chris-rock","id":1178413,"avatar_url":"https://avatars3.githubusercontent.com/u/1178413?v=4","gravatar_id":"","url":"https://api.github.com/users/chris-rock","html_url":"https://github.com/chris-rock","followers_url":"https://api.github.com/users/chris-rock/followers","following_url":"https://api.github.com/users/chris-rock/following{/other_user}","gists_url":"https://api.github.com/users/chris-rock/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-rock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-rock/subscriptions","organizations_url":"https://api.github.com/users/chris-rock/orgs","repos_url":"https://api.github.com/users/chris-rock/repos","events_url":"https://api.github.com/users/chris-rock/events{/privacy}","received_events_url":"https://api.github.com/users/chris-rock/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/chef/inspec-aws/pulls/89/commits","review_comments_url":"https://api.github.com/repos/chef/inspec-aws/pulls/89/comments","review_comment_url":"https://api.github.com/repos/chef/inspec-aws/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chef/inspec-aws/issues/89/comments","statuses_url":"https://api.github.com/repos/chef/inspec-aws/statuses/3c4f63f9fa4533b2469e6109d68886e87c2bd16d","head":{"label":"chef:lazy-loading","ref":"lazy-loading","sha":"3c4f63f9fa4533b2469e6109d68886e87c2bd16d","user":{"login":"chef","id":29740,"avatar_url":"https://avatars3.githubusercontent.com/u/29740?v=4","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":76541829,"name":"inspec-aws","full_name":"chef/inspec-aws","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars3.githubusercontent.com/u/29740?v=4","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/inspec-aws","description":"InSpec for AWS (Incubation)","fork":false,"url":"https://api.github.com/repos/chef/inspec-aws","forks_url":"https://api.github.com/repos/chef/inspec-aws/forks","keys_url":"https://api.github.com/repos/chef/inspec-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/inspec-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/inspec-aws/teams","hooks_url":"https://api.github.com/repos/chef/inspec-aws/hooks","issue_events_url":"https://api.github.com/repos/chef/inspec-aws/issues/events{/number}","events_url":"https://api.github.com/repos/chef/inspec-aws/events","assignees_url":"https://api.github.com/repos/chef/inspec-aws/assignees{/user}","branches_url":"https://api.github.com/repos/chef/inspec-aws/branches{/branch}","tags_url":"https://api.github.com/repos/chef/inspec-aws/tags","blobs_url":"https://api.github.com/repos/chef/inspec-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/inspec-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/inspec-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/inspec-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/inspec-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/inspec-aws/languages","stargazers_url":"https://api.github.com/repos/chef/inspec-aws/stargazers","contributors_url":"https://api.github.com/repos/chef/inspec-aws/contributors","subscribers_url":"https://api.github.com/repos/chef/inspec-aws/subscribers","subscription_url":"https://api.github.com/repos/chef/inspec-aws/subscription","commits_url":"https://api.github.com/repos/chef/inspec-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/inspec-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/inspec-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/inspec-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/inspec-aws/contents/{+path}","compare_url":"https://api.github.com/repos/chef/inspec-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/inspec-aws/merges","archive_url":"https://api.github.com/repos/chef/inspec-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/inspec-aws/downloads","issues_url":"https://api.github.com/repos/chef/inspec-aws/issues{/number}","pulls_url":"https://api.github.com/repos/chef/inspec-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/inspec-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/inspec-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/inspec-aws/labels{/name}","releases_url":"https://api.github.com/repos/chef/inspec-aws/releases{/id}","deployments_url":"https://api.github.com/repos/chef/inspec-aws/deployments","created_at":"2016-12-15T08:53:31Z","updated_at":"2017-10-10T07:14:59Z","pushed_at":"2017-10-11T00:21:59Z","git_url":"git://github.com/chef/inspec-aws.git","ssh_url":"git@github.com:chef/inspec-aws.git","clone_url":"https://github.com/chef/inspec-aws.git","svn_url":"https://github.com/chef/inspec-aws","homepage":"https://www.inspec.io/","size":105,"stargazers_count":26,"watchers_count":26,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":25,"forks":9,"open_issues":25,"watchers":26,"default_branch":"master"}},"base":{"label":"chef:master","ref":"master","sha":"0bce3858363ed5326c0d1f160818589f60a1209f","user":{"login":"chef","id":29740,"avatar_url":"https://avatars3.githubusercontent.com/u/29740?v=4","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":76541829,"name":"inspec-aws","full_name":"chef/inspec-aws","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars3.githubusercontent.com/u/29740?v=4","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/inspec-aws","description":"InSpec for AWS (Incubation)","fork":false,"url":"https://api.github.com/repos/chef/inspec-aws","forks_url":"https://api.github.com/repos/chef/inspec-aws/forks","keys_url":"https://api.github.com/repos/chef/inspec-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/inspec-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/inspec-aws/teams","hooks_url":"https://api.github.com/repos/chef/inspec-aws/hooks","issue_events_url":"https://api.github.com/repos/chef/inspec-aws/issues/events{/number}","events_url":"https://api.github.com/repos/chef/inspec-aws/events","assignees_url":"https://api.github.com/repos/chef/inspec-aws/assignees{/user}","branches_url":"https://api.github.com/repos/chef/inspec-aws/branches{/branch}","tags_url":"https://api.github.com/repos/chef/inspec-aws/tags","blobs_url":"https://api.github.com/repos/chef/inspec-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/inspec-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/inspec-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/inspec-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/inspec-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/inspec-aws/languages","stargazers_url":"https://api.github.com/repos/chef/inspec-aws/stargazers","contributors_url":"https://api.github.com/repos/chef/inspec-aws/contributors","subscribers_url":"https://api.github.com/repos/chef/inspec-aws/subscribers","subscription_url":"https://api.github.com/repos/chef/inspec-aws/subscription","commits_url":"https://api.github.com/repos/chef/inspec-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/inspec-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/inspec-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/inspec-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/inspec-aws/contents/{+path}","compare_url":"https://api.github.com/repos/chef/inspec-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/inspec-aws/merges","archive_url":"https://api.github.com/repos/chef/inspec-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/inspec-aws/downloads","issues_url":"https://api.github.com/repos/chef/inspec-aws/issues{/number}","pulls_url":"https://api.github.com/repos/chef/inspec-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/inspec-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/inspec-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/inspec-aws/labels{/name}","releases_url":"https://api.github.com/repos/chef/inspec-aws/releases{/id}","deployments_url":"https://api.github.com/repos/chef/inspec-aws/deployments","created_at":"2016-12-15T08:53:31Z","updated_at":"2017-10-10T07:14:59Z","pushed_at":"2017-10-11T00:21:59Z","git_url":"git://github.com/chef/inspec-aws.git","ssh_url":"git@github.com:chef/inspec-aws.git","clone_url":"https://github.com/chef/inspec-aws.git","svn_url":"https://github.com/chef/inspec-aws","homepage":"https://www.inspec.io/","size":105,"stargazers_count":26,"watchers_count":26,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":25,"forks":9,"open_issues":25,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/inspec-aws/pulls/89"},"html":{"href":"https://github.com/chef/inspec-aws/pull/89"},"issue":{"href":"https://api.github.com/repos/chef/inspec-aws/issues/89"},"comments":{"href":"https://api.github.com/repos/chef/inspec-aws/issues/89/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/inspec-aws/pulls/89/comments"},"review_comment":{"href":"https://api.github.com/repos/chef/inspec-aws/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chef/inspec-aws/pulls/89/commits"},"statuses":{"href":"https://api.github.com/repos/chef/inspec-aws/statuses/3c4f63f9fa4533b2469e6109d68886e87c2bd16d"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"aduric"}}