add support to not require signing checks
This commit is contained in:
parent
3c09fb8f15
commit
8c27b8c3fb
1 changed files with 10 additions and 2 deletions
|
|
@ -212,7 +212,10 @@ namespace SecondBotEvents.Services
|
||||||
|
|
||||||
public KeyValuePair<bool, string> RunCommand(SignedCommand C)
|
public KeyValuePair<bool, string> RunCommand(SignedCommand C)
|
||||||
{
|
{
|
||||||
|
if(acceptNewCommands == false)
|
||||||
|
{
|
||||||
|
return new KeyValuePair<bool, string>(false, "Not accepting commands");
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string lowerName = C.command.ToLower();
|
string lowerName = C.command.ToLower();
|
||||||
|
|
@ -324,13 +327,18 @@ namespace SecondBotEvents.Services
|
||||||
}
|
}
|
||||||
Vaildate(requireTimewindow, windowSize, secret);
|
Vaildate(requireTimewindow, windowSize, secret);
|
||||||
}
|
}
|
||||||
public SignedCommand(string setCommand, string setSigningCode, string[] setArgs, int setUnixtime, string setReplyTarget, bool requireTimewindow, int windowSize, string secret)
|
public SignedCommand(string setCommand, string setSigningCode, string[] setArgs, int setUnixtime, string setReplyTarget, bool requireTimewindow, int windowSize, string secret, bool requireSigning = true)
|
||||||
{
|
{
|
||||||
command = setCommand;
|
command = setCommand;
|
||||||
signingCode = setSigningCode;
|
signingCode = setSigningCode;
|
||||||
args = setArgs;
|
args = setArgs;
|
||||||
unixtimeOfCommand = setUnixtime;
|
unixtimeOfCommand = setUnixtime;
|
||||||
replyTarget = setReplyTarget;
|
replyTarget = setReplyTarget;
|
||||||
|
if (requireSigning == false)
|
||||||
|
{
|
||||||
|
accepted = true; // just accept the command
|
||||||
|
return;
|
||||||
|
}
|
||||||
Vaildate(requireTimewindow, windowSize, secret);
|
Vaildate(requireTimewindow, windowSize, secret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue