5
5
#include "strvec.h"
6
6
7
7
/**
8
- * The credentials API provides an abstracted way of gathering username and
9
- * password credentials from the user.
8
+ * The credentials API provides an abstracted way of gathering
9
+ * authentication credentials from the user.
10
10
*
11
11
* Typical setup
12
12
* -------------
@@ -116,11 +116,12 @@ struct credential_capability {
116
116
};
117
117
118
118
/**
119
- * This struct represents a single username/password combination
120
- * along with any associated context. All string fields should be
121
- * heap-allocated (or NULL if they are not known or not applicable).
122
- * The meaning of the individual context fields is the same as
123
- * their counterparts in the helper protocol.
119
+ * This struct represents a single login credential (typically a
120
+ * username/password combination) along with any associated
121
+ * context. All string fields should be heap-allocated (or NULL if
122
+ * they are not known or not applicable). The meaning of the
123
+ * individual context fields is the same as their counterparts in
124
+ * the helper protocol.
124
125
*
125
126
* This struct should always be initialized with `CREDENTIAL_INIT` or
126
127
* `credential_init`.
@@ -207,11 +208,12 @@ void credential_clear(struct credential *);
207
208
208
209
/**
209
210
* Instruct the credential subsystem to fill the username and
210
- * password fields of the passed credential struct by first
211
- * consulting helpers, then asking the user. After this function
212
- * returns, the username and password fields of the credential are
213
- * guaranteed to be non-NULL. If an error occurs, the function will
214
- * die().
211
+ * password (or authtype and credential) fields of the passed
212
+ * credential struct by first consulting helpers, then asking the
213
+ * user. After this function returns, either the username and
214
+ * password fields or the credential field of the credential are
215
+ * guaranteed to be non-NULL. If an error occurs, the function
216
+ * will die().
215
217
*
216
218
* If all_capabilities is set, this is an internal user that is prepared
217
219
* to deal with all known capabilities, and we should advertise that fact.
@@ -232,10 +234,10 @@ void credential_approve(struct credential *);
232
234
* have been rejected. This will cause the credential subsystem to
233
235
* notify any helpers of the rejection (which allows them, for
234
236
* example, to purge the invalid credentials from storage). It
235
- * will also free() the username and password fields of the
236
- * credential and set them to NULL (readying the credential for
237
- * another call to `credential_fill`). Any errors from helpers are
238
- * ignored.
237
+ * will also free() the username, password, and credential fields
238
+ * of the credential and set them to NULL (readying the credential
239
+ * for another call to `credential_fill`). Any errors from helpers
240
+ * are ignored.
239
241
*/
240
242
void credential_reject (struct credential * );
241
243
0 commit comments