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_r179744124
##########
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:
in general, i think the more popular usage for explicitly provided secret
values will be string values, but that's just my opinion :-). regarding numeric
support, you are right, json does not really specify a bit limit; however,
language support for json integers does impose precision limits. in this case,
the api gw web actions are written in javascript with 53 bit integer precision,
which i think may be sufficient for most use cases - in particular for the
auto-generated random secret number; if there is need to have greater precision
i suppose the user specified number can be quoted and treated as a string.
https://stackoverflow.com/questions/13502398/json-integers-limit-on-size
----------------------------------------------------------------
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