rabbah commented on a change in pull request #2218: Port Controller from Spray 
to Akka
URL: 
https://github.com/apache/incubator-openwhisk/pull/2218#discussion_r132814453
 
 

 ##########
 File path: 
core/controller/src/main/scala/whisk/core/controller/AuthenticatedRoute.scala
 ##########
 @@ -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 => 
Left(CustomRejection(InternalServerError))
-                    case t                        => 
Left(CustomRejection(ServiceUnavailable))
-                }
+    def basicAuth[A](verify: Option[BasicHttpCredentials] => 
Future[Option[A]]) = {
+        authenticateOrRejectWithChallenge[BasicHttpCredentials, A] { creds =>
 
 Review comment:
   the new logic does report an internal server error if the database 
connection is severed.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to