def get_auth_token_gss(account, gsscred, appid, ip=None, vo='def'):
    """
    Authenticate a Rucio account temporarily via a GSS token.

    The tokens lifetime is 1 hour.

    :param account: Account identifier as a string.
    :param gsscred: GSS principal@REALM as a string.
    :param appid: The application identifier as a string.
    :param ip: IP address of the client as a string.
    :param vo: The VO to act on.

    :returns: A models.Token object as saved to the database.
    """

    kwargs = {'account': account, 'gsscred': gsscred}
    if not permission.has_permission(
            issuer=account, vo=vo, action='get_auth_token_gss', kwargs=kwargs):
        raise exception.AccessDenied(
            'User with identity %s can not log to account %s' %
            (gsscred, account))

    account = InternalAccount(account, vo=vo)

    return authentication.get_auth_token_gss(account, gsscred, appid, ip)
Example #2
0
def get_auth_token_gss(account, gsscred, appid, ip=None):
    """
    Authenticate a Rucio account temporarily via a GSS token.

    The tokens lifetime is 1 hour.

    :param account: Account identifier as a string.
    :param gsscred: GSS principal@REALM as a string.
    :param appid: The application identifier as a string.
    :param ip: IP address of the client as a string.
    :returns: Authentication token as a variable-length string.
    """

    kwargs = {'account': account, 'gsscred': gsscred}
    if not permission.has_permission(issuer=account, action='get_auth_token_gss', kwargs=kwargs):
        raise exception.AccessDenied('User with identity %s can not log to account %s' % (gsscred, account))

    return authentication.get_auth_token_gss(account, gsscred, appid, ip)
Example #3
0
def get_auth_token_gss(account, gsscred, appid, ip=None):
    """
    Authenticate a Rucio account temporarily via a GSS token.

    The tokens lifetime is 1 hour.

    :param account: Account identifier as a string.
    :param gsscred: GSS principal@REALM as a string.
    :param appid: The application identifier as a string.
    :param ip: IP address of the client as a string.
    :returns: Authentication token as a variable-length string.
    """

    kwargs = {'account': account, 'gsscred': gsscred}
    if not permission.has_permission(issuer=account, action='get_auth_token_gss', kwargs=kwargs):
        raise exception.AccessDenied('User with identity %s can not log to account %s' % (gsscred, account))

    return authentication.get_auth_token_gss(account, gsscred, appid, ip)