From e1c27a3c7fd2a48eadf7c0afce4b7efa74506aed Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Fri, 30 Aug 2024 18:11:52 +0200 Subject: [PATCH] Update redirect URIs when syncing clients from the config Fixes #3143 --- ...ee99a00e32df3727ebe97b523b6836e1696d8b8e2a0ef70bfa44.json} | 4 ++-- crates/storage-pg/src/oauth2/client.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) rename crates/storage-pg/.sqlx/{query-d93810bb6573bf27f4ed83f5a1733640f3d5aa6d7354a1b16647d3cc941fc76c.json => query-5236305c49b1ee99a00e32df3727ebe97b523b6836e1696d8b8e2a0ef70bfa44.json} (56%) diff --git a/crates/storage-pg/.sqlx/query-d93810bb6573bf27f4ed83f5a1733640f3d5aa6d7354a1b16647d3cc941fc76c.json b/crates/storage-pg/.sqlx/query-5236305c49b1ee99a00e32df3727ebe97b523b6836e1696d8b8e2a0ef70bfa44.json similarity index 56% rename from crates/storage-pg/.sqlx/query-d93810bb6573bf27f4ed83f5a1733640f3d5aa6d7354a1b16647d3cc941fc76c.json rename to crates/storage-pg/.sqlx/query-5236305c49b1ee99a00e32df3727ebe97b523b6836e1696d8b8e2a0ef70bfa44.json index ea17cb75e..23b06789c 100644 --- a/crates/storage-pg/.sqlx/query-d93810bb6573bf27f4ed83f5a1733640f3d5aa6d7354a1b16647d3cc941fc76c.json +++ b/crates/storage-pg/.sqlx/query-5236305c49b1ee99a00e32df3727ebe97b523b6836e1696d8b8e2a0ef70bfa44.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n INSERT INTO oauth2_clients\n ( oauth2_client_id\n , encrypted_client_secret\n , redirect_uris\n , grant_type_authorization_code\n , grant_type_refresh_token\n , grant_type_client_credentials\n , grant_type_device_code\n , token_endpoint_auth_method\n , jwks\n , jwks_uri\n , is_static\n )\n VALUES\n ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, TRUE)\n ON CONFLICT (oauth2_client_id)\n DO\n UPDATE SET encrypted_client_secret = EXCLUDED.encrypted_client_secret\n , grant_type_authorization_code = EXCLUDED.grant_type_authorization_code\n , grant_type_refresh_token = EXCLUDED.grant_type_refresh_token\n , grant_type_client_credentials = EXCLUDED.grant_type_client_credentials\n , grant_type_device_code = EXCLUDED.grant_type_device_code\n , token_endpoint_auth_method = EXCLUDED.token_endpoint_auth_method\n , jwks = EXCLUDED.jwks\n , jwks_uri = EXCLUDED.jwks_uri\n , is_static = TRUE\n ", + "query": "\n INSERT INTO oauth2_clients\n ( oauth2_client_id\n , encrypted_client_secret\n , redirect_uris\n , grant_type_authorization_code\n , grant_type_refresh_token\n , grant_type_client_credentials\n , grant_type_device_code\n , token_endpoint_auth_method\n , jwks\n , jwks_uri\n , is_static\n )\n VALUES\n ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, TRUE)\n ON CONFLICT (oauth2_client_id)\n DO\n UPDATE SET encrypted_client_secret = EXCLUDED.encrypted_client_secret\n , redirect_uris = EXCLUDED.redirect_uris\n , grant_type_authorization_code = EXCLUDED.grant_type_authorization_code\n , grant_type_refresh_token = EXCLUDED.grant_type_refresh_token\n , grant_type_client_credentials = EXCLUDED.grant_type_client_credentials\n , grant_type_device_code = EXCLUDED.grant_type_device_code\n , token_endpoint_auth_method = EXCLUDED.token_endpoint_auth_method\n , jwks = EXCLUDED.jwks\n , jwks_uri = EXCLUDED.jwks_uri\n , is_static = TRUE\n ", "describe": { "columns": [], "parameters": { @@ -19,5 +19,5 @@ }, "nullable": [] }, - "hash": "d93810bb6573bf27f4ed83f5a1733640f3d5aa6d7354a1b16647d3cc941fc76c" + "hash": "5236305c49b1ee99a00e32df3727ebe97b523b6836e1696d8b8e2a0ef70bfa44" } diff --git a/crates/storage-pg/src/oauth2/client.rs b/crates/storage-pg/src/oauth2/client.rs index 034a7ecbd..9fb3c3192 100644 --- a/crates/storage-pg/src/oauth2/client.rs +++ b/crates/storage-pg/src/oauth2/client.rs @@ -574,6 +574,7 @@ impl<'c> OAuth2ClientRepository for PgOAuth2ClientRepository<'c> { ON CONFLICT (oauth2_client_id) DO UPDATE SET encrypted_client_secret = EXCLUDED.encrypted_client_secret + , redirect_uris = EXCLUDED.redirect_uris , grant_type_authorization_code = EXCLUDED.grant_type_authorization_code , grant_type_refresh_token = EXCLUDED.grant_type_refresh_token , grant_type_client_credentials = EXCLUDED.grant_type_client_credentials