如何在Sinatra应用中使用ActivereCord加密?
我有一个Sinatra应用程序,该应用程序通过使用activerecord
和sinatra-activerecord
gems来运行ActiverEcord。我想使用ActiverEcord加密,但是“ nofollow noreferrer”> activerecord加密指南并指定如何将所需的加密密钥添加到Rails凭据文件中。由于这不是Rails应用程序,因此如何为ActiverEcord指定替代密钥库?
具体来说,我看到的错误是:
ActiveRecord::Encryption::Errors::Configuration:
key_derivation_salt is not configured. Please configure it via credential active_record_encryption.key_derivation_salt or by setting config.active_record.encryption.key_derivation_salt
因此,我认为它运行正确,我只是不知道如何在没有Rails凭据文件的情况下进行配置。
I have a Sinatra app which runs ActiveRecord by using the activerecord
and sinatra-activerecord
gems. I would like to use ActiveRecord encryption, but the ActiveRecord Encryption guide assumes that I have a Rails app and specifies how to add the required encryption keys to the Rails credentials file. As this is not a Rails app, how do I specify an alternate keystore for ActiveRecord to use?
Specifically the error I am seeing is:
ActiveRecord::Encryption::Errors::Configuration:
key_derivation_salt is not configured. Please configure it via credential active_record_encryption.key_derivation_salt or by setting config.active_record.encryption.key_derivation_salt
So I think that it is running correctly, I just don't know how to configure it without the Rails credentials file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Try this:
Looks undocumented, but found在源代码中。
Try this:
Looks undocumented, but found in the source code.