File tree 2 files changed +6
-10
lines changed
2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -18,18 +18,14 @@ package ytest
18
18
19
19
import (
20
20
"github.com/goplus/yap/ytest/auth"
21
- "github.com/goplus/yap/ytest/auth/token "
21
+ "github.com/goplus/yap/ytest/auth/bearer "
22
22
)
23
23
24
24
// -----------------------------------------------------------------------------
25
25
26
- func Oauth2 (auth string ) auth.RTComposer {
27
- return nil
28
- }
29
-
30
- // Token creates an Authorization by specified token.
31
- func Token (auth string ) auth.RTComposer {
32
- return token .New (auth )
26
+ // Bearer creates a Bearer Authorization by specified token.
27
+ func Bearer (token string ) auth.RTComposer {
28
+ return bearer .New (token )
33
29
}
34
30
35
31
// -----------------------------------------------------------------------------
Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
- package token
17
+ package bearer
18
18
19
19
import (
20
20
"net/http"
@@ -30,7 +30,7 @@ type tokenRounderTripper struct {
30
30
}
31
31
32
32
func (p * tokenRounderTripper ) RoundTrip (req * http.Request ) (* http.Response , error ) {
33
- req .Header .Set ("Authorization" , p .token )
33
+ req .Header .Set ("Authorization" , "Bearer " + p .token )
34
34
return p .rt .RoundTrip (req )
35
35
}
36
36
You can’t perform that action at this time.
0 commit comments