Rally 使用API密钥嵌入应用程序

Rally 使用API密钥嵌入应用程序,rally,Rally,我正试图按照内部说明使用alm wsapi只读API密钥。我使用rally app builder创建了一个简单的缺陷查询应用程序。当我从Rally注销时,我尝试在Chrome浏览器中使用以下语法查看缺陷网格,在浏览器中插入我的apiKey代替“key here”: file:///C:/ProjectWork/RallyGitHub/rally-app defect metrics/deploy/app external.html?apiKey=“key here” 加载此页面时,要求我提供R

我正试图按照内部说明使用alm wsapi只读API密钥。我使用rally app builder创建了一个简单的缺陷查询应用程序。当我从Rally注销时,我尝试在Chrome浏览器中使用以下语法查看缺陷网格,在浏览器中插入我的apiKey代替“key here”:

file:///C:/ProjectWork/RallyGitHub/rally-app defect metrics/deploy/app external.html?apiKey=“key here”

加载此页面时,要求我提供Rally登录凭据,而不是默认为API密钥中嵌入的Rally用户

我做错了什么,有什么帮助吗

此文件中的应用程序代码如下所示:

<!DOCTYPE html>
<html>
<head>
    <title>DefectMetrics</title>

    <script type="text/javascript" src="https://rally1.rallydev.com/apps/2.0rc3/sdk.js"></script>

    <script type="text/javascript">
        Rally.onReady(function () {
            Ext.define("CustomApp",{extend:"Rally.app.App",componentCls:"app",launch:function(){Rally.data.ModelFactory.getModel({type:"Defect",success:function(model){this.grid=this.add({xtype:"rallygrid",model:model,columnCfgs:["FormattedID","Name","State","Owner"],storeConfig:{filters:[{property:"State",operator:"=",value:"Closed"}]}})},scope:this})}});

        Rally.launchApp('CustomApp', {
            name:"DefectMetrics",
            parentRepos:""
        });
    });
</script>
</head>
<body>
</body>
</html>

缺陷度量
Rally.onReady(函数(){
Ext.define(“CustomApp”),{extend:“Rally.app.app”,componentCls:“app”,launch:function(){Rally.data.ModelFactory.getModel({type:“Defect”,success:function(model){this.grid=this.add({xtype:“rallygrid”,model:model,columnCfgs:[“FormattedID”,“Name”,“State”,“Owner”,“Owner”]),storeConfig:{filters:[{property:“State:”,operator:“=”,value:“Closed”}}}}}}}}}}}};
Rally.launchApp('CustomApp'{
名称:“缺陷度量”,
家长报告:“
});
});

通过文件://URL访问时,AppSDK2.0rc3应用程序使用JSONP:

这不允许在请求头中设置API密钥,因此会通过基本身份验证提示您输入凭据

如中所述,当运行rally app builder run时,您正在运行node.js服务器,允许AppSDK2使用CORS,并且可以根据需要在请求标头中设置apiKey以进行rally

请注意,
rally app builder run
最初将显示:

http://localhost:1337/App-debug.html
在默认浏览器中,将提示您输入凭据。但是,如果手动将api密钥附加到URL:

http://localhost:1337/App-debug.html?apiKey=_m9XjyrgVQ6
和刷新,应用程序将呈现,而无需输入凭据