diff --git a/Core/Commands/StreamAdmin.cs b/Core/Commands/StreamAdmin.cs index 1d814e4..4eab0a1 100644 --- a/Core/Commands/StreamAdmin.cs +++ b/Core/Commands/StreamAdmin.cs @@ -31,7 +31,7 @@ namespace BetterSecondBot.HttpService [Route(HttpVerbs.Post, "/FetchNextNotecard/{token}")] public object FetchNextNotecard([FormField] string endpoint, [FormField] string endpointcode, string token) { - if (tokens.Allow(token, "avatars", "FetchNextNotecard", handleGetClientIP()) == false) + if (tokens.Allow(token, "streamadmin", "FetchNextNotecard", handleGetClientIP()) == false) { return Failure("Token not accepted"); } diff --git a/Core/HttpService/HttpAsService.cs b/Core/HttpService/HttpAsService.cs index d3007c8..757f9cd 100644 --- a/Core/HttpService/HttpAsService.cs +++ b/Core/HttpService/HttpAsService.cs @@ -35,9 +35,9 @@ namespace BetterSecondBot.HttpService bool found = true; while (found == true) { - if (helpers.notempty(Environment.GetEnvironmentVariable("scoped_token_" + loop.ToString())) == true) + if (helpers.notempty(Environment.GetEnvironmentVariable("ScopedToken" + loop.ToString())) == true) { - processScopedTokenRaw(Environment.GetEnvironmentVariable("scoped_token_" + loop.ToString())); + processScopedTokenRaw(Environment.GetEnvironmentVariable("ScopedToken" + loop.ToString())); } else { @@ -343,7 +343,7 @@ namespace BetterSecondBot.HttpService } scopedTokenInfo info = scopedtokens[code]; string build = workgroup + "/" + command; - if (info.AllowWorkgroups.Contains(workgroup) == true) + if ((info.AllowWorkgroups.Contains(workgroup) == true) || (info.AllowWorkgroups.Contains("+ALL") == true)) { return true; } @@ -512,31 +512,39 @@ namespace BetterSecondBot.HttpService if (permsgroupname == "chat") { allowed = new List(){ - "chat/localchathistory", - "chat/localchatsay", - "groups/getgroupchat", - "groups/sendgroupchat", - "groups/listgroups", - "im/chatwindows", - "im/listwithunread", + "chat/IM", + "chat/LocalChatHistory", + "chat/Say", + "group/Groupchat", + "group/GetGroupList", + "group/GroupchatListAllUnreadGroups", "im/getimchat", - "im/sendimchat" + "im/chatwindows", + "im/haveunreadims", + "im/listwithunread" }; } else if (permsgroupname == "giver") { allowed = new List(){ - "inventory/send", - "inventory/folders", - "inventory/contents" + "inventory/SendItem", + "inventory/SendFolder", + "inventory/InventoryFolders", + "inventory/InventoryContents" }; } else if (permsgroupname == "movement") { allowed = new List(){ - "core/walkto", - "core/teleport", - "core/gesture" + "movement/AutoPilot", + "movement/AutoPilotStop", + "movement/Fly", + "movement/RequestTeleport", + "movement/RotateTo", + "movement/RotateToFace", + "movement/RotateToFaceVector", + "movement/SendTeleportLure", + "movement/Teleport", }; } return allowed.Contains(build); diff --git a/README.md b/README.md index c035ba6..6cb7d20 100644 --- a/README.md +++ b/README.md @@ -109,44 +109,69 @@ You get set these tokens up by file or Environment Variables. ##### Environment Variables |Name | Value| |--|--| -| scoped_token_1 | "t:[10charcode],ws:core,ws:group" | -| scoped_token_2 | "t:[10charcode],cg:chat" | -| scoped_token_3 | "t:[10charcode],cm:chat/localchathistory" | +| ScopedToken1 | "t:[10charcode],ws:core,ws:group" | +| ScopedToken2 | "t:[10charcode],cg:chat" | +| ScopedToken3 | "t:[10charcode],cm:chat/LocalChatHistory" | ### HTTP scoped tokens (info) --- - command [cm] "example: `cm:chat/localchathistory` + command [cm] "example: `cm:chat/LocalChatHistory` + "a single command, formated as cm:[workspace]/[commandname]" - workspaces [ws] "example: ws: core, ws: groups" + workspaces [ws] "example: ws: core, ws: group" + "all commands under a workspace" + + "known workspaces" + animation + avatars + chat + core + dialogs + estate + friends + group + home + im + info + inventory + movement + notecard + parcel + self + streamadmin + +ALL commandgroups [cg] "example: `cg:chat`" - chat - chat/localchathistory - chat/localchatsay - groups/getgroupchat - groups/sendgroupchat - groups/listgroups - im/chatwindows - im/listwithunread - im/getimchat - im/sendimchat - - giver - inventory/send - inventory/folders - inventory/contents - - - groupinvite - [WIP] - - movement - core/walkto - core/teleport - core/gesture + chat + chat/IM + chat/LocalChatHistory + chat/Say + group/Groupchat + group/GetGroupList + group/GroupchatListAllUnreadGroups + im/getimchat + im/chatwindows + im/haveunreadims + im/listwithunread + giver + inventory/SendItem + inventory/SendFolder + inventory/InventoryFolders + inventory/InventoryContents + + movement + movement/AutoPilot + movement/AutoPilotStop + movement/Fly + movement/RequestTeleport + movement/RotateTo + movement/RotateToFace + movement/RotateToFaceVector + movement/SendTeleportLure + movement/Teleport ### BetterRelay system