1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004
|
# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright 2020 Raritan Inc. All rights reserved.
#
# This is an auto-generated file.
#
# Section generated by IdlC from "ServiceAuthorization.idl"
#
import raritan.rpc
from raritan.rpc import Interface, Structure, ValueObject, Enumeration, typecheck, DecodeException
# interface
class ServiceAuthorization(Interface):
idlType = "security.ServiceAuthorization:1.0.0"
ERR_PASSWORD_INVALID = 1
class _setPassword(Interface.Method):
name = 'setPassword'
@staticmethod
def encode(service, password):
typecheck.is_string(service, AssertionError)
typecheck.is_string(password, AssertionError)
args = {}
args['service'] = service
args['password'] = password
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
def __init__(self, target, agent):
super(ServiceAuthorization, self).__init__(target, agent)
self.setPassword = ServiceAuthorization._setPassword(self)
#
# Section generated by IdlC from "Security.idl"
#
import raritan.rpc
from raritan.rpc import Interface, Structure, ValueObject, Enumeration, typecheck, DecodeException
import raritan.rpc.event
import raritan.rpc.security
# enumeration
class IpfwPolicy(Enumeration):
idlType = "security.IpfwPolicy:1.0.0"
values = ["ACCEPT", "DROP", "REJECT"]
IpfwPolicy.ACCEPT = IpfwPolicy(0)
IpfwPolicy.DROP = IpfwPolicy(1)
IpfwPolicy.REJECT = IpfwPolicy(2)
# structure
class IpfwRule(Structure):
idlType = "security.IpfwRule:1.0.0"
elements = ["ipMask", "policy"]
def __init__(self, ipMask, policy):
typecheck.is_string(ipMask, AssertionError)
typecheck.is_enum(policy, raritan.rpc.security.IpfwPolicy, AssertionError)
self.ipMask = ipMask
self.policy = policy
@classmethod
def decode(cls, json, agent):
obj = cls(
ipMask = json['ipMask'],
policy = raritan.rpc.security.IpfwPolicy.decode(json['policy']),
)
return obj
def encode(self):
json = {}
json['ipMask'] = self.ipMask
json['policy'] = raritan.rpc.security.IpfwPolicy.encode(self.policy)
return json
# structure
class IpFw(Structure):
idlType = "security.IpFw:2.0.0"
elements = ["enabled", "defaultPolicyIn", "defaultPolicyOut", "ruleSetIn", "ruleSetOut"]
def __init__(self, enabled, defaultPolicyIn, defaultPolicyOut, ruleSetIn, ruleSetOut):
typecheck.is_bool(enabled, AssertionError)
typecheck.is_enum(defaultPolicyIn, raritan.rpc.security.IpfwPolicy, AssertionError)
typecheck.is_enum(defaultPolicyOut, raritan.rpc.security.IpfwPolicy, AssertionError)
for x0 in ruleSetIn:
typecheck.is_struct(x0, raritan.rpc.security.IpfwRule, AssertionError)
for x0 in ruleSetOut:
typecheck.is_struct(x0, raritan.rpc.security.IpfwRule, AssertionError)
self.enabled = enabled
self.defaultPolicyIn = defaultPolicyIn
self.defaultPolicyOut = defaultPolicyOut
self.ruleSetIn = ruleSetIn
self.ruleSetOut = ruleSetOut
@classmethod
def decode(cls, json, agent):
obj = cls(
enabled = json['enabled'],
defaultPolicyIn = raritan.rpc.security.IpfwPolicy.decode(json['defaultPolicyIn']),
defaultPolicyOut = raritan.rpc.security.IpfwPolicy.decode(json['defaultPolicyOut']),
ruleSetIn = [raritan.rpc.security.IpfwRule.decode(x0, agent) for x0 in json['ruleSetIn']],
ruleSetOut = [raritan.rpc.security.IpfwRule.decode(x0, agent) for x0 in json['ruleSetOut']],
)
return obj
def encode(self):
json = {}
json['enabled'] = self.enabled
json['defaultPolicyIn'] = raritan.rpc.security.IpfwPolicy.encode(self.defaultPolicyIn)
json['defaultPolicyOut'] = raritan.rpc.security.IpfwPolicy.encode(self.defaultPolicyOut)
json['ruleSetIn'] = [raritan.rpc.security.IpfwRule.encode(x0) for x0 in self.ruleSetIn]
json['ruleSetOut'] = [raritan.rpc.security.IpfwRule.encode(x0) for x0 in self.ruleSetOut]
return json
# enumeration
class RoleAccessPolicy(Enumeration):
idlType = "security.RoleAccessPolicy:1.0.0"
values = ["ALLOW", "DENY"]
RoleAccessPolicy.ALLOW = RoleAccessPolicy(0)
RoleAccessPolicy.DENY = RoleAccessPolicy(1)
# structure
class RoleAccessRule(Structure):
idlType = "security.RoleAccessRule:1.0.0"
elements = ["startIp", "endIp", "roleId", "policy"]
def __init__(self, startIp, endIp, roleId, policy):
typecheck.is_string(startIp, AssertionError)
typecheck.is_string(endIp, AssertionError)
typecheck.is_int(roleId, AssertionError)
typecheck.is_enum(policy, raritan.rpc.security.RoleAccessPolicy, AssertionError)
self.startIp = startIp
self.endIp = endIp
self.roleId = roleId
self.policy = policy
@classmethod
def decode(cls, json, agent):
obj = cls(
startIp = json['startIp'],
endIp = json['endIp'],
roleId = json['roleId'],
policy = raritan.rpc.security.RoleAccessPolicy.decode(json['policy']),
)
return obj
def encode(self):
json = {}
json['startIp'] = self.startIp
json['endIp'] = self.endIp
json['roleId'] = self.roleId
json['policy'] = raritan.rpc.security.RoleAccessPolicy.encode(self.policy)
return json
# structure
class RoleAccessControl(Structure):
idlType = "security.RoleAccessControl:1.0.0"
elements = ["enabled", "defaultPolicy", "rules"]
def __init__(self, enabled, defaultPolicy, rules):
typecheck.is_bool(enabled, AssertionError)
typecheck.is_enum(defaultPolicy, raritan.rpc.security.RoleAccessPolicy, AssertionError)
for x0 in rules:
typecheck.is_struct(x0, raritan.rpc.security.RoleAccessRule, AssertionError)
self.enabled = enabled
self.defaultPolicy = defaultPolicy
self.rules = rules
@classmethod
def decode(cls, json, agent):
obj = cls(
enabled = json['enabled'],
defaultPolicy = raritan.rpc.security.RoleAccessPolicy.decode(json['defaultPolicy']),
rules = [raritan.rpc.security.RoleAccessRule.decode(x0, agent) for x0 in json['rules']],
)
return obj
def encode(self):
json = {}
json['enabled'] = self.enabled
json['defaultPolicy'] = raritan.rpc.security.RoleAccessPolicy.encode(self.defaultPolicy)
json['rules'] = [raritan.rpc.security.RoleAccessRule.encode(x0) for x0 in self.rules]
return json
# structure
class PasswordSettings(Structure):
idlType = "security.PasswordSettings:1.0.0"
elements = ["enableAging", "agingInterval", "enableStrongReq", "minPwLength", "maxPwLength", "enforceLower", "enforceUpper", "enforceNumeric", "enforceSpecial", "pwHistoryDepth"]
def __init__(self, enableAging, agingInterval, enableStrongReq, minPwLength, maxPwLength, enforceLower, enforceUpper, enforceNumeric, enforceSpecial, pwHistoryDepth):
typecheck.is_bool(enableAging, AssertionError)
typecheck.is_int(agingInterval, AssertionError)
typecheck.is_bool(enableStrongReq, AssertionError)
typecheck.is_int(minPwLength, AssertionError)
typecheck.is_int(maxPwLength, AssertionError)
typecheck.is_bool(enforceLower, AssertionError)
typecheck.is_bool(enforceUpper, AssertionError)
typecheck.is_bool(enforceNumeric, AssertionError)
typecheck.is_bool(enforceSpecial, AssertionError)
typecheck.is_int(pwHistoryDepth, AssertionError)
self.enableAging = enableAging
self.agingInterval = agingInterval
self.enableStrongReq = enableStrongReq
self.minPwLength = minPwLength
self.maxPwLength = maxPwLength
self.enforceLower = enforceLower
self.enforceUpper = enforceUpper
self.enforceNumeric = enforceNumeric
self.enforceSpecial = enforceSpecial
self.pwHistoryDepth = pwHistoryDepth
@classmethod
def decode(cls, json, agent):
obj = cls(
enableAging = json['enableAging'],
agingInterval = json['agingInterval'],
enableStrongReq = json['enableStrongReq'],
minPwLength = json['minPwLength'],
maxPwLength = json['maxPwLength'],
enforceLower = json['enforceLower'],
enforceUpper = json['enforceUpper'],
enforceNumeric = json['enforceNumeric'],
enforceSpecial = json['enforceSpecial'],
pwHistoryDepth = json['pwHistoryDepth'],
)
return obj
def encode(self):
json = {}
json['enableAging'] = self.enableAging
json['agingInterval'] = self.agingInterval
json['enableStrongReq'] = self.enableStrongReq
json['minPwLength'] = self.minPwLength
json['maxPwLength'] = self.maxPwLength
json['enforceLower'] = self.enforceLower
json['enforceUpper'] = self.enforceUpper
json['enforceNumeric'] = self.enforceNumeric
json['enforceSpecial'] = self.enforceSpecial
json['pwHistoryDepth'] = self.pwHistoryDepth
return json
# structure
class SSHSettings(Structure):
idlType = "security.SSHSettings:1.0.0"
elements = ["allowPasswordAuth", "allowPublicKeyAuth"]
def __init__(self, allowPasswordAuth, allowPublicKeyAuth):
typecheck.is_bool(allowPasswordAuth, AssertionError)
typecheck.is_bool(allowPublicKeyAuth, AssertionError)
self.allowPasswordAuth = allowPasswordAuth
self.allowPublicKeyAuth = allowPublicKeyAuth
@classmethod
def decode(cls, json, agent):
obj = cls(
allowPasswordAuth = json['allowPasswordAuth'],
allowPublicKeyAuth = json['allowPublicKeyAuth'],
)
return obj
def encode(self):
json = {}
json['allowPasswordAuth'] = self.allowPasswordAuth
json['allowPublicKeyAuth'] = self.allowPublicKeyAuth
return json
# enumeration
class SSHHostKeyType(Enumeration):
idlType = "security.SSHHostKeyType:1.0.0"
values = ["SSH_HOST_KEY_TYPE_RSA", "SSH_HOST_KEY_TYPE_ECDSA"]
SSHHostKeyType.SSH_HOST_KEY_TYPE_RSA = SSHHostKeyType(0)
SSHHostKeyType.SSH_HOST_KEY_TYPE_ECDSA = SSHHostKeyType(1)
# enumeration
class SSHKeyFingerprintType(Enumeration):
idlType = "security.SSHKeyFingerprintType:1.0.0"
values = ["SSH_KEY_FPRINT_TYPE_MD5_HEX", "SSH_KEY_FPRINT_TYPE_SHA256_BASE64", "SSH_KEY_FPRINT_TYPE_UNKNOWN"]
SSHKeyFingerprintType.SSH_KEY_FPRINT_TYPE_MD5_HEX = SSHKeyFingerprintType(0)
SSHKeyFingerprintType.SSH_KEY_FPRINT_TYPE_SHA256_BASE64 = SSHKeyFingerprintType(1)
SSHKeyFingerprintType.SSH_KEY_FPRINT_TYPE_UNKNOWN = SSHKeyFingerprintType(2)
# structure
class SSHKeyFingerprint(Structure):
idlType = "security.SSHKeyFingerprint:1.0.0"
elements = ["fingerprint", "type"]
def __init__(self, fingerprint, type):
typecheck.is_string(fingerprint, AssertionError)
typecheck.is_enum(type, raritan.rpc.security.SSHKeyFingerprintType, AssertionError)
self.fingerprint = fingerprint
self.type = type
@classmethod
def decode(cls, json, agent):
obj = cls(
fingerprint = json['fingerprint'],
type = raritan.rpc.security.SSHKeyFingerprintType.decode(json['type']),
)
return obj
def encode(self):
json = {}
json['fingerprint'] = self.fingerprint
json['type'] = raritan.rpc.security.SSHKeyFingerprintType.encode(self.type)
return json
# structure
class SSHHostKey(Structure):
idlType = "security.SSHHostKey:1.0.0"
elements = ["key", "type", "fingerprints"]
def __init__(self, key, type, fingerprints):
typecheck.is_string(key, AssertionError)
typecheck.is_enum(type, raritan.rpc.security.SSHHostKeyType, AssertionError)
for x0 in fingerprints:
typecheck.is_struct(x0, raritan.rpc.security.SSHKeyFingerprint, AssertionError)
self.key = key
self.type = type
self.fingerprints = fingerprints
@classmethod
def decode(cls, json, agent):
obj = cls(
key = json['key'],
type = raritan.rpc.security.SSHHostKeyType.decode(json['type']),
fingerprints = [raritan.rpc.security.SSHKeyFingerprint.decode(x0, agent) for x0 in json['fingerprints']],
)
return obj
def encode(self):
json = {}
json['key'] = self.key
json['type'] = raritan.rpc.security.SSHHostKeyType.encode(self.type)
json['fingerprints'] = [raritan.rpc.security.SSHKeyFingerprint.encode(x0) for x0 in self.fingerprints]
return json
# structure
class RestrictedServiceAgreement(Structure):
idlType = "security.RestrictedServiceAgreement:1.0.0"
elements = ["enabled", "banner"]
def __init__(self, enabled, banner):
typecheck.is_bool(enabled, AssertionError)
typecheck.is_string(banner, AssertionError)
self.enabled = enabled
self.banner = banner
@classmethod
def decode(cls, json, agent):
obj = cls(
enabled = json['enabled'],
banner = json['banner'],
)
return obj
def encode(self):
json = {}
json['enabled'] = self.enabled
json['banner'] = self.banner
return json
# value object
class PasswordSettingsChanged(raritan.rpc.event.UserEvent):
idlType = "security.PasswordSettingsChanged:1.0.0"
def __init__(self, oldSettings, newSettings, actUserName, actIpAddr, source):
super(raritan.rpc.security.PasswordSettingsChanged, self).__init__(actUserName, actIpAddr, source)
typecheck.is_struct(oldSettings, raritan.rpc.security.PasswordSettings, AssertionError)
typecheck.is_struct(newSettings, raritan.rpc.security.PasswordSettings, AssertionError)
self.oldSettings = oldSettings
self.newSettings = newSettings
def encode(self):
json = super(raritan.rpc.security.PasswordSettingsChanged, self).encode()
json['oldSettings'] = raritan.rpc.security.PasswordSettings.encode(self.oldSettings)
json['newSettings'] = raritan.rpc.security.PasswordSettings.encode(self.newSettings)
return json
@classmethod
def decode(cls, json, agent):
obj = cls(
oldSettings = raritan.rpc.security.PasswordSettings.decode(json['oldSettings'], agent),
newSettings = raritan.rpc.security.PasswordSettings.decode(json['newSettings'], agent),
# for event.UserEvent
actUserName = json['actUserName'],
actIpAddr = json['actIpAddr'],
# for idl.Event
source = Interface.decode(json['source'], agent),
)
return obj
def listElements(self):
elements = ["oldSettings", "newSettings"]
elements = elements + super(raritan.rpc.security.PasswordSettingsChanged, self).listElements()
return elements
# value object
class FrontPanelPrivilegesChanged(raritan.rpc.event.UserEvent):
idlType = "security.FrontPanelPrivilegesChanged:1.0.0"
def __init__(self, oldPrivileges, newPrivileges, actUserName, actIpAddr, source):
super(raritan.rpc.security.FrontPanelPrivilegesChanged, self).__init__(actUserName, actIpAddr, source)
for x0 in oldPrivileges:
typecheck.is_string(x0, AssertionError)
for x0 in newPrivileges:
typecheck.is_string(x0, AssertionError)
self.oldPrivileges = oldPrivileges
self.newPrivileges = newPrivileges
def encode(self):
json = super(raritan.rpc.security.FrontPanelPrivilegesChanged, self).encode()
json['oldPrivileges'] = [x0 for x0 in self.oldPrivileges]
json['newPrivileges'] = [x0 for x0 in self.newPrivileges]
return json
@classmethod
def decode(cls, json, agent):
obj = cls(
oldPrivileges = [x0 for x0 in json['oldPrivileges']],
newPrivileges = [x0 for x0 in json['newPrivileges']],
# for event.UserEvent
actUserName = json['actUserName'],
actIpAddr = json['actIpAddr'],
# for idl.Event
source = Interface.decode(json['source'], agent),
)
return obj
def listElements(self):
elements = ["oldPrivileges", "newPrivileges"]
elements = elements + super(raritan.rpc.security.FrontPanelPrivilegesChanged, self).listElements()
return elements
# interface
class Security(Interface):
idlType = "security.Security:3.0.2"
ERR_INVALID_VALUE = 1
# structure
class Settings(Structure):
idlType = "security.Security_3_0_2.Settings:1.0.0"
elements = ["http2httpsRedir", "userBlockTimeout", "userMaxFailedLogins", "ipFw", "ipV6Fw", "roleAccessControl", "roleAccessControlV6", "pwSettings", "idleTimeout", "singleLogin", "sshSettings"]
def __init__(self, http2httpsRedir, userBlockTimeout, userMaxFailedLogins, ipFw, ipV6Fw, roleAccessControl, roleAccessControlV6, pwSettings, idleTimeout, singleLogin, sshSettings):
typecheck.is_bool(http2httpsRedir, AssertionError)
typecheck.is_int(userBlockTimeout, AssertionError)
typecheck.is_int(userMaxFailedLogins, AssertionError)
typecheck.is_struct(ipFw, raritan.rpc.security.IpFw, AssertionError)
typecheck.is_struct(ipV6Fw, raritan.rpc.security.IpFw, AssertionError)
typecheck.is_struct(roleAccessControl, raritan.rpc.security.RoleAccessControl, AssertionError)
typecheck.is_struct(roleAccessControlV6, raritan.rpc.security.RoleAccessControl, AssertionError)
typecheck.is_struct(pwSettings, raritan.rpc.security.PasswordSettings, AssertionError)
typecheck.is_int(idleTimeout, AssertionError)
typecheck.is_bool(singleLogin, AssertionError)
typecheck.is_struct(sshSettings, raritan.rpc.security.SSHSettings, AssertionError)
self.http2httpsRedir = http2httpsRedir
self.userBlockTimeout = userBlockTimeout
self.userMaxFailedLogins = userMaxFailedLogins
self.ipFw = ipFw
self.ipV6Fw = ipV6Fw
self.roleAccessControl = roleAccessControl
self.roleAccessControlV6 = roleAccessControlV6
self.pwSettings = pwSettings
self.idleTimeout = idleTimeout
self.singleLogin = singleLogin
self.sshSettings = sshSettings
@classmethod
def decode(cls, json, agent):
obj = cls(
http2httpsRedir = json['http2httpsRedir'],
userBlockTimeout = json['userBlockTimeout'],
userMaxFailedLogins = json['userMaxFailedLogins'],
ipFw = raritan.rpc.security.IpFw.decode(json['ipFw'], agent),
ipV6Fw = raritan.rpc.security.IpFw.decode(json['ipV6Fw'], agent),
roleAccessControl = raritan.rpc.security.RoleAccessControl.decode(json['roleAccessControl'], agent),
roleAccessControlV6 = raritan.rpc.security.RoleAccessControl.decode(json['roleAccessControlV6'], agent),
pwSettings = raritan.rpc.security.PasswordSettings.decode(json['pwSettings'], agent),
idleTimeout = json['idleTimeout'],
singleLogin = json['singleLogin'],
sshSettings = raritan.rpc.security.SSHSettings.decode(json['sshSettings'], agent),
)
return obj
def encode(self):
json = {}
json['http2httpsRedir'] = self.http2httpsRedir
json['userBlockTimeout'] = self.userBlockTimeout
json['userMaxFailedLogins'] = self.userMaxFailedLogins
json['ipFw'] = raritan.rpc.security.IpFw.encode(self.ipFw)
json['ipV6Fw'] = raritan.rpc.security.IpFw.encode(self.ipV6Fw)
json['roleAccessControl'] = raritan.rpc.security.RoleAccessControl.encode(self.roleAccessControl)
json['roleAccessControlV6'] = raritan.rpc.security.RoleAccessControl.encode(self.roleAccessControlV6)
json['pwSettings'] = raritan.rpc.security.PasswordSettings.encode(self.pwSettings)
json['idleTimeout'] = self.idleTimeout
json['singleLogin'] = self.singleLogin
json['sshSettings'] = raritan.rpc.security.SSHSettings.encode(self.sshSettings)
return json
class _getSettings(Interface.Method):
name = 'getSettings'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = raritan.rpc.security.Security.Settings.decode(rsp['_ret_'], agent)
typecheck.is_struct(_ret_, raritan.rpc.security.Security.Settings, DecodeException)
return _ret_
class _setSettings(Interface.Method):
name = 'setSettings'
@staticmethod
def encode(settings):
typecheck.is_struct(settings, raritan.rpc.security.Security.Settings, AssertionError)
args = {}
args['settings'] = raritan.rpc.security.Security.Settings.encode(settings)
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
class _getHttpRedirSettings(Interface.Method):
name = 'getHttpRedirSettings'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_bool(_ret_, DecodeException)
return _ret_
class _setHttpRedirSettings(Interface.Method):
name = 'setHttpRedirSettings'
@staticmethod
def encode(http2httpsRedir):
typecheck.is_bool(http2httpsRedir, AssertionError)
args = {}
args['http2httpsRedir'] = http2httpsRedir
return args
@staticmethod
def decode(rsp, agent):
return None
class _isHstsEnabled(Interface.Method):
name = 'isHstsEnabled'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_bool(_ret_, DecodeException)
return _ret_
class _setHstsEnabled(Interface.Method):
name = 'setHstsEnabled'
@staticmethod
def encode(enable):
typecheck.is_bool(enable, AssertionError)
args = {}
args['enable'] = enable
return args
@staticmethod
def decode(rsp, agent):
return None
class _getIpFwSettings(Interface.Method):
name = 'getIpFwSettings'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = raritan.rpc.security.IpFw.decode(rsp['_ret_'], agent)
typecheck.is_struct(_ret_, raritan.rpc.security.IpFw, DecodeException)
return _ret_
class _setIpFwSettings(Interface.Method):
name = 'setIpFwSettings'
@staticmethod
def encode(ipFw):
typecheck.is_struct(ipFw, raritan.rpc.security.IpFw, AssertionError)
args = {}
args['ipFw'] = raritan.rpc.security.IpFw.encode(ipFw)
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
class _getIpV6FwSettings(Interface.Method):
name = 'getIpV6FwSettings'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = raritan.rpc.security.IpFw.decode(rsp['_ret_'], agent)
typecheck.is_struct(_ret_, raritan.rpc.security.IpFw, DecodeException)
return _ret_
class _setIpV6FwSettings(Interface.Method):
name = 'setIpV6FwSettings'
@staticmethod
def encode(ipV6Fw):
typecheck.is_struct(ipV6Fw, raritan.rpc.security.IpFw, AssertionError)
args = {}
args['ipV6Fw'] = raritan.rpc.security.IpFw.encode(ipV6Fw)
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
class _getRoleAccessControlSettings(Interface.Method):
name = 'getRoleAccessControlSettings'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = raritan.rpc.security.RoleAccessControl.decode(rsp['_ret_'], agent)
typecheck.is_struct(_ret_, raritan.rpc.security.RoleAccessControl, DecodeException)
return _ret_
class _setRoleAccessControlSettings(Interface.Method):
name = 'setRoleAccessControlSettings'
@staticmethod
def encode(settings):
typecheck.is_struct(settings, raritan.rpc.security.RoleAccessControl, AssertionError)
args = {}
args['settings'] = raritan.rpc.security.RoleAccessControl.encode(settings)
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
class _getRoleAccessControlSettingsV6(Interface.Method):
name = 'getRoleAccessControlSettingsV6'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = raritan.rpc.security.RoleAccessControl.decode(rsp['_ret_'], agent)
typecheck.is_struct(_ret_, raritan.rpc.security.RoleAccessControl, DecodeException)
return _ret_
class _setRoleAccessControlSettingsV6(Interface.Method):
name = 'setRoleAccessControlSettingsV6'
@staticmethod
def encode(settings):
typecheck.is_struct(settings, raritan.rpc.security.RoleAccessControl, AssertionError)
args = {}
args['settings'] = raritan.rpc.security.RoleAccessControl.encode(settings)
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
class _getBlockSettings(Interface.Method):
name = 'getBlockSettings'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
blockTimeout = rsp['blockTimeout']
maxFailedLogins = rsp['maxFailedLogins']
typecheck.is_int(blockTimeout, DecodeException)
typecheck.is_int(maxFailedLogins, DecodeException)
return (blockTimeout, maxFailedLogins)
class _setBlockSettings(Interface.Method):
name = 'setBlockSettings'
@staticmethod
def encode(blockTimeout, maxFailedLogins):
typecheck.is_int(blockTimeout, AssertionError)
typecheck.is_int(maxFailedLogins, AssertionError)
args = {}
args['blockTimeout'] = blockTimeout
args['maxFailedLogins'] = maxFailedLogins
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
class _getPwSettings(Interface.Method):
name = 'getPwSettings'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = raritan.rpc.security.PasswordSettings.decode(rsp['_ret_'], agent)
typecheck.is_struct(_ret_, raritan.rpc.security.PasswordSettings, DecodeException)
return _ret_
class _setPwSettings(Interface.Method):
name = 'setPwSettings'
@staticmethod
def encode(pwSettings):
typecheck.is_struct(pwSettings, raritan.rpc.security.PasswordSettings, AssertionError)
args = {}
args['pwSettings'] = raritan.rpc.security.PasswordSettings.encode(pwSettings)
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
class _getIdleTimeoutSettings(Interface.Method):
name = 'getIdleTimeoutSettings'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
class _setIdleTimeoutSettings(Interface.Method):
name = 'setIdleTimeoutSettings'
@staticmethod
def encode(idleTimeout):
typecheck.is_int(idleTimeout, AssertionError)
args = {}
args['idleTimeout'] = idleTimeout
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
class _getSingleLoginLimitation(Interface.Method):
name = 'getSingleLoginLimitation'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_bool(_ret_, DecodeException)
return _ret_
class _setSingleLoginLimitation(Interface.Method):
name = 'setSingleLoginLimitation'
@staticmethod
def encode(singleLogin):
typecheck.is_bool(singleLogin, AssertionError)
args = {}
args['singleLogin'] = singleLogin
return args
@staticmethod
def decode(rsp, agent):
return None
class _getSSHSettings(Interface.Method):
name = 'getSSHSettings'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = raritan.rpc.security.SSHSettings.decode(rsp['_ret_'], agent)
typecheck.is_struct(_ret_, raritan.rpc.security.SSHSettings, DecodeException)
return _ret_
class _setSSHSettings(Interface.Method):
name = 'setSSHSettings'
@staticmethod
def encode(settings):
typecheck.is_struct(settings, raritan.rpc.security.SSHSettings, AssertionError)
args = {}
args['settings'] = raritan.rpc.security.SSHSettings.encode(settings)
return args
@staticmethod
def decode(rsp, agent):
return None
class _getSSHHostKeys(Interface.Method):
name = 'getSSHHostKeys'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = [raritan.rpc.security.SSHHostKey.decode(x0, agent) for x0 in rsp['_ret_']]
for x0 in _ret_:
typecheck.is_struct(x0, raritan.rpc.security.SSHHostKey, DecodeException)
return _ret_
class _getRestrictedServiceAgreement(Interface.Method):
name = 'getRestrictedServiceAgreement'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = raritan.rpc.security.RestrictedServiceAgreement.decode(rsp['_ret_'], agent)
typecheck.is_struct(_ret_, raritan.rpc.security.RestrictedServiceAgreement, DecodeException)
return _ret_
class _setRestrictedServiceAgreement(Interface.Method):
name = 'setRestrictedServiceAgreement'
@staticmethod
def encode(settings):
typecheck.is_struct(settings, raritan.rpc.security.RestrictedServiceAgreement, AssertionError)
args = {}
args['settings'] = raritan.rpc.security.RestrictedServiceAgreement.encode(settings)
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
class _getSupportedFrontPanelPrivileges(Interface.Method):
name = 'getSupportedFrontPanelPrivileges'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = [x0 for x0 in rsp['_ret_']]
for x0 in _ret_:
typecheck.is_string(x0, DecodeException)
return _ret_
class _getFrontPanelPrivileges(Interface.Method):
name = 'getFrontPanelPrivileges'
@staticmethod
def encode():
args = {}
return args
@staticmethod
def decode(rsp, agent):
_ret_ = [x0 for x0 in rsp['_ret_']]
for x0 in _ret_:
typecheck.is_string(x0, DecodeException)
return _ret_
class _setFrontPanelPrivileges(Interface.Method):
name = 'setFrontPanelPrivileges'
@staticmethod
def encode(privileges):
for x0 in privileges:
typecheck.is_string(x0, AssertionError)
args = {}
args['privileges'] = [x0 for x0 in privileges]
return args
@staticmethod
def decode(rsp, agent):
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
def __init__(self, target, agent):
super(Security, self).__init__(target, agent)
self.getSettings = Security._getSettings(self)
self.setSettings = Security._setSettings(self)
self.getHttpRedirSettings = Security._getHttpRedirSettings(self)
self.setHttpRedirSettings = Security._setHttpRedirSettings(self)
self.isHstsEnabled = Security._isHstsEnabled(self)
self.setHstsEnabled = Security._setHstsEnabled(self)
self.getIpFwSettings = Security._getIpFwSettings(self)
self.setIpFwSettings = Security._setIpFwSettings(self)
self.getIpV6FwSettings = Security._getIpV6FwSettings(self)
self.setIpV6FwSettings = Security._setIpV6FwSettings(self)
self.getRoleAccessControlSettings = Security._getRoleAccessControlSettings(self)
self.setRoleAccessControlSettings = Security._setRoleAccessControlSettings(self)
self.getRoleAccessControlSettingsV6 = Security._getRoleAccessControlSettingsV6(self)
self.setRoleAccessControlSettingsV6 = Security._setRoleAccessControlSettingsV6(self)
self.getBlockSettings = Security._getBlockSettings(self)
self.setBlockSettings = Security._setBlockSettings(self)
self.getPwSettings = Security._getPwSettings(self)
self.setPwSettings = Security._setPwSettings(self)
self.getIdleTimeoutSettings = Security._getIdleTimeoutSettings(self)
self.setIdleTimeoutSettings = Security._setIdleTimeoutSettings(self)
self.getSingleLoginLimitation = Security._getSingleLoginLimitation(self)
self.setSingleLoginLimitation = Security._setSingleLoginLimitation(self)
self.getSSHSettings = Security._getSSHSettings(self)
self.setSSHSettings = Security._setSSHSettings(self)
self.getSSHHostKeys = Security._getSSHHostKeys(self)
self.getRestrictedServiceAgreement = Security._getRestrictedServiceAgreement(self)
self.setRestrictedServiceAgreement = Security._setRestrictedServiceAgreement(self)
self.getSupportedFrontPanelPrivileges = Security._getSupportedFrontPanelPrivileges(self)
self.getFrontPanelPrivileges = Security._getFrontPanelPrivileges(self)
self.setFrontPanelPrivileges = Security._setFrontPanelPrivileges(self)
|