Проблема с шифрованием учетных данных базы данныхJAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Проблема с шифрованием учетных данных базы данных

Сообщение Anonymous »

Вот pom.xml:

Код: Выделить всё

 & l t ; p r o j e c t   x m l n s = & q u o t ; h t t p : / / m a v e n . a p a c h e . o r g / P O M / 4 . 0 . 0 & q u o t ; < b r   / >         x m l n s : x s i = & q u o t ; h t t p : / / w w w . w 3 . o r g / 2 0 0 1 / X M L S c h e m a - i n s t a n c e & q u o t ; < b r   / >         x s i : s c h e m a L o c a t i o n = & q u o t ; h t t p : / / m a v e n . a p a c h e . o r g / P O M / 4 . 0 . 0   h t t p s : / / m a v e n . a p a c h e . o r g / x s d / m a v e n - 4 . 0 . 0 . x s d & q u o t ; & g t ; < b r   / >         & l t ; m o d e l V e r s i o n & g t ; 4 . 0 . 0 & l t ; / m o d e l V e r s i o n & g t ; < b r   / >         & l t ; p a r e n t & g t ; < b r   / >                 & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r   / >                 & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - p a r e n t & l t ; / a r t i f a c t I d & g t ; < b r   / >                 & l t ; v e r s i o n & g t ; 3 . 3 . 0 & l t ; / v e r s i o n & g t ; < b r   / >                 & l t ; r e l a t i v e P a t h   / & g t ; < b r   / >         & l t ; / p a r e n t & g t ; < b r   / >         & l t ; g r o u p I d & g t ; c o m . p a y m e d & l t ; / g r o u p I d & g t ; < b r   / >         & l t ; a r t i f a c t I d & g t ; a c c o u n t & l t ; / a r t i f a c t I d & g t ; < b r   / >         & l t ; v e r s i o n & g t ; 1 . 7 . 0 & l t ; / v e r s i o n & g t ; < b r   / >         & l t ; n a m e & g t ; a c c o u n t & l t ; / n a m e & g t ; < b r   / >         & l t ; d e s c r i p t i o n & g t ; M o d u l e   d e   c o m p t e   p o u r   l & a m p ; a p o s ; a u t h e n t i f i c a t i o n & l t ; / d e s c r i p t i o n & g t ; < b r   / > < b r   / >         & l t ; p r o p e r t i e s & g t ; < b r   / >                 & l t ; j a v a . v e r s i o n & g t ; 1 7 & l t ; / j a v a . v e r s i o n & g t ; < b r   / >                 & l t ; p r o j e c t . b u i l d . s o u r c e E n c o d i n g & g t ; U T F - 8 & l t ; / p r o j e c t . b u i l d . s o u r c e E n c o d i n g & g t ; < b r   / >                 & l t ; s o n a r . c o v e r a g e . j a c o c o . x m l R e p o r t P a t h s & g t ; t a r g e t / s i t e / j a c o c o / j a c o c o . x m l & l t ; / s o n a r . c o v e r a g e . j a c o c o . x m l R e p o r t P a t h s & g t ; < b r   / >                 & l t ; s p o t l e s s . v e r s i o n & g t ; 2 . 4 4 . 4 & l t ; / s p o t l e s s . v e r s i o n & g t ; < b r   / >                 & l t ; c h e c k s t y l e . v e r s i o n & g t ; 1 0 . 2 3 . 0 & l t ; / c h e c k s t y l e . v e r s i o n & g t ; < b r   / >                 & l t ; c h e c k s t y l e - m a v e n - p l u g i n . v e r s i o n & g t ; 3 . 6 . 0 & l t ; / c h e c k s t y l e - m a v e n - p l u g i n . v e r s i o n & g t ; < b r   / >         & l t ; / p r o p e r t i e s & g t ; < b r   / > < b r   / >         & l t ; p r o f i l e s & g t ; < b r   / >                 & l t ; p r o f i l e & g t ; < b r   / >                         & l t ; i d & g t ; d e v & l t ; / i d & g t ; < b r   / >                         & l t ; a c t i v a t i o n & g t ; < b r   / >                                 & l t ; a c t i v e B y D e f a u l t & g t ; t r u e & l t ; / a c t i v e B y D e f a u l t & g t ; < b r   / >                         & l t ; / a c t i v a t i o n & g t ; < b r   / >                         & l t ; p r o p e r t i e s & g t ; < b r   / >                                 & l t ; p r o j e c t . p a c k a g i n g & g t ; j a r & l t ; / p r o j e c t . p a c k a g i n g & g t ; < b r   / >                         & l t ; / p r o p e r t i e s & g t ; < b r   / >                 & l t ; / p r o f i l e & g t ; < b r   / >                 & l t ; p r o f i l e & g t ; < b r   / >                         & l t ; i d & g t ; r e l e a s e & l t ; / i d & g t ; < b r   / >                         & l t ; p r o p e r t i e s & g t ; < b r   / >                                 & l t ; p r o j e c t . p a c k a g i n g & g t ; w a r & l t ; / p r o j e c t . p a c k a g i n g & g t ; < b r   / >                         & l t ; / p r o p e r t i e s & g t ; < b r   / >                         & l t ; d e p e n d e n c i e s & g t ; < b r   / >                                 & l t ; d e p e n d e n c y & g t ; < b r   / >                                         & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r   / >                                         & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - t o m c a t & l t ; / a r t i f a c t I d & g t ; < b r   / >                                         & l t ; s c o p e & g t ; p r o v i d e d & l t ; / s c o p e & g t ; < b r   / >                                 & l t ; / d e p e n d e n c y & g t ; < b r   / >                                 & l t ; d e p e n d e n c y & g t ; < b r   / >                                         & l t ; g r o u p I d & g t ; j a v a x . s e r v l e t & l t ; / g r o u p I d & g t ; < b r   / >                                         & l t ; a r t i f a c t I d & g t ; s e r v l e t - a p i & l t ; / a r t i f a c t I d & g t ; < b r   / >                                         & l t ; v e r s i o n & g t ; 2 . 3 & l t ; / v e r s i o n & g t ; < b r   / >                                         & l t ; s c o p e & g t ; p r o v i d e d & l t ; / s c o p e & g t ; < b r   / >                                 & l t ; / d e p e n d e n c y & g t ; < b r   / >                         & l t ; / d e p e n d e n c i e s & g t ; < b r   / >                 & l t ; / p r o f i l e & g t ; < b r   / >         & l t ; / p r o f i l e s & g t ; < b r   / > < b r   / >         & l t ; d e p e n d e n c i e s & g t ; < b r   / >                 & l t ; d e p e n d e n c y & g t ; < b r   / >                         & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r   / >                         & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r & l t ; / a r t i f a c t I d & g t ; < b r   / >                         & l t ; e x c l u s i o n s & g t ; < b r   / >                                 & l t ; e x c l u s i o n & g t ; < b r   / >                                         & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r   / >                                         & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - l o g g i n g & l t ; / a r t i f a c t I d & g t ; < b r   / >                                 & l t ; / e x c l u s i o n & g t ; < b r   / >                         & l t ; / e x c l u s i o n s & g t ; < b r   / >                 & l t ; / d e p e n d e n c y & g t ; < b r   / >                 & l t ; d e p e n d e n c y & g t ; < b r   / >                         & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r   / >                         & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - a c t u a t o r & l t ; / a r t i f a c t I d & g t ; < b r   / >                 & l t ; / d e p e n d e n c y & g t ; < b r   / >                 & l t ; d e p e n d e n c y & g t ; < b r   / >                         & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r   / >                         & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - w e b & l t ; / a r t i f a c t I d & g t ; < b r   / >                 & l t ; / d e p e n d e n c y & g t ; < b r   / >                 & l t ; d e p e n d e n c y & g t ; < b r   / >                         & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r   / >                         & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - t e s t & l t ; / a r t i f a c t I d & g t ; < b r   / >                         & l t ; s c o p e & g t ; t e s t & l t ; / s c o p e & g t ; < b r   / >                 & l t ; / d e p e n d e n c y & g t ; < b r   / >                 & l t ; d e p e n d e n c y & g t ; < b r   / >                         & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r   / >                         & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - d a t a - j p a & l t ; / a r t i f a c t I d & g t ; < b r   / >                 & l t ; / d e p e n d e n c y & g t ; < b r   / >                 & l t ; d e p e n d e n c y & g t ; < b r   / >                         & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . s e c u r i t y & l t ; / g r o u p I d & g t ; < b r   / >                         & l t ; a r t i f a c t I d & g t ; s p r i n g - s e c u r i t y - c r y p t o & l t ; / a r t i f a c t I d & g t ; < b r   / >                 & l t ; / d e p e n d e n c y & g t ; < b r   / >                 & l t ; d e p e n d e n c y & g t ; < b r   / >                         & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r   / >                         & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - v a l i d a t i o n & l t ; / a r t i f a c tId>


org.springframework.boot
spring-boot-starter-log4j2


org.springframework.boot
spring-boot-starter-amqp



org.jboss.resteasy
resteasy-client
6.2.5.Final


org.jboss.resteasy
resteasy-jackson2-provider
6.2.5.Final


org.jboss.resteasy
resteasy-multipart-provider
6.2.5.Final


jakarta.ws.rs
jakarta.ws.rs-api



commons-lang
commons-lang
2.6


commons-validator
commons-validator
1.7


com.google.code.gson
gson


com.auth0
java-jwt
4.4.0


org.liquibase
liquibase-core


org.postgresql
postgresql


com.github.ulisesbocchio
jasypt-spring-boot-starter
3.0.5


org.mockito
mockito-core
5.4.0
test



io.springfox
springfox-spring-webmvc
3.0.0
runtime


io.springfox
springfox-core
3.0.0


io.springfox
springfox-boot-starter
3.0.0


org.springdoc
springdoc-openapi-starter-webmvc-ui
2.1.0


io.swagger.core.v3
swagger-core
2.2.12


org.projectlombok
lombok
provided



io.getunleash
unleash-client-java
11.1.1
compile






org.springframework.boot
spring-boot-maven-plugin


org.jacoco
jacoco-maven-plugin
0.8.13



prepare-agent



report
verify

report



XML






com.diffplug.spotless
spotless-maven-plugin
${spotless.version}



apply

validate



origin/develop






org.apache.maven.plugins
maven-checkstyle-plugin
${checkstyle-maven-plugin.version}

checkstyle.xml
true



com.puppycrawl.tools
checkstyle
${checkstyle.version}





check

validate






Вот файл application-dev.yaml (поскольку для активных профилей установлено значение --spring.profiles.active=dev в конфигурации запуска IntelliJ):

Код: Выделить всё

spring:
application:
name: ACCOUNT
jpa:
hibernate:
ddl-auto: update
show-sql: false
properties:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.PostgreSQLDialect
liquibase:
enabled: true
change-log: classpath:db/changelog/master.xml
datasource:
url:  jdbc:postgresql://localhost:5432/paymed_account
username: postgres
password: postgres
driverClassName: org.postgresql.Driver
rabbitmq:
host: localhost
port: 5672
username: guest
password: guest
listener:
simple:
retry:
enabled: true
initial-interval: 3s
max-attempts: 5
max-interval: 3s
multiplier: 1

security:
salt: test
secretKey: annotationKey

jwt:
uuidClaimName: sub
usernameClaimName: preferred_username
client:
user: peu_dev

cookie:
domain: localhost
userContext:
secretKey: secret

server:
port: 8088
tomcat:
accesslog:
enabled: true
directory: "/data/paymed/logs"
prefix: access_log
buffered: false
suffix: .log
file-date-format: .yyyy-MM-dd
pattern: common

rhsso:
ws:
endpoint: https://login-int.paymed.pro
timeout: 30000
userUri: /auth/realms
adminUri: /auth/admin/realms
realms: /PEU_DEV
getTokenUri: /protocol/openid-connect/token
usersUri: /users
resetPasswordUri: /reset-password
userClientId: peu_dev
adminClientId: peu_rest_api_dev
adminClientSecret: 834bd84f-c262-4bfc-a9e6-6bc2a2593c8e
#adminClientSecret: ad2b03cd-4604-4a33-a50b-fcea70283174 (int)
pscIdendityProviderAlias: psc
serviceAccountClientId: peu_account_service_dev
serviceAccountClientSecret: 7270ff99-c74f-4f2f-b8f8-f45f1b71b358
#serviceAccountClientSecret: 7270ff99-c74f-4f2f-b8f8-f45f1b71b358
#serviceAccountClientSecret: 834bd84f-c262-4bfc-a9e6-6bc2a2593c8e (int)

sessions:
ws:
endpoint: http://localhost:8086
timeout: 30000

user:
ws:
endpoint: http://localhost:8081
timeout: 30000

document:
ws:
endpoint: http://localhost:8090
timeout: 30000

notifications:
ws:
endpoint: http://localhost:8089
timeout: 30000

salesforce:
ws:
endpoint: http://localhost:8087
timeout: 30000

monetique:
brandId: brandId

psc:
ws:
endpoint: https://auth.bas.psc.esante.gouv.fr/auth/realms/esante-wallet
timeout : 30000
loginRedirectUri: http://slapp022i0.aveo.local:8082/auth/realms/PEU_INTEG/broker/psc/endpoint
clientId: paymed-paymed-bas
clientSecret: AAajEwbnsmIBwtKz3A9Syw6sRGj11GDf

batch:
deleteInactiveUser:
accountAge: 21 #days
userDeletionNotification:
delay: 3 #days
Во время выполнения я получаю следующую ошибку:

Код: Выделить всё

2026-01-29 17:20:32,522 INFO 14052 --- [           main] c.p.a.AccountApplication                 : Starting AccountApplication using Java 17.0.18 with PID 14052 (D:\Projets\Paymed\service-account\target\classes started by aandrianiaina in D:\Projets\Paymed)
2026-01-29 17:20:32,541 INFO 14052 --- [           main] c.p.a.AccountApplication                 : The following 1 profile is active: "--spring.profiles.active=dev"
2026-01-29 17:20:35,396 INFO 14052 --- [           main] o.s.b.w.e.t.TomcatWebServer              : Tomcat initialized with port 8088 (http)
2026-01-29 17:20:35,533 INFO 14052 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2912 ms
2026-01-29 17:20:35,982 WARN 14052 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Failed to initialize dependency 'liquibase' of LoadTimeWeaverAware bean 'entityManagerFactory': Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Failed to instantiate [liquibase.integration.spring.SpringLiquibase]: Factory method 'liquibase' threw exception with message: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Unsatisfied dependency expressed through method 'dataSource' parameter 0: Error creating bean with name 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties':  Could not bind properties to 'DataSourceProperties' : prefix=spring.datasource, ignoreInvalidFields=false, ignoreUnknownFields=true
2026-01-29 17:20:36,015 INFO 14052 --- [           main] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2026-01-29 17:20:36,032 ERROR 14052 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to bind properties under 'spring.datasource.password' to java.lang.String:

Reason: java.lang.IllegalStateException: either 'jasypt.encryptor.password', one of ['jasypt.encryptor.private-key-string', 'jasypt.encryptor.private-key-location'] for asymmetric encryption, or one of ['jasypt.encryptor.gcm-secret-key-string', 'jasypt.encryptor.gcm-secret-key-location', 'jasypt.encryptor.gcm-secret-key-password'] for AES/GCM encryption must be provided for Password-based or Asymmetric encryption
Что не так?


Подробнее здесь: https://stackoverflow.com/questions/798 ... encryption
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»