Beispiel #1
0
 def __init__(self, authority=None):
     if isinstance(authority, auth.AuthorityType):
         self.authority = authority
     else:
         self.authority = auth.AuthorityType()
         self.__owner = True
         status = auth.authority_create(self.authority)
         if status:
             raise AuthError(status)
Beispiel #2
0
 def __init__(self, ticket=None):
     if isinstance(ticket, auth.TicketType):
         self.ticket = ticket
     else:
         self.ticket = auth.TicketType()
         self.__owner = True
         status = auth.ticket_create(self.ticket)
         if status:
             raise AuthError(status)
Beispiel #3
0
def register_module(name=None):
    if name == None:
        status = auth.register_module()
    elif isinstance (name, types.TupleType) \
      or isinstance (name, types.ListType):
        for n in name:
            status = auth.register_module(n)
    else:
        status = auth.register_module(name)
    if status:
        raise AuthError(status)
Beispiel #4
0
 def authenticate(self):
     status = auth.authority_authenticate(self.authority)
     if status:
         raise AuthError(status)
Beispiel #5
0
 def set_ticket(self, ticket):
     status = auth.authority_set_ticket(self.authority, ticket.ticket)
     if status:
         raise AuthError(status)
Beispiel #6
0
 def get_ticket(self):
     status, ticket = auth.authority_get_ticket(self.authority)
     if status:
         raise AuthError(status)
     return Ticket(ticket)
Beispiel #7
0
def authenticate(auth_data, password):
    status = auth.authenticate(auth_data, password)
    if status:
        raise AuthError(status)
Beispiel #8
0
 def get_ticket(self, user):
     status, ticket = auth.wicket_get_ticket(self.wicket, user)
     if status:
         raise AuthError(status)
     return Ticket(ticket)
Beispiel #9
0
 def set_secret(self, secret):
     status = auth.ticket_set_secret(self.ticket, secret.secret)
     if status:
         raise AuthError(status)