Skip to content

fix: openapi docs authorization #2182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

theedigerati
Copy link

Add HTTPBearer Authorization to OpenAPI docs.

  • id_token authorization for all protected endpoints.
  • api_key authorization for app integration endpoints.

omi-docs-auth

@beastoin
Copy link
Collaborator

1/ does your changes compatible with the current backend functionalities ?
2/ could you re-base with the main branch ?

@theedigerati

@theedigerati
Copy link
Author

theedigerati commented Apr 14, 2025

1/ does your changes compatible with the current backend functionalities ? 2/ could you re-base with the main branch ?

@theedigerati

Yes, the changes are compatible with the current backend functionalities.

Code changes:

  • A handler (from FastAPI) for authorization headers . This is needed because OpenAPI 3 spec does not allow authorization headers be passed directly to endpoints in the docs
  • Edits on the integration endpoints for api_key extraction from authorization header.

@beastoin
Copy link
Collaborator

beastoin commented Apr 21, 2025

man @theedigerati

just a gentle reminder, you PR is a bit dirty haha. please clean it by reducing the unnecessary changes. (as 2/)

then just share me a bit about your tests (follow up with 1/)

@beastoin
Copy link
Collaborator

@aaravgarg could you help with following up on this ticket, feel free to ask for a merge if you think everything looks good.

@theedigerati
Copy link
Author

man @theedigerati

just a gentle reminder, you PR is a bit dirty haha. please clean it by reducing the unnecessary changes. (as 2/)

then just share me a bit about your tests (follow up with 1/)

Hello @beastoin,

I realised that my default editor formatting obscured the important changes, along with some edits I had intended as improvements. My apologies.

For testing, I used the Swagger docs to try out all the integration endpoints, as well as the ones for creating and enabling an app. Everything worked as expected, which covered the areas where I made changes.

Just curious — is there any particular reason there's no formatter or test suite set up for the Python codebase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants