Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
MECLIPSE-1066: Added flag to core, that is set in request context whe…
Browse files Browse the repository at this point in the history
…n performing an auth check (rather than actually retreiving something)

git-svn-id: file:///opt/svn/repositories/sonatype.org/nexus/trunk/nexus@6429 2aa8b3fc-8ebb-4439-a84f-95066eaea8ab
  • Loading branch information
dbradicich committed May 12, 2010
1 parent 1f6c55b commit 1b851be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Expand Up @@ -31,6 +31,11 @@ public class RequestContext

/** Context key for condition "if-none-match" */
public static final String CTX_CONDITION_IF_NONE_MATCH = "request.condition.ifNoneMatch";

/** Context key to mark request as used for auth check only, so repo impl will know there is no
* work required (i.e. interpolation, etc.)
*/
public static final String CTX_AUTH_CHECK_ONLY = "request.auth.check.only";

private RequestContext parent;

Expand Down
Expand Up @@ -23,6 +23,7 @@
import org.jsecurity.web.WebUtils;
import org.sonatype.nexus.proxy.AccessDeniedException;
import org.sonatype.nexus.proxy.ItemNotFoundException;
import org.sonatype.nexus.proxy.RequestContext;
import org.sonatype.nexus.proxy.ResourceStoreRequest;
import org.sonatype.nexus.proxy.access.Action;

Expand Down Expand Up @@ -88,7 +89,11 @@ public String getResourceStorePath( ServletRequest request )

protected ResourceStoreRequest getResourceStoreRequest( ServletRequest request, boolean localOnly )
{
return new ResourceStoreRequest( getResourceStorePath( request ), localOnly );
ResourceStoreRequest rsr = new ResourceStoreRequest( getResourceStorePath( request ), localOnly );

rsr.getRequestContext().put( RequestContext.CTX_AUTH_CHECK_ONLY, true );

return rsr;
}

@Override
Expand Down

0 comments on commit 1b851be

Please sign in to comment.