Skip to content

Commit

Permalink
Website update (#271)
Browse files Browse the repository at this point in the history
* Website update

- Fixed SETNX status in API Compatibility page
- Added ACL commands

* Added SRANDMEMBER to docs

* Update api-compatibility.md

Removed deprecated notes from api-compatibility doc

* Update .gitignore

Adding package.lock.json to .gitignore

* Typo in .gitignore

* Update .gitignore

---------

Co-authored-by: vazois <96085550+vazois@users.noreply.github.com>
  • Loading branch information
TalZaccai and vazois authored Apr 16, 2024
1 parent a8820b3 commit 17572f4
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 40 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ ClientBin/
node_modules/
**/log-commits
.mono
**/package-lock.json

# RIA/Silverlight projects
Generated_Code/
Expand Down
126 changes: 126 additions & 0 deletions website/docs/commands/acl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
id: acl-commands
sidebar_label: ACL
title: ACL
slug: acl
---

### ACL CAT

#### Syntax

```bash
ACL CAT [category]
```

The command shows the available ACL categories if called without arguments. If a category name is given, the command shows all the Garnet commands in the specified category.

#### Resp Reply

One of the following:

* Array reply: an array of Bulk string reply elements representing ACL categories or commands in a given category.
* Simple error reply: the command returns an error if an invalid category name is given.

---

### ACL DELUSER

#### Syntax

```bash
ACL DELUSER username [username ...]
```

Delete all the specified ACL users and terminate all the connections that are authenticated with such users. Note: the special default user cannot be removed from the system, this is the default user that every new connection is authenticated with. The list of users may include usernames that do not exist, in such case no operation is performed for the non existing users.

#### Resp Reply

Integer reply: the number of users that were deleted. This number will not always match the number of arguments since certain users may not exist.

---

### ACL LIST

#### Syntax

```bash
ACL LIST
```

The command shows the currently active ACL rules in the Garnet server.

#### Resp Reply

Array reply: an array of Bulk string reply elements.

---

### ACL LOAD

#### Syntax

```bash
ACL LOAD
```

When Garnet is configured to use an ACL file, this command will reload the ACLs from the file, replacing all the current ACL rules with the ones defined in the file. The command makes sure to have an all or nothing behavior, that is:

* If every line in the file is valid, all the ACLs are loaded.
* If one or more line in the file is not valid, nothing is loaded, and the old ACL rules defined in the server memory continue to be used.

#### Resp Reply

Returns +OK on success, otherwise --ERR message if any.

---

### ACL SETUSER

#### Syntax

```bash
ACL SETUSER username [rule [rule ...]]
```
Create an ACL user with the specified rules or modify the rules of an existing user.
Manipulate Garnet ACL users interactively. If the username does not exist, the command creates the username without any privilege. It then reads from left to right all the rules provided as successive arguments, setting the user ACL rules as specified. If the user already exists, the provided ACL rules are simply applied in addition to the rules already set.
#### Resp Reply
Returns +OK on success, otherwise --ERR message if any.
---
### ACL USERS
#### Syntax
```bash
ACL USERS
```
The command shows a list of all the usernames of the currently configured users in the Garnet ACL system.
#### Resp Reply
Array reply: list of existing ACL users.
---
### ACL WHOAMI
#### Syntax
```bash
ACL WHOAMI
```
Return the username the current connection is authenticated with. New connections are authenticated with the "default" user. They can change user using AUTH.
#### Resp Reply
Bulk string reply: the username of the current connection.
---
53 changes: 33 additions & 20 deletions website/docs/commands/api-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,42 @@ Below is the full list of API commands and their implementation status in Garnet
Note that this list is subject to change as we continue to expand our API command support with the help of our growing community.

### Command Categories
1. [BITMAP](#bitmap)
2. [CLUSTER](#cluster)
3. [CONNECTION](#connection)
4. [FUNCTIONS](#functions)
5. [GENERIC](#generic)
6. [GEO](#geo)
7. [HASH](#hash)
8. [HYPERLOGLOG](#hyperloglog)
9. [KEYS](#keys)
10. [LIST](#list)
11. [PUB/SUB](#pubsub)
12. [SCRIPTING](#scripting)
13. [SERVER](#server)
14. [SET](#set)
15. [SORTED SET](#sorted-set)
16. [STREAM](#stream)
17. [STRING](#string)
18. [TRANSACTIONS](#transactions)
1. [ACL](#acl)
2. [BITMAP](#bitmap)
3. [CLUSTER](#cluster)
4. [CONNECTION](#connection)
5. [FUNCTIONS](#functions)
6. [GENERIC](#generic)
7. [GEO](#geo)
8. [HASH](#hash)
9. [HYPERLOGLOG](#hyperloglog)
10. [KEYS](#keys)
11. [LIST](#list)
12. [PUB/SUB](#pubsub)
13. [SCRIPTING](#scripting)
14. [SERVER](#server)
15. [SET](#set)
16. [SORTED SET](#sorted-set)
17. [STREAM](#stream)
18. [STRING](#string)
10. [TRANSACTIONS](#transactions)

### Full Commands List

| Category | Command | Implemented in Garnet | Notes |
| ------------- | ------------- | ------------- | ------------- |
| <span id="acl">**ACL**</span> | [CAT](acl.md#acl-cat) || |
| | [DELUSER](acl.md#acl-deluser) || |
| | DRYRUN || |
| | GENPASS || |
| | GETUSER || |
| | [LIST](acl.md#acl-list) || |
| | [LOAD](acl.md#acl-load) || |
| | LOG || |
| | SAVE || |
| | [SETUSER](acl.md#acl-setuser) || |
| | [USERS](acl.md#acl-users) || |
| | [WHOAMI](acl.md#acl-whoami) || |
| <span id="bitmap">**BITMAP**</span> | [BITCOUNT](analytics.md#bitcount) || |
| | [BITFIELD](analytics.md#bitfield) || |
| | BITFIELD_RO || |
Expand Down Expand Up @@ -223,7 +236,7 @@ Note that this list is subject to change as we continue to expand our API comman
| | SMISMEMBER || |
| | SMOVE || |
| | [SPOP](data-structures.md#spop) || |
| | SRANDMEMBER | | |
| | [SRANDMEMBER](data-structures.md#srandmember) | | |
| | [SREM](data-structures.md#srem) || |
| | [SSCAN](data-structures.md#sscan) || |
| | SUNION || |
Expand Down Expand Up @@ -297,7 +310,7 @@ Note that this list is subject to change as we continue to expand our API comman
| | [SET](raw-string.md#set) || |
| | [SET ... NX](raw-string.md#set) || |
| | [SETEX](raw-string.md#setex) || |
| | [SETNX](raw-string.md#setnx) | | |
| | SETNX | | |
| | SETRANGE || |
| | [STRLEN](raw-string.md#strlen) || |
| | SUBSTR || |
Expand Down
17 changes: 17 additions & 0 deletions website/docs/commands/data-structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,23 @@ Returns if **member** is a member of the set stored at **key**.
---
### SRANDMEMBER
#### Syntax
```bash
SRANDMEMBER key [count]
```
When called with just the **key** argument, return a random element from the set value stored at **key**.
If the provided **count** argument is positive, return an array of **distinct elements**. The array's length is either **count** or the set's cardinality (SCARD), whichever is lower.
If called with a negative **count**, the behavior changes and the command is allowed to return the **same element multiple times**. In this case, the number of returned elements is the absolute value of the specified **count**.
---
### SREM
#### Syntax
Expand Down
19 changes: 0 additions & 19 deletions website/docs/commands/raw-string.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,25 +231,6 @@ Simple string reply: OK.
---
### SETNX
#### Syntax
```bash
SETNX key value
```
Set **key** to hold value if **key** does not exist. When **key** already holds a value, no operation is performed.
#### Resp Reply
One of the following:
* Integer reply: 0 if the key was not set.
* Integer reply: 1 if the key was set.
---
### STRLEN
#### Syntax
Expand Down
2 changes: 1 addition & 1 deletion website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const sidebars = {
{type: 'category', label: 'Welcome', collapsed: false, items: ["welcome/intro", "welcome/news", "welcome/features", "welcome/releases", "welcome/compatibility", "welcome/roadmap", "welcome/faq", "welcome/about-us"]},
{type: 'category', label: 'Getting Started', items: ["getting-started/build", "getting-started/configuration", "getting-started/security"]},
{type: 'category', label: 'Benchmarking', items: ["benchmarking/overview", "benchmarking/results-resp-bench", "benchmarking/resp-bench"]},
{type: 'category', label: 'Commands', items: ["commands/overview", "commands/api-compatibility", "commands/raw-string", "commands/generic-commands", "commands/analytics-commands", "commands/data-structures", "commands/server-commands", "commands/checkpoint-commands", "commands/transactions-commands", "commands/cluster"]},
{type: 'category', label: 'Commands', items: ["commands/overview", "commands/api-compatibility", "commands/raw-string", "commands/generic-commands", "commands/analytics-commands", "commands/data-structures", "commands/server-commands", "commands/checkpoint-commands", "commands/transactions-commands", "commands/cluster", "commands/acl-commands"]},
{type: 'category', label: 'Server Extensions', items: ["extensions/transactions", "extensions/raw-strings", "extensions/objects"]},
{type: 'category', label: 'Cluster Mode', items: ["cluster/overview", "cluster/replication", "cluster/key-migration"]},
{type: 'category', label: 'Developer Guide', items: ["dev/onboarding", "dev/code-structure", "dev/configuration", "dev/network", "dev/processing", "dev/garnet-api",
Expand Down

0 comments on commit 17572f4

Please sign in to comment.