Skip to content

Commit

Permalink
enable fdb auth by default 8.0
Browse files Browse the repository at this point in the history
Signed-off-by: mohitkhullar <[email protected]>
  • Loading branch information
mohitkhullar committed Nov 25, 2024
1 parent 3406927 commit db9b6a0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion db/db_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ static int check_user_password(struct sqlclntstate *clnt)
int password_rc = 0;
int valid_user;

clnt->authdata = get_authdata(clnt);

if ((gbl_uses_externalauth || gbl_uses_externalauth_connect) &&
(externalComdb2AuthenticateUserMakeRequest || debug_switch_ignore_null_auth_func()) &&
!clnt->admin && !clnt->current_user.bypass_auth) {
clnt->authdata = get_authdata(clnt);
if (!clnt->authdata && clnt->secure && !gbl_allow_anon_id_for_spmux)
return reject_anon_id(clnt);
if (gbl_externalauth_warn && !clnt->authdata) {
Expand Down
2 changes: 1 addition & 1 deletion db/db_tunables.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ REGISTER_TUNABLE("foreign_db_push_remote", NULL, TUNABLE_BOOLEAN,
&gbl_fdb_push_remote, NOARG, NULL, NULL, NULL, NULL);
REGISTER_TUNABLE("foreign_db_push_redirect", "Redirect fdb query to run via client instead of on server. (Default: off)", TUNABLE_BOOLEAN,
&gbl_fdb_push_redirect_foreign, NOARG, NULL, NULL, NULL, NULL);
REGISTER_TUNABLE("foreign_db_auth_enabled", "Redirect extern auth data to remote server. (Default: off)",
REGISTER_TUNABLE("foreign_db_auth_enabled", "Redirect extern auth data to remote server. (Default: on)",
TUNABLE_BOOLEAN, &gbl_fdb_auth_enabled, NOARG, NULL, NULL, NULL, NULL);
REGISTER_TUNABLE("fullrecovery", "Attempt to run database "
"recovery from the beginning of "
Expand Down
2 changes: 1 addition & 1 deletion db/fdb_fend.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int gbl_fdb_incoherence_percentage = 0;
int gbl_fdb_io_error_retries = 16;
int gbl_fdb_io_error_retries_phase_1 = 6;
int gbl_fdb_io_error_retries_phase_2_poll = 100;
int gbl_fdb_auth_enabled = 0;
int gbl_fdb_auth_enabled = 1;

struct fdb_tbl;
struct fdb;
Expand Down
2 changes: 1 addition & 1 deletion db/fdb_push.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ int handle_fdb_push(struct sqlclntstate *clnt, struct errstat *err)
return -1;
}

if (gbl_uses_externalauth && gbl_fdb_auth_enabled && externalComdb2getAuthIdBlob)
if (gbl_fdb_auth_enabled && externalComdb2getAuthIdBlob)
cdb2_setIdentityBlob(hndl, externalComdb2getAuthIdBlob(clnt->authdata));

rc = cdb2_run_statement(hndl, clnt->sql);
Expand Down
2 changes: 1 addition & 1 deletion plugins/remsql/fdb_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern int gbl_fdb_auth_enabled;

static int fdb_auth_enabled()
{
return (gbl_fdb_auth_enabled && gbl_uses_externalauth);
return gbl_fdb_auth_enabled;
}

/* matches fdb_svc_callback_t callbacks */
Expand Down
2 changes: 1 addition & 1 deletion tests/tunables.test/t00_all_tunables.expected
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
(name='force_old_cursors', description='Replicant will use old cursors', type='BOOLEAN', value='OFF', read_only='N')
(name='force_writesql', description='Force admin mode to for write sql. (Default: on)', type='BOOLEAN', value='ON', read_only='N')
(name='foreign_db_allow_cross_class', description='', type='BOOLEAN', value='OFF', read_only='Y')
(name='foreign_db_auth_enabled', description='Redirect extern auth data to remote server. (Default: off)', type='BOOLEAN', value='OFF', read_only='N')
(name='foreign_db_auth_enabled', description='Redirect extern auth data to remote server. (Default: on)', type='BOOLEAN', value='ON', read_only='N')
(name='foreign_db_push_redirect', description='Redirect fdb query to run via client instead of on server. (Default: off)', type='BOOLEAN', value='OFF', read_only='N')
(name='foreign_db_push_remote', description='', type='BOOLEAN', value='OFF', read_only='N')
(name='foreign_db_resolve_local', description='', type='BOOLEAN', value='OFF', read_only='Y')
Expand Down

0 comments on commit db9b6a0

Please sign in to comment.