Changeset: 734bdeaea410 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=734bdeaea410
Modified Files:
        monetdb5/modules/mal/remote.c
        monetdb5/modules/mal/remote.mal
        sql/backends/monet5/sql_gencode.c
Branch: remote_auth
Log Message:

We need to pass the scenario 'msql'

With this commit the whole pipeline works. What needs still to be done
is to provide a correct implementation for the AUTH functions that
interact with the vault in the local server AND modify the
RMTconnectScen and/or the mapi, in order to authenticate with hashed passwords.


diffs (69 lines):

diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c
--- a/monetdb5/modules/mal/remote.c
+++ b/monetdb5/modules/mal/remote.c
@@ -162,11 +162,6 @@ str RMTconnectScen(
        /* just make sure the return isn't garbage */
        *ret = 0;
 
-       /* TODO:
-        * 1. remote user and password from arg list
-        * 2. use AUTHgetRemoteTableCredentials(uri, client)
-        */
-
        if (ouri == NULL || *ouri == NULL || strcmp(*ouri, (str)str_nil) == 0)
                throw(ILLARG, "remote.connect", ILLEGAL_ARGUMENT ": database 
uri "
                                "is NULL or nil");
@@ -270,6 +265,7 @@ RMTconnectURI(Client cntxt, MalBlkPtr mb
        char *uri;
        char *tmp;
        char *ret;
+       str scen;
        str msg;
        ValPtr v;
 
@@ -278,13 +274,14 @@ RMTconnectURI(Client cntxt, MalBlkPtr mb
        v = &stk->stk[pci->argv[0]];
 
        uri = *getArgReference_str(stk, pci, 1);
+       scen = *getArgReference_str(stk, pci, 2);
        if (uri == NULL || strcmp(uri, (str)str_nil) == 0) {
                throw(ILLARG, "remote.connect", ILLEGAL_ARGUMENT ": URI is NULL 
or nil");
        }
 
        rethrow("remote.connect", tmp, AUTHgetRemoteTableCredentials(uri, 
cntxt, &remoteuser, &passwd));
 
-       msg = RMTconnect(&ret, &uri, &remoteuser, &passwd);
+       msg = RMTconnectScen(&ret, &uri, &remoteuser, &passwd, &scen);
 
        GDKfree(remoteuser);
        GDKfree(passwd);
diff --git a/monetdb5/modules/mal/remote.mal b/monetdb5/modules/mal/remote.mal
--- a/monetdb5/modules/mal/remote.mal
+++ b/monetdb5/modules/mal/remote.mal
@@ -24,7 +24,7 @@ comment "returns a newly created connect
 command connect(uri:str, user:str, passwd:str, scen:str):str
 address RMTconnectScen
 comment "returns a newly created connection for uri, using user name, password 
and scenario";
-pattern connect(uri:str):str
+pattern connect(uri:str, schen:str):str
 address RMTconnectURI
 comment "return a newly created connection for uri. username and password 
should be in the vault"
 
diff --git a/sql/backends/monet5/sql_gencode.c 
b/sql/backends/monet5/sql_gencode.c
--- a/sql/backends/monet5/sql_gencode.c
+++ b/sql/backends/monet5/sql_gencode.c
@@ -356,12 +356,10 @@ static int
                lret[i] = getArg(p, 0);
        }
 
-       /* q := remote.connect("uri"); */
+       /* q := remote.connect("uri", "msql"); */
        p = newStmt(curBlk, remoteRef, connectRef);
        p = pushStr(curBlk, p, uri);
-       /*p = pushStr(curBlk, p, "monetdb");
-       p = pushStr(curBlk, p, "monetdb");
-       p = pushStr(curBlk, p, "msql");*/
+       p = pushStr(curBlk, p, "msql");
        q = getArg(p, 0);
 
        /* remote.exec(q, "sql", "register", "mod", "name", "relational_plan", 
"signature"); */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to