Summary
With this PR we are extending Gomatic support till GOCD version 19.6.0 along with improvements on how Gomatic authenticates with GOCD.
Problem statement
Use 'cd.go.authorization.github' plugin so that basic authentication can be disabled completely on the GOCD server. This enhances security and removes the management overhead of password file-based authentication.
Issues identified
When we installed the Github authentication plugin on GOCD 19.6.0, we found that gomatic 0.6.7 still lacks the support for access token-based authentication to GOCD API.
Solution
Hence, we enhanced the 'HostRestClient' class to entertain token-based authentication via 'Authentication: Bearer' header in GOCD API calls.
Since we wanted to add support till the latest version of GOCD available, i.e., 19.6.0, it required us to add support for an updated attribute called 'artifactOrigin' (earlier called as 'origin') for 'FetchArtifactTask' class. We have also updated the test for that.
We also updated the 'config_url' URL as per the GOCD API documentation, as the old 'config_url' did not seem to entertain API calls with header-based authentication.
Comments
We have not added any new tests for HostRestClient class but all existing unit and integration tests PASS and the supported GOCD versions have been updated in the README.
Summary With this PR we are extending Gomatic support till GOCD version 19.6.0 along with improvements on how Gomatic authenticates with GOCD.
Problem statement Use 'cd.go.authorization.github' plugin so that basic authentication can be disabled completely on the GOCD server. This enhances security and removes the management overhead of password file-based authentication.
Issues identified When we installed the Github authentication plugin on GOCD 19.6.0, we found that gomatic 0.6.7 still lacks the support for access token-based authentication to GOCD API.
Solution Hence, we enhanced the 'HostRestClient' class to entertain token-based authentication via 'Authentication: Bearer' header in GOCD API calls.
Since we wanted to add support till the latest version of GOCD available, i.e., 19.6.0, it required us to add support for an updated attribute called 'artifactOrigin' (earlier called as 'origin') for 'FetchArtifactTask' class. We have also updated the test for that.
We also updated the 'config_url' URL as per the GOCD API documentation, as the old 'config_url' did not seem to entertain API calls with header-based authentication.
Comments We have not added any new tests for HostRestClient class but all existing unit and integration tests PASS and the supported GOCD versions have been updated in the README.
Authors Varun Saraogi Mansab Uppal