Skip to content

Commit 5e98fec

Browse files
committed
features: add potentiallyUnsafeConfigAnnotations
Fix issue 1202 Signed-off-by: Akihiro Suda <[email protected]>
1 parent 6331715 commit 5e98fec

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

features.md

+18
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,24 @@ The current version of the spec do not provide a way to enumerate the possible v
140140
}
141141
```
142142

143+
## <a name="featuresPotentiallyUnsafeConfigAnnotations" />Unsafe annotations in `config.json`
144+
145+
**`potentiallyUnsafeConfigAnnotations`** (array of strings, OPTIONAL) contains values of [`annotations` property of `config.json`](config.md#annotations)
146+
that may potentially change the behavior of the runtime.
147+
148+
A value that ends with "." is interpreted as a prefix of annotations.
149+
150+
### Example
151+
```json
152+
"potentiallyUnsafeConfigAnnotations": [
153+
"com.example.foo.bar",
154+
"org.systemd.property."
155+
]
156+
```
157+
158+
The example above matches `com.example.foo.bar`, `org.systemd.property.ExecStartPre`, etc.
159+
The example does not match `com.example.foo.bar.baz`.
160+
143161
# Example
144162

145163
Here is a full example for reference.

schema/features-schema.json

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
},
1818
"annotations": {
1919
"$ref": "defs.json#/definitions/annotations"
20+
},
21+
"potentiallyUnsafeConfigAnnotations": {
22+
"$ref": "defs.json#/definitions/ArrayOfStrings"
2023
},
2124
"linux": {
2225
"$ref": "features-linux.json#/linux"

specs-go/features/features.go

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ type Features struct {
2424
// Annotations contains implementation-specific annotation strings,
2525
// such as the implementation version, and third-party extensions.
2626
Annotations map[string]string `json:"annotations,omitempty"`
27+
28+
// PotentiallyUnsafeConfigAnnotations the list of the potential unsafe annotations
29+
// that may appear in `config.json`.
30+
//
31+
// A value that ends with "." is interpreted as a prefix of annotations.
32+
PotentiallyUnsafeConfigAnnotations []string `json:"potentiallyUnsafeConfigAnnotations,omitempty"`
2733
}
2834

2935
// Linux is specific to Linux.

0 commit comments

Comments
 (0)