Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
A token which verifies that can be used to authorize a specific user.

src/c/r/crtauth-HEAD/crtauth/server.py   crtauth(Download)
    def _make_token(self, username, expire_time):
        t = protocol.Token(username=username,
                           valid_from=int(self.now_func() - CLOCK_FUDGE),
                           valid_to=expire_time)
 

src/c/r/crtauth-HEAD/test/protocol_test.py   crtauth(Download)
 
ref_token = protocol.Token(
    valid_from=1365084334, valid_to=1365084634, username="noa")
 
 
def test_serialize_token_binary():
    token = protocol.Token(valid_from=1365084334, valid_to=1365084634,
                           username="noa")
    buf = protocol.Token.serialize(token)
    assert buf == "t\x00\x00\x00Q]\x88\xaeQ]\x89\xda\x00\x00\x00\x03noa\x00"