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_r132818253
 
 

 ##########
 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:
   opened https://github.com/apache/incubator-openwhisk/issues/2607
 
----------------------------------------------------------------
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