Unstructured-IO / unstructured-api

Apache License 2.0
489 stars 102 forks source link

feat: add support for API key validation for self-hosted #322

Closed omikader closed 9 months ago

omikader commented 9 months ago

This PR gives people the ability to use the API key header to validate requests when self-hosting Unstructured. If the optional environment variable of UNSTRUCTURED_API_KEY does not match the request header of unstructured-api-key, then we fail with a 401 response instead of fulfilling the request.

This will allow people to self-host unstructured with confidence that only internal applications that have access to the shared key can use the service.

Closes https://github.com/Unstructured-IO/unstructured-api/issues/321

awalker4 commented 9 months ago

Thanks for the PR! This certainly makes sense. A few things:

omikader commented 9 months ago

@awalker4 all set! Thanks for the quick review. Let me know if there's anything else you'd like to see before merging 🙂

awalker4 commented 9 months ago

Final thing - can you bump the version to 0.0.60 in the changelog? You can run make version-sync to bump all the relevant files. Thanks!