use environment variables to set and override access and secret keys at server startup

This commit is contained in:
Olivier Sallou
2016-02-22 11:15:20 +01:00
committed by Harshavardhana
parent bd6850e79f
commit 678585c513
2 changed files with 27 additions and 0 deletions
+6
View File
@@ -38,6 +38,12 @@ func isValidAccessKey(accessKeyID string) bool {
return regex.MatchString(accessKeyID)
}
// isValidSecretKey - validate secret key
func isValidSecretKey(secretKeyID string) bool {
regex := regexp.MustCompile("^[a-zA-Z0-9\\-\\.\\_\\~]{40}$")
return regex.MatchString(secretKeyID)
}
// generateAccessKeyID - generate random alpha numeric value using only uppercase characters
// takes input as size in integer
func generateAccessKeyID() ([]byte, *probe.Error) {