Skip to content

Latest commit

 

History

History
209 lines (130 loc) · 9.27 KB

README.md

File metadata and controls

209 lines (130 loc) · 9.27 KB

AccessControl

(access_control)

Overview

Operations related to access control/signing keys api

Available Operations

  • create - Create a signing key
  • get_all - Retrieves signing keys
  • delete - Delete Signing Key
  • get - Retrieves a signing key
  • update - Update a signing key

create

The publicKey is a representation of the public key, encoded as base 64 and is passed as a string, and the privateKey is displayed only on creation. This is the only moment where the client can save the private key, otherwise it will be lost. Remember to decode your string when signing JWTs. Up to 10 signing keys can be generated, after that you must delete at least one signing key to create a new one.

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.access_control.create()

if res.signing_key is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.CreateSigningKeyResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

get_all

Retrieves signing keys

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.access_control.get_all()

if res.data is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetSigningKeysResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

delete

Delete Signing Key

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.access_control.delete(key_id="<value>")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
key_id str ✔️ ID of the signing key
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteSigningKeyResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

get

Retrieves a signing key

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.access_control.get(key_id="<value>")

if res.signing_key is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
key_id str ✔️ ID of the signing key
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetSigningKeyResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

update

Update a signing key

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.access_control.update(key_id="<value>", request_body={})

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
key_id str ✔️ ID of the signing key
request_body operations.UpdateSigningKeyRequestBody ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.UpdateSigningKeyResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /