warrant-dev / warrant

Warrant is a highly scalable, centralized authorization service based on Google Zanzibar. Use it to define, enforce, query, and audit application authorization and access control.
https://warrant.dev
Apache License 2.0
1.15k stars 43 forks source link

Add wookie middleware #232

Closed stanleyphu closed 1 year ago

stanleyphu commented 1 year ago

Describe your changes

This PR renames the existing wookie middleware and a new wookie middleware (WookieMiddleware) which fetches the wookie token and sets it in the request context.

The current wookie middlename is renamed from WookieMiddleware to WarrantTokenMiddleware and simply sets the Warrant-Token header value in context. This allows queries to be handled appropriately by either the reader or writer instance. The new wookie middleware WookieMiddleware can be applied to applicable endpoints and fetches/parses the token and sets it in context.

Issue number and link (if applicable)