-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require whisk auth fix #480
base: master
Are you sure you want to change the base?
require whisk auth fix #480
Conversation
92e7523
to
1de1d9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I apologize no one reviewed this sooner. I added a comment about generating alphanumeric secrets instead of integer only. Also this needs either some go unit tests or integration (scala) tests.
@@ -849,49 +854,76 @@ func getWebSecureAnnotations(action *whisk.Action) whisk.KeyValueArr { | |||
return webKvArr[0:j] | |||
} | |||
|
|||
func getNewSecret(secret interface{}) string { | |||
_, isJSONNum := secret.(json.Number) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd replace this with the ability to generate an alphanumeric secret instead.
Something like:
rand.Seed(time.Now().UnixNano())
var alphabet = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
b := make([]rune, SECRET_LENGTH)
for i := range b {
b[i] = alphabet[rand.Intn(len(alphabet))]
}
return string(b)
No description provided.