passbolt / passbolt_slack

Slack plugin for passbolt v1
11 stars 3 forks source link

As a passbolt and slack user I would like to receive a personal notification when a password is shared with me. #1

Open stripthis opened 7 years ago

stripthis commented 7 years ago

https://github.com/passbolt/passbolt_api/issues/116

silentsilas commented 7 years ago

Seems easy enough. I'll try emitting an event when sharing is successful here, and add it to the list of events the Slack API is listening for.

I'm giving Passbolt a try this weekend, so I'll see if I can implement this after it's all set up. It'd be a great feature to have.

stripthis commented 7 years ago

Hi @Poeticode that's great, let us know how it goes and if you need help for review!

silentsilas commented 7 years ago

It seems that this will be a bit more difficult than I thought. I forked the two repos and got it to broadcast to a channel whenever someone shares a password with another user.

But, to have it send a private message to the user, which is what the original request is for, would require that the app knows what the user's Slack username or Slack IM channel ID is. I might dive into the code a few weeks from now to see if I can add this as an optional property for the user's profile.

Also, the user sharing the password will see an error at the bottom of their page that says the URL is probably formatted incorrectly. Having difficulties finding out what's causing this, but my guess is that something doesn't like how the Slack webhook URL looks.

stripthis commented 7 years ago

@Poeticode it seems you can get the slack user id from the users.list API endpoint. Maybe you can get the IM channel of the passbolt bot from the im.list API endpoint and cache it, or ask the user to store in the plugin configuration. Concerning the storage of the code I would recommend storing it in a separate table, maybe something like: one User has one SlackId where Slack id =

**Slackld**
id: UUID(36) not null primary key
user_id:UUID(36) not null 
slack_id:string(256) not null
created:datetime not null
modified:datetime

Btw, as a head's up in case you have not seen, we will be migrating to Cakephp v3 in August, so this plugin will also need to be migrated along with it (unless you want to wait and restart it once migration is done).

silentsilas commented 7 years ago

@stripthis Yeah, I think I'll wait for the v3 migration before working on this further. I'll just get myself accustomed to the codebase for now. I think my team would be interested in using Passbolt once Categories is implemented, so I'd like to help out with that in the future. I'm primarily a Laravel dev, so it'll take some time getting used to how Cake v3 does things. :P

Until that time comes, would the following gameplan be good?