@@ -218,6 +218,8 @@ type TestCase struct {
218218 Expected TestResults
219219 RequestHeader map [string ]string
220220 RequestCookie * http.Cookie
221+
222+ DisableV1Services bool
221223}
222224
223225func ParametrizedRouteTest (scenario TestCase ) func (* testing.T ) {
@@ -298,6 +300,7 @@ func ParametrizedRouteTest(scenario TestCase) func(*testing.T) {
298300 defer gitlab .Close ()
299301 rpConfig .ExternalGitlabURL = gitlabURL
300302 }
303+ rpConfig .EnableV1Services = ! scenario .DisableV1Services
301304 proxy , proxyURL := setupTestRevproxy (& rpConfig , sessionStore )
302305 defer upstream .Close ()
303306 defer upstream2 .Close ()
@@ -440,6 +443,46 @@ func TestInternalSvcRoutes(t *testing.T) {
440443 },
441444 RequestCookie : & http.Cookie {Name : sessions .SessionCookieName , Value : "sessionID" },
442445 },
446+ {
447+ Path : "/api/notebooks/test/acceptedAuth" ,
448+ Expected : TestResults {
449+ Path : "/api/data/notebooks/test/acceptedAuth" ,
450+ VisitedServerIDs : []string {"upstream" },
451+ UpstreamRequestHeaders : []map [string ]string {{
452+ echo .HeaderAuthorization : "Bearer accessTokenValue" ,
453+ "Gitlab-Access-Token" : "" ,
454+ "Gitlab-Access-Token-Expires-At" : "" ,
455+ "Renku-Auth-Refresh-Token" : "refreshTokenValue" ,
456+ "Renku-Auth-Anon-Id" : "" ,
457+ }},
458+ },
459+ Tokens : []models.AuthToken {
460+ newTestToken (
461+ models .AccessTokenType ,
462+ tokenID ("renku:myToken" ),
463+ tokenPlainValue ("accessTokenValue" ),
464+ tokenProviderID ("renku" ),
465+ ),
466+ newTestToken (
467+ models .RefreshTokenType ,
468+ tokenID ("renku:myToken" ),
469+ tokenPlainValue ("refreshTokenValue" ),
470+ tokenProviderID ("renku" ),
471+ ),
472+ newTestToken (
473+ models .AccessTokenType ,
474+ tokenID ("gitlab:otherToken" ),
475+ tokenPlainValue ("gitlabAccessTokenValue" ),
476+ tokenProviderID ("gitlab" ),
477+ tokenExpiresAt (time .Unix (16746525971 , 0 )),
478+ ),
479+ },
480+ Sessions : []models.Session {
481+ newTestSesssion (sessionID ("sessionID" ), withTokenIDs (map [string ]string {"renku" : "renku:myToken" , "gitlab" : "gitlab:otherToken" })),
482+ },
483+ RequestCookie : & http.Cookie {Name : sessions .SessionCookieName , Value : "sessionID" },
484+ DisableV1Services : true ,
485+ },
443486 {
444487 Path : "/api/notebooks" ,
445488 Expected : TestResults {Path : "/api/data/notebooks" , VisitedServerIDs : []string {"upstream" }},
0 commit comments