141 auth_header
This commit is contained in:
+6
-4
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
//variables.framework.docs={};
|
//variables.framework.docs={};
|
||||||
variables.framework.docs.APIName="svc-api";
|
variables.framework.docs.APIName="svc-api";
|
||||||
variables.framework.docs.APIVersion="0.140"; /*dependencies*/ /*$ git config --global --unset user.password*/
|
variables.framework.docs.APIVersion="0.141"; /*auth_header*/ /*$ git config --global --unset user.password*/
|
||||||
|
|
||||||
variables.framework.globalHeaders = structNew();
|
variables.framework.globalHeaders = structNew();
|
||||||
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
|
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
|
||||||
@@ -71,6 +71,8 @@
|
|||||||
}
|
}
|
||||||
//*** почему-то scope this ведет себя совершенно не так, как request и variables
|
//*** почему-то scope this ведет себя совершенно не так, как request и variables
|
||||||
// в нем, когда переменная получает значение Empty:null, можно выполнить writedump, а в других получаем ошибку, что такой переменной нет
|
// в нем, когда переменная получает значение Empty:null, можно выполнить writedump, а в других получаем ошибку, что такой переменной нет
|
||||||
|
|
||||||
|
request.auth_header="";
|
||||||
request.locateIamService=locateIamService; //for possible debug
|
request.locateIamService=locateIamService; //for possible debug
|
||||||
//request.IAM_SERVICE_URL=this.iamServiceUrl;
|
//request.IAM_SERVICE_URL=this.iamServiceUrl;
|
||||||
</cfscript>
|
</cfscript>
|
||||||
@@ -230,9 +232,9 @@
|
|||||||
if (lCase(arguments.cfc) EQ 'err') return true;
|
if (lCase(arguments.cfc) EQ 'err') return true;
|
||||||
if (lCase(arguments.cfc) EQ 'throw') return true;
|
if (lCase(arguments.cfc) EQ 'throw') return true;
|
||||||
|
|
||||||
var auth="";
|
|
||||||
if (structKeyExists(headers,"Authorization")) {
|
if (structKeyExists(headers,"Authorization")) {
|
||||||
auth=headers.Authorization;
|
request.auth_header=headers.Authorization;
|
||||||
} else {
|
} else {
|
||||||
return representationOf("Authorization header expected").withStatus(401);
|
return representationOf("Authorization header expected").withStatus(401);
|
||||||
}
|
}
|
||||||
@@ -240,7 +242,7 @@
|
|||||||
try {
|
try {
|
||||||
var httpService = new http(method = "GET", charset = "utf-8", url = #this.iamServiceUrl#, timeout="5");
|
var httpService = new http(method = "GET", charset = "utf-8", url = #this.iamServiceUrl#, timeout="5");
|
||||||
httpService.addParam(type = "HEADER", name = "Accept", value = "application/json");
|
httpService.addParam(type = "HEADER", name = "Accept", value = "application/json");
|
||||||
httpService.addParam(type = "HEADER", name = "Authorization", value = "#auth#"); //passthrough
|
httpService.addParam(type = "HEADER", name = "Authorization", value = "#request.auth_header#"); //passthrough
|
||||||
//writedump(this.iamServiceUrl);abort;
|
//writedump(this.iamServiceUrl);abort;
|
||||||
var resp = httpService.send();
|
var resp = httpService.send();
|
||||||
//if (resp.status_code NEQ 200) throw("IDP response not OK");
|
//if (resp.status_code NEQ 200) throw("IDP response not OK");
|
||||||
|
|||||||
@@ -218,7 +218,9 @@
|
|||||||
<cfhttpparam type="HEADER" name="Authorization" value="#request.ORCHESTRATOR_AUTH#"/>
|
<cfhttpparam type="HEADER" name="Authorization" value="#request.ORCHESTRATOR_AUTH#"/>
|
||||||
<cfhttpparam type="HEADER" name="Accept" value="application/json"/>
|
<cfhttpparam type="HEADER" name="Accept" value="application/json"/>
|
||||||
<cfhttpparam type="HEADER" name="User-Agent" value="#request.USER_AGENT#"/>
|
<cfhttpparam type="HEADER" name="User-Agent" value="#request.USER_AGENT#"/>
|
||||||
|
<!--- <cfhttpparam type="HEADER" name="X-Auth-Token" value="#request.auth_header#"/> --->
|
||||||
<cfhttpparam type="formfield" name="delay" value="0sec"/>
|
<cfhttpparam type="formfield" name="delay" value="0sec"/>
|
||||||
|
<cfhttpparam type="formfield" name="auth_header" value="request.auth_header"/>
|
||||||
<cfloop query="qInstanceOperationParam">
|
<cfloop query="qInstanceOperationParam">
|
||||||
<cfhttpparam type="formfield" name="#param#" value="#param_value#"/>
|
<cfhttpparam type="formfield" name="#param#" value="#param_value#"/>
|
||||||
</cfloop>
|
</cfloop>
|
||||||
|
|||||||
Reference in New Issue
Block a user