refactor/idiomatic-handlers-middlewares #25

Merged
xdrm-brackets merged 7 commits from refactor/idiomatic-handlers-middlewares into 0.4.0 2021-06-20 08:26:28 +00:00

7 Commits

Author SHA1 Message Date
Adrien Marquès fd1ced5a8b
fix: restore request denied on invalid auth after contextual middlwares
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2021-06-20 10:24:12 +02:00
Adrien Marquès 97941da901
docs: update README for context.Context and middlewares
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2021-06-20 02:16:24 +02:00
Adrien Marquès af63c4514b
refactor: idiomatic remove of api.Context for context.Context, custom middlewares for standard http middlewares
continuous-integration/drone/push Build is passing Details
- remove api.Context as using context.Context is more idiomatic
 - remove api.Adapter as it is redundant with func(http.Handler) http.Handler
 - remove authentication middlewares as they be achieved as normal middlewares but launched around the handler (after the service has been found and validated)
 - builder.With() adds an standard Middleware that runs before any aicra code
 - builder.WithContext() adds an http middleware that runs just before the service handler is called. The http.Request provided contains a context with useful values such as the required permissions (from the service configuration).
 - handlers take a context.Context variable as first argument instead of api.Context
2021-06-20 02:14:31 +02:00
Adrien Marquès 6a78351a2c
doc: update README for *api.Context handler argument 2021-06-20 00:56:25 +02:00
Adrien Marquès 53dfc8f679
feat: *api.Context is required as first handler argument
continuous-integration/drone/push Build is passing Details
2021-06-20 00:47:04 +02:00
Adrien Marquès ed404106f2
refactor: rename api.Ctx to api.Context, extends context.Context with helper methods 2021-06-20 00:46:42 +02:00
Adrien Marquès fa1ecfd97f
feat: create internal context.Context custom keys 2021-06-20 00:46:04 +02:00