{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/441","labels_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/441/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/441/comments","events_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/441/events","html_url":"https://github.com/strongloop/loopback-datasource-juggler/issues/441","id":57225987,"number":441,"title":"Observe after access","user":{"login":"cajoy","id":1035148,"avatar_url":"https://avatars.githubusercontent.com/u/1035148?v=3","gravatar_id":"","url":"https://api.github.com/users/cajoy","html_url":"https://github.com/cajoy","followers_url":"https://api.github.com/users/cajoy/followers","following_url":"https://api.github.com/users/cajoy/following{/other_user}","gists_url":"https://api.github.com/users/cajoy/gists{/gist_id}","starred_url":"https://api.github.com/users/cajoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cajoy/subscriptions","organizations_url":"https://api.github.com/users/cajoy/orgs","repos_url":"https://api.github.com/users/cajoy/repos","events_url":"https://api.github.com/users/cajoy/events{/privacy}","received_events_url":"https://api.github.com/users/cajoy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=3","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"milestone":null,"comments":14,"created_at":"2015-02-10T19:44:30Z","updated_at":"2015-03-31T09:32:43Z","closed_at":null,"body":"I see there is couple of observers such as \"access\", \"create\" and etc.\r\n\r\nWhat I need is \"after find\".\r\n\r\nThe reason is: I need to encrypt/decrypt data in database.\r\n\r\nSo basically before save I can encrypt data with the key.\r\nBut I can't decrypt data after find.\r\n\r\nI've tried with getter/setter but it doesn't work.\r\n\r\nCan someone help me with the issue?\r\n\r\nThanks, Alex\r\n"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/comments/88014026","html_url":"https://github.com/strongloop/loopback-datasource-juggler/issues/441#issuecomment-88014026","issue_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/441","id":88014026,"user":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=3","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"created_at":"2015-03-31T09:32:43Z","updated_at":"2015-03-31T09:32:43Z","body":"> IMO, the hooks are not the right tool for transparent encryption of model properties (data), because the instance passed to \"before save\" hooks is then returned in the server response. The HTTP client will thus receive encrypted data, unless you implement also an \"after save\" hook that would decrypt them.\r\n\r\n> Could you please open a new issue in loopback requesting the feature for an easy way how to specify a different database representation of the model data?\r\n\r\nSee https://github.com/strongloop/loopback/issues/1260"}}