diff --git a/lib/auth/auth.lisp b/lib/auth/auth.lisp new file mode 100644 index 0000000..55eae32 --- /dev/null +++ b/lib/auth/auth.lisp @@ -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) diff --git a/lib/auth/scopes-auth.asd b/lib/auth/scopes-auth.asd new file mode 100644 index 0000000..1fd91c6 --- /dev/null +++ b/lib/auth/scopes-auth.asd @@ -0,0 +1,23 @@ +(in-package #:asdf-user) + +(defsystem :scopes-auth + :author "cyberconcepts.org Team " + :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))) + + diff --git a/lib/auth/test/test-auth.lisp b/lib/auth/test/test-auth.lisp new file mode 100644 index 0000000..4a7ce91 --- /dev/null +++ b/lib/auth/test/test-auth.lisp @@ -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 ()) diff --git a/scopes.asd b/scopes.asd index bb27b01..749b43e 100644 --- a/scopes.asd +++ b/scopes.asd @@ -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")) diff --git a/storage/folder.lisp b/storage/folder.lisp index 8fb2bd3..19d8cc3 100644 --- a/storage/folder.lisp +++ b/storage/folder.lisp @@ -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)))))) diff --git a/test/config-sqlite.lisp b/test/config-sqlite.lisp index 8ec1726..2909731 100644 --- a/test/config-sqlite.lisp +++ b/test/config-sqlite.lisp @@ -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) diff --git a/util.lisp b/util.lisp index de937bf..e1f4e69 100644 --- a/util.lisp +++ b/util.lisp @@ -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