Scenario:
Say, you have an HTTP Client origin with the following parameters,
URL: https://url.com/v1/datapoints
Header parameters:
predix-zone-id - abcd-1234-efgh
Content-type - application/json
Authorization - Bearer QxODA1MjA4MGJmIiwiYXVkIjpbInByZWRpeC1hc3NldC56b25lcy4wZGQ5ZGZlMC00NTRjLTRiNjQtYTc3My0zZmE1YTUwZGU5MDQiLCJtb3JuZWRldmlsbGllcnNfYXBwIiwidWFhIiwidGltZXNlcmllcy56b25lcy5jMmFjMzQ3Zi03OTQzLTRkYTEtYjE3My0xMzlhNWFhZWY5MzAiLCJvcGVuaWQiXX0.tCsFxjxyfO23ZKnH0ljgZTn1YV492IceDFi51rXuAsBym52jKlXwXhh9J3gD0ltO-p5NeLvYEBlNGtN51XkCC7auNarzBLaiNo6_VVjA_Q-urzFKuBOAMbsuP6lQZLLSZZTeL5dfcynl_mKTht69BCgs8y1v4E6ZVs8-mZW_yHQjbIZRMmjt-mJH7T83_YNF8g
and the above Authorization gets refreshed every 24 hours.
Goal:
To be able to continue running the pipeline with the latest token without having to manually apply the latest token and restart the pipeline.
Solution:
Periodically have the token populated into a plain text file, say, authorization_token.txt (using curl or something similar). Ensure that this file is placed inside the SDC resources directory. Then, one can have a '${runtime:loadResource("authorization_token.txt", true)}' defined against the Authorization field above so that the latest token is made use of by the HTTP Client while retrieving data from the source.