anchor.diff:  = buddy-auth - Auth/Authz facilities for ring based apps.
   Andrey Antukh, <niwi@niwi.nz>
  -0.13.0
  +1.0.0
   :toc: left
   :!numbered:
   :source-highlighter: pygments
  
positive.code:   (let [data (:form-params request)
          user (find-user (:username data)   ;; (implementation ommited)
                          (:password data))
          token (jwe/encrypt {:user (:id user)} pubkey
                             {:alg :rsa-oaep :enc :a128-hs256})]
      {:status 200
       :body (json/encode {:token token})
       :headers {:content-type "application/json"})))
  ----
  
  For more details about jwe, see the
  link:https://funcool.github.io/buddy-sign/latest/#jwe[buddy-sign] documentation.
  
  In order to use any asymmetric encryption algorithm, you should have private/public
  key pair. If you don't have one, don't worry, it is very easy to generate it using
  *openssl*, see this link:https://funcool.github.io/buddy-sign/latest/#generate-keypairs[faq entry].
  
negative.code:   (let [data (:form-params request)
          user (find-user (:username data)   ;; (implementation ommited)
                          (:password data))
          token (jwt/sign {:user (:id user)} secret)]
      {:status 200
       :body (json/encode {:token token})
       :headers {:content-type "application/json"})))
  ----
  
  For more details about jwt, see the
  link:https://funcool.github.io/buddy-sign/latest/#jwt[buddy-sign] documentation.
  
  Some valuable resources for learning about stateless authentication are:
  
  