From f8215863dd3840e231fc1283153562a02f99456b Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Mon, 15 Feb 2021 04:22:12 -0700 Subject: [PATCH] Girocco/Project.pm: make json secret available via web gui Now that protected fields are available, go ahead and add the jsonsecret field to the list that's viewable/editable whenever 'notifyjson' has been enabled. It will only be viewable/editable once the admin password has been entered. Signed-off-by: Kyle J. McKay --- Girocco/Project.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Girocco/Project.pm b/Girocco/Project.pm index 20b8ac4..1556183 100644 --- a/Girocco/Project.pm +++ b/Girocco/Project.pm @@ -60,7 +60,8 @@ our $metadata_fields = { 'POST JSON at', 'notifyjson', 'text'], - ['JSON Content-Type', 'jsontype', 'select', 'JSON POST Content-Type', \&_json_choices]], + ['JSON Content-Type', 'jsontype', 'select', 'JSON POST Content-Type', \&_json_choices], + ['JSON Secret', 'jsonsecret', 'text', 'secret used to compute JSON POST signatures']], notifycia => ['Commit notify – CIA project name', 'notifycia', 'text', 'CIA is defunct – this value is ignored'], }; @@ -832,6 +833,7 @@ sub cgi_fill { $self->{jsontype} = 'application/x-www-form-urlencoded'; } } + $self->{jsonsecret} = $gcgi->wparam('jsonsecret'); } if ($field_enabled->('notifycia')) { @@ -867,6 +869,7 @@ sub form_defaults { notifytag => html_esc($self->{notifytag}), notifyjson => html_esc($self->{notifyjson}), jsontype => html_esc($self->{jsontype}), + jsonsecret => html_esc($self->{jsonsecret}), notifycia => html_esc($self->{notifycia}), __project__ => $self -- 2.11.4.GIT