basic set-up of lib/auth system; + minor corrections
This commit is contained in:
parent
919119d649
commit
d09abff170
7 changed files with 61 additions and 5 deletions
9
lib/auth/auth.lisp
Normal file
9
lib/auth/auth.lisp
Normal file
|
@ -0,0 +1,9 @@
|
|||
;;;; cl-scopes/lib/auth - authentication services
|
||||
|
||||
(defpackage :scopes-auth
|
||||
(:use :common-lisp)
|
||||
(:local-nicknames (:dom :scopes/web/dom))
|
||||
(:import-from :scopes/web/dom #:div #:label)
|
||||
(:export #:login))
|
||||
|
||||
(in-package :scopes-auth)
|
23
lib/auth/scopes-auth.asd
Normal file
23
lib/auth/scopes-auth.asd
Normal file
|
@ -0,0 +1,23 @@
|
|||
(in-package #:asdf-user)
|
||||
|
||||
(defsystem :scopes-auth
|
||||
:author "cyberconcepts.org Team <team@cyberconcepts.org>"
|
||||
:license "MIT"
|
||||
:version "0.0.1"
|
||||
:homepage "https://www.cyberconcepts.org"
|
||||
:description "Authentication services"
|
||||
:depends-on (:scopes)
|
||||
:components ((:file "auth"))
|
||||
:long-description "scopes framework: authentication services."
|
||||
;;#.(uiop:read-file-string
|
||||
;; (uiop:subpathname *load-pathname* "README.md")))
|
||||
:in-order-to ((test-op
|
||||
(test-op "scopes-auth/test"))))
|
||||
|
||||
(defsystem :scopes-auth/test
|
||||
:depends-on (:scopes-auth)
|
||||
:components ((:file "test/test-auth"))
|
||||
:perform (test-op (o c)
|
||||
(symbol-call :scopes-auth/test :run)))
|
||||
|
||||
|
21
lib/auth/test/test-auth.lisp
Normal file
21
lib/auth/test/test-auth.lisp
Normal file
|
@ -0,0 +1,21 @@
|
|||
;;;; cl-scopes/lib/auth/test - tests for the scopes-auth system
|
||||
|
||||
(defpackage :scopes-auth/test
|
||||
(:use :common-lisp)
|
||||
(:local-nicknames (:auth :scopes-auth)
|
||||
(:t :scopes/testing))
|
||||
(:import-from :scopes/testing #:deftest #:==)
|
||||
(:export #:run))
|
||||
|
||||
(in-package :scopes-auth/test)
|
||||
|
||||
;;;; test runner
|
||||
|
||||
(defun run ()
|
||||
(let ((t:*test-suite* (t:test-suite "auth")))
|
||||
(unwind-protect
|
||||
(progn
|
||||
(test-login))
|
||||
(t:show-result))))
|
||||
|
||||
(deftest test-login ())
|
|
@ -5,7 +5,7 @@
|
|||
:license "MIT"
|
||||
:version "0.0.1"
|
||||
:homepage "https://www.cyberconcepts.org"
|
||||
:description "Generic data processing."
|
||||
:description "Generic data processing"
|
||||
:depends-on (:scopes-core :scopes-web
|
||||
:dbi :sxql)
|
||||
:components ((:file "storage/folder" :depends-on ("storage/tracking"))
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
(query f `((:parentid ,(id f)))))
|
||||
|
||||
(defun parent (f)
|
||||
(let ((pid (parse-integer (util:keyword-to-string (shape:head-value f :parentid)))))
|
||||
(let ((pid (util:to-integer (shape:head-value f :parentid))))
|
||||
(tracking:query-one (tracking:container f)
|
||||
(tracking:make-where `((:trackid ,pid))))))
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; cl-scopes/test/config-sqlite.lisp
|
||||
;;; use: `(load "test/...")` from package scopes/test-storage
|
||||
;;;; cl-scopes/test/config-sqlite.lisp
|
||||
;;;; use: `(load "test/...")` from package scopes/test-storage
|
||||
|
||||
(in-package :scopes/test-storage)
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
(:use :common-lisp)
|
||||
(:export #:lg #:lgd #:lgi
|
||||
#:rfill #:rtrim #:loop-plist #:filter-plist #:plist-pairs #:plist-equal
|
||||
#:flatten-str #:to-keyword #:keyword-to-string #:to-string
|
||||
#:flatten-str #:to-keyword #:keyword-to-string #:to-integer #:to-string
|
||||
#:absolute-dir #:check-dir #:ensure-dir #:home-path #:path-from-string
|
||||
#:relative-path #:runtime-path #:system-path))
|
||||
|
||||
|
@ -58,6 +58,9 @@
|
|||
(format nil pattern k)
|
||||
(str:join sep (mapcar #'(lambda (s) (format nil pattern s)) k)))))
|
||||
|
||||
(defun to-integer (k)
|
||||
(parse-integer (string k)))
|
||||
|
||||
(defun to-keyword (s)
|
||||
(if (string= s "")
|
||||
nil
|
||||
|
|
Loading…
Add table
Reference in a new issue