rond-authz/rond

Add userId inside the rego input

Closed this issue · 3 comments

To get the userId, at the moment I must have it in headers and get it from the headers.
But rond already take it from the header, so we could add it in the InputUser struct to simplify the get of the user id.

Describe the solution you'd like
Add the userId in this struct

rond/core/input.go

Lines 52 to 58 in 67adb74

type InputUser struct {
Properties map[string]interface{} `json:"properties,omitempty"`
Groups []string `json:"groups,omitempty"`
Bindings []types.Binding `json:"bindings,omitempty"`
Roles []types.Role `json:"roles,omitempty"`
ResourcePermissionsMap PermissionsOnResourceMap `json:"resourcePermissionsMap,omitempty"`
}

Describe alternatives you've considered
It's possible at the moment to take it from headers, but it's a duplication from what rond already do.

I'd like to work on it.

Hi @davidebianchi yes, I agree with you; this makes sense and may be useful to folks out there; let's do it!

Thank you @tarunsamanta2k20, it should be pretty straightforward if you want to give it a try just submit a PR :)

I've managed to complete the implementation in a new PR (#232), sorry @tarunsamanta2k20 I saw your PR was stalling and thought it was faster implementing it a new PR, thanks for the attempt anyway :)