Skip to content

Commit

Permalink
Major API documentation upgrade.
Browse files Browse the repository at this point in the history
- all public functions and global variables documentation extended and
  rewoked
- documentation compatible with qsl/doc library
- documentation accessible from q process level via .doc.list .doc.find
  .doc.show
  • Loading branch information
pawelhudak committed Mar 7, 2016
1 parent 360fc83 commit da97ec2
Show file tree
Hide file tree
Showing 53 changed files with 5,205 additions and 3,675 deletions.
49 changes: 27 additions & 22 deletions components/accessPoint/accessPoint.q
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/L/ Copyright (c) 2011-2014 Exxeleron GmbH
/L/
/L/ Licensed under the Apache License, Version 2.0 (the "License");
/L/ you may not use this file except in compliance with the License.
/L/ You may obtain a copy of the License at
/L/
/L/ http://www.apache.org/licenses/LICENSE-2.0
/L/
/L/ Unless required by applicable law or agreed to in writing, software
/L/ distributed under the License is distributed on an "AS IS" BASIS,
/L/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/L/ See the License for the specific language governing permissions and
/L/ limitations under the License.
/-/
/-/ Licensed under the Apache License, Version 2.0 (the "License");
/-/ you may not use this file except in compliance with the License.
/-/ You may obtain a copy of the License at
/-/
/-/ http://www.apache.org/licenses/LICENSE-2.0
/-/
/-/ Unless required by applicable law or agreed to in writing, software
/-/ distributed under the License is distributed on an "AS IS" BASIS,
/-/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/-/ See the License for the specific language governing permissions and
/-/ limitations under the License.

/A/ DEVnet: Joanna Jarmulska, Pawel Hudak, Bartosz Kaliszuk
/V/ 3.0
/S/ Access point component:
/S/ Responsible for:
/S/ - providing abstraction level for users to effortlessly query both historical (<hdb.q>) and real-time data (<rdb.q>) using the same interface described in the <query.q> library
/S/ - applying user authorization performed by the <authorization.q> library
/S/ - providing access control by defining functions that are permitted to specific users, described in the <authorization.q> library
/S/ Adding new user, user groups, permitted namespaces, and security check levels should take place in global access.cfg file (see <access.qsd>).
/S/ Additional plugins should be specified on the command line using `-lib' switch (see <.sl.libCmd[]> in <sl.q>).
/-/ Responsible for:
/-/ - providing abstraction level for users to effortlessly query both historical (<hdb.q>) and real-time data (<rdb.q>) using the same interface described in the <query.q> library
/-/ - applying user authorization performed by the <authorization.q> library
/-/ - providing access control by defining functions that are permitted to specific users, described in the <authorization.q> library
/-/ Adding new user, user groups, permitted namespaces, and security check levels should take place in global access.cfg file (see <access.qsd>).
/-/ Additional plugins should be specified on the command line using `-lib' switch (see <.sl.libCmd[]> in <sl.q>).

/T/ q accessPoint.q -lib demoExample -p 5020

Expand All @@ -33,15 +33,20 @@ system"l ",getenv[`EC_QSL_PATH],"/sl.q";
.sl.lib["cfgRdr/cfgRdr"];

/------------------------------------------------------------------------------/
/F/ Main initialization function for the component
/F/ - loads configuration settings to namespace .ap.cfg
/E/ .sl.main[`];
.sl.main:{
/F/ Main initialization function for the component.
/-/ - loads configuration settings to namespace .ap.cfg
/P/ flags:LIST - nyi
/R/ no return value
/E/ .sl.main`
.sl.main:{[flags]
/G/ List of aux servers, loaded from cfg.serverAux field from system.cfg.
.ap.cfg.serverAux:.cr.getCfgField[`THIS;`group;`cfg.serverAux];
/G/ Connections timeout, loaded from cfg.timeout field from system.cfg.
.ap.cfg.timeout:.cr.getCfgField[`THIS;`group;`cfg.timeout];
.ap.p.init[];
};

/------------------------------------------------------------------------------/
.ap.p.init:{[params]
.hnd.hopen[.ap.cfg.serverAux;.ap.cfg.timeout;`lazy];
.sl.libCmd[];
Expand Down
68 changes: 38 additions & 30 deletions components/authentication/genPass.q
Original file line number Diff line number Diff line change
@@ -1,44 +1,52 @@
/L/ Copyright (c) 2011-2014 Exxeleron GmbH
/L/
/L/ Licensed under the Apache License, Version 2.0 (the "License");
/L/ you may not use this file except in compliance with the License.
/L/ You may obtain a copy of the License at
/L/
/L/ http://www.apache.org/licenses/LICENSE-2.0
/L/
/L/ Unless required by applicable law or agreed to in writing, software
/L/ distributed under the License is distributed on an "AS IS" BASIS,
/L/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/L/ See the License for the specific language governing permissions and
/L/ limitations under the License.
/-/
/-/ Licensed under the Apache License, Version 2.0 (the "License");
/-/ you may not use this file except in compliance with the License.
/-/ You may obtain a copy of the License at
/-/
/-/ http://www.apache.org/licenses/LICENSE-2.0
/-/
/-/ Unless required by applicable law or agreed to in writing, software
/-/ distributed under the License is distributed on an "AS IS" BASIS,
/-/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/-/ See the License for the specific language governing permissions and
/-/ limitations under the License.

/A/ DEVnet: Bartosz Kaliszuk ([email protected])
/V/ 3.0
/D/ 2012.06.22

/S/ Password generation component:
/S/ Responsible for:
/S/ - generation of encrypted password for a user
/S/ Usage:
/S/ In order to generate a new obfuscated password for a user, please run admin.genPass interactive service from yak
/S/
/S/ (start code)
/S/ $ yak console core.genPass
/S/ Please enter new password: USERINPUT
/S/ Please re-enter new password: USERINPUT
/S/ Your new password is: 0x6160e6574666
/S/ (end)
/S/
/S/ This new password (`0x6160e6574666`) should be placed in access.cfg file.
/S/ Note:
/S/ Please note that kdb+ does not provide high level security measures on its own.
/S/ Therefore, it must be noted that any user with q knowledge and access to the source code will have means of compromising the system.
/S/ One way to prevent it is to compile the source code and use binaries in production environments.
/-/ Responsible for:
/-/ - generation of encrypted password for a user
/-/ Usage:
/-/ In order to generate a new obfuscated password for a user, please run admin.genPass interactive service from yak
/-/
/-/ (start code)
/-/ $ yak console core.genPass
/-/ Please enter new password: USERINPUT
/-/ Please re-enter new password: USERINPUT
/-/ Your new password is: 0x6160e6574666
/-/ (end)
/-/
/-/ This new password (`0x6160e6574666`) should be placed in access.cfg file.
/-/ Note:
/-/ Please note that kdb+ does not provide high level security measures on its own.
/-/ Therefore, it must be noted that any user with q knowledge and access to the source code will have means of compromising the system.
/-/ One way to prevent it is to compile the source code and use binaries in production environments.

/------------------------------------------------------------------------------/
system"l ",getenv[`EC_QSL_PATH],"/sl.q";
.sl.init[`gp];
.sl.lib["cfgRdr/cfgRdr"]; // necessary now even though we don't use configuration

/------------------------------------------------------------------------------/
.gp.p.dx:{[p;m] `byte$0b sv/:m<>/:0b vs/:`int$p};

/------------------------------------------------------------------------------/
/F/ Generates encrypted password. Should be execuded only when q started in console mode as it requires console interaction.
/R/ no return value
/E/ .gp.genpass[]
.gp.genpass:{[]
1 "\n\n";
1 "Please enter new password: ";
Expand All @@ -50,5 +58,5 @@ system"l ",getenv[`EC_QSL_PATH],"/sl.q";
exit[0];
};


/------------------------------------------------------------------------------/
.sl.run[`gp;`.gp.genpass;`];
47 changes: 24 additions & 23 deletions components/authentication/refreshUFiles.q
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
/L/ Copyright (c) 2011-2014 Exxeleron GmbH
/L/
/L/ Licensed under the Apache License, Version 2.0 (the "License");
/L/ you may not use this file except in compliance with the License.
/L/ You may obtain a copy of the License at
/L/
/L/ http://www.apache.org/licenses/LICENSE-2.0
/L/
/L/ Unless required by applicable law or agreed to in writing, software
/L/ distributed under the License is distributed on an "AS IS" BASIS,
/L/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/L/ See the License for the specific language governing permissions and
/L/ limitations under the License.
/-/
/-/ Licensed under the Apache License, Version 2.0 (the "License");
/-/ you may not use this file except in compliance with the License.
/-/ You may obtain a copy of the License at
/-/
/-/ http://www.apache.org/licenses/LICENSE-2.0
/-/
/-/ Unless required by applicable law or agreed to in writing, software
/-/ distributed under the License is distributed on an "AS IS" BASIS,
/-/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/-/ See the License for the specific language governing permissions and
/-/ limitations under the License.

/V/ 3.0

/S/ Refresh permissions component:
/S/ Responsible for:
/S/ - regeneration of user access files (used with -u/-U options)
/S/.
/S/ Notes:
/S/ - this script generates one file for each component with permitted users information taken from access.cfg file.
/S/ - files are generated in cfg.userTxtPath specified directory.

/T/ yak start refreshPerm
/-/ Responsible for:
/-/ - regeneration of user access files (used with -u/-U options)
/-/ Notes:
/-/ - this script generates one file for each component with permitted users information taken from access.cfg file.
/-/ - files are generated in cfg.userTxtPath specified directory.

/------------------------------------------------------------------------------/
/ lib and etc /
Expand All @@ -32,14 +29,17 @@ system"l ",getenv[`EC_QSL_PATH],"/sl.q";
.sl.lib["cfgRdr/cfgRdr"];

/------------------------------------------------------------------------------/

/F/ Initialization function
.sl.main:{
/F/ Component initialization entry point.
/P/ flags:LIST - nyi
/R/ no return value
/E/ .sl.main`
.sl.main:{[flags]
.cr.loadCfg[`ALL];
.ru.p.init[];
exit[0];
};

/------------------------------------------------------------------------------/
.ru.p.init:{[params]
// define users
.log.info[`ru] "Refreshing user access files...";
Expand Down Expand Up @@ -76,6 +76,7 @@ system"l ",getenv[`EC_QSL_PATH],"/sl.q";
path 0:1_":" 0:users;
};

/------------------------------------------------------------------------------/
.ru.p.verify:{[umatched]
/ check user count per process vs count per distinct u file
perproc:select pucnt:count i by procname, uFile from umatched;
Expand Down
Loading

0 comments on commit da97ec2

Please sign in to comment.