Buckets:

download
raw
860 Bytes
import asyncio
import os
from keyshield import ApiKeyService
from keyshield.hasher.argon2 import Argon2ApiKeyHasher
from keyshield.repositories.in_memory import InMemoryApiKeyRepository
# Set env var to override default pepper
# Using a strong, unique pepper is crucial for security
# Default pepper is insecure and should not be used in production
pepper = os.getenv("SECRET_PEPPER")
hasher = Argon2ApiKeyHasher(pepper=pepper)
# default hasher is Argon2 with a default pepper (to be changed in prod)
repo = InMemoryApiKeyRepository()
service = ApiKeyService(
repo=repo,
hasher=hasher,
)
async def main():
entity, api_key = await service.create(name="development")
print("Give this secret to the client:", api_key)
verified = await service.verify_key(api_key)
print("Verified key belongs to:", verified.id_)
asyncio.run(main())

Xet Storage Details

Size:
860 Bytes
·
Xet hash:
264e20604f9c3ca412a94a6add87ae49805460203723b8392ac7fa86b3a2f872

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.