(t *testing.T)
| 71 | } |
| 72 | |
| 73 | func TestBceSigner_GetSignature(t *testing.T) { |
| 74 | s := getSigner() |
| 75 | baseURL, _ := url.Parse("http://127.0.0.1/v1/functions/test") |
| 76 | req := rest.NewRequest(nil, "GET", baseURL, "v1", rest.ContentConfig{}, nil, 0) |
| 77 | req.SetHeader("Content-Length", "13256") |
| 78 | req.SetHeader("Content-MD5", "ujOLK9GE1xdbYdfKvfI1BA==") |
| 79 | req.SetHeader("Host", "bos.qasandbox.bcetest.baidu.com") |
| 80 | req.SetHeader("x-cloud-content-sha256", "4604e6530e5a06dec3099e77977cab6c7c88eae21005f6edd66deffc203a5e6e") |
| 81 | req.SetHeader("x-cloud-date", "2016-01-04T06:12:04Z") |
| 82 | req.SetHeader("x-cloud-request-id", "f98023ac-1189-412b-93f5-859970585dce") |
| 83 | |
| 84 | req.Param("foo", "bar") |
| 85 | req.Param("path", "/aaa/bbb/ccc") |
| 86 | res := s.GetSignature(req) |
| 87 | t.Logf("get signature %s", res) |
| 88 | } |
| 89 | |
| 90 | func getSigner() auth.Signer { |
| 91 | fc := bceAuthFactory{} |
nothing calls this directly
no test coverage detected