Skip to content

openziti-test-kitchen/openziti-edge-client-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

openziti-edge-client

OpenZiti Edge Client API

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.25.31
  • Package version: 0.25.33
  • Build package: org.openapitools.codegen.languages.PythonPriorClientCodegen For more information, please visit https://openziti.discourse.group

Requirements.

Python >=3.6

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/openziti-test-kitchen/openziti-edge-client-python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/openziti-test-kitchen/openziti-edge-client-python.git)

Then import the package:

import openziti_edge_client

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import openziti_edge_client

Getting Started

Please follow the installation procedure and then run the following:

import time
import openziti_edge_client
from pprint import pprint
from openziti_edge_client.api import authentication_api
from openziti_edge_client.model.api_error_envelope import ApiErrorEnvelope
from openziti_edge_client.model.authenticate import Authenticate
from openziti_edge_client.model.current_api_session_detail_envelope import CurrentApiSessionDetailEnvelope
from openziti_edge_client.model.empty import Empty
from openziti_edge_client.model.mfa_code import MfaCode
# Defining the host is optional and defaults to https://demo.ziti.dev/edge/client/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = openziti_edge_client.Configuration(
    host = "https://demo.ziti.dev/edge/client/v1"
)



# Enter a context with an instance of the API client
with openziti_edge_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = authentication_api.AuthenticationApi(api_client)
    method = "password" # str | 
    auth = Authenticate(
        config_types=ConfigTypes([
            "config_types_example",
        ]),
        env_info=EnvInfo(
            arch="arch_example",
            os="os_example",
            os_release="os_release_example",
            os_version="os_version_example",
        ),
        password=Password("password_example"),
        sdk_info=SdkInfo(
            app_id="app_id_example",
            app_version="app_version_example",
            branch="branch_example",
            revision="revision_example",
            type="type_example",
            version="version_example",
        ),
        username=Username("username_example"),
    ) # Authenticate |  (optional)

    try:
        # Authenticate via a method supplied via a query string parameter
        api_response = api_instance.authenticate(method, auth=auth)
        pprint(api_response)
    except openziti_edge_client.ApiException as e:
        print("Exception when calling AuthenticationApi->authenticate: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://demo.ziti.dev/edge/client/v1

Class Method HTTP request Description
AuthenticationApi authenticate POST /authenticate Authenticate via a method supplied via a query string parameter
AuthenticationApi authenticate_mfa POST /authenticate/mfa Complete MFA authentication
CurrentAPISessionApi create_current_api_session_certificate POST /current-api-session/certificates Creates an ephemeral certificate for the current API Session
CurrentAPISessionApi current_api_session_delete DELETE /current-api-session Logout
CurrentAPISessionApi delete_current_api_session_certificate DELETE /current-api-session/certificates/{id} Delete an ephemeral certificate
CurrentAPISessionApi detail_current_api_session_certificate GET /current-api-session/certificates/{id} Retrieves an ephemeral certificate
CurrentAPISessionApi detail_current_identity_authenticator GET /current-identity/authenticators/{id} Retrieve an authenticator for the current identity
CurrentAPISessionApi extend_current_identity_authenticator POST /current-identity/authenticators/{id}/extend Allows the current identity to recieve a new certificate associated with a certificate based authenticator
CurrentAPISessionApi extend_verify_current_identity_authenticator POST /current-identity/authenticators/{id}/extend-verify Allows the current identity to validate reciept of a new client certificate
CurrentAPISessionApi get_current_api_session GET /current-api-session Return the current API session
CurrentAPISessionApi list_current_api_session_certificates GET /current-api-session/certificates List the ephemeral certificates available for the current API Session
CurrentAPISessionApi list_current_identity_authenticators GET /current-identity/authenticators List authenticators for the current identity
CurrentAPISessionApi list_service_updates GET /current-api-session/service-updates Returns data indicating whether a client should updates it service list
CurrentAPISessionApi patch_current_identity_authenticator PATCH /current-identity/authenticators/{id} Update the supplied fields on an authenticator of this identity
CurrentAPISessionApi update_current_identity_authenticator PUT /current-identity/authenticators/{id} Update all fields on an authenticator of this identity
CurrentIdentityApi create_mfa_recovery_codes POST /current-identity/mfa/recovery-codes For a completed MFA enrollment regenerate the recovery codes
CurrentIdentityApi delete_mfa DELETE /current-identity/mfa Disable MFA for the current identity
CurrentIdentityApi detail_mfa GET /current-identity/mfa Returns the current status of MFA enrollment
CurrentIdentityApi detail_mfa_qr_code GET /current-identity/mfa/qr-code Show a QR code for unverified MFA enrollments
CurrentIdentityApi detail_mfa_recovery_codes GET /current-identity/mfa/recovery-codes For a completed MFA enrollment view the current recovery codes
CurrentIdentityApi enroll_mfa POST /current-identity/mfa Initiate MFA enrollment
CurrentIdentityApi get_current_identity GET /current-identity Return the current identity
CurrentIdentityApi get_current_identity_edge_routers GET /current-identity/edge-routers Return this list of Edge Routers the identity has access to
CurrentIdentityApi verify_mfa POST /current-identity/mfa/verify Complete MFA enrollment by verifying a time based one time token
EdgeRouterApi get_current_identity_edge_routers GET /current-identity/edge-routers Return this list of Edge Routers the identity has access to
EnrollApi enroll POST /enroll Enroll an identity via one-time-token
EnrollApi enroll_ca POST /enroll/ca Enroll an identity with a pre-exchanged certificate
EnrollApi enroll_er_ott POST /enroll/erott Enroll an edge-router
EnrollApi enroll_ott POST /enroll/ott Enroll an identity via one-time-token
EnrollApi enroll_ott_ca POST /enroll/ottca Enroll an identity via one-time-token with a pre-exchanged client certificate
EnrollApi ernoll_updb POST /enroll/updb Enroll an identity via one-time-token
EnrollApi extend_current_identity_authenticator POST /current-identity/authenticators/{id}/extend Allows the current identity to recieve a new certificate associated with a certificate based authenticator
EnrollApi extend_router_enrollment POST /enroll/extend/router Extend the life of a currently enrolled router's certificates
EnrollApi extend_verify_current_identity_authenticator POST /current-identity/authenticators/{id}/extend-verify Allows the current identity to validate reciept of a new client certificate
ExtendEnrollmentApi extend_current_identity_authenticator POST /current-identity/authenticators/{id}/extend Allows the current identity to recieve a new certificate associated with a certificate based authenticator
ExtendEnrollmentApi extend_router_enrollment POST /enroll/extend/router Extend the life of a currently enrolled router's certificates
ExtendEnrollmentApi extend_verify_current_identity_authenticator POST /current-identity/authenticators/{id}/extend-verify Allows the current identity to validate reciept of a new client certificate
ExternalJWTSignerApi list_external_jwt_signers GET /external-jwt-signers List Client Authentication External JWT
InformationalApi detail_spec GET /specs/{id} Return a single spec resource
InformationalApi detail_spec_body GET /specs/{id}/spec Returns the spec's file
InformationalApi list_protocols GET /protocols Return a list of the listening Edge protocols
InformationalApi list_root GET / Returns version information
InformationalApi list_specs GET /specs Returns a list of API specs
InformationalApi list_version GET /version Returns version information
MFAApi authenticate_mfa POST /authenticate/mfa Complete MFA authentication
MFAApi create_mfa_recovery_codes POST /current-identity/mfa/recovery-codes For a completed MFA enrollment regenerate the recovery codes
MFAApi delete_mfa DELETE /current-identity/mfa Disable MFA for the current identity
MFAApi detail_mfa GET /current-identity/mfa Returns the current status of MFA enrollment
MFAApi detail_mfa_qr_code GET /current-identity/mfa/qr-code Show a QR code for unverified MFA enrollments
MFAApi detail_mfa_recovery_codes GET /current-identity/mfa/recovery-codes For a completed MFA enrollment view the current recovery codes
MFAApi enroll_mfa POST /current-identity/mfa Initiate MFA enrollment
MFAApi verify_mfa POST /current-identity/mfa/verify Complete MFA enrollment by verifying a time based one time token
PostureChecksApi create_posture_response POST /posture-response Submit a posture response to a posture query
PostureChecksApi create_posture_response_bulk POST /posture-response-bulk Submit multiple posture responses
ServiceApi delete_service DELETE /services/{id} Delete a service
ServiceApi detail_service GET /services/{id} Retrieves a single service
ServiceApi list_service_terminators GET /services/{id}/terminators List of terminators assigned to a service
ServiceApi list_services GET /services List services
ServiceApi patch_service PATCH /services/{id} Update the supplied fields on a service
ServiceApi update_service PUT /services/{id} Update all fields on a service
ServicesApi list_service_updates GET /current-api-session/service-updates Returns data indicating whether a client should updates it service list
SessionApi create_session POST /sessions Create a session resource
SessionApi delete_session DELETE /sessions/{id} Delete a session
SessionApi detail_session GET /sessions/{id} Retrieves a single session
SessionApi list_sessions GET /sessions List sessions
WellKnownApi list_well_known_cas GET /.well-known/est/cacerts Get CA Cert Store

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

oauth2

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: /oidc/authorize
  • Scopes:
  • openid: openid

ztSession

  • Type: API key
  • API key parameter name: zt-session
  • Location: HTTP header

Author

[email protected]

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in openziti_edge_client.apis and openziti_edge_client.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from openziti_edge_client.api.default_api import DefaultApi
  • from openziti_edge_client.model.pet import Pet

Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import openziti_edge_client
from openziti_edge_client.apis import *
from openziti_edge_client.models import *

About

Python Library Implementing the OpenZiti Edge Client API

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published