@@ -129,56 +129,57 @@ the `encryption_*` and `ssl_*` options
129129directly to the constructor as keyword arguments, even though it is
130130required when they are placed in the environment file.
131131
132- Creating PAM or Native Credentials File (.irodsA)
133- -------------------------------------------------
132+ Creating a PAM or Native Authentication File
133+ --------------------------------------------
134134
135- Use of following free functions will allow the creation of encoded authentication files for use in
136- the client 's iRODS login environment :
135+ The following free functions may be used to create the authentication secrets files (called
136+ ` .irodsA ` per the convention of iRODS 's iCommands) :
137137 - ` irods.client_init.write_native_irodsA_file `
138138 - ` irods.client_init.write_pam_irodsA_file `
139139
140- These functions can roughly be described as duplicating the function of iinit (from iCommands) ,
141- provided that a valid irods_environment.json has already been created.
140+ These functions can roughly be described as duplicating the function of ` iinit ` ,
141+ provided that a valid ` irods_environment.json ` has already been created.
142142
143- Each takes a cleartext password and writes an appropriately processed version of it
144- into an .irodsA "password" (also known as "credentials" or "secrets") file in the appropriate
145- location. That location is ` ~/.irods/.irodsA ` unless IRODS_AUTHENTICATION_FILE has been set
143+ Each of the above functions can take a cleartext password and write an appropriately encoded
144+ version of it into an authentication in the appropriate location. That location is
145+ ` ~/.irods/.irodsA ` unless the environment variable IRODS_AUTHENTICATION_FILE has been set
146146in the command shell to dictate an alternative file path.
147147
148- As an example, here we write a native .irodsA file using the first of the two functions. We
149- pass in only the required argument, with its value determined by the input terminal via the
150- Python ` getpass ` facility:
148+ As an example, here we write a native ` .irodsA ` file using the first of the two functions. We
149+ provide the one required argument, a password string entered - in this case - interactively at the
150+ terminal.
151151
152152``` bash
153- $ echo ' { "irods_user_name":"rods", ... }' > ~ /.irods/irods_environment.json
154- $ python -c " import irods.client_init, getpass
153+ bash$ echo ' { "irods_user_name":"rods",
154+ ... # other parameters as needed
155+ }' > ~ /.irods/irods_environment.json
156+ bash$ python -c " import irods.client_init, getpass
155157irods.client_init.write_native_irodsA_file(getpass.getpass('Enter iRODS password -> '))"
156158```
157159
158- By default, if an .irodsA file already exists, it will be overwritten. If, however, these functions'
159- overwrite parameter is set to ` False ` , an exception of type ` irods.client_init.irodsA_already_exists `
160- is raised to warn of any older .irodsA file that might otherwise have been overwritten.
160+ By default, when an ` .irodsA ` file already exists, it will be overwritten. If however the
161+ ` overwrite ` parameter is set to ` False ` , an exception of type ` irods.client_init.irodsA_already_exists `
162+ is raised to warn of any older ` .irodsA ` file that might otherwise have been overwritten.
161163
162164Equivalently to the above, we can issue the following command.
163165
164166``` bash
165- $ prc_write_irodsA.py native <<< " ${MY_CURRENT_IRODS_PASSWORD}"
167+ bash $ prc_write_irodsA.py native <<< " ${MY_CURRENT_IRODS_PASSWORD}"
166168```
167169
168- Or the redirect may be left off, in which case the user is prompted for the iRODS password
169- and echo of the keyboard input will be suppressed, in the style of iinit. Regardless
170+ The redirect may of course be left off, in which case the user is prompted for the iRODS password
171+ and echo of the keyboard input will be suppressed, in the style of ` iinit ` . Regardless
170172which technique is used, no password will be visible on the terminal during or after input.
171173
172174For the ` pam_password ` scheme, typically SSL/TLS must first be enabled to avoid sending data related
173175to the password - or even sending the raw password itself - over a network connection in the clear.
174176
175- Thus, for ` pam_password ` authentication to work well, we should first ensure when setting up the
176- client environment that the ` irods_environment.json ` file includes the appropriate
177- SSL/TLS connection parameters. If present, ` iinit ` can be used to verify this prerequisite is
178- fulfilled, as in that case its invocation would create a valid .irodsA from merely prompting the user
179- for their PAM password.
177+ Thus for ` pam_password ` authentication to work well, we should first ensure, when setting up the
178+ client environment, to include within ` irods_environment.json ` the appropriate SSL/TLS connection
179+ parameters. In a pinch, ` iinit ` can be used to verify this prerequisite is fulfilled,
180+ as its invocation would then create a valid .irodsA from merely prompting the user for their PAM password.
180181
181- Again , this can also be done either using the free function directly:
182+ Once again , this can also be done either using the free function directly:
182183
183184``` python
184185irods.client_init.write_pam_irodsA_file(getpass.getpass(' Enter current PAM password -> ' ))
@@ -187,11 +188,11 @@ irods.client_init.write_pam_irodsA_file(getpass.getpass('Enter current PAM passw
187188or from the Bash command shell:
188189
189190``` bash
190- $ prc_write_irodsA.py pam_password <<< " ${MY_CURRENT_PAM_PASSWORD}"
191+ bash $ prc_write_irodsA.py pam_password <<< " ${MY_CURRENT_PAM_PASSWORD}"
191192```
192193
193- As a final note, in the "pam_password" scheme the default SSL requirement can be disabled (for purposes
194- of testing only):
194+ As a final note, in the "pam_password" scheme the default SSL requirement can be disabled (preferably for
195+ purposes of testing only! ):
195196
196197``` python
197198session = irods.session.iRODSSession(host = " localhost" , port = 1247 ,
@@ -204,7 +205,7 @@ session.set_auth_option_for_scheme('pam_password', irods.auth.pam_password.ENSUR
204205home = session.collections.get(' /tempZone/home/alice' )
205206```
206207
207- Note however that in future releases of iRODS it is possible that extra SSL checking could be
208+ Note, however, in future releases of iRODS it is possible that extra SSL checking could be
208209implemented server-side, at which point the above code could not be guaranteed to work.
209210
210211Legacy (iRODS 4.2-compatible) PAM authentication
0 commit comments