MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Proxy and AutoDiscovery), HTTPS Proxy, Accessing Non Mule Application With API Manager
The document summarizes an agenda for a MuleSoft Meetup Group discussing Anypoint Custom Policies, API Manager, and secrets management. The agenda includes introductions, demonstrations of custom policies, API manager features like automated policies and API proxying, and enabling HTTPS. It also briefly discusses integrating Auth0 with MuleSoft for authentication. The meetup aims to help attendees learn about extending API functionality through custom policies and managing APIs securely in Anypoint Platform.
Similar to MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Proxy and AutoDiscovery), HTTPS Proxy, Accessing Non Mule Application With API Manager
MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...Jitendra Bafna
Similar to MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Proxy and AutoDiscovery), HTTPS Proxy, Accessing Non Mule Application With API Manager (20)
MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Proxy and AutoDiscovery), HTTPS Proxy, Accessing Non Mule Application With API Manager
1. [17th Nov 2020]
[Surat] MuleSoft Meetup Group
MuleSoft Custom Policies, Anypoint API Manager,
API Group and Secrets Manager
2. 2
● Introduction
● Anypoint Custom Policies
● Anypoint API Manager (Mule Application and Non Mule Application)
● Enabling HTTPS for API Manage Proxy and Secret Manager
● Networking time
Agenda
3. 3
●About the organizer:
○ Jitendra Bafna – Managing Solution Architect at Capgemini
Introductions
A SHOW OF HANDS:
Who is new to this Meetup?
5. 5
Custom Policies are policies that anyone can develop and apply to their APIs, with the intention of
extending existing functionality or defining new ones.
The current workflow to get a working policy for Mule 4 that can be applied in Anypoint Platform
consists of:
Develop the policy.
Package the policy.
Upload the resulting policy assets to Exchange.
Apply the policy to any API through API Manager.
What is Custom Policies?
6. 6
The first step to develop a custom policy consists in setting up a project with the required files.
The easiest way to gather all your required files is by using the maven archetype.
One way to do so is by configuring Maven’s settings.xml with the following section:
Setting up a project with the archetype
<profiles>
<profile>
<id>archetype-repository</id>
<repositories> <repository> <id>archetype</id> <name>Mule Repository</name> <url>https://repository-
master.mulesoft.org/nexus/content/repositories/public</url> <releases> <enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy> </releases> <snapshots> <enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy> </snapshots> </repository> </repositories> </profile>
</profiles>
7. 7
Once maven profile has been setup, you can execute following command
Setting up a project with the archetype
mvn -Parchetype-repository archetype:generate -DarchetypeGroupId=org.mule.tools -DarchetypeArtifactId=api-
gateway-custom-policy-archetype -DarchetypeVersion=1.2.0 -DgroupId=${orgId} -DartifactId=${policyName} -
Dversion=1.0.0-SNAPSHOT -Dpackage=mule-policy
8. 8
hose four files are the basic ones needed for having a working policy.
pom.xml
groupId is defined as the organization ID used with the archetype. This value must remain as it
is.
mule-policy packaging, so packager plugin can successfully build the JAR.
distributionManagement section is defined pointing to user’s Exchange.
mule-maven-plugin responsible of packaging the policy into a deployable jar
maven-deploy-plugin configured to deploy both the resulting jar and the YAML when uploading
the policy to Exchange
mule-artifact.json exists for the mule-maven-plugin. This is the same file you need for Mule
applications.
my-custom-policy.yaml renders the policy configuration UI. If this file is not provided, the policy
won’t be able to be applied through API Platform’s UI.
template.xml where the actual logic of the policy and Mule configuration that defines the policy
behavior.
Setting up a project with the archetype
9. 9
This extension simplifies the modification of HTTP requests and responses that go through the
different policies.
HTTP Policy Transform Extension
10. 10
HTTP Policy Transform Extension
Operations
Add Headers Operations
Add Request Headers
Add Request Headers List
Add Response Headers
Add Response Headers List
Remove Headers
Set Response
Set Request
12. 12
API Manager
API Manager is a component of Anypoint Platform for managing APIs.
API Manager 2.x is tightly integrated with the following tools:
Design Center for creating the RAML structure of the API
The API design capabilities of Design Center replace the Jul 2017 API Designer tool in
Anypoint Platform.
Exchange for storing and publishing API assets
Assets are components, such as API versions, templates, and connectors owned by
MuleSoft or your organization.
Studio for implementing the API
A
PI changes made in Studio are synchronized using Autodiscovery with the API
registered in other tools, such as Design Center and API Manager.
13. 13
API Manager
API Policies
API Group
Automated
Policies
API Proxy
API Auto
Discovery
API Analytics
API Monitoring
API Alerts
Custom Policies
API Monitoring
Anypoint API Manager
14. 14
Anypoint API Proxy
CloudHub
Runtime Manager
API Manager
API Policies Security API Proxy
API
Analytics
API
Monitoring
Open Banking Proxy
(8081)
Open Banking Application
(8081)
http
http
16. 16
Anypoint HTTPS API Proxy (SSL Offloading)
CloudHub
Runtime Manager
API Manager
API Policies Security API Proxy
API
Analytics
API
Monitoring
Open Banking Proxy
(8082)
Open Banking Application
(8081)
TLS Context
Secret Manager – TLS Context/Truststore/Keystore
https
https
http
17. 17
Automated Policies
Configuring and using automated policies enables your Anypoint Platform instance to
comply with common security and logging requirements by automatically applying the
same set of policies to all APIs running in a single environment. With policy automation,
API owners can quickly design, build, and deploy secure and consistent APIs.
18. 18
Anypoint HTTPS API Proxy (SSL Offloading)
CloudHub
Runtime Manager
API Manager
API Policies Security API Proxy
API
Analytics
API
Monitoring
Open Banking Proxy
(8082)
Open Banking Application
(8081)
TLS Context
Secret Manager – TLS Context/Truststore/Keystore
https
https
http
19. 19
Anypoint HTTPS API Proxy (SSL Tunneling)
CloudHub
Runtime Manager
API Manager
API Policies Security API Proxy
API
Analytics
API
Monitoring
Open Banking Proxy
(8082)
Open Banking Application
(8082)
TLS Context
Secret Manager – TLS Context/Truststore/Keystore
https
https
https
20. 20
Accessing Non Mule Application Using API Proxy
CloudHub
Runtime Manager
API Manager
Non Mule Application
(Time Zone Application)
API Policies Security API Proxy
API
Analytics
API
Monitoring
API Proxy Application
(8081)
21. 21
Accessing Non Mule Application Using API Proxy
(On Premise or Private Cloud)
CloudHub
API Manager
API Policies Security API Proxy
API
Analytics
API
Monitoring
API Proxy Application
(8091)
Runtime Manager
VPC (192.168.1.0/24)
Corporate Datacenter
Non Mule Application
( Timezone
Application)
Anypoint VPN
Databases and
Service