当前位置:网站首页>Nacos Jaspyt配置加密设置
Nacos Jaspyt配置加密设置
2022-08-09 15:08:00 【隔壁老瓦】
考虑到安全性,最好将配置文件中的敏感信息进行加密。例如说,MySQL 的用户名密码、第三方平台的Token令牌等等
Nacos + Jasypt 配置加密
- 1、增加pom引入
<!-- 实现对 Jasypt 实现自动化配置 -->
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>3.0.2</version>
</dependency>- 2、新增nacos配置

- 3、JasyptTest 测试类进行加密
package com.example.nacosConfig.controller; import org.jasypt.encryption.StringEncryptor; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.Spri
边栏推荐
猜你喜欢
随机推荐
1. Introducing GEE and Geemap
我的第一篇博客
布隆过滤器及LRU Cache的实现
浮动的特点
初始C语言 C生万物
Chapter 5: Visualizing Geospatial Data
3. Using Earth Engine Data
测试工作管理与规范
学编程的第十天
Detailed explanation of three pieces in C language
C语言初印象(1.2w字粗略讲讲C)
js事件流
学习编程的第四天
float属性的使用
设计一个登录小程序(while和getchar实现)
如何判断闰年
多线程相关:按序打印、交替打印FooBar、交替打印字符串
The web project accesses static resources inside the jar
学编程的第十一天
2022年深圳杯数学建模A题代码思路-- 破除“尖叫效应”与“回声室效应”,走出“信息茧房”









