You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/04/05 15:52:30 UTC

[GitHub] mdeuser commented on a change in pull request #267: --web-secure generated integer must be within api gw max int range

mdeuser commented on a change in pull request #267: --web-secure generated integer must be within api gw max int range
URL: https://github.com/apache/incubator-openwhisk-cli/pull/267#discussion_r179511741
 
 

 ##########
 File path: commands/action.go
 ##########
 @@ -1194,10 +1195,12 @@ func printSavedActionCodeSuccess(name string) {
 			}))
 }
 
-// Generate a random int64 number to be used as a web action's
+// Generate a random number to be used as a web action's require-whisk-auth secret
 func genWebActionSecureKey() int64 {
 	r := rand.New(rand.NewSource(time.Now().Unix()))
-	return r.Int63()
+
+	// Truncate integer for API GW interoperability
+	return r.Int63() & MAX_JS_INT
 
 Review comment:
   not well.  i think the better validation test might be in the api creation (would be a separate pr) to validate this value before using it to create the api.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services