mirror of https://github.com/grafana/grafana.git
				
				
				
			Merge branch 'master' of github.com:grafana/grafana
This commit is contained in:
		
						commit
						1e06f3f5f4
					
				|  | @ -3,6 +3,7 @@ package login | |||
| import ( | ||||
| 	"errors" | ||||
| 
 | ||||
| 	"crypto/subtle" | ||||
| 	"github.com/grafana/grafana/pkg/bus" | ||||
| 	m "github.com/grafana/grafana/pkg/models" | ||||
| 	"github.com/grafana/grafana/pkg/setting" | ||||
|  | @ -56,7 +57,7 @@ func loginUsingGrafanaDB(query *LoginUserQuery) error { | |||
| 	user := userQuery.Result | ||||
| 
 | ||||
| 	passwordHashed := util.EncodePassword(query.Password, user.Salt) | ||||
| 	if passwordHashed != user.Password { | ||||
| 	if subtle.ConstantTimeCompare([]byte(passwordHashed), []byte(user.Password)) != 1 { | ||||
| 		return ErrInvalidCredentials | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
|  | @ -352,9 +352,15 @@ function($, _) { | |||
|   kbn.valueFormats.gbytes = kbn.formatBuilders.binarySIPrefix('B', 3); | ||||
| 
 | ||||
|   // Data Rate
 | ||||
|   kbn.valueFormats.pps = kbn.formatBuilders.decimalSIPrefix('pps'); | ||||
|   kbn.valueFormats.bps = kbn.formatBuilders.decimalSIPrefix('bps'); | ||||
|   kbn.valueFormats.Bps = kbn.formatBuilders.decimalSIPrefix('Bps'); | ||||
|   kbn.valueFormats.pps    = kbn.formatBuilders.decimalSIPrefix('pps'); | ||||
|   kbn.valueFormats.bps    = kbn.formatBuilders.decimalSIPrefix('bps'); | ||||
|   kbn.valueFormats.Bps    = kbn.formatBuilders.decimalSIPrefix('Bps'); | ||||
|   kbn.valueFormats.KBs    = kbn.formatBuilders.decimalSIPrefix('Bs', 1); | ||||
|   kbn.valueFormats.Kbits  = kbn.formatBuilders.decimalSIPrefix('bits', 1); | ||||
|   kbn.valueFormats.MBs    = kbn.formatBuilders.decimalSIPrefix('Bs', 2); | ||||
|   kbn.valueFormats.Mbits  = kbn.formatBuilders.decimalSIPrefix('bits', 2); | ||||
|   kbn.valueFormats.GBs    = kbn.formatBuilders.decimalSIPrefix('Bs', 3); | ||||
|   kbn.valueFormats.Gbits  = kbn.formatBuilders.decimalSIPrefix('bits', 3); | ||||
| 
 | ||||
|   // Throughput
 | ||||
|   kbn.valueFormats.ops  = kbn.formatBuilders.simpleCountUnit('ops'); | ||||
|  | @ -595,6 +601,12 @@ function($, _) { | |||
|           {text: 'packets/sec', value: 'pps'}, | ||||
|           {text: 'bits/sec',    value: 'bps'}, | ||||
|           {text: 'bytes/sec',   value: 'Bps'}, | ||||
|           {text: 'kilobites/sec', value: 'Kbits'}, | ||||
|           {text: 'kilobytes/sec',    value: 'KBs'}, | ||||
|           {text: 'megabites/sec', value: 'Mbits'}, | ||||
|           {text: 'megabytes/sec',    value: 'MBs'}, | ||||
|           {text: 'gigabytes/sec',   value: 'GBs'}, | ||||
|           {text: 'gigabites/sec',   value: 'Gbits'}, | ||||
|         ] | ||||
|       }, | ||||
|       { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue