@@ -129,56 +129,57 @@ the `encryption_*` and `ssl_*` options
129
129
directly to the constructor as keyword arguments, even though it is
130
130
required when they are placed in the environment file.
131
131
132
- Creating PAM or Native Credentials File (.irodsA)
133
- -------------------------------------------------
132
+ Creating a PAM or Native Authentication File
133
+ --------------------------------------------
134
134
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) :
137
137
- ` irods.client_init.write_native_irodsA_file `
138
138
- ` irods.client_init.write_pam_irodsA_file `
139
139
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.
142
142
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
146
146
in the command shell to dictate an alternative file path.
147
147
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.
151
151
152
152
``` 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
155
157
irods.client_init.write_native_irodsA_file(getpass.getpass('Enter iRODS password -> '))"
156
158
```
157
159
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.
161
163
162
164
Equivalently to the above, we can issue the following command.
163
165
164
166
``` bash
165
- $ prc_write_irodsA.py native <<< " ${MY_CURRENT_IRODS_PASSWORD}"
167
+ bash $ prc_write_irodsA.py native <<< " ${MY_CURRENT_IRODS_PASSWORD}"
166
168
```
167
169
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
170
172
which technique is used, no password will be visible on the terminal during or after input.
171
173
172
174
For the ` pam_password ` scheme, typically SSL/TLS must first be enabled to avoid sending data related
173
175
to the password - or even sending the raw password itself - over a network connection in the clear.
174
176
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.
180
181
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:
182
183
183
184
``` python
184
185
irods.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
187
188
or from the Bash command shell:
188
189
189
190
``` bash
190
- $ prc_write_irodsA.py pam_password <<< " ${MY_CURRENT_PAM_PASSWORD}"
191
+ bash $ prc_write_irodsA.py pam_password <<< " ${MY_CURRENT_PAM_PASSWORD}"
191
192
```
192
193
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! ):
195
196
196
197
``` python
197
198
session = irods.session.iRODSSession(host = " localhost" , port = 1247 ,
@@ -204,7 +205,7 @@ session.set_auth_option_for_scheme('pam_password', irods.auth.pam_password.ENSUR
204
205
home = session.collections.get(' /tempZone/home/alice' )
205
206
```
206
207
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
208
209
implemented server-side, at which point the above code could not be guaranteed to work.
209
210
210
211
Legacy (iRODS 4.2-compatible) PAM authentication
0 commit comments