package security

import (
	"go.uber.org/zap"

	"codeberg.org/mapleopentech/monorepo/cloud/maplepress-backend/config"
	"codeberg.org/mapleopentech/monorepo/cloud/maplepress-backend/pkg/security/clientip"
	"codeberg.org/mapleopentech/monorepo/cloud/maplepress-backend/pkg/security/jwt"
)

// ProvideJWTProvider provides a JWT provider instance
func ProvideJWTProvider(cfg *config.Config) jwt.Provider {
	return jwt.NewProvider(cfg)
}

// ProvideClientIPExtractor provides a client IP extractor instance
// CWE-348: Secure IP extraction with X-Forwarded-For validation
func ProvideClientIPExtractor(cfg *config.Config, logger *zap.Logger) (*clientip.Extractor, error) {
	return clientip.ProvideExtractor(cfg, logger)
}
