|
9 | 9 | @ConfigurationProperties(prefix = "openfga") |
10 | 10 | public class OpenFgaProperties implements InitializingBean { |
11 | 11 |
|
| 12 | + /** |
| 13 | + * URL to OpenFGA instance. |
| 14 | + * If configured, beans will be initialized. |
| 15 | + */ |
12 | 16 | private String apiUrl; |
| 17 | + /** |
| 18 | + * The ID of the store to use. |
| 19 | + */ |
13 | 20 | private String storeId; |
| 21 | + |
| 22 | + /** |
| 23 | + * The ID of the authorization model to use. |
| 24 | + */ |
14 | 25 | private String authorizationModelId; |
15 | 26 |
|
| 27 | + /** |
| 28 | + * The credentials for the OpenFGA client. |
| 29 | + */ |
16 | 30 | private Credentials credentials; |
17 | 31 |
|
18 | 32 | public String getApiUrl() { |
@@ -88,7 +102,13 @@ public void validate() { |
88 | 102 | */ |
89 | 103 | public static class Credentials { |
90 | 104 |
|
| 105 | + /** |
| 106 | + * The authentication method to use for the OpenFGA client. |
| 107 | + */ |
91 | 108 | private CredentialsMethod method; |
| 109 | + /** |
| 110 | + * Authentication config for the OpenFGA client. |
| 111 | + */ |
92 | 112 | private CredentialsConfiguration config; |
93 | 113 |
|
94 | 114 | public CredentialsMethod getMethod() { |
@@ -136,12 +156,36 @@ public enum CredentialsMethod { |
136 | 156 | * {@link dev.openfga.sdk.api.client.OpenFgaClient} credentials configuration properties |
137 | 157 | */ |
138 | 158 | public static class CredentialsConfiguration { |
| 159 | + /** |
| 160 | + * The API token used to authenticate the client at OpenFGA. |
| 161 | + * Required, if {@code API_TOKEN} method should be used. |
| 162 | + */ |
139 | 163 | private String apiToken; |
| 164 | + /** |
| 165 | + * The API token issuer, used as an additional check. |
| 166 | + * Required, if {@code CLIENT_CREDENTIALS} method should be used. |
| 167 | + */ |
140 | 168 | private String apiTokenIssuer; |
| 169 | + /** |
| 170 | + * The API audience. |
| 171 | + * If configured and if {@code CLIENT_CREDENTIALS} is used, |
| 172 | + * the client will use this audience to obtain an access token. |
| 173 | + */ |
141 | 174 | private String apiAudience; |
| 175 | + /** |
| 176 | + * The OAuth2 client ID. |
| 177 | + * Required, if {@code CLIENT_CREDENTIALS} method should be used. |
| 178 | + */ |
142 | 179 | private String clientId; |
| 180 | + /** |
| 181 | + * The OAuth2 client secret. |
| 182 | + * Required, if {@code CLIENT_CREDENTIALS} method should be used. |
| 183 | + */ |
143 | 184 | private String clientSecret; |
144 | | - |
| 185 | + /** |
| 186 | + * Space seperated list of OAuth2 scopes used to |
| 187 | + * obtain an access token. |
| 188 | + */ |
145 | 189 | private String scopes; |
146 | 190 |
|
147 | 191 | public String getApiTokenIssuer() { |
|
0 commit comments