Fork me on GitHub
#untangled
<
2016-04-05
>
tony.kay02:04:42

Started building server exercises. Got the first one working…it is kinda neat seeing the app state update with markers as load happens simple_smile

tony.kay02:04:49

just pushed on untangled-tutorial

tony.kay05:04:22

I went ahead and added some datomic testing to the tutorial…including the above discussion points about with-db-fixture

tony.kay05:04:34

D.U.N. done for the night...

tony.kay05:04:12

OK,almost done….anyone working on the tutorial should probably re-clone (or at least hard reset develop/master to origin after a fetch). I wanted to rewrite the repo because I had a bum email address in a lot of commits. Didn’t realize I had an old work email configured.

tony.kay05:04:25

Anyone just playing with it can just pull.

tomjack17:04:06

pulling did not work for me

tony.kay17:04:55

@tomjack: what did it say?

tony.kay17:04:06

If that happens, try git reset --hard origin/develop

tony.kay17:04:14

(or master, if that is the branch you're on)

tomjack17:04:25

just a warning simple_smile

kenbier22:04:14

Is there a good example on how to setup authorization using the untangled-server? I am trying to setup authorization policies, and would like each api read and mutate function to call a policy before doing any work. If you are unauthorized to read an entity, say, the policy would throw an exception and the api would return a 401. From what I've read so far, it seems the only way to pass through the status code is to throw an ex-info with the status, headers, and body. Does this seem correct? https://github.com/untangled-web/untangled-server/blob/master/src/untangled/server/impl/components/handler.clj#L69

ethangracer22:04:05

@kenbier: yes, that is correct

ethangracer22:04:45

your mutation does the authorization check

ethangracer22:04:35

if it finds that the action isn’t authorized, then you write something like (throw (ex-info “message” {:status 401}). you can include more information in the body and custom headers of the response if you want to, but you aren’t required to provide those keys. if you don’t return any of :status, :body, or :header, then the server will throw a 400 by default

currentoor23:04:09

@ethangracer: so do you guys do anything untangle-y in your devcards? Or just use devcards the same way a vanilla om.next app would?

ethangracer23:04:31

haven’t played a ton with devcards more recently, but when i’ve written them I’ve used it the same way as om.next

currentoor23:04:41

cool, thanks