def test_valid_certs(self):
"""
Verify authenticate succeeds when cn matches, fails when it doesn't
"""
self.expect_forbidden(data=self.cert, cn="other-cn")
auth = httpauthclientcert.HTTPClientCertAuth(cn="system:master-proxy")
req = falcon.Request(create_environ())
req.env[SSL_CLIENT_VERIFY] = self.cert
resp = falcon.Response()
self.assertEqual(None, auth.authenticate(req, resp))
# With no cn any is valid
auth = httpauthclientcert.HTTPClientCertAuth()
req = falcon.Request(create_environ())
req.env[SSL_CLIENT_VERIFY] = self.cert
resp = falcon.Response()
self.assertEqual(None, auth.authenticate(req, resp))
test_authenticator_httpbasicauth.py 文件源码
python
阅读 16
收藏 0
点赞 0
评论 0
评论列表
文章目录