加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

scala – 如何将加密密码设置为凭证以使用sbt发布Nexus OSS?

发布时间:2020-12-16 08:45:31 所属栏目:安全 来源:网络整理
导读:我正在尝试使用global.sbt中的未加密密码访问Nexus OSS存储库,例如 this,我的global.sbt是: credentials += Credentials("Sonatype Nexus","repo.example.com","username","unencrypted_password") 我想考虑设置加密密码. 解决方法 您可以在?/ .ivy2 / .cre
我正在尝试使用global.sbt中的未加密密码访问Nexus OSS存储库,例如 this,我的global.sbt是:

credentials += Credentials("Sonatype Nexus","repo.example.com","username","unencrypted_password")

我想考虑设置加密密码.

解决方法

您可以在?/ .ivy2 / .credentials下创建一个名为.credentials的文件.这是一个相当标准的位置,但显然您可以将文件放在磁盘上的任何位置.

该文件如下所示:

realm = Sonatype Nexus Repository Manager
host = oss.sonatype.org
user = publishing@yourco.com
password = $encrypted

要加密密码,您可以使用已知的AES密码,这意味着您基本上可以执行以下操作:

val credential: DirectCredentials = Credentials(Path.userHome / ".ivy2" / ".credentials")
val decrypted = credential.copy(passwd = decryptAes(credential.passwd))

现在你需要的是一个广泛或类似的共享密码公司,以及一种解密AES的方法,为此看起来像here.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读