mirror of
				https://github.com/grafana/grafana.git
				synced 2025-02-25 18:55:37 -06:00 
			
		
		
		
	Merge branch 'develop' into apikey_hashed
Conflicts: pkg/api/apikey.go pkg/services/sqlstore/migrations.go
This commit is contained in:
		@@ -8,22 +8,22 @@ import (
 | 
			
		||||
var ErrInvalidApiKey = errors.New("Invalid API Key")
 | 
			
		||||
 | 
			
		||||
type ApiKey struct {
 | 
			
		||||
	Id        int64
 | 
			
		||||
	AccountId int64
 | 
			
		||||
	Name      string
 | 
			
		||||
	Key       string
 | 
			
		||||
	Role      RoleType
 | 
			
		||||
	Created   time.Time
 | 
			
		||||
	Updated   time.Time
 | 
			
		||||
	Id      int64
 | 
			
		||||
	OrgId   int64
 | 
			
		||||
	Name    string
 | 
			
		||||
	Key     string
 | 
			
		||||
	Role    RoleType
 | 
			
		||||
	Created time.Time
 | 
			
		||||
	Updated time.Time
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ---------------------
 | 
			
		||||
// COMMANDS
 | 
			
		||||
type AddApiKeyCommand struct {
 | 
			
		||||
	Name      string   `json:"name" binding:"Required"`
 | 
			
		||||
	Role      RoleType `json:"role" binding:"Required"`
 | 
			
		||||
	AccountId int64    `json:"-"`
 | 
			
		||||
	Key       string   `json:"-"`
 | 
			
		||||
	Name  string   `json:"name" binding:"Required"`
 | 
			
		||||
	Role  RoleType `json:"role" binding:"Required"`
 | 
			
		||||
	OrgId int64    `json:"-"`
 | 
			
		||||
	Key   string   `json:"-"`
 | 
			
		||||
 | 
			
		||||
	Result *ApiKey `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
@@ -33,20 +33,20 @@ type UpdateApiKeyCommand struct {
 | 
			
		||||
	Name string   `json:"name"`
 | 
			
		||||
	Role RoleType `json:"role"`
 | 
			
		||||
 | 
			
		||||
	AccountId int64 `json:"-"`
 | 
			
		||||
	OrgId int64 `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type DeleteApiKeyCommand struct {
 | 
			
		||||
	Id        int64 `json:"id"`
 | 
			
		||||
	AccountId int64 `json:"-"`
 | 
			
		||||
	Id    int64 `json:"id"`
 | 
			
		||||
	OrgId int64 `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ----------------------
 | 
			
		||||
// QUERIES
 | 
			
		||||
 | 
			
		||||
type GetApiKeysQuery struct {
 | 
			
		||||
	AccountId int64
 | 
			
		||||
	Result    []*ApiKey
 | 
			
		||||
	OrgId  int64
 | 
			
		||||
	Result []*ApiKey
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type GetApiKeyByKeyQuery struct {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user