rabbah commented on a change in pull request #2218: Port Controller from Spray 
to Akka

 File path: 
 @@ -38,19 +37,17 @@ trait AuthenticatedRoute {
     protected implicit val executionContext: ExecutionContext
     /** Creates HTTP BasicAuth handler */
-    protected def basicauth(implicit transid: TransactionId) = {
-        new BasicHttpAuthenticator[Identity](realm = "whisk rest service", 
validateCredentials _) {
-            override def apply(ctx: RequestContext) = {
-                super.apply(ctx) recover {
-                    case t: IllegalStateException => 
-                    case t                        => 
-                }
+    def basicAuth[A](verify: Option[BasicHttpCredentials] => 
Future[Option[A]]) = {
+        authenticateOrRejectWithChallenge[BasicHttpCredentials, A] { creds =>
 Review comment:
   the code above tries to return a more informative error when authentication 
fails because the database is not available. I think we are losing this feature 
now. I don't think there was a test for this (it will require mocking a db 
connection and failing it). 
   you can simulate this locally and verify this is a small change in behavior 
- if i'm right, then please open an issue to address it separately (this time 
with a test).
   edit: confirmed that the new logic reports an internal server error if the 
database connection is severed instead of service unavailable.
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

Reply via email to