Secure credentialsΒΆ

Nearly all web-services need valid credentials for authentication.

Instead of storing this security related information inside .farm -files, you should store them on local Environment variables , which are normally not available for other users.

Use the helper function MF_ENV to get this data into your configuration during runtime of Metric-Farmer.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
  "metrics": {
    "open_issues": {
      "description": "Measure open jira issues",
      "source": {
        "type": "jira",
        "jql": "status = Open"
      }
    },
  },

  "sources": {
    "jira": {
      "class": "mf.rest",
      "url": "https://my_jira.com",
      "user": ":MF_ENV:JIRA_USER",
      "password": ":MF_ENV:JIRA_PASSWORD",
      "payload": {
        "fields": [
          "status"
        ],
        "maxResults": 1,
        "jql": ":MF_REPLACE:jql"
      },
    }
  }
}