mirror of
https://github.com/openziti/zrok.git
synced 2025-06-26 12:42:18 +02:00
cleanup secrets access infrasructure (#983)
This commit is contained in:
parent
3493b1f765
commit
4da71637e6
@ -21,7 +21,7 @@ type adminCreateSecretsAccessIdentityCommand struct {
|
||||
|
||||
func newAdminCreateSecretsIdentityCommand() *adminCreateSecretsAccessIdentityCommand {
|
||||
cmd := &cobra.Command{
|
||||
Use: "secrets-access-identity <name>",
|
||||
Use: "secrets-access-identity <secretsAccessIdentityName>",
|
||||
Aliases: []string{"sai"},
|
||||
Short: "Create a secrets access identity for accessing the secrets listener",
|
||||
Args: cobra.ExactArgs(1),
|
||||
@ -32,18 +32,18 @@ func newAdminCreateSecretsIdentityCommand() *adminCreateSecretsAccessIdentityCom
|
||||
}
|
||||
|
||||
func (cmd *adminCreateSecretsAccessIdentityCommand) run(_ *cobra.Command, args []string) {
|
||||
name := args[0]
|
||||
secretsAccessIdentityName := args[0]
|
||||
|
||||
env, err := environment.LoadRoot()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
zif, err := env.ZitiIdentityNamed(name)
|
||||
zif, err := env.ZitiIdentityNamed(secretsAccessIdentityName)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if _, err := os.Stat(zif); err == nil {
|
||||
logrus.Errorf("identity '%v' already exists at '%v'", name, zif)
|
||||
logrus.Errorf("identity '%v' already exists at '%v'", secretsAccessIdentityName, zif)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
@ -52,11 +52,11 @@ func (cmd *adminCreateSecretsAccessIdentityCommand) run(_ *cobra.Command, args [
|
||||
panic(err)
|
||||
}
|
||||
|
||||
secretsAccessIdentityZId, err := cmd.createIdentity(name, env, zrok)
|
||||
secretsAccessIdentityZId, err := cmd.createIdentity(secretsAccessIdentityName, env, zrok)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
logrus.Infof("created identity '%v' with ziti id '%v'", name, secretsAccessIdentityZId)
|
||||
logrus.Infof("created identity '%v' with ziti id '%v'", secretsAccessIdentityName, secretsAccessIdentityZId)
|
||||
|
||||
if err := cmd.createDialPolicy(secretsAccessIdentityZId, zrok); err != nil {
|
||||
panic(err)
|
||||
|
53
cmd/zrok/adminDeleteSecretsAccessIdentity.go
Normal file
53
cmd/zrok/adminDeleteSecretsAccessIdentity.go
Normal file
@ -0,0 +1,53 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/openziti/zrok/environment"
|
||||
"github.com/openziti/zrok/rest_client_zrok"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
type adminDeleteSecretsAccessIdentityCommand struct {
|
||||
cmd *cobra.Command
|
||||
}
|
||||
|
||||
func newDeleteSecretsAccessIdentityCommand() *adminDeleteSecretsAccessIdentityCommand {
|
||||
cmd := &cobra.Command{
|
||||
Use: "secrets-access-identity <secretsAccessIdentityZId>",
|
||||
Aliases: []string{"sai"},
|
||||
Short: "Delete a secrets access identity",
|
||||
Args: cobra.ExactArgs(1),
|
||||
}
|
||||
command := &adminDeleteSecretsAccessIdentityCommand{cmd: cmd}
|
||||
cmd.Run = command.run
|
||||
return command
|
||||
}
|
||||
|
||||
func (cmd *adminDeleteSecretsAccessIdentityCommand) run(_ *cobra.Command, args []string) {
|
||||
secretsAccessIdentityZId := args[0]
|
||||
|
||||
env, err := environment.LoadRoot()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
zrok, err := env.Client()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if err := cmd.deleteDialPolicy(secretsAccessIdentityZId, zrok); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if err := cmd.deleteIdentity(secretsAccessIdentityZId, zrok); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func (cmd *adminDeleteSecretsAccessIdentityCommand) deleteDialPolicy(zId string, zrok *rest_client_zrok.Zrok) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cmd *adminDeleteSecretsAccessIdentityCommand) deleteIdentity(zId string, zrok *rest_client_zrok.Zrok) error {
|
||||
return nil
|
||||
}
|
@ -281,8 +281,8 @@ swagger:model DeleteIdentityBody
|
||||
*/
|
||||
type DeleteIdentityBody struct {
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
// z Id
|
||||
ZID string `json:"zId,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this delete identity body
|
||||
|
@ -1327,7 +1327,7 @@ func init() {
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"zId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
@ -4204,7 +4204,7 @@ func init() {
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"zId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
|
@ -78,8 +78,8 @@ func (o *DeleteIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||
// swagger:model DeleteIdentityBody
|
||||
type DeleteIdentityBody struct {
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
// z Id
|
||||
ZID string `json:"zId,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this delete identity body
|
||||
|
@ -20,6 +20,7 @@ models/CreateIdentity201Response.ts
|
||||
models/CreateIdentityRequest.ts
|
||||
models/CreateOrganization201Response.ts
|
||||
models/CreateOrganizationRequest.ts
|
||||
models/DeleteIdentityRequest.ts
|
||||
models/DisableRequest.ts
|
||||
models/EnableRequest.ts
|
||||
models/Enroll200Response.ts
|
||||
|
@ -23,6 +23,7 @@ import type {
|
||||
CreateIdentityRequest,
|
||||
CreateOrganization201Response,
|
||||
CreateOrganizationRequest,
|
||||
DeleteIdentityRequest,
|
||||
InviteTokenGenerateRequest,
|
||||
ListFrontends200ResponseInner,
|
||||
ListOrganizationMembers200Response,
|
||||
@ -50,6 +51,8 @@ import {
|
||||
CreateOrganization201ResponseToJSON,
|
||||
CreateOrganizationRequestFromJSON,
|
||||
CreateOrganizationRequestToJSON,
|
||||
DeleteIdentityRequestFromJSON,
|
||||
DeleteIdentityRequestToJSON,
|
||||
InviteTokenGenerateRequestFromJSON,
|
||||
InviteTokenGenerateRequestToJSON,
|
||||
ListFrontends200ResponseInnerFromJSON,
|
||||
@ -98,8 +101,8 @@ export interface DeleteFrontendRequest {
|
||||
body?: CreateFrontend201Response;
|
||||
}
|
||||
|
||||
export interface DeleteIdentityRequest {
|
||||
body?: CreateIdentityRequest;
|
||||
export interface DeleteIdentityOperationRequest {
|
||||
body?: DeleteIdentityRequest;
|
||||
}
|
||||
|
||||
export interface DeleteOrganizationRequest {
|
||||
@ -351,7 +354,7 @@ export class AdminApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async deleteIdentityRaw(requestParameters: DeleteIdentityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
async deleteIdentityRaw(requestParameters: DeleteIdentityOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
@ -367,7 +370,7 @@ export class AdminApi extends runtime.BaseAPI {
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CreateIdentityRequestToJSON(requestParameters['body']),
|
||||
body: DeleteIdentityRequestToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
@ -375,7 +378,7 @@ export class AdminApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async deleteIdentity(requestParameters: DeleteIdentityRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
async deleteIdentity(requestParameters: DeleteIdentityOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.deleteIdentityRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
|
65
sdk/nodejs/sdk/src/api/models/DeleteIdentityRequest.ts
Normal file
65
sdk/nodejs/sdk/src/api/models/DeleteIdentityRequest.ts
Normal file
@ -0,0 +1,65 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* zrok
|
||||
* zrok client access
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface DeleteIdentityRequest
|
||||
*/
|
||||
export interface DeleteIdentityRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof DeleteIdentityRequest
|
||||
*/
|
||||
zId?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the DeleteIdentityRequest interface.
|
||||
*/
|
||||
export function instanceOfDeleteIdentityRequest(value: object): value is DeleteIdentityRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function DeleteIdentityRequestFromJSON(json: any): DeleteIdentityRequest {
|
||||
return DeleteIdentityRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function DeleteIdentityRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeleteIdentityRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'zId': json['zId'] == null ? undefined : json['zId'],
|
||||
};
|
||||
}
|
||||
|
||||
export function DeleteIdentityRequestToJSON(json: any): DeleteIdentityRequest {
|
||||
return DeleteIdentityRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function DeleteIdentityRequestToJSONTyped(value?: DeleteIdentityRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'zId': value['zId'],
|
||||
};
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ export * from './CreateIdentity201Response';
|
||||
export * from './CreateIdentityRequest';
|
||||
export * from './CreateOrganization201Response';
|
||||
export * from './CreateOrganizationRequest';
|
||||
export * from './DeleteIdentityRequest';
|
||||
export * from './DisableRequest';
|
||||
export * from './EnableRequest';
|
||||
export * from './Enroll200Response';
|
||||
|
@ -17,6 +17,7 @@ docs/CreateIdentity201Response.md
|
||||
docs/CreateIdentityRequest.md
|
||||
docs/CreateOrganization201Response.md
|
||||
docs/CreateOrganizationRequest.md
|
||||
docs/DeleteIdentityRequest.md
|
||||
docs/DisableRequest.md
|
||||
docs/EnableRequest.md
|
||||
docs/Enroll200Response.md
|
||||
@ -89,6 +90,7 @@ test/test_create_identity201_response.py
|
||||
test/test_create_identity_request.py
|
||||
test/test_create_organization201_response.py
|
||||
test/test_create_organization_request.py
|
||||
test/test_delete_identity_request.py
|
||||
test/test_disable_request.py
|
||||
test/test_enable_request.py
|
||||
test/test_enroll200_response.py
|
||||
@ -168,6 +170,7 @@ zrok_api/models/create_identity201_response.py
|
||||
zrok_api/models/create_identity_request.py
|
||||
zrok_api/models/create_organization201_response.py
|
||||
zrok_api/models/create_organization_request.py
|
||||
zrok_api/models/delete_identity_request.py
|
||||
zrok_api/models/disable_request.py
|
||||
zrok_api/models/enable_request.py
|
||||
zrok_api/models/enroll200_response.py
|
||||
|
@ -167,6 +167,7 @@ Class | Method | HTTP request | Description
|
||||
- [CreateIdentityRequest](docs/CreateIdentityRequest.md)
|
||||
- [CreateOrganization201Response](docs/CreateOrganization201Response.md)
|
||||
- [CreateOrganizationRequest](docs/CreateOrganizationRequest.md)
|
||||
- [DeleteIdentityRequest](docs/DeleteIdentityRequest.md)
|
||||
- [DisableRequest](docs/DisableRequest.md)
|
||||
- [EnableRequest](docs/EnableRequest.md)
|
||||
- [Enroll200Response](docs/Enroll200Response.md)
|
||||
|
@ -567,7 +567,7 @@ void (empty response body)
|
||||
|
||||
```python
|
||||
import zrok_api
|
||||
from zrok_api.models.create_identity_request import CreateIdentityRequest
|
||||
from zrok_api.models.delete_identity_request import DeleteIdentityRequest
|
||||
from zrok_api.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
@ -592,7 +592,7 @@ configuration.api_key['key'] = os.environ["API_KEY"]
|
||||
with zrok_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = zrok_api.AdminApi(api_client)
|
||||
body = zrok_api.CreateIdentityRequest() # CreateIdentityRequest | (optional)
|
||||
body = zrok_api.DeleteIdentityRequest() # DeleteIdentityRequest | (optional)
|
||||
|
||||
try:
|
||||
api_instance.delete_identity(body=body)
|
||||
@ -607,7 +607,7 @@ with zrok_api.ApiClient(configuration) as api_client:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**CreateIdentityRequest**](CreateIdentityRequest.md)| | [optional]
|
||||
**body** | [**DeleteIdentityRequest**](DeleteIdentityRequest.md)| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
29
sdk/python/src/docs/DeleteIdentityRequest.md
Normal file
29
sdk/python/src/docs/DeleteIdentityRequest.md
Normal file
@ -0,0 +1,29 @@
|
||||
# DeleteIdentityRequest
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**z_id** | **str** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from zrok_api.models.delete_identity_request import DeleteIdentityRequest
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of DeleteIdentityRequest from a JSON string
|
||||
delete_identity_request_instance = DeleteIdentityRequest.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(DeleteIdentityRequest.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
delete_identity_request_dict = delete_identity_request_instance.to_dict()
|
||||
# create an instance of DeleteIdentityRequest from a dict
|
||||
delete_identity_request_from_dict = DeleteIdentityRequest.from_dict(delete_identity_request_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
51
sdk/python/src/test/test_delete_identity_request.py
Normal file
51
sdk/python/src/test/test_delete_identity_request.py
Normal file
@ -0,0 +1,51 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
zrok
|
||||
|
||||
zrok client access
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
from zrok_api.models.delete_identity_request import DeleteIdentityRequest
|
||||
|
||||
class TestDeleteIdentityRequest(unittest.TestCase):
|
||||
"""DeleteIdentityRequest unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional) -> DeleteIdentityRequest:
|
||||
"""Test DeleteIdentityRequest
|
||||
include_optional is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# uncomment below to create an instance of `DeleteIdentityRequest`
|
||||
"""
|
||||
model = DeleteIdentityRequest()
|
||||
if include_optional:
|
||||
return DeleteIdentityRequest(
|
||||
z_id = ''
|
||||
)
|
||||
else:
|
||||
return DeleteIdentityRequest(
|
||||
)
|
||||
"""
|
||||
|
||||
def testDeleteIdentityRequest(self):
|
||||
"""Test DeleteIdentityRequest"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
@ -50,6 +50,7 @@ from zrok_api.models.create_identity201_response import CreateIdentity201Respons
|
||||
from zrok_api.models.create_identity_request import CreateIdentityRequest
|
||||
from zrok_api.models.create_organization201_response import CreateOrganization201Response
|
||||
from zrok_api.models.create_organization_request import CreateOrganizationRequest
|
||||
from zrok_api.models.delete_identity_request import DeleteIdentityRequest
|
||||
from zrok_api.models.disable_request import DisableRequest
|
||||
from zrok_api.models.enable_request import EnableRequest
|
||||
from zrok_api.models.enroll200_response import Enroll200Response
|
||||
|
@ -25,6 +25,7 @@ from zrok_api.models.create_identity201_response import CreateIdentity201Respons
|
||||
from zrok_api.models.create_identity_request import CreateIdentityRequest
|
||||
from zrok_api.models.create_organization201_response import CreateOrganization201Response
|
||||
from zrok_api.models.create_organization_request import CreateOrganizationRequest
|
||||
from zrok_api.models.delete_identity_request import DeleteIdentityRequest
|
||||
from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest
|
||||
from zrok_api.models.list_frontends200_response_inner import ListFrontends200ResponseInner
|
||||
from zrok_api.models.list_organization_members200_response import ListOrganizationMembers200Response
|
||||
@ -1989,7 +1990,7 @@ class AdminApi:
|
||||
@validate_call
|
||||
def delete_identity(
|
||||
self,
|
||||
body: Optional[CreateIdentityRequest] = None,
|
||||
body: Optional[DeleteIdentityRequest] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
@ -2007,7 +2008,7 @@ class AdminApi:
|
||||
|
||||
|
||||
:param body:
|
||||
:type body: CreateIdentityRequest
|
||||
:type body: DeleteIdentityRequest
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
@ -2058,7 +2059,7 @@ class AdminApi:
|
||||
@validate_call
|
||||
def delete_identity_with_http_info(
|
||||
self,
|
||||
body: Optional[CreateIdentityRequest] = None,
|
||||
body: Optional[DeleteIdentityRequest] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
@ -2076,7 +2077,7 @@ class AdminApi:
|
||||
|
||||
|
||||
:param body:
|
||||
:type body: CreateIdentityRequest
|
||||
:type body: DeleteIdentityRequest
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
@ -2127,7 +2128,7 @@ class AdminApi:
|
||||
@validate_call
|
||||
def delete_identity_without_preload_content(
|
||||
self,
|
||||
body: Optional[CreateIdentityRequest] = None,
|
||||
body: Optional[DeleteIdentityRequest] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
@ -2145,7 +2146,7 @@ class AdminApi:
|
||||
|
||||
|
||||
:param body:
|
||||
:type body: CreateIdentityRequest
|
||||
:type body: DeleteIdentityRequest
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
|
@ -28,6 +28,7 @@ from zrok_api.models.create_identity201_response import CreateIdentity201Respons
|
||||
from zrok_api.models.create_identity_request import CreateIdentityRequest
|
||||
from zrok_api.models.create_organization201_response import CreateOrganization201Response
|
||||
from zrok_api.models.create_organization_request import CreateOrganizationRequest
|
||||
from zrok_api.models.delete_identity_request import DeleteIdentityRequest
|
||||
from zrok_api.models.disable_request import DisableRequest
|
||||
from zrok_api.models.enable_request import EnableRequest
|
||||
from zrok_api.models.enroll200_response import Enroll200Response
|
||||
|
87
sdk/python/src/zrok_api/models/delete_identity_request.py
Normal file
87
sdk/python/src/zrok_api/models/delete_identity_request.py
Normal file
@ -0,0 +1,87 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
zrok
|
||||
|
||||
zrok client access
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class DeleteIdentityRequest(BaseModel):
|
||||
"""
|
||||
DeleteIdentityRequest
|
||||
""" # noqa: E501
|
||||
z_id: Optional[StrictStr] = Field(default=None, alias="zId")
|
||||
__properties: ClassVar[List[str]] = ["zId"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DeleteIdentityRequest from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DeleteIdentityRequest from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"zId": obj.get("zId")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
@ -436,7 +436,7 @@ paths:
|
||||
in: body
|
||||
schema:
|
||||
properties:
|
||||
name:
|
||||
zId:
|
||||
type: string
|
||||
responses:
|
||||
200:
|
||||
|
@ -20,6 +20,7 @@ models/CreateIdentity201Response.ts
|
||||
models/CreateIdentityRequest.ts
|
||||
models/CreateOrganization201Response.ts
|
||||
models/CreateOrganizationRequest.ts
|
||||
models/DeleteIdentityRequest.ts
|
||||
models/DisableRequest.ts
|
||||
models/EnableRequest.ts
|
||||
models/Enroll200Response.ts
|
||||
|
@ -23,6 +23,7 @@ import type {
|
||||
CreateIdentityRequest,
|
||||
CreateOrganization201Response,
|
||||
CreateOrganizationRequest,
|
||||
DeleteIdentityRequest,
|
||||
InviteTokenGenerateRequest,
|
||||
ListFrontends200ResponseInner,
|
||||
ListOrganizationMembers200Response,
|
||||
@ -50,6 +51,8 @@ import {
|
||||
CreateOrganization201ResponseToJSON,
|
||||
CreateOrganizationRequestFromJSON,
|
||||
CreateOrganizationRequestToJSON,
|
||||
DeleteIdentityRequestFromJSON,
|
||||
DeleteIdentityRequestToJSON,
|
||||
InviteTokenGenerateRequestFromJSON,
|
||||
InviteTokenGenerateRequestToJSON,
|
||||
ListFrontends200ResponseInnerFromJSON,
|
||||
@ -98,8 +101,8 @@ export interface DeleteFrontendRequest {
|
||||
body?: CreateFrontend201Response;
|
||||
}
|
||||
|
||||
export interface DeleteIdentityRequest {
|
||||
body?: CreateIdentityRequest;
|
||||
export interface DeleteIdentityOperationRequest {
|
||||
body?: DeleteIdentityRequest;
|
||||
}
|
||||
|
||||
export interface DeleteOrganizationRequest {
|
||||
@ -351,7 +354,7 @@ export class AdminApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async deleteIdentityRaw(requestParameters: DeleteIdentityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
async deleteIdentityRaw(requestParameters: DeleteIdentityOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
@ -367,7 +370,7 @@ export class AdminApi extends runtime.BaseAPI {
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CreateIdentityRequestToJSON(requestParameters['body']),
|
||||
body: DeleteIdentityRequestToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
@ -375,7 +378,7 @@ export class AdminApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async deleteIdentity(requestParameters: DeleteIdentityRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
async deleteIdentity(requestParameters: DeleteIdentityOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.deleteIdentityRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
|
65
ui/src/api/models/DeleteIdentityRequest.ts
Normal file
65
ui/src/api/models/DeleteIdentityRequest.ts
Normal file
@ -0,0 +1,65 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* zrok
|
||||
* zrok client access
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface DeleteIdentityRequest
|
||||
*/
|
||||
export interface DeleteIdentityRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof DeleteIdentityRequest
|
||||
*/
|
||||
zId?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the DeleteIdentityRequest interface.
|
||||
*/
|
||||
export function instanceOfDeleteIdentityRequest(value: object): value is DeleteIdentityRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function DeleteIdentityRequestFromJSON(json: any): DeleteIdentityRequest {
|
||||
return DeleteIdentityRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function DeleteIdentityRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeleteIdentityRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'zId': json['zId'] == null ? undefined : json['zId'],
|
||||
};
|
||||
}
|
||||
|
||||
export function DeleteIdentityRequestToJSON(json: any): DeleteIdentityRequest {
|
||||
return DeleteIdentityRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function DeleteIdentityRequestToJSONTyped(value?: DeleteIdentityRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'zId': value['zId'],
|
||||
};
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ export * from './CreateIdentity201Response';
|
||||
export * from './CreateIdentityRequest';
|
||||
export * from './CreateOrganization201Response';
|
||||
export * from './CreateOrganizationRequest';
|
||||
export * from './DeleteIdentityRequest';
|
||||
export * from './DisableRequest';
|
||||
export * from './EnableRequest';
|
||||
export * from './Enroll200Response';
|
||||
|
Loading…
x
Reference in New Issue
Block a user