SlideShare a Scribd company logo
1 of 26
1
February 18, 2023
Mysore MuleSoft Meetup
Part 2 - Handling NFRs of the API through API
Custom Policies
Safe Harbour Statement
● Both the speaker and the host are organizing this meet-up in individual capacity only.
We are not representing our companies here.
● This presentation is strictly for learning purposes only.
● Organizer/Presenter do not hold any responsibility that same solution will work for
your business requirements.
● This presentation is not meant for any promotional activities.
3
A recording of this meetup will be uploaded to events page within 24 hours
Questions can be submitted/asked at any time in the Chat/Questions and Answers Tab
Make it more Interactive!!!
Give us feedback! Rate this meetup session by filling feedback form at the end of the day
We Love Feedbacks!!! Its Bread & Butter for Meetup
Housekeeping
4
Introduction
● About the Organizers
5
Shubham Chaurasia
Billennium India
Pro Integration Developer
A SHOW OF HANDS:
Who is new to this Meetup?
Giridhar Meka
Sr. Technical Architect
linkedin.com/in/giridharmeka
linkedin.com/in/shubhamchaurasia1
6
Vijayaraghavan Venkatadri
Integration Architect
Introduction
● About the Speaker
✔ Working as an Integration Architect at Ernst & Young GDS
✔ 11+ years of experience in Integration and API products in
Solutioning & Design
✔ Spanning across MuleSoft, IBM stack & Cloud technologies
✔ MuleSoft Mentor & Speaker in the MuleSoft Community
✔ 6x certified in IBM & 2x certified in MuleSoft
Agenda
● Introductions
o Summary of Session One (Part 1 - Recap)
■ API’s NFR & Handling NFR
■ API Out of the Box Policies
■ API Policy Enforcement
o Handling NFR using Custom Policy
o Develop, Package, Publish & Manage a Custom Policy
o Use Case : Creating a Custom policy
● Demo
● Q & A
7
• Non-functional requirements define ground rules of how the implementation of the functional
requirements guarded and performed.
○ When it comes to API-First approach design, the NFR defines how the Web API
implementation should perform and react upon the Web API invocation by Web API client.
○ NFRs seeks below segments encapsulated in an API implementation such as performance,
security, compliance, consistency & reliability.
Summary of Session One (Part 1- Recap)
8
API’s Non-Functional Requirements
Handling Non-Functional Requirements
High Performant Runtime
Plane
API Design API Policy
Defines the scalability and
reliability by increasing the
throughput and processing time
of an API
Increases the consistency in delivering the data
and also increase the throughput, prevent data
loss being persistent
API Policy plays vital role in
handling the NFR to define the
security, compliance, Quality of
your service and operations
For example: CloudHub
For example: server-side caching,
asynchronous reliable implementations, etc.,
For example: Out-of-the-Box
policies, custom policies
✔ Compliance
○ Client ID enforcement
○ Cross-Origin Resource Sharing (CORS)
✔ Security
○ HTTP Basic Authentication API policies
■ Basic Authentication - LDAP
■ Basic Authentication - Simple
○ IP-based API Policies
■ IP blocklist
■ IP allowlist
Summary of Session One (Part 1- Recap)
9
Out of the Box (OOTB) API Policies
○ Threat Protection API Policies
■ JSON threat protection
■ XML threat protection
○ OAuth 2.0 access token enforcement API policies
■ OAuth 2.0 access token enforcement using Mule OAuth Provider
■ OpenAM access token enforcement
■ PingFederate access token enforcement
■ OpenId Connect access token enforcement
○ JSON Web Token
✔ Quality of Service - QoS
○ SLA-based API policies
■ Rate Limiting - SLA-based 10
Summary of Session One (Part 1- Recap)
Out of the Box (OOTB) API Policies
○ Non-SLA-based API Policies
■ Rate Limiting
■ Spike Control
■ HTTP Caching
✔ Transformation
○ HTTP header manipulation API policies
■ Header Injection
■ Header Removal
✔ Troubleshooting
○ Message Logging
11
Summary of Session One (Part 1- Recap)
Out of the Box (OOTB) API Policies
12
Summary of Session One (Part 1- Recap)
API Policy Enforcement
Mule Application
Non-Mule Application
(Non-Kubernetes cluster)
Non-Mule Application
(Kubernetes cluster)
On Anypoint Platform, the
embedded Mule runtime
enforce the API policies by
acquiring the API policy
enforcement capability within it
Any non-mule application requires
API proxies which can enable API
policy enforcement. API Proxies are
templated mule applications that
can be auto-generated by Anypoint
API manager. It is deployed to Mule
runtime which is typically called as
API Gateway
Anypoint Service Mesh enables API
policy enforcement which can be
installed by customers into their
customer-hosted Kubernetes
cluster. It builds on Istio, hence it is
required in Kubernetes cluster
before installing Anypoint Service
Mesh.
API policies will be
downloaded in Runtime from
API Manager control plane
using API Auto-discovery
Web API client should invoke API
proxies. Upon enforcing API
policies, the call will be routed to
actual API implementation
Web API clients can invoke Web
API implementation directly in which
Istio/Envoy directly intercept the
invocation and enforce API policy.
✔ Custom policy as the name denotes is a custom-made policy specific to the requirement which
you cannot fulfill through out of the box policies.
✔ These custom policies can developed, published as an asset and apply to the API in the API
Managers.
✔ Ideally a custom policy made of two important configuration files
○ Policy Configuration File: It is a YAML file where the policy parameters and metadata are
defined and subsequently rendered into User Interface field sections.
○ Policy Implementation File: It is a XML file where the actual custom policy logics
implemented and created a deployable JAR file.
Handling Non-Functional Requirements
✔ Custom Policy can accommodate both Functional and Non-Functional requirements. But is
predominantly intended for handling non-functional requirements such as
○ Checking Compliance
○ Additional Authentication
○ Custom Logging, etc..
Custom Policy
13
⮚ http-policy:proxy - The definition of a policy starts with this xml element. This element has an
argument that states the policy name.
⮚ http-policy:source - The element contains the instruction to execute and also can perform pre and
post processing activities before and after the HTTP listener event.
⮚ http-policy:execute - The element requires to execute actual Mule application or other policy.
▪ The instruction before the execute element will execute before executing Mule event processing.
▪ The instruction after the execute element will execute after executing Mule event processing.
Policy Implementation File - XML
14
An API having two custom policies in the order of authentication and logging
Policy Implementation File - XML
15
Execution Order
When an Web API invocation happens, the transaction route will take place in below pattern
★ Authenticate
★ Log-request
★ Flow execution
★ Log-response
✔ Like Mule application, custom policies also can use extension to make use of mule core capabilities.
✔ Example: mule-http-policy-transform-extension - is used to simplifies the modification of HTTP requests
and responses that go through the different policies.
✔ Also, custom code incorporation is allowed by using Mule plugin programmed using java or XML SDK.
Policy Implementation File - XML
16
Using Extension
✔ Applying API policies for the outbound calls i.e. outgoing HTTP calls within Mule application.
✔ http-policy:operation - is used to inject instructions before the Mule processing reaches the HTTP
requester.
Outbound Policies
Error Handling
✔ Mule 4 can handle errors thrown by API policy. Error handling can be done try and error-handler
elements.
✔ Once an error is caught by an error-handler, the error is either, propagated up the Mule Event
processing chain, or handled, where normal Mule event process execution continues
✔ Handlebars are simple templating framework which is required to control the execution of the
instructions within the Custom Policy.
✔ The execution will happen only when the appropriate criterias are selected.
○ It will access configuration values from YAML config file
○ Conditionally decides which section of the policy are applied depending on the selection criteria
○ Supports multiple operators
Policy Implementation File - XML
17
Handlebars
✔ Mule 4 uses this YAML file to store metadata and user parameters.
These parameters rendered in UI.
✔ This flexible design to allows policy to work for multiple API.
Policy Configuration File - YAML
18
Parameters Type
✔ Depending on the type of the parameter, the UI will render,
such as:
○ text boxes
○ radio buttons
○ checkboxes
✔ Mule 4 requires below steps for publishing a full-fledged custom policy
➢ Develop the policy
➢ Package the policy
➢ Upload the resulting policy assets to Exchange
➢ Apply the policy to any API through API Manager
Publishing Custom Policy
19
Develop the policy
✔ The first step to develop a custom policy consists in setting up a project with the required files.
✔ Maven archetype is the easiest way to gather required files in the project
✔ There are four files created and needed for a working policy
➢ pom.xml
➢ mule-artifact.json
➢ custom-policy.yaml
➢ template.xml
Publishing Custom Policy
20
Packaging the policy
✔ Use Maven plugin to package the policy into a deployable jar file.
✔ Use mvn clean package command to package your application
Upload the policy to Exchange
✔ In order to deploy to exchange, update your settings.xml with your exchange credentials or use
connected apps.
✔ Use mvn clean deploy command to deploy to Exchange.
Apply the policy to API via API Manager
✔ In the Anypoint API Manager, you can see the custom Policy is available in the Custom Policy section.
✔ Apply the Custom policy to the API you want.
USE CASE: Creating a Custom Policy
21
✔ A specific use case that an API receives customer creating request in which it has all the
customer information. As part of the customer creation in the backend, custId should be
generated in the response.
✔ Custom Logging Requirement
➢ Custom Message to be logged when the request is received.
➢ Should have option to dynamic plug and play logging in the request and the response.
➢ If the request logging is enabled,
■ Request attributes to be logged
■ Option of enabling/disabling of request attributes should be available.
➢ If the response logging is enabled
■ Response Payload to be logged
■ Option of enabling/disabling of response payload should be available.
POST /customers
Demo
Q&A
Take a stand !
● Nominate yourself for the next meetup speaker and suggest a topic as well.
24
● Share:
○ Tweet using the hashtag #MuleSoftMeetups
○ Join Mysore Group: https://meetups.mulesoft.com/mysore/
● Feedback:
○ Fill out the survey feedback and suggest topics for upcoming events
○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program
○ Reach out to Mysore Meetup Leaders (Shubham/Giridhar) to suggest topics
for next Meetup
What’s next?
25
Thank you

More Related Content

Similar to Handling NFRs for the API through API policies (Custom Policies) -Part 2 | MuleSoft Mysore Meetup #26

Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10D.Rajesh Kumar
 
Mule Meetup Calgary- API Governance & Conformance.pdf
Mule Meetup Calgary- API Governance & Conformance.pdfMule Meetup Calgary- API Governance & Conformance.pdf
Mule Meetup Calgary- API Governance & Conformance.pdfNithaJoseph4
 
12th Manila MuleSoft Meetup May 2022
12th Manila MuleSoft Meetup May 202212th Manila MuleSoft Meetup May 2022
12th Manila MuleSoft Meetup May 2022Ryan Anthony Andal
 
ASM Course Content.pdf
ASM Course Content.pdfASM Course Content.pdf
ASM Course Content.pdfviditsir
 
You can't make a (Denver) omelette without breaking eggs: Using OpenStack pol...
You can't make a (Denver) omelette without breaking eggs: Using OpenStack pol...You can't make a (Denver) omelette without breaking eggs: Using OpenStack pol...
You can't make a (Denver) omelette without breaking eggs: Using OpenStack pol...Brian Rosmaita
 
[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...
[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...
[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...jorgelebrato
 
Indianapolis mulesoft meetup_sep_11_2021
Indianapolis mulesoft meetup_sep_11_2021Indianapolis mulesoft meetup_sep_11_2021
Indianapolis mulesoft meetup_sep_11_2021ikram_ahamed
 
Warsaw MuleSoft Meetup #7 - custom policy
Warsaw MuleSoft Meetup #7 - custom policyWarsaw MuleSoft Meetup #7 - custom policy
Warsaw MuleSoft Meetup #7 - custom policyPatryk Bandurski
 
Customer segmentation and marketing automation with Apache Unomi
Customer segmentation and marketing automation with Apache UnomiCustomer segmentation and marketing automation with Apache Unomi
Customer segmentation and marketing automation with Apache UnomiMichael Ghen
 
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...Jitendra Bafna
 
Policy Guided Fulfillmentof Murano Applications
Policy Guided Fulfillmentof Murano ApplicationsPolicy Guided Fulfillmentof Murano Applications
Policy Guided Fulfillmentof Murano Applicationsrpospisil
 
Singapore MuleSoft Meetup - 24 Aug 2022
Singapore MuleSoft Meetup - 24 Aug 2022Singapore MuleSoft Meetup - 24 Aug 2022
Singapore MuleSoft Meetup - 24 Aug 2022Royston Lobo
 
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...Jitendra Bafna
 
PhillyForce 2018 - Salesforce Platform Keynote
PhillyForce 2018  - Salesforce Platform KeynotePhillyForce 2018  - Salesforce Platform Keynote
PhillyForce 2018 - Salesforce Platform Keynoteandyinthecloud
 
MuleSoft Meetup | Reading Meetup Group | Hosted by Integral Zone
MuleSoft Meetup | Reading Meetup Group | Hosted by Integral ZoneMuleSoft Meetup | Reading Meetup Group | Hosted by Integral Zone
MuleSoft Meetup | Reading Meetup Group | Hosted by Integral ZoneIntegralZone
 
A Vision On Integrated Inspection Planning Prototyping
A Vision On Integrated Inspection Planning PrototypingA Vision On Integrated Inspection Planning Prototyping
A Vision On Integrated Inspection Planning PrototypingGH_Wijnants
 
Mulesoft Meetup Roma - Monitoring Framework & DevOps.pptx
Mulesoft Meetup Roma - Monitoring Framework & DevOps.pptxMulesoft Meetup Roma - Monitoring Framework & DevOps.pptx
Mulesoft Meetup Roma - Monitoring Framework & DevOps.pptxAlfonso Martino
 
Microservices & anypoint service mesh calgary mule soft meetup
Microservices & anypoint service mesh   calgary mule soft meetupMicroservices & anypoint service mesh   calgary mule soft meetup
Microservices & anypoint service mesh calgary mule soft meetupJimmy Attia
 
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...Jitendra Bafna
 

Similar to Handling NFRs for the API through API policies (Custom Policies) -Part 2 | MuleSoft Mysore Meetup #26 (20)

Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10
 
Mule Meetup Calgary- API Governance & Conformance.pdf
Mule Meetup Calgary- API Governance & Conformance.pdfMule Meetup Calgary- API Governance & Conformance.pdf
Mule Meetup Calgary- API Governance & Conformance.pdf
 
12th Manila MuleSoft Meetup May 2022
12th Manila MuleSoft Meetup May 202212th Manila MuleSoft Meetup May 2022
12th Manila MuleSoft Meetup May 2022
 
ASM Course Content.pdf
ASM Course Content.pdfASM Course Content.pdf
ASM Course Content.pdf
 
You can't make a (Denver) omelette without breaking eggs: Using OpenStack pol...
You can't make a (Denver) omelette without breaking eggs: Using OpenStack pol...You can't make a (Denver) omelette without breaking eggs: Using OpenStack pol...
You can't make a (Denver) omelette without breaking eggs: Using OpenStack pol...
 
[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...
[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...
[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...
 
Indianapolis mulesoft meetup_sep_11_2021
Indianapolis mulesoft meetup_sep_11_2021Indianapolis mulesoft meetup_sep_11_2021
Indianapolis mulesoft meetup_sep_11_2021
 
Warsaw MuleSoft Meetup #7 - custom policy
Warsaw MuleSoft Meetup #7 - custom policyWarsaw MuleSoft Meetup #7 - custom policy
Warsaw MuleSoft Meetup #7 - custom policy
 
Customer segmentation and marketing automation with Apache Unomi
Customer segmentation and marketing automation with Apache UnomiCustomer segmentation and marketing automation with Apache Unomi
Customer segmentation and marketing automation with Apache Unomi
 
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
 
BRE Deep Dive
BRE Deep DiveBRE Deep Dive
BRE Deep Dive
 
Policy Guided Fulfillmentof Murano Applications
Policy Guided Fulfillmentof Murano ApplicationsPolicy Guided Fulfillmentof Murano Applications
Policy Guided Fulfillmentof Murano Applications
 
Singapore MuleSoft Meetup - 24 Aug 2022
Singapore MuleSoft Meetup - 24 Aug 2022Singapore MuleSoft Meetup - 24 Aug 2022
Singapore MuleSoft Meetup - 24 Aug 2022
 
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
 
PhillyForce 2018 - Salesforce Platform Keynote
PhillyForce 2018  - Salesforce Platform KeynotePhillyForce 2018  - Salesforce Platform Keynote
PhillyForce 2018 - Salesforce Platform Keynote
 
MuleSoft Meetup | Reading Meetup Group | Hosted by Integral Zone
MuleSoft Meetup | Reading Meetup Group | Hosted by Integral ZoneMuleSoft Meetup | Reading Meetup Group | Hosted by Integral Zone
MuleSoft Meetup | Reading Meetup Group | Hosted by Integral Zone
 
A Vision On Integrated Inspection Planning Prototyping
A Vision On Integrated Inspection Planning PrototypingA Vision On Integrated Inspection Planning Prototyping
A Vision On Integrated Inspection Planning Prototyping
 
Mulesoft Meetup Roma - Monitoring Framework & DevOps.pptx
Mulesoft Meetup Roma - Monitoring Framework & DevOps.pptxMulesoft Meetup Roma - Monitoring Framework & DevOps.pptx
Mulesoft Meetup Roma - Monitoring Framework & DevOps.pptx
 
Microservices & anypoint service mesh calgary mule soft meetup
Microservices & anypoint service mesh   calgary mule soft meetupMicroservices & anypoint service mesh   calgary mule soft meetup
Microservices & anypoint service mesh calgary mule soft meetup
 
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
 

More from MysoreMuleSoftMeetup

MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...MysoreMuleSoftMeetup
 
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40MysoreMuleSoftMeetup
 
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...MysoreMuleSoftMeetup
 
State Management in Mule applications | MuleSoft Mysore Meetup #42
State Management in Mule applications |  MuleSoft Mysore Meetup #42State Management in Mule applications |  MuleSoft Mysore Meetup #42
State Management in Mule applications | MuleSoft Mysore Meetup #42MysoreMuleSoftMeetup
 
Anypoint Code Builder (ACB) + AI + Hands-On | MuleSoft Mysore Meetup #41
Anypoint Code Builder (ACB) + AI + Hands-On |  MuleSoft Mysore Meetup #41Anypoint Code Builder (ACB) + AI + Hands-On |  MuleSoft Mysore Meetup #41
Anypoint Code Builder (ACB) + AI + Hands-On | MuleSoft Mysore Meetup #41MysoreMuleSoftMeetup
 
Transaction Management in Mule 4 | MuleSoft Mysore Meetup #39
Transaction Management in Mule 4 |  MuleSoft Mysore Meetup #39Transaction Management in Mule 4 |  MuleSoft Mysore Meetup #39
Transaction Management in Mule 4 | MuleSoft Mysore Meetup #39MysoreMuleSoftMeetup
 
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38MysoreMuleSoftMeetup
 
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37MysoreMuleSoftMeetup
 
Azure DevOps Pipeline setup for Mule APIs #36
Azure DevOps Pipeline setup for Mule APIs #36Azure DevOps Pipeline setup for Mule APIs #36
Azure DevOps Pipeline setup for Mule APIs #36MysoreMuleSoftMeetup
 
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35MysoreMuleSoftMeetup
 
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...MysoreMuleSoftMeetup
 
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...MysoreMuleSoftMeetup
 
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32MysoreMuleSoftMeetup
 
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...MysoreMuleSoftMeetup
 
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30MysoreMuleSoftMeetup
 
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29MysoreMuleSoftMeetup
 
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27MysoreMuleSoftMeetup
 
Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...
Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...
Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...MysoreMuleSoftMeetup
 
Designing Fault Tolerant APIs to keep Application Network Intact | MuleSoft M...
Designing Fault Tolerant APIs to keep Application Network Intact | MuleSoft M...Designing Fault Tolerant APIs to keep Application Network Intact | MuleSoft M...
Designing Fault Tolerant APIs to keep Application Network Intact | MuleSoft M...MysoreMuleSoftMeetup
 
CloudHub 2.0 + Shared Space Demo | MuleSoft Mysore Meetup #22
CloudHub 2.0 + Shared Space Demo | MuleSoft Mysore Meetup #22CloudHub 2.0 + Shared Space Demo | MuleSoft Mysore Meetup #22
CloudHub 2.0 + Shared Space Demo | MuleSoft Mysore Meetup #22MysoreMuleSoftMeetup
 

More from MysoreMuleSoftMeetup (20)

MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
 
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40
Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40
 
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
 
State Management in Mule applications | MuleSoft Mysore Meetup #42
State Management in Mule applications |  MuleSoft Mysore Meetup #42State Management in Mule applications |  MuleSoft Mysore Meetup #42
State Management in Mule applications | MuleSoft Mysore Meetup #42
 
Anypoint Code Builder (ACB) + AI + Hands-On | MuleSoft Mysore Meetup #41
Anypoint Code Builder (ACB) + AI + Hands-On |  MuleSoft Mysore Meetup #41Anypoint Code Builder (ACB) + AI + Hands-On |  MuleSoft Mysore Meetup #41
Anypoint Code Builder (ACB) + AI + Hands-On | MuleSoft Mysore Meetup #41
 
Transaction Management in Mule 4 | MuleSoft Mysore Meetup #39
Transaction Management in Mule 4 |  MuleSoft Mysore Meetup #39Transaction Management in Mule 4 |  MuleSoft Mysore Meetup #39
Transaction Management in Mule 4 | MuleSoft Mysore Meetup #39
 
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
 
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
 
Azure DevOps Pipeline setup for Mule APIs #36
Azure DevOps Pipeline setup for Mule APIs #36Azure DevOps Pipeline setup for Mule APIs #36
Azure DevOps Pipeline setup for Mule APIs #36
 
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
 
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...
 
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...
 
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32
 
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...
 
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30
 
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
 
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27
 
Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...
Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...
Maven Archetypes - Learn about importance of Maven Archetypes in MuleSoft | M...
 
Designing Fault Tolerant APIs to keep Application Network Intact | MuleSoft M...
Designing Fault Tolerant APIs to keep Application Network Intact | MuleSoft M...Designing Fault Tolerant APIs to keep Application Network Intact | MuleSoft M...
Designing Fault Tolerant APIs to keep Application Network Intact | MuleSoft M...
 
CloudHub 2.0 + Shared Space Demo | MuleSoft Mysore Meetup #22
CloudHub 2.0 + Shared Space Demo | MuleSoft Mysore Meetup #22CloudHub 2.0 + Shared Space Demo | MuleSoft Mysore Meetup #22
CloudHub 2.0 + Shared Space Demo | MuleSoft Mysore Meetup #22
 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 

Handling NFRs for the API through API policies (Custom Policies) -Part 2 | MuleSoft Mysore Meetup #26

  • 1. 1
  • 2. February 18, 2023 Mysore MuleSoft Meetup Part 2 - Handling NFRs of the API through API Custom Policies
  • 3. Safe Harbour Statement ● Both the speaker and the host are organizing this meet-up in individual capacity only. We are not representing our companies here. ● This presentation is strictly for learning purposes only. ● Organizer/Presenter do not hold any responsibility that same solution will work for your business requirements. ● This presentation is not meant for any promotional activities. 3
  • 4. A recording of this meetup will be uploaded to events page within 24 hours Questions can be submitted/asked at any time in the Chat/Questions and Answers Tab Make it more Interactive!!! Give us feedback! Rate this meetup session by filling feedback form at the end of the day We Love Feedbacks!!! Its Bread & Butter for Meetup Housekeeping 4
  • 5. Introduction ● About the Organizers 5 Shubham Chaurasia Billennium India Pro Integration Developer A SHOW OF HANDS: Who is new to this Meetup? Giridhar Meka Sr. Technical Architect linkedin.com/in/giridharmeka linkedin.com/in/shubhamchaurasia1
  • 6. 6 Vijayaraghavan Venkatadri Integration Architect Introduction ● About the Speaker ✔ Working as an Integration Architect at Ernst & Young GDS ✔ 11+ years of experience in Integration and API products in Solutioning & Design ✔ Spanning across MuleSoft, IBM stack & Cloud technologies ✔ MuleSoft Mentor & Speaker in the MuleSoft Community ✔ 6x certified in IBM & 2x certified in MuleSoft
  • 7. Agenda ● Introductions o Summary of Session One (Part 1 - Recap) ■ API’s NFR & Handling NFR ■ API Out of the Box Policies ■ API Policy Enforcement o Handling NFR using Custom Policy o Develop, Package, Publish & Manage a Custom Policy o Use Case : Creating a Custom policy ● Demo ● Q & A 7
  • 8. • Non-functional requirements define ground rules of how the implementation of the functional requirements guarded and performed. ○ When it comes to API-First approach design, the NFR defines how the Web API implementation should perform and react upon the Web API invocation by Web API client. ○ NFRs seeks below segments encapsulated in an API implementation such as performance, security, compliance, consistency & reliability. Summary of Session One (Part 1- Recap) 8 API’s Non-Functional Requirements Handling Non-Functional Requirements High Performant Runtime Plane API Design API Policy Defines the scalability and reliability by increasing the throughput and processing time of an API Increases the consistency in delivering the data and also increase the throughput, prevent data loss being persistent API Policy plays vital role in handling the NFR to define the security, compliance, Quality of your service and operations For example: CloudHub For example: server-side caching, asynchronous reliable implementations, etc., For example: Out-of-the-Box policies, custom policies
  • 9. ✔ Compliance ○ Client ID enforcement ○ Cross-Origin Resource Sharing (CORS) ✔ Security ○ HTTP Basic Authentication API policies ■ Basic Authentication - LDAP ■ Basic Authentication - Simple ○ IP-based API Policies ■ IP blocklist ■ IP allowlist Summary of Session One (Part 1- Recap) 9 Out of the Box (OOTB) API Policies
  • 10. ○ Threat Protection API Policies ■ JSON threat protection ■ XML threat protection ○ OAuth 2.0 access token enforcement API policies ■ OAuth 2.0 access token enforcement using Mule OAuth Provider ■ OpenAM access token enforcement ■ PingFederate access token enforcement ■ OpenId Connect access token enforcement ○ JSON Web Token ✔ Quality of Service - QoS ○ SLA-based API policies ■ Rate Limiting - SLA-based 10 Summary of Session One (Part 1- Recap) Out of the Box (OOTB) API Policies
  • 11. ○ Non-SLA-based API Policies ■ Rate Limiting ■ Spike Control ■ HTTP Caching ✔ Transformation ○ HTTP header manipulation API policies ■ Header Injection ■ Header Removal ✔ Troubleshooting ○ Message Logging 11 Summary of Session One (Part 1- Recap) Out of the Box (OOTB) API Policies
  • 12. 12 Summary of Session One (Part 1- Recap) API Policy Enforcement Mule Application Non-Mule Application (Non-Kubernetes cluster) Non-Mule Application (Kubernetes cluster) On Anypoint Platform, the embedded Mule runtime enforce the API policies by acquiring the API policy enforcement capability within it Any non-mule application requires API proxies which can enable API policy enforcement. API Proxies are templated mule applications that can be auto-generated by Anypoint API manager. It is deployed to Mule runtime which is typically called as API Gateway Anypoint Service Mesh enables API policy enforcement which can be installed by customers into their customer-hosted Kubernetes cluster. It builds on Istio, hence it is required in Kubernetes cluster before installing Anypoint Service Mesh. API policies will be downloaded in Runtime from API Manager control plane using API Auto-discovery Web API client should invoke API proxies. Upon enforcing API policies, the call will be routed to actual API implementation Web API clients can invoke Web API implementation directly in which Istio/Envoy directly intercept the invocation and enforce API policy.
  • 13. ✔ Custom policy as the name denotes is a custom-made policy specific to the requirement which you cannot fulfill through out of the box policies. ✔ These custom policies can developed, published as an asset and apply to the API in the API Managers. ✔ Ideally a custom policy made of two important configuration files ○ Policy Configuration File: It is a YAML file where the policy parameters and metadata are defined and subsequently rendered into User Interface field sections. ○ Policy Implementation File: It is a XML file where the actual custom policy logics implemented and created a deployable JAR file. Handling Non-Functional Requirements ✔ Custom Policy can accommodate both Functional and Non-Functional requirements. But is predominantly intended for handling non-functional requirements such as ○ Checking Compliance ○ Additional Authentication ○ Custom Logging, etc.. Custom Policy 13
  • 14. ⮚ http-policy:proxy - The definition of a policy starts with this xml element. This element has an argument that states the policy name. ⮚ http-policy:source - The element contains the instruction to execute and also can perform pre and post processing activities before and after the HTTP listener event. ⮚ http-policy:execute - The element requires to execute actual Mule application or other policy. ▪ The instruction before the execute element will execute before executing Mule event processing. ▪ The instruction after the execute element will execute after executing Mule event processing. Policy Implementation File - XML 14
  • 15. An API having two custom policies in the order of authentication and logging Policy Implementation File - XML 15 Execution Order When an Web API invocation happens, the transaction route will take place in below pattern ★ Authenticate ★ Log-request ★ Flow execution ★ Log-response
  • 16. ✔ Like Mule application, custom policies also can use extension to make use of mule core capabilities. ✔ Example: mule-http-policy-transform-extension - is used to simplifies the modification of HTTP requests and responses that go through the different policies. ✔ Also, custom code incorporation is allowed by using Mule plugin programmed using java or XML SDK. Policy Implementation File - XML 16 Using Extension ✔ Applying API policies for the outbound calls i.e. outgoing HTTP calls within Mule application. ✔ http-policy:operation - is used to inject instructions before the Mule processing reaches the HTTP requester. Outbound Policies Error Handling ✔ Mule 4 can handle errors thrown by API policy. Error handling can be done try and error-handler elements. ✔ Once an error is caught by an error-handler, the error is either, propagated up the Mule Event processing chain, or handled, where normal Mule event process execution continues
  • 17. ✔ Handlebars are simple templating framework which is required to control the execution of the instructions within the Custom Policy. ✔ The execution will happen only when the appropriate criterias are selected. ○ It will access configuration values from YAML config file ○ Conditionally decides which section of the policy are applied depending on the selection criteria ○ Supports multiple operators Policy Implementation File - XML 17 Handlebars
  • 18. ✔ Mule 4 uses this YAML file to store metadata and user parameters. These parameters rendered in UI. ✔ This flexible design to allows policy to work for multiple API. Policy Configuration File - YAML 18 Parameters Type ✔ Depending on the type of the parameter, the UI will render, such as: ○ text boxes ○ radio buttons ○ checkboxes
  • 19. ✔ Mule 4 requires below steps for publishing a full-fledged custom policy ➢ Develop the policy ➢ Package the policy ➢ Upload the resulting policy assets to Exchange ➢ Apply the policy to any API through API Manager Publishing Custom Policy 19 Develop the policy ✔ The first step to develop a custom policy consists in setting up a project with the required files. ✔ Maven archetype is the easiest way to gather required files in the project ✔ There are four files created and needed for a working policy ➢ pom.xml ➢ mule-artifact.json ➢ custom-policy.yaml ➢ template.xml
  • 20. Publishing Custom Policy 20 Packaging the policy ✔ Use Maven plugin to package the policy into a deployable jar file. ✔ Use mvn clean package command to package your application Upload the policy to Exchange ✔ In order to deploy to exchange, update your settings.xml with your exchange credentials or use connected apps. ✔ Use mvn clean deploy command to deploy to Exchange. Apply the policy to API via API Manager ✔ In the Anypoint API Manager, you can see the custom Policy is available in the Custom Policy section. ✔ Apply the Custom policy to the API you want.
  • 21. USE CASE: Creating a Custom Policy 21 ✔ A specific use case that an API receives customer creating request in which it has all the customer information. As part of the customer creation in the backend, custId should be generated in the response. ✔ Custom Logging Requirement ➢ Custom Message to be logged when the request is received. ➢ Should have option to dynamic plug and play logging in the request and the response. ➢ If the request logging is enabled, ■ Request attributes to be logged ■ Option of enabling/disabling of request attributes should be available. ➢ If the response logging is enabled ■ Response Payload to be logged ■ Option of enabling/disabling of response payload should be available. POST /customers
  • 22. Demo
  • 23. Q&A
  • 24. Take a stand ! ● Nominate yourself for the next meetup speaker and suggest a topic as well. 24
  • 25. ● Share: ○ Tweet using the hashtag #MuleSoftMeetups ○ Join Mysore Group: https://meetups.mulesoft.com/mysore/ ● Feedback: ○ Fill out the survey feedback and suggest topics for upcoming events ○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program ○ Reach out to Mysore Meetup Leaders (Shubham/Giridhar) to suggest topics for next Meetup What’s next? 25