cleanup secrets access infrasructure (#983)

This commit is contained in:
Michael Quigley 2025-06-17 16:36:20 -04:00
parent 3493b1f765
commit 4da71637e6
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
23 changed files with 399 additions and 32 deletions

View File

@ -21,7 +21,7 @@ type adminCreateSecretsAccessIdentityCommand struct {
func newAdminCreateSecretsIdentityCommand() *adminCreateSecretsAccessIdentityCommand { func newAdminCreateSecretsIdentityCommand() *adminCreateSecretsAccessIdentityCommand {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "secrets-access-identity <name>", Use: "secrets-access-identity <secretsAccessIdentityName>",
Aliases: []string{"sai"}, Aliases: []string{"sai"},
Short: "Create a secrets access identity for accessing the secrets listener", Short: "Create a secrets access identity for accessing the secrets listener",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
@ -32,18 +32,18 @@ func newAdminCreateSecretsIdentityCommand() *adminCreateSecretsAccessIdentityCom
} }
func (cmd *adminCreateSecretsAccessIdentityCommand) run(_ *cobra.Command, args []string) { func (cmd *adminCreateSecretsAccessIdentityCommand) run(_ *cobra.Command, args []string) {
name := args[0] secretsAccessIdentityName := args[0]
env, err := environment.LoadRoot() env, err := environment.LoadRoot()
if err != nil { if err != nil {
panic(err) panic(err)
} }
zif, err := env.ZitiIdentityNamed(name) zif, err := env.ZitiIdentityNamed(secretsAccessIdentityName)
if err != nil { if err != nil {
panic(err) panic(err)
} }
if _, err := os.Stat(zif); err == nil { 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) os.Exit(1)
} }
@ -52,11 +52,11 @@ func (cmd *adminCreateSecretsAccessIdentityCommand) run(_ *cobra.Command, args [
panic(err) panic(err)
} }
secretsAccessIdentityZId, err := cmd.createIdentity(name, env, zrok) secretsAccessIdentityZId, err := cmd.createIdentity(secretsAccessIdentityName, env, zrok)
if err != nil { if err != nil {
panic(err) 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 { if err := cmd.createDialPolicy(secretsAccessIdentityZId, zrok); err != nil {
panic(err) panic(err)

View 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
}

View File

@ -281,8 +281,8 @@ swagger:model DeleteIdentityBody
*/ */
type DeleteIdentityBody struct { type DeleteIdentityBody struct {
// name // z Id
Name string `json:"name,omitempty"` ZID string `json:"zId,omitempty"`
} }
// Validate validates this delete identity body // Validate validates this delete identity body

View File

@ -1327,7 +1327,7 @@ func init() {
"in": "body", "in": "body",
"schema": { "schema": {
"properties": { "properties": {
"name": { "zId": {
"type": "string" "type": "string"
} }
} }
@ -4204,7 +4204,7 @@ func init() {
"in": "body", "in": "body",
"schema": { "schema": {
"properties": { "properties": {
"name": { "zId": {
"type": "string" "type": "string"
} }
} }

View File

@ -78,8 +78,8 @@ func (o *DeleteIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
// swagger:model DeleteIdentityBody // swagger:model DeleteIdentityBody
type DeleteIdentityBody struct { type DeleteIdentityBody struct {
// name // z Id
Name string `json:"name,omitempty"` ZID string `json:"zId,omitempty"`
} }
// Validate validates this delete identity body // Validate validates this delete identity body

View File

@ -20,6 +20,7 @@ models/CreateIdentity201Response.ts
models/CreateIdentityRequest.ts models/CreateIdentityRequest.ts
models/CreateOrganization201Response.ts models/CreateOrganization201Response.ts
models/CreateOrganizationRequest.ts models/CreateOrganizationRequest.ts
models/DeleteIdentityRequest.ts
models/DisableRequest.ts models/DisableRequest.ts
models/EnableRequest.ts models/EnableRequest.ts
models/Enroll200Response.ts models/Enroll200Response.ts

View File

@ -23,6 +23,7 @@ import type {
CreateIdentityRequest, CreateIdentityRequest,
CreateOrganization201Response, CreateOrganization201Response,
CreateOrganizationRequest, CreateOrganizationRequest,
DeleteIdentityRequest,
InviteTokenGenerateRequest, InviteTokenGenerateRequest,
ListFrontends200ResponseInner, ListFrontends200ResponseInner,
ListOrganizationMembers200Response, ListOrganizationMembers200Response,
@ -50,6 +51,8 @@ import {
CreateOrganization201ResponseToJSON, CreateOrganization201ResponseToJSON,
CreateOrganizationRequestFromJSON, CreateOrganizationRequestFromJSON,
CreateOrganizationRequestToJSON, CreateOrganizationRequestToJSON,
DeleteIdentityRequestFromJSON,
DeleteIdentityRequestToJSON,
InviteTokenGenerateRequestFromJSON, InviteTokenGenerateRequestFromJSON,
InviteTokenGenerateRequestToJSON, InviteTokenGenerateRequestToJSON,
ListFrontends200ResponseInnerFromJSON, ListFrontends200ResponseInnerFromJSON,
@ -98,8 +101,8 @@ export interface DeleteFrontendRequest {
body?: CreateFrontend201Response; body?: CreateFrontend201Response;
} }
export interface DeleteIdentityRequest { export interface DeleteIdentityOperationRequest {
body?: CreateIdentityRequest; body?: DeleteIdentityRequest;
} }
export interface DeleteOrganizationRequest { 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 queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {}; const headerParameters: runtime.HTTPHeaders = {};
@ -367,7 +370,7 @@ export class AdminApi extends runtime.BaseAPI {
method: 'DELETE', method: 'DELETE',
headers: headerParameters, headers: headerParameters,
query: queryParameters, query: queryParameters,
body: CreateIdentityRequestToJSON(requestParameters['body']), body: DeleteIdentityRequestToJSON(requestParameters['body']),
}, initOverrides); }, initOverrides);
return new runtime.VoidApiResponse(response); 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); await this.deleteIdentityRaw(requestParameters, initOverrides);
} }

View 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'],
};
}

View File

@ -13,6 +13,7 @@ export * from './CreateIdentity201Response';
export * from './CreateIdentityRequest'; export * from './CreateIdentityRequest';
export * from './CreateOrganization201Response'; export * from './CreateOrganization201Response';
export * from './CreateOrganizationRequest'; export * from './CreateOrganizationRequest';
export * from './DeleteIdentityRequest';
export * from './DisableRequest'; export * from './DisableRequest';
export * from './EnableRequest'; export * from './EnableRequest';
export * from './Enroll200Response'; export * from './Enroll200Response';

View File

@ -17,6 +17,7 @@ docs/CreateIdentity201Response.md
docs/CreateIdentityRequest.md docs/CreateIdentityRequest.md
docs/CreateOrganization201Response.md docs/CreateOrganization201Response.md
docs/CreateOrganizationRequest.md docs/CreateOrganizationRequest.md
docs/DeleteIdentityRequest.md
docs/DisableRequest.md docs/DisableRequest.md
docs/EnableRequest.md docs/EnableRequest.md
docs/Enroll200Response.md docs/Enroll200Response.md
@ -89,6 +90,7 @@ test/test_create_identity201_response.py
test/test_create_identity_request.py test/test_create_identity_request.py
test/test_create_organization201_response.py test/test_create_organization201_response.py
test/test_create_organization_request.py test/test_create_organization_request.py
test/test_delete_identity_request.py
test/test_disable_request.py test/test_disable_request.py
test/test_enable_request.py test/test_enable_request.py
test/test_enroll200_response.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_identity_request.py
zrok_api/models/create_organization201_response.py zrok_api/models/create_organization201_response.py
zrok_api/models/create_organization_request.py zrok_api/models/create_organization_request.py
zrok_api/models/delete_identity_request.py
zrok_api/models/disable_request.py zrok_api/models/disable_request.py
zrok_api/models/enable_request.py zrok_api/models/enable_request.py
zrok_api/models/enroll200_response.py zrok_api/models/enroll200_response.py

View File

@ -167,6 +167,7 @@ Class | Method | HTTP request | Description
- [CreateIdentityRequest](docs/CreateIdentityRequest.md) - [CreateIdentityRequest](docs/CreateIdentityRequest.md)
- [CreateOrganization201Response](docs/CreateOrganization201Response.md) - [CreateOrganization201Response](docs/CreateOrganization201Response.md)
- [CreateOrganizationRequest](docs/CreateOrganizationRequest.md) - [CreateOrganizationRequest](docs/CreateOrganizationRequest.md)
- [DeleteIdentityRequest](docs/DeleteIdentityRequest.md)
- [DisableRequest](docs/DisableRequest.md) - [DisableRequest](docs/DisableRequest.md)
- [EnableRequest](docs/EnableRequest.md) - [EnableRequest](docs/EnableRequest.md)
- [Enroll200Response](docs/Enroll200Response.md) - [Enroll200Response](docs/Enroll200Response.md)

View File

@ -567,7 +567,7 @@ void (empty response body)
```python ```python
import zrok_api 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 zrok_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -592,7 +592,7 @@ configuration.api_key['key'] = os.environ["API_KEY"]
with zrok_api.ApiClient(configuration) as api_client: with zrok_api.ApiClient(configuration) as api_client:
# Create an instance of the API class # Create an instance of the API class
api_instance = zrok_api.AdminApi(api_client) api_instance = zrok_api.AdminApi(api_client)
body = zrok_api.CreateIdentityRequest() # CreateIdentityRequest | (optional) body = zrok_api.DeleteIdentityRequest() # DeleteIdentityRequest | (optional)
try: try:
api_instance.delete_identity(body=body) api_instance.delete_identity(body=body)
@ -607,7 +607,7 @@ with zrok_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**CreateIdentityRequest**](CreateIdentityRequest.md)| | [optional] **body** | [**DeleteIdentityRequest**](DeleteIdentityRequest.md)| | [optional]
### Return type ### Return type

View 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)

View 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()

View File

@ -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_identity_request import CreateIdentityRequest
from zrok_api.models.create_organization201_response import CreateOrganization201Response from zrok_api.models.create_organization201_response import CreateOrganization201Response
from zrok_api.models.create_organization_request import CreateOrganizationRequest 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.disable_request import DisableRequest
from zrok_api.models.enable_request import EnableRequest from zrok_api.models.enable_request import EnableRequest
from zrok_api.models.enroll200_response import Enroll200Response from zrok_api.models.enroll200_response import Enroll200Response

View File

@ -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_identity_request import CreateIdentityRequest
from zrok_api.models.create_organization201_response import CreateOrganization201Response from zrok_api.models.create_organization201_response import CreateOrganization201Response
from zrok_api.models.create_organization_request import CreateOrganizationRequest 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.invite_token_generate_request import InviteTokenGenerateRequest
from zrok_api.models.list_frontends200_response_inner import ListFrontends200ResponseInner from zrok_api.models.list_frontends200_response_inner import ListFrontends200ResponseInner
from zrok_api.models.list_organization_members200_response import ListOrganizationMembers200Response from zrok_api.models.list_organization_members200_response import ListOrganizationMembers200Response
@ -1989,7 +1990,7 @@ class AdminApi:
@validate_call @validate_call
def delete_identity( def delete_identity(
self, self,
body: Optional[CreateIdentityRequest] = None, body: Optional[DeleteIdentityRequest] = None,
_request_timeout: Union[ _request_timeout: Union[
None, None,
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)],
@ -2007,7 +2008,7 @@ class AdminApi:
:param body: :param body:
:type body: CreateIdentityRequest :type body: DeleteIdentityRequest
:param _request_timeout: timeout setting for this request. If one :param _request_timeout: timeout setting for this request. If one
number provided, it will be total request number provided, it will be total request
timeout. It can also be a pair (tuple) of timeout. It can also be a pair (tuple) of
@ -2058,7 +2059,7 @@ class AdminApi:
@validate_call @validate_call
def delete_identity_with_http_info( def delete_identity_with_http_info(
self, self,
body: Optional[CreateIdentityRequest] = None, body: Optional[DeleteIdentityRequest] = None,
_request_timeout: Union[ _request_timeout: Union[
None, None,
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)],
@ -2076,7 +2077,7 @@ class AdminApi:
:param body: :param body:
:type body: CreateIdentityRequest :type body: DeleteIdentityRequest
:param _request_timeout: timeout setting for this request. If one :param _request_timeout: timeout setting for this request. If one
number provided, it will be total request number provided, it will be total request
timeout. It can also be a pair (tuple) of timeout. It can also be a pair (tuple) of
@ -2127,7 +2128,7 @@ class AdminApi:
@validate_call @validate_call
def delete_identity_without_preload_content( def delete_identity_without_preload_content(
self, self,
body: Optional[CreateIdentityRequest] = None, body: Optional[DeleteIdentityRequest] = None,
_request_timeout: Union[ _request_timeout: Union[
None, None,
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)],
@ -2145,7 +2146,7 @@ class AdminApi:
:param body: :param body:
:type body: CreateIdentityRequest :type body: DeleteIdentityRequest
:param _request_timeout: timeout setting for this request. If one :param _request_timeout: timeout setting for this request. If one
number provided, it will be total request number provided, it will be total request
timeout. It can also be a pair (tuple) of timeout. It can also be a pair (tuple) of

View File

@ -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_identity_request import CreateIdentityRequest
from zrok_api.models.create_organization201_response import CreateOrganization201Response from zrok_api.models.create_organization201_response import CreateOrganization201Response
from zrok_api.models.create_organization_request import CreateOrganizationRequest 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.disable_request import DisableRequest
from zrok_api.models.enable_request import EnableRequest from zrok_api.models.enable_request import EnableRequest
from zrok_api.models.enroll200_response import Enroll200Response from zrok_api.models.enroll200_response import Enroll200Response

View 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

View File

@ -436,7 +436,7 @@ paths:
in: body in: body
schema: schema:
properties: properties:
name: zId:
type: string type: string
responses: responses:
200: 200:

View File

@ -20,6 +20,7 @@ models/CreateIdentity201Response.ts
models/CreateIdentityRequest.ts models/CreateIdentityRequest.ts
models/CreateOrganization201Response.ts models/CreateOrganization201Response.ts
models/CreateOrganizationRequest.ts models/CreateOrganizationRequest.ts
models/DeleteIdentityRequest.ts
models/DisableRequest.ts models/DisableRequest.ts
models/EnableRequest.ts models/EnableRequest.ts
models/Enroll200Response.ts models/Enroll200Response.ts

View File

@ -23,6 +23,7 @@ import type {
CreateIdentityRequest, CreateIdentityRequest,
CreateOrganization201Response, CreateOrganization201Response,
CreateOrganizationRequest, CreateOrganizationRequest,
DeleteIdentityRequest,
InviteTokenGenerateRequest, InviteTokenGenerateRequest,
ListFrontends200ResponseInner, ListFrontends200ResponseInner,
ListOrganizationMembers200Response, ListOrganizationMembers200Response,
@ -50,6 +51,8 @@ import {
CreateOrganization201ResponseToJSON, CreateOrganization201ResponseToJSON,
CreateOrganizationRequestFromJSON, CreateOrganizationRequestFromJSON,
CreateOrganizationRequestToJSON, CreateOrganizationRequestToJSON,
DeleteIdentityRequestFromJSON,
DeleteIdentityRequestToJSON,
InviteTokenGenerateRequestFromJSON, InviteTokenGenerateRequestFromJSON,
InviteTokenGenerateRequestToJSON, InviteTokenGenerateRequestToJSON,
ListFrontends200ResponseInnerFromJSON, ListFrontends200ResponseInnerFromJSON,
@ -98,8 +101,8 @@ export interface DeleteFrontendRequest {
body?: CreateFrontend201Response; body?: CreateFrontend201Response;
} }
export interface DeleteIdentityRequest { export interface DeleteIdentityOperationRequest {
body?: CreateIdentityRequest; body?: DeleteIdentityRequest;
} }
export interface DeleteOrganizationRequest { 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 queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {}; const headerParameters: runtime.HTTPHeaders = {};
@ -367,7 +370,7 @@ export class AdminApi extends runtime.BaseAPI {
method: 'DELETE', method: 'DELETE',
headers: headerParameters, headers: headerParameters,
query: queryParameters, query: queryParameters,
body: CreateIdentityRequestToJSON(requestParameters['body']), body: DeleteIdentityRequestToJSON(requestParameters['body']),
}, initOverrides); }, initOverrides);
return new runtime.VoidApiResponse(response); 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); await this.deleteIdentityRaw(requestParameters, initOverrides);
} }

View 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'],
};
}

View File

@ -13,6 +13,7 @@ export * from './CreateIdentity201Response';
export * from './CreateIdentityRequest'; export * from './CreateIdentityRequest';
export * from './CreateOrganization201Response'; export * from './CreateOrganization201Response';
export * from './CreateOrganizationRequest'; export * from './CreateOrganizationRequest';
export * from './DeleteIdentityRequest';
export * from './DisableRequest'; export * from './DisableRequest';
export * from './EnableRequest'; export * from './EnableRequest';
export * from './Enroll200Response'; export * from './Enroll200Response';