[ 
https://issues.apache.org/jira/browse/KNOX-2147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16992233#comment-16992233
 ] 

Sandor Molnar commented on KNOX-2147:
-------------------------------------

I haven't experienced any issue with the call history. Freshly built 
{{master}}, started {{knoxShell}} then ran the following commands:
{code:java}
knox:000> locations = 
KnoxShellTable.builder().jdbc().driver("org.apache.derby.jdbc.EmbeddedDriver").connectTo("jdbc:derby:/Users/smolnar/test/derbyDb").sql("SELECT
 * FROM sample.locations where zip < 10")
===> LOCATIONS
+--------+------------+----------+----------+--------------+
|  ZIP   |  COUNTRY   |  STATE   |   CITY   |  POPULATION  |
+--------+------------+----------+----------+--------------+
|   1    |     US     |    NY    |  City1   |    100000    |
|   2    |     US     |    NY    |  City2   |    100000    |
|   3    |     US     |    NY    |  City3   |    100000    |
|   4    |     US     |    NY    |  City4   |    100000    |
|   5    |     US     |    NY    |  City5   |    100000    |
|   6    |     US     |    NY    |  City6   |    100000    |
|   7    |     US     |    NY    |  City7   |    100000    |
|   8    |     US     |    NY    |  City8   |    100000    |
|   9    |     US     |    NY    |  City9   |    100000    |
+--------+------------+----------+----------+--------------+

knox:000> locations.getCallHistory()
===> Call history (id=1575959447957)

Step 1:
invokerClass=org.apache.knox.gateway.shell.table.KnoxShellTableBuilder
method=jdbc
builderMethod=false
params={}

Step 2:
invokerClass=org.apache.knox.gateway.shell.table.JDBCKnoxShellTableBuilder
method=driver
builderMethod=false
params={org.apache.derby.jdbc.EmbeddedDriver=class java.lang.String}

Step 3:
invokerClass=org.apache.knox.gateway.shell.table.JDBCKnoxShellTableBuilder
method=connectTo
builderMethod=false
params={jdbc:derby:/Users/smolnar/test/derbyDb=class java.lang.String}

Step 4:
invokerClass=org.apache.knox.gateway.shell.table.JDBCKnoxShellTableBuilder
method=createConnection
builderMethod=false
params={}

Step 5:
invokerClass=org.apache.knox.gateway.shell.table.JDBCKnoxShellTableBuilder
method=sql
builderMethod=true
params={SELECT * FROM sample.locations where zip < 10=class java.lang.String}
{code}
As you can see all related calls were intercepted. In fact, there was an extra 
call - createConnection - which I'm going to modify its visibility to 
{{private}}.

> Keep username and password out of KnoxShellTableCallHistory 
> ------------------------------------------------------------
>
>                 Key: KNOX-2147
>                 URL: https://issues.apache.org/jira/browse/KNOX-2147
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: KnoxShell
>            Reporter: Larry McCay
>            Assignee: Sandor Molnar
>            Priority: Major
>             Fix For: 1.4.0
>
>
> In working on KNOX-2132, I couldn't actually get the call history to work and 
> was therefore unable to make sure that the username and password params don't 
> end up in the persisted history or at least not rendered in the listing.
> Either call history no longer works or I just don't know how to enable it. 
> Tests don't seem to cover the actual AOP based capture but record hardcoded 
> calls rather than actual table interactions. I also notice that the 
> aspectjrt.jar isn't being placed in the lib dir for knoxshell which seems 
> broken.
> So, first thing to do is ensure that call history is actually working and fix 
> it if not. Then determine what to do about the username and password and 
> persistence of call histories as the means for reconstituting a dataset. Do 
> we build in a required login which would mean that the dataset rehydration 
> would require a user interaction for login? Do we encrypt the credentials - 
> if so, using what as a key and how to manage it? Do we just rely on file 
> permissions?
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to