@@ -29,6 +29,7 @@ func TestValidBearerAuth(t *testing.T) {
2929 assert .True (t , ok )
3030 assert .Equal (t , "admin" , usr )
3131 assert .NoError (t , err )
32+ assert .Equal (t , OAuth2SchemeName (req1 ), "owners_auth" )
3233
3334 req2 , _ := http .NewRequest ("GET" , "/blah" , nil )
3435 req2 .Header .Set ("Authorization" , "Bearer token123" )
@@ -37,6 +38,7 @@ func TestValidBearerAuth(t *testing.T) {
3738 assert .True (t , ok )
3839 assert .Equal (t , "admin" , usr )
3940 assert .NoError (t , err )
41+ assert .Equal (t , OAuth2SchemeName (req2 ), "owners_auth" )
4042
4143 body := url .Values (map [string ][]string {})
4244 body .Set ("access_token" , "token123" )
@@ -47,6 +49,7 @@ func TestValidBearerAuth(t *testing.T) {
4749 assert .True (t , ok )
4850 assert .Equal (t , "admin" , usr )
4951 assert .NoError (t , err )
52+ assert .Equal (t , OAuth2SchemeName (req3 ), "owners_auth" )
5053
5154 mpbody := bytes .NewBuffer (nil )
5255 writer := multipart .NewWriter (mpbody )
@@ -59,6 +62,7 @@ func TestValidBearerAuth(t *testing.T) {
5962 assert .True (t , ok )
6063 assert .Equal (t , "admin" , usr )
6164 assert .NoError (t , err )
65+ assert .Equal (t , OAuth2SchemeName (req4 ), "owners_auth" )
6266}
6367
6468func TestInvalidBearerAuth (t * testing.T ) {
@@ -162,6 +166,7 @@ func TestValidBearerAuthCtx(t *testing.T) {
162166 assert .Equal (t , wisdom , req1 .Context ().Value (original ))
163167 assert .Equal (t , extraWisdom , req1 .Context ().Value (extra ))
164168 assert .Nil (t , req1 .Context ().Value (reason ))
169+ assert .Equal (t , OAuth2SchemeName (req1 ), "owners_auth" )
165170
166171 req2 , _ := http .NewRequest ("GET" , "/blah" , nil )
167172 req2 = req2 .WithContext (context .WithValue (req2 .Context (), original , wisdom ))
@@ -174,6 +179,7 @@ func TestValidBearerAuthCtx(t *testing.T) {
174179 assert .Equal (t , wisdom , req2 .Context ().Value (original ))
175180 assert .Equal (t , extraWisdom , req2 .Context ().Value (extra ))
176181 assert .Nil (t , req2 .Context ().Value (reason ))
182+ assert .Equal (t , OAuth2SchemeName (req2 ), "owners_auth" )
177183
178184 body := url .Values (map [string ][]string {})
179185 body .Set ("access_token" , "token123" )
@@ -188,6 +194,7 @@ func TestValidBearerAuthCtx(t *testing.T) {
188194 assert .Equal (t , wisdom , req3 .Context ().Value (original ))
189195 assert .Equal (t , extraWisdom , req3 .Context ().Value (extra ))
190196 assert .Nil (t , req3 .Context ().Value (reason ))
197+ assert .Equal (t , OAuth2SchemeName (req3 ), "owners_auth" )
191198
192199 mpbody := bytes .NewBuffer (nil )
193200 writer := multipart .NewWriter (mpbody )
@@ -204,6 +211,7 @@ func TestValidBearerAuthCtx(t *testing.T) {
204211 assert .Equal (t , wisdom , req4 .Context ().Value (original ))
205212 assert .Equal (t , extraWisdom , req4 .Context ().Value (extra ))
206213 assert .Nil (t , req4 .Context ().Value (reason ))
214+ assert .Equal (t , OAuth2SchemeName (req4 ), "owners_auth" )
207215}
208216
209217func TestInvalidBearerAuthCtx (t * testing.T ) {
0 commit comments