Adding valid origin ip directive and data
parent
fb60cf0cdd
commit
e3b223878d
|
@ -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)
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue