-
Notifications
You must be signed in to change notification settings - Fork 215
/
source.yml
169 lines (163 loc) · 6.59 KB
/
source.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Copyright (c) 2022 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
type: object
title: Source
description: A subscription source subscribed by this connection
properties:
addresses:
type: array
uniqueItems: true
title: Array of source addresses
description: The source addresses this connection consumes messages from
items:
type: string
title: Source address
description: A source address to consume messages from
consumerCount:
type: integer
title: Consumer count
description: The number of consumers that should be attached to each source address
default: 1
qos:
type: integer
title: Quality of service level
description: Maximum Quality-of-Service level to request when subscribing for messages
authorizationContext:
type: array
title: The authorization context
description: The authorization context defines all authorization subjects associated for this source
uniqueItems: true
items:
type: string
title: Authorization Subject
description: |-
An authorization subject associated with this source.
You can either use a fixed subject or use a placeholder that resolves header values from incoming messages.
For example to use the `device_id` header in the subject, you can specify the placeholder
`{{ header:device_id }}` which is then replaced by Ditto when a message from this source is processed.
By using a placeholder you can access any header value: `{{ header:<any-header-name> }}`
example:
- "ditto:myAuthorizationSubject"
- "device:{{ header:device_id }}"
enforcement:
type: object
title: Enforcement configuration
description: Defines an enforcement for this source to make sure that a device can only access its associated
Thing.
required:
- input
- filters
properties:
input:
type: string
title: Input value of enforcement
description: |-
The input value of the enforcement that should identify the origin of the message (e.g. a
device id). You can use placeholders within this field depending on the connection type. E.g. for AMQP
1.0 connections you can use `{{ header:[any-header-name] }}` to resolve the value from a message header.
example: "{{ header:device_id }}"
filters:
type: array
title: The enforcement filters
description: An array of filters. One of the defined filters must match the input value from the message
otherwise the message is rejected.
uniqueItems: true
items:
type: string
title: Enforcement filter
description: |-
A filter that must match the input value for a message to be accepted. You can use the placeholders
`{{ thing:id }}`, `{{ thing:name }}` or `{{ thing:namespace }}` in a filter.
example:
- "{{ thing:id }}"
- "{{ thing:namespace }}/{{ thing:name }}"
acknowledgementRequests:
type: object
title: Acknowledgement requests configuration
description: Contains requests to acknowledgements which must be fulfilled before a message consumed from this
source is technically settled/ACKed at the e.g. message broker.
additionalProperties: false
properties:
includes:
type: array
title: Included acknowledgement requests
description: Acknowledgement requests to be included for each message consumed by this source.
items:
title: String representation of a single acknowledgement request
type: string
filter:
type: string
title: Filter expression whether to include acknowledgements at all
description: Optional filter to be applied to the requested acknowledgements - takes an `fn:filter()`
function expression
example:
- "fn:filter(header:qos,'ne',0)"
required:
- includes
payloadMapping:
type: array
title: The payload mappings
description: A list of payload mappings that are applied to messages received via this source. If no
payload mapping is specified the standard Ditto mapping is used as default.
items:
type: string
title: Payload Mapping
description: References a payload mapping definition by its ID (the key of the PayloadMappingDefinition)
example:
- "Ditto"
- "status"
headerMapping:
type: object
title: Header mapping configuration
description: Ditto protocol headers computed from external headers and certain properties of the Ditto protocol messages created by payload mapping.
replyTarget:
type: object
title: Reply target configuration
description: Configuration for sending responses of incoming commands.
additionalProperties: false
properties:
enabled:
type: boolean
title: Whether reply target is enabled
description: Whether reply target is enabled.
address:
type: string
title: Reply target address
description: |-
The target address where responses of incoming commands from the parent source are published to.
The following placeholders are allowed within the target address:
* Thing ID: `{{ thing:id }}`
* Thing Namespace: `{{ thing:namespace }}`
* Thing Name: `{{ thing:name }}` (the part of the ID without the namespace)
* Ditto protocol topic attribute: `{{ topic:[topic-placeholder-attr] }}`
* Ditto protocol header value: `{{ header:[any-header-name] }}`
If placeholder resolution fails for a response, then the response is dropped.
example:
- "{{ header:device_id }}"
- "{{ source:address }}"
headerMapping:
type: object
title: Header mapping configuration
description: External headers computed from headers and other properties of Ditto protocol messages.
expectedResponseTypes:
type: array
title: Expected response types
description: Contains a list of response types that should be published to the reply target.
uniqueItems: true
items:
type: string
title: Response types
enum:
- "response"
- "error"
- "nack"
required:
- address