You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+95Lines changed: 95 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,10 @@ Supported Golang version:
33
33
-[Mac OSX](#mac-osx)
34
34
-[Windows](#windows)
35
35
-[Errors](#errors)
36
+
-[User Authentication](#user-authentication)
37
+
-[Compile](#compile)
38
+
-[Usage](#usage)
39
+
-
36
40
-[Extensions](#extensions)
37
41
-[Spatialite](#spatialite)
38
42
-[FAQ](#faq)
@@ -76,6 +80,9 @@ Boolean values can be one of:
76
80
77
81
| Name | Key | Value(s) | Description |
78
82
|------|-----|----------|-------------|
83
+
| UA - Create |`_auth`| - | Create User Authentication, for more information see [User Authentication](#user-authentication)|
84
+
| UA - Username |`_auth_user`| - | Username for User Authentication, for more information see [User Authentication](#user-authentication)|
85
+
| UA - Password |`_auth_pass`| - | Password for User Authentication, for more information see [User Authentication](#user-authentication)|
79
86
| Auto Vacuum |`_auto_vacuum`\|`_vacuum`| <ul><li>`0`\|`none`</li><li>`1`\|`full`</li><li>`2`\|`incremental`</li></ul> | For more information see [PRAGMA auto_vacuum](https://www.sqlite.org/pragma.html#pragma_auto_vacuum)|
80
87
| Busy Timeout |`_busy_timeout`\|`_timeout`|`int`| Specify value for sqlite3_busy_timeout. For more information see [PRAGMA busy_timeout](https://www.sqlite.org/pragma.html#pragma_busy_timeout)|
81
88
| Case Sensitive LIKE |`_case_sensitive_like`\|`_cslike`|`boolean`| For more information see [PRAGMA case_sensitive_like](https://www.sqlite.org/pragma.html#pragma_case_sensitive_like)|
| Secure Delete | sqlite_secure_delete | This compile-time option changes the default setting of the secure_delete pragma.<br><br>When this option is not used, secure_delete defaults to off. When this option is present, secure_delete defaults to on.<br><br>The secure_delete setting causes deleted content to be overwritten with zeros. There is a small performance penalty since additional I/O must occur.<br><br>On the other hand, secure_delete can prevent fragments of sensitive information from lingering in unused parts of the database file after it has been deleted. See the documentation on the secure_delete pragma for additional information |
145
152
| Secure Delete (FAST) | sqlite_secure_delete_fast | For more information see [PRAGMA secure_delete](https://www.sqlite.org/pragma.html#pragma_secure_delete)|
Operations on the database regarding to user management can only be preformed by an administrator user.
344
+
345
+
### Support
346
+
347
+
The user authentication supports two kinds of users
348
+
349
+
- administrators
350
+
- regular users
351
+
352
+
### User Management
353
+
354
+
User management can be done by directly using the `*SQLiteConn` or by SQL.
355
+
356
+
#### SQL
357
+
358
+
The following sql functions are available for user management.
359
+
360
+
| Function | Arguments | Description |
361
+
|----------|-----------|-------------|
362
+
| `authenticate` | username `string`, password `string` | Will authenticate an user, this is done by the connection; and should not be used manually. |
363
+
| `auth_user_add` | username `string`, password `string`, admin `int` | This function will add an user to the database.<br>if the database is not protected by user authentication it will enable it. Argument `admin` is an integer identifying if the added user should be an administrator. Only Administrators can add administrators. |
364
+
| `auth_user_change` | username `string`, password `string`, admin `int` | Function to modify an user. Users can change their own password, but only an administrator can change the administrator flag. |
365
+
| `authUserDelete` | username `string` | Delete an user from the database. Can only be used by an administrator. The current logged in administrator cannot be deleted. This is to make sure their is always an administrator remaining. |
366
+
367
+
These functions will return an integer.
368
+
369
+
- 0 (SQLITE_OK)
370
+
- 23 (SQLITE_AUTH) Failed to perform due to authentication or insufficient privileges
0 commit comments