Documentation
¶
Index ¶
- type Option
- func WithLogger(l log.Logger) Option
- func WithRevaGatewaySelector(selectable pool.Selectable[gateway.GatewayAPIClient]) Option
- func WithRoleMapping(roleMap []config.RoleMapping) Option
- func WithRoleService(rs settingssvc.RoleService) Option
- func WithRolesClaim(claim string) Option
- func WithServiceAccount(c config.ServiceAccount) Option
- type Options
- type UserRoleAssigner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(o *Options)
Option defines a single option function.
func WithRevaGatewaySelector ¶
func WithRevaGatewaySelector(selectable pool.Selectable[gateway.GatewayAPIClient]) Option
WithRevaGatewaySelector set the gatewaySelector option
func WithRoleMapping ¶
func WithRoleMapping(roleMap []config.RoleMapping) Option
WithRoleMapping configures the map of OpenCloud role names to claims values
func WithRoleService ¶
func WithRoleService(rs settingssvc.RoleService) Option
WithRoleService sets the roleservice instance to use
func WithRolesClaim ¶
WithRolesClaim sets the OIDC claim for looking up role names
func WithServiceAccount ¶
func WithServiceAccount(c config.ServiceAccount) Option
WithServiceAccount configures the service account creator to use
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options defines the available options for this package.
type UserRoleAssigner ¶
type UserRoleAssigner interface {
// UpdateUserRoleAssignment is called by the account resolver middleware. It updates the user's role assignment
// based on the user's (OIDC) claims. It adds the user's roles to the opaque data of the cs3.User struct
UpdateUserRoleAssignment(ctx context.Context, user *cs3.User, claims map[string]interface{}) (*cs3.User, error)
// ApplyUserRole can be called by proxy middlewares, it looks up the user's roles and adds them
// the users "roles" key in the user's opaque data
ApplyUserRole(ctx context.Context, user *cs3.User) (*cs3.User, error)
}
UserRoleAssigner allows providing different implementations for how users get their default roles assigned by the proxy during authentication
func NewDefaultRoleAssigner ¶
func NewDefaultRoleAssigner(opts ...Option) UserRoleAssigner
NewDefaultRoleAssigner returns an implementation of the UserRoleAssigner interface
func NewOIDCRoleAssigner ¶
func NewOIDCRoleAssigner(opts ...Option) UserRoleAssigner
NewOIDCRoleAssigner returns an implementation of the UserRoleAssigner interface