func (s *SingleKrItemStore) Get(k Key) (*Session, error) {
	keyStr := k.Key()
	currentDb, err := s.getDb()
	if err != nil {
		log.Debugf("cache get `%s`: miss (read error): %s", keyStr, err)
		return nil, xerrors.Errorf("failed loading db for %q: %w", keyStr, err)
	}
	session, ok := currentDb.Sessions[keyStr]
	if !ok {
		log.Debugf("cache get `%s`: miss", keyStr)
		return nil, xerrors.Errorf("failed finding session for %q: %w", keyStr, keyring.ErrKeyNotFound)
	}
	if session.Expiration.Before(time.Now()) {
		log.Debugf("cache get `%s`: expired", keyStr)
		return nil, xerrors.Errorf("session expired for %q: %w", keyStr, ErrSessionExpired)
	}
	log.Debugf("cache get `%s`: hit", keyStr)
	return &session, nil
}
Get loads the db from the keyring, and returns the session at k.Key()

If the keyring item is not found (the db hasn't been written) or the key is
not found, returns wrapped keyring.ErrKeyNotFound

If the session is found, but is expired, returns wrapped ErrSessionExpired
package sessioncache
import (
	"encoding/json"
	"time"
	"github.com/99designs/keyring"
	log "github.com/sirupsen/logrus"
	"golang.org/x/xerrors"
)
const KeyringItemKey = "session-cache"
const KeyringItemLabel = "aws-okta session cache"
type singleKrItemDb struct {
	Sessions map[string]Session
}
type SingleKrItemStore struct {
	Keyring keyring.Keyring
}
func (s *SingleKrItemStore) getDb() (*singleKrItemDb, error) {
	item, err := s.Keyring.Get(KeyringItemKey)
	if err != nil {
		return nil, xerrors.Errorf("failed Keyring.Get(%q): %w", KeyringItemKey, err)
	}
	var unmarshalled singleKrItemDb
	if err := json.Unmarshal(item.Data, &unmarshalled); err != nil {
		return nil, xerrors.Errorf("failed unmarshal for %q: %w", KeyringItemKey, err)
	}
	return &unmarshalled, nil
}