<commit_before>package provider

import (
	"github.com/hellofresh/janus/pkg/config"
)

var providers map[string]Provider

// Provider represents an auth provider
type Provider interface {
	Verifier
	Build(config config.Credentials) Provider
}

func init() {
	providers = make(map[string]Provider)
}

// Register registers a new provider
func Register(providerName string, providerConstructor Provider) {
	providers[providerName] = providerConstructor
}

// GetProviders returns the list of registered providers
func GetProviders() map[string]Provider {
	return providers
}<commit_msg>prevents concurrent access<commit_after>package provider

import (
	"sync"

	"github.com/hellofresh/janus/pkg/config"
)

var providers map[string]Provider
var mutex sync.Mutex

// Provider represents an auth provider
type Provider interface {
	Verifier
	Build(config config.Credentials) Provider
}

func init() {
	providers = make(map[string]Provider)
}

// Register registers a new provider
func Register(providerName string, providerConstructor Provider) {
	mutex.Lock()
	defer mutex.Unlock()

	providers[providerName] = providerConstructor
}

// GetProviders returns the list of registered providers
func GetProviders() map[string]Provider {
	return providers
}
{'fraction_non_alphanumeric': 0.08413461538461539, 'fraction_numerical': 0.0, 'mean_word_length': 5.6436170212765955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7363712', 'n_tokens_mistral': 355, 'n_tokens_neox': 345, 'n_words': 103}