Using REST API to run server based script file
|
08-27-2014, 01:31 AM
Post: #1
|
|||
|
|||
Using REST API to run server based script file
I am wondering if the REST API can be used to load and run a script file hosted on the private instance?
I would like to be able to submit a request from an application of our and passing the script via a post is less than ideal (login info would need to be passed). Thanks |
|||
08-30-2014, 01:48 AM
Post: #2
|
|||
|
|||
RE: Using REST API to run server based script file
No, it can't pull pre-defined scripts (currently anyway).
|
|||
08-30-2014, 04:40 AM
Post: #3
|
|||
|
|||
RE: Using REST API to run server based script file | |||
08-30-2014, 04:54 AM
Post: #4
|
|||
|
|||
RE: Using REST API to run server based script file
Shouldn't be too hard. Somewhere around here: https://github.com/WPO-Foundation/webpag...st.php#L76
Add a new parameter that identifies pre-defined scripts (say "runscript") and if that parameter is set go load the script into $test['script']. It will get treated as if it was passed in from that point on (do it after $test['script'] is initially set or it will be overwritten). You need to be a bit careful about server attacks so don't pass in the actual file name unless you do some regex scrubbing. Another option (maybe cleaner) would be to define script replacement strings and in ValidateScript ( https://github.com/WPO-Foundation/webpag....php#L1105 ) you could do the string replacement like we do for the built-in %URL% and %HOST% placeholders. |
|||
08-30-2014, 05:16 AM
Post: #5
|
|||
|
|||
RE: Using REST API to run server based script file
Ahh cool. Thanks for the info, the cleaner is a good idea.
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)