Skip to content

Commit

Permalink
Update API Client
Browse files Browse the repository at this point in the history
#### What's Changed
---

##### `GET` /admin/settings/

###### Return Type:

Changed response : **200 OK**

* Changed content type : `application/json`

    * Added property `impersonation_require_reason` (boolean)
        > Require administrators to provide a reason for impersonating a user.

##### `PUT` /admin/settings/

###### Request:

Changed content type : `application/json`

* Added property `impersonation_require_reason` (boolean)
    > Require administrators to provide a reason for impersonating a user.

###### Return Type:

Changed response : **200 OK**

* Changed content type : `application/json`

    * Added property `impersonation_require_reason` (boolean)
        > Require administrators to provide a reason for impersonating a user.

##### `PATCH` /admin/settings/

###### Request:

Changed content type : `application/json`

* Added property `impersonation_require_reason` (boolean)
    > Require administrators to provide a reason for impersonating a user.

###### Return Type:

Changed response : **200 OK**

* Changed content type : `application/json`

    * Added property `impersonation_require_reason` (boolean)
        > Require administrators to provide a reason for impersonating a user.

##### `POST` /core/users/{id}/impersonate/

###### Request:

New content type : `application/json`
  • Loading branch information
authentik-automation[bot] committed Nov 12, 2024
1 parent 204705c commit 59cf273
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ docs/IdentificationChallenge.md
docs/IdentificationChallengeResponseRequest.md
docs/IdentificationStage.md
docs/IdentificationStageRequest.md
docs/ImpersonationRequest.md
docs/InstallId.md
docs/IntentEnum.md
docs/InvalidResponseActionEnum.md
Expand Down Expand Up @@ -893,6 +894,7 @@ src/models/identification_challenge.rs
src/models/identification_challenge_response_request.rs
src/models/identification_stage.rs
src/models/identification_stage_request.rs
src/models/impersonation_request.rs
src/models/install_id.rs
src/models/intent_enum.rs
src/models/invalid_response_action_enum.rs
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "authentik-client"
version = "3.2024101.1"
version = "3.2024101.2"
authors = ["[email protected]"]
description = "Making authentication simple."
license = "MIT"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ Class | Method | HTTP request | Description
- [IdentificationChallengeResponseRequest](docs/IdentificationChallengeResponseRequest.md)
- [IdentificationStage](docs/IdentificationStage.md)
- [IdentificationStageRequest](docs/IdentificationStageRequest.md)
- [ImpersonationRequest](docs/ImpersonationRequest.md)
- [InstallId](docs/InstallId.md)
- [IntentEnum](docs/IntentEnum.md)
- [InvalidResponseActionEnum](docs/InvalidResponseActionEnum.md)
Expand Down
5 changes: 3 additions & 2 deletions docs/CoreApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ Name | Type | Description | Required | Notes

## core_users_impersonate_create

> core_users_impersonate_create(id)
> core_users_impersonate_create(id, impersonation_request)

Impersonate a user
Expand All @@ -1593,6 +1593,7 @@ Impersonate a user
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **i32** | A unique integer value identifying this User. | [required] |
**impersonation_request** | [**ImpersonationRequest**](ImpersonationRequest.md) | | [required] |

### Return type

Expand All @@ -1604,7 +1605,7 @@ Name | Type | Description | Required | Notes

### HTTP request headers

- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
Expand Down
11 changes: 11 additions & 0 deletions docs/ImpersonationRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ImpersonationRequest

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**reason** | **String** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


1 change: 1 addition & 0 deletions docs/PatchedSettingsRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Name | Type | Description | Notes
**footer_links** | Option<[**serde_json::Value**](.md)> | The option configures the footer links on the flow executor pages. | [optional]
**gdpr_compliance** | Option<**bool**> | When enabled, all the events caused by a user will be deleted upon the user's deletion. | [optional]
**impersonation** | Option<**bool**> | Globally enable/disable impersonation. | [optional]
**impersonation_require_reason** | Option<**bool**> | Require administrators to provide a reason for impersonating a user. | [optional]
**default_token_duration** | Option<**String**> | Default token duration | [optional]
**default_token_length** | Option<**u32**> | Default token length | [optional]

Expand Down
1 change: 1 addition & 0 deletions docs/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Name | Type | Description | Notes
**footer_links** | Option<[**serde_json::Value**](.md)> | The option configures the footer links on the flow executor pages. | [optional]
**gdpr_compliance** | Option<**bool**> | When enabled, all the events caused by a user will be deleted upon the user's deletion. | [optional]
**impersonation** | Option<**bool**> | Globally enable/disable impersonation. | [optional]
**impersonation_require_reason** | Option<**bool**> | Require administrators to provide a reason for impersonating a user. | [optional]
**default_token_duration** | Option<**String**> | Default token duration | [optional]
**default_token_length** | Option<**u32**> | Default token length | [optional]

Expand Down
1 change: 1 addition & 0 deletions docs/SettingsRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Name | Type | Description | Notes
**footer_links** | Option<[**serde_json::Value**](.md)> | The option configures the footer links on the flow executor pages. | [optional]
**gdpr_compliance** | Option<**bool**> | When enabled, all the events caused by a user will be deleted upon the user's deletion. | [optional]
**impersonation** | Option<**bool**> | Globally enable/disable impersonation. | [optional]
**impersonation_require_reason** | Option<**bool**> | Require administrators to provide a reason for impersonating a user. | [optional]
**default_token_duration** | Option<**String**> | Default token duration | [optional]
**default_token_length** | Option<**u32**> | Default token length | [optional]

Expand Down
26 changes: 26 additions & 0 deletions schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5295,6 +5295,12 @@ paths:
required: true
tags:
- core
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ImpersonationRequest'
required: true
security:
- authentik: []
responses:
Expand Down Expand Up @@ -42720,6 +42726,14 @@ components:
incorrect user info is entered.
required:
- name
ImpersonationRequest:
type: object
properties:
reason:
type: string
minLength: 1
required:
- reason
InstallID:
type: object
properties:
Expand Down Expand Up @@ -50029,6 +50043,10 @@ components:
impersonation:
type: boolean
description: Globally enable/disable impersonation.
impersonation_require_reason:
type: boolean
description: Require administrators to provide a reason for impersonating
a user.
default_token_duration:
type: string
minLength: 1
Expand Down Expand Up @@ -53758,6 +53776,10 @@ components:
impersonation:
type: boolean
description: Globally enable/disable impersonation.
impersonation_require_reason:
type: boolean
description: Require administrators to provide a reason for impersonating
a user.
default_token_duration:
type: string
description: Default token duration
Expand Down Expand Up @@ -53797,6 +53819,10 @@ components:
impersonation:
type: boolean
description: Globally enable/disable impersonation.
impersonation_require_reason:
type: boolean
description: Require administrators to provide a reason for impersonating
a user.
default_token_duration:
type: string
minLength: 1
Expand Down
2 changes: 2 additions & 0 deletions src/apis/core_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2868,6 +2868,7 @@ pub async fn core_users_destroy(
pub async fn core_users_impersonate_create(
configuration: &configuration::Configuration,
id: i32,
impersonation_request: models::ImpersonationRequest,
) -> Result<(), Error<CoreUsersImpersonateCreateError>> {
let local_var_configuration = configuration;

Expand All @@ -2886,6 +2887,7 @@ pub async fn core_users_impersonate_create(
if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};
local_var_req_builder = local_var_req_builder.json(&impersonation_request);

let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
Expand Down
24 changes: 24 additions & 0 deletions src/models/impersonation_request.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* authentik
*
* Making authentication simple.
*
* The version of the OpenAPI document: 2024.10.1
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
*/

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ImpersonationRequest {
#[serde(rename = "reason")]
pub reason: String,
}

impl ImpersonationRequest {
pub fn new(reason: String) -> ImpersonationRequest {
ImpersonationRequest { reason }
}
}
2 changes: 2 additions & 0 deletions src/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ pub mod identification_stage;
pub use self::identification_stage::IdentificationStage;
pub mod identification_stage_request;
pub use self::identification_stage_request::IdentificationStageRequest;
pub mod impersonation_request;
pub use self::impersonation_request::ImpersonationRequest;
pub mod install_id;
pub use self::install_id::InstallId;
pub mod intent_enum;
Expand Down
4 changes: 4 additions & 0 deletions src/models/patched_settings_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ pub struct PatchedSettingsRequest {
/// Globally enable/disable impersonation.
#[serde(rename = "impersonation", skip_serializing_if = "Option::is_none")]
pub impersonation: Option<bool>,
/// Require administrators to provide a reason for impersonating a user.
#[serde(rename = "impersonation_require_reason", skip_serializing_if = "Option::is_none")]
pub impersonation_require_reason: Option<bool>,
/// Default token duration
#[serde(rename = "default_token_duration", skip_serializing_if = "Option::is_none")]
pub default_token_duration: Option<String>,
Expand All @@ -63,6 +66,7 @@ impl PatchedSettingsRequest {
footer_links: None,
gdpr_compliance: None,
impersonation: None,
impersonation_require_reason: None,
default_token_duration: None,
default_token_length: None,
}
Expand Down
4 changes: 4 additions & 0 deletions src/models/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ pub struct Settings {
/// Globally enable/disable impersonation.
#[serde(rename = "impersonation", skip_serializing_if = "Option::is_none")]
pub impersonation: Option<bool>,
/// Require administrators to provide a reason for impersonating a user.
#[serde(rename = "impersonation_require_reason", skip_serializing_if = "Option::is_none")]
pub impersonation_require_reason: Option<bool>,
/// Default token duration
#[serde(rename = "default_token_duration", skip_serializing_if = "Option::is_none")]
pub default_token_duration: Option<String>,
Expand All @@ -63,6 +66,7 @@ impl Settings {
footer_links: None,
gdpr_compliance: None,
impersonation: None,
impersonation_require_reason: None,
default_token_duration: None,
default_token_length: None,
}
Expand Down
4 changes: 4 additions & 0 deletions src/models/settings_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ pub struct SettingsRequest {
/// Globally enable/disable impersonation.
#[serde(rename = "impersonation", skip_serializing_if = "Option::is_none")]
pub impersonation: Option<bool>,
/// Require administrators to provide a reason for impersonating a user.
#[serde(rename = "impersonation_require_reason", skip_serializing_if = "Option::is_none")]
pub impersonation_require_reason: Option<bool>,
/// Default token duration
#[serde(rename = "default_token_duration", skip_serializing_if = "Option::is_none")]
pub default_token_duration: Option<String>,
Expand All @@ -63,6 +66,7 @@ impl SettingsRequest {
footer_links: None,
gdpr_compliance: None,
impersonation: None,
impersonation_require_reason: None,
default_token_duration: None,
default_token_length: None,
}
Expand Down

0 comments on commit 59cf273

Please sign in to comment.