StateVoicesNational / Spoke

mass-contact text/SMS distribution tool
Other
464 stars 407 forks source link

Feature Request: Set per-org NGP_VAN_API_KEY in UI, similar to Twilio #1693

Open mayefsky opened 4 years ago

mayefsky commented 4 years ago

Based on reading code I am pretty sure (but would love confirmation!) that:

--You can have per-organization differing VAN API keys --The current way to achieve this is to edit the features column in the Organizations table directly --Unlike the Twilio secret there's no encryption handling

If someone can confirm I can do the DB edit I would really appreciate that, but having it in the UI similar to the Twilio option would be great as well...thank you!

Frydafly commented 4 years ago

@bobbyoderek yes you can edit the features in the organization table


{ "NGP_VAN_APP_NAME": "YOUR HUSTLE API KEY NAME", "NGP_VAN_API_KEY": "YOUR API KEY" } 

Then clear the redis cache using Heroku CLI:


heroku redis:cli -a [YOUR_HEROKU_APP_NAME] --confirm [YOUR_HEROKU_APP_NAME]

FLUSHDB
mayefsky commented 4 years ago

Thank you @Frydafly! There was some unexpected permanence when I was messing around and it coming from redis makes sense/saves me a headache.

allibail commented 4 years ago

My team is also interested in a UI for NGP VAN credentials. We have a multi-tenant deployment that could really use this.

mayefsky commented 4 years ago

@Frydafly (or anyone but you seem to have experience!) do you have any suggestions for cleverly handling organizations that want to pull lists from both MyC and MyV when using per-organization keys? I was thinking of just literally cloning the contact importer/action handler and either appending the '|0' or '|1' where the query is assembled, or storing them separately in the database, but both ways seem a little clunky.

bxjw commented 4 years ago

Yes, we'd also find it helpful if you could choose between MyC and MyV in different instances across organizations. It looks like the code automatically goes with "|0" as is, if I'm reading it right?

codygordon commented 4 years ago

@bobbyoderek @allibail @bxjw – this is a WFP priority and fairly trivial, so I'm going to work on implementing it. Can you all confirm you have not begun work on this yet?

mayefsky commented 4 years ago

I have not done work in this direction but @lperson has and I think some of it got into 8.1/9.0; I haven't been able to poke around myself yet but planning to upgrade to 9.0 and test this out this coming week.

bxjw commented 4 years ago

Ah, yes, looks like this is the relevant PR? We'll have to try it.