Documentation
¶
Overview ¶
Package graphql provides GraphQL execution engine
Package graphql provides GraphQL resolver implementations ¶
Package graphql provides GraphQL API support for AegisGate ¶
Package graphql provides GraphQL subscription support ¶
Package graphql provides GraphQL API support for AegisGate
Index ¶
- func GetComplexityLimit(ctx context.Context) int
- func GetDepthLimit(ctx context.Context) int
- func WithComplexityLimit(ctx context.Context, limit int) context.Context
- func WithDepthLimit(ctx context.Context, limit int) context.Context
- func WithRequestInfo(ctx context.Context, info *RequestInfo) context.Context
- type AuthConfig
- type AuthProvider
- type AuthResult
- type Certificate
- type CertificateFilter
- type ComplianceFinding
- type ComplianceFindingConnection
- type ComplianceFindingEdge
- type ComplianceReport
- type ComplianceReportSummary
- type ComplianceResult
- type ComplianceStatus
- type ComplianceStatusSummary
- type Config
- type ConfigError
- type ConfigInput
- type ConfigValidationResult
- type CounterMetric
- type CreateUserInput
- type DashboardData
- type DashboardStats
- type Error
- type EventHandler
- type Executor
- type FindingEdge
- type FindingFilter
- type Framework
- type FrameworkStatus
- type FrameworkType
- type GaugeMetric
- type Handler
- type Health
- type HealthCheck
- type License
- type Location
- type LogLevel
- type LoginInput
- type MTLSConfig
- type MTLSStatus
- type MetricSnapshot
- type MetricsSnapshot
- type Module
- type ModuleHealth
- type ModuleStatus
- type ModuleTier
- type PageInfo
- type Pagination
- type PasswordPolicy
- type Permission
- type Provider
- type ProviderType
- type ProxyConfig
- type ProxyConfigInput
- type ProxyHealth
- type ProxyStats
- type RegistryStatus
- type RequestInfo
- type Resolver
- func (r *Resolver) AuthConfig(ctx context.Context) (*AuthConfig, error)
- func (r *Resolver) Certificates(ctx context.Context, args struct{ ... }) ([]*Certificate, error)
- func (r *Resolver) ComplianceFindings(ctx context.Context, args struct{ ... }) (*ComplianceFindingConnection, error)
- func (r *Resolver) ComplianceFrameworks(ctx context.Context) ([]*Framework, error)
- func (r *Resolver) ComplianceReport(ctx context.Context, args struct{ ... }) (*ComplianceReport, error)
- func (r *Resolver) ComplianceStatus(ctx context.Context) (*ComplianceStatusSummary, error)
- func (r *Resolver) CreateUser(ctx context.Context, args struct{ ... }) (*User, error)
- func (r *Resolver) CreateWebhook(ctx context.Context, args struct{ ... }) (*Webhook, error)
- func (r *Resolver) CurrentUser(ctx context.Context) (*User, error)
- func (r *Resolver) DashboardData(ctx context.Context) (*DashboardData, error)
- func (r *Resolver) DeleteUser(ctx context.Context, args struct{ ... }) (bool, error)
- func (r *Resolver) DeleteWebhook(ctx context.Context, args struct{ ... }) (bool, error)
- func (r *Resolver) Execute(ctx context.Context, query string, variables map[string]interface{}) *Response
- func (r *Resolver) Health(ctx context.Context) (*Health, error)
- func (r *Resolver) Login(ctx context.Context, args struct{ ... }) (*AuthResult, error)
- func (r *Resolver) Logout(ctx context.Context) (bool, error)
- func (r *Resolver) Module(ctx context.Context, args struct{ ... }) (*Module, error)
- func (r *Resolver) Modules(ctx context.Context) ([]*Module, error)
- func (r *Resolver) ProxyConfig(ctx context.Context) (*ProxyConfig, error)
- func (r *Resolver) ProxyEnabled(ctx context.Context) (bool, error)
- func (r *Resolver) ProxyHealth(ctx context.Context) (*ProxyHealth, error)
- func (r *Resolver) ProxyStats(ctx context.Context) (*ProxyStats, error)
- func (r *Resolver) RegistryStatus(ctx context.Context) (*RegistryStatus, error)
- func (r *Resolver) RunComplianceCheck(ctx context.Context, args struct{ ... }) (*ComplianceResult, error)
- func (r *Resolver) SIEMConfig(ctx context.Context) (*SIEMConfig, error)
- func (r *Resolver) SIEMEvents(ctx context.Context, args struct{ ... }) ([]*SIEMEvent, error)
- func (r *Resolver) SIEMStats(ctx context.Context) (*SIEMStats, error)
- func (r *Resolver) SSOProvider(ctx context.Context, args struct{ ... }) (*SSOProvider, error)
- func (r *Resolver) SSOProviders(ctx context.Context) ([]*SSOProvider, error)
- func (r *Resolver) Sessions(ctx context.Context, args struct{ ... }) ([]*Session, error)
- func (r *Resolver) UpdateUser(ctx context.Context, args struct{ ... }) (*User, error)
- func (r *Resolver) UpdateWebhook(ctx context.Context, args struct{ ... }) (*Webhook, error)
- func (r *Resolver) Uptime(ctx context.Context) (float64, error)
- func (r *Resolver) User(ctx context.Context, args struct{ ... }) (*User, error)
- func (r *Resolver) Users(ctx context.Context, args struct{ ... }) ([]*User, error)
- func (r *Resolver) Violation(ctx context.Context, args struct{ ... }) (*Violation, error)
- func (r *Resolver) Violations(ctx context.Context, args struct{ ... }) ([]*Violation, error)
- func (r *Resolver) Webhook(ctx context.Context, args struct{ ... }) (*Webhook, error)
- func (r *Resolver) WebhookStats(ctx context.Context) (*WebhookStats, error)
- func (r *Resolver) Webhooks(ctx context.Context, args struct{ ... }) ([]*Webhook, error)
- type Response
- type Role
- type SIEMConfig
- type SIEMEvent
- type SIEMEventFilter
- type SIEMStats
- type SSOProvider
- type SSOProviderType
- type SecurityEvent
- type Server
- type ServerConfig
- type Session
- type Severity
- type Stats
- type Subscription
- type SubscriptionEvent
- type SubscriptionManager
- func (sm *SubscriptionManager) Cleanup()
- func (sm *SubscriptionManager) Count() int
- func (sm *SubscriptionManager) Publish(eventType string, payload map[string]interface{})
- func (sm *SubscriptionManager) PublishCompliance(result *ComplianceResult)
- func (sm *SubscriptionManager) PublishHealth(health *Health)
- func (sm *SubscriptionManager) PublishMetrics(snapshot *MetricsSnapshot)
- func (sm *SubscriptionManager) PublishSIEMEvent(event *SIEMEvent)
- func (sm *SubscriptionManager) PublishSecurityEvent(event *SecurityEvent)
- func (sm *SubscriptionManager) PublishViolation(violation *Violation)
- func (sm *SubscriptionManager) RegisterHandler(eventType string, handler EventHandler)
- func (sm *SubscriptionManager) RegisterSubscriptions()
- func (sm *SubscriptionManager) Subscribe(ctx context.Context, query string, variables map[string]interface{}, ...) (*Subscription, error)
- func (sm *SubscriptionManager) Unsubscribe(id string)
- type TLSConfig
- type TestResult
- type Time
- type TimeRange
- type UpdateUserInput
- type User
- type UserFilter
- type Violation
- type ViolationFilter
- type ViolationType
- type WebSocketHandler
- type WebSocketMessage
- type WebSocketUpgrader
- type Webhook
- type WebhookFilter
- type WebhookInput
- type WebhookStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetComplexityLimit ¶
GetComplexityLimit gets complexity limit from context
func GetDepthLimit ¶
GetDepthLimit gets depth limit from context
func WithComplexityLimit ¶
WithComplexityLimit adds complexity limit to context
func WithDepthLimit ¶
WithDepthLimit adds depth limit to context
func WithRequestInfo ¶
func WithRequestInfo(ctx context.Context, info *RequestInfo) context.Context
WithRequestInfo adds request info to context
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Provider string `json:"provider"`
SessionTimeout int `json:"session_timeout"`
MaxSessionsPerUser int `json:"max_sessions_per_user"`
RequireMFA bool `json:"require_mfa"`
MFAMethods []string `json:"mfa_methods"`
PasswordPolicy *PasswordPolicy `json:"password_policy"`
LoginAttempts int `json:"login_attempts"`
LockoutDuration int `json:"lockout_duration"`
Providers []string `json:"providers"`
}
AuthConfig represents authentication configuration
type AuthResult ¶
type AuthResult struct {
Success bool `json:"success"`
Token string `json:"token"`
RefreshToken string `json:"refreshToken"`
ExpiresAt Time `json:"expiresAt"`
User *User `json:"user"`
Error string `json:"error"`
}
AuthResult represents authentication result
type Certificate ¶
type Certificate struct {
ID string `json:"id"`
Subject string `json:"subject"`
Issuer string `json:"issuer"`
SerialNumber string `json:"serialNumber"`
NotBefore Time `json:"notBefore"`
NotAfter Time `json:"notAfter"`
DNSNames []string `json:"dnsNames"`
Fingerprint string `json:"fingerprint"`
IsCA bool `json:"isCA"`
Status string `json:"status"`
}
Certificate represents a certificate
type CertificateFilter ¶
CertificateFilter represents filter parameters for certificate queries
type ComplianceFinding ¶
type ComplianceFinding struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Severity Severity `json:"severity"`
Category string `json:"category"`
Timestamp Time `json:"timestamp"`
}
ComplianceFinding represents a compliance finding
type ComplianceFindingConnection ¶
type ComplianceFindingConnection struct {
Edges []FindingEdge `json:"edges"`
PageInfo PageInfo `json:"page_info"`
TotalCount int `json:"total_count"`
}
ComplianceFindingConnection represents a paginated list of findings
type ComplianceFindingEdge ¶
type ComplianceFindingEdge struct {
Node compliance.Finding `json:"node"`
Cursor string `json:"cursor"`
}
ComplianceFindingEdge represents an edge in compliance findings
type ComplianceReport ¶
type ComplianceReport struct {
ID string `json:"id"`
Framework string `json:"framework"`
Timestamp time.Time `json:"timestamp"`
Status string `json:"status"`
Summary string `json:"summary"`
Findings []compliance.Finding `json:"findings"`
}
ComplianceReport represents a compliance report
type ComplianceReportSummary ¶
type ComplianceReportSummary struct {
TotalChecks int `json:"totalChecks"`
Passed int `json:"passed"`
Failed int `json:"failed"`
Warnings int `json:"warnings"`
NotApplicable int `json:"notApplicable"`
Score float64 `json:"score"`
}
ComplianceReportSummary represents compliance report summary
type ComplianceResult ¶
type ComplianceResult struct {
ID string `json:"id"`
Framework string `json:"framework"`
Status string `json:"status"`
Passed bool `json:"passed"`
Score float64 `json:"score"`
Timestamp time.Time `json:"timestamp"`
Findings []compliance.Finding `json:"findings"`
}
ComplianceResult represents the result of a compliance check
type ComplianceStatus ¶
type ComplianceStatus string
ComplianceStatus represents compliance check status
type ComplianceStatusSummary ¶
type ComplianceStatusSummary struct {
Overall ComplianceStatus `json:"overall"`
Frameworks []*FrameworkStatus `json:"frameworks"`
LastCheck Time `json:"lastCheck"`
}
ComplianceStatusSummary represents overall compliance status
type Config ¶
type Config struct {
Name string
Value interface{}
}
Config represents a configuration
type ConfigError ¶
ConfigError represents config error
type ConfigInput ¶
type ConfigInput struct {
Name string
Value interface{}
}
ConfigInput represents input for configuring modules
type ConfigValidationResult ¶
type ConfigValidationResult struct {
Valid bool `json:"valid"`
Errors []*ConfigError `json:"errors"`
}
ConfigValidationResult represents config validation result
type CounterMetric ¶
type CounterMetric struct {
Name string `json:"name"`
Value int64 `json:"value"`
Labels map[string]interface{} `json:"labels"`
}
CounterMetric represents counter metric
type CreateUserInput ¶
type CreateUserInput struct {
Username string `json:"username"`
Email string `json:"email"`
Password string `json:"password"`
Role Role `json:"role"`
}
CreateUserInput represents create user input
type DashboardData ¶
type DashboardData struct {
TotalRequests int64 `json:"total_requests"`
BlockedRequests int64 `json:"blocked_requests"`
ActiveUsers int `json:"active_users"`
ComplianceScore float64 `json:"compliance_score"`
}
DashboardData represents dashboard data for the UI
type DashboardStats ¶
type DashboardStats struct {
TotalRequests int64 `json:"totalRequests"`
BlockedRequests int64 `json:"blockedRequests"`
ActiveUsers int `json:"activeUsers"`
ActiveConnections int `json:"activeConnections"`
Uptime float64 `json:"uptime"`
}
DashboardStats represents dashboard statistics
type Error ¶
type Error struct {
Message string `json:"message"`
Locations []Location `json:"locations,omitempty"`
Path []interface{} `json:"path,omitempty"`
Extensions map[string]interface{} `json:"extensions,omitempty"`
}
Error represents a GraphQL error
type EventHandler ¶
type EventHandler func(ctx context.Context, event *SubscriptionEvent)
EventHandler is a function that handles events
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor handles GraphQL query execution
func NewExecutor ¶
NewExecutor creates a new executor
type FindingEdge ¶
type FindingEdge struct {
Node compliance.Finding `json:"node"`
Cursor string `json:"cursor"`
}
FindingEdge represents an edge in the finding connection
type FindingFilter ¶
FindingFilter represents filter parameters for compliance findings
type Framework ¶
type Framework struct {
ID FrameworkType `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version"`
Status ComplianceStatus `json:"status"`
FindingsCount int `json:"findingsCount"`
}
Framework represents a compliance framework
type FrameworkStatus ¶
type FrameworkStatus struct {
Framework FrameworkType `json:"framework"`
Status ComplianceStatus `json:"status"`
Score float64 `json:"score"`
LastCheck *Time `json:"lastCheck"`
}
FrameworkStatus represents framework status
type GaugeMetric ¶
type GaugeMetric struct {
Name string `json:"name"`
Value float64 `json:"value"`
Labels map[string]interface{} `json:"labels"`
}
GaugeMetric represents gauge metric
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles HTTP requests for GraphQL
func NewHandler ¶
NewHandler creates a new GraphQL handler
type Health ¶
type Health struct {
Status string `json:"status"`
Checks []*HealthCheck `json:"checks"`
Timestamp Time `json:"timestamp"`
}
Health represents health status
type HealthCheck ¶
type HealthCheck struct {
Name string `json:"name"`
Status string `json:"status"`
Message string `json:"message"`
Timestamp Time `json:"timestamp"`
}
HealthCheck represents a health check
type License ¶
type License struct {
ID string `json:"id"`
Type string `json:"type"`
Valid bool `json:"valid"`
ExpiresAt *Time `json:"expiresAt"`
Features []string `json:"features"`
}
License represents a license
type LoginInput ¶
type LoginInput struct {
Username string `json:"username"`
Password string `json:"password"`
MFACode string `json:"mfaCode"`
}
LoginInput represents login input
type MTLSConfig ¶
type MTLSConfig struct {
Enabled bool `json:"enabled"`
CertFile string `json:"certFile"`
KeyFile string `json:"keyFile"`
CACertFile string `json:"caCertFile"`
CAKeyFile string `json:"caKeyFile"`
ClientAuth string `json:"clientAuth"`
VerifyClientCert bool `json:"verifyClientCert"`
}
MTLSConfig represents mTLS configuration
type MTLSStatus ¶
type MTLSStatus struct {
Enabled bool `json:"enabled"`
CaCertFile string `json:"ca_cert_file"`
ClientCertFile string `json:"client_cert_file"`
}
MTLSStatus represents mTLS configuration status
type MetricSnapshot ¶
type MetricSnapshot struct {
Timestamp Time `json:"timestamp"`
Counters []*CounterMetric `json:"counters"`
Gauges []*GaugeMetric `json:"gauges"`
}
MetricSnapshot represents metrics snapshot
type MetricsSnapshot ¶
type MetricsSnapshot struct {
Timestamp time.Time `json:"timestamp"`
TotalRequests int64 `json:"total_requests"`
BlockedRequests int64 `json:"blocked_requests"`
ActiveUsers int `json:"active_users"`
}
MetricsSnapshot represents a snapshot of system metrics
type Module ¶
type Module struct {
ID string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Category string `json:"category"`
Tier ModuleTier `json:"tier"`
Status ModuleStatus `json:"status"`
}
Module represents a module
type ModuleHealth ¶
type ModuleHealth struct {
Status string `json:"status"`
Message string `json:"message"`
LastCheck Time `json:"lastCheck"`
}
ModuleHealth represents module health
type PageInfo ¶
type PageInfo struct {
HasNextPage bool `json:"hasNextPage"`
HasPreviousPage bool `json:"hasPreviousPage"`
StartCursor string `json:"startCursor"`
EndCursor string `json:"endCursor"`
}
PageInfo represents page info
type Pagination ¶
type Pagination struct {
Offset int `json:"offset"`
Limit int `json:"limit"`
Total int `json:"total"`
}
Pagination represents pagination parameters
type PasswordPolicy ¶
type PasswordPolicy struct {
MinLength int `json:"min_length"`
RequireUpper bool `json:"require_upper"`
RequireLower bool `json:"require_lower"`
RequireDigit bool `json:"require_digit"`
RequireSpecial bool `json:"require_special"`
MaxAge int `json:"max_age"`
}
PasswordPolicy - local type for GraphQL
type Provider ¶
type Provider = sso.SSOProvider
sso.Provider - alias for sso.SSOProvider (the sso package uses SSOProvider)
type ProviderType ¶
type ProviderType = sso.SSOProvider
sso.ProviderType - alias for sso.SSOProvider (used as provider type)
type ProxyConfig ¶
type ProxyConfig struct {
Enabled bool `json:"enabled"`
BindAddress string `json:"bind_address"`
Upstream string `json:"upstream"`
MaxBodySize int64 `json:"max_body_size"`
Timeout int `json:"timeout"`
RateLimit int `json:"rate_limit"`
TLSEnabled bool `json:"tls_enabled"`
}
ProxyConfig represents proxy configuration
type ProxyConfigInput ¶
ProxyConfigInput represents input for configuring the proxy
type ProxyHealth ¶
type ProxyHealth struct {
Status string `json:"status"`
Uptime float64 `json:"uptime"`
MemoryUsage int64 `json:"memoryUsage"`
}
ProxyHealth represents proxy health
type ProxyStats ¶
type ProxyStats struct {
RequestsTotal int64 `json:"requestsTotal"`
RequestsBlocked int64 `json:"requestsBlocked"`
RequestsAllowed int64 `json:"requestsAllowed"`
BytesIn int64 `json:"bytesIn"`
BytesOut int64 `json:"bytesOut"`
ActiveConnections int `json:"activeConnections"`
AvgLatencyMs float64 `json:"avgLatencyMs"`
}
ProxyStats represents proxy statistics
type RegistryStatus ¶
type RegistryStatus struct {
TotalModules int `json:"total_modules"`
ActiveModules int `json:"active_modules"`
HealthyModules int `json:"healthy_modules"`
ModuleStatuses map[string]string `json:"module_statuses"`
}
RegistryStatus represents the status of the module registry
type RequestInfo ¶
RequestInfo holds information about the current request
func GetRequestInfo ¶
func GetRequestInfo(ctx context.Context) *RequestInfo
GetRequestInfo gets request info from context
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver handles GraphQL resolver functions
func (*Resolver) AuthConfig ¶
func (r *Resolver) AuthConfig(ctx context.Context) (*AuthConfig, error)
AuthConfig resolves auth configuration
func (*Resolver) Certificates ¶
func (r *Resolver) Certificates(ctx context.Context, args struct { Filter *CertificateFilter Pagination *Pagination }) ([]*Certificate, error)
Certificates resolves certificates
func (*Resolver) ComplianceFindings ¶
func (r *Resolver) ComplianceFindings(ctx context.Context, args struct { Filter *FindingFilter Pagination *Pagination }) (*ComplianceFindingConnection, error)
ComplianceFindings resolves compliance findings
func (*Resolver) ComplianceFrameworks ¶
ComplianceFrameworks resolves compliance frameworks
func (*Resolver) ComplianceReport ¶
func (r *Resolver) ComplianceReport(ctx context.Context, args struct { Framework compliance.Framework Period *TimeRange }) (*ComplianceReport, error)
ComplianceReport resolves a compliance report
func (*Resolver) ComplianceStatus ¶
func (r *Resolver) ComplianceStatus(ctx context.Context) (*ComplianceStatusSummary, error)
ComplianceStatus resolves compliance status
func (*Resolver) CreateUser ¶
func (r *Resolver) CreateUser(ctx context.Context, args struct{ Input *CreateUserInput }) (*User, error)
CreateUser resolves create user mutation
func (*Resolver) CreateWebhook ¶
func (r *Resolver) CreateWebhook(ctx context.Context, args struct{ Input *WebhookInput }) (*Webhook, error)
CreateWebhook resolves create webhook mutation
func (*Resolver) CurrentUser ¶
CurrentUser resolves the current authenticated user
func (*Resolver) DashboardData ¶
func (r *Resolver) DashboardData(ctx context.Context) (*DashboardData, error)
DashboardData resolves dashboard data
func (*Resolver) DeleteUser ¶
DeleteUser resolves delete user mutation
func (*Resolver) DeleteWebhook ¶
DeleteWebhook resolves delete webhook mutation
func (*Resolver) Execute ¶
func (r *Resolver) Execute(ctx context.Context, query string, variables map[string]interface{}) *Response
Execute executes a GraphQL query
func (*Resolver) Login ¶
func (r *Resolver) Login(ctx context.Context, args struct{ Input *LoginInput }) (*AuthResult, error)
Login resolves login mutation
func (*Resolver) ProxyConfig ¶
func (r *Resolver) ProxyConfig(ctx context.Context) (*ProxyConfig, error)
ProxyConfig resolves proxy configuration
func (*Resolver) ProxyEnabled ¶
ProxyEnabled resolves whether proxy is enabled
func (*Resolver) ProxyHealth ¶
func (r *Resolver) ProxyHealth(ctx context.Context) (*ProxyHealth, error)
ProxyHealth resolves proxy health
func (*Resolver) ProxyStats ¶
func (r *Resolver) ProxyStats(ctx context.Context) (*ProxyStats, error)
ProxyStats resolves proxy statistics
func (*Resolver) RegistryStatus ¶
func (r *Resolver) RegistryStatus(ctx context.Context) (*RegistryStatus, error)
RegistryStatus resolves registry status
func (*Resolver) RunComplianceCheck ¶
func (r *Resolver) RunComplianceCheck(ctx context.Context, args struct { Framework compliance.Framework }) (*ComplianceResult, error)
RunComplianceCheck resolves run compliance check mutation
func (*Resolver) SIEMConfig ¶
func (r *Resolver) SIEMConfig(ctx context.Context) (*SIEMConfig, error)
SIEMConfig resolves SIEM configuration
func (*Resolver) SIEMEvents ¶
func (r *Resolver) SIEMEvents(ctx context.Context, args struct { Filter *SIEMEventFilter Pagination *Pagination }) ([]*SIEMEvent, error)
SIEMEvents resolves SIEM events
func (*Resolver) SSOProvider ¶
SSOProvider resolves a single SSO provider
func (*Resolver) SSOProviders ¶
func (r *Resolver) SSOProviders(ctx context.Context) ([]*SSOProvider, error)
SSOProviders resolves SSO providers
func (*Resolver) Sessions ¶
func (r *Resolver) Sessions(ctx context.Context, args struct { UserID *string Pagination *Pagination }) ([]*Session, error)
Sessions resolves sessions
func (*Resolver) UpdateUser ¶
func (r *Resolver) UpdateUser(ctx context.Context, args struct { ID string Input *UpdateUserInput }) (*User, error)
UpdateUser resolves update user mutation
func (*Resolver) UpdateWebhook ¶
func (r *Resolver) UpdateWebhook(ctx context.Context, args struct { ID string Input *WebhookInput }) (*Webhook, error)
UpdateWebhook resolves update webhook mutation
func (*Resolver) Users ¶
func (r *Resolver) Users(ctx context.Context, args struct { Filter *UserFilter Pagination *Pagination }) ([]*User, error)
Users resolves the users query
func (*Resolver) Violations ¶
func (r *Resolver) Violations(ctx context.Context, args struct { Filter *ViolationFilter Pagination *Pagination }) ([]*Violation, error)
Violations resolves violations
func (*Resolver) WebhookStats ¶
func (r *Resolver) WebhookStats(ctx context.Context) (*WebhookStats, error)
WebhookStats resolves webhook statistics
func (*Resolver) Webhooks ¶
func (r *Resolver) Webhooks(ctx context.Context, args struct { Filter *WebhookFilter Pagination *Pagination }) ([]*Webhook, error)
Webhooks resolves webhooks
type Response ¶
type Response struct {
Data interface{} `json:"data,omitempty"`
Errors []*Error `json:"errors,omitempty"`
Extensions map[string]interface{} `json:"extensions,omitempty"`
}
Response represents a GraphQL response
type SIEMConfig ¶
type SIEMConfig struct {
Enabled bool `json:"enabled"`
Platform string `json:"platform"`
Endpoint string `json:"endpoint"`
Format string `json:"format"`
BufferSize int `json:"buffer_size"`
}
SIEMConfig represents SIEM configuration
type SIEMEvent ¶
type SIEMEvent struct {
ID string `json:"id"`
Timestamp Time `json:"timestamp"`
Source string `json:"source"`
Category string `json:"category"`
Severity Severity `json:"severity"`
Message string `json:"message"`
Attributes map[string]interface{} `json:"attributes"`
}
SIEMEvent represents SIEM event
type SIEMEventFilter ¶
type SIEMEventFilter struct {
Source string
Category string
Severity string
StartTime *time.Time
EndTime *time.Time
}
SIEMEventFilter represents filter parameters for SIEM events
type SIEMStats ¶
type SIEMStats = Stats
SIEMStats is an alias for Stats (for resolver.go compatibility)
type SSOProvider ¶
type SSOProvider struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
}
SSOProvider - local type for GraphQL (not to be confused with sso.SSOProvider)
type SSOProviderType ¶
type SSOProviderType = sso.SSOProvider
sso.SSOProviderType - alias for sso.SSOProvider
type SecurityEvent ¶
type SecurityEvent struct {
ID string `json:"id"`
Type string `json:"type"`
Severity string `json:"severity"`
Message string `json:"message"`
Timestamp string `json:"timestamp"`
}
SecurityEvent represents a security event for subscriptions
type Server ¶
Server represents the GraphQL server
func NewServer ¶
func NewServer(cfg *ServerConfig, logger *slog.Logger) *Server
NewServer creates a new GraphQL server
func (*Server) RegisterModules ¶
func (s *Server) RegisterModules( authMgr *auth.Manager, ssoMgr *sso.Manager, complianceMgr *compliance.Manager, proxySrv *proxy.Proxy, siemMgr *siem.Manager, webhookMgr *webhook.Manager, tlsMgr *tls.Manager, coreReg *core.Registry, metricsMgr *metrics.Manager, )
RegisterModules registers all AegisGate modules with the GraphQL server
type ServerConfig ¶
type ServerConfig struct {
Enabled bool `yaml:"enabled"`
ListenAddress string `yaml:"listen_address"`
Port int `yaml:"port"`
Playground bool `yaml:"playground"`
DepthLimit int `yaml:"depth_limit"`
ComplexityLimit int `yaml:"complexity_limit"`
Timeout time.Duration `yaml:"timeout"`
}
ServerConfig holds GraphQL server configuration
func DefaultServerConfig ¶
func DefaultServerConfig() *ServerConfig
DefaultServerConfig returns default configuration
type Session ¶
type Session struct {
ID string `json:"id"`
UserID string `json:"userId"`
Token string `json:"token"`
ExpiresAt Time `json:"expiresAt"`
CreatedAt Time `json:"createdAt"`
IPAddress string `json:"ipAddress"`
UserAgent string `json:"userAgent"`
}
Session represents a user session
type Stats ¶
type Stats struct {
EventsSent int64 `json:"events_sent"`
EventsReceived int64 `json:"events_received"`
EventsFailed int64 `json:"events_failed"`
BytesSent int64 `json:"bytes_sent"`
}
siem.Stats - create a stats type for SIEM (the package doesn't have this)
type Subscription ¶
type Subscription struct {
ID string
Query string
Variables map[string]interface{}
Operation string
Context context.Context
Cancel context.CancelFunc
Events chan *SubscriptionEvent
StartedAt time.Time
}
Subscription represents an active subscription
type SubscriptionEvent ¶
type SubscriptionEvent struct {
ID string `json:"id"`
Type string `json:"type"`
Payload map[string]interface{} `json:"payload"`
Timestamp time.Time `json:"timestamp"`
}
SubscriptionEvent represents a subscription event
type SubscriptionManager ¶
type SubscriptionManager struct {
// contains filtered or unexported fields
}
SubscriptionManager manages GraphQL subscriptions
func NewSubscriptionManager ¶
func NewSubscriptionManager() *SubscriptionManager
NewSubscriptionManager creates a new subscription manager
func (*SubscriptionManager) Cleanup ¶
func (sm *SubscriptionManager) Cleanup()
Cleanup removes all subscriptions
func (*SubscriptionManager) Count ¶
func (sm *SubscriptionManager) Count() int
Count returns the number of active subscriptions
func (*SubscriptionManager) Publish ¶
func (sm *SubscriptionManager) Publish(eventType string, payload map[string]interface{})
Publish publishes an event to all matching subscriptions
func (*SubscriptionManager) PublishCompliance ¶
func (sm *SubscriptionManager) PublishCompliance(result *ComplianceResult)
PublishCompliance publishes compliance result
func (*SubscriptionManager) PublishHealth ¶
func (sm *SubscriptionManager) PublishHealth(health *Health)
PublishHealth publishes health status change
func (*SubscriptionManager) PublishMetrics ¶
func (sm *SubscriptionManager) PublishMetrics(snapshot *MetricsSnapshot)
PublishMetrics publishes metrics update
func (*SubscriptionManager) PublishSIEMEvent ¶
func (sm *SubscriptionManager) PublishSIEMEvent(event *SIEMEvent)
PublishSIEMEvent publishes a SIEM event
func (*SubscriptionManager) PublishSecurityEvent ¶
func (sm *SubscriptionManager) PublishSecurityEvent(event *SecurityEvent)
PublishSecurityEvent publishes a security event
func (*SubscriptionManager) PublishViolation ¶
func (sm *SubscriptionManager) PublishViolation(violation *Violation)
PublishViolation publishes a violation event
func (*SubscriptionManager) RegisterHandler ¶
func (sm *SubscriptionManager) RegisterHandler(eventType string, handler EventHandler)
RegisterHandler registers an event handler for a subscription type
func (*SubscriptionManager) RegisterSubscriptions ¶
func (sm *SubscriptionManager) RegisterSubscriptions()
RegisterSubscriptions registers default subscription handlers
func (*SubscriptionManager) Subscribe ¶
func (sm *SubscriptionManager) Subscribe(ctx context.Context, query string, variables map[string]interface{}, operation string) (*Subscription, error)
Subscribe creates a new subscription
func (*SubscriptionManager) Unsubscribe ¶
func (sm *SubscriptionManager) Unsubscribe(id string)
Unsubscribe removes a subscription
type TLSConfig ¶
type TLSConfig struct {
Enabled bool `json:"enabled"`
MinVersion string `json:"minVersion"`
MaxVersion string `json:"maxVersion"`
CipherSuites []string `json:"cipherSuites"`
CertFile string `json:"certFile"`
KeyFile string `json:"keyFile"`
AutoGenerate bool `json:"autoGenerate"`
}
TLSConfig represents TLS configuration
type TestResult ¶
TestResult represents a test result (for test configuration)
type Time ¶
Time is a custom scalar for time
func (Time) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type UpdateUserInput ¶
UpdateUserInput represents input for updating a user
type User ¶
type User struct {
ID string `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
Role Role `json:"role"`
Enabled bool `json:"enabled"`
LastLogin *Time `json:"lastLogin"`
CreatedAt Time `json:"createdAt"`
UpdatedAt Time `json:"updatedAt"`
}
User represents a user
type UserFilter ¶
UserFilter represents filter parameters for user queries
type Violation ¶
type Violation struct {
ID string `json:"id"`
Type ViolationType `json:"type"`
Severity Severity `json:"severity"`
Message string `json:"message"`
Timestamp Time `json:"timestamp"`
ClientIP string `json:"clientIP"`
Method string `json:"method"`
Path string `json:"path"`
Blocked bool `json:"blocked"`
}
Violation represents a proxy violation
type ViolationFilter ¶
type ViolationFilter struct {
Severity string
Type string
ClientIP string
Path string
StartDate *time.Time
EndDate *time.Time
}
ViolationFilter represents filter parameters for violation queries
type WebSocketHandler ¶
type WebSocketHandler struct {
// contains filtered or unexported fields
}
WebSocketHandler handles GraphQL WebSocket connections
func NewWebSocketHandler ¶
func NewWebSocketHandler(manager *SubscriptionManager) *WebSocketHandler
NewWebSocketHandler creates a new WebSocket handler
func (*WebSocketHandler) HandleWebSocket ¶
func (wh *WebSocketHandler) HandleWebSocket(w http.ResponseWriter, r *http.Request)
HandleWebSocket handles WebSocket connection
func (*WebSocketHandler) SetAuthFunc ¶
SetAuthFunc sets authentication function
type WebSocketMessage ¶
type WebSocketMessage struct {
Type string `json:"type"`
ID string `json:"id,omitempty"`
Payload string `json:"payload,omitempty"`
}
WebSocketMessage represents a WebSocket message
type WebSocketUpgrader ¶
type WebSocketUpgrader struct {
ReadBufferSize int
WriteBufferSize int
CheckOrigin func(r *http.Request) bool
}
WebSocketUpgrader upgrades HTTP to WebSocket
func DefaultUpgrader ¶
func DefaultUpgrader() *WebSocketUpgrader
DefaultUpgrader returns default WebSocket upgrader
type Webhook ¶
type Webhook struct {
ID string `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
Events []string `json:"events"`
Enabled bool `json:"enabled"`
CreatedAt Time `json:"createdAt"`
UpdatedAt Time `json:"updatedAt"`
}
Webhook represents a webhook
type WebhookFilter ¶
WebhookFilter represents filter parameters for webhooks
type WebhookInput ¶
WebhookInput represents input for creating/updating a webhook
type WebhookStats ¶
type WebhookStats struct {
TotalDeliveries int64 `json:"total_deliveries"`
SuccessCount int64 `json:"success_count"`
FailureCount int64 `json:"failure_count"`
LastDelivery time.Time `json:"last_delivery"`
LastError string `json:"last_error"`
}
WebhookStats represents webhook statistics