The pattern can contain IPv4 and IPv6 addresses (including IPv6 wrapped IPv4 addresses).
또한 보기: http://tools.ietf.org/html/rfc4632
또한 보기: http://tools.ietf.org/html/rfc4291#section-2.3 Example: 127.0.0.0/24 will match all IP addresses from 127.0.0.0 to 127.0.0.255 127.0.0.0/31 and 127.0.0.1/31 will both match the IP addresses 127.0.0.0 and 127.0.0.1 127.0.0.254/31 and 127.0.0.255/31 will both match the IP addresses 127.0.0.254 and 127.0.0.255 1:2::3:4 will match the IPv6 address written as 1:2:0:0:0:0:3:4 or 1:2::3:4 ::7F00:1 will match the address written as 127.0.0.1, ::127.0.0.1 or ::7F00:1 ::1 (IPv6 loopback) will *not* match the address 127.0.0.1
상속: implements Neos\Flow\Security\RequestPatternInterface
예제 #1
0
 /**
  * @dataProvider validAndInvalidIpPatterns
  * @test
  */
 public function requestMatchingBasicallyWorks($pattern, $ip, $expected)
 {
     $requestMock = $this->getMockBuilder(Request::class)->disableOriginalConstructor()->setMethods(array('getClientIpAddress'))->getMock();
     $requestMock->expects($this->once())->method('getClientIpAddress')->will($this->returnValue($ip));
     $actionRequestMock = $this->getMockBuilder(ActionRequest::class)->disableOriginalConstructor()->getMock();
     $actionRequestMock->expects($this->any())->method('getHttpRequest')->will($this->returnValue($requestMock));
     $requestPattern = new Ip(['cidrPattern' => $pattern]);
     $this->assertEquals($expected, $requestPattern->matchRequest($actionRequestMock));
 }