dave
08/27/2017, 10:54 PMget(roles(UserController::getAllUserIds, ApiRole.ANYONE))
instead - where the roles()
method returns another Handler.
2. There's a type in your tutorial - should this.header("Basic")
be this.header("Authorization")
?tipsy
08/27/2017, 11:16 PMThe extension property concept is interesting - not really seen that done beforeyeah, i like it a lot, i try to use it everywhere it makes sense
will the next concept introduced into the API builder result in 8 methods per HTTP verb?yup. it's not ideal, but i'm willing to write this boilerplate if it leads to a nicer api for end-users.
get(controller, roles(...))
reads a lot better than get(roles(controller, ...))
, in my opinion. at a certain point i guess it will become too much, but i don't think there are a lot more concepts to add
shouldthanks, fixed. that's what i get for writing the tutorial before actually creating a project and running the code ๐bethis.header("Basic")
this.header("Authorization")
dave
08/28/2017, 7:55 AMhandler.securedBy(Role.God, Role.Minion)
At the moment, there are duplicate methods on ApiBuilder and Javalin which take the roles et al. By replacing them with a single method (for each verb), we can then use a callback onto Javalin to add behaviour without ever touching the ApiBuilder again: https://gist.github.com/daviddenton/845c2490c9158c7b91c5f8f97ec7cf97dave
08/28/2017, 7:55 AMdave
08/28/2017, 7:58 AMtipsy
08/28/2017, 2:32 PMtipsy
08/28/2017, 2:33 PMtipsy
08/28/2017, 2:33 PMdave
08/28/2017, 5:24 PMtipsy
08/28/2017, 5:48 PMController::action.securedBy(...)
to work too, which i'm not sure looks very nice anymore
either way there's no way to make this work in java (?)dave
08/29/2017, 12:58 PMtipsy
08/29/2017, 4:51 PM1 question I'd ask - are you really worried about people accessing your APIs from Java?yes. i'm a primarily a java (/frontend) dev working in a company that only does java.. great java interop is a goal for me, and it helps me learn the language.
Also, they'd have to be introducing the entire kotlin language to their app just to use a web library - which is a bit odd when you think about it. Just my 2c... ๐you don't need to have kotlin installed to use a jar that was built with kotlin