========
Kerberos authentication for Twisted
```python
import os
import sys
from twisted.cred.portal import IRealm, Portal
from twisted.internet import reactor
from twisted.python import log
from twisted.web import server
from twisted.web.guard import HTTPAuthSessionWrapper, BasicCredentialFactory
from twisted.web.resource import IResource, Resource
from zope.interface import implements
import authkerb
class Simple(Resource):
isLeaf = True
def render_GET(self, request):
return '<html>Hello, world!</html>'
class Realm(object):
implements(IRealm)
def requestAvatar(self, avatarId, mind, *interfaces):
if IResource in interfaces:
return (IResource, Simple(), lambda: None)
raise NotImplementedError()
os.environ['KRB5_KTNAME'] = '/path/to/keytab'
log.startLogging(sys.stdout)
negotiateChecker = authkerb.NegotiateCredentialsChecker()
basicChecker = authkerb.BasicCredentialsChecker('HTTP/example.org', 'EXAMPLE.ORG')
portal = Portal(Realm(), [negotiateChecker, basicChecker])
negotiateFactory = authkerb.NegotiateCredentialFactory('HTTP')
basicFactory = BasicCredentialFactory('realm')
resource = HTTPAuthSessionWrapper(portal, [negotiateFactory, basicFactory])
site = server.Site(resource)
reactor.listenTCP(8080, site)
reactor.run()
```
Metadata
Release files for authkerb 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| authkerb-0.1.tar.gz | 2.9 kB | Without provenance | Details for authkerb-0.1.tar.gz |
Release files / authkerb-0.1.tar.gz
| Download URL | authkerb-0.1.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f68f78dcddf26b456679b6ce1ccf1b774be05e2ff4752efe292b5f43d770fbbd
|
|
BLAKE2b-256 checksum How to use checksums |
b74c412a8c2eb8a092e1ebf1ee7b141791cfb3c05ff951cfe209eb8df82777ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for authkerb 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.