Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientWrapper ¶
type ClientWrapper interface {
Allowed(ctx context.Context, resource Resource, verb Verb) (bool, error)
}
func NewClientWrapperImpl ¶
func NewClientWrapperImpl(baseUrl string, timeout time.Duration) ClientWrapper
type ClientWrapperImpl ¶
type ClientWrapperImpl struct {
// contains filtered or unexported fields
}
func (*ClientWrapperImpl) Allowed ¶
func (r *ClientWrapperImpl) Allowed(ctx context.Context, resource Resource, verb Verb) (bool, error)
Allowed fetches an access list from RBAC based on RBAC_URL and returns if the xrhid has the `content-sources:*:*` permission xrhid is the identity json structure coded in base64. resource is the content-sources resource which is being requested. verb is the action we are quering, in our case, read or write
type MockClientWrapper ¶
MockClientWrapper is an autogenerated mock type for the ClientWrapper type
func NewMockClientWrapper ¶
func NewMockClientWrapper(t mockConstructorTestingTNewMockClientWrapper) *MockClientWrapper
NewMockClientWrapper creates a new instance of MockClientWrapper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
type PermissionsMap ¶
PermissionsMap Map Method and Path to a RbacEntry
var ServicePermissions *PermissionsMap = NewPermissionsMap()
func NewPermissionsMap ¶
func NewPermissionsMap() *PermissionsMap
func (*PermissionsMap) Add ¶
func (pm *PermissionsMap) Add(method string, path string, res Resource, verb Verb) *PermissionsMap
func (*PermissionsMap) Permission ¶
type Verb ¶
type Verb string
The following constants result from the schema below https://github.com/RedHatInsights/rbac-config/blob/master/schemas/permissions.schema