diff --git a/v1/Application.cfc b/v1/Application.cfc index 673841f..0515e35 100644 --- a/v1/Application.cfc +++ b/v1/Application.cfc @@ -51,7 +51,7 @@ //variables.framework.docs={}; 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["Access-Control-Expose-Headers"] = "Location"; @@ -62,7 +62,7 @@ request.UNDEFINED_USR_ID=-1; request.ANONYMOUS_USR_ID=2; request.GUEST_USR_ID=3; - request.USER_AGENT="#variables.framework.docs.APIName# #variables.framework.docs.APIVersion# stand:#this.getStand()#"; + request.USER_AGENT="#variables.framework.docs.APIName# #variables.framework.docs.APIVersion# stand:#this.getStand()#"; //////////////////////////////////////////////////////// request.ORCHESTRATOR_AUTH = createObject("java", "java.lang.System").getEnv("ORCHESTRATOR_AUTH"); @@ -71,6 +71,8 @@ } //*** почему-то scope this ведет себя совершенно не так, как request и variables // в нем, когда переменная получает значение Empty:null, можно выполнить writedump, а в других получаем ошибку, что такой переменной нет + + request.auth_header=""; request.locateIamService=locateIamService; //for possible debug //request.IAM_SERVICE_URL=this.iamServiceUrl; @@ -230,9 +232,9 @@ if (lCase(arguments.cfc) EQ 'err') return true; if (lCase(arguments.cfc) EQ 'throw') return true; - var auth=""; + if (structKeyExists(headers,"Authorization")) { - auth=headers.Authorization; + request.auth_header=headers.Authorization; } else { return representationOf("Authorization header expected").withStatus(401); } @@ -240,7 +242,7 @@ try { 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 = "Authorization", value = "#auth#"); //passthrough + httpService.addParam(type = "HEADER", name = "Authorization", value = "#request.auth_header#"); //passthrough //writedump(this.iamServiceUrl);abort; var resp = httpService.send(); //if (resp.status_code NEQ 200) throw("IDP response not OK"); diff --git a/v1/resources/instance_operation_run.cfc b/v1/resources/instance_operation_run.cfc index a177e7c..e26f6dd 100644 --- a/v1/resources/instance_operation_run.cfc +++ b/v1/resources/instance_operation_run.cfc @@ -218,7 +218,9 @@ + +