Adding valid origin ip directive and data

stable
Alejandro Alonso 2014-12-02 14:21:15 +01:00 committed by David Barragán Merino
parent fb60cf0cdd
commit e3b223878d
3 changed files with 29 additions and 0 deletions

View File

@ -302,3 +302,24 @@ BitbucketWebhooksDirective = ($repo, $confirm, $loading) ->
return {link:link}
module.directive("tgBitbucketWebhooks", ["$tgRepo", "$tgConfirm", "$tgLoading", BitbucketWebhooksDirective])
#############################################################################
## Valid Origin IP's Directive
#############################################################################
ValidOriginIpsDirective = ->
link = ($scope, $el, $attrs, $ngModel) ->
$ngModel.$parsers.push (value) ->
value = $.trim(value)
if value == ""
return []
return value.split(",")
return {
link: link
restrict: "EA"
require: "ngModel"
}
module.directive("tgValidOriginIps", ValidOriginIpsDirective)

View File

@ -13,6 +13,10 @@ block content
include views/components/mainTitle
form
fieldset
label(for="valid-origin-ips") Valid origin ips (separated by ,) <br/>Bitbucket requests are not signed so the best way of verifying the origin is by IP. If the field is empty there will be no IP validation.
input(type="text", name="valid-origin-ips", tg-valid-origin-ips, ng-model="bitbucket.valid_origin_ips", placeholder="Valid origin ips", id="valid-origin-ips")
fieldset
label(for="secret-key") Secret key
input(type="text", name="secret-key", ng-model="bitbucket.secret", placeholder="Secret key", id="secret-key")

View File

@ -13,6 +13,10 @@ block content
include views/components/mainTitle
form
fieldset
label(for="valid-origin-ips") Valid origin ips (separated by ,) <br/>Gitlab requests are not signed so the best way of verifying the origin is by IP. If the field is empty there will be no IP validation.
input(type="text", name="valid-origin-ips", tg-valid-origin-ips, ng-model="gitlab.valid_origin_ips", placeholder="Valid origin ips", id="valid-origin-ips")
fieldset
label(for="secret-key") Secret key
input(type="text", name="secret-key", ng-model="gitlab.secret", placeholder="Secret key", id="secret-key")