mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 15:22:47 +01:00
@@ -11,8 +11,8 @@ import (
|
||||
type Hooks struct {
|
||||
DatabaseAfterConnectFuncs []func(ctx context.Context, client driver.Client, name string)
|
||||
IngestionFilterFunc func(ctx context.Context, index *index.Index) (string, error)
|
||||
TicketReadFilterFunc func(ctx context.Context) (string, map[string]interface{}, error)
|
||||
TicketWriteFilterFunc func(ctx context.Context) (string, map[string]interface{}, error)
|
||||
TicketReadFilterFunc func(ctx context.Context) (string, map[string]any, error)
|
||||
TicketWriteFilterFunc func(ctx context.Context) (string, map[string]any, error)
|
||||
GetGroupsFunc func(ctx context.Context, username string) ([]string, error)
|
||||
}
|
||||
|
||||
@@ -26,20 +26,23 @@ func (h *Hooks) IngestionFilter(ctx context.Context, index *index.Index) (string
|
||||
if h.IngestionFilterFunc != nil {
|
||||
return h.IngestionFilterFunc(ctx, index)
|
||||
}
|
||||
|
||||
return "[]", nil
|
||||
}
|
||||
|
||||
func (h *Hooks) TicketReadFilter(ctx context.Context) (string, map[string]interface{}, error) {
|
||||
func (h *Hooks) TicketReadFilter(ctx context.Context) (string, map[string]any, error) {
|
||||
if h.TicketReadFilterFunc != nil {
|
||||
return h.TicketReadFilterFunc(ctx)
|
||||
}
|
||||
|
||||
return "", nil, nil
|
||||
}
|
||||
|
||||
func (h *Hooks) TicketWriteFilter(ctx context.Context) (string, map[string]interface{}, error) {
|
||||
func (h *Hooks) TicketWriteFilter(ctx context.Context) (string, map[string]any, error) {
|
||||
if h.TicketWriteFilterFunc != nil {
|
||||
return h.TicketWriteFilterFunc(ctx)
|
||||
}
|
||||
|
||||
return "", nil, nil
|
||||
}
|
||||
|
||||
@@ -47,5 +50,6 @@ func (h *Hooks) GetGroups(ctx context.Context, username string) ([]string, error
|
||||
if h.GetGroupsFunc != nil {
|
||||
return h.GetGroupsFunc(ctx, username)
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user