Last active
August 29, 2015 13:57
-
-
Save PuercoPop/9792537 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ql:quickload :optima) | |
(ql:quickload :split-sequence) | |
(defun process-auth-header (auth-header) | |
"Validate that is the correct 'scheme' (NOQ) and return the id and the | |
digest." | |
(match (split-sequence #\: auth-header) | |
((list first digest) (cons digest . first)))) | |
;; Error | |
;; | |
;; The value FIRST is not of type LIST. | |
;; [Condition of type TYPE-ERROR] | |
;; | |
;; Expected | |
;; | |
;; (process-auth-header "NOQ toto:ly0u787twocI0k1SnvB2mp0dnaobK2tsdtiiNRzyYXE=") | |
;; => ly0u787twocI0k1SnvB2mp0dnaobK2tsdtiiNRzyYXE= | |
;; Silly rabbit an extra . | |
;; Finished function | |
(defun process-auth-header (auth-header) | |
"Validate that is the correct 'scheme' (NOQ) and return the id and the | |
digest." | |
(match (split-sequence #\: auth-header) | |
((list first digest) | |
(match (split-sequence #\Space first) | |
((list scheme user-id) | |
(progn | |
(assert (string= scheme "NOQ")) | |
(values user-id digest))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment