ProxyDB

ProxyRepository class is a front-end to the proxy repository Database

class DIRAC.FrameworkSystem.DB.ProxyDB.ProxyDB(useMyProxy=False)

Bases: DIRAC.Core.Base.DB.DB

class ConnectionPool(host, user, passwd, port=3306, graceTime=600)

Bases: object

Management of connections per thread

__init__(host, user, passwd, port=3306, graceTime=600)

x.__init__(…) initializes x; see help(type(x)) for signature

clean(now=False)
get(dbName, retries=10)
transactionCommit(dbName)
transactionRollback(dbName)
transactionStart(dbName)
NOTIFICATION_TIMES = [2592000, 1296000]
__init__(useMyProxy=False)

set MySQL connection parameters and try to connect

buildCondition(condDict=None, older=None, newer=None, timeStamp=None, orderAttribute=None, limit=False, greater=None, smaller=None, offset=None)

Build SQL condition statement from provided condDict and other extra check on a specified time stamp. The conditions dictionary specifies for each attribute one or a List of possible values greater and smaller are dictionaries in which the keys are the names of the fields, that are requested to be >= or < than the corresponding value. For compatibility with current usage it uses Exceptions to exit in case of invalid arguments

completeDelegation(requestId, userDN, delegatedPem)

Complete a delegation and store it in the db

countEntries(table, condDict, older=None, newer=None, timeStamp=None, connection=False, greater=None, smaller=None)

Count the number of entries wit the given conditions

deleteEntries(tableName, condDict=None, limit=False, conn=None, older=None, newer=None, timeStamp=None, orderAttribute=None, greater=None, smaller=None)

Delete rows from “tableName” with N records can match the condition if limit is not False, the given limit is set String type values will be appropriately escaped, they can be single values or lists of values.

deleteProxy(userDN, userGroup='any')

Remove proxy of the given user from the repository

deleteRequest(requestId)

Delete a request from the db

executeStoredProcedure(packageName, parameters, outputIds)
executeStoredProcedureWithCursor(packageName, parameters)
generateDelegationRequest(proxyChain, userDN)

Generate a request and store it for a given proxy Chain

generateToken(requesterDN, requesterGroup, numUses=1, lifeTime=0, retries=10)

Generate and return a token and the number of uses for the token

getCSOption(optionName, defaultValue=None)
getCounters(table, attrList, condDict, older=None, newer=None, timeStamp=None, connection=False, greater=None, smaller=None)

Count the number of records on each distinct combination of AttrList, selected with condition defined by condDict and time stamps

getCredentialsAboutToExpire(requiredSecondsLeft, onlyPersistent=True)
getDistinctAttributeValues(table, attribute, condDict=None, older=None, newer=None, timeStamp=None, connection=False, greater=None, smaller=None)

Get distinct values of a table attribute under specified conditions

getFields(tableName, outFields=None, condDict=None, limit=False, conn=None, older=None, newer=None, timeStamp=None, orderAttribute=None, greater=None, smaller=None)

Select “outFields” from “tableName” with condDict N records can match the condition return S_OK( tuple(Field,Value) ) if outFields is None all fields in “tableName” are returned if limit is not False, the given limit is set inValues are properly escaped using the _escape_string method, they can be single values or lists of values.

getFromAddr()

Get the From address to use in proxy expiry e-mails.

getLogsContent(selDict, sortList, start=0, limit=0)
Function to get the contents of the logs table
parameters are a filter to the db
getMyProxyMaxLifeTime()
getMyProxyServer()
getProxiesContent(selDict, sortList, start=0, limit=0)
Function to get the contents of the db
parameters are a filter to the db
getProxy(userDN, userGroup, requiredLifeTime=False)

Get proxy string from the Proxy Repository for use with userDN in the userGroup

getRemainingTime(userDN, userGroup)

Returns the remaining time the proxy is valid

getUsers(validSecondsLeft=0, dnMask=False, groupMask=False, userMask=False)

Get all the distinct users from the Proxy Repository. Optionally, only users with valid proxies within the given validity period expressed in seconds

getVOMSProxy(userDN, userGroup, requiredLifeTime=False, requestedVOMSAttr=False)

Get proxy string from the Proxy Repository for use with userDN in the userGroup and VOMS attr

insertFields(tableName, inFields=None, inValues=None, conn=None, inDict=None)

Insert a new row in “tableName” assigning the values “inValues” to the fields “inFields”. String type values will be appropriately escaped.

logAction(action, issuerDN, issuerGroup, targetDN, targetGroup)

Add an action to the log

purgeExpiredProxies(sendNotifications=True)

Purge expired requests from the db

purgeExpiredRequests()

Purge expired requests from the db

purgeExpiredTokens()
purgeLogs()

Purge expired requests from the db

renewFromMyProxy(userDN, userGroup, lifeTime=False, chain=False)
retrieveDelegationRequest(requestId, userDN)

Retrieve a request from the DB

sendExpirationNotifications()
setPersistencyFlag(userDN, userGroup, persistent=True)

Set the proxy PersistentFlag to the flag value

storeProxy(userDN, userGroup, chain)

Store user proxy into the Proxy repository for a user specified by his DN and group.

transactionCommit()
transactionRollback()
transactionStart()
updateFields(tableName, updateFields=None, updateValues=None, condDict=None, limit=False, conn=None, updateDict=None, older=None, newer=None, timeStamp=None, orderAttribute=None, greater=None, smaller=None)

Update “updateFields” from “tableName” with “updateValues”. updateDict alternative way to provide the updateFields and updateValues N records can match the condition return S_OK( number of updated rows ) if limit is not False, the given limit is set String type values will be appropriately escaped.

useToken(token, requesterDN, requesterGroup)