Skip to content

Please log the current logged user when denying access #2

@Feandil

Description

@Feandil

The current code logs things like this:

2014-01-22 23:04:20.467Z - INFO [InitSecurityContext] - Connection from .....
2014-01-22 23:04:20.475Z - INFO [BasePAPOperation] - Insufficient privileges to perform operation 'GetPoliciesForPAPOperation'
2014-01-22 23:04:20.475Z - ERROR [ProvisioningService] - Insufficient privileges to perform operation 'GetPoliciesForPAPOperation'.

When more than one user is connected, there is no way to know which one is denied. Looking in the code, the function that should be modified is in src/main/java/org/glite/authz/pap/authz/BasePAPOperation.java:

    public final T execute() {

        logOperation();

        if ( !isAllowed() ) {

            log.info( "Insufficient privileges to perform operation '"
                    + getName() + "'" );

            throw new PAPAuthzException(
                    "Insufficient privileges to perform operation '"
                            + getName() + "'." );
        }

        return doExecute();
    }

As far as I understand the code (not really ...), the current logged user could be obtained via 'CurrentAdmin admin = CurrentAdmin.instance();' or directly something like what is in CurrentAdmin (SecurityContext theContext = SecurityContext.getCurrentContext(); String adminDN = theContext.getClientName();)'. I don't know how to format correctly the output...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions