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)
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)
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)
def authenticate(self): status = auth.authority_authenticate(self.authority) if status: raise AuthError(status)
def set_ticket(self, ticket): status = auth.authority_set_ticket(self.authority, ticket.ticket) if status: raise AuthError(status)
def get_ticket(self): status, ticket = auth.authority_get_ticket(self.authority) if status: raise AuthError(status) return Ticket(ticket)
def authenticate(auth_data, password): status = auth.authenticate(auth_data, password) if status: raise AuthError(status)
def get_ticket(self, user): status, ticket = auth.wicket_get_ticket(self.wicket, user) if status: raise AuthError(status) return Ticket(ticket)
def set_secret(self, secret): status = auth.ticket_set_secret(self.ticket, secret.secret) if status: raise AuthError(status)