You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by "Lili Ma (JIRA)" <ji...@apache.org> on 2017/01/03 09:52:58 UTC

[jira] [Commented] (HAWQ-1246) Add generation of RequestID, ClientIP, queryContext(SQL Statement) in HAWQ , and encapsulate these contents to JSON request to RPS

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

Lili Ma commented on HAWQ-1246:
-------------------------------

Current Request ID is managed per session level, and now we print it out in HAWQ master log.
```
2017-01-03 17:38:34.775632 CST,"malili","postgres",p54608,th2056364032,"[local]",,2017-01-03 17:38:30 CST,3586,con14,cmd2,seg-10000,,,x3586,sx1,"LOG","00000","Send JSON request to Ranger: { ""requestId"": ""8"", ""user"": ""malili"", ""clientIp"": ""127.0.0.1"", ""context"": ""SELECT d.datname as \""Name\"",\n       pg_catalog.pg_get_userbyid(d.datdba) as \""Owner\"",\n       pg_catalog.pg_encoding_to_char(d.encoding) as \""Encoding\"",\n       pg_catalog.array_to_string(d.datacl, E'\\n') AS \""Access privileges\""\nFROM pg_catalog.pg_database d\nWHERE d.datname <> 'hcatalog'\nORDER BY 1;"", ""access"": [ { ""resource"": { ""database"": ""postgres"", ""schema"": ""pg_catalog"", ""function"": ""pg_encoding_to_char"" }, ""privileges"": [ ""EXECUTE"" ] } ] }",,,,,,"SELECT d.datname as ""Name"",
       pg_catalog.pg_get_userbyid(d.datdba) as ""Owner"",
       pg_catalog.pg_encoding_to_char(d.encoding) as ""Encoding"",
       pg_catalog.array_to_string(d.datacl, E'\n') AS ""Access privileges""
FROM pg_catalog.pg_database d
WHERE d.datname <> 'hcatalog'
ORDER BY 1;",0,,"rangerrest.c",391,
```

Note that it's session level.  We can use this information to detect what's a query is composed of.

> Add generation of RequestID, ClientIP, queryContext(SQL Statement) in HAWQ , and encapsulate these contents to JSON request to RPS
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HAWQ-1246
>                 URL: https://issues.apache.org/jira/browse/HAWQ-1246
>             Project: Apache HAWQ
>          Issue Type: Bug
>          Components: Security
>            Reporter: Xiang Sheng
>            Assignee: Xiang Sheng
>             Fix For: 2.2.0.0-incubating
>
>
> These informations should be generated and encapsulate them to the full json request. 
> Currently they are hardcoded.
> {code}
> json_object *jreqid = json_object_new_string("1");
> json_object_object_add(jrequest, "requestId", jreqid);
> json_object *jclientip = json_object_new_string("123.0.0.21");
> json_object_object_add(jrequest, "clientIp", jclientip);
> json_object *jcontext = json_object_new_string("SELECT * FROM DDDDDDD");
> json_object_object_add(jrequest, "context", jcontext);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)