WSO2 APIM URL pattern mediation script - wso2-api-manager

I am using WSO2 APIM v2.0.0 and working through a POC.
I managed to understand and use message mediation policies on in/out/fault flows. This mediation policy applies to the entire API.
But I would like to use a mediation script for various URL pattern defined under the same API.
I found the following in the gateway (Carbon) under resources. Are you able to guide me with a documentation of implementing this please.
Thanks in advance.

You can't engage mediation sequences per URL pattern. But you can for in sequence and out sequence separately.
In your case, you can read request path within a mediation sequence like below and implement your logic depending on that.
<property name="ApiName" scope="transport" expression="$ctx:REST_SUB_REQUEST_PATH"/>
For more details, read this blog post.

Related

How to add Azure custom Policy for Azure Data Factory to only use Azure Key Vault during the Linked Service Creation?

How to add Azure custom Policy for Azure Data Factory to only use Azure Key Vault during the Linked Service Creation for fetching the Data Store Credentials instead of credentials being put up directly in ADF Linked Service. Please suggest ARM or PowerShell methods for the policy implementation.
As of yesterday, the Data Factory Azure Policy integration is available which means you can now find some built-in policies that can be assigned to ADF.
One of those is exactly what you're asking for as you can see in the image below. You can find more information here
Edit: Based on your comment, I'm editing this answer with the info you want. When it comes to custom policies, it's pretty much up to you to come up with them and create what fits your needs. In your particular case, I've created one policy that does what you want, please see here.
This policy will audit your data factory linked services and check if they're using a self-hosted integration runtime. Currently, that check is only done for a few types of integration runtimes (if you look at the policy, you can see 5 of them) which means that if you want to check more types of linked services, you'll need to add them to the list of allowed values and select them when assigning the policy definition.
Bear in mind that for some linked services types, such as Key Vault, that check won't make sense since that service can't use a self-hosted IR

Mule 4 : How to implement a policy in Mule 4 app and exclude API?

Scenario: After creating and adding an API in API exchange, we can add a policy like a rate limiting to it. After the policy is created we have the API fragment that we copy and paste in our RAML API specification.
My question is can we define the policy in RAML and implement the policy logic directly in the Mule app and remove the API Proxy in between.
If yes, can someone also please share the link to examples if there are any?
Add an autodiscovery element to your application. This is the Basic Endpoint use case described at https://docs.mulesoft.com/api-manager/2.x/api-auto-discovery-new-concept#proxy-endpoint-vs-basic-endpoint and https://docs.mulesoft.com/api-manager/2.x/configure-autodiscovery-4-task (assuming you are using Mule 4).
You need to configure everything manually, instead of the proxy which is autogenerated.
You can't do this in RAML as you described in your question.
but to add any policy logic other than the policies that are available in your API Manager, you can create your own custom policy and after creating upload that in your API manager and apply them.
Thanks

How to expose the data service using wso2ei

I am new to this area, can anyone please help me on this. Below is my requirement.
I have a data source and i want to access those data through REST service, i have created a data source and its giving response when executing as CURL command. Further what i want to do is need to expose that as REST service in WSO2EI and the endpoint have to be configured/publish in wso2 API manager.
Please guide me on the flow how to achieve this, I have tried my best but i couldn't make much progress.
Thanks in advance.
You can create DSS REST services by creating ODATA service [1]. If you are using ODATA, you do not need to manually define CURD operations. DSS server will automatically map RDBMS database with CURD operations.
Otherwise you can create custom REST service with Data services as it described in here[2]. Here you can define a REST service along with the SQL query that need to execute for particular request.
I found this blog[3] that contain instruction to expose Data service with WSO2 API manager with an example. This example generate ODATA service with WSO2EI and expose as managed API with WSO2 API manager as following diagram.
https://docs.wso2.com/display/EI640/Exposing+Data+as+an+OData+Service
https://docs.wso2.com/display/EI640/Exposing+a+Datasource+as+a+Data+Service
https://medium.com/wso2-learning/how-to-expose-your-database-as-a-managed-api-with-wso2-in-10-minutes-c9ac2595738b

SonarQube HTTP header authentication

Has anyone successfully implemented Sonarqube based on documentation given here ?
I have a project dashboard, which authenticates using my company's LDAP. The requirement is to use this authentication and invoke Sonar using X-Forwarded-Login & X-Forwarded-Name headers as mentioned in the documentation. Is there a way to achieve this ? Based on my analysis, this is not possible, since we cannot set headers for external redirects.
Is there anyway to achieve the stated objective ?

REST API's and PEGA

I can see that you have some expertise with REST API's and PEGA. I would like to know if we expose web call using REST API's to PEGA, will we get all custom rules and all or we need to replicate the rules?
Regards,
Sudhanshu
If you are consuming the REST API and will be using Pega as the REST client, you do not have to create the rules manually. There is an accelerator ("wizard") that will create the rules for you, based on an example request/response for the REST API.
REST mean "Representational state transfer" in pega to create the REST , it provides widget by using widget we can create it. Please visit the link for more updates:
https://myknowpega.blogspot.com/2019/04/pega-81-application-development.html
Since your question is not entirely clear, let me specify for both options (i.e., connector and service). Besides, I am assuming you are using the latest version of PEGA
Integrating Pega with an external service (via Connect-REST)
This can be achieved using the integration wizard by navigating as specified below Configure -> Integration -> Connectors -> Create REST Integration
Documentation to achieve it step by step is listed here
https://docs.pega.com/data-management-and-integration/84/creating-rest-integration
Pega Exposed as a service to external systems via Service-REST
It is bit of a manual process involving creation of service packages, service-REST rules and the configuring the methods GET/POST/PUT/PATCH/DELETE and its corresponding responses.
Documentation on the same is available here as indicated below.
https://docs.pega.com/data-management-and-integration/84/service-rest-rules

Resources