anchor.diff:                             :parameters (list (cons "id_token" id-token))
                              :method :get
                              :accept "application/json;charset=utf-8")
  -    (declare (ignore stream stream-closed-p))
  +    (declare (ignore response-headers stream stream-closed-p))
       (assert (<= 200 status 299) ()
               "While validating Google sign-in token, error ~D: ~A returned by ~A"
               status status-reason response-uri)
  
positive.code:                                 *static-directory*)))
  
  (defroute "/tootstest/js/:name.js" (&key name)
    (send-static "application/javascript;charset=utf-8"
                 (merge-pathnames (make-pathname
                                   :directory '(:relative "js")
  
negative.code:       (assert (< (parse-integer (getf response :exp))
                   (local-time:timestamp-to-unix (local-time:now))) ()
                   "The Google sign-in permission has already expired.")
        (user-id<-registrar-id :google (getf response :sub)))))
  
  (defun find-player-by-id (id)
    "Retrieve the player object represented by ID."
    (check-type id (unsigned-byte 128))
    (error 'unimplemented))
  
  (defun ensure-player (player)
    "Ensure  that  PLAYER   is  a  PLAYER  object.   Coërces  integers  or
  base-36-coded integer strings."
    (etypecase player
      (player player)
      ((integer 1 *) (find-player-by-id player))
      (string (find-player-by-id (parse-integer player :radix 36)))))
  
  (defun render-player-details (player)
    "Return a JSON object describing the player object.
  
  This method needs to be reworked."
    (let ((player (ensure-player player)))
      (render-json `((:player . ((:id .,(player-id player))
                                 (:email .,(player-email player))
                                 (:given-name .,(player-given-name player))
                                 (:surname .,(player-surname player))
                                 (:full-name .,(player-full-name player))
                                 (:date-of-birth .,(player-date-of-birth player))
                                 (:age .,(player-age player))))))))
  
  (defroute ("/tootstest/login/registrars/:registrar" :method :post)
      (&key registrar id-token)
    "Accept a POST request with information about a player sign-in through an
  identity provider  identified by the case-insensitive  string REGISTRAR.
  An ID-TOKEN unique among all users of REGISTRAR is required.
  
  There is no  need for ID-TOKEN to be distinctive  of a particular player
  across time or valid far into  the future. The REGISTRAR will be queried
  by a specific method to obtain a reference to a local user.
  "
    (handler-case
        (let ((user (ecase (make-keyword (string-upcase registrar))
                      (:google (user<-google-token id-token))
                      (:facebook (error 'unimplemented)))))
          (when user
            (render-player-details user)))
      (error (c)
        (render-json `((:error . (princ-to-string ,c)))))))
  
  
  