~divmod-dev/divmod.org/1304710-storeless-adapter

« back to all changes in this revision

Viewing changes to Vertex/vertex/ivertex.py

  • Committer: cyli
  • Date: 2013-06-27 06:02:46 UTC
  • mto: This revision was merged to the branch mainline in revision 2702.
  • Revision ID: cyli-20130627060246-ciict8hwvjuy9d81
Move Vertex out of the Divmod.org repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2005 Divmod, Inc.  See LICENSE file for details
2
 
 
3
 
from zope.interface import Interface
4
 
 
5
 
class IQ2QTransport(Interface):
6
 
    """
7
 
    I am a byte-stream-oriented transport which has Q2Q identifiers associated
8
 
    with the endpoints, and possibly some cryptographic verification of the
9
 
    authenticity of those endpoints.
10
 
    """
11
 
 
12
 
    def getQ2QHost():
13
 
        """ Returns a Q2QAddress object representing the user on this end of the
14
 
        connection.
15
 
        """
16
 
 
17
 
    def getQ2QPeer():
18
 
        """ Returns a Q2QAddress object representing the user on the other end of the
19
 
        connection.
20
 
        """
21
 
 
22
 
class IQ2QUser(Interface):
23
 
    """
24
 
    A cred interface for Q2Q users.
25
 
    """
26
 
    def signCertificateRequest(certificateRequest, domainCert, suggestedSerial):
27
 
        """
28
 
        Return a signed certificate object if the subject fields in the
29
 
        certificateRequest are valid.
30
 
        """
31
 
 
32
 
class IFileTransfer(Interface):
33
 
 
34
 
    def getUploadSink(self, path):
35
 
        """
36
 
        @param path: a PathFragment that the client wishes to upload to.
37
 
 
38
 
        @return: a DataSink where we'll save the data to.
39
 
        """
40
 
 
41
 
    def getDownloadSource(self, path):
42
 
        """
43
 
        @param path: a PathFragment that the client wishes to download.
44
 
 
45
 
        @return: a DataSource to download data from.
46
 
        """
47
 
 
48
 
    def listChildren(self, path):
49
 
        """
50
 
        @param path: a PathFragment that the client wishes to get a list of.
51
 
 
52
 
        @return: a list of dictionaries mapping::
53
 
            {'name': str,
54
 
             'size': int,
55
 
             'type': vertex.filexfer.MIMEType,
56
 
             'modified': datetime.datetime}
57
 
        """
58
 
 
59
 
class ISessionTokenStorage(Interface):
60
 
    def idFromCookie(self, cookie, domain):
61
 
        """Look up a user ID from the given cookie in the given domain.
62
 
        """
63
 
 
64
 
class ICertificateStorage(Interface):
65
 
    def getSelfSignedCertificate(self, domainName):
66
 
        """
67
 
        @return: a Deferred which will fire with the certificate for the given
68
 
        domain name.
69
 
        """
70
 
 
71
 
    def storeSelfSignedCertificate(self, domainName, mainCert):
72
 
        """
73
 
        @type mainCert: C{str}
74
 
        @param mainCert: Serialized, self-signed certificate to associate
75
 
        with the given domain.
76
 
 
77
 
        @return: a Deferred which will fire when the certificate has been
78
 
        stored successfully.
79
 
        """
80
 
 
81
 
    def getPrivateCertificate(self, domainName):
82
 
        """
83
 
        @return: a PrivateCertificate instance, e.g. a certificate including a
84
 
        private key, for 'domainName'.
85
 
        """
86
 
 
87
 
    def addPrivateCertificate(self, domainName, existingCertificate=None):
88
 
        """
89
 
        """
90
 
 
91
 
class IOfferUp(Interface):
92
 
    """
93
 
    Sharing control database storage.
94
 
    """
95
 
 
96
 
class IPlugin(Interface):
97
 
    """
98
 
    """
99
 
 
100
 
class ITestPlugin(Interface):
101
 
    """
102
 
    Dummy plug-in interface for unit testing.
103
 
    """
104
 
 
105
 
class ITestPlugin2(Interface):
106
 
    """
107
 
    Dummy plug-in interface for unit testing.
108
 
    """