Remove useless comment

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-06 11:16:50 +01:00
parent d209716d95
commit f33a1fe149
14 changed files with 7 additions and 43 deletions

View File

@@ -23,19 +23,14 @@ import (
"go.probo.inc/probo/pkg/probod"
)
// EnvGetter is a function that retrieves environment variables.
// This allows for easy testing by injecting a mock implementation.
type EnvGetter func(key string) string
// Builder creates a Config from environment variables.
type Builder struct {
getEnv EnvGetter
samlCertificate string
samlPrivateKey string
}
// NewBuilder creates a new Builder with the given environment getter.
// If getEnv is nil, os.Getenv is used.
func NewBuilder(getEnv EnvGetter) *Builder {
if getEnv == nil {
getEnv = os.Getenv
@@ -43,15 +38,11 @@ func NewBuilder(getEnv EnvGetter) *Builder {
return &Builder{getEnv: getEnv}
}
// SetSAMLCredentials sets pre-generated SAML certificate and private key.
// If not set, they will be generated automatically if not provided via environment.
func (b *Builder) SetSAMLCredentials(certificate, privateKey string) {
b.samlCertificate = certificate
b.samlPrivateKey = privateKey
}
// Build creates a FullConfig from environment variables.
// Returns an error if required environment variables are missing.
func (b *Builder) Build() (*probod.FullConfig, error) {
if err := b.validateRequired(); err != nil {
return nil, err

View File

@@ -23,8 +23,6 @@ import (
"gopkg.in/yaml.v3"
)
// WriteConfig writes the configuration to the specified path as YAML.
// It creates the parent directory if it doesn't exist.
func WriteConfig(cfg *probod.FullConfig, path string) error {
dir := filepath.Dir(path)
if err := os.MkdirAll(dir, 0755); err != nil {

View File

@@ -14,17 +14,14 @@
package probod
// CorsConfig contains CORS settings.
type CorsConfig struct {
AllowedOrigins []string `json:"allowed-origins"`
}
// ProxyProtocolConfig contains proxy protocol settings.
type ProxyProtocolConfig struct {
TrustedProxies []string `json:"trusted-proxies"`
}
// APIConfig contains HTTP API configuration.
type APIConfig struct {
Addr string `json:"addr"`
ProxyProtocol ProxyProtocolConfig `json:"proxy-protocol"`

View File

@@ -19,9 +19,8 @@ import (
"fmt"
)
// AuthConfig contains authentication configuration.
type AuthConfig struct {
Cookie CookieConfig `json:"cookie"`
Cookie CookieConfig `json:"cookie"`
Password PasswordConfig `json:"password"`
DisableSignup bool `json:"disable-signup"`
InvitationConfirmationTokenValidity int `json:"invitation-confirmation-token-validity"`
@@ -30,7 +29,6 @@ type AuthConfig struct {
SAML SAMLConfig `json:"saml"`
}
// CookieConfig contains session cookie configuration.
type CookieConfig struct {
Domain string `json:"domain"`
Secret string `json:"secret"`
@@ -39,7 +37,6 @@ type CookieConfig struct {
Secure bool `json:"secure"`
}
// PasswordConfig contains password hashing configuration.
type PasswordConfig struct {
Iterations int `json:"iterations"`
Pepper string `json:"pepper"`

View File

@@ -14,7 +14,6 @@
package probod
// AWSConfig contains AWS S3 configuration.
type AWSConfig struct {
Region string `json:"region"`
Bucket string `json:"bucket"`

View File

@@ -23,17 +23,15 @@ import (
"go.probo.inc/probo/pkg/connector"
)
// ConnectorConfig contains connector configuration.
type ConnectorConfig struct {
Provider string `json:"provider"`
Protocol connector.ProtocolType `json:"protocol"`
Config connector.Connector `json:"-"`
RawConfig any `json:"config,omitempty"`
Settings any `json:"-"`
RawSettings any `json:"settings,omitempty"`
Provider string `json:"provider"`
Protocol connector.ProtocolType `json:"protocol"`
Config connector.Connector `json:"-"`
RawConfig any `json:"config,omitempty"`
Settings any `json:"-"`
RawSettings any `json:"settings,omitempty"`
}
// ConnectorConfigOAuth2 contains OAuth2 connector configuration.
type ConnectorConfigOAuth2 struct {
ClientID string `json:"client-id"`
ClientSecret string `json:"client-secret"`

View File

@@ -14,7 +14,6 @@
package probod
// CustomDomainsConfig contains custom domain configuration.
type CustomDomainsConfig struct {
RenewalInterval int `json:"renewal-interval"`
ProvisionInterval int `json:"provision-interval"`
@@ -23,7 +22,6 @@ type CustomDomainsConfig struct {
ACME ACMEConfig `json:"acme"`
}
// ACMEConfig contains ACME certificate configuration.
type ACMEConfig struct {
Directory string `json:"directory"`
Email string `json:"email"`

View File

@@ -14,7 +14,6 @@
package probod
// MailerConfig contains email mailer configuration.
type MailerConfig struct {
MailerInterval int `json:"mailer-interval"`
SenderName string `json:"sender-name"`
@@ -22,7 +21,6 @@ type MailerConfig struct {
SMTP SMTPConfig `json:"smtp"`
}
// SMTPConfig contains SMTP server configuration.
type SMTPConfig struct {
Addr string `json:"addr"`
User string `json:"user"`

View File

@@ -14,14 +14,12 @@
package probod
// NotificationsConfig contains notification configuration.
type NotificationsConfig struct {
Mailer MailerConfig `json:"mailer"`
Slack SlackConfig `json:"slack"`
Webhook WebhookConfig `json:"webhook"`
}
// WebhookConfig contains webhook configuration.
type WebhookConfig struct {
SenderInterval int `json:"sender-interval"`
CacheTTL int `json:"cache-ttl"`

View File

@@ -14,7 +14,6 @@
package probod
// OpenAIConfig contains OpenAI API configuration.
type OpenAIConfig struct {
APIKey string `json:"api-key"`
Temperature float64 `json:"temperature"`

View File

@@ -21,7 +21,6 @@ import (
"go.gearno.de/kit/pg"
)
// PgConfig contains PostgreSQL database configuration.
type PgConfig struct {
Addr string `json:"addr"`
Username string `json:"username"`

View File

@@ -18,7 +18,6 @@ import (
"time"
)
// SAMLConfig contains SAML authentication configuration.
type SAMLConfig struct {
SessionDuration int `json:"session-duration"`
CleanupIntervalSeconds int `json:"cleanup-interval-seconds"`

View File

@@ -14,13 +14,7 @@
package probod
// SCIMBridgeConfig contains SCIM bridge configuration.
type SCIMBridgeConfig struct {
// SyncInterval is the time between sync attempts for each bridge (in seconds).
// Default: 900 (15 minutes)
SyncInterval int `json:"sync-interval"`
// PollInterval is the time between polling for bridges to sync (in seconds).
// Default: 30
PollInterval int `json:"poll-interval"`
}

View File

@@ -14,7 +14,6 @@
package probod
// SlackConfig contains Slack notification configuration.
type SlackConfig struct {
SenderInterval int `json:"sender-interval"`
SigningSecret string `json:"signing-secret"`