Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit. Simple Ring middleware for supplying appengine user i…
…nfo.
- Loading branch information
0 parents
commit ad198c7
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
appengine-clj.jar | ||
classes |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<project name="appengine-clj" basedir="." default="compile"> | ||
|
||
<property name="sdk.dir" location="../appengine-java-sdk" /> | ||
<property name="classes.dir" value="classes" /> | ||
<property name="lib.dir" value="lib" /> | ||
<property name="src.dir" value="src" /> | ||
<property name="jar.file" value="appengine-clj.jar" /> | ||
|
||
<path id="project.classpath"> | ||
<pathelement path="${classes.dir}" /> | ||
<fileset dir="${lib.dir}"> | ||
<include name="**/*.jar" /> | ||
</fileset> | ||
<fileset dir="${sdk.dir}/lib"> | ||
<include name="**/*.jar" /> | ||
</fileset> | ||
</path> | ||
|
||
<target name="clean"> | ||
<delete dir="${classes.dir}" /> | ||
<delete file="${jar.file}" /> | ||
</target> | ||
|
||
<target name="init"> | ||
<mkdir dir="${classes.dir}" /> | ||
</target> | ||
|
||
<target name="compile" depends="clean,init"> | ||
<java classname="clojure.lang.Compile" classpathref="project.classpath" failonerror="true"> | ||
<classpath path="${src.dir}" /> | ||
<sysproperty key="clojure.compile.path" value="${classes.dir}" /> | ||
<arg value="appengine-clj.users" /> | ||
</java> | ||
</target> | ||
|
||
<target name="jar" depends="compile"> | ||
<jar jarfile="${jar.file}" basedir="${classes.dir}" /> | ||
</target> | ||
|
||
</project> | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(ns appengine-clj.users | ||
(:import | ||
(com.google.appengine.api.users User UserService UserServiceFactory))) | ||
|
||
|
||
(defn wrap-with-user-info [application] | ||
(fn [request] | ||
(let [user-service (UserServiceFactory/getUserService) | ||
user (.getCurrentUser user-service)] | ||
(application (assoc request :appengine-clj/user-info {:user user :user-service user-service}))))) | ||
|