github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/java-legacy/docs/ExternalApi.md (about) 1 # ExternalApi 2 3 All URIs are relative to *http://localhost/api/v1* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**createUserExternalPrincipal**](ExternalApi.md#createUserExternalPrincipal) | **POST** /auth/users/{userId}/external/principals | attach external principal to user 8 [**deleteUserExternalPrincipal**](ExternalApi.md#deleteUserExternalPrincipal) | **DELETE** /auth/users/{userId}/external/principals | delete external principal from user 9 [**externalPrincipalLogin**](ExternalApi.md#externalPrincipalLogin) | **POST** /auth/external/principal/login | perform a login using an external authenticator 10 [**getExternalPrincipal**](ExternalApi.md#getExternalPrincipal) | **GET** /auth/external/principals | describe external principal by id 11 [**listUserExternalPrincipals**](ExternalApi.md#listUserExternalPrincipals) | **GET** /auth/users/{userId}/external/principals/ls | list user external policies attached to a user 12 13 14 <a name="createUserExternalPrincipal"></a> 15 # **createUserExternalPrincipal** 16 > createUserExternalPrincipal(userId, principalId, externalPrincipalCreation) 17 18 attach external principal to user 19 20 ### Example 21 ```java 22 // Import classes: 23 import io.lakefs.clients.api.ApiClient; 24 import io.lakefs.clients.api.ApiException; 25 import io.lakefs.clients.api.Configuration; 26 import io.lakefs.clients.api.auth.*; 27 import io.lakefs.clients.api.models.*; 28 import io.lakefs.clients.api.ExternalApi; 29 30 public class Example { 31 public static void main(String[] args) { 32 ApiClient defaultClient = Configuration.getDefaultApiClient(); 33 defaultClient.setBasePath("http://localhost/api/v1"); 34 35 // Configure HTTP basic authorization: basic_auth 36 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 37 basic_auth.setUsername("YOUR USERNAME"); 38 basic_auth.setPassword("YOUR PASSWORD"); 39 40 // Configure API key authorization: cookie_auth 41 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 42 cookie_auth.setApiKey("YOUR API KEY"); 43 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 44 //cookie_auth.setApiKeyPrefix("Token"); 45 46 // Configure HTTP bearer authorization: jwt_token 47 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 48 jwt_token.setBearerToken("BEARER TOKEN"); 49 50 // Configure API key authorization: oidc_auth 51 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 52 oidc_auth.setApiKey("YOUR API KEY"); 53 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 54 //oidc_auth.setApiKeyPrefix("Token"); 55 56 // Configure API key authorization: saml_auth 57 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 58 saml_auth.setApiKey("YOUR API KEY"); 59 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 60 //saml_auth.setApiKeyPrefix("Token"); 61 62 ExternalApi apiInstance = new ExternalApi(defaultClient); 63 String userId = "userId_example"; // String | 64 String principalId = "principalId_example"; // String | 65 ExternalPrincipalCreation externalPrincipalCreation = new ExternalPrincipalCreation(); // ExternalPrincipalCreation | 66 try { 67 apiInstance.createUserExternalPrincipal(userId, principalId, externalPrincipalCreation); 68 } catch (ApiException e) { 69 System.err.println("Exception when calling ExternalApi#createUserExternalPrincipal"); 70 System.err.println("Status code: " + e.getCode()); 71 System.err.println("Reason: " + e.getResponseBody()); 72 System.err.println("Response headers: " + e.getResponseHeaders()); 73 e.printStackTrace(); 74 } 75 } 76 } 77 ``` 78 79 ### Parameters 80 81 Name | Type | Description | Notes 82 ------------- | ------------- | ------------- | ------------- 83 **userId** | **String**| | 84 **principalId** | **String**| | 85 **externalPrincipalCreation** | [**ExternalPrincipalCreation**](ExternalPrincipalCreation.md)| | [optional] 86 87 ### Return type 88 89 null (empty response body) 90 91 ### Authorization 92 93 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) 94 95 ### HTTP request headers 96 97 - **Content-Type**: application/json 98 - **Accept**: application/json 99 100 ### HTTP response details 101 | Status code | Description | Response headers | 102 |-------------|-------------|------------------| 103 **201** | external principal attached successfully | - | 104 **401** | Unauthorized | - | 105 **404** | Resource Not Found | - | 106 **409** | Resource Conflicts With Target | - | 107 **420** | too many requests | - | 108 **0** | Internal Server Error | - | 109 110 <a name="deleteUserExternalPrincipal"></a> 111 # **deleteUserExternalPrincipal** 112 > deleteUserExternalPrincipal(userId, principalId) 113 114 delete external principal from user 115 116 ### Example 117 ```java 118 // Import classes: 119 import io.lakefs.clients.api.ApiClient; 120 import io.lakefs.clients.api.ApiException; 121 import io.lakefs.clients.api.Configuration; 122 import io.lakefs.clients.api.auth.*; 123 import io.lakefs.clients.api.models.*; 124 import io.lakefs.clients.api.ExternalApi; 125 126 public class Example { 127 public static void main(String[] args) { 128 ApiClient defaultClient = Configuration.getDefaultApiClient(); 129 defaultClient.setBasePath("http://localhost/api/v1"); 130 131 // Configure HTTP basic authorization: basic_auth 132 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 133 basic_auth.setUsername("YOUR USERNAME"); 134 basic_auth.setPassword("YOUR PASSWORD"); 135 136 // Configure API key authorization: cookie_auth 137 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 138 cookie_auth.setApiKey("YOUR API KEY"); 139 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 140 //cookie_auth.setApiKeyPrefix("Token"); 141 142 // Configure HTTP bearer authorization: jwt_token 143 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 144 jwt_token.setBearerToken("BEARER TOKEN"); 145 146 // Configure API key authorization: oidc_auth 147 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 148 oidc_auth.setApiKey("YOUR API KEY"); 149 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 150 //oidc_auth.setApiKeyPrefix("Token"); 151 152 // Configure API key authorization: saml_auth 153 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 154 saml_auth.setApiKey("YOUR API KEY"); 155 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 156 //saml_auth.setApiKeyPrefix("Token"); 157 158 ExternalApi apiInstance = new ExternalApi(defaultClient); 159 String userId = "userId_example"; // String | 160 String principalId = "principalId_example"; // String | 161 try { 162 apiInstance.deleteUserExternalPrincipal(userId, principalId); 163 } catch (ApiException e) { 164 System.err.println("Exception when calling ExternalApi#deleteUserExternalPrincipal"); 165 System.err.println("Status code: " + e.getCode()); 166 System.err.println("Reason: " + e.getResponseBody()); 167 System.err.println("Response headers: " + e.getResponseHeaders()); 168 e.printStackTrace(); 169 } 170 } 171 } 172 ``` 173 174 ### Parameters 175 176 Name | Type | Description | Notes 177 ------------- | ------------- | ------------- | ------------- 178 **userId** | **String**| | 179 **principalId** | **String**| | 180 181 ### Return type 182 183 null (empty response body) 184 185 ### Authorization 186 187 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) 188 189 ### HTTP request headers 190 191 - **Content-Type**: Not defined 192 - **Accept**: application/json 193 194 ### HTTP response details 195 | Status code | Description | Response headers | 196 |-------------|-------------|------------------| 197 **204** | external principal detached successfully | - | 198 **401** | Unauthorized | - | 199 **404** | Resource Not Found | - | 200 **420** | too many requests | - | 201 **0** | Internal Server Error | - | 202 203 <a name="externalPrincipalLogin"></a> 204 # **externalPrincipalLogin** 205 > AuthenticationToken externalPrincipalLogin(externalLoginInformation) 206 207 perform a login using an external authenticator 208 209 ### Example 210 ```java 211 // Import classes: 212 import io.lakefs.clients.api.ApiClient; 213 import io.lakefs.clients.api.ApiException; 214 import io.lakefs.clients.api.Configuration; 215 import io.lakefs.clients.api.models.*; 216 import io.lakefs.clients.api.ExternalApi; 217 218 public class Example { 219 public static void main(String[] args) { 220 ApiClient defaultClient = Configuration.getDefaultApiClient(); 221 defaultClient.setBasePath("http://localhost/api/v1"); 222 223 ExternalApi apiInstance = new ExternalApi(defaultClient); 224 ExternalLoginInformation externalLoginInformation = new ExternalLoginInformation(); // ExternalLoginInformation | 225 try { 226 AuthenticationToken result = apiInstance.externalPrincipalLogin(externalLoginInformation); 227 System.out.println(result); 228 } catch (ApiException e) { 229 System.err.println("Exception when calling ExternalApi#externalPrincipalLogin"); 230 System.err.println("Status code: " + e.getCode()); 231 System.err.println("Reason: " + e.getResponseBody()); 232 System.err.println("Response headers: " + e.getResponseHeaders()); 233 e.printStackTrace(); 234 } 235 } 236 } 237 ``` 238 239 ### Parameters 240 241 Name | Type | Description | Notes 242 ------------- | ------------- | ------------- | ------------- 243 **externalLoginInformation** | [**ExternalLoginInformation**](ExternalLoginInformation.md)| | [optional] 244 245 ### Return type 246 247 [**AuthenticationToken**](AuthenticationToken.md) 248 249 ### Authorization 250 251 No authorization required 252 253 ### HTTP request headers 254 255 - **Content-Type**: application/json 256 - **Accept**: application/json 257 258 ### HTTP response details 259 | Status code | Description | Response headers | 260 |-------------|-------------|------------------| 261 **200** | successful external login | - | 262 **400** | Bad Request | - | 263 **401** | Unauthorized | - | 264 **403** | Forbidden | - | 265 **404** | Resource Not Found | - | 266 **420** | too many requests | - | 267 **0** | Internal Server Error | - | 268 269 <a name="getExternalPrincipal"></a> 270 # **getExternalPrincipal** 271 > ExternalPrincipal getExternalPrincipal(principalId) 272 273 describe external principal by id 274 275 ### Example 276 ```java 277 // Import classes: 278 import io.lakefs.clients.api.ApiClient; 279 import io.lakefs.clients.api.ApiException; 280 import io.lakefs.clients.api.Configuration; 281 import io.lakefs.clients.api.auth.*; 282 import io.lakefs.clients.api.models.*; 283 import io.lakefs.clients.api.ExternalApi; 284 285 public class Example { 286 public static void main(String[] args) { 287 ApiClient defaultClient = Configuration.getDefaultApiClient(); 288 defaultClient.setBasePath("http://localhost/api/v1"); 289 290 // Configure HTTP basic authorization: basic_auth 291 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 292 basic_auth.setUsername("YOUR USERNAME"); 293 basic_auth.setPassword("YOUR PASSWORD"); 294 295 // Configure API key authorization: cookie_auth 296 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 297 cookie_auth.setApiKey("YOUR API KEY"); 298 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 299 //cookie_auth.setApiKeyPrefix("Token"); 300 301 // Configure HTTP bearer authorization: jwt_token 302 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 303 jwt_token.setBearerToken("BEARER TOKEN"); 304 305 // Configure API key authorization: oidc_auth 306 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 307 oidc_auth.setApiKey("YOUR API KEY"); 308 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 309 //oidc_auth.setApiKeyPrefix("Token"); 310 311 // Configure API key authorization: saml_auth 312 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 313 saml_auth.setApiKey("YOUR API KEY"); 314 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 315 //saml_auth.setApiKeyPrefix("Token"); 316 317 ExternalApi apiInstance = new ExternalApi(defaultClient); 318 String principalId = "principalId_example"; // String | 319 try { 320 ExternalPrincipal result = apiInstance.getExternalPrincipal(principalId); 321 System.out.println(result); 322 } catch (ApiException e) { 323 System.err.println("Exception when calling ExternalApi#getExternalPrincipal"); 324 System.err.println("Status code: " + e.getCode()); 325 System.err.println("Reason: " + e.getResponseBody()); 326 System.err.println("Response headers: " + e.getResponseHeaders()); 327 e.printStackTrace(); 328 } 329 } 330 } 331 ``` 332 333 ### Parameters 334 335 Name | Type | Description | Notes 336 ------------- | ------------- | ------------- | ------------- 337 **principalId** | **String**| | 338 339 ### Return type 340 341 [**ExternalPrincipal**](ExternalPrincipal.md) 342 343 ### Authorization 344 345 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) 346 347 ### HTTP request headers 348 349 - **Content-Type**: Not defined 350 - **Accept**: application/json 351 352 ### HTTP response details 353 | Status code | Description | Response headers | 354 |-------------|-------------|------------------| 355 **200** | external principal | - | 356 **401** | Unauthorized | - | 357 **404** | Resource Not Found | - | 358 **420** | too many requests | - | 359 **0** | Internal Server Error | - | 360 361 <a name="listUserExternalPrincipals"></a> 362 # **listUserExternalPrincipals** 363 > ExternalPrincipalList listUserExternalPrincipals(userId, prefix, after, amount) 364 365 list user external policies attached to a user 366 367 ### Example 368 ```java 369 // Import classes: 370 import io.lakefs.clients.api.ApiClient; 371 import io.lakefs.clients.api.ApiException; 372 import io.lakefs.clients.api.Configuration; 373 import io.lakefs.clients.api.auth.*; 374 import io.lakefs.clients.api.models.*; 375 import io.lakefs.clients.api.ExternalApi; 376 377 public class Example { 378 public static void main(String[] args) { 379 ApiClient defaultClient = Configuration.getDefaultApiClient(); 380 defaultClient.setBasePath("http://localhost/api/v1"); 381 382 // Configure HTTP basic authorization: basic_auth 383 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 384 basic_auth.setUsername("YOUR USERNAME"); 385 basic_auth.setPassword("YOUR PASSWORD"); 386 387 // Configure API key authorization: cookie_auth 388 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 389 cookie_auth.setApiKey("YOUR API KEY"); 390 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 391 //cookie_auth.setApiKeyPrefix("Token"); 392 393 // Configure HTTP bearer authorization: jwt_token 394 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 395 jwt_token.setBearerToken("BEARER TOKEN"); 396 397 // Configure API key authorization: oidc_auth 398 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 399 oidc_auth.setApiKey("YOUR API KEY"); 400 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 401 //oidc_auth.setApiKeyPrefix("Token"); 402 403 // Configure API key authorization: saml_auth 404 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 405 saml_auth.setApiKey("YOUR API KEY"); 406 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 407 //saml_auth.setApiKeyPrefix("Token"); 408 409 ExternalApi apiInstance = new ExternalApi(defaultClient); 410 String userId = "userId_example"; // String | 411 String prefix = "prefix_example"; // String | return items prefixed with this value 412 String after = "after_example"; // String | return items after this value 413 Integer amount = 100; // Integer | how many items to return 414 try { 415 ExternalPrincipalList result = apiInstance.listUserExternalPrincipals(userId, prefix, after, amount); 416 System.out.println(result); 417 } catch (ApiException e) { 418 System.err.println("Exception when calling ExternalApi#listUserExternalPrincipals"); 419 System.err.println("Status code: " + e.getCode()); 420 System.err.println("Reason: " + e.getResponseBody()); 421 System.err.println("Response headers: " + e.getResponseHeaders()); 422 e.printStackTrace(); 423 } 424 } 425 } 426 ``` 427 428 ### Parameters 429 430 Name | Type | Description | Notes 431 ------------- | ------------- | ------------- | ------------- 432 **userId** | **String**| | 433 **prefix** | **String**| return items prefixed with this value | [optional] 434 **after** | **String**| return items after this value | [optional] 435 **amount** | **Integer**| how many items to return | [optional] [default to 100] 436 437 ### Return type 438 439 [**ExternalPrincipalList**](ExternalPrincipalList.md) 440 441 ### Authorization 442 443 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) 444 445 ### HTTP request headers 446 447 - **Content-Type**: Not defined 448 - **Accept**: application/json 449 450 ### HTTP response details 451 | Status code | Description | Response headers | 452 |-------------|-------------|------------------| 453 **200** | external principals list | - | 454 **401** | Unauthorized | - | 455 **404** | Resource Not Found | - | 456 **420** | too many requests | - | 457 **0** | Internal Server Error | - | 458