Student Manual
Student Manual
Architecture:
Application Networks
Student Manual
August 7, 2020
1
Table of Contents
Welcome To Anypoint Platform Architecture: Application Networks 1
1. Putting the Course in Context 7
2. Introducing MuleSoft, the Application Network Vision and Anypoint Platform 14
3. Establishing Organizational and Platform Foundations 32
4. Identifying, Reusing and Publishing APIs 61
5. Enforcing NFRs on the Level of API Invocations Using Anypoint API Manager 104
6. Designing Effective APIs 154
7. Architecting and Deploying Effective API Implementations 194
8. Augmenting API-Led Connectivity With Elements From Event-Driven Architecture 232
9. Transitioning Into Production 249
10. Monitoring and Analyzing the Behavior of the Application Network 273
Wrapping-Up Anypoint Platform Architecture: Application Networks 295
Appendix A: Documenting the Architecture Model 299
Appendix B: ArchiMate Notation Cheat Sheets 303
Glossary 306
Bibliography 318
Version History 320
Anypoint Platform Architecture Application Networks
Course prerequisites
The target audience of this course are architects, especially Enterprise Architects and Solution
Architects, new to Anypoint Platform, API-led connectivity and the application network approach,
but experienced in other integration approaches (e.g., SOA) and integration
technologies/platforms.
Prior to attending this course, students are required to get an overview of Anypoint Platform and its
constituent components. This can be achieved by various means, such as
Course goals
The overarching goal of this course is to enable students to
• direct the emergence of an effective application network out of individual integration solutions
following API-led connectivity, working with all relevant stakeholders on all levels of the
organization
• create credible high-level architecture models for integration solutions on Anypoint Platform
such that functional and non-functional requirements are likely to be met and the principles of
API-led connectivity and application networks are followed
This course is predominantly about cloud-native architectures using the MuleSoft-hosted Anypoint
Platform, i.e., CloudHub.
Course outline
• Welcome To Anypoint Platform Architecture: Application Networks
• Module 1
• Module 2
• Module 3
• Module 4
• Module 5
• Module 6
• Module 7
• Module 8
• Module 9
• Module 10
• Wrapping-Up Anypoint Platform Architecture: Application Networks
This course is primarily driven by a single case study, Acme Insurance, and two imminent
strategically important change initiatives that need to be addressed by Acme Insurance. These
change initiatives provide the background and motivation for most discussions in this course.
As various aspects of the case study are addressed, the discussion naturally elaborates on the
central topic of the course, i.e., how to architect and design application networks using API-led
connectivity and Anypoint Platform.
However, the course cannot jump into architecting without any prior knowledge about Anypoint
Platform, what terms like "API-led connectivity" and "application network" actually mean, and how
MuleSoft and MuleSoft customers typically approach integration challenges like those faced by
Acme Insurance. Therefore, Module 1 and Module 2 provide this context-setting and introduction.
Acme Insurance itself is briefly introduced already in Introducing Acme Insurance and becomes the
focus of the discussion from Module 3 onwards.
As the architectural and design discussions in this course unfold, it is inevitable that opinions are
expressed, solutions presented and decisions made that are somewhat ambiguous, without a clear-
cut distinction between correct or false: such is the nature of architecture and design. A good
example of this is the discussion on Bounded Context Data Model versus Enterprise Data Model in
section 6.3. Students are of course encouraged to challenge the decisions made, and to decide
differently in similar real-world situations. The crucial point is that the thought processes behind
these architectural and design decisions are elaborated-on in the course, which creates awareness
of the topic and increases understanding of the tradeoffs involved in making a decision.
Exercises, typically in the form of group discussions, are an important element of this course. But
these exercises are never in the form of actually doing something, on the computer, with Anypoint
Platform or any of its components. Instead, they are simply discussions that invite to reflect, with
the intention of validating and deepening the understanding of a topic addressed in the course.
All architecture diagrams use ArchiMate 3 notation. A summary of that notation can be found in
Appendix B.
The course manual is somewhere between a bound edition of the slides and a standalone book: it
contains all slide content and enough context around this content to be much easier to consume
than the slides alone would be. On the other hand, the course manual lacks some of the
explanations and elaborations that a full-fledged book would be expected to contain: this additional
depth is provided by the instructor when teaching the course!
MuleSoft offers a certification based on this course: MuleSoft Certified Platform Architect For
students fulfilling the course’s prerequisites, attending class and studying the Course Manual should
be sufficient for passing the exam.
Acme Insurance has recently been acquired by an international competitor: The New Owners. As
one consequence, Acme Insurance is currently being rebranded as a subsidiary of The New Owners.
As another important consequence, Acme Insurance’s strategy is increasingly being defined by The
New Owners.
The New
Owners
• Acme Insurance operates an IBM-centric data center with the Acme Insurance Mainframe and
clusters of AIX machines
• The Policy Admin System runs on the Mainframe and is used by both Motor and Home
Underwriting. However, support for Motor and Home policies was added to the Policy Admin
System in different phases and so uses different data schemata and database tables
• The Motor Claims System is operated in-house on a WebSphere application server cluster
deployed on AIX
• The Home Claims System is a different system, operated by an external hosting provider and
accessed over the web
• Both claims systems are accessed by Acme Insurance’s own Claims Adjudication team from their
workstations
• Simple claims administration is handled by an outsourced call center, also via the Motor Claims
System and Home Claims System
Backoffice
Beware of the two completely distinct meanings of the term "policy" in this course:
insurance policy on the one hand and API policy on the other hand. To avoid
confusion, the latter will always be referred to using the complete term "API
policy".
• Open-up to external price comparison services ("Aggregators") for motor insurance: This
contributes to the goal of establishing new sales channels, which in turn (positively) influences
the driver of increasing revenue, which is important to all management stakeholders
• Provide (minimal) self-service capabilities to customers: This contributes to the goal of
increasing the prevalence of customer self-service, which in turn (positively) influences the
driver of reducing cost, which is important to all management stakeholders as well as to
Corporate IT
Not immediately relevant, but clearly on the horizon, are the following far-reaching changes:
• Replace the two bespoke claims handling systems, the Motor Claims System and Home Claims
System, with one COTS product: This contributes to the principle of preferring COTS solutions,
which in turn contributes to Corporate IT’s goal of standardizing IT systems across all
subsidiaries of The New Owners
• Replace the legacy policy rating engine with a corporate standard: This contributes to the
principle of reusing custom software (such as the corporate standard policy rating engine) where
possible, which in turn contributes to Corporate IT’s goal of standardizing IT systems
Revenue Cost
Increase Reduction
Figure 3. Acme Insurance’s immediate and near-term strategic change initiatives, their rationale
and stakeholders.
Objectives
• Define Catalyst
• Describe how this course is aligned to parts of Catalyst
• Use essential course terminology correctly
• Recognize the ArchiMate 3 notation subset used in this course
Figure 4. Catalyst holistically addresses all aspects of integration capability delivery into an
organization.
Catalyst and the Catalyst playbooks, but it does not follow the exact naming or sequential order of
the playbooks' activities.
However:
• Iteration is at the heart of Catalyst, but this course does not iterate
◦ Every topic is discussed once, in the light of different aspects of the case study, which would
in the real world be addressed in different iterations
• Catalyst stresses planning, but this course does not simulate planning activities or present plans
• Discussion of organizational enablement and the C4E is light and mainly introduces the concept
and a few ideas on how to measure the C4E’s impact with KPIs
Figure 5. This course focuses on architectural aspects of technology delivery and introduces the
C4E.
Simplified
notion of API
API Client
Figure 6. The simplified notion of API merges the aspects of application interface, technology
interface, API implementation, application service and business service and is here represented
visually as an application service element with the name of the API. An API in this simplified sense
directly serves an API client and is invoked (triggered) by that API client.
This simplified notion of API is justified because in a very significant number of cases there is
exactly one instance of each of these elements per API. Indeed, striving for a 1-to-1 relationship
between API as application interface and API implementation in particular is usually advisable as it
helps combat the complexity of large application networks. This is also the approach followed in
this course.
• Experience APIs are shown invoking Process APIs and Process APIs are shown invoking System
APIs, although, in reality, it is only the API implementation of the Experience API that depends
on the technology interface of the Process API and, at runtime, through that interface, invokes
the API implementation of the Process API; and it is only the API implementation of the Process
API that depends on the technology interface of the System API and, at runtime, through that
interface, invokes the API implementation of the System API.
• It is possible to say that an “API is deployed to a runtime” when in reality it is only the API
implementation (the application component) that is deployable.
In other contexts (not in this course), the terms "service" or "microservice" are used for the same
purpose as the simplified notion of API.
When the simplified notion of API is dominant then the pleonasm "API interface" is sometimes used
to specifically address the interface-aspect of the API in contrast to its implementation-aspect.
For instance:
• If the Auto policy rating API were just exposed over one HTTP-based interface, e.g., a
JSON/REST interface, then the simplified notion of this API would comprise:
Summary
• Catalyst is a holistic framework and methodology for enterprise integration delivery proposed by
MuleSoft, addressing
◦ Business outcomes
◦ Technology delivery in the form of platform delivery and delivery of projects
◦ Organizational enablement through the Center for Enablement (C4E), support for Anypoint
Platform and training
• This course is aligned with the technology delivery and C4E dimensions of Catalyst
• An API is an application interface, typically with a business purpose, to programmatic API clients
using HTTP-based protocols
• Sometimes the term "API" also denotes the API implementation, i.e., the underlying application
component that implements the API’s functionality
• API-led connectivity is a style of integration architecture that prioritizes APIs and assigns them
to three tiers
• Application network is the state of an Enterprise Architecture that emerges from the application
of API-led connectivity and fosters governance, discoverability, consumability and reuse
Objectives
• Articulate MuleSoft’s mission
• Explain MuleSoft’s proposal for closing the increasing IT delivery gap
• Describe the capabilities and high-level components of Anypoint Platform
MuleSoft’s mission is to enable companies to transform and compete in a vastly changing digital
world.
The reality is that most digital transformation initiatives are failing. Some of the reasons behind
these failures are:
The complexity is massive and compounding, and the need for speed and agility is increasing.
Custom code is brittle, it breaks easily, it is the enemy of speed and agility and is also a bottleneck
because it is understood by too few people.
A better, more strategic approach to integration is needed in order to go faster and innovate at a
new scale, in a way that’s governed but not gated by IT.
MuleSoft is helping 1800+ enterprise customers undertake transformative changes, and so have a
unique perspective on the market.
Figure 9. In a composable enterprise, there is a standard way to unlock data and connect systems,
as opposed to integration being a secondary concern, leaving much more bandwidth for business
innovation.
• Instead of IT focusing on delivering every single project itself, IT focuses on building reusable
assets that are specifically designed for consumption by a broader audience
• Not only does this free up precious time and resources, it significantly reduces the complexity
for IT to capitalize on new technologies
• It also frees up IT bandwidth to respond to the needs of the business to innovate – and,
importantly, meet the needs of the end-customer – much faster
Figure 10. How MuleSoft’s proposal for an IT operating model that distinguishes between
enablement and asset production on the one hand, and consumption of those assets and
innovation on the other hand, allows the increasing demands on IT to be met at constant IT
delivery capacity.
Figure 11. An IT operating model that emphasizes the consumption of assets by LoB IT and
developers as much as the production of these assets.
The API is a product and it has its own software development lifecycle (SDLC) consisting of design,
test, build, manage, and versioning and it comes with thorough documentation to enable its
consumption.
• APIs adhere to standards (typically HTTP and REST), that are developer-friendly, easily
accessible and understood broadly
• They are treated more like products than code
• They are designed for consumption for specific audiences (e.g., mobile developers)
• They are documented and versioned
• They are secured, governed, monitored and managed for performance and scale
Figure 12. Visualization of how APIs are the building blocks that represent unique business
capabilities and can be composed easily into a connected experience.
The best apps and companies of today are on this journey, taking an API-led approach to
connectivity and application development. The entire experience is composed of existing APIs, built
for reuse.
API-led connectivity provides an approach for connecting and exposing assets through APIs. As a
result, these assets become discoverable through self-service without losing control.
• System APIs: In the example, data from SAP, Salesforce and ecommerce systems is unlocked by
putting APIs in front of them. These form a System API tier, which provides consistent,
managed, and secure access to backend systems
• Process APIs: Then, one builds on the System APIs by combining and streamlining customer
data from multiple sources into a "Customers" API (breaking down application silos). These
Process APIs take core assets and combine them with some business logic to create a higher
level of value. Importantly, these higher-level objects are now useful assets that can be further
reused, as they are APIs themselves.
• Experience APIs: Finally, an API is built that brings together the order status and history,
delivering the data specifically needed by the Web app. These are Experience APIs that are
designed specifically for consumption by a specific end-user app or device. These APIs allow app
developers to quickly innovate on projects by consuming the underlying assets without having to
know how the data got there. In fact, if anything changes to any of the systems of processes
underneath, it may not require any changes to the app itself.
With API-led connectivity, when tasked with a new mobile app, there are now reusable assets to
build on, eliminating a lot of work. It is now much easier to innovate.
unlock, or the processes they compose, or the experience they’d like to offer in the application.
• Central IT produces reusable assets, and in the process unlocks key systems, including legacy
applications, data sources, and SaaS apps. Decentralizes and democratizes access to company
data. These assets are created as part of the project delivery process, not as a separate
exercise.
• LOB IT and Central IT can then reuse these API assets and compose process-level information
• App developers can discover and self-serve on all of these reusable assets, creating the
experience-tier of APIs and ultimately the end-user applications
It is critical to connect the three tiers as driving the production and consumption model with
reusable assets, which are discovered and self-served by downstream IT and developers.
Figure 14. The APIs in each of the three tiers of API-led connectivity have a specific focus and are
typically owned by different groups.
Figure 15. A new mentality and operating model are needed. The C4E is a collaborative, cross-
functional team that acts as the steward of all assets. The team enables the broader organization
to consume those assets and get full value from them.
• discoverable
• self-service
• consumable by the broader organization
The application network is recomposable: it is built for change because it "bends but does not
break".
As was also mentioned in the context of Catalyst in 1.1.1, these capabilities are to be deployed in
such a way as to contribute to and be in alignment with the organization’s (strategic) goals,
drivers, outcomes, etc..
These technology delivery capabilities are furthermore used in the context of an (IT) operating
model that comprises various functions.
Operating Model
Figure 16. A high-level view of the technology delivery capabilities provided by Anypoint Platform in
the context of various relevant aspects of the Business Architecture of an organization.
Rather than going into a lot of detail now, it is best to just browse through these and revisit them
at the end of the course, matching what was discussed during the course against these capabilities.
Runtime High-
Reusable Assets availability and Runtime Analytics API Actionable
Discovery Scalability and Monitoring Documentation
Supporting
Capabilities
API Specification API Analytics API Consumer and
Design API Implementation relevant to Client On-boarding
Runtime Hosting Operator/Provider Software
Development
API Implementation Data API Client Process
Design Transformation API Policy Credentials
Configuration and Management
Project
Management
Management
Artifacts Version Orchestration, API Analytics
Control Routing and Flow API Policy Alerting, relevant to
Control Analytics and Consumer
Reporting
Infrastructure
API Testing, Connectivity with Operations
Simulation and External Systems API Usage and
Mocking Discoverability
Analytics
Automated Build Runtime High-
Pipeline availability and
Scalability
Operating Model
Figure 17. A medium-level drill-down into the technology delivery capabilities provided by Anypoint
Platform, and some generic supporting capabilities needed for performing API-led connectivity.
• Anypoint Design Center: Development tools to design and implement APIs, integrations and
connectors [Ref2]:
◦ API designer
◦ Flow designer
◦ Anypoint Studio
◦ Mule SDKs
◦ APIKit
◦ MUnit
• Anypoint Management Center: Single unified web interface for Anypoint Platform administration:
◦ Anypoint API Manager [Ref3]
◦ Anypoint Runtime Manager [Ref5]
◦ Anypoint Analytics [Ref7]
◦ Anypoint Access Management [Ref6]
◦ Anypoint Monitoring [Ref16]
◦ Anypoint Visualizer [Ref29]
• Anypoint Exchange: Save and share reusable assets publicly or privately [Ref4]. Preloaded
content includes:
◦ Anypoint Connectors
◦ Anypoint Templates
◦ Examples
◦ WSDLs
◦ RAML and OAS APIs
◦ Developer Portals
• Mule runtime and Runtime services: Enterprise-grade security, scalability, reliability and high
availability:
◦ Mule runtime [Ref1]
◦ Anypoint MQ [Ref8]
◦ Object Store
◦ Anypoint Virtual Private Cloud (VPC)
◦ CloudHub
◦ Anypoint Runtime Fabric [Ref27]
◦ Anypoint Connectors:
▪ Connectivity to external systems
▪ Dynamic connectivity to APIs
▪ Build custom connectors using Mule SDKs
• Anypoint Security
• Anypoint Platform Private Cloud Edition
• Government Cloud [Ref28]
All functionality exposed in the web UI is also available via Anypoint Platform APIs: these are JSON
REST APIs which are also invoked by the web UI. Anypoint Platform APIs enable extensive
automation of the interaction with Anypoint Platform.
MuleSoft also provides higher-level automation tools that capitalize on the presence of Anypoint
Platform APIs:
Related to this discussion is the observation that Anypoint Exchange is also accessible as a Maven
repository. This means that a Maven POM can be configured to deploy artifacts into Anypoint
Exchange and retrieve artifacts from Anypoint Exchange, just like with any other Maven repository
(such as Nexus).
As a general rule, all actions of type create/update/delete are recorded in the audit log, but
concrete actions for each type of action are much more specific than this. For example, when
updating (editing) an API version (object), the audit log distinguishes between actions like adding a
tag, removing a tag, editing the name of the API version, and many more.
The audit log can be retrieved and queried via the Anypoint Platform web UI and an Anypoint
Platform API by users with the appropriate authorization.
Summary
• MuleSoft’s mission is "To connect the world’s applications, data and devices to transform
business"
• MuleSoft proposes to close the increasing IT delivery gap through a consumption-oriented
operating model with modern APIs as the core enabler
• API-led connectivity defines tiers for Experience APIs, Process APIs and System APIs with
distinct stakeholders and focus
• An application network emerges from the repeated application of API-led connectivity and
stresses self-service consumption, visibility, governance and security
• Anypoint Platform provides the capabilities for realizing application networks
• Anypoint Platform consists of these high-level components: Anypoint Design Center, Anypoint
Management Center, Anypoint Exchange, Mule runtime & services
• Interaction with Anypoint Platform can be extensively automated
• Anypoint Platform maintains an audit log of all changes to an Anypoint Platform organization
Objectives
• Advise on establishing a C4E and identify KPIs to measure its success
• Choose between options for hosting Anypoint Platform and provisioning Mule runtimes
• Describe the set-up of organizational structure on Anypoint Platform
• Compare and contrast Identity Management and Client Management on Anypoint Platform
• LoBs (personal motor and home) have a long history of independence, also in IT
• LoBs have strong IT skills, medium integration skills but no know-how in API-led connectivity or
Anypoint Platform
• Acme IT is small but enthusiastic about application networks and API-led connectivity
• DevOps capabilities are present in LoB IT and Acme IT
• Corporate IT lacks the capacity and desire to involve themselves directly in Acme Insurance’s
Enterprise Architecture. All they care about is that corporate principles are being followed, as
summarized in Figure 3
Remarks:
• The "enable" principle defines an Outcome-Based Delivery model for the C4E: see 1.1.1
• The principles of "self-service", "reuse-driven" and "federated" promise increased integration
delivery speed
• Overall the C4E aims for a streamlined, lean engagement model, as also reflected in the "asset-
focused" principle
• This discussion omits questions of funding the C4E and whether C4E staff is fully or partially
assigned to the C4E
The following technical business roles are assigned to the C4E at the positions in their
organizational structure as shown in Figure 20:
• Platform Architect:
◦ Responsibilities: Platform vision and it’s evolution to meet tactical and strategic objectives of
the business
◦ Profile: Solid understanding of the technical foundation of the platform; a technology
enthusiast with a strong track record of building and running high volume, reliable
architectures, preferably including cloud, As-A-Service infrastructure and applications
• API Architect; Integration Architect/Developer:
◦ Responsibilities: Provides “enough” guidance over the design and operations of the C4E
assets; thought leadership, leading key stakeholders in designing and adopting API
architectures; architecting integrations solutions for C4E internal customers working close
with them through the whole lifecycle; gathering requirements from both the business and
technical teams to determine the integration solutions/APIs
◦ Profile: Deep experience of integration and API architecture, thorough understanding of
industry trends, vendors, frameworks and practices
• DevOps Architect/Engineer
The New
Owners
Personal Motor Claims Motor Home Home Claims Home LoB IT C4E
Motor LoB IT Underwriting Underwriting
Figure 20. Organizational view into Acme Insurance’s target Business Architecture with a C4E
supporting LoBs and their project teams with their integration needs. Technical C4E business roles
are shown in blue, managerial C4E business roles are not shown.
1. Compile a list of statements which, if largely true, allow the conclusion that the C4E is successful
2. Compile a similar list that allows the conclusion that the application network vision is being
realized
3. From the above lists, extract a list of corresponding metrics
Solution
See 3.1.4.
The extraction of many of these metrics can be automatically through the invocation of Anypoint
Platform APIs:
Figure 22. Current number of assets published to Anypoint Exchange grouped by type of asset.
• The Anypoint Platform runtime plane comprises the Mule runtime itself, Anypoint Connectors
used by Mule applications executing in the Mule runtime, and all supporting Runtime services,
incl. Anypoint Enterprise Security, Anypoint Fabric, Anypoint VPCs, CloudHub Dedicated Load
Balancers, Object Store and Anypoint MQ. Simply put, the runtime plane is where integration
logic executes.
• The Anypoint Platform control plane comprises all Anypoint Platform components that are
involved in managing/controlling the components of the runtime plane (i.e., Anypoint
Management Center, incl. Anypoint API Manager and Anypoint Runtime Manager), the design of
APIs or Mule applications (i.e., Anypoint Design Center, incl. Anypoint Studio and API designer)
or the documentation and discovery of application network assets (i.e., Anypoint Exchange)
Figure 23. Components of the Anypoint Platform belong to either the control plane or the runtime
plane.
In addition to executing integration logic implemented in terms of Mule applications in the Anypoint
Platform runtime plane, the Anypoint Platform also supports API management and analytics of APIs
implemented not as Mule applications and therefore executing outside the Anypoint Platform
runtime plane - so-called external API implementations. These approaches make use of relevant
components of the Anypoint Platform control plane, such as Anypoint API Manager. See Module 5.
Figure 24. Overview of Anypoint Platform deployment options and MuleSoft product names (in
bold) for each supported scenario.
• MuleSoft-hosted:
◦ Product: Anypoint Platform
◦ AWS regions: US East (N Virginia, https://anypoint.mulesoft.com) or EU (Frankfurt,
https://eu1.anypoint.mulesoft.com)
• Customer-hosted:
◦ Product: Anypoint Platform Private Cloud Edition
Options for the deployment of the Anypoint Platform runtime plane, incl. provisioning of Mule
runtimes:
• MuleSoft-hosted:
◦ In the public AWS cloud: CloudHub
◦ In an AWS VPC: CloudHub with Anypoint VPC
◦ AWS regions:
▪ Under management of the US East control plane: US East, US West, Canada, Asia Pacific,
EU (Frankfurt, Ireland, London, …), South America
▪ Under management of the EU control plane: EU (Frankfurt and Ireland)
• Customer-hosted:
◦ Manually provisioned Mule runtimes on bare metal, VMs, on-premises, in a public or private
cloud, …
Figure 25. MuleSoft-hosted Anypoint Platform control plane managing MuleSoft-hosted Anypoint
Platform runtime plane. Runtime plane comprises iPaaS-provisioned Mule runtimes on CloudHub in
the public AWS cloud.
Figure 26. MuleSoft-hosted Anypoint Platform control plane managing MuleSoft-hosted Anypoint
Platform runtime plane. Runtime plane comprises iPaaS-provisioned Mule runtimes on CloudHub in
an Anypoint VPC.
Figure 27. MuleSoft-hosted Anypoint Platform control plane managing customer-hosted Anypoint
Platform runtime plane. Runtime plane comprises manually provisioned Mule runtimes.
Figure 28. MuleSoft-hosted Anypoint Platform control plane managing customer-hosted Anypoint
Platform runtime plane. Runtime plane comprises iPaaS-provisioned Mule runtimes on a Kubernetes
cluster maintained by Anypoint Runtime Fabric.
Figure 29. Anypoint Platform Private Cloud Edition: Customer-hosted Anypoint Platform control
plane managing customer-hosted Anypoint Platform runtime plane. Runtime plane comprises
manually provisioned Mule runtimes.
Figure 30. Anypoint Platform for Pivotal Cloud Foundry: Customer-hosted Anypoint Platform control
plane managing customer-hosted Anypoint Platform runtime plane. Runtime plane comprises
iPaaS-provisioned Mule runtimes on PCF.
• At the highest level, not all Anypoint Platform components are currently available for every
Anypoint Platform deployment scenario.
• Some features of Anypoint Platform components that are available in more than one deployment
scenario differ in their details, typically due to the different technical characteristics and
capabilities available in each case.
Anypoint MQ yes no no no no
Notes:
• External Analytics refers to Splunk, ELK or similar software. Normally, external Analytics for API
and runtime metrics is configured, when supported, through Anypoint Runtime Manager. In
Anypoint Runtime Fabric though this is configured differently, without Anypoint Runtime
Manager, by forwarding Kubernetes cluster logs to the external Analytics software
• Persistent VM queues in a non-CloudHub deployment scenario have many more options, such as
cluster-wide in-memory replication or persistence on disk or in a database, but may require
management of persistent storage
• The Tanuki Software Java Service Wrapper offers limited auto-restart capabilities also for
customer-managed Mule runtimes, but this is not comparable to CloudHub’s, Anypoint Runtime
Fabric’s or PCF’s sophisticated health-check-based auto-restart feature
• Anypoint Runtime Manager alerts on CloudHub (and only on CloudHub) also include the option
of custom alerts and notifications (via the CloudHub connector)
• Anypoint Platform Private Cloud Edition supports minimal Anypoint Runtime Manager alerts
related to the Mule application being deployed, undeployed, etc., but no alerts based on Mule
events or API events
• Anypoint Runtime Manager monitoring dashboards include load and performance metrics for
Mule applications and the servers to which Mule runtimes are deployed
• Insight is a troubleshooting tool that gives in-depth visibility into Mule applications by collecting
Mule events (business events and default events) and the transactions to which these events
belong. Only CloudHub supports the replay of transactions (which causes re-processing the
involved message)
• Clustering Mule runtimes when deploying through Anypoint Platform for Pivotal Cloud Foundry
requires a PCF Hazelcast service. Mule runtime clusters in Hybrid and Anypoint Platform Private
Cloud Edition deployment scenarios only need and use the Hazelcast features built into the Mule
runtime itself.
Solution
Anypoint Platform deployment scenarios can be evaluated along the following dimensions:
Figure 31. AWS regions in which MuleSoft hosts the Anypoint Platform control plane (large colored
circles) and runtime plane (small yellow marks). Data resides within the runtime plane, while
limited amounts of metadata are sent from there to the managing control plane (arrows in the
color of the managing control plane).
The fundamental principle is that the location of Mule runtimes, together with the integration logic
implemented by Mule applications executing in these Mule runtimes, determine the location and
residency of all data. In addition to the data itself, limited amounts of metadata and metrics are
exchanged with the Anypoint Management Center components of the Anypoint Platform control
plane. Specifically:
• Mule runtimes and Mule applications can either be managed entirely by the customer or execute
in one of the AWS regions supported by CloudHub as described in 3.2.2: this determines where
all data, in the form of Mule messages, is processed.
• Mule applications can make use of Object Store, persistent VM queues or other resilience
features. In a CloudHub deployment, all of these features store data in the same AWS region as
the Mule runtime itself. For customer-managed deployments the customer fully controls where
These rules are typically applied as follows to meet regulatory requirements through jurisdiction-
local deployments (assuming suitably implemented Mule applications):
• A combination of the MuleSoft-hosted Anypoint Platform EU/US control plane and a matching
MuleSoft-hosted EU/US runtime plane (i.e., using CloudHub and Anypoint MQ in a matching
AWS region) keeps all data and metadata in the EU/US.
• A combination of the MuleSoft-hosted Anypoint Platform EU/US control plane and a customer-
hosted runtime plane (i.e., Hybrid deployment , optionally with Anypoint Runtime Fabric) keeps
all data on customer-hosted infrastructure and all metadata in the EU/US.
• A combination of a customer-hosted Anypoint Platform control plane and a matching customer-
hosted runtime plane (i.e., using Anypoint Platform Private Cloud Edition or Anypoint Platform
for Pivotal Cloud Foundry) keeps all data and metadata on customer-hosted infrastructure.
Figure 32. Anypoint Access Management and the Anypoint Platform entitlements.
Figure 33. Anypoint Access Management controls access to and allocation of various resources on
Anypoint Platform.
Figure 34. Anypoint Access Management at the level of the Personal Motor LoB business group.
Both Identity Management and Client Management require an Identity Provider. Somewhat
simplifying the roles and responsibilities of an Identity Provider in both cases, one could say:
• The Identity Provider for Identity Management stores and validates user credentials.
• The Identity Provider for Client Management issues, stores, and validates OAuth 2.0 access
tokens for API clients.
By default, Anypoint Platform acts as an internal Identity Provider for Identity Management.
Anypoint Platform also supports configuring one external Identity Provider for Identity Management
at the Anypoint Platform organization level.
If an external Identity Provider is configured for Identity Management, then SAML 2.0 bearer
tokens issued by that Identity Provider can be used for invocations of the Anypoint Platform APIs.
Optionally, before configuring an external Identity Provider for Identity Management, administrative
users can be set up for invoking the Anypoint Platform APIs. These will remain valid after the
external Identity Provider has been configured and the credentials of these users can therefore still
be used to invoke Anypoint Platform APIs after the external Identity Provider has been configured
for Identity Management.
By default, Anypoint Platform does not act as an Identity Provider for OAuth 2.0 Client
Management. This means that in order for APIs managed by Anypoint Platform to make use of
OAuth 2.0, an external Identity Provider must be configured.
Anypoint Platform supports the configuration of multipe Identity Providers for Client Management.
All Identity Providers for Client Management must be configured at the Anypoint Platform
organization level and can then be assigned to individual business groups and environments. This
allows using different Identity Providers for - and therefore segregating Client Management and API
clients by:
There is a limited form of Client Management that is unrelated to OAuth 2.0, and is represented,
for example, by the checks performed by the Client ID enforcement API policy (see 5.3.27). In this
form of Client Management, no tokens are involved and API clients are simply identified and
authenticated by client ID and secret. For this limited, non-OAuth 2.0 form of Client Management,
Anypoint Platform does act as an internal Identity Provider if no external Identity Provider has been
configured for Client Management. Once an Identity Provider has been configured for Client
Management, and hence the full OAuth 2.0 form of Client Management becomes available, that
Identity Provider then is invovled in all forms of Client Management, including the limited, non-
OAuth 2.0 form of Client Management - although the Client Management performed in Anypoint
Platform continues to remain authoritative for the non-OAuth 2.0 form of Client Management (see
5.3.16).
For Client Management, Anypoint Platform supports the following Identity Providers as OAuth 2.0
servers:
• OpenAM
• PingFederate
• OpenID Connect (OIDC) Dynamic Client Registration (DCR)
◦ a standard implemented by Identity Providers such as Salesforce Identity, Okta, and OpenAM
After a brief evaluation period Acme Insurance chooses PingFederate as an Identity Provider ontop
of AD. They configure their Anypoint Platform organization in the MuleSoft-hosted Anypoint
Acme Insurance is currently unsure whether they will need OAuth 2.0, but if they do, they plan to
use the same PingFederate instance also for Client Management.
Summary
• A federated C4E is established at Acme Insurance to facilitate API-led connectivity and the
growth of an application network
◦ Federation plays to the strength of Acme Insurance’s LoB IT
◦ KPIs to measure the C4E’s success are defined and monitored
• Anypoint Platform control plane and runtime plane can both be hosted by MuleSoft or customers
• Mule runtimes can be provisioned manually or through iPaaS functionality
• iPaaS-provisioning of Mule runtimes is supported via CloudHub, Anypoint Platform for Pivotal
Cloud Foundry and Anypoint Runtime Fabric
• Not all Anypoint Platform components are available in all deployment scenarios
• Acme Insurance and its LoBs and users are onboarded onto Anypoint Platform using an external
Identity Provider
• Identity Management and Client Management are clearly distinct functional areas, both
supported by Identity Providers
Objectives
• Map Acme Insurance’s planned strategic initiatives to products and projects
• Identify APIs needed to implement these products
• Assign each API to one of the three tiers of API-led connectivity
• Reason in detail composition and collaboration of APIs
• Reuse APIs wherever possible
• Publish APIs and related assets for reuse
• Understand how Anypoint API Community Manager helps build developer communities around
some or all APIs in an application network
All relevant stakeholders come together under the guidance of the C4E to concretize these strategic
initiatives into two minimally viable products and their defining features:
The products' features realize the requirements defined by the strategic initiatives.
Figure 35. Architecturally significant features of the immediately relevant strategic initiatives, and
the products they are assigned to.
The "Aggregator Integration" product and "Customer Self-Service App" product are assigned to two
project teams. The project for the "Aggregator Integration" product is kicked-off immediately, while
the project for the "Customer Self-Service App" product starts with some delay.
This project for the "Aggregator Integration" product is the first to use API-led connectivity at Acme
Insurance, and is also the one etablishing the foundation of what will become the Acme Insurance
application network.
The project to implement the "Aggregator Integration" product kicks off at the Personal Motor LoB,
and is actively supported by the newly established C4E within Acme IT (3.1.2). In particular, the
C4E’s Platform Architect spends 50% of his time contributing exclusively to this project, and an
experienced architect from the Personal Motor LoB who is assigned full-time to this project also
reports to the C4E Lead in his new role of C4E API Architect.
This is the first API-led connectivity project at Acme Insurance, so it must establish an Enterprise
Architecture compatible with an application network. The resulting application network will at first
be minimal, just enough to sustain the "Aggregator Integration" product, but it will grow
subsequently when the "Customer Self-Service App" product is realized.
Within the application network and API-led connectivity frameworks, you first architect for the
functional and later, in 5.1, for the non-functional requirements of this feature.
1. The business process is triggered by the receipt of a policy description from the Aggregator
2. First it must be established whether the policy holder for whom the quote is to be created is an
existing customer of Acme Insurance, i.e., whether they already hold a policy at Acme Insurance
3. Applicable policy options (collision coverage, liability coverage, comprehensive insurance, …)
must be retrieved based on the policy description
4. Policy options must be ranked such that options most likely to be attractive to the customer and,
at the same time, most lucrative to Acme Insurance appear first
5. One policy quote must be created for each of the top-5 policy options
6. The business process ends with the delivery (return) of the top-5 quotes to the Aggregator
Figure 36. High-level view of the "Create Aggregator Quotes" business process.
4.2.3. Looking ahead to the NFRs for the "Create quote for
aggregators" feature
To give a bit more context for the following discussion, it is helpful to briefly inspect the non-
functional requirements (NFRs) that will have to be fulfilled for the "Create quote for aggregators"
feature: 5.1.1.
Solution
The following APIs could serve to realize the functional requirements of the "Create quote for
aggregators" feature with an API-led connectivity approach (Figure 37):
• "Aggregator Quote Creation EAPI": (Aggregator policy description) -> (0-5 ranked motor policy
quotes)
◦ Receives a description of the details of the motor policy desired by the customer, incl.
essential customer data, as specified by the Aggregator. Returns up to 5 matching quotes,
ranked (ordered) such that the most preferred quote is first
◦ Determines whether the customer is an existing policy holder or new to Acme Insurance
◦ Retrieves a ranked list of policy options to be offered
◦ Creates one quote for each of the top 5 policy options and returns these, as specified by the
Aggregator
• "Policy Holder Search PAPI": (personal identifiers) -> (matching policy holders)
◦ Based on personal identifiers (name, dob, SSN, …) returns a description of all matching policy
holders of any policies at Acme Insurance, for any LoB
• "Policy Options Ranking PAPI": (policy holder properties, policy properties) -> (policy options
ranked from highest to lowest)
◦ Given essential properties of a (future) policy holder (age, standing with Acme Insurance, …)
and a some aspects of the policy to be offered to that policy holder (type of vehicle/home,
value, …) retrieves a list of available options for this policy (collision coverage, liability
coverage, comprehensive insurance, theft, …) and ranks them in the order in which they
should be offered
• "Motor Quote PAPI": create: (policy description, policy holder description) -> (motor policy
quote)
◦ Given a complete description of a desired motor policy and the (future) policy holder, creates
a matching quote and returns its description
• "Motor Policy Holder Search SAPI": (personal identifiers) -> (matching motor policy holders)
◦ Searches the Policy Admin System for policy holders of motor policies matching the given
personal identifiers (name, dob, SSN, …) and returns matching policy holder’s data
• "Home Policy Holder Search SAPI": (personal identifiers) -> (matching home policy holders)
◦ Searches the Policy Admin System for policy holders of home policies matching the given
personal identifiers (name, dob, SSN, …) and returns matching policy holder’s data
• "Policy Options Retrieval SAPI": (policy properties) -> (policy options)
◦ Given some aspects of a policy to be created (type of vehicle/home, value, …) returns all
options that can possibly be offered for this policy (collision coverage, liability coverage,
comprehensive insurance, theft, …)
• "Motor Quote Creation New Business SAPI": (policy description, policy holder description) ->
(new business motor policy quote)
◦ Given a complete description of a desired motor policy and a future policy holder new to
Acme Insurance, creates a "new business" quote for such a motor policy and returns its
description
• "Motor Quote Creation Addon Business SAPI": (policy description, policy holder identifier) ->
(addon business motor policy quote)
◦ Given a complete description of a desired motor policy and an identifier for an existing policy
holder, creates an "addon business" quote for such a motor policy and returns its description
Aggregator
Quote Creation
Experience APIs
Aggregator
Quote Creation
API
create
Process APIs
System APIs
Motor Policy Home Policy Policy Options Motor Quote Motor Quote
Holder Search Holder Search Retrieval API Creation New Creation Addon
API API Business API Business API
Policy Admin
System
Figure 37. Experience API, Process APIs and System APIs collaborating for the "Create quote for
aggregators" feature and ultimately serving the needs of the Aggregator.
You observe that the "Create quote for aggregators" feature can be implemented by one
synchronous invocation of the "Aggregator Quote Creation EAPI" which in turn triggers apparently
synchronous invocations of several APIs in the other tiers of the architecture, ultimately leading to
multiple invocations of the Policy Admin System.
This serves the functional requirements of this feature, but will need to be revisited when NFRs are
discussed.
Summary
• Essential aspect of "Create quote for aggregators" feature implemented by one synchronous
invocation of the "Aggregator Quote Creation EAPI"
• In turn triggers invocations of several APIs in all 3 tiers of the architecture
• Ultimately leads to invocations of the Policy Admin System
• Compare and contrast coarse-grained and fine-grained APIs and API implementations
Solution
The granularity of the decomposition of functionality into APIs and API implementations can be
analyzed along the following dimensions:
• Deployability: Each API and API implementation is independently deployable from all other APIs
and API implementations (assuming proper version management (6.2) to not break API
dependencies): finer-grained APIs and API implementations allow finer-grained evolution and
rollout of functionality (in the form of newer versions of APIs and API implementations)
• Management: Each API implementation and API is monitored and managed independently,
where the latter includes the enforcement of access control, QoS, etc. (Module 5), which can
hence be more finely tailored with more fine-grained APIs and API implementations
• Scalability: Resources (memory, number of CPUs, number of machines, …) are allocated to each
API implementation independently, and can therefore be tuned (scaled) to each API
implementation’s specific needs
• Resources: Each API implementation consumes a minimum set of resources (CPUs/vCores,
CloudHub workers, …) and more API implementations - even if they are smaller - typically
means higher resource usage overall
• Complexity: Smaller APIs and API implementations are simpler and therefore more easily
understood and maintained. Compared to larger and hence fewer APIs and API implementations
they also result in more API-related assets visible in the application network and more and more
complex interactions (API invocations). In other words, as the complexity of each node in the
application network is reduced the complexity of the entire application network increases
• Latency: Each additional API invocation adds latency, and smaller APIs therefore cause higher
overall latency - which often must be mitigated through caching, etc. (Module 7)
• Failure modes: Each additional API invocation is an additional remote interaction between
application components, the potential failure of which must be addressed (7.2)
• Team organization: Each API can be implemented independently of all other API
implementations, assuming that the application interfaces between API implementations - in the
form of API specifications - have been agreed. This means that team organization and
parallelization of implementation effort are more flexible with fine-grained APIs and API
implementations: Business Architecture follows Application Architecture [Ref14]
• Agility and innovation: Following from most of the above, smaller APIs and API implementations
typically result in shorter innovation cycles because changes and new features can be deployed
into production more swiftly
• The technology interface of the "Aggregator Quote Creation EAPI" is an XML/HTTP API that is
invoked by the Aggregator
• The API implementation of the "Aggregator Quote Creation EAPI" invokes various Process APIs,
such as the "Policy Holder Search PAPI"
Aggregator
Quote Creation
Aggregator Aggregator
Quote Creation Quote Creation
Service API
Policy Options
Ranking JSON
REST API
Create Motor
Quote JSON REST
API
• Its technology interface is a JSON REST API that is invoked by the API implementation of the
Policy Holder
Search
Home Policy
Holder Search
JSON REST API
Figure 39. "Policy Holder Search PAPI", initially serving the API implementation of the "Aggregator
Quote Creation EAPI".
• Its technology interface is a JSON REST API that is invoked by the API implementation of the
"Policy Holder Search PAPI"
• Its API implementation invokes the Policy Admin System over an unidentified technology
interface (MQ-based, 7.1.3)
Motor Policy
Holder Search
Figure 40. "Motor Policy Holder Search SAPI", exposing existing functionality in the Policy Admin
System, and initially serving the API implementation of the "Policy Holder Search PAPI".
Aggregator
Quote
Creation API
Policy
Options
Retrieval API
Figure 41. How APIs in all tiers serve the "Create Aggregator Quotes" business process.
1. Analyze the APIs identified for the realization of the "Create quote for aggregators" feature with
respect to their dependency on the data format exchanged with the Aggregator
2. Identify new APIs and refine existing APIs to maximize reuse when other Aggregators will need
to be supported in the future
3. Describe as clearly as possible which elements of the currently identified APIs will have to
change to accommodate your proposed changes
Solution
• Only the "Aggregator Quote Creation EAPI" depends on the Aggregator-defined data format
• In the future there will be one Experience API per Aggregator, similar to "Aggregator Quote
Creation EAPI"
• The common functionality of these Experience APIs should be encapsulated in a new Process
API, e.g. the "One-Step Motor Quote Creation Process API"
◦ Accepts and returns Aggregator-neutral description of policy and quotes
• Changes:
◦ "Aggregator Quote Creation EAPI": Interface unchanged, implementation changed
significantly to mainly delegate to "One-Step" Process API
◦ New "One-Step" Process API with implementation similar to the orchestration logic in the
current "Aggregator Quote Creation EAPI"
◦ New Experience APIs, one per Aggregator, delegating to "One-Step" Process API
◦ Other APIs remain unchanged
This scenario, i.e., the refactoring of an existing Experience API to adapt to an improved
understanding of an integration scenario, is a concrete realization of the claim that application
networks are recomposable and "bend but don’t break" under change (2.2.11). The current
Aggregator as an existing client of the "Aggregator Quote Creation EAPI" does not experience any
change as the "Aggregator Quote Creation EAPI" API implementation is refactored to use the new
"One-Step" Process API. At the same time, technical debt for the existing, misguided
implementation of the "Aggregator Quote Creation EAPI" is paid back immediately by the creation
of the new "One-Step" Process API and the re-use of the orchestration logic hidden in "Aggregator
Quote Creation EAPI".
As the application network is just being established, Anypoint Exchange currently contains no APIs
that can be reused for this feature.
In order to announce the fact that the chosen APIs will be implemented, you immediately create
and publish an Anypoint Exchange entry for each API:
1. A basic API specification, preferably in the form of a RAML definition, is required for each API
2. The creation of the API specification must start in Anypoint Design Center, from where the API
specification can be exported to Anypoint Exchange
3. The version of each API should clearly indicate that it is not production-ready yet, e.g., by using
v0 as the version of the API specification and 0.0.1 for the corresponding first Anypoint
Exchange asset (6.2)
4. A rudimentary API portal for each API is then automatically rendered in Anypoint Exchange
The C4E provides guidance and support with these activities. Importantly, the C4E defines naming
conventions for all assets, including for those to be published in Anypoint Exchange. The following
examples illustrate the naming conventions used by Acme Insurance for these first steps:
• Anypoint Design Center projects: "Policy Holder Search PAPI", similarly for Experience APIs
(EAPI) and System APIs (SAPI)
• API specification version: v0
• API specification Anypoint Exchange entry: name: "Policy Holder Search PAPI", asset ID:
policy-holder-search-papi (group ID is set by Anypoint Exchange to be the Anypoint
Platform organization ID), version: 0.0.1 (group/asset ID and version form the "Maven
coordinates" of an Anypoint Exchange asset)
API documentation for the "Policy Holder Search PAPI" is a form of contract for all elements of the
API, i.e., its business service, application service, application interface and technology interface.
The API specification of the API - the RAML definition or OpenAPI definition - is the most important
way of expressing that contract.
API documentation must be discoverable and engaging for it to be effective: two capabilities that
are provided by Anypoint Platform as discussed shortly.
• Details of the JSON/REST interface to the API should be exhaustively specified in the API
specification of the API
• The same is true for security constraints like required HTTPS protocol and authentication
mechanisms
◦ Currently unknown information can be added later to the API specification, for instance when
NFRs are addressed
• Other NFRs, like throughput goals are not part of the API specification but the wider API
documentation, specifically the API’s Anypoint Exchange entry
Discoverable
Assets
Figure 42. Documentation for the "Policy Holder Search PAPI", including its API specification in the
form of a RAML definition, documents the business service realized by the API, its SLA and non-
functional aspects. API documentation must also be discoverable and engaging, as it must be easy
to access by API consumers.
The API specification should capture all of these aspects that are currently known about the API,
but may well be at first more of a stub than a complete API specification: it will be amended as the
project progresses and the understanding of the API improves.
Using the mocking feature of API designer you confirm that the interaction with the API is sound
from the API client’s perspective.
Figure 43. Using the API designer feature of Anypoint Design Center to sketch and try-out (mock)
"Policy Holder Search PAPI".
Engaging
Documentation
Figure 44. Publishing an Anypoint Exchange entry for "Policy Holder Search PAPI", including API
Notebooks and an API Console, and optionally including it in Acme Insurance’s Public (Developer)
Portal (Exchange Portal), makes for engaging and discoverable documentation of that API serving
internal and optionally external API consumers.
From within the Anypoint Design Center project for "Policy Holder Search PAPI" publish to Anypoint
Exchange, thereby creating an Anypoint Exchange entry of type "REST API" for that API.
The Anypoint Exchange entry for an API is the main entry point to the documentation for that API.
As soon as a first draft of the API specification of "Policy Holder Search PAPI" has been created in
Anypoint Design Center, it should be published to Anypoint Exchange to announce its addition to
the application network. Use versioning to reflect the maturity (or lack thereof) of an API
specification.
Strictly speaking, an Anypoint Exchange entry of type "REST API" is for an API specification. But
Anypoint Exchange provides several features that turn Anypoint Exchange entries for APIs into
comprehensive portals for these APIs:
• It separates consumer- and client-facing version (major version) from asset version (full
semantic version of the API specification artifact): 6.2
• It parses the API specification and renders an API Console called "API summary", which allows
the exploration and mocking of the API
• It keeps track of API instances, i.e., API endpoints on which API implementations accept
requests
• It allows the addition of arbitrary content and specifically supports that creation of API
Notebooks
The manually-added content of an Anypoint Exchange entry for each API should at the very least
document what cannot be expressed in the API specification, such as the HTTPS mutual
authentication requirement for the "Aggregator Quote Creation EAPI".
Every change to the content of that API specification triggers an asset version increase in the
corresponding Anypoint Exchange entry. This behavior is consistent with the fact that Anypoint
Exchange is also a Maven-compatible artifact repository - storing, in this case, a RAML definition.
See 6.2 for a discussion of versioning API-related artifacts.
Figure 45. The Anypoint Exchange entry for "Policy Holder Search PAPI", providing a portal for this
API, including such views as the auto-generated API Console ("API summary") and
instances/endpoints for this and previous versions of this API.
"Policy Holder Search PAPI" can now be discovered in Acme Insurance’s Anypoint Exchange, when
browsing or searching for any kind of asset, including APIs.
You note that when an API specification is published to Anypoint Exchange then a corresponding
Anypoint Connector for Mule applications to invoke the API is also created as a separate Anypoint
Exchange entry (Figure 46).
Figure 46. Publishing an Anypoint Exchange entry based on an API specification auto-generates an
Anypoint Connector to invoke that API from Mule applications.
The API Console for the "Policy Holder Search PAPI" is automatically included in its Anypoint
Exchange entry, based on the preliminary API specification created earlier. It allows the invocation
of the API against the baseUri from the RAML definition as well as any of its known
instances/endpoints, including the mocking service.
Figure 47. The API Console automatically included in the Anypoint Exchange entry for "Policy
Holder Search PAPI".
Include an API Notebook for the "Policy Holder Search PAPI" in its Anypoint Exchange entry. This
API Notebook makes use of the API’s preliminary API specification created earlier.
The API Notebook can be created as a new, distinct page or API Notebook code cells can be
included in any of the existing (editable) pages. The former is typically preferred, as it makes the
API Notebook stand out. In any case, the essence of an API Notebook are its code cells, which are
demarcated as Markdown fenced code blocks with the notebook info-string
(https://github.github.com/gfm/) and contain JavaScript code.
Figure 48. Creating an API Notebook for "Policy Holder Search PAPI".
Figure 49. Sharing the Anypoint Exchange entry for "Policy Holder Search PAPI" allows it to be
published in Acme Insurance’s Public (Developer) Portal (Exchange Portal).
Accessing the Public (Developer) Portal (Exchange Portal) does not require authentication and
authorization and hence only publicly visible APIs should be exposed in this way. (This is clearly not
the case for the "Policy Holder Search PAPI" used here to illustrate the Public (Developer) Portal
(Exchange Portal) - apologies.)
The Public (Developer) Portal (Exchange Portal) can be styled to reflect the Corporate Identify of an
organization.
Figure 50. Acme Insurance’s lightly styled Public (Developer) Portal (Exchange Portal) showing only
publicly visible APIs from Acme Insurance’s application network.
The API instances (endpoints) visible in the Anypoint Exchange entry of an API accessed from the
Public (Developer) Portal (Exchange Portal) are only those that have been marked with public
visibility. By default, this includes the mocking service instance.
Figure 51. The API consumer’s view of the Anypoint Exchange entry for "Policy Holder Search PAPI"
when accessed from Acme Insurance’s Public (Developer) Portal (Exchange Portal).
4.3.13. Repeat for all APIs for the "Create quote for
aggregators" feature
Create rudimentary API specifications and corresponding Anypoint Exchange entries with API
Notebooks and API Consoles for all APIs needed for the "Create quote for aggregators" feature.
Figure 52. Acme Insurance’s Anypoint Exchange showing some of the APIs available in Acme
Insurance’s application network.
This is the second API-led connectivity project at Acme Insurance, so it can already build on an
Enterprise Architecture compatible with a nascent application network.
The project team realizing the "Customer Self-Service App" product is again located at the Personal
Motor LoB. However, it is assumed that the "Retrieve policy holder summary" feature will require
access to information typically handled by the Home LoB. This product therefore has a wider
business scope than the very focused "Aggregator Integration" product addressed earlier. The
contribution of the C4E, as a cross-LoB, Acme Insurance-wide entity, is therefore particularly
important. The federated nature of the Acme Insurance C4E should come as an advantage here,
because it means that there are C4E-aligned and -assigned roles such as API Architects in both
Personal Motor LoB IT and Home LoB IT.
Within the application network and API-led connectivity frameworks, you first architect for the
functional and then for the non-functional requirements of the two features of the "Customer Self-
Service App" product, in turn.
You analyze the "Retrieve policy holder summary" feature, trying to break it down into APIs in the
three tiers of API-led connectivity, checking against Acme Insurance’s Anypoint Exchange as you do
so:
• You discover the existing "Policy Holder Search PAPI" and decide that it fits the first step in the
"Retrieve policy holder summary" feature, so you reuse it from the new "Policy Holder Summary
PAPI"
• You define the new "Policy Search PAPI" to support searching for policies across lines of business
(motor and home)
• The "Claims PAPI" currently only needs to support searching for claims across LoBs, but is
envisioned to ultimately grow to support other operations on claims
All-in-all, the following new APIs could serve to realize the functional requirements of the "Retrieve
policy holder summary" feature with an API-led connectivity approach (Figure 53):
• "Mobile Policy Holder Summary EAPI": (policy holder identifier) -> (policy holder status
summary)
◦ Given an identifier of an Acme Insurance policy holder (SSN, customer number, …), returns a
concise, mobile-friendly summary of its status as a customer of Acme Insurance, incl. concise
summary data about policies held, claims open or recently updated, etc.
◦ A particular (strictly speaking non-functional) security aspect this Experience API is that the
policy holder identifier shall not be passed as a normal input parameter but must always be
taken to be the currently authenticated user (OAuth 2.0 resource owner) on whose behalf the
API invocation is made
• "Policy Holder Summary PAPI": (policy holder identifier) -> (policy holder status summary)
◦ Given an identifier of an Acme Insurance policy holder (SSN, customer number, …), returns a
summary of its status as a customer of Acme Insurance, incl. summary data about all policies
held and claims known, etc.
◦ It is assumed that the available policy holder identifier is acceptable input to "Policy Holder
Search PAPI"
◦ The policy holder identifier is passed as a normal input parameter
• "Policy Search PAPI": (policy properties) -> (matching policies)
◦ Based on available data describing a policy (data about policy holder, vehicle, insured home
address, …) returns a description of all matching policies at Acme Insurance, for any LoB
• "Claims PAPI": search: (claim properties) -> (matching claims)
◦ Based on available data describing a claim (data about policy, claimant, vehicle, burgled
home address, …) returns a description of all matching policies at Acme Insurance, for any
LoB
• "Motor Policy Search SAPI": (motor policy properties) -> (matching motor policies)
◦ Searches the Policy Admin System for motor policies matching the given policy data (data
about policy holder, vehicle, …)
• "Home Policy Search SAPI": (home policy properties) -> (matching home policies)
◦ Searches the Policy Admin System for home policies matching the given policy data (insured
home address, …)
• "Motor Claims Search SAPI": (claim properties) -> (matching motor claims)
◦ Searches the Motor Claims System for motor claims matching the given claim properties
(data about policy holder, vehicle, …)
• "Home Claims Search SAPI": (claim properties) -> (matching home claims)
◦ Searches the Home Claims System for home claims matching the given claim properties
(data about policy holder, burgled home address, …)
Experience APIs
Mobile Policy
Holder Summary
API
Process APIs
Policy Holder
Summary API
search
System APIs
Motor Policy Home Policy Motor Policy Home Policy Motor Claims Home Claims
Holder Search Holder Search Search API Search API Search API Search API
API API
Policy Admin
Motor Claims Home Claims
System
System System
Figure 53. Experience API, Process APIs and System APIs collaborating for the "Retrieve policy
holder summary" feature of the "Customer Self-Service App" product.
4.4.3. APIs for the "Submit auto claim" feature in all tiers
You define the "Mobile Auto Claim Submission EAPI" as the interface for the Customer Self-Service
Mobile App and the "Motor Claims Submission SAPI" for the interaction with the Motor Claims
System.
You tentatively define the "Motor Claims Submission PAPI", to insulate the Experience API from the
System API. This is because
• it is possible that the Process API will have to perform as-yet undiscovered coordination in order
to invoke the System API
• the Process API will likely need to validate the claim submission before passing it on to the
System API
All-in-all, the following APIs could serve to realize the functional requirements of the "Submit auto
claim" feature with an API-led connectivity approach (Figure 54):
Experience APIs
Mobile Auto
Claim
Submission API
Process APIs
Motor Claims
Submission API
System APIs
Motor Claims
Submission API
Motor Claims
System
Figure 54. Experience API, Process APIs and System APIs collaborating for the "Submit auto claim"
feature of the "Customer Self-Service App" product.
Note that the asynchronicity of the interaction (5.2.3) is not visible in Figure 54.
• The API specifications for the APIs capture the important functional and some non-functional
aspects in a preliminary fashion
• An entry in Acme Insurance’s Anypoint Exchange has been created based on each API’s API
specification, including an API Console and a rudimentary API Notebook for that API, and
pointing to the API’s instances/endpoints (which at this point only comprise those from the
mocking service)
• The Acme Insurance Public (Developer) Portal (Exchange Portal) gives external API consumers
access to all public APIs: these are typically only (some of) the Experience APIs in the
application network
• No NFRs have been addressed
• No API implementations and no API clients have been developed
Experience APIs
Process APIs
Policy Holder
create Summary API
search
Policy Holder Policy Options Motor Quote API Policy Search API Motor Claims Claims API
Search API Ranking API Submission API
System APIs
Motor Policy Home Policy Policy Options Motor Quote Motor Quote Motor Policy Home Policy Motor Claims Motor Claims Home Claims
Holder Search Holder Search Retrieval API Creation New Creation Addon Search API Search API Submission API Search API Search API
API API Business API Business API
Figure 55. All APIs in the Acme Insurance application network after addressing the functional
requirements of the "Aggregator Integration" product and "Customer Self-Service App" product.
But Anypoint Exchange and Public (Developer) Portals (Exchange Portals) are not general purpose
CMSs (Content-Management Systems), support only limited forms of visual customization, and lack
many interaction channels with API consumers, such as discussion forums. Anypoint API
Community Manager builds on top of the information available in Anypoint Platform and Anypoint
Exchange to provide these and other capabilities [Ref24].
Anypoint API Community Manager allows an organization such as Acme Insurance to build and
operate API consumer communities around their APIs, addressing both internal and external
developers (partners). Anypoint API Community Manager provides customization, branding,
marketing, and engagement capabilities.
APIs cataloged in Anypoint Exchange can be surfaced in Anypoint API Community Manager for API
consumers to discover them and use them to manage API clients, API access credentials, and
consumption metrics.
Anypoint API Community Manager is implemented on Salesforce Community Cloud and accesses
the information it needs about an application network by invoking Anypoint Platform APIs. Being
built on Salesforce Community Cloud, the look and feel, branding, and content of an Anypoint API
Community Manager instance can be extensively customized with Salesforce Community Builder, a
drag-and-drop editor for Salesforce Community Cloud [Ref26]. Similarly leveraging its Salesforce
Community Cloud foundation, Anypoint API Community Manager provides extensive dashboards
and reports about how API consumers interact with assets in Anypoint API Community Manager.
Figure 56. The Anypoint Exchange web UI and Public (Developer) Portals (Exchange Portals) (here
subsumed under "Exchange API portals") on the one hand, and Anypoint API Community Manager
on the other, have access to the same set of API-related assets in Anypoint Platform, which they
retrieve through Anypoint Platform APIs, in particular those for Anypoint Exchange (here called
"Exchange Services").
Figure 57. Anypoint API Community Manager can be extensively branded and customized, including
the Identity Provider used for user management.
Figure 58. Different content sources can be presented in Anypoint API Community Manager. This
includes APIs retrieved from Anypoint Exchange and news articles, but also events, tutorials, blog
posts, and any form of documentation.
Figure 59. API documentation presented in Anypoint API Community Manager can make use of API-
specific components, for example for querying APIs available in Anypoint Exchange, as well as the
full generic feature set of Salesforce Community Cloud.
Figure 60. The API Console familiar from Anypoint Exchange is one of many API-related
components that can be rendered in Anypoint API Community Manager pages.
Figure 61. API consumers can also request access to an API instance through Anypoint API
Community Manager, as well as manage their API clients (applications). API consumers can then
get insights on their API clients' performance as they invoke these APIs.
Figure 62. Administrators of an Anypoint API Community Manager instance use a rich set of tools
and controls to define the APIs to surface in Anypoint API Community Manager, manage CMS-style
content, forums, and all other aspects of that Anypoint API Community Manager instance.
Figure 63. Salesforce Community Builder is the visual drag-and-drop editor used to define the look-
and-feel and structure of Anypoint API Community Manager pages.
Summary
• Acme Insurance’s immediate strategic initiatives require the creation of an "Aggregator
Integration" product and a "Customer Self-Service App" product
• The functional requirements of these products have been analyzed:
◦ Require 3 Experience APIs, 7 Process APIs and 10 System APIs
◦ Aggregator and Customer Self-Service Mobile App invoke Experience APIs
◦ API implementations of Experience APIs invoke Process APIs
◦ API implementations of Process APIs invoke other Process APIs or System APIs
◦ System APIs access the Policy Admin System, the Motor Claims System and the Home Claims
System, respectively
• 1 Process API and 2 System APIs originally identified for the "Aggregator Integration" product
have been reused in the "Customer Self-Service App" product
• Using Anypoint Design Center, API specifications in the form of RAML definitions for each API
were sketched and simulated
• Anypoint Exchange entries with API Console and API Notebook were created and published for
each API
• Acme Insurance plans to expose some APIs from Anypoint Exchange in Anypoint API Community
Manager to provide API consumers with a visually more compelling and more interactive
experience than is possible with Anypoint Exchange and Public (Developer) Portals (Exchange
Portals) alone
Objectives
• Describe how Anypoint API Manager controls API invocations
• Use API policies to enforce non-functional constraints on API invocations
• Choose between enforcement of API policies in an API implementation, an API proxy, or
Anypoint Service Mesh
• Register an API client for access to an API version
• Describe when and how to pass client ID/secret to an API
• Establish guidelines for API policies suitable for System APIs, Process APIs and Experience APIs
• Describe how Anypoint Security enables de/tokenization and additional Edge policies in Anypoint
Runtime Fabric deployments
Consequently, the NFRs for the "Create quote for aggregators" feature are dictated primarily by the
Aggregator:
Figure 64. Essential NFRs for the "Create quote for aggregators" feature.
5.1.2. Meeting the NFRs for the "Create quote for aggregators"
feature using an Anypoint Platform-based Technology
Architecture
The implementation of the "Create quote for aggregators" feature must meet the NFRs listed
above. At this point you make a first attempt at selecting a Technology Architecture rooted in
Anypoint Platform features that addresses these NFRs:
• XML/HTTP interface:
◦ Not architecturally significant, should be captured in API specification
Retrieve policy
holder summary
Figure 65. Essential NFRs for the "Retrieve policy holder summary" feature.
• HTTPS:
◦ Document in API specification
◦ Ensure in API implementation
• OAuth 2.0:
◦ Enforce with Anypoint API Manager
◦ Requires Identity Provider for Client Management: PingFederate
• Consistency: to be addressed through event notifications, Module 8
This means that Acme Insurance’s PingFederate instance, in addition to serving as an Identity
Provider for Identity Management, also assumes the responsibilities for OAuth 2.0 Client
Management. The C4E in collaboration with Acme IT configures the MuleSoft-hosted Anypoint
Platform accordingly.
Processing claim submissions entails numerous automated downstream validation and processing
steps, for example:
• Storing images (typically of the accident) sent with the claim submission in a Document
Management System
• Checking coverage of the vehicle and driver involved in the accident with the Policy Admin
System
Performing these steps synchronously with the claim submission would take too long. Processing
claim submissions must therefore be done asynchronously.
• Request over HTTP with claim submission, with asynchronous processing of the submission
• Performance:
◦ Currently ill-defined NFRs
◦ Aim for 10 requs/s
◦ No response time requirement because processing is asynchronous
• Security: HTTPS, OAuth 2.0-authenticated customer
• Reliability: claim submissions must not be lost
• Consistency: Claims submitted from the Customer Self-Service Mobile App through the "Submit
auto claim" feature should be included as soon as possible in the summary returned by the
Figure 66. Essential NFRs for the "Submit auto claim" feature.
• Performance and security requirements: as before for "Retrieve policy holder summary" feature
• Async processing of claim submission and no claim submission loss:
◦ Select suitable messaging system to trigger asynchronous processing without message loss:
▪ Anypoint MQ or Mule runtime persistent VM queues as implemented in CloudHub
▪ Anypoint MQ would be a new component in Acme Insurance’s Technology Architecture
(8.3.1)
◦ Select suitable persistence mechanism to store correlation information for asynchronous
processing:
▪ Mule runtime Object Store as implemented in CloudHub (7.1.14)
• Consistency: to be addressed through event notifications, Module 8
The consistency requirement cannot be met just through communication with the Motor Claims
System alone, because once a claim submission is passed to the Motor Claims System it goes
through a sequence of transitions that are not visible from outside the Motor Claims System, i.e.,
are not accessible through the "Motor Claims Search SAPI". Only after some considerable time has
passed the newly submitted claim becomes visible to the "Motor Claims Search SAPI" and can
therefore be returned via the normal interaction with the Motor Claims System for the "Retrieve
policy holder summary" feature. This requirement will be addressed separately in Module 8.
• REST APIs
◦ With API specification in the form of a RAML definition or OpenAPI definition
◦ Without formal API specification
◦ Hypermedia-enabled REST APIs
• Non-REST APIs
◦ GraphQL APIs
◦ SOAP web services (APIs)
◦ JSON-RPC, gRPC, …
• An API implementation implemented as a Mule application can embed the feature of enforcing
API policies, by recruiting the API policy enforcement capability of the Mule runtime on which it
executes
• For external API implementations, i.e., API implementations not implemented as Mule
applications:
◦ A separate, auto-generated Mule application called an API proxy can be deployed in front of
exactly one external API implementation, in a Mule runtime called the API Gateway, to
enforce API policies for the API exposed by that external API implementation
◦ External API implementations deployed to a Kubernetes cluster can use Anypoint Service
Mesh as an add-on to the Kubernetes cluster. Anypoint Service Mesh provisions the Mule
applications and Mule runtimes required for API policy enforcement in a much more efficient,
streamlined, and Kubernetes-native way than would be possible by simply deploying one
generic API proxy for every API implementation in the Kubernetes cluster
The API policies themselves are not included into any of these Mule applications, just the capability
of enforcing API policies via the Mule runtime. This is true for both the API policy template (code)
and API policy definition (data). API policies are downloaded at runtime from Anypoint API Manager
into the Mule application that enforces them.
API Policy
Figure 67. An API policy consists of a template (code) and definition (data) and its enforcement
requires a Mule runtime, which provides this function. Enforcement can either be performed
embedded in an API implementation itself (if it is a Mule application), or via a separate API proxy
(a dedicated Mule application), or through Anypoint Service Mesh (via a dedicated Mule application
deployed to the same Kubernetes cluster as the API implementations).
API Policy
API Policy
download
Mule runtime
API implementation
(Mule app)
HTTP/S
API client
API client
HTTP/S
Mule runtime
API implementation
(Mule app)
download
API Policy
API Policy
Figure 68. The enforcement of API policies for API implementations that are Mule applications can
be performed embedded in the API implementation itself using services provided by the Mule
runtime on which the API implementation executes. Depending on the Anypoint Platform runtime
plane, different API implementations may or must execute in different Mule runtimes.
• API proxies are templated Mule applications that can be auto-generated by Anypoint API
Manager
• Being Mule applications, API proxies must be deployed to a Mule runtime, which is then typically
called an API Gateway. The term API Gateway denotes the usage and licensing of these Mule
runtimes, not a technical difference to "normal" Mule runtimes
• In Anypoint Platform runtime planes with iPaaS functionality (such as CloudHub), Anypoint API
Manager can not only auto-generate the API proxy but also deploy it to an auto-provisioned
API Policy
API Policy
download
download
API Policy
API Policy
(copy)
Figure 69. The enforcement of API policies for API implementations that are not Mule applications
(and are not deployed to a Kubernetes cluster) must be performed in a separate, dedicated,
templated Mule application called API proxy. API proxies recruit the API policy enforcement feature
of the Mule runtime on which they execute, which is called API Gateway. Typically, every API proxy
is deployed to its own dedicated Mule runtime, thereby introducing at least one separate node for
each API implementation. API clients must invoke the API proxy explicitly.
• Because Kubernetes-native API implementations are typically fine-grained, the addition of one
separate API proxy for every such API implementation would introduce unacceptable overhead
• Anypoint Service Mesh can be installed by customers into their customer-hosted Kubernetes
clusters, supported on:
◦ Google Kubernetes Engine (GKE)
◦ Amazon Elastic Kubernetes Service (EKS)
Kubernetes namespace
Mule app
(productized, part of
Anypoint Service
Mesh
via Istio/Envoy
Figure 70. The enforcement of API policies for API implementations that are not Mule applications
and are deployed to a Kubernetes cluster (as Kubernetes services and pods) is best performed via
Anypoint Service Mesh. Part of Anypoint Service Mesh is a dedicated Mule application and Mule
runtimes that are deployed as separate pods in the same Kubernetes namespace as the API
implementations. Through Istio/Envoy, employed by Anypoint Service Mesh, API policy
enforcement is performed via this Mule application for all API implementations in that namespace,
without the API clients having to change the endpoint addresses at which they invoke their APIs.
One set of Anypoint Service Mesh-provided Mule runtime/Mule application pods suffices to perform
API policy enforcement (and API management/analytics in general) for all - typically fine-grained -
API implementations in a Kubernetes cluster namespace.
• List scenarios/requirements that would be best addressed by API policy enforcement embedded
in the API implementation, in an API proxy, or through Anypoint Service Mesh, respectively
Solution
The following scenarios call for API proxies, Anypoint Service Mesh, or embedded API policy
enforcement:
API implementations are not Mule applications but external API implementations:
• API implementations are not Mule applications and hence do not execute in Mule runtimes:
Embedded API policy enforcement is not possible, only API proxies or Anypoint Service Mesh,
and the latter only if the API implementations are deployed to a Kubernetes cluster
• API implementations are deployed to a Kubernetes cluster as non-Mule applications: Anypoint
Service Mesh is the most idiomatic and efficient API policy enforcement approach
Figure 71. Anypoint API Manager displaying some of the APIs in the Acme Insurance application
network.
An automated policy is defined in a specific environment in Anypoint API Manager and for a specific
version of the Mule runtime. The automated policy is then automatically applied to all current and
future API instances in that envrionment for which API policy enforcement is performed in a
matching Mule runtime.
An API instance must also declare the asset version (full semantic version) currently being exposed
by this endpoint. The asset version (e.g., 2.3.4) must be compatible with the major API version
(e.g., v2) and can be updated during the lifetime of the API instance.
Multiple API instances can be bundled into an API Group instance. An API Group exists in a specific
organization and environment. Adminstrators can apply SLA tiers to the entire group of API
instances (5.3.25). API clients can request access to an API Group instance to gain access all API
instances in that group, rather than having to individually request access to each API instance
(5.3.26). API policies cannot be applied to API Group instances.
performed when configuring the API policy and is then applied at the time when the API policy is
enforced.
• Compliance
◦ Client ID enforcement
◦ Cross-Origin Resource Sharing (CORS) (control thereof)
• Security
◦ HTTP Basic Authentication API policies
▪ Basic Authentication - LDAP
▪ Basic Authentication - Simple
◦ IP-based API policies
▪ IP blocklist (= the name used here for what is officially still called "IP blacklist")
▪ IP allowlist (= the name used here for what is officially still called "IP whitelist")
◦ 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
◦ JWT Validation
◦ Tokenization-related API policies only available with Anypoint Security in Anypoint Runtime
Fabric (5.4.3)
• QoS
◦ SLA-based API policies
▪ Rate Limiting - SLA-based
◦ non-SLA-based API policies
▪ Rate Limiting
▪ Spike Control
▪ HTTP Caching
• Transformation
◦ HTTP header manipulation API policies
▪ Header Injection
▪ Header Removal
• Troubleshooting
◦ Message Logging
The following API policies were available previously when being enforced on Mule 3 runtimes and/or
older versions of Anypoint Platform:
Figure 72. Classification of API policies (templates) available out-of-the-box in Anypoint Platform
and the ability to define custom API policies. Only blue API policies are concrete, the others
elements are included for clarification.
• API policies are ordered in a chain, with the API implementation or API proxy as the last element
• An incoming HTTP request for an HTTP endpoint exposed by the API is passed down this chain,
and the outgoing (returning) HTTP response is passed up the chain
• API policies implement what is called an "around advice" in AOP, i.e., they execute code before
handing control to the next element in the chain and after the next element in the chain has
handed-back control, altering the HTTP request or response if desired
• In Mule 4 runtimes, API policies can also be applied to outgoing HTTP requests, i.e., these API
policies can define a separate "around advice" that applies to HTTP requests sent by the API
implementation or API proxy and incoming (returning) HTTP responses subsequently received
• Client ID enforcement
• CORS control
The CORS policy participates in interactions with API clients defined by CORS (Cross-Origin
Resource Sharing):
• Rejects HTTP requests whose Origin request header does not match configured origin domains
• Sets Access-Control- HTTP response headers to match configured cross-origins, usage of
credentials, etc.
• Responds to CORS pre-flight HTTP OPTIONS requests (containing Access-Control-Request-
request headers) as per the policy configuration (setting Access-Control- response headers)
The CORS policy can be important for Experience APIs invoked from a browser.
• Authentication/Authorization
• IP-based access control
• Payload threat protection
• Tokenization (5.4.3)
When an Identity Provider such as PingFederate is configured for Client Management on Anypoint
Platform, then API clients who register with Anypoint Platform for access to an API receive client ID
and secret values that are in sync between Anypoint Platform and the Identity Provider.
Token validation
Figure 73. The interaction between Anypoint Platform, PingFederate as an Identity Provider
configured for Client Management, and a Mule runtime enforcing the PingFederate access token
enforcement API policy.
The client ID assigned to an API client is immutable, but other properties of the API client
application, such as the client secret, the application URL, or the OAuth 2.0 redirect URL, could
require changing over the lifetime of an API client application. Changing ("rotating") the client
secret for a given client ID is particularly relevant for security reasons, so this will be used as the
prototypical use case for the following discussion.
Both Anypoint Platform and commonly used Identity Providers support client secret rotation - but
care must be taken that such a change is propagated to the other party, lest the client secret in
Anypoint Platform and the Identity Provider will be out-of-sync after such a change. This is
inevitable for OIDC DCR because it does not specify a mechanism for updating client secrets - but
Anypoint Platform implements an extension to OIDC DCR to enable updates from Anypoint Platform
to the Identity Provider (see below). Specifically:
• Anypoint Platform triggers the creation of an API client application in the Identity Provider, and
at this point client ID and secret are stored and in-sync in Anypoint Platform and the Identity
Provider. Any changes to the client secret from that point onwards are by default not synced in
either direction
• The client secret can be rotated in the Identity Provider, but the changed secret is not synced
back to Anypoint Platform. If the secret is changed in the Identity Provider then it becomes out-
of-sync with the secret stored in Anypoint Platform and therefore:
◦ For OAuth 2.0: API clients must use the new client secret when obtaining an OAuth 2.0
access token from the Identity Provider. This token can be validated successfully through the
matching OAuth 2.0 token enforcement API policy in Anypoint Platform, because that policy
delegates OAuth 2.0 access token validation to the Identity Provider
◦ For non-OAuth 2.0 API policies like Client ID enforcement: API clients must send the old
client secret with the API invocation, because client ID and secret in the API invocation are
validated against client ID and secret stored in Anypoint Platform
• If a strictly OIDC DCR-compatible Identity Provider is configured for Client Management in
Anypoint Platform, then Anypoint Platform does not allow rotating the client secret, because the
changed secret cannot be synced to such an Identity Provider, and hence the secret changed in
Anypoint Platform would become out-of-sync with the secret stored in the Identity Provider
◦ However, Anypoint Platform implements an extension to OIDC DCR that allows Anypoint
Platform to send a HTTP PUT/DELETE request to an external application when an API client
application is changed/deleted in Anypoint Platform. If this extension is enabled, then a client
secret change results in an HTTP PUT from Anypoint Platform to that application. That
application cannot be the Identity Provider itself, though, because these HTTP requests are
not standardized by OIDC DCR. Instead, the application must be an adapter that hides the
Identity Provider and translates all OIDC DCR invocations plus these proprietary PUT/DELETE
requests into invocations of the Identity Provider
The "HTTP Basic Authentication" API policy must be backed by one of these Security Managers:
The Security Manager is made available to the HTTP Basic Authentication API policy through its own
"Security Manager Injector" API policy.
API policies configure the functionality of a Simple or LDAP security manager inside the API policy
itself and therefore do not require a separate "Security Manager Injector" API policy.
• JSON Web Token (JWT) is a compact claims representation format intended for space
constrained environments such as
◦ HTTP Authorization headers and
◦ URI query parameters.
• JWTs encode claims to be transmitted as a JSON object that is used
◦ as the payload of a JSON Web Signature (JWS) structure or
◦ as the plaintext of a JSON Web Encryption (JWE) structure,
• enabling the claims to be
◦ digitally signed or integrity protected and/or
◦ encrypted.
• JWT Claims Set: A JSON object that contains the claims conveyed by the JWT.
• Claim: A piece of information asserted about a subject. A claim is represented as a name/value
pair:
◦ A Claim Name is always a string.
◦ A Claim Value can be any JSON value.
• The contents of the JOSE Header describe the cryptographic operations applied to the JWT
Claims Set.
• Unsecured JWTs: created without a signature or encryption.
1 {
2 "typ": "JWT",
3 "alg": "HS256"
4 }
1 {
2 "iss": "joe",
3 "exp": 1300819380,
4 "http://example.com/is_root": true
5 }
◦ Both JSON objects are then normalized, base64-encoded, MACed, the MAC is normalized and
base64-encoded, and all 3 parts are concatenated with . to form the complete JWT:
1 eyJ0<snip>NiJ9.eyJp<snip>VlfQ.dBjf<snip>EjXk
• Unsecured JWT:
◦ JOSE Header:
1 { "alg": "none" }
1 eyJh<snip>lIn0.eyJp<snip>VlfQ.
• Registered Claim Names are registered in the IANA "JSON Web Token Claims" registry:
Figure 74. The interaction of external API clients with Experience APIs and the API invocations
within an application network form two logically distinct realms of token usage. Experience APIs sit
at the boundary between those two realms. OAuth 2.0 access tokens created by an Identity
Provider acting as an OAuth 2.0 server are typically used in the former realm, whereas JWTs can
be used in the latter realm to transmit an application network-internal Claims Set about the current
user. (JWTs are thereby used as User Claims tokens.)
• Signatures don’t hide the JWT Claims Set from third parties, because they are not a form of
encryption (which JWE would provide)
Signature validation by the JWT recipient requires access to the shared secret (for HMAC) or public
key (for a digital signature) that matches the shared secret or private key, respectively, used for
signing the JWT. The shared secret or public key are typically retrieved by the JWT recipient from a
JWKS server at a URL known to the JWT recipient [Ref23].
Signature validation:
• Rejects an incoming HTTP request if its JWT does not pass signature validation
• Does not support JWE (encrypted) JWTs
• Supports JWS (signed) JWTs, validating the token’s signature
◦ Confined to a subset of JWS-supported algorithms (HMAC and RSA)
◦ Shared secret or public key can be specified in the policy definition or retrieved from a JWKS
server
• Supports unsecured (unsigned, unencrypted) JWTs
• Can also simply ignore a token’s signature even if present
• Rejects an incoming HTTP request if the Claims Set in the JWT does not match configured
constraints
• Supports all types of JWT Claims (registered, public, private)
• Propagates the Claims Set to the Mule application to which the JWT validation API policy is
applied
• This is a local, in-process propagation in an in-memory variable
• nesting levels
• string length
• number of elements
etc.
The first two of these API policies enforce a throughput limit defined in number of API invocations
per unit of time:
• Rate Limiting rejects requests when the throughput limit has been reached
• Spike Control queues requests beyond the throughput limit and delays and limits reprocessing of
these requests
Anypoint Platform provides two different ways to define the throughput limit enforced by the Rate
Limiting API policy:
• Non-SLA-based, where a throughput limit is defined on the API policy definition associated with
a particular API instance
◦ Limit is enforced for that API instance and the sum of all its API clients, ignoring the identity
of the API clients
• SLA-based, where a throughput limit is defined in an SLA tier
◦ API clients must register with the API instance at a particular SLA tier
◦ Limit is enforced separately for each registered API client
An SLA-based API policy requires the API client to identify itself with a client ID: 5.3.27. On the
other hand, the API clients of APIs without client ID-based API policies can remain anonymous.
When an API client invokes an API that has any QoS-related API policy defined, then the HTTP
response from the API invocation may contain HTTP response headers that inform the API client of
the remaining capacity as per the QoS-related API policy:
• X-RateLimit-Reset: remaining time in milliseconds until the end of the current limit
enforcement time window
• X-RateLimit-Limit: overall number of API invocations allowed in the current limit enforcement
time window
• X-RateLimit-Remaining: actually remaining number of API invocations in the current limit
enforcement time window
Returning these HTTP response headers is optional (configurable) and should only be done if API
clients are internal to the organization, such that external API clients do not become privy to how
QoS is enforced for the API.
If an API instance has SLA tiers defined then every API client that registers for access to that API
instance is assigned to exactly one SLA tier and is thereby promised the QoS offered by that SLA
tier.
• defines one or more throughput limits, i.e., limits on the number of API invocations per time unit
◦ E.g., 100 requs per second and simultaneously 1000 requs per hour
◦ These limits are per API client and API instance
• requires either manual approval or supports automatic approval of API clients requesting usage
of that SLA tier
◦ typically, SLA tiers that confer high QoS guarantees require manual approval
To enforce the throughput limits of an SLA tier, an SLA-based Rate Limiting API policy needs to be
configured for that API instance. The violation of the QoS defined by an SLA tier can be monitored
and reported with Anypoint Analytics and can also be the source of alerts.
API clients sending API invocations to an API with enforced SLA tiers must identify themselves via a
client ID/client secret pair sent in the API invocation to the API.
SLA tiers can also be assigned to an API Group instance and thereby to all API instances in that
group. The throughput limits of an SLA tier applied to a group can be refined for individual API
instances in that group. The enforcement of the throughput limits, as always, must occur through
the appropriate SLA-based API policies applied to the API instances - API policies cannot be applied
to the API Group instance.
In Anypoint Platform, an API client requesting access or having been granted access to an API is
called "application". The resulting relationship between API and API client is called a "contract" in
Anypoint API Manager.
Once the registration request is approved - either automatically or manually - the API consumer
receives a client ID and client secret that must be supplied by the nominated API client in
subsequent API invocations to that API instance.
Figure 75. An API consumer is using the Anypoint Exchange entry for a particular (major) version
of "Aggregator Quote Creation EAPI" to request access to an API instance of that API for an API
client (application) called Aggregator.
Figure 76. Anypoint API Manager web UI showing the Aggregator as the only API client (application
"contract") registered for access to this particular API instance of "Aggregator Quote Creation
EAPI". The Aggregator is registered with the "Standard" SLA tier.
API Group instances bundle several API instances for the main benefit of enabling API consumers to
request access for a particular API client to the group and thereby gain access to each API instance
in that group. This establishes a group-level contract in Anypoint API Manager (and a potential
Identity Provider configured for Client Management), similar to the API-level contract described
previously. (It follows that all API instances in an API Group instance must use the same Identity
Provider for Client Management.) Just as for API instances, requesting access to an API Group
instance is peformed through Anypoint Exchange. To enable this, API Groups can be published to
Anypoint Exchange from Anypoint API Manager, so that API Groups and API Group instances
receive their own Anypoint Exchange entries, distinct from those of the individual APIs and API
instances.
When requesting access to an API instance or API Group instance with one or more SLA tiers, one
SLA tier must be selected by the API consumer when requesting access (Figure 75).
Client ID and secret must be supplied in the API invocation as defined by the API policy. Available
options are:
• as query parameters
◦ by default client_id and client_secret
• as custom request headers
• in the standard Authorization header as defined by HTTP Basic Authentication
◦ where client ID takes the role of username and client secret that of password
The client ID-based API policies currently available in Anypoint Platform are:
• Client ID enforcement
◦ Enforces presence and validity of client ID (and typically also client secret)
• Rate Limiting - SLA-based
◦ Rejects requests when the throughput limit defined in the SLA tier for the API client has been
reached
SLA-based Rate Limiting requires the SLA tier of the API client making the current API invocation to
be retrieved by the client ID supplied in the API invocation. This API policy therefore implicitly also
enforces the presence and validity of the client ID, and, as a convenience, optionally, also the client
secret. It therefore can subsume the functionality of the Client ID enforcement API policy.
OAuth 2.0 access tokens implicitly carry the identity of the API client and its client ID, because:
• The API client (and its client ID/secret) is known to both Anypoint Platform and the OAuth 2.0
server (the Identity Provider registered for Client Management with Anypoint Platform)
• When the API client retrieves a token from the OAuth 2.0 server, it does so by identifying itself
with its client ID
• The OAuth 2.0 access token enforcement API policy exchanges the token for the client ID and
passes it to any downstream SLA-based API policy
Therefore, client secret validation is often turned off if the SLA-based API policy is combined with
an OAuth 2.0 access token enforcement API policy. In this case, the OAuth 2.0 API policy
exchanges the token for the client ID and makes the client ID available to the SLA-based API
policy.
The API policy caches entire HTTP responses, incl. the HTTP response status code, HTTP response
headers and the HTTP response body. There is a size limit for cached HTTP responses (currently
1MB).
Caching is only performed for HTTP requests for which a configurable expression evaluates to true.
By default, this expression tests that the HTTP method is GET or HEAD, i.e., is safe (6.4.6).
Similarly, caching is only performed for HTTP responses for which a configurable expression
evaluates to true. By default, this expression tests that the status code is in a restricted set of 2xx,
3xx, 4xx or 5xx codes.
By default the HTTP Caching API policy honors many of the caching directives (HTTP headers)
defined by the HTTP standard (6.4.7).
Cache invalidation of one or all cache entries can be performed by sending a HTTP request with a
configurable HTTP request header and the value invalidate or invalidate-all, respectively.
Various parameters of the HTTP Caching API policy determine how exactly caching is performed:
• Cache entries are stored by a string key defined via a DataWeave expression. By default, this is
the request path, excl. query parameters
• The size of the cache in terms of number of entries must be limited
• Cache entries expire as determined by a configurable time-to-live
• The cache can be distributed such that the same cache entries are seen by all replicas of the API
policy (corresponding to replicas of the API implementation or API proxy to which the API policy
is applied). This results in the cache being maintained in a CloudHub Object Store as described
in 7.1.15
• The cache can also be persistent such that it survives restarts of the API implementation, which
again means that it must be maintained in a CloudHub Object Store
• Header Injection
• Header Removal
The values for the injected headers are DataWeave expressions, and hence can be dynamically
evaluated.
They are useful, for instance, as one part of a solution for propagating transaction IDs as HTTP
headers along chains of API invocations.
Experience APIs
Aggregator
Quote Creation
API
create
Process APIs
System APIs
Motor Policy Home Policy Policy Options Motor Quote Motor Quote
Holder Search Holder Search Retrieval API Creation New Creation Addon
API API Business API Business API
Policy Admin
System
Figure 77. All APIs collaborating for the "Aggregator Integration" product.
Solution
• IP allowlisting to the IP address range of the API implementations of Process APIs (assuming
they execute in a subnet that assigns well-defined source IPs to them)
• Must always define SLA tiers that require manual approval
• SLA-based Rate Limiting API policy must enforce the QoS of the chosen SLA tier
• Spike Control API policy must protect the backend system from temporary API invocation bursts
by evening them out and enforces the published overall throughput guarantee
◦ X-RateLimit- HTTP response headers should not be exposed to API clients from this API
policy but from the SLA-based API policy
• These API policies should be applied in this order and thereby enforce strict compliance for this
critical class of APIs
Acme Insurance applies these guidelines to all System APIs in their application network.
Figure 78. API policies defined for a particular API instance of the "Policy Options Retrieval SAPI".
Note the automatic application of all automated policies defined in this environment that match the
version of the Mule runtime that performs API policy enforcement for this API instance.
• IP allowlisting to the IP address range of the API implementations of Process APIs and
Experience APIs (assuming they execute in a subnet that assigns well-defined source IPs to
them)
• May define non-SLA-based API policies but should then use Client ID enforcement, such that the
identity of API clients is always known and available for API-based analytics (Module 10)
• If SLA tiers are defined then SLA-based Rate Limiting API policy must enforce the QoS of the
chosen SLA tier
• Spike Control API policy must protect from temporary API invocation bursts by evening them out
and enforces the published overall throughput guarantee
◦ X-RateLimit- HTTP response headers should not be exposed to API clients from this API
policy
• These API policies should be applied in this order
Acme Insurance applies these guidelines to all Process APIs in their application network.
Figure 79. API policies defined for a particular API instance of the "Policy Holder Search PAPI". Note
the automatic application of all automated policies defined in this environment that match the
version of the Mule runtime that performs API policy enforcement for this API instance.
For the "Aggregator Quote Creation EAPI" consumed by the Aggregator you define the following:
Figure 80. API policies defined for a particular API instance of the "Aggregator Quote Creation
EAPI". Note the automatic application of all automated policies defined in this environment that
match the version of the Mule runtime that performs API policy enforcement for this API instance.
For the "Mobile Policy Holder Summary EAPI" and "Mobile Auto Claim Submission EAPI" consumed
by Acme Insurance’s own Customer Self-Service Mobile App you define:
Figure 81. API policies defined for a particular API instance of the "Mobile Policy Holder Summary
EAPI". The "OAuth 2.0 access token enforcement using external (Mule OAuth) provider" API policy
should be replaced with one that fits the Identity Provider configured for Client Management. Note
that there is currently no Mule runtime deployed that performs API policy enforcement for this API
instance (see the "unregistered" status). Anypoint API Manager can therefore not determine which,
if any, of the automated policies defined in this environment can be applied to this API instance.
From this the following general guidelines for API policies on Experience APIs emerge:
Figure 82. API policies applied to APIs in all tiers collaborating for the "Create quote for
aggregators" feature (the suggested order of API policies is not visible in this diagram).
Figure 83. API policies applied to APIs in all tiers collaborating for the "Retrieve policy holder
summary" feature (the suggested order of API policies is not visible in this diagram).
Figure 84. API policies applied to APIs in all tiers collaborating for the "Submit auto claim" feature
(the suggested order of API policies is not visible in this diagram).
These changes to the contract between API client and API implementation must be reflected in the
API specification of the API. In other words, applying API policies often requires the RAML definition
or OpenAPI definition to be changed to reflect the applied API policies.
In the case of security-related API policies, RAML has specific support through securitySchemes,
e.g. of type OAuth 2.0 or Basic Authentication. In other cases, RAML traits are a perfect
mechanism for expressing the changes to the API specification introduced by the application of an
API policy.
The C4E owns the definition of reusable RAML fragments for all commonly used API policies in
Acme Insurance. These RAML fragments are published to Anypoint Exchange to encourage
consumption and reuse.
Figure 85. Increase in HTTP request-response latency through the application of various API
policies, which are enforced embedded in the API implementation.
Notes:
• The timings quoted in Figure 85 for the PingFederate access token enforcement policy exclude
the actual remote call to PingFederate
• Measurements for Figure 85 where performed using API Gateway 2.0, 1kB payloads, c3.xlarge
(4-vCore, 7.5GB RAM, standard disks, 1Gbit network)
Figure 86. In a deployment of Anypoint Runtime Fabric with Anypoint Security as the Ingress,
external API clients access APIs exposed by Mule application API implementations via Anypoint
Security, which provides load-balancing and SSL termination and enforces Edge policies for all
these APIs. Additionally, Anypoint API Manager-defined API policies can be enforced within the Mule
runtimes to which these Mule applications are deployed.
• Content Attack Prevention (CAP) by limiting HTTP request properties: HTTP methods, header
size, body size, URL path length, … (cf. 5.3.23)
• Allowlisting of API client IP addresses, similar to IP-based access control in API policies (5.3.11)
• Web Application Firewall (WAF) security policy enforcing the OWASP Core Rule Set [Ref17],
including (configurable): SQL injection, cross-site scripting, local file inclusion, HTTPoxy,
Shellshock, session fixation, …
• DoS attack prevention through monitoring of API clients' HTTP requests, and rate limiting or
blocking their IP address upon detection of a DoS attack
◦ Other Edge policies and API policies can escalate policy violations to a DoS policy to
contribute to the detection of a DoS attack, as defined by rules in the DoS policy
• Tokenization replaces sensitive information (credit card number, SSN, account number, any
regex, …) with a reversable token
• Detokenization restores the original sensitive information
• Typically configured to be format-preserving such that downstream systems' validation rules are
not violated
◦ 1234-5678-9012-3456 -> 9264-1956-3442-3456 (tokenization of credit card number,
configured to preserve format and keep last 4 digits)
• Applied to HTTP requests (Figure 87) or responses (Figure 88) sent to/from individual APIs by
configuring the Tokenization and Detokenization API policies via Anypoint API Manager on the
corresponding API instances
• Tokenization Service is deployed to Anypoint Runtime Fabric and these API policies delegate to it
the actual de/tokenization
• Anypoint Security implements vaultless tokenization, i.e., there is no "vault" (database) that
stores the original, clear-text values
• Tokens are not amenable to brute-force attempts of detokenization
Figure 87. Tokenization can be performed by the Tokenization API policy on the contents of HTTP
requests. Detokenization via the Detokenization API policy works analogously. Both API policies
delegate to Anypoint Security’s Tokenization Service.
Figure 88. Tokenization can be performed by the Tokenization API policy on the contents of HTTP
responses. Detokenization via the Detokenization API policy works analogously. Both API policies
delegate to Anypoint Security’s Tokenization Service.
Summary
• The NFRs for the "Aggregator Integration" product and "Customer Self-Service App" product are
a combination of constraints on throughput, response time, security and reliability
• Anypoint API Manager and API policies control APIs and API invocations and can impose NFRs on
that level in various areas
• API policies can be enforced directly in an API implementation that is a Mule application, in a
separately deployed API proxy, or via Anypoint Service Mesh
• Client ID-based API policies require API clients to be registered for access to an API instance
◦ Must pass client ID/secret with every API invocation, possibly implicitly via OAuth 2.0 access
token
• The Acme Insurance C4E has defined guidelines for the API policies to apply to System APIs,
Process APIs and Experience APIs
• C4E has created reusable RAML fragments for API policies and published them to Anypoint
Exchange
• Anypoint Security can enforce Edge policies to implement perimeter defence in customer-hosted
deployments of Mule runtimes on Anypoint Runtime Fabric
• De/Tokenization can be applied to API invocation content by API policies that require Anypoint
Security