Documentation ¶
Index ¶
- Constants
- type AuditlogClient
- type AuditlogMessageFactory
- type AuthMode
- type BasicAuthConfig
- type BasicHttpClient
- type Client
- type Config
- type HttpClient
- type MessageFactory
- type MetricCollector
- type NoOpService
- type OAuthConfig
- type OAuthMtlsConfig
- type Service
- type Sink
- type TimeService
- type UUIDService
- type Worker
Constants ¶
View Source
const ( PreAuditlogOperation = "pre-operation" PostAuditlogOperation = "post-operation" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditlogClient ¶
type AuditlogClient interface { LogConfigurationChange(ctx context.Context, change model.ConfigurationChange) error LogSecurityEvent(ctx context.Context, event model.SecurityEvent) error }
type AuditlogMessageFactory ¶
type AuditlogMessageFactory interface { CreateConfigurationChange() model.ConfigurationChange CreateSecurityEvent() model.SecurityEvent }
type BasicAuthConfig ¶
type BasicHttpClient ¶
type BasicHttpClient struct {
// contains filtered or unexported fields
}
func NewBasicAuthClient ¶
func NewBasicAuthClient(cfg BasicAuthConfig, client *http.Client) *BasicHttpClient
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) LogConfigurationChange ¶
func (*Client) LogSecurityEvent ¶
type Config ¶
type Config struct { URL string `envconfig:"APP_AUDITLOG_URL"` ConfigPath string `envconfig:"APP_AUDITLOG_CONFIG_PATH"` SecurityPath string `envconfig:"APP_AUDITLOG_SECURITY_PATH"` AuthMode AuthMode `envconfig:"APP_AUDITLOG_AUTH_MODE"` ClientTimeout time.Duration `envconfig:"APP_AUDITLOG_CLIENT_TIMEOUT,default=30s"` MsgChannelSize int `envconfig:"APP_AUDITLOG_CHANNEL_SIZE,default=100"` MsgChannelTimeout time.Duration `envconfig:"APP_AUDITLOG_CHANNEL_TIMEOUT,default=5s"` WriteWorkers int `envconfig:"APP_AUDITLOG_WRITE_WORKERS,default=5"` }
type MessageFactory ¶
type MessageFactory struct {
// contains filtered or unexported fields
}
func NewMessageFactory ¶
func NewMessageFactory(user, tenant string, uuidSvc UUIDService, timeSvc TimeService) *MessageFactory
func (*MessageFactory) CreateConfigurationChange ¶
func (f *MessageFactory) CreateConfigurationChange() model.ConfigurationChange
func (*MessageFactory) CreateSecurityEvent ¶
func (f *MessageFactory) CreateSecurityEvent() model.SecurityEvent
type MetricCollector ¶
type MetricCollector interface {
SetChannelSize(size int)
}
type NoOpService ¶
type NoOpService struct { }
func (*NoOpService) Log ¶
func (sink *NoOpService) Log(context.Context, proxy.AuditlogMessage) error
func (*NoOpService) PreLog ¶
func (sink *NoOpService) PreLog(context.Context, proxy.AuditlogMessage) error
type OAuthConfig ¶
type OAuthConfig struct { ClientID string `envconfig:"APP_AUDITLOG_CLIENT_ID"` ClientSecret string `envconfig:"APP_AUDITLOG_CLIENT_SECRET"` OAuthURL string `envconfig:"APP_AUDITLOG_OAUTH_URL"` User string `envconfig:"APP_AUDITLOG_OAUTH_USER,default=$USER"` Tenant string `envconfig:"APP_AUDITLOG_OAUTH_TENANT,default=$PROVIDER"` TokenPath string `envconfig:"APP_AUDITLOG_TOKEN_PATH"` }
type OAuthMtlsConfig ¶
type OAuthMtlsConfig struct { ClientID string `envconfig:"APP_AUDITLOG_CLIENT_ID"` OAuthURL string `envconfig:"APP_AUDITLOG_OAUTH_URL"` User string `envconfig:"APP_AUDITLOG_OAUTH_USER,default=$USER"` Tenant string `envconfig:"APP_AUDITLOG_OAUTH_TENANT,default=$PROVIDER"` TokenPath string `envconfig:"APP_AUDITLOG_TOKEN_PATH"` SkipSSLValidation bool `envconfig:"APP_AUDITLOG_SKIP_SSL_VALIDATION,default=false"` X509Cert string `envconfig:"APP_AUDITLOG_X509_CERT"` X509Key string `envconfig:"APP_AUDITLOG_X509_KEY"` }
func (*OAuthMtlsConfig) ParseCertificate ¶
func (c *OAuthMtlsConfig) ParseCertificate() (*tls.Certificate, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(client AuditlogClient, msgFactory AuditlogMessageFactory) *Service
type Sink ¶
type Sink struct {
// contains filtered or unexported fields
}
func NewSink ¶
func NewSink(logsChannel chan proxy.AuditlogMessage, timeout time.Duration, collector MetricCollector) *Sink
type TimeService ¶
type UUIDService ¶
type UUIDService interface {
Generate() string
}
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func NewWorker ¶
func NewWorker(svc proxy.AuditlogService, auditlogChannel chan proxy.AuditlogMessage, collector MetricCollector) *Worker
Source Files ¶
Click to show internal directories.
Click to hide internal directories.