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
worker_processes 4; | |
pid nginx.pid; | |
#daemon off; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} | |
http { |
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
## | |
# You should look at the following URL's in order to grasp a solid understanding | |
# of Nginx configuration files in order to fully unleash the power of Nginx. | |
# http://wiki.nginx.org/Pitfalls | |
# http://wiki.nginx.org/QuickStart | |
# http://wiki.nginx.org/Configuration | |
# | |
# Generally, you will want to move this file somewhere, and start with a clean | |
# file but keep this around for reference. Or just disable in sites-enabled. | |
# |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
# fix for npm ERR! "Error: EROFS, symlink" issues | |
# http://blog.liip.ch/archive/2012/07/25/vagrant-and-node-js-quick-tip.html |
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
(ns api.rabbitmq | |
(:gen-class) | |
(:require [langohr.core :as rmq] | |
[langohr.channel :as lch] | |
[langohr.queue :as lq] | |
[langohr.consumers :as lc] | |
[langohr.basic :as lb])) | |
(def ^{:const true} | |
default-exchange-name "") |
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
(def user-to-add { | |
:name "sharedadmin" | |
:email "[email protected]" | |
:display_name "En Ginuity" | |
:password "somepass" | |
}) | |
(def deftest-datomic | |
(do-template [deftest-name schemas body] | |
(deftest deftest-name |
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
(def user-to-add { | |
:name "sharedadmin" | |
:email "[email protected]" | |
:display_name "En Ginuity" | |
:password "somepass" | |
}) | |
(deftest add-and-retrieve-user | |
(ds/start {:schemas user/schema}) | |
(binding [*connection* (d/connect *uri*)] |
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
;;this fn doesn't work. couchdb is still being called even though with-redef is replacing the authenticator. | |
(with-redefs [ | |
api.routes.login/conn (db.datomic.seeding/connection-to-seeded-db) | |
api.db.couch/authenticator (constantly {:basic-authentication {:ok true :name nil :roles ["_admin"] } :couchdb-id "sharedadmin"}) | |
] | |
;;use mem DB for this | |
(deftest login-route | |
(testing "testing logging in as sharedadmin" | |
(is (= (-> (session api.core/app) ;Use your ring app |
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
user=> (use 'librarian-clojure.security) | |
nil | |
user=> (def request {:params {:login "jacek" :password "secr3t"}}) | |
#'user/request | |
user=> (log-in request) | |
AssertionError Assert failed: (somnium.congomongo/connection? c__793__auto__) librarian-clojure.db/db-get-user (db.clj:63) | |
user=> ;; no CongoDB up and running - mock its availability | |
user=> (def ^:dynamic db-get-user) | |
#'user/db-get-user | |
user=> (binding [db-get-user (fn [v] (println "user: " v) v)] |
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
[ | |
;; put shared admin in DB | |
{ | |
:db/id #db/id[:db.part/user -1000001], | |
:user/roles :role/super-user, ;enum | |
:user/couch-id "sharedadmin", | |
:user/firstname "En", | |
:user/lastname "Ginuity" | |
} | |
] |
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
(def simple-user-schema | |
[{:db/id {:part :db.part/db, :idx -1000050}, | |
:db/ident :user/firstname, | |
:db/valueType :db.type/string, | |
:db/cardinality :db.cardinality/one, | |
:db/fulltext true, | |
:db/doc "A user's first name", | |
:db.install/_attribute :db.part/db} | |
{:db/id {:part :db.part/db, :idx -1000051}, | |
:db/ident :user/lastname, |