Refactors irule module to conform to recent standards (#25709)

Also includes unit tests for the code
This commit is contained in:
Tim Rupp
2017-06-14 11:03:17 -07:00
committed by John R Barker
parent ba12ce64b0
commit b85785bf07
6 changed files with 767 additions and 234 deletions

View File

@@ -0,0 +1,8 @@
when LB_SELECTED {
# Capture IP address chosen by WIP load balancing
set wipHost [LB::server addr]
}
when LB_FAILED {
set wipHost [LB::server addr]
}

View File

@@ -0,0 +1,18 @@
when RULE_INIT {
set static::FormBaseURL "/sp-ofba-form"
set static::FormReturnURL "/sp-ofba-completed"
set static::HeadAuthReq "X-FORMS_BASED_AUTH_REQUIRED"
set static::HeadAuthRet "X-FORMS_BASED_AUTH_RETURN_URL"
set static::HeadAuthSize "X-FORMS_BASED_AUTH_DIALOG_SIZE"
set static::HeadAuthSizeVal "800x600"
set static::ckname "MRHSession_SP"
set static::Basic_Realm_Text "SharePoint Authentication"
}
when HTTP_REQUEST {
set apmsessionid [HTTP::cookie value MRHSession]
}
when HTTP_RESPONSE {
# Insert persistent cookie for html content type and private session
}

View File

@@ -0,0 +1,20 @@
[
{
"kind": "tm:gtm:rule:rulestate",
"name": "asdf",
"partition": "Common",
"fullPath": "/Common/asdf",
"generation": 92,
"selfLink": "https://localhost/mgmt/tm/gtm/rule/~Common~asdf?ver=12.1.2",
"apiAnonymous": "when DNS_REQUEST {\n if { [IP::addr [IP::remote_addr] equals 10.254.254.0/24] } {\n cname test.affilate.example.com\n\n } elseif { [IP::addr [IP::remote_addr] equals 10.0.0.0/8] } {\n cname test.internal.example.com\n\n }\n #everything else will be handled by the default pools in the main WIP\n}"
},
{
"kind": "tm:gtm:rule:rulestate",
"name": "foo",
"partition": "Common",
"fullPath": "/Common/foo",
"generation": 93,
"selfLink": "https://localhost/mgmt/tm/gtm/rule/~Common~foo?ver=12.1.2",
"apiAnonymous": "when LB_SELECTED {\n # Capture IP address chosen by WIP load balancing\n set wipHost [LB::server addr]\n}\n\nwhen LB_FAILED {\n set wipHost [LB::server addr]\n}"
}
]

File diff suppressed because one or more lines are too long