API Goverment rules in WSO2 - wso2

I would like to implement automatic rules of API Goverment in a WSO2 API Manager platform like, for example, validating context with a regular expresion, or version numbering or API name or API resources endpoint naming or parameters, etc.
I checked in version 2.6.0 (and previous versions of major 2) that it can be done in jaggery apps of publisher, but this is a mix of data and presentation (view structure with js and html) and it is not a clear and right way to implement it.
Is there any rules engine or other dedicated mechanism to do it? If not, is it in the roadmap of WSO2 AM to add this kind of features? It would be great.

APIM 3.x onwards UIs are implemented using react and backend services are exposed via REST APIs. SO from this version onwards, this is clearly separated. UI level validations can be changed in the React and if there are any additional validations required, REST API interceptors or workflow interceptors can be used to enforce any validations.

Related

What is the official way to customize, extend and move the API Publisher and API Store out of the WSO2 API Manager server?

WSO2 reached out to me in Twitter and told me to put a question here if I had one.
My client wants to customize (for now it only means changing the layout of things) the API Publisher and API Store from a WSO2 API Manager 2.0.0.
Since I know that inevitably we will get to the point where the changes are going to be profound and require external libraries for new functionality (we have a library of AngularJS code which I know they will want to use), I want to know:
What is the official, recommended way to customize and extend the web applications for the API Store and the API Publisher? I need to have version control, unit testing, etc.
Is there a way to move these web apps out of the APIM server and into their own server? All our UI applications are hosted in a specific server.
Realistically, how much change can I introduce before make making an awful mess?
Thank you.
You can create new themes and subthemes for API publisher and store UIs. You can refer docs here.
Please note that publisher and store apps are written in Jaggery. You need a Jaggery server to host Jaggery apps.
If you want to add more functionality to the UI, you can either write jaggery, or you'll have to write your own web application (maybe with AngularJS or any other). In that case, you can use APIM REST APIs to talk to APIM backend.

WSO2 ESB, REST Apis Versioning strategy

I have PizzaV1.0.0 API, which strategy does it use to generate a new V2.0.0 version and keep both in ESB.
If version the CAR, the duplicity of APIs and Sequences.
I have not found a way to version the APIs in eclipse, I need to version the API and some sequences that have changed.
In API Manager I created a new version, now I have two versions published.
What versioning strategy do you use in ESB to stay in sync with API Manager?
Maybe this post can help you
http://nandikajayawardana.blogspot.com.br/2014/02/proxy-service-version-management-with.html
I do what they describe and it is working great.

Wirecloud authentication using keystone only?

The instructions for providing FIWARE based authentication for Wirecloud suggest installing KeyRock (a frontend/backend combo of the Horizon/Keystone GE). Is the frontend (Horizon) really necessary if the only application to be secured is a Wirecloud instance (and possibly some backend services). The point is to avoid, if possible, to have to configure/style/maintain etc. a second frontend. Is it possible to authenticate directly using a Django plugin like this? Pros and cons?
WireCloud is currently linked to the use of django.contrib.auth, any authentication plugin based on it should work. Moreover, the instructions for using KeyRock are using python-social-auth so, in fact, you can use it for authenticating using any of the backends supported by python-social-auth: GitHub, Twitter, OpenId, ...
In that regard, I don't see any problem in the use of the plugin you are proposing (Although I have not tested it).
The advantage of using the KeyRock backend provided by WireCloud is that it enables operators and widgets to propagate the credentials to third-party services using KeyRock for authentication (e.g. Orion Context Broker, Object Storage, ... and in general, any service behind a PEP proxy).

How can I wrap the Sitecore 8 itemWebApi to apply custom business logic to API responses?

I have a requirement to build a service endpoint to provide specific Sitecore 8.0 items (containing a given field value in a given branch of the content tree) to requesting mobile app clients. Encapsulating this logic (and perhaps some other calculations, etc) means the out-of-the-box API is not suitable.
I'd like to mimic an existing SOAP service exposed by another CMS, however I'm not above using a modified version of the RESTful itemWebApi if it confers greater code reusability or upgrade-safety.
Based on my research thusfar, it would appear my options are to build a custom handler, a completely separate asmx service (ala this approach), or to build a custom controller (similar to this custom Web API controller method).
Overriding or replacing the default pipeline processors for the itemWebApi does not seem viable, as I don't want to replace/modify the OOB API if I can avoid it.
Has anyone with the same type of requirement for Sitecore 8 found a better approach?
The approach I chose was to create a separate service "router" developed using the adapter pattern to be consumed by our mobile app clients. The router in turn calls the Sitecore ItemWebApi.
This fit my needs the best as it is completely decoupled from the Sitecore application and the client can be modified if necessary without impacting the endpoint.
It would also be worth looking to EntityService within Sitecore.Services.Client in Sitecore 8. Its a Web API based service but has more flexibility over the standard Sitecore Item Web API because you can define your model and the business logic yourself.
I can see you have mention my other blog post on adding a custom Web API controller. Enitity Service is different, it's a framework by Sitecore to achieve a standard way of creating custom web service for Sitecore.
I have written a blog post on EntityService. It has both a Javascript and standard rest based API to communicate with the service too.
http://mikerobbins.co.uk/2015/01/06/entityservice-sitecore-service-client/
Example Application here: https://github.com/sobek1985/EntityServiceDemo
And a few more posts on advanced features in Entity Service: http://mikerobbins.co.uk/category/sitecore/sitecore-service-client/

How do i find all the api's exposed on WSO2 EMM

is there any other route other than the route mentioned in another post (pasted the post details below), where need to look into a bunch of files and understand the api's exposed.
=====
Yes its possible. All the functions in EMM are exposed as APIs. You better look at the scripts at wso2emm-1.1.0\repository\deployment\server\jaggeryapps\emm\api to get an idea on the APIs in EMM. You can find the endpoints inside those js filese. Also please note that this app is written using JaggeryJS. For the authentication you may look at SAML sso which has been used in EMM. For this you could use a modal dialog to load the SSO page or else you may modify it to support OAuth as follows.
WSO2 EMM does not expose any APIs, that supports registering a device other than Android or iOS as they are the supported platforms. The quoted text is from a question related to iOS.