Skip to content

Latest commit

 

History

History
160 lines (118 loc) · 4.98 KB

File metadata and controls

160 lines (118 loc) · 4.98 KB

onepanel.core.api.AuthServiceApi

All URIs are relative to http://localhost:8888

Method HTTP request Description
is_authorized POST /apis/v1beta1/auth
is_valid_token POST /apis/v1beta1/auth/token

is_authorized

IsAuthorizedResponse is_authorized(body)

Example

  • Api Key Authentication (Bearer):
from __future__ import print_function
import time
import onepanel.core.api
from onepanel.core.api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8888
# See configuration.py for a list of all supported configuration parameters.
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Bearer
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888",
    api_key = {
        'authorization': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with onepanel.core.api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = onepanel.core.api.AuthServiceApi(api_client)
    body = onepanel.core.api.IsAuthorized() # IsAuthorized | 

    try:
        api_response = api_instance.is_authorized(body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AuthServiceApi->is_authorized: %s\n" % e)

Parameters

Name Type Description Notes
body IsAuthorized

Return type

IsAuthorizedResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/octet-stream

HTTP response details

Status code Description Response headers
200 A successful response. -
0 An unexpected error response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

is_valid_token

IsValidTokenResponse is_valid_token(body)

Example

  • Api Key Authentication (Bearer):
from __future__ import print_function
import time
import onepanel.core.api
from onepanel.core.api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8888
# See configuration.py for a list of all supported configuration parameters.
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Bearer
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888",
    api_key = {
        'authorization': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with onepanel.core.api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = onepanel.core.api.AuthServiceApi(api_client)
    body = onepanel.core.api.IsValidTokenRequest() # IsValidTokenRequest | 

    try:
        api_response = api_instance.is_valid_token(body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AuthServiceApi->is_valid_token: %s\n" % e)

Parameters

Name Type Description Notes
body IsValidTokenRequest

Return type

IsValidTokenResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/octet-stream

HTTP response details

Status code Description Response headers
200 A successful response. -
0 An unexpected error response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]