SkyeHoefling / dnn-powershell

A DNN Powershell Module
MIT License
6 stars 0 forks source link

Initial Scope Discussion #2

Open SkyeHoefling opened 7 years ago

SkyeHoefling commented 7 years ago

This is an email discussion that got started today with Peter Donker, Daniel Mettler, Kelly Ford, David Poindexter, Clint Patterson and Andrew Hoefling. The discussion have been copied and pasted into this issue to make the communication open for anyone to participate in.

Hoefling Software Mail - DNN Prompt and MS Powershell.pdf

The purpose of this issue is to discuss MVP goals and to start coming up with tangible items to put into the MVP document.

david-poindexter commented 7 years ago

Great conversation guys – looking forward to seeing how things progress here via GitHub! Just so everyone knows, the next release of nvQuickSite will have command line execution support.

SkyeHoefling commented 7 years ago
david-poindexter commented 7 years ago
donker commented 7 years ago

Currently all prompt commands are run through WebAPI. This makes our challenge significantly easier IMHO. All you'd need to do is to call this using an authenticated call and you should be able to run any command present in Prompt.

Is this the path we'll be travelling?

SkyeHoefling commented 7 years ago

@donker Thanks for sharing this information:

Currently all prompt commands are run through WebAPI

I haven't had a chance to review the implementation details of the Prompt and wasn't sure how it worked. Knowing that it uses WebAPI significantly simplifies the implementation that we have to do. I think it'll be appropriate to leverage that existing architecture so the Prompt code and the PowerShell code can stay as close together as possible.

donker commented 7 years ago

What you should do is to run prompt and open up your dev tools so you can see the web traffic. Then do a command like "list-commands" and you'll quickly see how this was made. It's not rocket science and I think it's the easiest way to drill into DNN because you're independent from implementation details and location.

david-poindexter commented 7 years ago

I mentioned this via #3 but there are two endpoints in Prompt.

Where Prompt needs some work is in the area of getting (via the API) options/params/help for individual commands. That would greatly help towards our goals here.

donker commented 7 years ago

This is the prompt WebAPI:

https://github.com/dnnsoftware/Dnn.AdminExperience.Extensions/blob/development/src/Modules/Settings/Dnn.PersonaBar.Prompt/Services/CommandController.cs

donker commented 7 years ago

One of the more "hacky" things we'll need to do is to get an antiforgerytoken from the server before we can issue a command. Simply authenticating the call won't cut it. The Cmd method is POST and has the ValidateAntiForgeryToken attribute. This is doable but feels a bit like a hack. Which is what we're doing anyway.

david-poindexter commented 7 years ago

Sorry for the cross-talk, but wanted to also reference this JIRA issue here as well.

donker commented 7 years ago

Antiforgery proves to be a hurdle we can take. Using Jwt you bypass it.