@@ -633,16 +633,16 @@ Y_UNIT_TEST_SUITE(Mvp) {
633
633
const NActors::TActorId sessionCreator = runtime.Register (new TSessionCreateHandler (edge, settings));
634
634
incomingRequest = new NHttp::THttpIncomingRequest ();
635
635
TStringBuilder request;
636
- request << " GET /auth/callback?code=code_template&state=" << state << " HTTP/1.1\r\n " ;
636
+ request << " GET /auth/callback?code=code_template# &state=" << state << " HTTP/1.1\r\n " ;
637
637
request << " Host: " + hostProxy + " \r\n " ;
638
638
request << " Cookie: " << setCookie.NextTok (" ;" ) << " \r\n " ;
639
639
EatWholeString (incomingRequest, redirectStrategy.CreateRequest (request));
640
640
runtime.Send (new IEventHandle (sessionCreator, edge, new NHttp::TEvHttpProxy::TEvHttpIncomingRequest (incomingRequest)));
641
641
642
642
auto outgoingRequestEv = runtime.GrabEdgeEvent <NHttp::TEvHttpProxy::TEvHttpOutgoingRequest>(handle);
643
643
const TStringBuf& body = outgoingRequestEv->Request ->Body ;
644
- UNIT_ASSERT_STRING_CONTAINS (body, " code%3Dcode_template " );
645
- UNIT_ASSERT_STRING_CONTAINS (body, " grant_type%3Dauthorization_code " );
644
+ UNIT_ASSERT_STRING_CONTAINS (body, " code=code_template%23 " );
645
+ UNIT_ASSERT_STRING_CONTAINS (body, " grant_type=authorization_code " );
646
646
647
647
const TString authorizationServerResponse = R"___( {"access_token":"access_token_value","token_type":"bearer","expires_in":43199,"scope":"openid","id_token":"id_token_value"})___" ;
648
648
NHttp::THttpIncomingResponsePtr incomingResponse = new NHttp::THttpIncomingResponse (outgoingRequestEv->Request );
@@ -724,7 +724,7 @@ Y_UNIT_TEST_SUITE(Mvp) {
724
724
}
725
725
const TString hostProxy = " oidcproxy.net" ;
726
726
TStringBuilder request;
727
- request << " GET /auth/callback?code=code_template&state=" << wrongState << " HTTP/1.1\r\n " ;
727
+ request << " GET /auth/callback?code=code_template# &state=" << wrongState << " HTTP/1.1\r\n " ;
728
728
request << " Host: " + hostProxy + " \r\n " ;
729
729
TString cookie = context.CreateYdbOidcCookie (settings.ClientSecret );
730
730
TStringBuf cookieBuf (cookie);
@@ -778,7 +778,7 @@ Y_UNIT_TEST_SUITE(Mvp) {
778
778
779
779
TContext context ({.State = " test_state" , .RequestedAddress = " /requested/page" , .AjaxRequest = false });
780
780
TStringBuilder request;
781
- request << " GET /auth/callback?code=code_template&state=" << context.GetState (settings.ClientSecret ) << " HTTP/1.1\r\n " ;
781
+ request << " GET /auth/callback?code=code_template# &state=" << context.GetState (settings.ClientSecret ) << " HTTP/1.1\r\n " ;
782
782
request << " Host: oidcproxy.net\r\n " ;
783
783
TString cookie = context.CreateYdbOidcCookie (settings.ClientSecret );
784
784
TStringBuf cookieBuf (cookie);
@@ -793,8 +793,8 @@ Y_UNIT_TEST_SUITE(Mvp) {
793
793
TAutoPtr<IEventHandle> handle;
794
794
auto outgoingRequestEv = runtime.GrabEdgeEvent <NHttp::TEvHttpProxy::TEvHttpOutgoingRequest>(handle);
795
795
const TStringBuf& body = outgoingRequestEv->Request ->Body ;
796
- UNIT_ASSERT_STRING_CONTAINS (body, " code%3Dcode_template " );
797
- UNIT_ASSERT_STRING_CONTAINS (body, " grant_type%3Dauthorization_code " );
796
+ UNIT_ASSERT_STRING_CONTAINS (body, " code=code_template%23 " );
797
+ UNIT_ASSERT_STRING_CONTAINS (body, " grant_type=authorization_code " );
798
798
799
799
const TString authorizationServerResponse = R"___( {"access_token":"access_token_value","token_type":"bearer","expires_in":43199,"scope":"openid","id_token":"id_token_value"})___" ;
800
800
NHttp::THttpIncomingResponsePtr incomingResponse = new NHttp::THttpIncomingResponse (outgoingRequestEv->Request );
@@ -832,7 +832,7 @@ Y_UNIT_TEST_SUITE(Mvp) {
832
832
const NActors::TActorId sessionCreator = runtime.Register (new TSessionCreateHandler (edge, settings));
833
833
TContext context ({.State = " test_state" , .RequestedAddress = " /requested/page" , .AjaxRequest = redirectStrategy.IsAjaxRequest ()});
834
834
TStringBuilder request;
835
- request << " GET /auth/callback?code=code_template&state=" << context.GetState (settings.ClientSecret ) << " HTTP/1.1\r\n " ;
835
+ request << " GET /auth/callback?code=code_template# &state=" << context.GetState (settings.ClientSecret ) << " HTTP/1.1\r\n " ;
836
836
request << " Host: oidcproxy.net\r\n " ;
837
837
TString cookie = context.CreateYdbOidcCookie (settings.ClientSecret );
838
838
TStringBuf cookieBuf (cookie);
@@ -848,8 +848,8 @@ Y_UNIT_TEST_SUITE(Mvp) {
848
848
TAutoPtr<IEventHandle> handle;
849
849
auto outgoingRequestEv = runtime.GrabEdgeEvent <NHttp::TEvHttpProxy::TEvHttpOutgoingRequest>(handle);
850
850
const TStringBuf& body = outgoingRequestEv->Request ->Body ;
851
- UNIT_ASSERT_STRING_CONTAINS (body, " code%3Dcode_template " );
852
- UNIT_ASSERT_STRING_CONTAINS (body, " grant_type%3Dauthorization_code " );
851
+ UNIT_ASSERT_STRING_CONTAINS (body, " code=code_template%23 " );
852
+ UNIT_ASSERT_STRING_CONTAINS (body, " grant_type=authorization_code " );
853
853
854
854
const TString authorizationServerResponse = R"___( {"access_token":"invalid_access_token","token_type":"bearer","expires_in":43199,"scope":"openid","id_token":"id_token_value"})___" ;
855
855
NHttp::THttpIncomingResponsePtr incomingResponse = new NHttp::THttpIncomingResponse (outgoingRequestEv->Request );
@@ -899,7 +899,7 @@ Y_UNIT_TEST_SUITE(Mvp) {
899
899
900
900
TContext context ({.State = " test_state" , .RequestedAddress = " /requested/page" , .AjaxRequest = false });
901
901
TStringBuilder request;
902
- request << " GET /callback?code=code_template&state=" << context.GetState (settings.ClientSecret ) << " HTTP/1.1\r\n " ;
902
+ request << " GET /callback?code=code_template# &state=" << context.GetState (settings.ClientSecret ) << " HTTP/1.1\r\n " ;
903
903
request << " Host: oidcproxy.net\r\n " ;
904
904
TString cookie = context.CreateYdbOidcCookie (settings.ClientSecret );
905
905
TStringBuf cookieBuf (cookie);
@@ -915,8 +915,8 @@ Y_UNIT_TEST_SUITE(Mvp) {
915
915
auto outgoingRequestEv = runtime.GrabEdgeEvent <NHttp::TEvHttpProxy::TEvHttpOutgoingRequest>(handle);
916
916
const TStringBuf& body = outgoingRequestEv->Request ->Body ;
917
917
918
- UNIT_ASSERT_STRING_CONTAINS (body, " code%3Dcode_template " );
919
- UNIT_ASSERT_STRING_CONTAINS (body, " grant_type%3Dauthorization_code " );
918
+ UNIT_ASSERT_STRING_CONTAINS (body, " code=code_template%23 " );
919
+ UNIT_ASSERT_STRING_CONTAINS (body, " grant_type=authorization_code " );
920
920
921
921
const TString authorizationServerResponse = R"___( {"access_token":"access_token_value","token_type":"bearer","expires_in":43199,"scope":"openid","id_token":"id_token_value"})___" ;
922
922
NHttp::THttpIncomingResponsePtr incomingResponse = new NHttp::THttpIncomingResponse (outgoingRequestEv->Request );
@@ -1062,7 +1062,7 @@ Y_UNIT_TEST_SUITE(Mvp) {
1062
1062
TContext context ({.State = " good_state" , .RequestedAddress = " /requested/page" , .AjaxRequest = false });
1063
1063
const TString hostProxy = " oidcproxy.net" ;
1064
1064
TStringBuilder request;
1065
- request << " GET /auth/callback?code=code_template&state=" << context.GetState (settings.ClientSecret ) << " HTTP/1.1\r\n " ;
1065
+ request << " GET /auth/callback?code=code_template# &state=" << context.GetState (settings.ClientSecret ) << " HTTP/1.1\r\n " ;
1066
1066
request << " Host: " + hostProxy + " \r\n " ;
1067
1067
NHttp::THttpIncomingRequestPtr incomingRequest = new NHttp::THttpIncomingRequest ();
1068
1068
EatWholeString (incomingRequest, request);
@@ -1106,7 +1106,7 @@ Y_UNIT_TEST_SUITE(Mvp) {
1106
1106
}
1107
1107
const TString hostProxy = " oidcproxy.net" ;
1108
1108
TStringBuilder request;
1109
- request << " GET /auth/callback?code=code_template&state=" << wrongState << " HTTP/1.1\r\n " ;
1109
+ request << " GET /auth/callback?code=code_template# &state=" << wrongState << " HTTP/1.1\r\n " ;
1110
1110
request << " Host: " + hostProxy + " \r\n " ;
1111
1111
TString cookie = context.CreateYdbOidcCookie (settings.ClientSecret );
1112
1112
TStringBuf cookieBuf (cookie);
0 commit comments