Skip to content

Commit

Permalink
add user profile endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
r4vi committed Nov 6, 2017
1 parent 8ddb6fb commit ef704dc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ If you want it to return any custom scopes then just add `scope=whatever` to you

## User Getting Started
1. Download a release: [releases]
1. make sure you have java 8.
1. decide what port you want it running on and export the PORT environment variable: `export PORT=12345`, if you don't specify a port it runs on 8080 by default.
1. Run `java -jar fakesso-0.0.2-SNAPSHOT-standalone.jar`
1. make sure you have java 8
1. decide what port you want it running on and export the PORT environment variable: `export PORT=12345`
1. Run `java -jar fakesso-0.0.3-standalone.jar`


## Developer Getting Started
Expand Down
4 changes: 2 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(defproject fakesso "0.0.2-SNAPSHOT"
(defproject fakesso "0.0.3"
:description "a really insecure oauth2 provider"
:url "http://example.com/FIXME"
:url "https://github.com/r4vi/fakesso"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
Expand Down
8 changes: 8 additions & 0 deletions src/fakesso/service.clj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
})
)

(defn whoami [request]
(ring-resp/response {:email "test@test.test"
:first_name "test"
:last_name "test"
:groups []
}))

(def html-interceptors [http/html-body])
(def json-interceptors [http/json-body])

Expand All @@ -65,6 +72,7 @@
["/o/introspect/" :get (conj json-interceptors `introspect) :route-name :introspect]
["/o/token/" :post (conj json-interceptors `token) :route-name :token-post]
["/o/token/" :get (conj json-interceptors `token) :route-name :token]
["/api/v1/user/me/" :get (conj json-interceptors `whoami) :route-name :whoami]
})

;; Consumed by fakesso.server/create-server
Expand Down

0 comments on commit ef704dc

Please sign in to comment.