rabbah commented on a change in pull request #2877: Better error controller
message for authorization failure
URL:
https://github.com/apache/incubator-openwhisk/pull/2877#discussion_r149808706
##########
File path:
core/controller/src/main/scala/whisk/core/entitlement/Entitlement.scala
##########
@@ -175,13 +181,34 @@ protected[core] abstract class
EntitlementProvider(config: WhiskConfig, loadBala
.flatMap(_ => checkUserThrottle(user, right, resources))
.flatMap(_ => checkConcurrentUserThrottle(user, right, resources))
.flatMap(_ => checkPrivilege(user, right, resources))
+ .flatMap(resourcePrivSet => {
+ Future
+ .sequence {
+ resourcePrivSet.map { resourcePriv =>
+ if (!resourcePriv._2) {
+ inaccessibleResources += resourcePriv._1
+ Future.successful(false)
+ } else {
+ Future.successful(true)
+ }
+ }
+ }
+ .map { _.forall(identity) }
+ })
} else Future.successful(true)
} else if (right != REJECT) {
+ resources.map(r => inaccessibleResources += r)
logging.info(
this,
s"supplied authkey for user '$subject' does not have privilege
'$right' for '${resources.mkString(",")}'")
Review comment:
i'd separate with `, ` (a space after comma) for better readability.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services