Integrations
Patterns
Messaging Channels
| Pattern | Image |
|---|---|
| Point-to-Point Channel | |
| Pub-Sub Channel | |
| Dead Letter Channel |
Message Construction
| Pattern | Image |
|---|---|
| Line | |
| Message | |
| Command Message | |
| Document Message | |
| Event Message | |
| Request-Reply |
Message Routing
| Pattern | Image |
|---|---|
| Content-Based Router | |
| Splitter | |
| Aggregator | |
| Scatter-Gather |
Message Transformation
| Pattern | Image |
|---|---|
| Content Enricher | |
| Content Filter | |
| Message Translator | |
| Normalizer |
Message Endpoints
| Pattern | Image |
|---|---|
| Sender | |
| Receiver |
Flows
Request-Reply
The “Sender” (example “HTTPIn” takes a Document as input and dispatches a message). The message
has a “respond_to” channel. The receiver (example “APICall” takes the request document, makes an HTTP call, constructs a response message) and sends to the respond_to channel.
Pattern language
Application A constructs a message, sends via a channel where it goes through Routing and Transformation, ending at Application B.
Web Socket
Client connects to “HTTPIn” and opens two new channels. These can connect up with a Shell Receiver Endpoint that opens a STDIN and STDOUT channel that connect up with the WS channels.
Tenant Management
Mutation: A Request-Reply where we do an API Call, write an Activity record, and then return a response
OAuth
This pattern implements the OIDC Authorization Code Grant flow.
name: example
nodes:
- id: start
action: HTTPIn
config:
method: GET
routes:
- /{*rest}
- id: oidc
action: Callout
config:
graph: oidc
config:
issuer: https:://idp/issuer/.well-known/openid-configuration
- id: rp
action: APICall
config:
url: https://some_upstream_service
method: GET
edges:
- { from: start, to: oidc }
- { from: oidc, to: rp }
---
name: oidc
nodes:
- id: intake
action: Normalizer
description: take a HTTP message and issuer config and append issuer details
config:
session_cookie: request.claim_ticket
- id: claim
action: ContentEnricher
description: ""
config:
claim: claim_ticket
- id: decision
action: ContentRouter
description: Route depending on what phase we are in
config:
rules:
- label: idp_callback
match: "(request.path == /cb and request.method == GET)"
next: idp_callback
- label: not_logged_in
match: "no_claim_ticket_found (session_cookie)"
next: redirect_to_idp
- name: "logged_in"
match: "claim_ticket_found"
next: done
- id: redirect_to_idp
action: APICall
config:
url: https:://idp/issuer/.well-known/openid-configuration
method: GET
next:
- id: prepare_redirect
action: MessageTranslation
config:
url: https://oidc.dev.api.gov.bc.ca/authorize
method: GET
params:
client_id: "client_id"
response_type: "code"
redirect_uri: "https://oidc.dev.api.gov.bc.ca/callback"
scope: "openid profile email"
state: "state"
nonce: "nonce"
pkce: "calculation"
next:
- id: return_redirect
action: HTTPResponse
config:
status_code: 302
headers:
Location: "https://oidc.dev.api.gov.bc.ca/authorize?client_id=client_id&response_type=code&redirect_uri=https://oidc.dev.api.gov.bc.ca/callback&scope=openid profile email&state=state&nonce=nonce"
- id: idp_callback
action: MessageTranslation
config: {}
next:
- id: get_token
action: APICall
config:
url: https://oidc.dev.api.gov.bc.ca/token
method: POST
headers:
Content-Type: application/x-www-form-urlencoded
body:
grant_type: "authorization_code"
code: "{query.code}"
client_id: "client_id"
client_secret: "client_secret"
pkce: "calculation"
next:
- id: new_claim_ticket
action: ClaimTicket
config:
ticket: "{response}"
- id: prepare_cookie
action: MessageTranslation
config:
session_cookie: request.claim_ticket
path: /
http_only: true
secure: true
same_site: strict
- id: return_redirect
action: HTTPResponse
config:
status_code: 302
headers:
Set-Cookie: '"claim_ticket=" + [response.claim_ticket, response.http_only, response.secure, response.same_site].join("; ")'
Location: "{start.query.redirect_uri}"