Skip to main content

该项目用于将url经过base64转码后可以安全的在http请求参数中传输

encode-decode 过程

原始链接的encode和decode对应方法

from longbao_urllib import UrlEnvelop
import time

host = "http://localhost:8000"
# 创建一个url信封,compress用于对参数进行压缩
wrapper = UrlEnvelop(
        f"{host}/api/ad/callback?q1=123&q2=234&q3=456&q4=78911",
        compress=True,
    )
# 返回可以放在query中的参数
raw = wrapper.url_encode(
        f"{host}/api/ad/mock/kuaishou/callback?cid=123&pid=xyzxxxxxxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyyyyxxxxxxxxxxxxxxxxxxxxxxxx",
        clickid="xx-yy-zz")


decoded_url = wrapper.url_decode(raw, conv_type=1, conv_ts=time.time(), clickid="xx-yy-zz")

参数 wrap-upwrap 过程

from longbao_urllib import UrlEnvelop

host = "http://localhost:8000"
wrapper = UrlEnvelop(
        f"{host}/api/ad/callback?q1=123&q2=234&q3=456&q4=78911",
        compress=True,
    )
# 将原始链接包裹后的新的链接
url1 = wrapper.wrap(
    f"{host}/api/ad/mock/kuaishou/callback?callback=123&pid=xyz",
    request_id="xx-yy-zz",
)
# 打开后返回原始的链接
url2 = wrapper.unwrap(
    url1,
    request_id="xx-yy-ww",
)

Metadata

Release files for longbao-urllib 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for longbao-urllib 0.2.0
File Size Uploaded Provenance Actions
longbao_urllib-0.2.0.tar.gz 4.9 kB Without provenance Details for longbao_urllib-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for longbao-urllib 0.2.0
File Interpreter ABI Platform Actions
longbao_urllib-0.2.0-py3-none-any.whl Python 3 none any Details for longbao_urllib-0.2.0-py3-none-any.whl

Total release size: 8.2 kB

Release files / longbao_urllib-0.2.0.tar.gz

Download URL longbao_urllib-0.2.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d34a45e54f50e04a87ae85bc2c2df0d8e95af57e0b7d489eca2f5706a94780a2
BLAKE2b-256 checksum
How to use checksums
2ad303b4a8149053eb8b5b2345f89eb8b984c1152a7cf9264eef5b4eff61602a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / longbao_urllib-0.2.0-py3-none-any.whl

Download URL longbao_urllib-0.2.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ed05bd3bcfe40d3da1daf4727a9c546658230c7f3402e5c13594c5e5dc7814c
BLAKE2b-256 checksum
How to use checksums
beacdefbd1ba363fa28481247c073bb951f02031739c0d550776b93fbda605d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for longbao-urllib 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page