使用Rally脚本时,使用API​​密钥替换凭据

时间:2015-05-22 13:08:46

标签: rally

因此,我使用以下Ruby脚本对用户权限进行批量更改:https://github.com/RallyTools/Rally-User-Management

我的问题是我需要将此代码放在其他人可能访问它的服务器上,我想更改my_vars.rb文件以API密钥的形式保存我的凭据而不是我的用户名和密码。

这可能吗?因为它看起来并不像删除用户名和密码行那么简单,并且用API键替换那些行

1 个答案:

答案 0 :(得分:0)

rally_api gem documentation显示了在Usage部分中与ApiKey建立连接的示例。用户管理实用程序基于此gem。

#Using api keys? -- currently rally1 only
Go to https://rally1.rallydev.com/login
You can generate an api key on this site and use it *instead* of username and password
config = {:base_url => "https://rally1.rallydev.com/slm"}
config[:api_key]   = "_your_api_key_from_https://rally1.rallydev.com/login"
config[:workspace]  = "Workspace Name"
config[:project]    = "Project Name"
config[:headers]    = headers #from RallyAPI::CustomHttpHeader.new()

提交历史记录显示rally_api开始支持版本1.0中的ApiKey身份验证