Closed github-actions[bot] closed 7 months ago
I think implementing it as auth in TSOA is fine as it's really only internal. Or do you also dislike that?
Or is it the header? I do think a header is the simplest approach but I'm open to other solutions.
Please let me know which parts you don't like (x-tenant-id header, using tsoa authentication logic for this (which is used internally), or the security mention in the swagger UI). Because all of them can be solved independently of the others
I think implementing it as auth in TSOA is fine as it's really only internal. Or do you also dislike that?
Or is it the header? I do think a header is the simplest approach but I'm open to other solutions.
Please let me know which parts you don't like (x-tenant-id header, using tsoa authentication logic for this (which is used internally), or the security mention in the swagger UI). Because all of them can be solved independently of the others
Yeah using the parameter from the header is absolutely fine. I was referring mostly to the fact of calling it 'auth' because it can lead to some confusions, like the question raised by Warren when you presented this in last Credo contributors call.
In practice, as you say, it is just something noticeable in Swagger UI, so it's not that important. Maybe the tenants header could be handled by a @Middleware
, but I don't know if it will be easily possible to specify the header parameter in all routes as it is when using securityDefinitions
.
@genaris I've made improvements in #263, please let me know what you think! I can make ammendments in a follow up version if you would like to see it differently. The behaviour in general stays the same: x-tenant-id header to specify which tenant. But we can tweak how it's shown in SwaggerUI/openapi.json as well as how it works internally (kept it as authentication for now as it applies perfectly for what we're trying to do)
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 57.95%. Comparing base (
658cadc
) to head (2aa6451
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:robot: Release is at https://github.com/openwallet-foundation/credo-ts-ext/releases/tag/rest-v0.10.0 :sunflower:
Nicely done, @TimoGlastra !
:robot: I have created a release *beep* *boop*
0.10.0 (2024-03-31)
⚠ BREAKING CHANGES
Features
Bug Fixes
Miscellaneous Chores
update to credo 0.5 (#239) (16e44ec)
This PR was generated with Release Please. See documentation.