diff --git a/web/src/main/java/org/springframework/security/web/aot/hint/UserCredentialRuntimeHints.java b/web/src/main/java/org/springframework/security/web/aot/hint/UserCredentialRuntimeHints.java index c3b4c95a148..96700568725 100644 --- a/web/src/main/java/org/springframework/security/web/aot/hint/UserCredentialRuntimeHints.java +++ b/web/src/main/java/org/springframework/security/web/aot/hint/UserCredentialRuntimeHints.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,9 @@ class UserCredentialRuntimeHints implements RuntimeHintsRegistrar { @Override public void registerHints(RuntimeHints hints, ClassLoader classLoader) { - hints.resources().registerPattern("org/springframework/security/user-credentials-schema.sql"); + hints.resources() + .registerPattern("org/springframework/security/user-credentials-schema.sql") + .registerPattern("org/springframework/security/user-credentials-schema-postgres.sql"); } } diff --git a/web/src/main/resources/org/springframework/security/user-credentials-schema-postgres.sql b/web/src/main/resources/org/springframework/security/user-credentials-schema-postgres.sql new file mode 100644 index 00000000000..fb93b3869ac --- /dev/null +++ b/web/src/main/resources/org/springframework/security/user-credentials-schema-postgres.sql @@ -0,0 +1,18 @@ +create table user_credentials +( + credential_id varchar(1000) not null, + user_entity_user_id varchar(1000) not null, + public_key bytea not null, + signature_count bigint, + uv_initialized boolean, + backup_eligible boolean not null, + authenticator_transports varchar(1000), + public_key_credential_type varchar(100), + backup_state boolean not null, + attestation_object bytea, + attestation_client_data_json bytea, + created timestamp, + last_used timestamp, + label varchar(1000) not null, + primary key (credential_id) +); diff --git a/web/src/test/java/org/springframework/security/web/aot/hint/UserCredentialRuntimeHintsTests.java b/web/src/test/java/org/springframework/security/web/aot/hint/UserCredentialRuntimeHintsTests.java index 33799cc6f92..ed44b4cb268 100644 --- a/web/src/test/java/org/springframework/security/web/aot/hint/UserCredentialRuntimeHintsTests.java +++ b/web/src/test/java/org/springframework/security/web/aot/hint/UserCredentialRuntimeHintsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,8 @@ void credentialRecordsSqlFilesHasHints(String schemaFile) { } private static Stream getClientRecordsSqlFiles() { - return Stream.of("org/springframework/security/user-credentials-schema.sql"); + return Stream.of("org/springframework/security/user-credentials-schema.sql", + "org/springframework/security/user-credentials-schema-postgres.sql"); } }