Repository navigation
Expand file tree
/
Copy pathextensions.html
More file actions
536 lines (509 loc) · 35.4 KB
/
Copy pathextensions.html
File metadata and controls
536 lines (509 loc) · 35.4 KB
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Extensions | Runtime Conditions</title>
<meta name="description" content="How Runtime Conditions extensions define condition kinds, interface types, fields, and schemas." />
<link rel="canonical" href="https://runtimeconditions.io/extensions.html" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Extensions | Runtime Conditions" />
<meta property="og:description" content="How Runtime Conditions extensions define condition kinds, interface types, fields, and schemas." />
<meta property="og:url" content="https://runtimeconditions.io/extensions.html" />
<meta property="og:site_name" content="Runtime Conditions" />
<meta property="og:image" content="https://runtimeconditions.io/assets/social-card.jpg" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="Runtime Conditions logo: declare what your app needs to run." />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Extensions | Runtime Conditions" />
<meta name="twitter:description" content="How Runtime Conditions extensions define condition kinds, interface types, fields, and schemas." />
<meta name="twitter:image" content="https://runtimeconditions.io/assets/social-card.jpg" />
<meta name="twitter:image:alt" content="Runtime Conditions logo: declare what your app needs to run." />
<link rel="icon" type="image/svg+xml" href="assets/runtime-conditions-icon.svg" />
<link rel="icon" type="image/png" sizes="32x32" href="assets/icon-32.png" />
<link rel="apple-touch-icon" href="assets/apple-touch-icon.png" />
<link rel="stylesheet" href="assets/styles.css" />
<script src="assets/theme.js"></script>
</head>
<body>
<header class="site-header">
<div class="header-inner">
<a class="brand" href="index.html"><img class="brand-logo" src="assets/runtime-conditions-logo.svg" width="165" height="56" alt="Runtime Conditions"></a>
<nav class="top-links" aria-label="Top links">
<a href="https://github.com/runtimeconditions/spec/blob/main/docs/sixth-draft.md" data-tip="Read the latest draft of the specification" target="_blank" rel="noopener noreferrer"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/><path d="M9 13h6"/><path d="M9 17h6"/></svg><span>Current Draft</span></a>
<a href="https://github.com/runtimeconditions/rc-demos/blob/main/README.md" data-tip="Run Runtime Conditions end to end on your own machine" target="_blank" rel="noopener noreferrer"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><polygon points="10 8 16 12 10 16 10 8"/></svg><span>Run Demo</span></a>
<a href="reference.html" data-tip="See where each part of this guide comes from in the source repositories"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M3 6l6-3 6 3 6-3v15l-6 3-6-3-6 3z"/><path d="M9 3v15"/><path d="M15 6v15"/></svg><span>Source Map</span></a>
<a href="https://extensions.runtimeconditions.io/" data-tip="Browse every extension and its Go, Python, TypeScript and Java packages" target="_blank" rel="noopener noreferrer"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M21 8l-9-5-9 5 9 5 9-5z"/><path d="M3 8v8l9 5 9-5V8"/><path d="M12 13v8"/></svg><span>Registry</span></a>
<a class="social-link social-github" href="https://github.com/runtimeconditions" data-tip="Browse the Runtime Conditions repositories on GitHub" target="_blank" rel="noopener noreferrer"><svg class="nav-icon" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" focusable="false"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg><span class="visually-hidden">GitHub</span></a>
<a class="social-link social-slack" href="https://cloud-native.slack.com/archives/C0C0R4M65FZ" data-tip="Join the conversation on the CNCF Slack" target="_blank" rel="noopener noreferrer"><svg class="nav-icon" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" focusable="false"><path class="slack-red" d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313z"/><path class="slack-blue" d="M8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312z"/><path class="slack-green" d="M18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312z"/><path class="slack-yellow" d="M15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg><span class="visually-hidden">Slack</span></a>
</nav>
</div>
</header>
<div class="guide-layout">
<aside class="sidebar" aria-label="Guide chapters">
<p class="sidebar-title">Reader Guide</p>
<ol class="chapter-list">
<li><a href="index.html"><span class="num">00</span><span>Start here</span></a></li>
<li><a href="concepts.html"><span class="num">01</span><span>Core concepts</span></a></li>
<li><a href="spec.html"><span class="num">02</span><span>Profile shape</span></a></li>
<li><a href="developers.html"><span class="num">03</span><span>Code to profile</span></a></li>
<li><a aria-current="page" href="extensions.html"><span class="num">04</span><span>Extensions</span></a></li>
<li><a href="cli.html"><span class="num">05</span><span>rc CLI</span></a></li>
<li><a href="platform.html"><span class="num">06</span><span>Adapters</span></a></li>
<li><a href="demo.html"><span class="num">07</span><span>Run the demo</span></a></li>
<li><a href="reference.html"><span class="num">08</span><span>Reference</span></a></li>
<li><a href="faq.html"><span class="num">09</span><span>FAQ</span></a></li>
</ol>
</aside>
<main class="content">
<p class="chapter-label">Chapter 4</p>
<h1 class="page-title">Extensions give a profile its words.</h1>
<p class="intro">
A <a href="spec.html">profile</a> has a fixed shape, and extensions fill it in. An extension defines the kinds, interface types, fields, and allowed values a profile can use, and the JSON Schema that checks them.
</p>
<section class="section">
<h2>What an extension owns</h2>
<p class="short">Note: short extension IDs ending in <code>:v1alpha2</code> are canonical identifier URIs; the HTTP-dereferenceable YAML definition lives at <code>.../v1alpha2/runtimeconditions.extension.yaml</code>.</p>
<p class="short">An extension is a YAML definition. These are the parts it can have, and each one is a word in a profile: <code>cache</code> is a kind, <code>key_value</code> is an interface type, and <code>redis</code> is a field value.</p>
<div class="table-wrap">
<table>
<thead>
<tr><th>Extension Part</th><th>What It Does</th><th>Example</th></tr>
</thead>
<tbody>
<tr><td><code>dependencies</code></td><td>References vocabulary owned by other extensions.</td><td><code>https://runtimeconditions.io/extensions/rc/common-integrations/v1alpha2/runtimeconditions.extension.yaml</code></td></tr>
<tr><td><code>kinds</code></td><td>Defines Condition categories.</td><td><code>api</code>, <code>datastore</code>, <code>cache</code></td></tr>
<tr><td><code>interfaceTypes</code></td><td>Defines valid interface types for a kind.</td><td><code>http</code> for <code>api</code>, <code>key_value</code> for <code>cache</code></td></tr>
<tr><td><code>conditionFields</code></td><td>Defines extension-owned fields on Conditions.</td><td><code>configuration</code></td></tr>
<tr><td><code>interfaceFields</code></td><td>Defines extension-owned fields inside <code>interface</code>.</td><td><code>interface.engine</code>, <code>interface.operations</code></td></tr>
<tr><td><code>fieldValues</code></td><td>Defines allowed values for extension-owned fields.</td><td><code>redis</code>, <code>memcached</code>, <code>GET</code>, <code>POST</code></td></tr>
<tr><td><code>schemas</code></td><td>Defines machine-readable validation.</td><td>JSON Schema for HTTP API Conditions</td></tr>
</tbody>
</table>
</div>
</section>
<section class="section" id="behind-the-example">
<h2>The extensions behind the example</h2>
<p class="short">
The profile in <a href="spec.html#complete-profile">Profile shape</a> uses two extensions, and every word in it comes from one of them.
</p>
<div class="table-wrap">
<table>
<thead><tr><th>Word in the profile</th><th>Defined by</th><th>As</th></tr></thead>
<tbody>
<tr><td><code>kind: cache</code></td><td><a href="https://github.com/runtimeconditions/extensions/tree/main/catalog/rc/common-integrations" target="_blank" rel="noopener noreferrer">Common Integrations</a></td><td>kinds</td></tr>
<tr><td><code>interface.type: key_value</code></td><td>Common Integrations</td><td>interfaceTypes</td></tr>
<tr><td><code>interface.engine: redis</code></td><td>Common Integrations</td><td>interfaceFields and fieldValues</td></tr>
<tr><td><code>configuration</code></td><td><a href="https://github.com/runtimeconditions/extensions/tree/main/catalog/rc/env-configuration" target="_blank" rel="noopener noreferrer">Environment Configuration</a></td><td>conditionFields and fieldValues</td></tr>
</tbody>
</table>
</div>
<p class="short">
The two sections below show their definitions. Environment Configuration depends on Common Integrations, so a profile that uses configuration declares both, as <a href="spec.html#extension-declaration">Extension declaration</a> shows.
</p>
</section>
<section class="section">
<h2>First-party extension: Common Integrations</h2>
<p class="short">
The Common Integrations extension defines standard integration vocabulary for APIs, datastores, and caches. Profiles that use <code>kind: cache</code> or <code>interface.type: http</code> depend on this extension.
</p>
<div class="example">
<div class="example-title">
<span>catalog/rc/common-integrations/common-integrations-v1alpha2.yaml</span>
<a href="https://github.com/runtimeconditions/extensions/blob/main/catalog/rc/common-integrations/common-integrations-v1alpha2.yaml" target="_blank" rel="noopener noreferrer">source</a>
</div>
<pre><code>metadata:
id: https://runtimeconditions.io/extensions/rc/common-integrations/v1alpha2/runtimeconditions.extension.yaml
version: v1alpha2
spec:
kinds:
- name: api
- name: datastore
- name: cache
interfaceTypes:
- name: http
targetKind: api
- name: relational
targetKind: datastore
- name: document
targetKind: datastore
- name: key_value
targetKind: cache
- name: smtp
targetKind: api</code></pre>
</div>
</section>
<section class="section">
<h2>First-party extension: Environment Configuration</h2>
<p class="short">
The Environment Configuration extension adds the <code>configuration</code> field to common integration Conditions. It depends on Common Integrations and scopes its field to common-owned kinds and interface types.
</p>
<div class="example">
<div class="example-title">
<span>catalog/rc/env-configuration/env-configuration-v1alpha2.yaml</span>
<a href="https://github.com/runtimeconditions/extensions/blob/main/catalog/rc/env-configuration/env-configuration-v1alpha2.yaml" target="_blank" rel="noopener noreferrer">source</a>
</div>
<pre><code>spec:
dependencies:
- https://runtimeconditions.io/extensions/rc/common-integrations/v1alpha2/runtimeconditions.extension.yaml
conditionFields:
- name: configuration
appliesToKinds:
- api
appliesToInterfaceTypes:
- http
- name: configuration
appliesToKinds:
- datastore
appliesToInterfaceTypes:
- relational
- document
- name: configuration
appliesToKinds:
- cache
appliesToInterfaceTypes:
- key_value
- name: configuration
appliesToKinds:
- api
appliesToInterfaceTypes:
- smtp
fieldValues:
- field: configuration.env[].property
targetKind: cache
targetType: key_value
values:
- url
- hostname
- port
- scheme
- username
- password
- database
- token
- tls</code></pre>
</div>
</section>
<section class="section">
<h2>How a profile uses extensions</h2>
<p class="short">
The profile declares every extension required to interpret its vocabulary. Transitive dependencies are resolved by validators and tooling, but generated profiles should still declare the vocabulary they directly use. The validator checks every word against these extensions, in the order shown under <a href="spec.html#validation-order">Validation order</a>.
</p>
<div class="example">
<div class="example-title">Profile declaration and extension-owned fields</div>
<pre><code>extensions:
- https://runtimeconditions.io/extensions/rc/common-integrations:v1alpha2
- https://runtimeconditions.io/extensions/rc/env-configuration:v1alpha2
conditions:
- name: request-cache
kind: cache # common-integrations
interface:
type: key_value # common-integrations
engine: redis # common-integrations field value
configuration: # env-configuration
alternatives:
- env:
- property: url # env-configuration field value
name: REDIS_URL</code></pre>
</div>
</section>
<section class="section" id="binding-packages">
<h2>From extension to code: binding packages</h2>
<p class="short">
An extension is a definition, and <a href="cli.html#bindings"><code>rc bindings generate</code></a> turns it into packages you can import. <a href="developers.html">Code to profile</a> shows how to use them in your code.
Every first-party extension has a generated binding package in four languages. Each is built from the extension, so a declaration written against it is checked by the compiler, and each carries the resources a profiler verifies. The versions are the latest published; each name links to its registry page.
</p>
<div class="table-wrap">
<table>
<thead>
<tr><th>Extension</th><th>Go module</th><th>Python (PyPI)</th><th>TypeScript (npm)</th><th>Java (Maven Central)</th></tr>
</thead>
<tbody>
<tr>
<td><strong>common-integrations</strong><br /><code>rc/common-integrations</code> v1alpha2</td>
<td><a href="https://pkg.go.dev/runtimeconditions.io/x/rc/common@v0.3.0" target="_blank" rel="noopener noreferrer">0.3.0</a></td>
<td><a href="https://pypi.org/project/runtimeconditions-common-integrations/" target="_blank" rel="noopener noreferrer">0.2.0</a></td>
<td><a href="https://www.npmjs.com/package/@runtimeconditions/common-integrations" target="_blank" rel="noopener noreferrer">0.3.0</a></td>
<td><a href="https://central.sonatype.com/artifact/io.runtimeconditions.bindings/runtimeconditions-common-integrations/0.1.0" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
</tr>
<tr>
<td><strong>env-configuration</strong><br /><code>rc/env-configuration</code> v1alpha2</td>
<td><a href="https://pkg.go.dev/runtimeconditions.io/x/rc/env@v0.3.0" target="_blank" rel="noopener noreferrer">0.3.0</a></td>
<td><a href="https://pypi.org/project/runtimeconditions-env-configuration/" target="_blank" rel="noopener noreferrer">0.2.0</a></td>
<td><a href="https://www.npmjs.com/package/@runtimeconditions/env-configuration" target="_blank" rel="noopener noreferrer">0.3.0</a></td>
<td><a href="https://central.sonatype.com/artifact/io.runtimeconditions.bindings/runtimeconditions-env-configuration/0.1.0" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
</tr>
<tr>
<td><strong>source-control</strong><br /><code>rc/source-control</code> 0.1.0</td>
<td><a href="https://pkg.go.dev/runtimeconditions.io/x/rc/source@v0.1.0" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
<td><a href="https://pypi.org/project/runtimeconditions-source-control/" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
<td><a href="https://www.npmjs.com/package/@runtimeconditions/source-control" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
<td><a href="https://central.sonatype.com/artifact/io.runtimeconditions.bindings/runtimeconditions-source-control/0.1.0" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
</tr>
<tr>
<td><strong>aws-s3</strong><br /><code>aws/s3</code> 0.2.0</td>
<td><a href="https://pkg.go.dev/runtimeconditions.io/x/aws/s3@v0.2.0" target="_blank" rel="noopener noreferrer">0.2.0</a></td>
<td><a href="https://pypi.org/project/runtimeconditions-aws-s3/" target="_blank" rel="noopener noreferrer">0.2.0</a></td>
<td><a href="https://www.npmjs.com/package/@runtimeconditions/aws-s3" target="_blank" rel="noopener noreferrer">0.2.0</a></td>
<td><a href="https://central.sonatype.com/artifact/io.runtimeconditions.bindings/runtimeconditions-aws-s3/0.1.0" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
</tr>
<tr>
<td><strong>google-analytics</strong><br /><code>google/analytics</code> 0.1.0</td>
<td><a href="https://pkg.go.dev/runtimeconditions.io/x/google/analytics@v0.1.0" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
<td><a href="https://pypi.org/project/runtimeconditions-google-analytics/" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
<td><a href="https://www.npmjs.com/package/@runtimeconditions/google-analytics" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
<td><a href="https://central.sonatype.com/artifact/io.runtimeconditions.bindings/runtimeconditions-google-analytics/0.1.0" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
</tr>
<tr>
<td><strong>kubernetes-api</strong><br /><code>kubernetes/api</code> 0.1.0</td>
<td><a href="https://pkg.go.dev/runtimeconditions.io/x/kubernetes/api@v0.1.0" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
<td><a href="https://pypi.org/project/runtimeconditions-kubernetes-api/" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
<td><a href="https://www.npmjs.com/package/@runtimeconditions/kubernetes-api" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
<td><a href="https://central.sonatype.com/artifact/io.runtimeconditions.bindings/runtimeconditions-kubernetes-api/0.1.0" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
</tr>
<tr>
<td><strong>nats-service</strong><br /><code>nats/service</code> 0.2.0</td>
<td><a href="https://pkg.go.dev/runtimeconditions.io/x/nats/service@v0.2.0" target="_blank" rel="noopener noreferrer">0.2.0</a></td>
<td><a href="https://pypi.org/project/runtimeconditions-nats-service/" target="_blank" rel="noopener noreferrer">0.2.0</a></td>
<td><a href="https://www.npmjs.com/package/@runtimeconditions/nats-service" target="_blank" rel="noopener noreferrer">0.2.0</a></td>
<td><a href="https://central.sonatype.com/artifact/io.runtimeconditions.bindings/runtimeconditions-nats-service/0.1.0" target="_blank" rel="noopener noreferrer">0.1.0</a></td>
</tr>
</tbody>
</table>
</div>
<div class="example">
<div class="example-title">Install</div>
<pre><code>go get runtimeconditions.io/x/rc/common@v0.3.0
pip install runtimeconditions-common-integrations
npm install @runtimeconditions/common-integrations</code></pre>
</div>
<p class="short">
The Go modules are named <code>runtimeconditions.io/x/<extension></code>, the Python and npm packages <code>runtimeconditions-<package></code> and <code>@runtimeconditions/<package></code>, and the Java artifacts <code>io.runtimeconditions.bindings:runtimeconditions-<package></code>. The source of every package is under <a href="https://github.com/runtimeconditions/extensions/tree/main/bindings" target="_blank" rel="noopener noreferrer">bindings/</a> in the extensions repository.
</p>
</section>
<section class="section" id="writing">
<h2>Writing an extension</h2>
<p class="short">
Everything above is how extensions are used. The rest is for writing one, whether for your own company or to share. The <a href="faq.html#own-catalog">FAQ</a> lists the steps, and the <a href="https://github.com/runtimeconditions/spec/blob/main/docs/guides/extension-authoring.md" target="_blank" rel="noopener noreferrer">extension authoring guide</a> has the rules.
</p>
</section>
<section class="section">
<h2>Choosing vocabulary keywords</h2>
<p class="short">
Each extension keyword answers a different authoring question. Use the smallest keyword that owns the vocabulary you are adding, then use schemas for shape.
</p>
<div class="table-wrap">
<table>
<thead>
<tr><th>Author wants to</th><th>Use</th><th>Result</th></tr>
</thead>
<tbody>
<tr><td>Add a Condition category</td><td><code>kinds</code></td><td><code>kind: aws.object_store</code></td></tr>
<tr><td>Add an interface type for a kind</td><td><code>interfaceTypes</code></td><td><code>interface.type: aws.s3</code></td></tr>
<tr><td>Add a top-level Condition field</td><td><code>conditionFields</code></td><td><code>configuration</code>, <code>trust</code>, <code>access</code></td></tr>
<tr><td>Add a field inside <code>interface</code></td><td><code>interfaceFields</code></td><td><code>interface.engine</code>, <code>interface.bucketClass</code></td></tr>
<tr><td>Define portable value choices</td><td><code>fieldValues</code></td><td><code>redis</code>, <code>standard</code>, <code>GET</code></td></tr>
<tr><td>Validate object shape</td><td><code>schemas</code></td><td>Required properties, arrays, conditional rules</td></tr>
</tbody>
</table>
</div>
<div class="example">
<div class="example-title">Top-level field vs interface field</div>
<pre><code>conditionFields:
- name: configuration
appliesToKinds:
- cache
appliesToInterfaceTypes:
- key_value
interfaceFields:
- name: engine
targetKind: cache
targetType: key_value</code></pre>
</div>
</section>
<section class="section">
<h2>Field paths point to owned fields</h2>
<p class="short">
<code>fieldValues</code> names allowed values for a field path. It does not create the field; the path must resolve to <code>interface.type</code>, an <code>interfaceFields</code> entry, or a scoped <code>conditionFields</code> entry.
</p>
<div class="example">
<div class="example-title">Interface path</div>
<pre><code>interfaceFields:
- name: bucketClass
targetKind: aws.object_store
targetType: aws.s3
fieldValues:
- field: interface.bucketClass
targetKind: aws.object_store
targetType: aws.s3
values:
- standard
- archive</code></pre>
</div>
<div class="example">
<div class="example-title">Condition field path with array traversal</div>
<pre><code>conditionFields:
- name: configuration
appliesToKinds:
- cache
appliesToInterfaceTypes:
- key_value
fieldValues:
- field: configuration.env[].property
targetKind: cache
targetType: key_value
values:
- url
- hostname
- port</code></pre>
</div>
</section>
<section class="section">
<h2>Field values make vocabulary deterministic</h2>
<p class="short">
The extension does not merely say an engine field may exist. It also owns the shared values that validators and adapters can rely on.
</p>
<div class="example">
<div class="example-title">Cache engine values</div>
<pre><code>fieldValues:
- field: interface.engine
targetKind: cache
targetType: key_value
values:
- redis
- memcached</code></pre>
</div>
<div class="example">
<div class="example-title">HTTP method values</div>
<pre><code>fieldValues:
- field: interface.operations[].method
targetKind: api
targetType: http
values:
- GET
- HEAD
- POST
- PUT
- PATCH
- DELETE
- OPTIONS
- TRACE</code></pre>
</div>
</section>
<section class="section">
<h2>Extensions define JSON Schema validation</h2>
<p class="short">
Schema rules make extension validation portable. The validator can evaluate the profile without interpreting prose. This is the last step of <a href="spec.html#validation-order">Validation order</a>.
</p>
<div class="example">
<div class="example-title">HTTP API schema excerpt</div>
<pre><code>schemas:
- id: api-http-interface
appliesToKind: api
appliesToInterfaceType: http
description: Validates HTTP API integration conditions.
schema:
type: object
required:
- kind
- interface
properties:
kind:
const: api
interface:
type: object
required:
- type
properties:
type:
const: http
operations:
type: array
items:
required:
- method
- path</code></pre>
</div>
</section>
<section class="section">
<h2>Third-party extensions follow the same rules</h2>
<p class="short">
The AWS Object Store extension is treated as a third-party example. Any company can publish one like it: see <a href="faq.html#own-catalog">Can a company write its own catalog?</a> It defines <code>aws.object_store</code>, <code>aws.s3</code>, S3-specific fields, and its own scoped <code>configuration</code> properties.
</p>
<div class="example">
<div class="example-title">
<span>examples/extensions/aws-object-store/aws-object-store-v1alpha1.yaml</span>
<a href="https://github.com/runtimeconditions/spec/blob/main/examples/extensions/aws-object-store/aws-object-store-v1alpha1.yaml" target="_blank" rel="noopener noreferrer">source</a>
</div>
<pre><code>metadata:
id: https://aws.example.com/runtimeconditions/object-store/v1alpha1/runtimeconditions.extension.yaml
version: v1alpha1
spec:
kinds:
- name: aws.object_store
interfaceTypes:
- name: aws.s3
targetKind: aws.object_store
conditionFields:
- name: configuration
appliesToKinds:
- aws.object_store
appliesToInterfaceTypes:
- aws.s3</code></pre>
</div>
</section>
<nav class="page-nav" aria-label="Page navigation">
<a class="page-nav-prev" href="developers.html"><small>Previous</small><span>Code to profile</span></a>
<a class="page-nav-next" href="cli.html"><small>Next</small><span>rc CLI</span></a>
</nav>
</main>
</div>
<footer class="footer">
<div class="footer-inner">
<div class="footer-brand">
<a class="footer-logo" href="index.html"><img src="assets/runtime-conditions-logo.svg" width="141" height="48" alt="Runtime Conditions"></a>
<p>A machine-readable way for developers to declare what an app needs to run, so the platform can provide it.</p>
<div class="footer-social">
<a class="social-link social-github" href="https://github.com/runtimeconditions" aria-label="Runtime Conditions on GitHub" target="_blank" rel="noopener noreferrer"><svg class="nav-icon" viewBox="0 0 24 24" width="20" height="20" fill="currentColor" aria-hidden="true" focusable="false"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a>
<a class="social-link social-slack" href="https://cloud-native.slack.com/archives/C0C0R4M65FZ" aria-label="Runtime Conditions on the CNCF Slack" target="_blank" rel="noopener noreferrer"><svg class="nav-icon" viewBox="0 0 24 24" width="20" height="20" fill="currentColor" aria-hidden="true" focusable="false"><path class="slack-red" d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313z"/><path class="slack-blue" d="M8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312z"/><path class="slack-green" d="M18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312z"/><path class="slack-yellow" d="M15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg></a>
</div>
</div>
<nav class="footer-col" aria-label="Guide">
<h2>Guide</h2>
<ul>
<li><a href="index.html">Start here</a></li>
<li><a href="concepts.html">Core concepts</a></li>
<li><a href="spec.html">Profile shape</a></li>
<li><a href="developers.html">Code to profile</a></li>
<li><a href="cli.html">rc CLI</a></li>
<li><a href="faq.html">FAQ</a></li>
</ul>
</nav>
<nav class="footer-col" aria-label="Project">
<h2>Project</h2>
<ul>
<li><a href="https://github.com/runtimeconditions/spec/blob/main/docs/sixth-draft.md" target="_blank" rel="noopener noreferrer">Current draft</a></li>
<li><a href="https://extensions.runtimeconditions.io/" target="_blank" rel="noopener noreferrer">Extension registry</a></li>
<li><a href="https://github.com/runtimeconditions/rc-demos/blob/main/README.md" target="_blank" rel="noopener noreferrer">Run the demo</a></li>
<li><a href="reference.html">Source map</a></li>
</ul>
</nav>
<nav class="footer-col" aria-label="Community">
<h2>Community</h2>
<ul>
<li><a href="https://github.com/runtimeconditions" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="https://cloud-native.slack.com/archives/C0C0R4M65FZ" target="_blank" rel="noopener noreferrer">CNCF Slack</a></li>
<li><a href="https://github.com/runtimeconditions/runtimeconditions.github.io/issues" target="_blank" rel="noopener noreferrer">Improve this guide</a></li>
</ul>
</nav>
</div>
<div class="footer-bottom">
<span>© 2026 Runtime Conditions contributors.</span>
<span>Runtime Conditions is seeking adoption by an established parent project.</span>
</div>
</footer>
<script src="assets/syntax.js" defer></script>
</body>
</html>