|
10 | 10 | * [OPENEO\_PREFIX](#openeo_fastapi.client.settings.AppSettings.OPENEO_PREFIX)
|
11 | 11 | * [OIDC\_URL](#openeo_fastapi.client.settings.AppSettings.OIDC_URL)
|
12 | 12 | * [OIDC\_ORGANISATION](#openeo_fastapi.client.settings.AppSettings.OIDC_ORGANISATION)
|
13 |
| - * [OIDC\_ROLES](#openeo_fastapi.client.settings.AppSettings.OIDC_ROLES) |
| 13 | + * [OIDC\_POLICIES](#openeo_fastapi.client.settings.AppSettings.OIDC_POLICIES) |
14 | 14 | * [STAC\_VERSION](#openeo_fastapi.client.settings.AppSettings.STAC_VERSION)
|
15 | 15 | * [STAC\_API\_URL](#openeo_fastapi.client.settings.AppSettings.STAC_API_URL)
|
16 | 16 | * [STAC\_COLLECTIONS\_WHITELIST](#openeo_fastapi.client.settings.AppSettings.STAC_COLLECTIONS_WHITELIST)
|
17 | 17 | * [ensure\_endswith\_slash](#openeo_fastapi.client.settings.AppSettings.ensure_endswith_slash)
|
| 18 | + * [split\_oidc\_policies\_str\_to\_list](#openeo_fastapi.client.settings.AppSettings.split_oidc_policies_str_to_list) |
18 | 19 | * [Config](#openeo_fastapi.client.settings.AppSettings.Config)
|
19 | 20 |
|
20 | 21 | <a id="openeo_fastapi.client.settings"></a>
|
@@ -73,19 +74,37 @@ The OpenEO prefix to be used when creating the endpoint urls.
|
73 | 74 |
|
74 | 75 | #### OIDC\_URL
|
75 | 76 |
|
76 |
| -The URL of the OIDC provider used to authenticate tokens against. |
| 77 | +The policies to be used for authenticated users with the backend, if not set, any usser with a valid token from the issuer is accepted. |
77 | 78 |
|
78 | 79 | <a id="openeo_fastapi.client.settings.AppSettings.OIDC_ORGANISATION"></a>
|
79 | 80 |
|
80 | 81 | #### OIDC\_ORGANISATION
|
81 | 82 |
|
82 | 83 | The abbreviation of the OIDC provider's organisation name, e.g. egi.
|
83 | 84 |
|
84 |
| -<a id="openeo_fastapi.client.settings.AppSettings.OIDC_ROLES"></a> |
| 85 | +<a id="openeo_fastapi.client.settings.AppSettings.OIDC_POLICIES"></a> |
85 | 86 |
|
86 |
| -#### OIDC\_ROLES |
| 87 | +#### OIDC\_POLICIES |
87 | 88 |
|
88 |
| -The OIDC roles to check against when authenticating a user. |
| 89 | +The OIDC policies to check against when authorizing a user. If not provided, all users with a valid token from the issuer will be admitted. |
| 90 | + |
| 91 | +"&&" Is used to denote the addition of another policy. |
| 92 | +Policies in the list should be structures as "key, value". |
| 93 | +The key referers to some value that is expected to be found in the OIDC userinfo request. |
| 94 | +The value referes to some value that is then checked for presence in the values found at the key location. |
| 95 | + |
| 96 | +**Example**: |
| 97 | + |
| 98 | +``` |
| 99 | +{ |
| 100 | + |
| 101 | + "groups" : [ "/staff" ] |
| 102 | +} |
| 103 | + |
| 104 | +A valid policy to allow members from the group staff would be, "groups, /staff". This would be the value provided to OIDC_POLICIES. |
| 105 | + |
| 106 | +If you wanted to include users from another group called "/trial", the updated value to OIDC_POLICIES would be, "groups, /staff && groups, /trial" |
| 107 | +``` |
89 | 108 |
|
90 | 109 | <a id="openeo_fastapi.client.settings.AppSettings.STAC_VERSION"></a>
|
91 | 110 |
|
@@ -116,6 +135,17 @@ def ensure_endswith_slash(cls, v: str) -> str
|
116 | 135 |
|
117 | 136 | Ensure the STAC_API_URL ends with a trailing slash.
|
118 | 137 |
|
| 138 | +<a id="openeo_fastapi.client.settings.AppSettings.split_oidc_policies_str_to_list"></a> |
| 139 | + |
| 140 | +#### split\_oidc\_policies\_str\_to\_list |
| 141 | + |
| 142 | +```python |
| 143 | +@validator("OIDC_POLICIES", pre=True) |
| 144 | +def split_oidc_policies_str_to_list(cls, v: str) -> str |
| 145 | +``` |
| 146 | + |
| 147 | +Ensure the OIDC_POLICIES are split and formatted correctly. |
| 148 | + |
119 | 149 | <a id="openeo_fastapi.client.settings.AppSettings.Config"></a>
|
120 | 150 |
|
121 | 151 | ## Config Objects
|
|
0 commit comments