Skip to content

Commit

Permalink
Add SSO option to Windows GUI (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmishchenko-ua authored Jun 14, 2022
1 parent e6f9312 commit 42b031f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion dsn/odbc_dsn.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ MADB_DsnMap DsnMap[] = {
{&DsnKeys[14], 2, ckReconnect, 0, 0},
{&DsnKeys[15], 2, ckConnectPrompt, 0, 0},
{&DsnKeys[16], 2, cbCharset, 0, 0},
{&DsnKeys[42], 2, cbBrowserSSO, 0, 0},
{&DsnKeys[34], 2, txtServerKey, 260, 0},
{&DsnKeys[18], 3, txtPluginDir, 260, 0},
{&DsnKeys[39], 3, ckNoSSPS, 0, 0},
Expand All @@ -98,7 +99,7 @@ MADB_DsnMap DsnMap[] = {
{&DsnKeys[32], 4, cbTls13, 4, 0},
{&DsnKeys[33], 4, cbForceTls, 0, 0},
{&DsnKeys[27], 4, txtCrl, 0, 0},
{&DsnKeys[25], 4, txtTlsPeerFp, 260, 0},
{&DsnKeys[25], 4, txtTlsPeerFp, 260, 0},
{&DsnKeys[26], 4, txtTlsPeerFpList, 260, 0},
{NULL, 0, 0, 0, 0}
};
Expand Down
15 changes: 8 additions & 7 deletions dsn/odbc_dsn.rc
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "Please specify a server name and port",IDC_STATIC,9,7,130,10,0,WS_EX_TRANSPARENT
LTEXT "Server Name:",lblServerName,15,21,49,11,0,WS_EX_TRANSPARENT | WS_EX_RIGHT
LTEXT "Please specify a user name and password to connect to SingleStore",IDC_STATIC,9,54,207,8,0,WS_EX_TRANSPARENT
LTEXT "Please specify a database to use",IDC_STATIC,9,105,207,8,0,WS_EX_TRANSPARENT
LTEXT "User name:",IDC_STATIC,26,70,38,8,0,WS_EX_TRANSPARENT | WS_EX_RIGHT
LTEXT "Password:",IDC_STATIC,30,88,34,8,0,WS_EX_TRANSPARENT | WS_EX_RIGHT
LTEXT "Database:",IDC_STATIC,20,121,34,8,0,WS_EX_TRANSPARENT | WS_EX_RIGHT
EDITTEXT txtServerName,71,18,141,14,ES_AUTOHSCROLL
EDITTEXT txtPort,71,34,40,14,ES_AUTOHSCROLL
LTEXT "Port:",lblPort,15,35,49,11,0,WS_EX_TRANSPARENT | WS_EX_RIGHT
EDITTEXT txtPort,71,34,40,14,ES_AUTOHSCROLL
LTEXT "Please specify a user name and password to connect to SingleStore",IDC_STATIC,9,54,287,8,0,WS_EX_TRANSPARENT
LTEXT "User name:",IDC_STATIC,26,70,38,8,0,WS_EX_TRANSPARENT | WS_EX_RIGHT
EDITTEXT txtUserName,71,68,141,14,ES_AUTOHSCROLL
LTEXT "Password:",IDC_STATIC,30,88,34,8,0,WS_EX_TRANSPARENT | WS_EX_RIGHT
EDITTEXT txtPassword,71,86,142,14,ES_PASSWORD | ES_AUTOHSCROLL
PUSHBUTTON "&Test DSN",pbTestDSN,223,86,50,14
LTEXT "Please specify a database to use",IDC_STATIC,9,105,207,8,0,WS_EX_TRANSPARENT
LTEXT "Database:",IDC_STATIC,20,121,34,8,0,WS_EX_TRANSPARENT | WS_EX_RIGHT
COMBOBOX cbDatabase,71,119,93,80,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "< Previous",PB_PREV,50,149,50,14
PUSHBUTTON "Next >",PB_NEXT,104,149,50,14
Expand All @@ -132,8 +132,9 @@ BEGIN
CONTROL "Enable automatic reconnect",ckReconnect,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,79,107,10,WS_EX_TRANSPARENT
CONTROL "Don't prompt when connecting",ckConnectPrompt,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,95,113,10,WS_EX_TRANSPARENT

COMBOBOX cbCharset,113,110,160,80,CBS_DROPDOWN | CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
RTEXT "Connection Character Set:",IDC_STATIC,7,113,96,8,0,WS_EX_TRANSPARENT
COMBOBOX cbCharset,113,110,160,80,CBS_DROPDOWN | CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
CONTROL "Use Single Sign-On Auth instead of password",cbBrowserSSO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,129,220,8,WS_EX_TRANSPARENT

PUSHBUTTON "Cancel",IDCANCEL,178,149,50,14
PUSHBUTTON "Next >",PB_NEXT,104,149,50,14
Expand Down
1 change: 1 addition & 0 deletions dsn/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
#define pbCrlBrowse 1214
#define cbInteractive 1220
#define ckNoSSPS 1221
#define cbBrowserSSO 1222

// Next default values for new objects
//
Expand Down
6 changes: 3 additions & 3 deletions ma_dsn.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ MADB_DsnKey DsnKeys[]=
{"FORWARDONLY", offsetof(MADB_Dsn, ForceForwardOnly), DSN_TYPE_OPTION, MADB_OPT_FLAG_FORWARD_CURSOR, 0},
{"COMPAT_MODE", offsetof(MADB_Dsn, CompatMode), DSN_TYPE_BOOL, 0, 0}, /* MYSQL_COMPATIBILITY_MODE */
{"NO_SSPS", offsetof(MADB_Dsn, NoSsps), DSN_TYPE_BOOL, 0, 0},
{"NO_CACHE", offsetof(MADB_Dsn, NoCache), DSN_TYPE_OPTION, MADB_OPT_FLAG_NO_CACHE, 0},
{"NO_CACHE", offsetof(MADB_Dsn, NoCache), DSN_TYPE_OPTION, MADB_OPT_FLAG_NO_CACHE, 0}, /* 40 */
{"APP", offsetof(MADB_Dsn, App), DSN_TYPE_STRING, 0, 0},
/* SSO parameters */
/* SSO/JWT parameters */
{"BROWSER_SSO", offsetof(MADB_Dsn, IsBrowserAuth), DSN_TYPE_BOOL , 0, 0},
{"IGNORE_KEYRING_SSO", offsetof(MADB_Dsn, IgnoreKeyring), DSN_TYPE_BOOL , 0, 0},
{"IGNORE_KEYRING_SSO", offsetof(MADB_Dsn, IgnoreKeyring), DSN_TYPE_BOOL , 0, 0},
{"JWT", offsetof(MADB_Dsn, JWT), DSN_TYPE_STRING, 0, 0},
{"TEST_MODE", offsetof(MADB_Dsn, TestMode), DSN_TYPE_INT, 0, 0}, /* Use some mock functions for testing */
/* Aliases. Here offset is index of aliased key */
Expand Down

0 comments on commit 42b031f

Please sign in to comment.