05 API Management
05 API Management
● REST APIs
○ With API specification as RAML definition or OAS definition
○ Without formal API specification
○ Hypermedia-enabled REST APIs
● Non-REST APIs
○ GraphQL APIs
○ SOAP web services (APIs)
○ JSON-RPC, gRPC, …
API policies
● Client ID enforcement
● CORS control
○ Interacts with API clients for 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
○ Can be important for Experience APIs invoked from a browser
● Authentication/Authorization
○ OAuth 2.0 token enforcement API policies
■ Require matching Identity Provider configured for Client Management
● OpenAM, PingFederate or OIDC DCR compatible (Okta)
■ Discouraged “OAuth 2.0 access token enforcement using external provider”
requires access to Mule OAuth 2.0 provider or other configured in the policy
○ Basic Authentication: LDAP/Simple
■ Incorporate access to Identity Provider
● IP-based access control
○ blacklisting, whitelisting
● Payload threat protection
○ Guard against attacks sending over-sized HTTP request bodies
○ Limit size of XML or JSON bodies
All contents © MuleSoft Inc. 26
Interactions with OAuth 2.0 Client Management
● SLA tiers
○ Enable different API clients to receive different QoS
○ Define one or more throughput limits
■ Per API client and API instance
● API instance with SLA tiers requires every API client to register
for access with exactly one SLA tier
○ Manual or automatic approval
○ API clients must send client ID/client secret in API invocations
○ API client is promised the QoS offered by that SLA tier
● Enforcement by SLA-based Rate Limiting API policy
● Violation of SLA monitored, reported and alerted-on
All contents © MuleSoft Inc. 29
● Server-side caching
● Caches entire HTTP responses
○ status code, headers, body
○ Size limit of 1MB
● Only if
○ HTTP request expression is true:
■ Default: HTTP method is GET or HEAD
○ HTTP response expression is true
■ Default: status code is in restricted set of 2xx, 3xx, 4xx or 5xx
● May honor many caching directives (HTTP headers)
● Cache invalidation via HTTP request header
● Key
○ Default: request path
● Number of entries
● Time-to-live
● Distributed
● Persistent
● Increase in HTTP
request-response latency
● through API policies
● enforced embedded in
API implementation
Summary