Limit the code a plugin can run in dotnet core - plugins

I'm looking at implementing a plugin architecture where I will have end users write plugins that I will execute in the application I'm developing (.net-core 2.0 console application). I load the plugins dynamically at runtime and they implement a plugin interface in a shared assembly. I do want to limit the actions that the user can perform from the plugin and therefore I provide the plugin with an API object. Is there a way to limit the plugin so that it only can use that API? In .NET 4.x I could do this with AppDomains and Code Access Security but haven't found a way to do the same in dotnet core yet. Any ideas how to solve this?

Related

what is the need & use of apache felix web console bundle in liferay 7.1

I am new in liferay want to perform crud operation using service builder so i want to understand need & use of apache felix web console bundle in liferay 7.1 so that i use it in order to check json/webservice api.
I would say you are not looking at the right tool for the job.
The console enables you to interact with the OSGi framework, a good place to start is not on the console but on the file systems if you are looking into understanding how Liferay uses the framework. The framework is embedded into the web app in order to provide the environment where bundles can live and provide services collectively.
Gogo is an auxiliary tool that enables interaction, you can query if bundles are installed, check the dependencies that you missed and who is providing a certain service or exposing a package.
Most of day-to-day of this kind of information you can also find in the app manager and/or logs.
About testing you api, I assume you are looking for seeing if it was installed and if it was resolved and activated. The app managers can provide the first clue for this, but gogo is an adequate tool as well, you will need to learn its commands and syntax. Do not worry they are trivial, you can find a description on the Apache's project page an on Liferay's dev guide.
Now, if you are looking to test the API for correctives or availability, using gogo will demand custom commands and lots of extra logic other tools provide for you.

ModernHttpClient Not Compartible with Web Appication Project

i am currently using Restclient to send request via web api for xamarin, it works well with windows and ios but i doesnt work for andriod , i searched and found a nuget package that will help, called ModernHttpClient,so it changes my code from var httpclient = new HttpClient(); to var httpClient = new HttpClient(new NativeMessageHandler()); but when i install it for the web application i keep getting an error stating the package is not compatible with the project. but it installs ok in android,ios and windows. i tried uninstalling it from the web application but i doesnt work in the code unless it appears in all the project.
so i want to find the reason why the package is not compatible with the web appication or a solution to the Restclient request not working on android .
Unfortunately the product page for modernhttpclient on nuget.org doesn't list any dependencies, but changing the domain name of the URL to use fuget.org instead of nuget.org lists monoandroid, monotouch, portable-net45+winrt45+wp8+wpa81, and xamarin.ios10. Therefore, these are the target frameworks that the package supports.
Another way to check what TFMs (target framework monikers) a package supports is to find/download the nupkg and then open it as a zip file, or use NuGet Package Explorer to look for subfolders under lib/.
You didn't say what target framework your web app is using, but this is where things start getting very complicated and I don't understand it very well. .NET Framework TFMs are compatible with other .NET Framework TFMs of lower versions. Similarly .NET Core TFMs are compatiable with other .NET Core TFMs of lower versions. .NET Standard is a whole other complication. NuGet also supports fallback or alternate TFM compatibility, to allow .NET Core apps to use libraries targetting .NET Framework, but it's a best guess and might fail at runtime (maybe it's even possible to fail to compile, I'm not sure, but restore will succeed with a warning). Given you're not getting the warning, but instead an error, it suggests to me that portable-net45 is not compatible with net45 and therefore probably isn't compatible with whatever target framework you're using with your web app (unless your web app is targetting net40 or earlier).
Having said all that, when I was looking at the package to see which frameworks it targets, I saw that the whole point of the package is to use the platform native HTTP stack, instead of Xamerin's HTTP stack on the mobile platforms. Your web app isn't running on a mobile platform, it's running on either .NET Core or .NET Framework, so you shouldn't need the package. I suggest you use #if, #else and #endif to use NativeMessageHandler only on Android and IOS, and then use the default HTTPClient constructor (or use HttpMessageHandler) on other platforms.

how to mange Alfresco process service development in code repository with versioning

I am currently working on Alfresco process service 1.8 version. In this I have developed some workflows using Web user interface.
I just wanted to know whether it is a standard process or not, As previously I worked on Alfresco content service and in ACS we are having All-in -one maven project that we used to keep in Git-lab repository after development for managing versioning after new development.
but In case on Alfresco process service we are developing workflow directly using user interface, is there any other standard process that we can use Instead of user interface.
Please suggest the best approach to manage code & development in Alfresco Process service 1.8
There is a blog post about how to test the models and the code related to them as part of a pipeline - please feel free to give feedback on its suggestions (preferably on the comments section)

Integrate automated GWT GUI testing with build system

I am in flux for integrating an automated GUI testing with my build system. My GUI application is developed in GWT. I use HUDSON as my automated build system. I would like to perform sanity test of my application. As I understand, the entire test setup will have following steps.
Build and deploy the application in predefined application server. In my case, it would be create and install the application in Android emulator.
Start/Launch the application.
Perform pre-defined user actions(UI Test cases) and validate them.
Somehow include validations for different browsers. I am really not sure how can I do this.
Generate report of test cases performed.
I am not posting the details of application as I think this detail will not make any difference in the approach. Can somebody guide me using past experience if this is possible and if it is then to what extent. The best UI automation tool (preferably open source) which can fit easily here.
We use TeamCity as build server for a GWT application. We just use it as a build server with two tasks: compile sources into Javascript, and deply war file to Tomcat application server. Although I didn't manually set it up yet, I believe it's possible to add a third task for UI testing using Selenium (which we used for another JSF web application testing).
A fairly good example of using Selenium automated testing is RichFaces. If you download its source code package, it includes hundreds of UI-testnig codes written generated by Selenium.

Building an Issue Tracker Plugin for TortoiseSVN

I've read a lot about IBugTraqProvider interface and implementing an issue tracker into the commit dialog of TortoiseSVN.
IBugTraqProvider is written here.
Is there a more simpler way not to do it, building the plug-in and installing it on TortoiseSVN. The Document is not that clear that a developer can create its own plugin.
I'm working with SalesForce as the Issue Tracker, and retrieved the WSDL file to integrate with the Working Items. Now I need to know how to connect it to TortoiseSVN.
Please any suggestions?
Take a look at issue-tracker-plugins.txt in the contrib directory in the TSVN source code. There's a fairly decent example in C# that should get you heading in the right direction.
When I built a plugin, I built a test harness that passed arbitrary information using the IBugtraqProvider interface, so that I could debug the plugin whilst building it, without having to reinstall the plugin into TSVN each time.