func (m *Module) CloseConfig() {
	m.Lock()
	defer m.Unlock()
	m.jwt.Close()
	m.funcRules = map[string]*config.Service{}
	m.eventingRules = map[string]*config.Rule{}
	m.fileRules = []*config.FileRule{}
	m.dbRules = map[string]*config.DatabaseRule{}
}
CloseConfig closes go routines and initializes maps
package auth
import (
	"context"
	"encoding/base64"
	"github.com/spaceuptech/space-cloud/gateway/config"
	"github.com/spaceuptech/space-cloud/gateway/utils"
)
func (m *Module) SetProjectConfig(projectConfig *config.ProjectConfig) error {
	m.Lock()
	defer m.Unlock()
	m.project = projectConfig.ID
	if projectConfig.SecretSource == "admin" {
		projectConfig.Secrets = []*config.Secret{{KID: utils.AdminSecretKID, Secret: m.adminMan.GetSecret(), IsPrimary: true, Alg: config.HS256}}
	}
	if err := m.jwt.SetSecrets(projectConfig.Secrets); err != nil {
		return err
	}
	decodedAESKey, err := base64.StdEncoding.DecodeString(projectConfig.AESKey)
	if err != nil {
		return err
	}
	m.aesKey = decodedAESKey
	return nil
}
func (m *Module) SetConfig(ctx context.Context, fileStoreType string, projectConfig *config.ProjectConfig, dbRules config.DatabaseRules, dbPreparedRules config.DatabasePreparedQueries, fileStoreRules config.FileStoreRules, remoteServices config.Services, eventingRules config.EventingRules) error {
	if err := m.SetProjectConfig(projectConfig); err != nil {
		return err
	}
	m.SetDatabaseRules(dbRules)
	m.SetDatabasePreparedQueryRules(dbPreparedRules)
	m.SetFileStoreRules(fileStoreRules)
	m.SetEventingRules(eventingRules)
	m.SetRemoteServiceConfig(remoteServices)
	return nil
}