mhenke1 commented on a change in pull request #3788: Store and pass variant
data in AuthKey
URL:
https://github.com/apache/incubator-openwhisk/pull/3788#discussion_r197836178
##########
File path: core/controller/src/main/scala/whisk/core/controller/Triggers.scala
##########
@@ -387,15 +387,17 @@ trait WhiskTriggersApi extends WhiskCollectionAPI {
.map(pkg => Path / pkg.namespace / rule.action.name.asString)
.getOrElse(Path / rule.action.name.asString)
- val request = HttpRequest(
- method = POST,
- uri = url.withPath(actionUrl ++ actionPath),
- headers = List(
- Authorization(BasicHttpCredentials(user.authkey.uuid.asString,
user.authkey.key.asString)),
- transid.toHeader),
- entity = HttpEntity(MediaTypes.`application/json`, args.compactPrint))
+ user.authkey.getCredentials
+ .map { creds =>
+ val request = HttpRequest(
+ method = POST,
+ uri = url.withPath(actionUrl ++ actionPath),
+ headers = List(Authorization(creds), transid.toHeader),
+ entity = HttpEntity(MediaTypes.`application/json`,
args.compactPrint))
- singleRequest(request)
+ singleRequest(request)
+ }
+ .getOrElse(Future.failed(new RuntimeException("invalid credentials
passed")))
Review comment:
Since this message is not user facing I have added an custom Exception into
this class
----------------------------------------------------------------
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