diff options
| -rw-r--r-- | config/slskd.example.yml | 1 | ||||
| -rw-r--r-- | src/slskd/Core/Options.cs | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/config/slskd.example.yml b/config/slskd.example.yml index 5939fb58..10c59288 100644 --- a/config/slskd.example.yml +++ b/config/slskd.example.yml @@ -97,6 +97,7 @@ # api_keys: # my_api_key: # key: <some example string between 16 and 255 characters> +# role: readonly # readonly, readwrite, administrator # cidr: 0.0.0.0/0,::/0 # logger: # loki: ~ diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index 765ba6e9..a1591923 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -29,6 +29,7 @@ namespace slskd using System.Text.RegularExpressions; using FluentFTP; using NetTools; + using slskd.Authentication; using slskd.Configuration; using slskd.Cryptography; using slskd.Network; @@ -1424,6 +1425,13 @@ namespace slskd public string Key { get; init; } /// <summary> + /// Gets the role for the key. + /// </summary> + [Description("user role for the key; readonly, readwrite, administrator")] + [Enum(typeof(Role))] + public string Role { get; init; } = slskd.Authentication.Role.ReadOnly.ToString(); + + /// <summary> /// Gets the comma separated list of CIDRs that are authorized to use the key. /// </summary> [Description("An optional comma separated list of CIDRs that are authorized to use the key")] |
