Changes

Jump to navigation Jump to search
994 bytes removed ,  09:30, 3 February 2021
db:create → user:create
This article is part of the [[Advanced User's Guide]].The user management defines which permissions are requiredby a user to perform a database command or XQuery expression.
Permissions are mostly relevant in the client/server architecture, as the[[Standalone ModeGUI]] and the [[GUICommand-Line Client]] is run with admin permissions.There are a few exceptions such as the [[XQuery Module#xquery:eval|xquery:eval]] function:its Its execution scope can also be limited by specifying a permission.
With <b>Version 8.0</b>, the user management has been revised: * Permissions can now be '''manually edited''', as they are stored as XML.* The permission file has been moved from the home directory to the '''database directory'''. It was renamed from {{Code|.basexperm}} to {{Code|users.xml}}.* Local permissions are now defined for database '''glob patterns''' instead Please take care of single databases. Both local and global permissions are stored in the same file.* A new [[User Module]] is available, which allows user management via '''XQuery'''.* MD5 password hashing has been discarded, as many md5 hashes can be easily uncovered with rainbow tables.* '''Salted sha256''' hashes are now used for authentication (the current timestamp will be used as salt).* Additionally, '''digest''' hashes are used in the client/server architecture and the [[Clients|Language Bindings]], and in the [[Web Application|HTTP Context]] if the [[Options#AUTHMETHOD|AUTHMETHOD]] is set to {{Code|Digest}}. {{Mark|Warning}}: As the available md5 hashes cannot automatically be converted to the new format, existing credentials will be ignored, and you will need to recreate your user data. Moreover, we will incrementally provide new [[Clients|Language Bindings]], which will be based on the digest hashes. Passwords in commands and XQuery functions are now specified in '''plain text'''. The rationale behind this is: * Transmission of passwords as md5 has not been safe anyway, as indicated above.* Different hash values can now be created from the original password. You will be safe if you follow basic usual security measures: ensure that your password will not end up in your bash history, avoid sending passwords via ordinary REST requests, etc.
==Rules==
and override global permissions.
[[File:perms.png|none|thumb|403px|Permissions hierarchy]]
User names must follow the [[Valid Names|valid names constraints]], and the database patterns must follow the [[Commands#Glob_Syntax|Glob Syntax]].
==CommandsOperations== For all operations, admin permissions are required:
Admin permissions are required to execute all of the following commands:=Commands=
'''Create user 'test' (password will be entered on command line). By default, the user will have no permissions ('none'):
<code>&gt; SHOW USERS</code>
'''Show detailed information about user 'test' via XQuery:'''
==XQuery== The available user functions are listed in the [[User Module]]: '''Create user 'test' with no permissions:''' <code>user:create('test', 'top-secret')</code> '''Show detailed information about user 'test':''' <code>&gt; XQUERY user:list-details()[@name = 'test']</code> '''Drop user 'test':''' <code>user:drop('test')</code> =Storage=
'''Drop of user 'test' via XQuery:'''The permission file {{Code|users.xml}} is stored in the database directory. This file can be manually edited; it will be parsed once when BaseX is started.
<code>&gt; XQUERY user:dropSalted SHA256 hashes are used for authentication ('test'the current timestamp will be used as salt)<. Additionally, digest hashes are used in the client/code> server architecture and the [[Clients|Language Bindings]], and in the [[Web Application|HTTP Context]] if {{Option|AUTHMETHOD}} is set to {{Code|Digest}}.
=Changelog=
Revised in Version 8.0.
editor, reviewer
9

edits

Navigation menu