Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
4729f714
Commit
4729f714
authored
Jan 10, 2019
by
antirez
Browse files
ACL: improved version of the user structure.
parent
45ff9f33
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server.h
View file @
4729f714
...
@@ -1356,8 +1356,27 @@ typedef struct {
...
@@ -1356,8 +1356,27 @@ typedef struct {
* user is associated to the connection after the connection is authenticated.
* user is associated to the connection after the connection is authenticated.
* If there is no associated user, the connection uses the default user. */
* If there is no associated user, the connection uses the default user. */
#define USER_MAX_COMMAND_BIT 1024
#define USER_MAX_COMMAND_BIT 1024
#define USER_FLAG_ENABLED (1<<0)
/* The user is active. */
typedef
struct
user
{
typedef
struct
user
{
uint64_t
flags
;
/* See USER_FLAG_* */
/* The bit in allowed_commands is set if this user has the right to
* execute this command. In commands having subcommands, if this bit is
* set, then all the subcommands are also available.
*
* If the bit for a given command is NOT set and the command has
* subcommands, Redis will also check allowed_subcommands in order to
* understand if the command can be executed. */
uint64_t
allowed_commands
[
USER_MAX_COMMAND_BIT
/
64
];
uint64_t
allowed_commands
[
USER_MAX_COMMAND_BIT
/
64
];
/* This array points, for each command ID (corresponding to the command
* bit set in allowed_commands), to an array of SDS strings, terminated by
* a NULL pointer, with all the sub commands that can be executed for
* this command. When no subcommands matching is used, the field is just
* set to NULL to avoid allocating USER_MAX_COMMAND_BIT pointers. */
sds
**
allowed_subcommands
;
list
*
passwords
;
/* A list of SDS valid passwords for this user. */
list
*
patterns
;
/* A list of allowed key patterns. */
}
user
;
}
user
;
/* Structure to hold hash iteration abstraction. Note that iteration over
/* Structure to hold hash iteration abstraction. Note that iteration over
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment