You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/deployment/pex.rst
+55-44Lines changed: 55 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -22,71 +22,82 @@ To use file-based configuration, you need to define the path to a directory that
22
22
.. code-block:: yaml
23
23
24
24
policy:
25
-
directory: /path/to/directory
25
+
directory: /path/to/directory
26
26
27
27
All JSON files in the directory will be loaded and used to define the mapping between scopes and presentation definitions.
28
28
29
29
To use a policy backend, you need to add the address of the policy backend to the configuration:
30
30
31
31
.. code-block:: yaml
32
32
33
-
policy:
34
-
address: http://localhost:8080
33
+
policy:
34
+
address: http://localhost:8080
35
35
36
36
You cannot define both the directory and the address in the configuration. If both are defined, an error will be raised at startup.
37
37
38
-
File-based configuration
39
-
************************
38
+
Policy Structure
39
+
****************
40
40
41
-
JSON files used for file-based configuration must have the following structure:
41
+
JSON documents used for policies must have the following structure:
42
42
43
43
.. code-block:: json
44
44
45
-
{
46
-
"example_scope": {
47
-
"organization": {
48
-
"id": "example",
49
-
"format": {
50
-
"ldp_vc": {
51
-
"proof_type": ["JsonWebSignature2020"]
52
-
},
53
-
"ldp_vp": {
54
-
"proof_type": ["JsonWebSignature2020"]
55
-
}
56
-
},
57
-
"definition": {
58
-
"input_descriptors": [
59
-
{
60
-
"id": "1",
61
-
"constraints": {
62
-
"fields": [
63
-
{
64
-
"path": ["$.type"],
65
-
"filter": {
66
-
"type": "string",
67
-
"const": "ExampleCredential"
68
-
}
69
-
}
70
-
]
71
-
}
72
-
}
73
-
]
74
-
}
75
-
}
76
-
}
77
-
}
78
-
79
-
Where `example_scope` is the scope that the presentation definition is associated with.
80
-
The `presentation_definition` object contains the presentation definition that should be used for the given scope.
81
-
The `wallet_owner_type` field is used to determine the audience type of the presentation definition, valid values are `organization` and `user`.
45
+
{
46
+
"example_scope": {
47
+
"organization": {
48
+
"id": "example",
49
+
"format": {
50
+
"ldp_vc": {
51
+
"proof_type": ["JsonWebSignature2020"]
52
+
},
53
+
"ldp_vp": {
54
+
"proof_type": ["JsonWebSignature2020"]
55
+
}
56
+
},
57
+
"definition": {
58
+
"input_descriptors": [
59
+
{
60
+
"id": "1",
61
+
"constraints": {
62
+
"fields": [
63
+
{
64
+
"id": "example_credential_type",
65
+
"path": ["$.type"],
66
+
"filter": {
67
+
"type": "string",
68
+
"const": "ExampleCredential"
69
+
}
70
+
}
71
+
]
72
+
}
73
+
}
74
+
]
75
+
}
76
+
}
77
+
}
78
+
}
79
+
80
+
Where ``example_scope`` is the scope that the presentation definition is associated with.
81
+
The ``presentation_definition`` object contains the presentation definition that should be used for the given scope.
82
+
The ``wallet_owner_type`` field is used to determine the audience type of the presentation definition, valid values are ``organization`` and ``user``.
83
+
84
+
OAuth2 Token Introspection field mapping
85
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86
+
87
+
The fields that contain an ``id`` property (e.g., ``example_credential_type`` in the example above) are returned in the OAuth2 Token Introspection response.
88
+
The value of the Verifiable Credential that the matched field constraint are included in the response as claims.
89
+
Writer of policies should take into consideration:
90
+
- fields that are intended to be used for logging or authorization decisions should have a distinct identifier.
91
+
- claims ideally map a registered claim name.
92
+
- overwriting properties already defined in the token introspection endpoint response is forbidden.
82
93
83
94
Policy backend API definition
84
95
*****************************
85
96
86
97
The policy backend API is defined in the `OpenAPI 3.x <https://spec.openapis.org/oas/latest.html>`_ format.
87
98
The API must have the following endpoint:
88
99
89
-
- `GET /presentation_definitions?scope=X&authorizer=Y`: Get the presentation definition for a given scope and tenant.
100
+
- ``GET /presentation_definitions?scope=X&authorizer=Y``: Get the presentation definition for a given scope and tenant.
90
101
91
102
The full API definition can be downloaded `here <../../_static/policy/v1.yaml>`_.
0 commit comments