hooks

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GrantTypeClientCredentials string = "client_credentials"
	GrantTypeJWTBearer         string = "urn:ietf:params:oauth:grant-type:jwt-bearer"
)

Variables

View Source
var ErrInvalidTotalSize = fmt.Errorf("invalid total size")

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(
	service ServiceInterface,
	middleware *AuthMiddleware,
	tracer tracing.TracingInterface,
	monitor monitoring.MonitorInterface,
	logger logging.LoggerInterface,
) *API

func (*API) RegisterEndpoints

func (a *API) RegisterEndpoints(mux *chi.Mux)

type AuthMiddleware

type AuthMiddleware struct {
	// contains filtered or unexported fields
}

func NewAuthMiddleware

func NewAuthMiddleware(token string, tracer tracing.TracingInterface, logger logging.LoggerInterface) *AuthMiddleware

func (*AuthMiddleware) AuthMiddleware

func (m *AuthMiddleware) AuthMiddleware(next http.Handler) http.Handler

type ClientInterface

type ClientInterface interface {
	FetchUserGroups(context.Context, User) ([]string, error)
}

type Record

type Record struct {
	Department string `mapstructure:"Department2__c"`
	Team       string `mapstructure:"fHCM2__Team__c"`
}

type Salesforce

type Salesforce struct {
	// contains filtered or unexported fields
}

func (*Salesforce) FetchUserGroups

func (s *Salesforce) FetchUserGroups(ctx context.Context, user User) ([]string, error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(
	clients []ClientInterface,
	tracer tracing.TracingInterface,
	monitor monitoring.MonitorInterface,
	logger logging.LoggerInterface,
) *Service

func (*Service) FetchUserGroups

func (s *Service) FetchUserGroups(ctx context.Context, user User) ([]string, error)

type ServiceInterface

type ServiceInterface interface {
	FetchUserGroups(context.Context, User) ([]string, error)
}

type User

type User struct {
	SubjectId string
	ClientId  string
	Email     string
}

func NewUserFromHookRequest

func NewUserFromHookRequest(r *oauth2.TokenHookRequest, logger logging.LoggerInterface) *User

func (*User) GetUserId

func (u *User) GetUserId() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL