mirror of
https://github.com/astaxie/beego.git
synced 2025-01-10 12:57:13 +00:00
debd68cbe4
This reverts commit fad897346f286303a6c4a2cb432ea44058e470cd, reversing changes made to e284b0ddae072311617a6fdd8393eb04aba873d2.
21 lines
425 B
Go
21 lines
425 B
Go
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")
|
|
}
|
|
}
|