code: func (s *session) SetIdentity(sessionType apitypes.SessionType, identity, auth envelope.Envelope) error {
  	s.mutex.Lock()
  	defer s.mutex.Unlock()
  
  	err := checkSessionType(sessionType, identity, auth)
  	if err != nil {
  		return err
  	}
  
  	s.identity = identity
  	s.auth = auth
  
  	return nil
  }
docs: // SetIdentity updates the session identity