Add property 'webhook_token' to the Pipeline schema.

This commit is contained in:
Kris De Volder
2017-05-15 17:11:04 -07:00
parent e7870ef2c1
commit 7c5b4b6d9b
3 changed files with 11 additions and 0 deletions

View File

@@ -219,6 +219,7 @@ public class PipelineYmlSchema implements YamlSchema {
addProp(t_resource, "type", t_resource_type_name).isRequired(true);
addProp(t_resource, "source", resourceSource);
addProp(t_resource, "check_every", t_duration);
addProp(t_resource, "webhook_token", t_ne_string);
AbstractType t_image_resource = f.ybean("ImageResource");
for (YTypedProperty p : t_resource.getProperties()) {

View File

@@ -0,0 +1,7 @@
*Optional.* If specified, web hooks can be sent to trigger an immediate *check* of the resource, specifying this value as a primitive form of authentication via query params.
After configuring this value, you would then configure your hook sender with the following painfully long path appended to your external URL:
/api/v1/teams/TEAM_NAME/pipelines/PIPELINE_NAME/resources/RESOURCE_NAME/check/webhook?webhook_token=WEBHOOK_TOKEN
Note that the request payload sent to this API endpoint is entirely ignored. You should configure the resource as if you're not using web hooks, as the resource config is still the "source of truth."

View File

@@ -1392,6 +1392,7 @@ public class ConcourseEditorTest {
"- name: sts4\n" +
" type: git\n" +
" check_every: 5m\n" +
" webhook_token: bladayadayaaa\n" +
" source:\n" +
" repository: https://github.com/spring-projects/sts4\n"
);
@@ -1399,6 +1400,7 @@ public class ConcourseEditorTest {
editor.assertHoverContains("name", "The name of the resource");
editor.assertHoverContains("type", "The type of the resource. Each worker advertises");
editor.assertHoverContains("source", 2, "The location of the resource");
editor.assertHoverContains("webhook_token", "web hooks can be sent to trigger an immediate *check* of the resource");
editor.assertHoverContains("check_every", "The interval on which to check for new versions");
}
@@ -3107,6 +3109,7 @@ public class ConcourseEditorTest {
editor.assertCompletionLabels(
//For the 'exact' context:
"check_every",
"webhook_token",
//"name", exists
//"source", exists
//"type", exists