mirror of
https://github.com/coder/coder.git
synced 2025-07-21 01:28:49 +00:00
chore: merge authorization contexts (#12816)
* chore: merge authorization contexts Instead of 2 auth contexts from apikey and dbauthz, merge them to just use dbauthz. It is annoying to have two. * fixup authorization reference
This commit is contained in:
@ -127,8 +127,8 @@ func TestExtractUserRoles(t *testing.T) {
|
||||
)
|
||||
rtr.Get("/", func(_ http.ResponseWriter, r *http.Request) {
|
||||
roles := httpmw.UserAuthorization(r)
|
||||
require.Equal(t, user.ID.String(), roles.Actor.ID)
|
||||
require.ElementsMatch(t, expRoles, roles.Actor.Roles.Names())
|
||||
require.Equal(t, user.ID.String(), roles.ID)
|
||||
require.ElementsMatch(t, expRoles, roles.Roles.Names())
|
||||
})
|
||||
|
||||
req := httptest.NewRequest("GET", "/", nil)
|
||||
|
Reference in New Issue
Block a user