Datasource: Remove support for unencrypted passwords (#49987)

* Datasource: Remove support for unencrypted passwords

* regenerate swagger

* [WIP] Remove references to datasource password and basic auth password fields (#50015)

* try delete moar tings

* delete provisioning stuff

* remove from yaml

* update snapshots

* remove lingering snapshot fields

* fix ds http settings

* Re-generate swagger and fix swagger-api-spec make target

Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
This commit is contained in:
Marcus Efraimsson
2022-06-03 17:38:22 +02:00
committed by GitHub
parent b344f48e68
commit 36c3398c6d
33 changed files with 268 additions and 430 deletions

View File

@@ -170,7 +170,7 @@ exports[`no enzyme tests`] = {
"public/app/plugins/datasource/cloud-monitoring/components/Aggregation.test.tsx:3822406835": [
[1, 19, 13, "RegExp match", "2409514259"]
],
"public/app/plugins/datasource/cloudwatch/components/ConfigEditor.test.tsx:1224072551": [
"public/app/plugins/datasource/cloudwatch/components/ConfigEditor.test.tsx:227258837": [
[0, 19, 13, "RegExp match", "2409514259"]
],
"public/app/plugins/datasource/cloudwatch/components/LogsQueryField.test.tsx:1501504663": [
@@ -182,7 +182,7 @@ exports[`no enzyme tests`] = {
"public/app/plugins/datasource/elasticsearch/configuration/DataLinks.test.tsx:248699332": [
[0, 17, 13, "RegExp match", "2409514259"]
],
"public/app/plugins/datasource/influxdb/components/ConfigEditor.test.tsx:3456478975": [
"public/app/plugins/datasource/influxdb/components/ConfigEditor.test.tsx:57753101": [
[0, 19, 13, "RegExp match", "2409514259"]
],
"public/app/plugins/datasource/loki/components/LokiExploreQueryEditor.test.tsx:1488067923": [

View File

@@ -19,8 +19,6 @@ apiVersion: 1
# orgId: 1
# # <string> url
# url: http://localhost:8080
# # <string> database password, if used
# password:
# # <string> database user, if used
# user:
# # <string> database name, if used
@@ -29,8 +27,6 @@ apiVersion: 1
# basicAuth:
# # <string> basic auth username
# basicAuthUser:
# # <string> basic auth password
# basicAuthPassword:
# # <bool> enable/disable with credentials headers
# withCredentials:
# # <bool> mark as default datasource. Max one per org

View File

@@ -98,8 +98,6 @@ datasources:
uid: my_unique_uid
# <string> url
url: http://localhost:8080
# <string> Deprecated, use secureJsonData.password
password:
# <string> database user, if used
user:
# <string> database name, if used
@@ -108,8 +106,6 @@ datasources:
basicAuth:
# <string> basic auth username
basicAuthUser:
# <string> Deprecated, use secureJsonData.basicAuthPassword
basicAuthPassword:
# <bool> enable/disable with credentials headers
withCredentials:
# <bool> mark as default datasource. Max one per org

View File

@@ -37,5 +37,6 @@ datasources:
# optionally
basicAuth: true
basicAuthUser: my_user
secureJsonData:
basicAuthPassword: test_password
```

View File

@@ -255,7 +255,6 @@ datasources:
url: http://localhost:3100
basicAuth: true
basicAuthUser: my_user
basicAuthPassword: test_password
jsonData:
maxLines: 1000
derivedFields:
@@ -272,6 +271,8 @@ datasources:
- matcherRegex: "traceID=(\\w+)"
name: TraceID
url: 'http://localhost:16686/trace/$${__value.raw}'
secureJsonData:
basicAuthPassword: test_password
```
Here's an example of a Jaeger data source corresponding to the above example. Note that the Jaeger `uid` value does match the Loki `datasourceUid` value.

View File

@@ -536,11 +536,9 @@ export interface DataSourceSettings<T extends DataSourceJsonData = DataSourceJso
typeName: string;
access: string;
url: string;
password: string;
user: string;
database: string;
basicAuth: boolean;
basicAuthPassword: string;
basicAuthUser: string;
isDefault: boolean;
jsonData: T;

View File

@@ -12,7 +12,6 @@ export const BasicAuthSettings: React.FC<HttpSettingsProps> = ({ dataSourceConfi
const onPasswordReset = () => {
onChange({
...dataSourceConfig,
basicAuthPassword: '',
secureJsonData: {
...dataSourceConfig.secureJsonData,
basicAuthPassword: '',
@@ -48,10 +47,7 @@ export const BasicAuthSettings: React.FC<HttpSettingsProps> = ({ dataSourceConfi
</InlineField>
<InlineField>
<SecretFormField
isConfigured={
!!dataSourceConfig.basicAuthPassword ||
!!(dataSourceConfig.secureJsonFields && dataSourceConfig.secureJsonFields.basicAuthPassword)
}
isConfigured={!!(dataSourceConfig.secureJsonFields && dataSourceConfig.secureJsonFields.basicAuthPassword)}
value={password || ''}
inputWidth={18}
labelWidth={10}

View File

@@ -17,12 +17,10 @@ const setup = (propOverrides?: object) => {
typeLogoUrl: '',
access: 'direct',
url: 'http://localhost:8086',
password: '',
user: 'grafana',
database: 'site',
basicAuth: false,
basicAuthUser: '',
basicAuthPassword: '',
withCredentials: false,
isDefault: false,
jsonData: {

View File

@@ -17,12 +17,10 @@ const settingsMock: DataSourceSettings<any, any> = {
typeLogoUrl: '',
access: 'direct',
url: 'http://localhost:8086',
password: '',
user: 'grafana',
database: 'site',
basicAuth: false,
basicAuthUser: '',
basicAuthPassword: '',
withCredentials: false,
isDefault: false,
jsonData: {

View File

@@ -18,12 +18,10 @@ const setup = (propOverrides?: object) => {
typeLogoUrl: '',
access: 'direct',
url: 'http://localhost:8086',
password: '',
user: 'grafana',
database: 'site',
basicAuth: false,
basicAuthUser: '',
basicAuthPassword: '',
withCredentials: false,
isDefault: false,
jsonData: {

View File

@@ -48,7 +48,6 @@ func (hs *HTTPServer) GetDataSources(c *models.ReqContext) response.Response {
Type: ds.Type,
TypeName: ds.Type,
Access: ds.Access,
Password: ds.Password,
Database: ds.Database,
User: ds.User,
BasicAuth: ds.BasicAuth,
@@ -488,12 +487,10 @@ func (hs *HTTPServer) convertModelToDtos(ctx context.Context, ds *models.DataSou
Url: ds.Url,
Type: ds.Type,
Access: ds.Access,
Password: ds.Password,
Database: ds.Database,
User: ds.User,
BasicAuth: ds.BasicAuth,
BasicAuthUser: ds.BasicAuthUser,
BasicAuthPassword: ds.BasicAuthPassword,
WithCredentials: ds.WithCredentials,
IsDefault: ds.IsDefault,
JsonData: ds.JsonData,

View File

@@ -17,12 +17,10 @@ type DataSource struct {
TypeLogoUrl string `json:"typeLogoUrl"`
Access models.DsAccess `json:"access"`
Url string `json:"url"`
Password string `json:"password"`
User string `json:"user"`
Database string `json:"database"`
BasicAuth bool `json:"basicAuth"`
BasicAuthUser string `json:"basicAuthUser"`
BasicAuthPassword string `json:"basicAuthPassword"`
WithCredentials bool `json:"withCredentials"`
IsDefault bool `json:"isDefault"`
JsonData *simplejson.Json `json:"jsonData,omitempty"`
@@ -42,7 +40,6 @@ type DataSourceListItemDTO struct {
TypeLogoUrl string `json:"typeLogoUrl"`
Access models.DsAccess `json:"access"`
Url string `json:"url"`
Password string `json:"password"`
User string `json:"user"`
Database string `json:"database"`
BasicAuth bool `json:"basicAuth"`

View File

@@ -366,7 +366,6 @@ func TestDataSourceProxy_routeRule(t *testing.T) {
Url: "http://influxdb:8083",
Database: "site",
User: "user",
Password: "password",
}
ctx := &models.ReqContext{}
@@ -557,18 +556,18 @@ func TestDataSourceProxy_routeRule(t *testing.T) {
secretsService := secretsManager.SetupTestService(t, fakes.NewFakeSecretsStore())
tests := []*testCase{
createAuthTest(t, secretsStore, models.DS_INFLUXDB_08, "http://localhost:9090", authTypePassword, authCheckQuery, false),
createAuthTest(t, secretsStore, models.DS_INFLUXDB_08, "http://localhost:9090", authTypePassword, authCheckQuery, true),
createAuthTest(t, secretsStore, models.DS_INFLUXDB, "http://localhost:9090", authTypePassword, authCheckHeader, true),
createAuthTest(t, secretsStore, models.DS_INFLUXDB, "http://localhost:9090", authTypePassword, authCheckHeader, false),
createAuthTest(t, secretsStore, models.DS_INFLUXDB, "http://localhost:9090", authTypeBasic, authCheckHeader, true),
createAuthTest(t, secretsStore, models.DS_INFLUXDB, "http://localhost:9090", authTypeBasic, authCheckHeader, false),
createAuthTest(t, secretsStore, models.DS_INFLUXDB_08, "http://localhost:9090", authTypePassword, authCheckQuery),
createAuthTest(t, secretsStore, models.DS_INFLUXDB_08, "http://localhost:9090", authTypePassword, authCheckQuery),
createAuthTest(t, secretsStore, models.DS_INFLUXDB, "http://localhost:9090", authTypePassword, authCheckHeader),
createAuthTest(t, secretsStore, models.DS_INFLUXDB, "http://localhost:9090", authTypePassword, authCheckHeader),
createAuthTest(t, secretsStore, models.DS_INFLUXDB, "http://localhost:9090", authTypeBasic, authCheckHeader),
createAuthTest(t, secretsStore, models.DS_INFLUXDB, "http://localhost:9090", authTypeBasic, authCheckHeader),
// These two should be enough for any other datasource at the moment. Proxy has special handling
// only for Influx, others have the same path and only BasicAuth. Non BasicAuth datasources
// do not go through proxy but through TSDB API which is not tested here.
createAuthTest(t, secretsStore, models.DS_ES, "http://localhost:9200", authTypeBasic, authCheckHeader, false),
createAuthTest(t, secretsStore, models.DS_ES, "http://localhost:9200", authTypeBasic, authCheckHeader, true),
createAuthTest(t, secretsStore, models.DS_ES, "http://localhost:9200", authTypeBasic, authCheckHeader),
createAuthTest(t, secretsStore, models.DS_ES, "http://localhost:9200", authTypeBasic, authCheckHeader),
}
for _, test := range tests {
runDatasourceAuthTest(t, secretsService, secretsStore, cfg, test)
@@ -918,7 +917,7 @@ const (
authCheckHeader = "header"
)
func createAuthTest(t *testing.T, secretsStore kvstore.SecretsKVStore, dsType string, url string, authType string, authCheck string, useSecureJsonData bool) *testCase {
func createAuthTest(t *testing.T, secretsStore kvstore.SecretsKVStore, dsType string, url string, authType string, authCheck string) *testCase {
// Basic user:password
base64AuthHeader := "Basic dXNlcjpwYXNzd29yZA=="
@@ -926,7 +925,7 @@ func createAuthTest(t *testing.T, secretsStore kvstore.SecretsKVStore, dsType st
datasource: &models.DataSource{
Id: 1,
OrgId: 1,
Name: fmt.Sprintf("%s,%s,%s,%s,%t", dsType, url, authType, authCheck, useSecureJsonData),
Name: fmt.Sprintf("%s,%s,%s,%s", dsType, url, authType, authCheck),
Type: dsType,
JsonData: simplejson.New(),
Url: url,
@@ -937,7 +936,6 @@ func createAuthTest(t *testing.T, secretsStore kvstore.SecretsKVStore, dsType st
if authType == authTypePassword {
message = fmt.Sprintf("%v should add username and password", dsType)
test.datasource.User = "user"
if useSecureJsonData {
secureJsonData, err := json.Marshal(map[string]string{
"password": "password",
})
@@ -945,14 +943,10 @@ func createAuthTest(t *testing.T, secretsStore kvstore.SecretsKVStore, dsType st
err = secretsStore.Set(context.Background(), test.datasource.OrgId, test.datasource.Name, "datasource", string(secureJsonData))
require.NoError(t, err)
} else {
test.datasource.Password = "password"
}
} else {
message = fmt.Sprintf("%v should add basic auth username and password", dsType)
test.datasource.BasicAuth = true
test.datasource.BasicAuthUser = "user"
if useSecureJsonData {
secureJsonData, err := json.Marshal(map[string]string{
"basicAuthPassword": "password",
})
@@ -960,15 +954,10 @@ func createAuthTest(t *testing.T, secretsStore kvstore.SecretsKVStore, dsType st
err = secretsStore.Set(context.Background(), test.datasource.OrgId, test.datasource.Name, "datasource", string(secureJsonData))
require.NoError(t, err)
} else {
test.datasource.BasicAuthPassword = "password"
}
}
require.NoError(t, err)
if useSecureJsonData {
message += " from securejsondata"
}
if authCheck == authCheckQuery {
message += " to query params"

View File

@@ -50,12 +50,14 @@ type DataSource struct {
Type string `json:"type"`
Access DsAccess `json:"access"`
Url string `json:"url"`
Password string `json:"password"`
// swagger:ignore
Password string `json:"-"`
User string `json:"user"`
Database string `json:"database"`
BasicAuth bool `json:"basicAuth"`
BasicAuthUser string `json:"basicAuthUser"`
BasicAuthPassword string `json:"basicAuthPassword"`
// swagger:ignore
BasicAuthPassword string `json:"-"`
WithCredentials bool `json:"withCredentials"`
IsDefault bool `json:"isDefault"`
JsonData *simplejson.Json `json:"jsonData"`
@@ -88,12 +90,10 @@ type AddDataSourceCommand struct {
Type string `json:"type" binding:"Required"`
Access DsAccess `json:"access" binding:"Required"`
Url string `json:"url"`
Password string `json:"password"`
Database string `json:"database"`
User string `json:"user"`
BasicAuth bool `json:"basicAuth"`
BasicAuthUser string `json:"basicAuthUser"`
BasicAuthPassword string `json:"basicAuthPassword"`
WithCredentials bool `json:"withCredentials"`
IsDefault bool `json:"isDefault"`
JsonData *simplejson.Json `json:"jsonData"`
@@ -114,12 +114,10 @@ type UpdateDataSourceCommand struct {
Type string `json:"type" binding:"Required"`
Access DsAccess `json:"access" binding:"Required"`
Url string `json:"url"`
Password string `json:"password"`
User string `json:"user"`
Database string `json:"database"`
BasicAuth bool `json:"basicAuth"`
BasicAuthUser string `json:"basicAuthUser"`
BasicAuthPassword string `json:"basicAuthPassword"`
WithCredentials bool `json:"withCredentials"`
IsDefault bool `json:"isDefault"`
JsonData *simplejson.Json `json:"jsonData"`

View File

@@ -340,7 +340,7 @@ func (s *Service) DecryptedBasicAuthPassword(ctx context.Context, ds *models.Dat
return value, nil
}
return ds.BasicAuthPassword, err
return "", err
}
func (s *Service) DecryptedPassword(ctx context.Context, ds *models.DataSource) (string, error) {
@@ -349,7 +349,7 @@ func (s *Service) DecryptedPassword(ctx context.Context, ds *models.DataSource)
return value, nil
}
return ds.Password, err
return "", err
}
func (s *Service) httpClientOptions(ctx context.Context, ds *models.DataSource) (*sdkhttpclient.Options, error) {

View File

@@ -240,11 +240,9 @@ func validateDatasource(t *testing.T, dsCfg *configs) {
require.Equal(t, ds.OrgID, int64(2))
require.Equal(t, ds.URL, "url")
require.Equal(t, ds.User, "user")
require.Equal(t, ds.Password, "password")
require.Equal(t, ds.Database, "database")
require.True(t, ds.BasicAuth)
require.Equal(t, ds.BasicAuthUser, "basic_auth_user")
require.Equal(t, ds.BasicAuthPassword, "basic_auth_password")
require.True(t, ds.WithCredentials)
require.True(t, ds.IsDefault)
require.True(t, ds.Editable)

View File

@@ -6,12 +6,10 @@ datasources:
access: proxy
orgId: 2
url: url
password: password
user: user
database: database
basicAuth: true
basicAuthUser: basic_auth_user
basicAuthPassword: basic_auth_password
withCredentials: true
isDefault: true
jsonData:

View File

@@ -9,12 +9,10 @@ apiVersion: 1
# access: proxy
# orgId: 2
# url: url
# password: password
# user: user
# database: database
# basicAuth: true
# basicAuthUser: basic_auth_user
# basicAuthPassword: basic_auth_password
# withCredentials: true
# jsonData:
# graphiteVersion: "1.1"

View File

@@ -16,8 +16,6 @@
# org_id: 1
# # <string> url
# url: http://localhost:8080
# # <string> database password, if used
# password:
# # <string> database user, if used
# user:
# # <string> database name, if used
@@ -26,8 +24,6 @@
# basic_auth:
# # <string> basic auth username
# basic_auth_user:
# # <string> basic auth password
# basic_auth_password:
# # <bool> enable/disable with credentials headers
# with_credentials:
# # <bool> mark as default datasource. Max one per org

View File

@@ -4,12 +4,10 @@ datasources:
access: proxy
org_id: 2
url: url
password: password
user: user
database: database
basic_auth: true
basic_auth_user: basic_auth_user
basic_auth_password: basic_auth_password
with_credentials: true
is_default: true
json_data:

View File

@@ -36,12 +36,10 @@ type upsertDataSourceFromConfig struct {
Type string
Access string
URL string
Password string
User string
Database string
BasicAuth bool
BasicAuthUser string
BasicAuthPassword string
WithCredentials bool
IsDefault bool
JSONData map[string]interface{}
@@ -82,12 +80,10 @@ type upsertDataSourceFromConfigV0 struct {
Type string `json:"type" yaml:"type"`
Access string `json:"access" yaml:"access"`
URL string `json:"url" yaml:"url"`
Password string `json:"password" yaml:"password"`
User string `json:"user" yaml:"user"`
Database string `json:"database" yaml:"database"`
BasicAuth bool `json:"basic_auth" yaml:"basic_auth"`
BasicAuthUser string `json:"basic_auth_user" yaml:"basic_auth_user"`
BasicAuthPassword string `json:"basic_auth_password" yaml:"basic_auth_password"`
WithCredentials bool `json:"with_credentials" yaml:"with_credentials"`
IsDefault bool `json:"is_default" yaml:"is_default"`
JSONData map[string]interface{} `json:"json_data" yaml:"json_data"`
@@ -102,12 +98,10 @@ type upsertDataSourceFromConfigV1 struct {
Type values.StringValue `json:"type" yaml:"type"`
Access values.StringValue `json:"access" yaml:"access"`
URL values.StringValue `json:"url" yaml:"url"`
Password values.StringValue `json:"password" yaml:"password"`
User values.StringValue `json:"user" yaml:"user"`
Database values.StringValue `json:"database" yaml:"database"`
BasicAuth values.BoolValue `json:"basicAuth" yaml:"basicAuth"`
BasicAuthUser values.StringValue `json:"basicAuthUser" yaml:"basicAuthUser"`
BasicAuthPassword values.StringValue `json:"basicAuthPassword" yaml:"basicAuthPassword"`
WithCredentials values.BoolValue `json:"withCredentials" yaml:"withCredentials"`
IsDefault values.BoolValue `json:"isDefault" yaml:"isDefault"`
JSONData values.JSONValue `json:"jsonData" yaml:"jsonData"`
@@ -132,12 +126,10 @@ func (cfg *configsV1) mapToDatasourceFromConfig(apiVersion int64) *configs {
Type: ds.Type.Value(),
Access: ds.Access.Value(),
URL: ds.URL.Value(),
Password: ds.Password.Value(),
User: ds.User.Value(),
Database: ds.Database.Value(),
BasicAuth: ds.BasicAuth.Value(),
BasicAuthUser: ds.BasicAuthUser.Value(),
BasicAuthPassword: ds.BasicAuthPassword.Value(),
WithCredentials: ds.WithCredentials.Value(),
IsDefault: ds.IsDefault.Value(),
JSONData: ds.JSONData.Value(),
@@ -146,23 +138,6 @@ func (cfg *configsV1) mapToDatasourceFromConfig(apiVersion int64) *configs {
Version: ds.Version.Value(),
UID: ds.UID.Value(),
})
// Using Raw value for the warnings here so that even if it uses env interpolation and the env var is empty
// it will still warn
if len(ds.Password.Raw) > 0 {
cfg.log.Warn(
"[Deprecated] the use of password field is deprecated. Please use secureJsonData.password",
"datasource name",
ds.Name.Value(),
)
}
if len(ds.BasicAuthPassword.Raw) > 0 {
cfg.log.Warn(
"[Deprecated] the use of basicAuthPassword field is deprecated. Please use secureJsonData.basicAuthPassword",
"datasource name",
ds.Name.Value(),
)
}
}
for _, ds := range cfg.DeleteDatasources {
@@ -191,12 +166,10 @@ func (cfg *configsV0) mapToDatasourceFromConfig(apiVersion int64) *configs {
Type: ds.Type,
Access: ds.Access,
URL: ds.URL,
Password: ds.Password,
User: ds.User,
Database: ds.Database,
BasicAuth: ds.BasicAuth,
BasicAuthUser: ds.BasicAuthUser,
BasicAuthPassword: ds.BasicAuthPassword,
WithCredentials: ds.WithCredentials,
IsDefault: ds.IsDefault,
JSONData: ds.JSONData,
@@ -230,12 +203,10 @@ func createInsertCommand(ds *upsertDataSourceFromConfig) *models.AddDataSourceCo
Type: ds.Type,
Access: models.DsAccess(ds.Access),
Url: ds.URL,
Password: ds.Password,
User: ds.User,
Database: ds.Database,
BasicAuth: ds.BasicAuth,
BasicAuthUser: ds.BasicAuthUser,
BasicAuthPassword: ds.BasicAuthPassword,
WithCredentials: ds.WithCredentials,
IsDefault: ds.IsDefault,
JsonData: jsonData,
@@ -273,12 +244,10 @@ func createUpdateCommand(ds *upsertDataSourceFromConfig, id int64) *models.Updat
Type: ds.Type,
Access: models.DsAccess(ds.Access),
Url: ds.URL,
Password: ds.Password,
User: ds.User,
Database: ds.Database,
BasicAuth: ds.BasicAuth,
BasicAuthUser: ds.BasicAuthUser,
BasicAuthPassword: ds.BasicAuthPassword,
WithCredentials: ds.WithCredentials,
IsDefault: ds.IsDefault,
JsonData: jsonData,

View File

@@ -158,12 +158,10 @@ func (ss *SQLStore) AddDataSource(ctx context.Context, cmd *models.AddDataSource
Access: cmd.Access,
Url: cmd.Url,
User: cmd.User,
Password: cmd.Password,
Database: cmd.Database,
IsDefault: cmd.IsDefault,
BasicAuth: cmd.BasicAuth,
BasicAuthUser: cmd.BasicAuthUser,
BasicAuthPassword: cmd.BasicAuthPassword,
WithCredentials: cmd.WithCredentials,
JsonData: cmd.JsonData,
SecureJsonData: cmd.EncryptedSecureJsonData,
@@ -222,12 +220,10 @@ func (ss *SQLStore) UpdateDataSource(ctx context.Context, cmd *models.UpdateData
Access: cmd.Access,
Url: cmd.Url,
User: cmd.User,
Password: cmd.Password,
Database: cmd.Database,
IsDefault: cmd.IsDefault,
BasicAuth: cmd.BasicAuth,
BasicAuthUser: cmd.BasicAuthUser,
BasicAuthPassword: cmd.BasicAuthPassword,
WithCredentials: cmd.WithCredentials,
JsonData: cmd.JsonData,
SecureJsonData: cmd.EncryptedSecureJsonData,

View File

@@ -6832,13 +6832,6 @@
"summary": "Add External Group.",
"operationId": "addTeamGroupApi",
"parameters": [
{
"type": "integer",
"format": "int64",
"name": "teamId",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
@@ -6846,6 +6839,13 @@
"schema": {
"$ref": "#/definitions/TeamGroupMapping"
}
},
{
"type": "integer",
"format": "int64",
"name": "teamId",
"in": "path",
"required": true
}
],
"responses": {
@@ -6879,14 +6879,14 @@
{
"type": "integer",
"format": "int64",
"name": "teamId",
"name": "groupId",
"in": "path",
"required": true
},
{
"type": "integer",
"format": "int64",
"name": "groupId",
"name": "teamId",
"in": "path",
"required": true
}
@@ -8002,9 +8002,6 @@
"basicAuth": {
"type": "boolean"
},
"basicAuthPassword": {
"type": "string"
},
"basicAuthUser": {
"type": "string"
},
@@ -8020,9 +8017,6 @@
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"secureJsonData": {
"type": "object",
"additionalProperties": {
@@ -9711,9 +9705,6 @@
"basicAuth": {
"type": "boolean"
},
"basicAuthPassword": {
"type": "string"
},
"basicAuthUser": {
"type": "string"
},
@@ -9737,9 +9728,6 @@
"type": "integer",
"format": "int64"
},
"password": {
"type": "string"
},
"readOnly": {
"type": "boolean"
},
@@ -9808,9 +9796,6 @@
"type": "integer",
"format": "int64"
},
"password": {
"type": "string"
},
"readOnly": {
"type": "boolean"
},
@@ -14454,9 +14439,6 @@
"basicAuth": {
"type": "boolean"
},
"basicAuthPassword": {
"type": "string"
},
"basicAuthUser": {
"type": "string"
},
@@ -14472,9 +14454,6 @@
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"secureJsonData": {
"type": "object",
"additionalProperties": {

View File

@@ -6832,13 +6832,6 @@
"summary": "Add External Group.",
"operationId": "addTeamGroupApi",
"parameters": [
{
"type": "integer",
"format": "int64",
"name": "teamId",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
@@ -6846,6 +6839,13 @@
"schema": {
"$ref": "#/definitions/TeamGroupMapping"
}
},
{
"type": "integer",
"format": "int64",
"name": "teamId",
"in": "path",
"required": true
}
],
"responses": {
@@ -6879,14 +6879,14 @@
{
"type": "integer",
"format": "int64",
"name": "teamId",
"name": "groupId",
"in": "path",
"required": true
},
{
"type": "integer",
"format": "int64",
"name": "groupId",
"name": "teamId",
"in": "path",
"required": true
}
@@ -7993,9 +7993,6 @@
"basicAuth": {
"type": "boolean"
},
"basicAuthPassword": {
"type": "string"
},
"basicAuthUser": {
"type": "string"
},
@@ -8011,9 +8008,6 @@
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"secureJsonData": {
"type": "object",
"additionalProperties": {
@@ -9455,9 +9449,6 @@
"basicAuth": {
"type": "boolean"
},
"basicAuthPassword": {
"type": "string"
},
"basicAuthUser": {
"type": "string"
},
@@ -9481,9 +9472,6 @@
"type": "integer",
"format": "int64"
},
"password": {
"type": "string"
},
"readOnly": {
"type": "boolean"
},
@@ -9552,9 +9540,6 @@
"type": "integer",
"format": "int64"
},
"password": {
"type": "string"
},
"readOnly": {
"type": "boolean"
},
@@ -11772,9 +11757,6 @@
"basicAuth": {
"type": "boolean"
},
"basicAuthPassword": {
"type": "string"
},
"basicAuthUser": {
"type": "string"
},
@@ -11790,9 +11772,6 @@
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"secureJsonData": {
"type": "object",
"additionalProperties": {

View File

@@ -13,7 +13,6 @@ export const getMockDataSources = (amount: number) => {
jsonData: { authType: 'credentials', defaultRegion: 'eu-west-2' },
name: `dataSource-${i}`,
orgId: 1,
password: '',
readOnly: false,
type: 'cloudwatch',
typeLogoUrl: 'public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png',
@@ -30,7 +29,6 @@ export const getMockDataSource = (): DataSourceSettings => {
access: '',
basicAuth: false,
basicAuthUser: '',
basicAuthPassword: '',
withCredentials: false,
database: '',
id: 13,
@@ -40,7 +38,6 @@ export const getMockDataSource = (): DataSourceSettings => {
name: 'gdev-cloudwatch',
typeName: 'Cloudwatch',
orgId: 1,
password: '',
readOnly: false,
type: 'cloudwatch',
typeLogoUrl: 'public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png',

View File

@@ -43,7 +43,6 @@ exports[`Render should render action bar and datasources 1`] = `
},
"name": "dataSource-0",
"orgId": 1,
"password": "",
"readOnly": false,
"type": "cloudwatch",
"typeLogoUrl": "public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png",
@@ -62,7 +61,6 @@ exports[`Render should render action bar and datasources 1`] = `
},
"name": "dataSource-1",
"orgId": 1,
"password": "",
"readOnly": false,
"type": "cloudwatch",
"typeLogoUrl": "public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png",
@@ -81,7 +79,6 @@ exports[`Render should render action bar and datasources 1`] = `
},
"name": "dataSource-2",
"orgId": 1,
"password": "",
"readOnly": false,
"type": "cloudwatch",
"typeLogoUrl": "public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png",
@@ -100,7 +97,6 @@ exports[`Render should render action bar and datasources 1`] = `
},
"name": "dataSource-3",
"orgId": 1,
"password": "",
"readOnly": false,
"type": "cloudwatch",
"typeLogoUrl": "public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png",
@@ -119,7 +115,6 @@ exports[`Render should render action bar and datasources 1`] = `
},
"name": "dataSource-4",
"orgId": 1,
"password": "",
"readOnly": false,
"type": "cloudwatch",
"typeLogoUrl": "public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png",

View File

@@ -11,11 +11,9 @@ export function createDatasourceSettings<T>(jsonData: T): DataSourceSettings<T>
typeName: 'Datasource',
access: 'server',
url: 'http://localhost',
password: '',
user: '',
database: '',
basicAuth: false,
basicAuthPassword: '',
basicAuthUser: '',
isDefault: false,
jsonData,

View File

@@ -154,7 +154,6 @@ export function getDataSourceLoadingNav(pageName: string): NavModel {
access: '',
basicAuth: false,
basicAuthUser: '',
basicAuthPassword: '',
withCredentials: false,
database: '',
id: 1,
@@ -163,7 +162,6 @@ export function getDataSourceLoadingNav(pageName: string): NavModel {
jsonData: { authType: 'credentials', defaultRegion: 'eu-west-2' },
name: 'Loading',
orgId: 1,
password: '',
readOnly: false,
type: loadingDSType,
typeName: loadingDSType,

View File

@@ -34,9 +34,7 @@ const setup = (propOverrides?: object) => {
type: 'cloudwatch',
typeName: 'Cloudwatch',
user: '',
password: '',
basicAuth: false,
basicAuthPassword: '',
basicAuthUser: '',
isDefault: true,
readOnly: false,

View File

@@ -8,7 +8,6 @@ exports[`Render should disable access key id field 1`] = `
Object {
"access": "proxy",
"basicAuth": false,
"basicAuthPassword": "",
"basicAuthUser": "",
"database": "",
"id": 1,
@@ -24,7 +23,6 @@ exports[`Render should disable access key id field 1`] = `
},
"name": "CloudWatch",
"orgId": 1,
"password": "",
"readOnly": false,
"secureJsonData": Object {
"accessKey": "",
@@ -99,7 +97,6 @@ exports[`Render should render component 1`] = `
Object {
"access": "proxy",
"basicAuth": false,
"basicAuthPassword": "",
"basicAuthUser": "",
"database": "",
"id": 1,
@@ -115,7 +112,6 @@ exports[`Render should render component 1`] = `
},
"name": "CloudWatch",
"orgId": 1,
"password": "",
"readOnly": false,
"secureJsonData": Object {
"accessKey": "",
@@ -190,7 +186,6 @@ exports[`Render should show access key and secret access key fields 1`] = `
Object {
"access": "proxy",
"basicAuth": false,
"basicAuthPassword": "",
"basicAuthUser": "",
"database": "",
"id": 1,
@@ -206,7 +201,6 @@ exports[`Render should show access key and secret access key fields 1`] = `
},
"name": "CloudWatch",
"orgId": 1,
"password": "",
"readOnly": false,
"secureJsonData": Object {
"accessKey": "",
@@ -281,7 +275,6 @@ exports[`Render should show arn role field 1`] = `
Object {
"access": "proxy",
"basicAuth": false,
"basicAuthPassword": "",
"basicAuthUser": "",
"database": "",
"id": 1,
@@ -297,7 +290,6 @@ exports[`Render should show arn role field 1`] = `
},
"name": "CloudWatch",
"orgId": 1,
"password": "",
"readOnly": false,
"secureJsonData": Object {
"accessKey": "",
@@ -372,7 +364,6 @@ exports[`Render should show credentials profile name field 1`] = `
Object {
"access": "proxy",
"basicAuth": false,
"basicAuthPassword": "",
"basicAuthUser": "",
"database": "",
"id": 1,
@@ -388,7 +379,6 @@ exports[`Render should show credentials profile name field 1`] = `
},
"name": "CloudWatch",
"orgId": 1,
"password": "",
"readOnly": false,
"secureJsonData": Object {
"accessKey": "",

View File

@@ -14,12 +14,10 @@ describe('AppInsights ConfigEditor', () => {
typeName: 'Azure',
access: 'proxy',
url: '',
password: '',
user: '',
database: '',
basicAuth: false,
basicAuthUser: '',
basicAuthPassword: '',
withCredentials: false,
isDefault: false,
jsonData: {},

View File

@@ -26,12 +26,10 @@ const setup = (propOverrides?: object) => {
typeLogoUrl: '',
access: 'proxy',
url: '',
password: '',
user: '',
database: '',
basicAuth: false,
basicAuthUser: '',
basicAuthPassword: '',
withCredentials: false,
isDefault: false,
jsonData: {

View File

@@ -57,7 +57,6 @@ exports[`Render should disable basic auth password input 1`] = `
Object {
"access": "proxy",
"basicAuth": false,
"basicAuthPassword": "",
"basicAuthUser": "",
"database": "",
"id": 21,
@@ -68,7 +67,6 @@ exports[`Render should disable basic auth password input 1`] = `
},
"name": "InfluxDB-3",
"orgId": 1,
"password": "",
"readOnly": false,
"secureJsonFields": Object {},
"type": "influxdb",
@@ -322,7 +320,6 @@ exports[`Render should hide basic auth fields when switch off 1`] = `
Object {
"access": "proxy",
"basicAuth": false,
"basicAuthPassword": "",
"basicAuthUser": "",
"database": "",
"id": 21,
@@ -333,7 +330,6 @@ exports[`Render should hide basic auth fields when switch off 1`] = `
},
"name": "InfluxDB-3",
"orgId": 1,
"password": "",
"readOnly": false,
"secureJsonFields": Object {},
"type": "influxdb",
@@ -587,7 +583,6 @@ exports[`Render should hide white listed cookies input when browser access chose
Object {
"access": "proxy",
"basicAuth": false,
"basicAuthPassword": "",
"basicAuthUser": "",
"database": "",
"id": 21,
@@ -598,7 +593,6 @@ exports[`Render should hide white listed cookies input when browser access chose
},
"name": "InfluxDB-3",
"orgId": 1,
"password": "",
"readOnly": false,
"secureJsonFields": Object {},
"type": "influxdb",
@@ -852,7 +846,6 @@ exports[`Render should render component 1`] = `
Object {
"access": "proxy",
"basicAuth": false,
"basicAuthPassword": "",
"basicAuthUser": "",
"database": "",
"id": 21,
@@ -863,7 +856,6 @@ exports[`Render should render component 1`] = `
},
"name": "InfluxDB-3",
"orgId": 1,
"password": "",
"readOnly": false,
"secureJsonFields": Object {},
"type": "influxdb",