|
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # # Copyright Buildbot Team Members
except ImportError: # For Python 2.4 import sha
""" Take a Change author and source and translate them into a User Object, storing the user in master.db, or returning None if the src is not specified.
@param master: link to Buildmaster for database operations @type master: master.Buildmaster instance
@param authors: Change author if string or Authz instance @type authors: string or status.web.authz instance
@param src: source from which the User Object will be created @type src: string """
author)) else:
identifier=usdict['identifier'], attr_type=usdict['attr_type'], attr_data=usdict['attr_data'])
""" This is a simple getter function that returns a user attribute that matches the contact_type argument, or returns None if no uid/match is found.
@param master: BuildMaster used to query the database @type master: BuildMaster instance
@param contact_type: type of contact attribute to look for in in a given user, such as 'email' or 'nick' @type contact_type: string
@param uid: user that is searched for the contact_type match @type uid: integer
@returns: string of contact information or None via deferred """
""" Encrypts the incoming password after adding some salt to store it in the database.
@param passwd: password portion of user credentials @type passwd: string
@returns: encrypted/salted string """ except TypeError: m = sha.new()
""" Tests to see if the guess, after salting and hashing, matches the passwd from the database.
@param guess: incoming password trying to be used for authentication @param passwd: already encrypted password from the database
@returns: boolean """ except TypeError: m = sha.new()
|