[GRASS-dev] [GRASS GIS] #3551: Please use env vars instead of cmd line parameters for credentials

#3551: Please use env vars instead of cmd line parameters for credentials
-------------------------+-------------------------
Reporter: frankie | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Default | Version: unspecified
Keywords: | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
Note that username and password are visible to all users by using simple
commands which list running processes. That is not a good thing o do, it
would be better using a pair of environment variables instead.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3551&gt;
GRASS GIS <https://grass.osgeo.org>

#3551: Please use env vars instead of cmd line parameters for credentials
--------------------------+-------------------------
  Reporter: frankie | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by neteler):

Please indicate to which processes you refer to, thanks (ideally, also add
as keyword(s)).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3551#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3551: Please use env vars instead of cmd line parameters for credentials
--------------------------+-------------------------
  Reporter: frankie | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by frankie):

Ops, sorry I missed the module, which is an addon: r.in.srtm.region (and
eventually r.in.srtm when updated for use of credentials).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3551#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3551: Please use env vars instead of cmd line parameters for credentials
--------------------------+-------------------------
  Reporter: frankie | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by marisn):

It's not that easy. Setting env variables for Windows users is not so
common as for *nix'ers. IMHO a correct solution would be to accept both –
env variables and command line parameters + add an explanation in
documentation. Thus on typical single user Windows boxes nothing would
change, but multiuser *nix users will be able to not expose their
credentials by using env vars.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3551#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3551: Please use env vars instead of cmd line parameters for credentials
--------------------------+------------------------------
  Reporter: frankie | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone:
Component: Addons | Version: unspecified
Resolution: | Keywords: r.in.srtm.region
       CPU: Unspecified | Platform: Unspecified
--------------------------+------------------------------
Changes (by neteler):

* keywords: => r.in.srtm.region
* type: defect => enhancement
* component: Default => Addons

Comment:

Suggestion: The best way might be to use a password file. A standard
approach for this is used by e.g. i.modis:

See "netrc" related code here:

https://trac.osgeo.org/grass/browser/grass-
addons/grass7/imagery/i.modis/i.modis.download/i.modis.download.py#L193

Note: Credentials are obtained from such a .netrc file also by wget, ftp
and other software.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3551#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>