<commit_before>package keyshareserver

import (
	"bytes"
	"context"
	"crypto/rand"
	"encoding/base64"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"strings"
	"sync"
	"time"

	"github.com/jasonlvhit/gocron"
	"github.com/privacybydesign/gabi"
	"github.com/privacybydesign/gabi/big"
	irma "github.com/privacybydesign/irmago"
	"github.com/sirupsen/logrus"

	"github.com/privacybydesign/irmago/internal/common"
	"github.com/privacybydesign/irmago/internal/keysharecore"
	"github.com/privacybydesign/irmago/server"
	"github.com/privacybydesign/irmago/server/irmaserver"

	"github.com/go-chi/chi"
)

type SessionData struct {
	LastKeyID    irma.PublicKeyIdentifier // last used key, used in signing the issuance message
	LastCommitID uint64
	expiry       time.Time
}

// Used to provide context in protocol sessions
type requestAuthorization struct {
	user                  KeyshareUser
	hasValidAuthorization bool
}

type Server struct {
	// configuration
	conf *Configuration

	// external components
	core          *keysharecore.Core
	sessionserver *irmaserver.Server
	db            KeyshareDB

	// Scheduler used to clean sessions
	scheduler     *gocron.Scheduler
	stopScheduler chan<- bool

	// Session data, keeping track of current keyshare protocol session state for each user
	sessions    map[string]*SessionData
	sessionLock sync.Mutex
}<commit_msg>refactor: remove unused keyshare struct<commit_after>package keyshareserver

import (
	"bytes"
	"context"
	"crypto/rand"
	"encoding/base64"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"strings"
	"sync"
	"time"

	"github.com/jasonlvhit/gocron"
	"github.com/privacybydesign/gabi"
	"github.com/privacybydesign/gabi/big"
	irma "github.com/privacybydesign/irmago"
	"github.com/sirupsen/logrus"

	"github.com/privacybydesign/irmago/internal/common"
	"github.com/privacybydesign/irmago/internal/keysharecore"
	"github.com/privacybydesign/irmago/server"
	"github.com/privacybydesign/irmago/server/irmaserver"

	"github.com/go-chi/chi"
)

type SessionData struct {
	LastKeyID    irma.PublicKeyIdentifier // last used key, used in signing the issuance message
	LastCommitID uint64
	expiry       time.Time
}

type Server struct {
	// configuration
	conf *Configuration

	// external components
	core          *keysharecore.Core
	sessionserver *irmaserver.Server
	db            KeyshareDB

	// Scheduler used to clean sessions
	scheduler     *gocron.Scheduler
	stopScheduler chan<- bool

	// Session data, keeping track of current keyshare protocol session state for each user
	sessions    map[string]*SessionData
	sessionLock sync.Mutex
}
{'fraction_non_alphanumeric': 0.09613899613899614, 'fraction_numerical': 0.003088803088803089, 'mean_word_length': 4.021317829457364, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2752841', 'n_tokens_mistral': 906, 'n_tokens_neox': 893, 'n_words': 186}