File: authproc_cardinality.md

package info (click to toggle)
simplesamlphp 1.19.7-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 42,920 kB
  • sloc: php: 202,044; javascript: 14,867; xml: 2,700; sh: 225; perl: 82; makefile: 70; python: 5
file content (49 lines) | stat: -rw-r--r-- 1,696 bytes parent folder | download | duplicates (4)
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
`core:Cardinality`
==================

Ensure the number of attribute values is within the specified multiplicity.

This filter should contain a set of attribute name => rule pairs describing the multiplicity rules for an attribute.

The special parameter `%ignoreEntities` can be used to give an array of entity IDs that should be ignored for testing, etc purposes.

A separate [`core:CardinalitySingle`](./core:authproc_cardinalitysingle) authproc filter provides additional functionality for the special case where attributes are single valued.

Specifying Rules
----------------

Multiplicity rules are specified as an associative array containing one or more of the following parameters:

`min`
:   The minimum number of values (participation) this attribute should have. Defaults to `zero`.

`max`
:   The maximum number of values (cardinality) this attribute should have. Defaults to no upper bound.

`warn`
:   Log a warning rather than generating an error. Defaults to `false`.

For convenience, minimum and maximum values can also be specified using a shorthand list notation.

Examples
--------

Require at least one `givenName`, no more than two email addresses, and between two and four values for `eduPersonScopedAffiliation`.

    'authproc' => array(
        50 => array(
            'class' => 'core:Cardinality',
            'givenName' => array('min' => 1),
            'mail' => array('max' => 2),
            'eduPersonScopedAffiliation' => array('min' => 2, 'max' => 4),
        ),
    ),

Use the shorthand notation for min, max:

    'authproc' => array(
        50 => array(
            'class' => 'core:Cardinality',
            'mail' => array(0, 2),
        ),
    ),