Skip to content

Commit 31c02e1

Browse files
committed
Rename tls-ssl to tls
1 parent 42aa923 commit 31c02e1

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

pkg/plugin/datasource.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func NewDatasource(ctx context.Context, source backend.DataSourceInstanceSetting
4848

4949
opts := options.Client().ApplyURI(uri)
5050

51-
if config.AuthMethod == "auth-tls-ssl" {
51+
if config.AuthMethod == "auth-tls" {
5252
// TLS setup
5353
tlsConfig, err := tlsSetup(config)
5454
if err != nil {
@@ -254,7 +254,7 @@ func (d *Datasource) CheckHealth(ctx context.Context, req *backend.CheckHealthRe
254254

255255
opts := options.Client().ApplyURI(uri).SetTimeout(5 * time.Second)
256256

257-
if config.AuthMethod == "auth-tls-ssl" {
257+
if config.AuthMethod == "auth-tls" {
258258
// TLS setup
259259
tlsConfig, err := tlsSetup(config)
260260
if err != nil {

pkg/plugin/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func MongoUri(config *models.PluginSettings) (string, error) {
8686
}
8787

8888
// TLS passphrase
89-
if config.AuthMethod == "auth-tls-ssl" && config.Secrets.ClientKeyPassword != "" {
89+
if config.AuthMethod == "auth-tls" && config.Secrets.ClientKeyPassword != "" {
9090
params += "&sslClientCertificateKeyPassword=" + config.Secrets.ClientKeyPassword
9191
}
9292

src/components/ConfigEditor.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface Props extends DataSourcePluginOptionsEditorProps<MongoDataSourceOption
2222
const mongoDBAuthMethods: SelectableValue[] = [
2323
{ label: 'None', value: MongoDBAuthMethod.NONE },
2424
{ label: 'Username/Password', value: MongoDBAuthMethod.USERNAME_PASSWORD },
25-
{ label: 'TLS/SSL', value: MongoDBAuthMethod.TLS_SSL },
25+
{ label: 'TLS/SSL', value: MongoDBAuthMethod.TLS },
2626
];
2727

2828
const mongoConnectionStringSchemes: SelectableValue[] = [
@@ -34,6 +34,7 @@ export function ConfigEditor(props: Props) {
3434
const { onOptionsChange, options } = props;
3535
const { jsonData, secureJsonFields, secureJsonData } = options;
3636

37+
// Setup default values
3738
if (!jsonData.authType) {
3839
jsonData.authType = MongoDBAuthMethod.NONE;
3940
}
@@ -212,7 +213,7 @@ export function ConfigEditor(props: Props) {
212213
</>
213214
)}
214215

215-
{jsonData.authType === MongoDBAuthMethod.TLS_SSL && (
216+
{jsonData.authType === MongoDBAuthMethod.TLS && (
216217
<>
217218
<Field label="Certificate Authority" description="Path to Certificate Authority (.pem)">
218219
<Input

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export interface JsQueryResult {
5050
export const MongoDBAuthMethod = {
5151
NONE: 'auth-none',
5252
USERNAME_PASSWORD: 'auth-username-password',
53-
TLS_SSL: 'auth-tls-ssl',
53+
TLS: 'auth-tls',
5454
};
5555

5656
export const ConnectionStringScheme = {

0 commit comments

Comments
 (0)