Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidCiphertext is returned when ciphertext is invalid or corrupted ErrInvalidCiphertext = errors.New("invalid ciphertext") // ErrDecryptionFailed is returned when decryption fails ErrDecryptionFailed = errors.New("decryption failed") )
var ( // ErrNoFieldsConfigured is returned when no fields are configured for forwarding ErrNoFieldsConfigured = errors.New("no fields configured for forwarding") )
Functions ¶
func GetValueByPath ¶
GetValueByPath retrieves a value from a nested map using a dot-separated path For example, "secrets.access_token" will retrieve data["secrets"]["access_token"] Returns the value as a string if found, empty string otherwise
Types ¶
type Base64Filter ¶
type Base64Filter struct{}
Base64Filter applies base64 encoding
func NewBase64Filter ¶
func NewBase64Filter() *Base64Filter
func (*Base64Filter) Apply ¶
func (f *Base64Filter) Apply(input *FilterOutput) (*FilterOutput, error)
func (*Base64Filter) InputTypes ¶
func (f *Base64Filter) InputTypes() []DataType
func (*Base64Filter) Name ¶
func (f *Base64Filter) Name() string
func (*Base64Filter) OutputType ¶
func (f *Base64Filter) OutputType() DataType
type DefaultForwarder ¶
type DefaultForwarder struct {
// contains filtered or unexported fields
}
DefaultForwarder is the default implementation of Forwarder
func NewForwarder ¶
func NewForwarder(cfg *config.ForwardingConfig, providers []config.OAuth2Provider) *DefaultForwarder
NewForwarder creates a new DefaultForwarder
func (*DefaultForwarder) AddToHeaders ¶
AddToHeaders adds user info to HTTP headers Processes each configured field and adds it as an HTTP header
func (*DefaultForwarder) AddToQueryString ¶
func (f *DefaultForwarder) AddToQueryString(targetURL string, userInfo *UserInfo) (string, error)
AddToQueryString adds user info to a URL's query string Processes each configured field and adds it as a query parameter
type EncryptFilter ¶
type EncryptFilter struct {
// contains filtered or unexported fields
}
EncryptFilter applies AES-256-GCM encryption
func NewEncryptFilter ¶
func NewEncryptFilter(encryptor *Encryptor) *EncryptFilter
func (*EncryptFilter) Apply ¶
func (f *EncryptFilter) Apply(input *FilterOutput) (*FilterOutput, error)
func (*EncryptFilter) InputTypes ¶
func (f *EncryptFilter) InputTypes() []DataType
func (*EncryptFilter) Name ¶
func (f *EncryptFilter) Name() string
func (*EncryptFilter) OutputType ¶
func (f *EncryptFilter) OutputType() DataType
type Encryptor ¶
type Encryptor struct {
// contains filtered or unexported fields
}
Encryptor handles encryption and decryption of user data
func NewEncryptor ¶
NewEncryptor creates a new Encryptor with the given key The key is hashed with SHA-256 to ensure it's exactly 32 bytes for AES-256
func (*Encryptor) DecryptMap ¶
DecryptMap decrypts an encrypted string back to a map of key-value pairs
type Filter ¶
type Filter interface {
// Name returns the filter name
Name() string
// InputTypes returns acceptable input types
InputTypes() []DataType
// OutputType returns the output type
OutputType() DataType
// Apply applies the filter to the input data
Apply(input *FilterOutput) (*FilterOutput, error)
}
Filter represents a data transformation filter
type FilterChain ¶
type FilterChain struct {
// contains filtered or unexported fields
}
FilterChain represents a chain of filters
func NewFilterChain ¶
func NewFilterChain(filterNames []string, encryptor *Encryptor) (*FilterChain, error)
NewFilterChain creates a new filter chain
type FilterOutput ¶
FilterOutput holds the result of a filter operation
type Forwarder ¶
type Forwarder interface {
// AddToHeaders adds user info to HTTP headers
// Returns a new http.Header with user information added
AddToHeaders(headers http.Header, userInfo *UserInfo) http.Header
// AddToQueryString adds user info to a URL's query string
// Returns the modified URL with user information in query parameters
AddToQueryString(targetURL string, userInfo *UserInfo) (string, error)
}
Forwarder is the interface for forwarding user information
type UserInfo ¶
type UserInfo struct {
Username string
Email string
Extra map[string]interface{} // Additional data from OAuth2 provider
Provider string // OAuth2 provider name
}
UserInfo contains user information to be forwarded
type ZipFilter ¶
type ZipFilter struct{}
ZipFilter applies gzip compression
func NewZipFilter ¶
func NewZipFilter() *ZipFilter
func (*ZipFilter) Apply ¶
func (f *ZipFilter) Apply(input *FilterOutput) (*FilterOutput, error)