Get Action of the request from request_rec

satheesh
satheesh
Hi All, Is there any built-in method is there to get actual Action(checkout, export, get-dir, update or delete) of the request from the request_rec. I have to differentiate the delete request from the propset(svn custom property) request. Thanks...

Last updated

satheesh
satheesh
Can anyone please tell me to get the actual action of the request....
orbrey
orbrey
Hi, I assume this is a follow on from your other thread, so what you're looking for is a way for Subversion to log the specific action? If so you have what was discussed in the previous thread, there's also the commit messages that you could parse to get the action taken?
satheesh
satheesh
Hi, This is for allowing/blocking(not for logging) the specific action in apache, as we have to allow the delete action only from specific svn client tool(by using user-agent)... not for all clients. How do we allow svn delete operation only for specific client. We are able get the user-agent from request_rec structure. If we allow DELETE method(for delete we have to allow M_DELETE,M_PROPPATCH and M_MERGE), then svn propset(both revision and version) also allowed. How to restrict this ? Thanks....
orbrey
orbrey
I was looking at pre-commit hook script examples to see if there's a way of doing this and I suspect there will be, but deletes are problematic. If you prevent someone from deleting you also prevent them from moving files (as that's the same as a copy file then a delete of the original), however they can delete the contents of a file and commit it empty which would have the same effect. Would you be able to specify read only access for these people, and if they need to submit code have them create a patch file which could then be reviewed and committed by a more senior developer?
satheesh
satheesh
Hi, What we supposed to do is to allow the delete operation for specific client tool only like TortoiseSVN(not for specific user) by using User-Agent and need to block the same for all other client tools. Is it possible to differentiate the client tool in pre-commit hook ?
orbrey
orbrey
It's not, no - the commit hooks receive environment variables and the command-line commands (and perameters) that were run, there's no information about the client there.
satheesh
satheesh
Hi, we have to differentiate the svn delete operations from all other request in Apache. So that we can allow/block the operations based on the user-agent of client tool. Is it possible to differentiate the delete operation(delete requests from all other requests) in Apache ?
orbrey
orbrey
Yes, as I said the svn commands that are run are passed to the commit hooks so that would be possible :)
satheesh
satheesh
What about [QUOTE=satheesh;169011]What we supposed to do is to allow the delete operation for specific client tool only like TortoiseSVN(not for specific user) by using User-Agent and need to block the same for all other client tools. [/QUOTE] Is it possible ? this is what exactly we want...
orbrey
orbrey
As I said before: [QUOTE]It's not, no - the commit hooks receive environment variables and the command-line commands (and perameters) that were run, there's no information about the client there.[/QUOTE] You could do it based on the command that's run - that information is sent to the hook scripts. You can't do it based on client though, because that information isn't sent to the hook scripts.
satheesh
satheesh
I'm not talking about only hook scripts, any possible way in Apache modules.
orbrey
orbrey
Ah, beg pardon. Yes, that's possible, though bear in mind it's possible to spoof that information.

1-13 of 13

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.

Post a reply
3199 views