Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    milanvdmria
    @milanvdmria
    Is there a way to do this over a path?
    milanvdmria
    @milanvdmria
    @adamw
    Adam Warski
    @adamw
    right now you have authentiationRoutes besides graphQLRoutes
    so if the request is not served by authRoutes it is then tried to be served by graphQLRoutes
    I think you will have to nest them:
    authenticationRoutes { graphQLRoutes }
    @milanvdmria ^
    milanvdmria
    @milanvdmria
    @adamw But it is not about the AuthenticationRoutes but rather about the sessionRequired. Because my GraphQLRoutes is nested inside of the SessionRequired call and should therefore need a session. Which is currently not the case :)
    Adam Warski
    @adamw
    @milanvdmria ah ... well that obviously shouldn't happen :) what's the session that you get in such cases? It must have some value ...
    milanvdmria
    @milanvdmria
    @adamw Ill have a look when Im home
    milanvdmria
    @milanvdmria
    Seems to be something on my side because now it seems to be working :)
    Patrick Ting
    @pcting
    regarding the dynomite REST route /cluster_describe, the port returned in the response seems to be the gossip/dyn_listen port. is this intended? it'll be nice if it was more specific... ie, listen_port, gossip_port, etc. i've been looking at it to build a TokenMapSupplier
    Adam Warski
    @adamw
    @pcting I'm not sure if it's the right channel? :)
    Patrick Ting
    @pcting
    @adamw whoops, thanks. you're right
    Roberto Leibman
    @rleibman
    hey hi. I'm sure it's been asked endlessly... but I couldn't find any faqs on it... is there a tried and true way of doing Form based authentication? I managed to get BasicAuthentication working in [seriously] a few minutes, but can't find anything for form based auth.
    Roberto Leibman
    @rleibman
    I should have seen that the last traffic here was from almost a year ago... oh well.
    Adam Warski
    @adamw
    @rleibman well I suppose you would just read the form data on the client side and call your authentication logic :) So sth like:
    val mySecureRoute = formFields("user", "password") { (user, password) =>
      onComplete(authorize(user, password)) { result => // authorize: (String, String) => FuturepBoolean
        if (result) {
          setSession(...) { /* app logic */ }
        } else {
          complete(StatusCodes.Forbidden)
        }
      }
    }
    Roberto Leibman
    @rleibman
    It's a bit more complicated than that...with BasicAuth built into akka, I have directives for authenticate and authorize that give me back a user, or reject, forcing the browser to bring up a login dialog. Yes, I understand the login code you posted, but I was hoping of a slightly larger example of usage, with login, logout and the equivalent of authenticate (bonus point for create user, forgot password). The ScalaExample in git is actually pretty close.
    Adam Warski
    @adamw
    @rleibman a bit late, sorry, but maybe https://github.com/softwaremill/bootzooka will also be interesting
    Roberto Leibman
    @rleibman
    I mostly wrangled it by hand... though I'll definitely take a look at that project, thanks.
    Bilal
    @bilal-fazlani
    Hi, is there a support/example that shows integration between akka-http-session and reactjs application?
    bharath619
    @bharath619
    is there any documentation for akka-http-session?
    Adam Warski
    @adamw
    just what's in the repo
    Kaizar
    @kaizar__twitter
    Using Akka Http 10.1.9 I am trying to override the StatusCodes default message. This can be done in a couple of ways for instance 1. StatusCodes.Created.copy(Created.intValue)(reason = "", defaultMessage = "", allowsEntity = false) 2. StatusCodes.custom(Created.intValue, reason = "", defaultMessage = "", allowsEntity = false)
    This results in returning a Closed Delimited Octet-stream. Then tested either in postman or through curl script, it keeps processing even after the response is returned as if the stream is still open. Does anybody has faced this issue and know the workaround?
    Roberto Leibman
    @rleibman
    Good morning!
    I'm having an issue with my project... for some reason, when I try to log out the server goes into the weeds and I end up with a timeout.
    I've got the whole thing wrapped with zio... but I tried just putting myInvalidateSession straight at the top of the route before any of the zio stuff shows up and got the same result.
    Roberto Leibman
    @rleibman
    Found it... a bug in akka-http!
    It calls copy recursively.
    Adam Warski
    @adamw
    @rleibman ah it's the same copy? And probably akka-http-session uses the deprecated method instead of the new one?
    Roberto Leibman
    @rleibman
    Yup, anyway, I've fixed it upstream in akka-http and the PR got approved and merged, so it'll be ok in the next version of akka-http, you can still fix it and call the new method if you want.
    Adam Warski
    @adamw
    @rleibman yes, if you could, that would be great. Thanks! :)
    Roberto Leibman
    @rleibman
    @adamw...so the problem is that the issue I found doesn't really show it's face until you take akka-http-session and do a tech refresh updating all the dependencies, but If I update the dependencies, now I get a bunch of
    [error] (core / scalaCompilerBridgeScope / csrConfiguration) insecure protocol is unsupported
    Adam Warski
    @adamw
    whoa never seen that
    what is csrConfiguration :D
    maybe you need to update sbt as well?
    we can just do a new minor release after updating all deps
    Roberto Leibman
    @rleibman
    I tried updating everything, scala, sbt, etc. I used UpdateDependencies (from a plugin) to figure out exactly what needed new versions
    Roberto Leibman
    @rleibman
    And no luck :(
    ok... a bit more info:
    [error] insecure HTTP request is unsupported 'http://dl.bintray.com/scalaz/releases'; switch to HTTPS or opt-in as ("Scalaz Bintray Repo" at "http://dl.bintray.com/scalaz/releases").withAllowInsecureProtocol(true), or by using allowInsecureProtocol in repositories file
    Roberto Leibman
    @rleibman
    With the latest sbt-softwaremill that problem goes away... btw, I don't think I'm too fond of transitive dependencies that hide issues like these ;)
    Roberto Leibman
    @rleibman
    ok, so some progress, but now, since I no longer have access to HttpCookie::copy, I need to use HttpCookie::withMaxAge, but that method doesn't take an option, it takes an int... it seems like I can't get a copy of the cookie with MaxAge unset... what's the intent?
    @adamw ^
    It's not even clear from the non-existent http documantation what a maxage of None does, is it equivalent as zero (which makes the cookie expire immediately)?
    Or maybe expire at the end of the session?
    But if I'm reading this correctly, createCookieWithValue just sets MaxAge to None anyway, so the copy is really superfluous.
    Roberto Leibman
    @rleibman
    ok... there goes my Saturday, here's the PR, enjoy! softwaremill/akka-http-session#78
    I did make sure sbt +test all worked