Merge lp://staging/~rvb/gwacl/random-pw into lp://staging/gwacl
Proposed by
Raphaël Badin
Status: | Merged |
---|---|
Approved by: | Raphaël Badin |
Approved revision: | 179 |
Merged at revision: | 178 |
Proposed branch: | lp://staging/~rvb/gwacl/random-pw |
Merge into: | lp://staging/gwacl |
Diff against target: |
92 lines (+53/-3) 2 files modified
names.go (+32/-3) names_test.go (+21/-0) |
To merge this branch: | bzr merge lp://staging/~rvb/gwacl/random-pw |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella | Approve | ||
Review via email:
|
Commit message
Add MakeRandomPassword utility.
Description of the change
Add utility to create a valid Azure password. We could do this in much clever ways but I think that this serves our purpose well enough and is pretty readable.
To post a comment you must log in.
Looks good.
[1]
+const (
+ // Valid passwords must be 6-72 characters long.
+ passwordSize = 50
+)
According to http:// www.universetod ay.com/ 36302/atoms- in-the- universe/
this means that there are more possible password combinations than
there are atoms in the universe.
[2]
+ // Only digits and lower-case ASCII letters are accepted.
+ const (
+ chars = letters + digits + upperCaseLetters
+ )
+
The comment is incorrect. Also, you could dispense with the braces and
the blank line to try and claw back some of the losses incurred from
Go's syntax.
[3]
+ id := letter + upperCaseLetter + digit
+ for len(id) < passwordSize {
+ id += pickOne(chars)
+ }
+ return id
s/id/password/ ?