-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSCIMMY.Config.html
More file actions
496 lines (296 loc) · 18 KB
/
SCIMMY.Config.html
File metadata and controls
496 lines (296 loc) · 18 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Namespace: SCIMMY.Config - SCIMMY</title>
<script src="static/classy.js"></script>
<script src="static/highlight/highlight.min.js"></script>
<script src="static/highlight/langs/javascript.min.js"></script>
<script src="static/highlight/langs/json.min.js"></script>
<link type="text/css" rel="stylesheet" href="static/highlight/highlight.min.css">
<link type="text/css" rel="stylesheet" href="static/classy.css">
<link rel="icon" type="image/svg+xml" href="static/assets/icon.svg" />
</head>
<body>
<header class="page-header">
<h1 class="package-details">
<a class="package-name" href="./">
<img alt="SCIMMY" src="static/assets/logo.svg" />
</a>
<span class="package-version">
<span class="type-signature">1.3.5</span>
</span>
</h1>
<h2 class="page-title">Namespace: <span class="ancestors"><a href="index.html">SCIMMY</a>.</span>Config</h2>
<div class="page-links">
<a href="https://github.com/scimmyjs/scimmy" title="View Source on GitHub">
<img alt="View Source on GitHub" src="static/assets/github.png" />
</a>
<div class="page-nav-toggle">
<input type="checkbox" name="tiny-page-nav-toggle" id="tiny-page-nav-toggle" autocomplete="off"/>
<label for="tiny-page-nav-toggle">
<span></span>
<span></span>
<span></span>
</label>
</div>
</div>
</header>
<nav class="page-nav">
<label class="hidden" for="tiny-page-nav"></label>
<input class="hidden tiny-page-nav-target" type="checkbox" id="tiny-page-nav" autocomplete="off"/>
<div class="nav-content">
<h3>API</h3><ul class="active"><li class="active"><h4 class="active"><a href="SCIMMY.Config.html" class="active">Config</a></h4></li><li><details><summary><h4><a href="SCIMMY.Messages.html">Messages</a></h4></summary><ul><li><a href="SCIMMY.Messages.BulkRequest.html">BulkRequest</a></li><li><a href="SCIMMY.Messages.BulkResponse.html">BulkResponse</a></li><li><a href="SCIMMY.Messages.ErrorResponse.html">ErrorResponse</a></li><li><a href="SCIMMY.Messages.ListResponse.html">ListResponse</a></li><li><a href="SCIMMY.Messages.PatchOp.html">PatchOp</a></li><li><a href="SCIMMY.Messages.SearchRequest.html">SearchRequest</a></li></ul></details></li><li><details><summary><h4><a href="SCIMMY.Resources.html">Resources</a></h4></summary><ul><li><a href="SCIMMY.Resources.Group.html">Group</a></li><li><a href="SCIMMY.Resources.ResourceType.html">ResourceType</a></li><li><a href="SCIMMY.Resources.Schema.html">Schema</a></li><li><a href="SCIMMY.Resources.ServiceProviderConfig.html">ServiceProviderConfig</a></li><li><a href="SCIMMY.Resources.User.html">User</a></li></ul></details></li><li><details><summary><h4><a href="SCIMMY.Schemas.html">Schemas</a></h4></summary><ul><li><a href="SCIMMY.Schemas.EnterpriseUser.html">EnterpriseUser</a></li><li><a href="SCIMMY.Schemas.Group.html">Group</a></li><li><a href="SCIMMY.Schemas.ResourceType.html">ResourceType</a></li><li><a href="SCIMMY.Schemas.ServiceProviderConfig.html">ServiceProviderConfig</a></li><li><a href="SCIMMY.Schemas.User.html">User</a></li></ul></details></li><li><details><summary><h4><a href="SCIMMY.Types.html">Types</a></h4></summary><ul><li><a href="SCIMMY.Types.Attribute.html">Attribute</a></li><li><a href="SCIMMY.Types.SchemaDefinition.html">SchemaDefinition</a></li><li><a href="SCIMMY.Types.Error.html">Error</a></li><li><a href="SCIMMY.Types.Filter.html">Filter</a></li><li><a href="SCIMMY.Types.Resource.html">Resource</a></li><li><a href="SCIMMY.Types.Schema.html">Schema</a></li></ul></details></li></ul>
</div>
</nav>
<main id="main">
<article class="content-container class-definition">
<header class="section-header">
<h2 class="page-title subsection-title">Namespace: <span class="ancestors"><a href="index.html">SCIMMY</a>.</span>Config</h2>
<h2 class="class-title hidden">Namespace: SCIMMY.Config</h2>
</header>
<section id="description" class="container-overview">
<header>
<h3 class="hidden">Description</h3>
</header>
<div class="description"><p>SCIMMY provides a singleton class, <code>SCIMMY.Config</code>, that acts as a central store for a SCIM Service Provider's configuration.<br>
It is used for defining SCIM specification features supported (e.g. PATCH, sort, filter, etc).<br>
This can be either directly by an implementing service provider, or retrieved by a client (identity provider) from a remote service provider.<br>
By default, all specification features are marked as disabled, as your implementation may not support them.</p>
<h2 id="retrieving-configuration">Retrieving Configuration</h2>
<p>The stored configuration can be retrieved by calling <code><a href="SCIMMY.Config.html#.get">SCIMMY.Config.get</a>()</code>, which returns a cloned object
representing the configuration <em>at the time of retrieval</em>.</p>
<blockquote>
<p><strong>Note:</strong><br>
To prevent accidental configuration changes, the returned object has been trapped, and attempting to change a configuration
value directly on this object will throw a TypeError with the message <code>"SCIM Configuration can only be changed via the 'set' method"</code></p>
</blockquote>
<p>The structure of the object reflects the example provided in <a href="https://datatracker.ietf.org/doc/html/rfc7643#section-8.5">RFC7643§8.5</a>:</p>
<pre class="prettyprint source lang-json"><code>{
"documentationUri": "/path/to/documentation.html",
"patch": {
"supported": false
},
"bulk": {
"supported": false,
"maxOperations": 1000,
"maxPayloadSize": 1048576
},
"filter": {
"supported": false,
"maxResults": 200
},
"changePassword": {
"supported": false
},
"sort": {
"supported": false
},
"etag": {
"supported": false
},
"authenticationSchemes": []
}
</code></pre>
<h2 id="setting-configuration">Setting Configuration</h2>
<p>The stored configuration can be changed via the <code><a href="SCIMMY.Config.html#.set">SCIMMY.Config.set</a></code> method. This method can be called either with an object representing the new configuration, or with a configuration property name string and value pair.</p>
<ul>
<li>Where the only child property of a top-level configuration property is "supported", a boolean can be supplied as the value, which will be used as the value of the "supported" property.<pre class="prettyprint source lang-js"><code>// This will set patch.supported to true
SCIMMY.Config.set("patch", true);
</code></pre>
</li>
<li>The "filter" and "bulk" properties also accept a number value, which will be interpreted as being the value of the "maxResults" and "maxOperations" child properties respectively, and will automatically set "supported" to true.<pre class="prettyprint source lang-js"><code>// This will set filter.maxResults to 20, and filter.supported to true
SCIMMY.Config.set("filter", 20);
</code></pre>
</li>
</ul>
<blockquote>
<p><strong>Note:</strong><br>
Supplied values are validated against SCIMMY's ServiceProviderConfig schema definition.<br>
Providing values with incompatible types (e.g. the string "100" instead of the number 100) will throw a TypeError.<br>
This ensures configuration values always conform to the standard. See <a href="https://datatracker.ietf.org/doc/html/rfc7643#section-5">RFC7643§5</a> for more information.</p>
</blockquote>
<p>Multiple values can also be set at the same time, and changes are cumulative, so omitted properties will not be unset:</p>
<pre class="prettyprint source lang-js"><code>// With both shorthand and full syntax
SCIMMY.Config.set({
documentationUri: "https://example.com/docs/scim.html",
patch: true,
filter: 100,
bulk: {
supported: true,
maxPayloadSize: 2097152
},
authenticationSchemes: [
{/ Your authentication scheme details /}
]
});
</code></pre>
<h3 id="authentication-schemes">Authentication Schemes</h3>
<p>Service provider authentication schemes can be set in the same way as other configuration properties, and are cumulative.<br>
The authenticationSchemes collection can be reset by providing an empty array as the value for the authenticationSchemes property.</p>
<pre class="prettyprint source lang-js"><code>// Both of these will append the supplied values to the authenticationSchemes property
SCIMMY.Config.set("authenticationSchemes", {/ Your authentication scheme details /});
SCIMMY.Config.set("authenticationSchemes", [
{/ Your primary authentication scheme details /},
{/ Your secondary authentication scheme details /}
]);
// Reset the authenticationSchemes collection
SCIMMY.Config.set("authenticationSchemes", []);
</code></pre></div>
</section>
<section id="usage" class="class-usage">
<h3 class="subsection-title">Usage</h3>
<section id="details" class="details">
<dl class="details-list">
<div class="detail tag-kind">
<dt>Kind:</dt>
<dd><span class="signature type-signature">singleton</span></dd>
</div>
<div class="detail tag-source">
<dt>Source:</dt>
<dd><a href="https://github.com/scimmyjs/scimmy/blob/ea53d92787d2a5db844c7699a7aeb4c1eafa13a7/src/lib/config.js#L7">src/lib/config.js, line 7</a></dd>
</div>
</dl>
</section>
</section>
<section id="methods" class="child-methods">
<h3 class="subsection-title">Methods</h3>
<div class="subsection-content">
<article id=".get">
<header>
<h4 class="name"><span class="type-signature">(static) </span>get<span class="signature">()</span><span class="type-signature returns"> → {Object}</span></h4>
<div class="description"><p>Get SCIM service provider configuration</p></div>
</header>
<section class="details">
<dl class="details-list">
<div class="detail tag-source">
<dt>Source:</dt>
<dd><a href="https://github.com/scimmyjs/scimmy/blob/ea53d92787d2a5db844c7699a7aeb4c1eafa13a7/src/lib/config.js#L124">src/lib/config.js, line 124</a></dd>
</div>
</dl>
</section>
<section class="returns">
<h5 class="subsection-title">Returns:</h5>
<div class="param-desc"><p>the service provider configuration, proxied for protection</p></div>
<div class="detail tag-type">
<dt>Type:</dt>
<dd><span class="signature type-signature">{<span class="param-type">Object</span>}</span></dd>
</div>
</section>
</article><article id=".set">
<header>
<h4 class="name"><span class="type-signature">(static) </span>set<span class="signature">(name, config<span class="signature-attributes">opt</span>)</span><span class="type-signature returns"> → {Object|<a href="SCIMMY.Config.html">SCIMMY.Config</a>}</span></h4>
<div class="description"><p>Set SCIM service provider configuration</p></div>
</header>
<section class="details">
<dl class="details-list">
<div class="detail tag-source">
<dt>Source:</dt>
<dd><a href="https://github.com/scimmyjs/scimmy/blob/ea53d92787d2a5db844c7699a7aeb4c1eafa13a7/src/lib/config.js#L150">src/lib/config.js, line 150</a></dd>
</div>
</dl>
</section>
<section class="params">
<h5 class="subsection-title">Parameters:</h5>
<div class="subsection-content">
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name">
<code>
name<span class="signature-attributes"></span>
</code>
</td>
<td class="type">
<span class="param">
<code>
<span class="param-type">Object</span>
</code><code>
<span class="param-type">String</span>
</code>
</span>
</td>
<td class="default">
<pre class="prettyprint lang-json">
<code></code>
</pre>
</td>
<td class="description last">
<p>the configuration key name or value to apply</p>
</td>
</tr>
<tr>
<td class="name">
<code>
config<span class="signature-attributes">opt</span>
</code>
</td>
<td class="type">
<span class="param">
<code>
<span class="param-type">Object</span>
</code><code>
<span class="param-type">String</span>
</code><code>
<span class="param-type">Boolean</span>
</code>
</span>
</td>
<td class="default">
<pre class="prettyprint lang-json">
<code>name</code>
</pre>
</td>
<td class="description last">
<p>the new configuration to apply to the service provider config instance</p>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<section class="returns">
<h5 class="subsection-title">Returns:</h5>
<div class="param-desc"><p>the updated configuration instance, or the config container class for chaining</p></div>
<div class="detail tag-type">
<dt>Type:</dt>
<dd><span class="signature type-signature">{<span class="param-type">Object</span><span class="param-join">|</span><span class="param-type"><a href="SCIMMY.Config.html">SCIMMY.Config</a></span>}</span></dd>
</div>
</section>
</article>
</div>
</section>
</article>
<aside class="content-aside">
<div class="toc toc-tiny">
<h2 class="page-title">Namespace: <span class="ancestors"><a href="index.html">SCIMMY</a>.</span>Config</h2>
<details class="toc-container">
<summary class="toc-title">Table of Contents</summary>
<nav class="toc-content"><ul><li><h5 class="toc-section"><a href="#description">Description</a></h5><ul class="no-indent"><li><a href="#retrieving-configuration">Retrieving Configuration</a></li><li><a href="#setting-configuration">Setting Configuration</a><ul><li><a href="#authentication-schemes">Authentication Schemes</a></li></ul></li></ul></li><li><h5 class="toc-section"><a href="#usage">Usage</a></h5><ul><li><a href="#details">Details</a></li></ul></li><li><h5 class="toc-section"><a href="#methods">Methods</a></h5><ul><li><a href="#.get"><span class="type-signature">(static) </span>get</a></li><li><a href="#.set"><span class="type-signature">(static) </span>set</a></li></ul></li></ul></nav>
</details>
</div>
<div class="toc toc-regular">
<nav class="toc-container">
<h5 class="toc-title">Table of Contents</h5>
<div class="toc-content"><ul><li><h5 class="toc-section"><a href="#description">Description</a></h5><ul class="no-indent"><li><a href="#retrieving-configuration">Retrieving Configuration</a></li><li><a href="#setting-configuration">Setting Configuration</a><ul><li><a href="#authentication-schemes">Authentication Schemes</a></li></ul></li></ul></li><li><h5 class="toc-section"><a href="#usage">Usage</a></h5><ul><li><a href="#details">Details</a></li></ul></li><li><h5 class="toc-section"><a href="#methods">Methods</a></h5><ul><li><a href="#.get"><span class="type-signature">(static) </span>get</a></li><li><a href="#.set"><span class="type-signature">(static) </span>set</a></li></ul></li></ul></div>
</nav>
</div>
</aside>
<footer>
Generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
using <a href="https://github.com/sleelin/classy-template">classy-template</a>
<span class="creation-timestamp">2025-03-05T04:14:54.385Z</span>
</footer>
</main>
<script>hljs.highlightAll();</script>
</body>
</html>