mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-31 09:12:14 +00:00
Add Support Postgres To JdbcUserCredentialRepository
Closes gh-16832 Signed-off-by: Max Batischev <mblancer@mail.ru>
This commit is contained in:
parent
4703f9cf1c
commit
9a897d0b62
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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)
|
||||
);
|
@ -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 @@ public class UserCredentialRuntimeHintsTests {
|
||||
}
|
||||
|
||||
private static Stream<String> 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");
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user