New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

oblv-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oblv-client

python bindings for using enclaves with oblivious tooling

0.1.15
PyPI
Maintainers
1

oblv-client-python

Python bindings for oblv client proxy.

Installation

pip install oblv_client

Usage

import oblv_client as oc
import uuid
oc.set_log_level("info")

enc_url = "http://<some-enclave-url>
enc_port = 8000

# For Pkiauth
enclave = oc.Enclave(
        enc_url,
        enc_port,
        True,
        str(uuid.uuid4()),
        pcr0="",
        pcr1="",
        pcr2="",
        private_key="test_private.der",
        public_key="test_public.der",
        auth_type="pkiauth",
    )
enc_public_key = enclave.attest()

# for OAuth
enclave = oc.Enclave(
        enc_url,
        enc_port,
        True,
        str(uuid.uuid4()),
        pcr0="",
        pcr1="",
        pcr2="",
        auth_type="oauth",
        client_id="<client-id>",
        client_secret="<client-secret>",
        oauth_audience=oauth_audience,
        oauth_url=oauth_url
    )

# To attest
access_token = enclave.attest()

# Make HTTP Request
data = e.get(
    f"http://{enc_url}:{enc_port}/get_report",
    headers={"Header1": "HeaderValue"},
    body=bytes("some body contents", "utf-8"),
    params={"param1": "val1"},
    )
status = data.status
headers = data.headers
body = data.body

print(status)
print(headers)
print(body)

data = e.post(
    f"http://{enc_url}:{enc_port}/get_report",
    headers={"Header1": "HeaderValue"},
    params={"param1": "val1"},
    json={"key": "val"}
    )
status = data.status
headers = data.headers
body = data.body

print(status)
print(headers)
print(body)

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts