omi icon indicating copy to clipboard operation
omi copied to clipboard

fix: openapi docs authorization

Open theedigerati opened this issue 8 months ago • 5 comments

Add HTTPBearer Authorization to OpenAPI docs.

  • [x] id_token authorization for all protected endpoints.
  • [x] api_key authorization for app integration endpoints.

omi-docs-auth

theedigerati avatar Apr 10 '25 15:04 theedigerati

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

@theedigerati

beastoin avatar Apr 14 '25 11:04 beastoin

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.

theedigerati avatar Apr 14 '25 16:04 theedigerati

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 avatar Apr 21 '25 09:04 beastoin

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

beastoin avatar Apr 21 '25 09:04 beastoin

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?

theedigerati avatar Apr 22 '25 22:04 theedigerati

cool man, lets us verify it a bit then will let you know / @mdmohsin7 could you please help on testing it :)

beastoin avatar May 09 '25 11:05 beastoin

Closing due to inactivity @theedigerati, pls feel free to open it again when you push the fixes

mdmohsin7 avatar May 19 '25 00:05 mdmohsin7