我们将这个postgresql.conf配置文件放在Spring Boot应用程序中的确切位置?

编程入门 行业动态 更新时间:2024-10-27 09:45:47
本文介绍了我们将这个postgresql.conf配置文件放在Spring Boot应用程序中的确切位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试对prostrgres DB中的列进行加密.列名是"test".类型为"bytea".

I am trying to encrypt a column in my prostrgres DB. The column name is "test" of type "bytea".

我的实体代码在下面,

@ColumnTransformer(read = "pgp_sym_decrypt(" + " test, " + " current_setting('encrypt.key')" + ")", write = "pgp_sym_encrypt( " + " ?, " + " current_setting('encrypt.key')" + ") ") @Column(columnDefinition = "bytea") private String test;

postgresql.conf配置文件: crypto.key ='哇!非常安全.

postgresql.conf configuration file: encrypt.key = 'Wow! So much security.

将postgresql.conf配置文件放置在spring boot appln的src/main/resources中.但是没有选择encryption.key值.有没有一种方法可以使用application.properties传递密钥?

Placed the postgresql.conf configuration file in src/main/resources of spring boot appln. But the encryption.key value is not being picked up. And is there a way to pass the key using application.properties?

推荐答案

postgresql.conf是服务器的nofollow noreferrer>配置文件.它存储在数据目录(也称为集群")中服务器.

postgresql.conf is the configuration file for the Postgres server. It's stored inside the data directory (aka "cluster") on the server.

您不能将其放在客户端(您的应用程序运行所在的位置)上.那里没有意义.

You can't put it on the client side (where your application runs). It has no meaning there.

要在其中更改值,您需要编辑文件(在服务器上)或使用 ALTER SYSTEM .

To change values in there, you need to edit the file (on the server) or use ALTER SYSTEM.

如果要更改当前会话的配置设置,请使用 SET 或 set_config()

If you want to change a configuration setting for the current session, use SET or set_config()

后两个可能是您要为加密/解密功能初始化自定义属性的对象.

The latter two are probably the ones you are looking for to initialize the custom property for your encryption/decryption functions.

更多推荐

我们将这个postgresql.conf配置文件放在Spring Boot应用程序中的确切位置?

本文发布于:2023-10-15 11:54:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1494264.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:放在   配置文件   确切   应用程序   位置

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!