@@ -159,7 +159,7 @@ def test_revocation_disabled_without_endpoint(self, jwt_verifier):
159159 assert proxy ._upstream_revocation_endpoint is None
160160
161161 async def test_register_client (self , oauth_proxy ):
162- """Test client registration always uses upstream credentials ."""
162+ """Test client registration stores ProxyDCRClient without modifying original ."""
163163 client_info = OAuthClientInformationFull (
164164 client_id = "original-client-id" ,
165165 client_secret = "original-secret" ,
@@ -170,20 +170,19 @@ async def test_register_client(self, oauth_proxy):
170170
171171 await oauth_proxy .register_client (client_info )
172172
173- # Verify client was modified to use upstream credentials
174- assert client_info .client_id == "test-client-id"
175- assert client_info .client_secret == "test-client-secret"
176- assert client_info .token_endpoint_auth_method == "none"
177- assert "authorization_code" in client_info .grant_types
178- # refresh_token is only added if grant_types was empty
173+ assert client_info .client_id == "original-client-id"
174+ assert client_info .client_secret == "original-secret"
175+ assert client_info .token_endpoint_auth_method == "client_secret_post"
176+ assert client_info .grant_types == ["authorization_code" ]
179177
180- # Verify client was stored
178+ # Verify ProxyDCRClient was stored with upstream credentials
181179 stored_client = oauth_proxy ._clients .get ("test-client-id" )
182180 assert stored_client is not None
183181 assert stored_client .client_id == "test-client-id"
182+ assert stored_client .client_secret == "test-client-secret"
184183
185184 async def test_register_client_empty_grant_types (self , oauth_proxy ):
186- """Test client registration adds grant types when empty ."""
185+ """Test client registration with empty grant types."""
187186 client_info = OAuthClientInformationFull (
188187 client_id = "original-client-id" ,
189188 client_secret = "original-secret" ,
@@ -193,8 +192,12 @@ async def test_register_client_empty_grant_types(self, oauth_proxy):
193192
194193 await oauth_proxy .register_client (client_info )
195194
196- # Should add both authorization_code and refresh_token
197- assert client_info .grant_types == ["authorization_code" , "refresh_token" ]
195+ assert client_info .grant_types == []
196+
197+ # Verify stored ProxyDCRClient has proper grant types
198+ stored_client = oauth_proxy ._clients .get ("test-client-id" )
199+ assert stored_client is not None
200+ assert stored_client .grant_types == ["authorization_code" , "refresh_token" ]
198201
199202 async def test_get_client_existing (self , oauth_proxy ):
200203 """Test getting an existing registered client."""
0 commit comments