mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-06 15:16:53 +00:00
Code optimization
This commit is contained in:
20
vender/github.com/astaxie/beego/plugins/apiauth/apiauth_test.go
Executable file
20
vender/github.com/astaxie/beego/plugins/apiauth/apiauth_test.go
Executable file
@@ -0,0 +1,20 @@
|
||||
package apiauth
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSignature(t *testing.T) {
|
||||
appsecret := "beego secret"
|
||||
method := "GET"
|
||||
RequestURL := "http://localhost/test/url"
|
||||
params := make(url.Values)
|
||||
params.Add("arg1", "hello")
|
||||
params.Add("arg2", "beego")
|
||||
|
||||
signature := "mFdpvLh48ca4mDVEItE9++AKKQ/IVca7O/ZyyB8hR58="
|
||||
if Signature(appsecret, method, params, RequestURL) != signature {
|
||||
t.Error("Signature error")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user